diff --git a/components/tachart/tachartutils.pas b/components/tachart/tachartutils.pas index 8e6ef3c403..4446034693 100644 --- a/components/tachart/tachartutils.pas +++ b/components/tachart/tachartutils.pas @@ -236,7 +236,7 @@ type end; // An ordered set of integers represented as a comma-separated string - // for publushing as a single property. + // for publishing as a single property. TPublishedIntegerSet = object strict private FAllSet: Boolean; @@ -985,7 +985,15 @@ begin if AllSet then exit; sl := TStringList.Create; try - sl.CommaText := AValue; + if pos(',', AValue) > 0 then + sl.CommaText := AValue + else if pos(';', AValue) > 0 then begin + sl.Delimiter := ';'; + sl.DelimitedText := AValue; + end else if pos('|', AValue) > 0 then begin + sl.Delimiter := '|'; + sl.DelimitedText := AValue; + end; SetLength(FData, sl.Count); i := 0; for s in sl do diff --git a/components/tachart/test/UtilsTest.pas b/components/tachart/test/UtilsTest.pas index 35c47ee437..d22a74ac3f 100644 --- a/components/tachart/test/UtilsTest.pas +++ b/components/tachart/test/UtilsTest.pas @@ -445,6 +445,10 @@ begin AssertTrue(FISet.AllSet); FISet.AsString := '+'; AssertEquals(PUB_INT_SET_EMPTY, FISet.AsString); + FISet.AsString := '3 ;1;; 2'; + AssertEquals('3,1,2', FISet.AsString); + FISet.AsString := '3|1||2'; + AssertEquals('3,1,2', FISet.AsString); end; procedure TPublishedIntegerSetTest.TestIsSet; diff --git a/components/tachart/test/test.lpi b/components/tachart/test/test.lpi index 8ef8a6857d..b0007fe33e 100644 --- a/components/tachart/test/test.lpi +++ b/components/tachart/test/test.lpi @@ -1,7 +1,7 @@ - + - + @@ -18,7 +18,6 @@ - @@ -30,9 +29,10 @@ - - - + + + + @@ -43,27 +43,22 @@ - - - - - @@ -88,12 +83,6 @@ - - - - - -