Browse Source

minor refactoring.

Ugochukwu Mmaduekwe 7 years ago
parent
commit
6a1f994957

+ 2 - 2
QRCodeGenLib/src/Include/QRCodeGenLib.inc

@@ -125,11 +125,11 @@
 {$WARN COMBINING_SIGNED_UNSIGNED64 OFF}
 {$ENDIF}
 
-{$IF DECLARED(FireMonkeyVersion)}
+{$IFDEF Framework_FMX}
 {$DEFINE FMX}
 {$ELSE}
 {$DEFINE VCL}
-{$IFEND}
+{$ENDIF}
 
 {$ENDIF DELPHI}
 

+ 6 - 3
QRCodeGenLib/src/QRCodeGen/QlpQrCode.pas

@@ -1084,12 +1084,15 @@ var
   LColumn, LRow: Int32;
   LBorder: Int64;
   LStringList: TStringList;
+  LForegroundColor, LBackgroundColor: String;
 begin
   if (ABorder < 0) then
   begin
     raise EArgumentInvalidQRCodeGenLibException.CreateRes(@SBorderNegative);
   end;
   LBorder := ABorder;
+  LForegroundColor := TColorToHTMLColorHex(FForegroundColor);
+  LBackgroundColor := TColorToHTMLColorHex(FBackgroundColor);
   LStringList := TStringList.Create;
   LStringList.LineBreak := '';
   try
@@ -1103,7 +1106,7 @@ begin
       [FSize + (LBorder * 2), (FSize + LBorder * 2), UNIX_NEW_LINE]));
     LStringList.Add
       (Format('%s<rect width="100%%" height="100%%" fill="#%s"/>%s',
-      [TAB, TColorToHTMLColorHex(FBackgroundColor), UNIX_NEW_LINE]));
+      [TAB, LBackgroundColor, UNIX_NEW_LINE]));
     LStringList.Add(Format('%s<path d="', [TAB]));
 
     for LColumn := 0 to System.Pred(FSize) do
@@ -1123,8 +1126,8 @@ begin
 
     end;
 
-    LStringList.Add(Format('" fill="#%s"/>%s',
-      [TColorToHTMLColorHex(FForegroundColor), UNIX_NEW_LINE]));
+    LStringList.Add(Format('" fill="#%s"/>%s', [LForegroundColor,
+      UNIX_NEW_LINE]));
     LStringList.Add(Format('</svg>%s', [UNIX_NEW_LINE]));
 
     Result := LStringList.Text;