From 2e8cc2f51284163a35e0efe22497efb9bdf64317 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 31 Aug 2018 15:02:36 +0200 Subject: 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 --- sw/source/core/text/txtdrop.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sw/source/core/text/txtdrop.cxx') 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 -- cgit v1.2.3