Kaydet (Commit) fdeb14e4 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst 48bb54aa
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
struct ImplOutDevData; struct ImplOutDevData;
class ImplFontEntry; class ImplFontEntry;
struct ImplObjStack; struct ImplObjStack;
struct ImplKernPairData;
struct SystemGraphicsData; struct SystemGraphicsData;
struct SystemFontData; struct SystemFontData;
struct SystemTextLayoutData; struct SystemTextLayoutData;
......
...@@ -29,7 +29,6 @@ class ServerFont; ...@@ -29,7 +29,6 @@ class ServerFont;
class GlyphCachePeer; class GlyphCachePeer;
class ServerFontLayoutEngine; class ServerFontLayoutEngine;
class ServerFontLayout; class ServerFontLayout;
struct ImplKernPairData;
class ImplFontOptions; class ImplFontOptions;
#include <tools/gen.hxx> #include <tools/gen.hxx>
......
...@@ -268,18 +268,6 @@ private: ...@@ -268,18 +268,6 @@ private:
mutable int mnFallbackCount; mutable int mnFallbackCount;
}; };
// --------------------
// - ImplKernPairData -
// --------------------
struct ImplKernPairData
{
sal_uInt16 mnChar1;
sal_uInt16 mnChar2;
long mnKern;
};
// ----------------------- // -----------------------
// - ImplFontMetricData - // - ImplFontMetricData -
// ----------------------- // -----------------------
......
...@@ -35,7 +35,6 @@ class ImplDevFontList; ...@@ -35,7 +35,6 @@ class ImplDevFontList;
class SalBitmap; class SalBitmap;
class FontSelectPattern; class FontSelectPattern;
class ImplFontMetricData; class ImplFontMetricData;
struct ImplKernPairData;
class PhysicalFontFace; class PhysicalFontFace;
class ImplFontCharMap; class ImplFontCharMap;
class SalLayout; class SalLayout;
......
...@@ -270,8 +270,7 @@ private: ...@@ -270,8 +270,7 @@ private:
bool tryDrawBitmapGdiPlus(const SalTwoRect& rTR, const SalBitmap& rSrcBitmap); bool tryDrawBitmapGdiPlus(const SalTwoRect& rTR, const SalBitmap& rSrcBitmap);
// get kernign pairs of the current font // get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL) sal_uLong GetKernPairs();
sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
public: public:
// public SalGraphics methods, the interface to the independent vcl part // public SalGraphics methods, the interface to the independent vcl part
......
...@@ -1738,11 +1738,8 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe ...@@ -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 ( mbFontKernInit )
{ {
if( mpFontKernPairs ) if( mpFontKernPairs )
...@@ -1767,18 +1764,7 @@ sal_uLong WinSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKer ...@@ -1767,18 +1764,7 @@ sal_uLong WinSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKer
std::sort( mpFontKernPairs, mpFontKernPairs + mnFontKernPairCount, ImplCmpKernData ); std::sort( mpFontKernPairs, mpFontKernPairs + mnFontKernPairCount, ImplCmpKernData );
} }
if( !pKernPairs ) return mnFontKernPairCount;
return mnFontKernPairCount;
else if( mpFontKernPairs )
{
if ( nPairs < mnFontKernPairCount )
nPairs = mnFontKernPairCount;
memcpy( pKernPairs, mpFontKernPairs,
nPairs*sizeof( ImplKernPairData ) );
return nPairs;
}
return 0;
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
......
...@@ -2928,7 +2928,7 @@ SalLayout* WinSalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe ...@@ -2928,7 +2928,7 @@ SalLayout* WinSalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
{ {
// TODO: directly cache kerning info in the rFontInstance // TODO: directly cache kerning info in the rFontInstance
// TODO: get rid of kerning methods+data in WinSalGraphics object // TODO: get rid of kerning methods+data in WinSalGraphics object
GetKernPairs( 0, NULL ); GetKernPairs();
rFontInstance.SetKernData( mnFontKernPairCount, mpFontKernPairs ); rFontInstance.SetKernData( mnFontKernPairCount, mpFontKernPairs );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment