Explorar o código

* Fix bug #26717

git-svn-id: trunk@28659 -
michael %!s(int64=11) %!d(string=hai) anos
pai
achega
beafc9fe8c
Modificáronse 2 ficheiros con 25 adicións e 4 borrados
  1. 6 3
      rtl/objpas/classes/classesh.inc
  2. 19 1
      rtl/objpas/classes/stringl.inc

+ 6 - 3
rtl/objpas/classes/classesh.inc

@@ -623,6 +623,9 @@ type
     procedure SetNameValueSeparator(c:Char);
     procedure WriteData(Writer: TWriter);
     procedure DoSetTextStr(const Value: string; DoClear : Boolean);
+    Function GetDelimiter : Char;
+    Function GetNameValueSeparator : Char;
+    Function GetQuoteChar: Char;
   protected
     procedure DefineProperties(Filer: TFiler); override;
     procedure Error(const Msg: string; Data: Integer);
@@ -677,11 +680,11 @@ type
     procedure GetNameValue(Index : Integer; Out AName,AValue : String);
     function  ExtractName(Const S:String):String;
     Property TextLineBreakStyle : TTextLineBreakStyle Read GetLBS Write SetLBS;
-    property Delimiter: Char read FDelimiter write SetDelimiter;
+    property Delimiter: Char read GetDelimiter write SetDelimiter;
     property DelimitedText: string read GetDelimitedText write SetDelimitedText;
     Property StrictDelimiter : Boolean Read FStrictDelimiter Write FStrictDelimiter;
-    property QuoteChar: Char read FQuoteChar write SetQuoteChar;
-    Property NameValueSeparator : Char Read FNameValueSeparator Write SetNameValueSeparator;
+    property QuoteChar: Char read GetQuoteChar write SetQuoteChar;
+    Property NameValueSeparator : Char Read GetNameValueSeparator Write SetNameValueSeparator;
     property ValueFromIndex[Index: Integer]: string read GetValueFromIndex write SetValueFromIndex;
     property Capacity: Integer read GetCapacity write SetCapacity;
     property CommaText: string read GetCommaText write SetCommaText;

+ 19 - 1
rtl/objpas/classes/stringl.inc

@@ -74,8 +74,8 @@ begin
     FQuoteChar:='"';
     FDelimiter:=',';
     FNameValueSeparator:='=';
-    FSpecialCharsInited:=true;
     FLBS:=DefaultTextLineBreakStyle;
+    FSpecialCharsInited:=true;
     end;
 end;
 
@@ -97,6 +97,12 @@ begin
   FDelimiter:=c;
 end;
 
+Function TStrings.GetDelimiter : Char;
+begin
+  CheckSpecialChars;
+  Result:=FDelimiter;
+end;
+
 
 procedure TStrings.SetQuoteChar(c:Char);
 begin
@@ -104,12 +110,24 @@ begin
   FQuoteChar:=c;
 end;
 
+Function TStrings.GetQuoteChar :Char;
+begin
+  CheckSpecialChars;
+  Result:=FQuoteChar;
+end;
+
 procedure TStrings.SetNameValueSeparator(c:Char);
 begin
   CheckSpecialChars;
   FNameValueSeparator:=c;
 end;
 
+Function TStrings.GetNameValueSeparator :Char;
+begin
+  CheckSpecialChars;
+  Result:=FNameValueSeparator;
+end;
+
 
 function TStrings.GetCommaText: string;