Pārlūkot izejas kodu

* Patch from LacaK2 to improve decimalpoint localisation. (Mantis 18338)

git-svn-id: trunk@16653 -
marco 14 gadi atpakaļ
vecāks
revīzija
ff2292aafa
1 mainītis faili ar 7 papildinājumiem un 8 dzēšanām
  1. 7 8
      rtl/objpas/fmtbcd.pp

+ 7 - 8
rtl/objpas/fmtbcd.pp

@@ -1202,7 +1202,7 @@ IMPLEMENTATION
       pack_BCD := True;
      end;
 
-  procedure SetDecimals ( var dp,
+  procedure SetDecimals ( out dp,
                               dc : Char );
 
     begin
@@ -1704,6 +1704,7 @@ IMPLEMENTATION
       l :  {$ifopt r+} 0..maxfmtbcdfractionsize + 1 + 1 {$else} Integer {$endif};
       i :  {$ifopt r+} low ( bh.FDig )..high ( bh.LDig ) {$else} Integer {$endif};
       pp : {$ifopt r+} low ( bh.FDig ) - 1..1 {$else} Integer {$endif};
+      dp, dc : Char;
 
     begin
 {$ifdef use_ansistring}
@@ -1712,6 +1713,7 @@ IMPLEMENTATION
       unpack_BCD ( BCD, bh );
       WITH bh do
         begin
+          SetDecimals ( dp, dc );
           l := 0;
           if Neg
             then begin
@@ -1742,9 +1744,9 @@ IMPLEMENTATION
                     then begin
 {$ifndef use_ansistring}
                       Inc ( l );
-                      result[l] := '.';
+                      result[l] := dp;
 {$else}
-                      result := result + '.';
+                      result := result + dp;
 {$endif}
                      end;
 {$ifndef use_ansistring}
@@ -3755,11 +3757,8 @@ end;
 
 function VarToBCD ( const aValue : Variant ) : tBCD;
   begin
-    if VarIsFmtBCD(aValue) then
-      Result:=TFMTBcdVarData(TVarData(aValue).vPointer).BCD
-    else
-      Result:=VariantToBCD(TVarData(aValue));
-   end;
+    Result:=VariantToBCD(TVarData(aValue));
+  end;
 
 
 constructor TFMTBcdVarData.create;