From 770fa8ffb23c295186be105474228e53f37d872a Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 10 Apr 2006 08:45:13 +0000 Subject: [PATCH] fixed ExtTextOut getting TextHeight git-svn-id: trunk@9111 - --- components/codetools/laz_xmlstreaming.pas | 8 ++------ examples/xmlstreaming/mainunit.pas | 1 + lcl/interfaces/gtk/gtkwinapi.inc | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/components/codetools/laz_xmlstreaming.pas b/components/codetools/laz_xmlstreaming.pas index 412bae0132..4433c08a5a 100644 --- a/components/codetools/laz_xmlstreaming.pas +++ b/components/codetools/laz_xmlstreaming.pas @@ -392,13 +392,9 @@ begin end; procedure TXMLObjectWriter.WriteWideString(const Value: WideString); -var - s: string; +// save widestrings as utf8 begin - SetLength(s,length(Value)*2); - if s<>'' then - System.Move(Value[1],s[1],length(s)); - GetPropertyElement('widestring')['value'] := s; + GetPropertyElement('widestring')['value'] := System.UTF8Encode(Value); end; diff --git a/examples/xmlstreaming/mainunit.pas b/examples/xmlstreaming/mainunit.pas index a75efc96f8..c2ae9bcb2d 100644 --- a/examples/xmlstreaming/mainunit.pas +++ b/examples/xmlstreaming/mainunit.pas @@ -29,6 +29,7 @@ type property MyString: string read FMyString write FMyString; property MyEnum: TMyEnum read FMyEnum write FMyEnum; property MySet: TMySet read FMySet write FMySet; + end; diff --git a/lcl/interfaces/gtk/gtkwinapi.inc b/lcl/interfaces/gtk/gtkwinapi.inc index 15fc124ca7..583ee39f4b 100644 --- a/lcl/interfaces/gtk/gtkwinapi.inc +++ b/lcl/interfaces/gtk/gtkwinapi.inc @@ -3844,7 +3844,7 @@ begin if UseFont<>nil then begin LineLen := FindChar(#10,Str,Count); UpdateDCTextMetric(TDeviceContext(DC)); - LineHeight:=DCTextMetric.TextMetric.tmHeight; + LineHeight:=GetTextHeight(DCTextMetric); if Buffered then begin TxtPt.X := 0; TxtPt.Y := LineHeight;