summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2012-05-09 13:30:11 +0300
committerTor Lillqvist <tlillqvist@suse.com>2012-05-09 13:37:05 +0300
commit0947d09c8aa71e5c413a3b637d6402b0f41239e1 (patch)
tree988d249678569987c29a060209a22822e9e45e92 /vcl/win
parent7a3061db050d1727240bad9c3e4142f2a94944bf (diff)
GCP_KERN_HACK has been hardcoded since 2002, so why bother with ifdefs
Change-Id: I7e37289aba503310c54026d5a8bcbf8e4d51fb6c
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx9
-rw-r--r--vcl/win/source/gdi/winlayout.cxx30
2 files changed, 3 insertions, 36 deletions
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index 4d866f9a59a1..79ff37548944 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -69,9 +69,7 @@
#include "outdev.h" // for ImplGlyphFallbackFontSubstitution
#include "sft.hxx"
-#ifdef GCP_KERN_HACK
#include <algorithm>
-#endif
#ifdef ENABLE_GRAPHITE
#include <graphite2/Font.h>
@@ -1797,17 +1795,10 @@ sal_uLong WinSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKer
int nCount = ::GetKerningPairsW( mhDC, 0, NULL );
if( nCount )
{
- #ifdef GCP_KERN_HACK
pPairs = new KERNINGPAIR[ nCount+1 ];
mpFontKernPairs = pPairs;
mnFontKernPairCount = nCount;
::GetKerningPairsW( mhDC, nCount, pPairs );
- #else // GCP_KERN_HACK
- pPairs = pKernPairs;
- nCount = (nCount < nPairs) : nCount : nPairs;
- ::GetKerningPairsW( mhDC, nCount, pPairs );
- return nCount;
- #endif // GCP_KERN_HACK
}
mbFontKernInit = FALSE;
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index db52d43ecfab..72f9cf3dac35 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -48,9 +48,7 @@
#define alloca _alloca
#endif
-#ifdef GCP_KERN_HACK
- #include <algorithm>
-#endif // GCP_KERN_HACK
+#include <algorithm>
#include <usp10.h>
#include <shlwapi.h>
@@ -87,7 +85,6 @@ public:
private:
// TODO: also add HFONT??? Watch out for issues with too many active fonts...
-#ifdef GCP_KERN_HACK
public:
bool HasKernData() const;
void SetKernData( int, const KERNINGPAIR* );
@@ -95,7 +92,6 @@ public:
private:
KERNINGPAIR* mpKerningPairs;
int mnKerningPairs;
-#endif // GCP_KERN_HACK
public:
SCRIPT_CACHE& GetScriptCache() const
@@ -389,13 +385,6 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
if( rArgs.mnFlags & (SAL_LAYOUT_KERNING_PAIRS | SAL_LAYOUT_KERNING_ASIAN) )
mpGlyphOrigAdvs = new int[ mnGlyphCount ];
-#ifndef GCP_KERN_HACK
- DWORD nGcpOption = 0;
- // enable kerning if requested
- if( rArgs.mnFlags & SAL_LAYOUT_KERNING_PAIRS )
- nGcpOption |= GCP_USEKERNING;
-#endif // GCP_KERN_HACK
-
for( i = 0; i < mnGlyphCount; ++i )
mpOutGlyphs[i] = pBidiStr[ i ];
mnWidth = 0;
@@ -478,18 +467,11 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
mpGlyphOrigAdvs[i] = mnNotdefWidth;
}
-#ifdef GCP_KERN_HACK
// apply kerning if the layout engine has not yet done it
if( rArgs.mnFlags & (SAL_LAYOUT_KERNING_ASIAN|SAL_LAYOUT_KERNING_PAIRS) )
{
-#else // GCP_KERN_HACK
- // apply just asian kerning
- if( rArgs.mnFlags & SAL_LAYOUT_KERNING_ASIAN )
- {
- if( !(rArgs.mnFlags & SAL_LAYOUT_KERNING_PAIRS) )
-#endif // GCP_KERN_HACK
- for( i = 0; i < mnGlyphCount; ++i )
- mpGlyphOrigAdvs[i] = mpGlyphAdvances[i];
+ for( i = 0; i < mnGlyphCount; ++i )
+ mpGlyphOrigAdvs[i] = mpGlyphAdvances[i];
// #99658# also apply asian kerning on the substring border
int nLen = mnGlyphCount;
@@ -497,7 +479,6 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
++nLen;
for( i = 1; i < nLen; ++i )
{
-#ifdef GCP_KERN_HACK
if( rArgs.mnFlags & SAL_LAYOUT_KERNING_PAIRS )
{
int nKernAmount = mrWinFontEntry.GetKerning( pBidiStr[i-1], pBidiStr[i] );
@@ -505,7 +486,6 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
mnWidth += nKernAmount;
}
else if( rArgs.mnFlags & SAL_LAYOUT_KERNING_ASIAN )
-#endif // GCP_KERN_HACK
if( ( (0x3000 == (0xFF00 & pBidiStr[i-1])) || (0x2010 == (0xFFF0 & pBidiStr[i-1])) || (0xFF00 == (0xFF00 & pBidiStr[i-1])))
&& ( (0x3000 == (0xFF00 & pBidiStr[i])) || (0x2010 == (0xFFF0 & pBidiStr[i])) || (0xFF00 == (0xFF00 & pBidiStr[i])) ) )
@@ -2927,7 +2907,6 @@ SalLayout* WinSalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
}
else
{
-#ifdef GCP_KERN_HACK
if( (rArgs.mnFlags & SAL_LAYOUT_KERNING_PAIRS) && !rFontInstance.HasKernData() )
{
// TODO: directly cache kerning info in the rFontInstance
@@ -2935,7 +2914,6 @@ SalLayout* WinSalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
GetKernPairs( 0, NULL );
rFontInstance.SetKernData( mnFontKernPairCount, mpFontKernPairs );
}
-#endif // GCP_KERN_HACK
BYTE eCharSet = ANSI_CHARSET;
if( mpLogFont )
@@ -2984,9 +2962,7 @@ ImplWinFontEntry::~ImplWinFontEntry()
{
if( maScriptCache != NULL )
ScriptFreeCache( &maScriptCache );
-#ifdef GCP_KERN_HACK
delete[] mpKerningPairs;
-#endif // GCP_KERN_HACK
}
// -----------------------------------------------------------------------