[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/win

Tor Lillqvist tml at collabora.com
Mon Oct 21 01:19:18 PDT 2013


 include/vcl/outdev.hxx           |    1 -
 vcl/inc/generic/glyphcache.hxx   |    1 -
 vcl/inc/outfont.hxx              |   12 ------------
 vcl/inc/salgdi.hxx               |    1 -
 vcl/inc/win/salgdi.h             |    3 +--
 vcl/win/source/gdi/salgdi3.cxx   |   18 ++----------------
 vcl/win/source/gdi/winlayout.cxx |    2 +-
 7 files changed, 4 insertions(+), 34 deletions(-)

New commits:
commit fdeb14e4ee73ca1e1213f0dcde61600d9baac657
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Oct 21 10:59:38 2013 +0300

    Simplify further after the kerning pair changes
    
    The ImplKernPairData struct was used now only by the VCL Windows code, and was
    apparently supposed to be identical to the Win32 KERNINGPAIR struct anyway.
    
    GetKernPairs() was called just once with zero and NULL parameters anyway, so
    it can be simplified.
    
    Change-Id: Iaa288868d1e590e0385377abc5b9d9d331d39d97

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 696a928..7c5dbb8 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -43,7 +43,6 @@
 struct ImplOutDevData;
 class ImplFontEntry;
 struct ImplObjStack;
-struct ImplKernPairData;
 struct SystemGraphicsData;
 struct SystemFontData;
 struct SystemTextLayoutData;
diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx
index 179c2b2..7e1acaf 100644
--- a/vcl/inc/generic/glyphcache.hxx
+++ b/vcl/inc/generic/glyphcache.hxx
@@ -29,7 +29,6 @@ class ServerFont;
 class GlyphCachePeer;
 class ServerFontLayoutEngine;
 class ServerFontLayout;
-struct ImplKernPairData;
 class ImplFontOptions;
 
 #include <tools/gen.hxx>
diff --git a/vcl/inc/outfont.hxx b/vcl/inc/outfont.hxx
index f88a88b..6e3210b 100644
--- a/vcl/inc/outfont.hxx
+++ b/vcl/inc/outfont.hxx
@@ -268,18 +268,6 @@ private:
     mutable int                     mnFallbackCount;
 };
 
-// --------------------
-// - ImplKernPairData -
-// --------------------
-
-struct ImplKernPairData
-{
-    sal_uInt16          mnChar1;
-    sal_uInt16          mnChar2;
-    long                mnKern;
-};
-
-
 // -----------------------
 // - ImplFontMetricData -
 // -----------------------
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index 442a5a9..d4a219d 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -35,7 +35,6 @@ class ImplDevFontList;
 class SalBitmap;
 class FontSelectPattern;
 class ImplFontMetricData;
-struct ImplKernPairData;
 class PhysicalFontFace;
 class ImplFontCharMap;
 class SalLayout;
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index ccbee18..b54c876 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -270,8 +270,7 @@ private:
     bool tryDrawBitmapGdiPlus(const SalTwoRect& rTR, const SalBitmap& rSrcBitmap);
 
     // get kernign pairs of the current font
-    // return only PairCount if (pKernPairs == NULL)
-    sal_uLong               GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
+    sal_uLong               GetKernPairs();
 
 public:
     // public SalGraphics methods, the interface to the independent vcl part
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index 9a4779a..a9efe50 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -1738,11 +1738,8 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
 
 // -----------------------------------------------------------------------
 
-sal_uLong WinSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs )
+sal_uLong WinSalGraphics::GetKernPairs()
 {
-    DBG_ASSERT( sizeof( KERNINGPAIR ) == sizeof( ImplKernPairData ),
-                "WinSalGraphics::GetKernPairs(): KERNINGPAIR != ImplKernPairData" );
-
     if ( mbFontKernInit )
     {
         if( mpFontKernPairs )
@@ -1767,18 +1764,7 @@ sal_uLong WinSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKer
         std::sort( mpFontKernPairs, mpFontKernPairs + mnFontKernPairCount, ImplCmpKernData );
     }
 
-    if( !pKernPairs )
-        return mnFontKernPairCount;
-    else if( mpFontKernPairs )
-    {
-        if ( nPairs < mnFontKernPairCount )
-            nPairs = mnFontKernPairCount;
-        memcpy( pKernPairs, mpFontKernPairs,
-                nPairs*sizeof( ImplKernPairData ) );
-        return nPairs;
-    }
-
-    return 0;
+    return mnFontKernPairCount;
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 78a2d2d..f240f17 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -2928,7 +2928,7 @@ SalLayout* WinSalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
         {
             // TODO: directly cache kerning info in the rFontInstance
             // TODO: get rid of kerning methods+data in WinSalGraphics object
-            GetKernPairs( 0, NULL );
+            GetKernPairs();
             rFontInstance.SetKernData( mnFontKernPairCount, mpFontKernPairs );
         }
 


More information about the Libreoffice-commits mailing list