diff --git a/inc/hgl/io/TextOutputStream.h b/inc/hgl/io/TextOutputStream.h index 20f838b..68e0522 100644 --- a/inc/hgl/io/TextOutputStream.h +++ b/inc/hgl/io/TextOutputStream.h @@ -123,7 +123,7 @@ namespace hgl for(int i=0;i &str=sl[i]; + const T &str=sl.GetString(i); const int len=str.Length(); diff --git a/inc/hgl/type/List.cpp b/inc/hgl/type/List.cpp index 72c9ae2..ed39490 100644 --- a/inc/hgl/type/List.cpp +++ b/inc/hgl/type/List.cpp @@ -19,7 +19,7 @@ namespace hgl template bool List::Begin(T &ti)const { - if(!items) + if(!items||count<=0) return(false); memcpy(&ti,items,sizeof(T)); @@ -29,7 +29,7 @@ namespace hgl template bool List::End(T &ti)const { - if(!items) + if(!items||count<=0) return(false); memcpy(&ti,items+count-1,sizeof(T)); diff --git a/inc/hgl/type/StringList.h b/inc/hgl/type/StringList.h index 70cffa0..1e94875 100644 --- a/inc/hgl/type/StringList.h +++ b/inc/hgl/type/StringList.h @@ -205,7 +205,7 @@ namespace hgl Items.Exchange(index1,index2); } - T &GetString(int n)const{return *(Items[n]);} ///<取得指定行字符串 + const T &GetString(int n)const{return *(Items[n]);} ///<取得指定行字符串 };//template class StringList template T StringList::NullString; ///<空字符串实例