From 51ff7e7a53afb14d5b01c00a37a2ea2c97431f4d Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 20 Aug 2015 13:37:13 +0300 Subject: Drop code that is dead after 4667db065d34193d99bce82f7e8f3b20a03ecade Change-Id: Id023b43e901b0e41ebf3b208c6e80fd023bf7f9a --- vcl/win/source/gdi/salgdi.cxx | 5 ----- vcl/win/source/gdi/salgdi3.cxx | 40 -------------------------------------- vcl/win/source/gdi/winlayout.cxx | 42 ---------------------------------------- 3 files changed, 87 deletions(-) (limited to 'vcl/win') diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx index 1a1d569afceb..cf77cf1e1ae2 100644 --- a/vcl/win/source/gdi/salgdi.cxx +++ b/vcl/win/source/gdi/salgdi.cxx @@ -629,9 +629,6 @@ WinSalGraphics::WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hW mhDefPal(0), mpStdClipRgnData(NULL), mpFontAttrCache(NULL), - mpFontKernPairs(NULL), - mnFontKernPairCount(0), - mbFontKernInit(false), mnPenWidth(GSL_PEN_WIDTH) { if (OpenGLHelper::isVCLOpenGLEnabled() && !mbPrinter) @@ -661,8 +658,6 @@ WinSalGraphics::~WinSalGraphics() // delete cache data delete [] mpStdClipRgnData; - - delete [] mpFontKernPairs; } SalGraphicsImpl* WinSalGraphics::GetImpl() const diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index f61d878f8323..fbb3b872e6d8 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -1559,17 +1559,6 @@ sal_uInt16 WinSalGraphics::SetFont( FontSelectPattern* pFont, int nFallbackLevel if( mpWinFontData[ nFallbackLevel ] ) mpWinFontData[ nFallbackLevel ]->UpdateFromHDC( getHDC() ); - if( !nFallbackLevel ) - { - mbFontKernInit = TRUE; - if ( mpFontKernPairs ) - { - delete[] mpFontKernPairs; - mpFontKernPairs = NULL; - } - mnFontKernPairCount = 0; - } - // some printers have higher internal resolution, so their // text output would be different from what we calculated // => suggest DrawTextArray to workaround this problem @@ -1655,35 +1644,6 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe pMetric->mnMinKashida = GetMinKashidaWidth(); } -sal_uLong WinSalGraphics::GetKernPairs() -{ - if ( mbFontKernInit ) - { - if( mpFontKernPairs ) - { - delete[] mpFontKernPairs; - mpFontKernPairs = NULL; - } - mnFontKernPairCount = 0; - - KERNINGPAIR* pPairs = NULL; - int nCount = ::GetKerningPairsW( getHDC(), 0, NULL ); - if( nCount ) - { - pPairs = new KERNINGPAIR[ nCount+1 ]; - mpFontKernPairs = pPairs; - mnFontKernPairCount = nCount; - ::GetKerningPairsW( getHDC(), nCount, pPairs ); - } - - mbFontKernInit = FALSE; - - std::sort( mpFontKernPairs, mpFontKernPairs + mnFontKernPairCount, ImplCmpKernData ); - } - - return mnFontKernPairCount; -} - const FontCharMapPtr WinSalGraphics::GetFontCharMap() const { if( !mpWinFontData[0] ) diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index c1c2d7e65d34..315d9834d934 100644 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -76,14 +76,6 @@ public: private: // TODO: also add HFONT??? Watch out for issues with too many active fonts... -public: - bool HasKernData() const; - void SetKernData( int, const KERNINGPAIR* ); - int GetKerning( sal_Unicode, sal_Unicode ) const; -private: - KERNINGPAIR* mpKerningPairs; - int mnKerningPairs; - public: SCRIPT_CACHE& GetScriptCache() const { return maScriptCache; } @@ -2426,8 +2418,6 @@ int WinSalGraphics::GetMinKashidaWidth() ImplWinFontEntry::ImplWinFontEntry( FontSelectPattern& rFSD ) : ImplFontEntry( rFSD ) -, mpKerningPairs( NULL ) -, mnKerningPairs( -1 ) , maWidthMap( 512 ) , mnMinKashidaWidth( -1 ) , mnMinKashidaGlyph( -1 ) @@ -2439,38 +2429,6 @@ ImplWinFontEntry::~ImplWinFontEntry() { if( maScriptCache != NULL ) ScriptFreeCache( &maScriptCache ); - delete[] mpKerningPairs; -} - -bool ImplWinFontEntry::HasKernData() const -{ - return (mnKerningPairs >= 0); -} - -void ImplWinFontEntry::SetKernData( int nPairCount, const KERNINGPAIR* pPairData ) -{ - mnKerningPairs = nPairCount; - mpKerningPairs = new KERNINGPAIR[ mnKerningPairs ]; - memcpy( mpKerningPairs, (const void*)pPairData, nPairCount*sizeof(KERNINGPAIR) ); -} - -int ImplWinFontEntry::GetKerning( sal_Unicode cLeft, sal_Unicode cRight ) const -{ - int nKernAmount = 0; - if( mpKerningPairs ) - { - const KERNINGPAIR aRefPair = { cLeft, cRight, 0 }; - const KERNINGPAIR* pFirstPair = mpKerningPairs; - const KERNINGPAIR* pEndPair = mpKerningPairs + mnKerningPairs; - const KERNINGPAIR* pPair = std::lower_bound( pFirstPair, - pEndPair, aRefPair, ImplCmpKernData ); - if( (pPair != pEndPair) - && (pPair->wFirst == aRefPair.wFirst) - && (pPair->wSecond == aRefPair.wSecond) ) - nKernAmount = pPair->iKernAmount; - } - - return nKernAmount; } bool ImplWinFontEntry::InitKashidaHandling( HDC hDC ) -- cgit