diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-31 15:02:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-03 09:56:51 +0200 |
commit | 2e8cc2f51284163a35e0efe22497efb9bdf64317 (patch) | |
tree | b4f9f6d1cd07035460e3cf2a63cf7c0f32e1a118 /sw/source/core/text/txtdrop.cxx | |
parent | aeff83240c88435d11590f5e9c6fe9927a508c6a (diff) |
use less magic in sw/
rename the "magic" members and fields that are actually a font-cache-id,
to more useful names
Change-Id: Ie787b0939115c576e979c7e27a21a68c138c32f6
Reviewed-on: https://gerrit.libreoffice.org/59868
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/text/txtdrop.cxx')
-rw-r--r-- | sw/source/core/text/txtdrop.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index 53558c50b230..9b8ddf411e39 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -700,7 +700,7 @@ void SwTextPainter::PaintDropPortion() class SwDropCapCache { - long aMagicNo[ DROP_CACHE_SIZE ]; + const void* aFontCacheId[ DROP_CACHE_SIZE ]; OUString aText[ DROP_CACHE_SIZE ]; sal_uInt16 aFactor[ DROP_CACHE_SIZE ]; sal_uInt16 aWishedHeight[ DROP_CACHE_SIZE ]; @@ -714,7 +714,7 @@ public: // SwDropCapCache Ctor / Dtor SwDropCapCache::SwDropCapCache() : nIndex( 0 ) { - memset( &aMagicNo, 0, sizeof(aMagicNo) ); + memset( &aFontCacheId, 0, sizeof(aFontCacheId) ); memset( &aWishedHeight, 0, sizeof(aWishedHeight) ); } @@ -725,7 +725,7 @@ void SwDropPortion::DeleteDropCapCache() void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf ) { - const void* pFntNo = nullptr; + const void* nFntCacheId = nullptr; sal_uInt16 nTmpIdx = 0; OSL_ENSURE( pDrop->GetPart(),"DropPortion without part during font calculation"); @@ -741,13 +741,13 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf if ( bUseCache ) { SwFont& rFnt = pCurrPart->GetFont(); - rFnt.ChkMagic( rInf.GetVsh(), rFnt.GetActual() ); - rFnt.GetMagic( pFntNo, nTmpIdx, rFnt.GetActual() ); + rFnt.CheckFontCacheId( rInf.GetVsh(), rFnt.GetActual() ); + rFnt.GetFontCacheId( nFntCacheId, nTmpIdx, rFnt.GetActual() ); nTmpIdx = 0; while( nTmpIdx < DROP_CACHE_SIZE && - ( aText[ nTmpIdx ] != aStr || aMagicNo[ nTmpIdx ] != sal_IntPtr(pFntNo) || + ( aText[ nTmpIdx ] != aStr || aFontCacheId[ nTmpIdx ] != nFntCacheId || aWishedHeight[ nTmpIdx ] != pDrop->GetDropHeight() ) ) ++nTmpIdx; } @@ -782,7 +782,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf if ( bUseCache ) { // save keys for cache - aMagicNo[ nTmpIdx ] = sal_IntPtr(pFntNo); + aFontCacheId[ nTmpIdx ] = nFntCacheId; aText[ nTmpIdx ] = aStr; aWishedHeight[ nTmpIdx ] = sal_uInt16(nWishedHeight); // save initial scaling factor |