From: <ah...@us...> - 2009-03-23 21:09:07
|
Revision: 12257 http://jvcl.svn.sourceforge.net/jvcl/?rev=12257&view=rev Author: ahuser Date: 2009-03-23 21:08:54 +0000 (Mon, 23 Mar 2009) Log Message: ----------- Added checks for empty strings Modified Paths: -------------- trunk/jvcl/run/JvDBTreeView.pas trunk/jvcl/run/JvListView.pas trunk/jvcl/run/JvStringGrid.pas Modified: trunk/jvcl/run/JvDBTreeView.pas =================================================================== --- trunk/jvcl/run/JvDBTreeView.pas 2009-03-22 23:46:27 UTC (rev 12256) +++ trunk/jvcl/run/JvDBTreeView.pas 2009-03-23 21:08:54 UTC (rev 12257) @@ -1486,7 +1486,8 @@ begin FMastersStream.Read(strLength, SizeOf(strLength)); SetLength(temp, strLength); - FMastersStream.Read(temp[1], strLength * SizeOf(Char)); // internally used stream + if strLength > 0 then + FMastersStream.Read(temp[1], strLength * SizeOf(Char)); // internally used stream TJvDBTreeNode(Node).SetMasterValue(temp); FMastersStream.Read(HasChildren, SizeOf(HasChildren)); Node.HasChildren := HasChildren <> 0; @@ -1514,9 +1515,10 @@ begin // save MasterValue as string temp := VarToStr(TJvDBTreeNode(Node).MasterValue); - strLength := length(temp); + strLength := Length(temp); FMastersStream.Write(strLength, SizeOf(strLength)); - FMastersStream.Write(temp[1], strLength * SizeOf(Char)); // internally used stream + if strLength > 0 then + FMastersStream.Write(temp[1], strLength * SizeOf(Char)); // internally used stream HasChildren := Byte(Node.HasChildren); FMastersStream.Write(HasChildren, SizeOf(HasChildren)); Node := Node.GetNext; Modified: trunk/jvcl/run/JvListView.pas =================================================================== --- trunk/jvcl/run/JvListView.pas 2009-03-22 23:46:27 UTC (rev 12256) +++ trunk/jvcl/run/JvListView.pas 2009-03-23 21:08:54 UTC (rev 12257) @@ -965,7 +965,6 @@ const cLISTVIEW01 = 'LISTVIEW01'; // 10 chars - cLISTVIEW02 = 'LISTVIEW01'; // 10 chars constructor TJvListView.Create(AOwner: TComponent); begin Modified: trunk/jvcl/run/JvStringGrid.pas =================================================================== --- trunk/jvcl/run/JvStringGrid.pas 2009-03-22 23:46:27 UTC (rev 12256) +++ trunk/jvcl/run/JvStringGrid.pas 2009-03-23 21:08:54 UTC (rev 12257) @@ -10,8 +10,8 @@ The Original Code is: JvStringGrid.PAS, released on 2001-02-28. -The Initial Developer of the Original Code is S?stien Buysse [sbuysse att buypin dott com] -Portions created by S?stien Buysse are Copyright (C) 2001 S?stien Buysse. +The Initial Developer of the Original Code is Sebastien Buysse [sbuysse att buypin dott com] +Portions created by Sebastien Buysse are Copyright (C) 2001 S?stien Buysse. All Rights Reserved. Contributor(s): Michael Beck [mbeck att bigfoot dott com]. @@ -892,7 +892,8 @@ else Bytes[K] := Byte(St[K + 1]); {$ENDIF} - Stream.Write(Bytes[0], Len); + if Len > 0 then + Stream.Write(Bytes[0], Len); if J <> ColCount - 1 then Stream.Write(A, 1); end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |