[Libreoffice-commits] .: vcl/win

Caolán McNamara caolan at kemper.freedesktop.org
Tue Mar 15 04:47:01 PDT 2011


 vcl/win/source/gdi/salgdi3.cxx   |   33 ++-------------------------------
 vcl/win/source/gdi/winlayout.cxx |    7 +++++--
 2 files changed, 7 insertions(+), 33 deletions(-)

New commits:
commit dfefad4f3066d7187bf8f3504489dedc8a1d7017
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 15 11:46:25 2011 +0000

    fix up merge conflicts

diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index c7337a8..a11c3b9 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -1274,6 +1274,8 @@ static unsigned GetUShort( const unsigned char* p ){ return((p[0]<<8)+p[1]);}
 //static signed GetSShort( const unsigned char* p ){ return((short)((p[0]<<8)+p[1]));}
 static inline DWORD CalcTag( const char p[4]) { return (p[0]+(p[1]<<8)+(p[2]<<16)+(p[3]<<24)); }
 
+// -----------------------------------------------------------------------
+
 void ImplWinFontData::UpdateFromHDC( HDC hDC ) const
 {
     // short circuit if already initialized
@@ -1364,37 +1366,6 @@ bool ImplWinFontData::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabi
 
 // -----------------------------------------------------------------------
 
-static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)+(p[2]<<8)+p[3]);}
-static unsigned GetUShort( const unsigned char* p ){ return((p[0]<<8)+p[1]);}
-//static signed GetSShort( const unsigned char* p ){ return((short)((p[0]<<8)+p[1]));}
-static inline DWORD CalcTag( const char p[4]) { return (p[0]+(p[1]<<8)+(p[2]<<16)+(p[3]<<24)); }
-
-void ImplWinFontData::ReadOs2Table( HDC hDC ) const
-{
-    const DWORD Os2Tag = CalcTag( "OS/2" );
-    DWORD nLength = ::GetFontData( hDC, Os2Tag, 0, NULL, 0 );
-    if( (nLength == GDI_ERROR) || !nLength )
-        return;
-    std::vector<unsigned char> aOS2map( nLength );
-    unsigned char* pOS2map = &aOS2map[0];
-    ::GetFontData( hDC, Os2Tag, 0, pOS2map, nLength );
-    sal_uInt32 nVersion = GetUShort( pOS2map );
-    if ( nVersion >= 0x0001 && nLength >= 58 )
-    {
-        // We need at least version 0x0001 (TrueType rev 1.66)
-        // to have access to the needed struct members.
-        sal_uInt32 ulUnicodeRange1 = GetUInt( pOS2map + 42 );
-        sal_uInt32 ulUnicodeRange2 = GetUInt( pOS2map + 46 );
-
-        // Check for CJK capabilities of the current font
-        mbHasCJKSupport = (ulUnicodeRange2 & 0x2DF00000);
-        mbHasKoreanRange= (ulUnicodeRange1 & 0x10000000)
-                        | (ulUnicodeRange2 & 0x01100000);
-        mbHasArabicSupport = (ulUnicodeRange1 & 0x00002000);
-   }
-}
-// -----------------------------------------------------------------------
-
 void ImplWinFontData::ReadGsubTable( HDC hDC ) const
 {
     mbGsubRead = true;
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 683fa00..5da87d0 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -2805,7 +2805,6 @@ private:
 public:
     GraphiteWinLayout(HDC hDC, const ImplWinFontData& rWFD, ImplWinFontEntry& rWFE);
 
-    ~GraphiteWinLayout() { gr_font_destroy(maImpl.getFont()); }
     // used by upper layers
     virtual bool  LayoutText( ImplLayoutArgs& );    // first step of layout
     virtual void  AdjustLayout( ImplLayoutArgs& );  // adjusting after fallback etc.
@@ -2825,7 +2824,11 @@ public:
     virtual void    MoveGlyph( int nStart, long nNewXPos );
     virtual void    DropGlyph( int nStart );
     virtual void    Simplify( bool bIsBase );
-    ~GraphiteWinLayout() { delete mpFeatures; mpFeatures = NULL; };
+    ~GraphiteWinLayout()
+    {
+        delete mpFeatures;
+        gr_font_destroy(maImpl.GetFont());
+    }
 };
 
 float gr_fontAdvance(const void* appFontHandle, gr_uint16 glyphId)


More information about the Libreoffice-commits mailing list