[Lazarus] Typo in TFPCustomFont?

Reinier Olislagers reinierolislagers at gmail.com
Fri Jan 18 16:29:26 CET 2013


On 16-1-2013 16:12, Felipe Monteiro de Carvalho wrote:
> I fixed the spelling error in rev 23411 without deprecated

Perhaps the attached patch could be applied to fix the Lazarus issue
described in mantis 23675: The strikethrough fix should also be in upstream.

Haven't checked with 2.6.0 or earlier, but Lazarus compiles correctly
with trunk.

Alternatively/additionally, perhaps trunk could be fixed like 2.6.2 was
using deprecated - so existing code wouldn't break:
-    property StrikeTrough : boolean index 8 read GetFlags write SetFlags;
+    property StrikeTrough : boolean  index 8 read GetFlags write
SetFlags; deprecated;
+    property StrikeThrough : boolean index 8 read GetFlags write SetFlags;


thanks,
Reinier
-------------- next part --------------
Index: components/fpvectorial/fpvectorial.pas
===================================================================
--- components/fpvectorial/fpvectorial.pas	(revision 39878)
+++ components/fpvectorial/fpvectorial.pas	(working copy)
@@ -1198,7 +1198,12 @@
   ADest.Font.Bold := Font.Bold;
   ADest.Font.Italic := Font.Italic;
   ADest.Font.Underline := Font.Underline;
-  //ADest.Font.StrikeThrough := Font.StrikeThrough; uncomment when FPC 2.6.2+ only is supported
+  {$IF FPC_FULLVERSION>=20602} //changed in 2.6.2 and 2.7; remove when FPC 2.6.2+ only is supported
+  ADest.Font.StrikeThrough := Font.StrikeThrough;
+  {$ELSE}
+  ADest.Font.StrikeTrough := Font.StrikeTrough; //old version with typo
+  {$END}
+
   {$ifdef USE_LCL_CANVAS}
   ALCLDest.Font.Orientation := Round(Font.Orientation * 16);
   {$endif}
Index: components/aggpas/src/agg_fpimage.pas
===================================================================
--- components/aggpas/src/agg_fpimage.pas	(revision 39878)
+++ components/aggpas/src/agg_fpimage.pas	(working copy)
@@ -382,7 +382,11 @@
     property Bold; // only windows
     property Italic; // only windows
     property Underline; // not supported
-    //property StrikeThrough; // not supported, uncomment when FPC 2.6.2+ only is supported
+    {$IF FPC_FULLVERSION>=20602} //changed in 2.6.2 and 2.7; remove when FPC 2.6.2+ only is supported
+    property StrikeThrough;
+    {$ELSE}
+    property StrikeTrough; //old version with typo
+    {$END}
   end;
 
   { TAggFPPath }
Index: lcl/interfaces/customdrawn/customdrawnwinapi.inc
===================================================================
--- lcl/interfaces/customdrawn/customdrawnwinapi.inc	(revision 39878)
+++ lcl/interfaces/customdrawn/customdrawnwinapi.inc	(working copy)
@@ -4090,7 +4090,11 @@
   TM.tmBreakChar := '?';
   TM.tmItalic := Ord(lFont.Italic);
   TM.tmUnderlined := Ord(lFont.Underline);
-  //TM.tmStruckOut := Ord(lFont.StrikeThrough); uncomment when FPC 2.6.2+ only is supported
+  {$IF FPC_FULLVERSION>=20602} //changed in 2.6.2 and 2.7; remove when FPC 2.6.2+ only is supported
+  TM.tmStruckOut := Ord(lFont.StrikeThrough);
+  {$ELSE}
+  TM.tmStruckOut := Ord(lFont.StrikeTrough); //old version with typo
+  {$END}
 
   { Defaults to a TrueType font.
     Note that the meaning of the FIXED_PITCH constant is the opposite of
Index: lcl/lazcanvas.pas
===================================================================
--- lcl/lazcanvas.pas	(revision 39878)
+++ lcl/lazcanvas.pas	(working copy)
@@ -761,7 +761,11 @@
   Font.Bold := AFont.Bold;
   Font.Italic := AFont.Italic;
   Font.Underline := AFont.Underline;
-  //Font.StrikeThrough := AFont.StrikeThrough; uncomment when FPC 2.6.2+ only is supported
+  {$IF FPC_FULLVERSION>=20602} //changed in 2.6.2 and 2.7; remove when FPC 2.6.2+ only is supported
+  Font.StrikeThrough := AFont.StrikeThrough;
+  {$ELSE}
+  Font.StrikeTrough := AFont.StrikeTrough; //old version with typo
+  {$ENDIF}
 end;
 
 { TFPWindowsSharpInterpolation }


More information about the Lazarus mailing list