From: <ah...@us...> - 2012-09-26 16:51:54
|
Revision: 13449 http://jvcl.svn.sourceforge.net/jvcl/?rev=13449&view=rev Author: ahuser Date: 2012-09-26 16:51:47 +0000 (Wed, 26 Sep 2012) Log Message: ----------- Mantis #5917: JvGnugettext TranslateStrings Clear has side effects Modified Paths: -------------- trunk/jvcl/run/JvGnugettext.pas Modified: trunk/jvcl/run/JvGnugettext.pas =================================================================== --- trunk/jvcl/run/JvGnugettext.pas 2012-09-25 08:05:34 UTC (rev 13448) +++ trunk/jvcl/run/JvGnugettext.pas 2012-09-26 16:51:47 UTC (rev 13449) @@ -93,6 +93,10 @@ // Delphi 2009 with Unicode {$DEFINE DELPHI2009OROLDER} {$endif} +{$ifdef VER210} + // Delphi 2010 with Unicode + {$DEFINE DELPHI2010OROLDER} +{$endif} {$ifdef VER220} // Delphi 2011 with Unicode {$DEFINE DELPHI2011OROLDER} @@ -2151,6 +2155,12 @@ end; {$endif} try + // Fix for Mantis #5917. TStringList doesn't release the objects in PutObject, so we + // use this to get sl.Clear to not destroy the objects in classes that inherit from + // TStringList but do a ClearObject in Clear. + if (sl.ClassType <> TStringList) and (sl is TStringList) then + for I := 0 to sl.Count do + sl.Objects[I] := nil; // same here, we don't want to modify the properties of the orignal string list sl.Clear; sl.AddStrings(s); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |