summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-10-21 10:59:38 +0300
committerTor Lillqvist <tml@collabora.com>2013-10-21 11:18:45 +0300
commitfdeb14e4ee73ca1e1213f0dcde61600d9baac657 (patch)
tree533b6c2ac8cf117f28c33decfea5b60544615be9 /vcl/win
parent48bb54aa7eafa85c5b0a2574fb3fa167614ddcbc (diff)
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
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx18
-rw-r--r--vcl/win/source/gdi/winlayout.cxx2
2 files changed, 3 insertions, 17 deletions
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index 9a4779a23bdf..a9efe50bf508 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 78a2d2d3b588..f240f17e68a5 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 );
}