sw/source/core/inc/fntcache.hxx | 6 +- sw/source/core/inc/swcache.hxx | 6 +- sw/source/core/inc/swfont.hxx | 92 ++++++++++++++++++------------------ sw/source/core/text/frmcrsr.cxx | 2 sw/source/core/text/inftxt.cxx | 2 sw/source/core/text/itratr.cxx | 12 ++-- sw/source/core/text/itratr.hxx | 2 sw/source/core/text/porfld.cxx | 2 sw/source/core/text/porrst.cxx | 2 sw/source/core/text/redlnitr.cxx | 12 ++-- sw/source/core/text/txtdrop.cxx | 14 ++--- sw/source/core/text/txthyph.cxx | 10 +-- sw/source/core/txtnode/fntcache.cxx | 20 +++---- sw/source/core/txtnode/fntcap.cxx | 12 ++-- sw/source/core/txtnode/swfntcch.cxx | 2 sw/source/core/txtnode/swfont.cxx | 32 ++++++------ 16 files changed, 114 insertions(+), 114 deletions(-)
New commits: commit 2e8cc2f51284163a35e0efe22497efb9bdf64317 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Aug 31 15:02:36 2018 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Sep 3 09:56:51 2018 +0200 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.gran...@collabora.co.uk> diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx index 9bf8024c9f72..ee8a1d2971f7 100644 --- a/sw/source/core/inc/fntcache.hxx +++ b/sw/source/core/inc/fntcache.hxx @@ -55,7 +55,7 @@ public: // Font cache, global variable, created/destroyed in txtinit.cxx extern SwFntCache *pFntCache; extern SwFntObj *pLastFont; -extern sal_uInt8 *pMagicNo; +extern sal_uInt8* mnFontCacheIdCounter; /** * Defines a substring on a given output device, to be used as an std::map<> @@ -99,7 +99,7 @@ class SwFntObj : public SwCacheObj static MapMode *pPixMap; public: - SwFntObj( const SwSubFont &rFont, const void* pOwner, + SwFntObj( const SwSubFont &rFont, const void* nFontCacheId, SwViewShell const *pSh ); virtual ~SwFntObj() override; @@ -149,7 +149,7 @@ protected: virtual SwCacheObj *NewObj( ) override; public: - SwFntAccess( const void * &rMagic, sal_uInt16 &rIndex, const void *pOwner, + SwFntAccess( const void*& rnFontCacheId, sal_uInt16 &rIndex, const void *pOwner, SwViewShell const *pShell, bool bCheck = false ); SwFntObj* Get() { return static_cast<SwFntObj*>( SwCacheAccess::Get() ); } diff --git a/sw/source/core/inc/swcache.hxx b/sw/source/core/inc/swcache.hxx index 30410061b49f..2744b9f2f318 100644 --- a/sw/source/core/inc/swcache.hxx +++ b/sw/source/core/inc/swcache.hxx @@ -200,7 +200,7 @@ protected: inline SwCacheObj *Get(); inline SwCacheAccess( SwCache &rCache, const void *pOwner, bool bSeek ); - inline SwCacheAccess( SwCache &rCache, const void *pOwner, const sal_uInt16 nIndex ); + inline SwCacheAccess( SwCache &rCache, const void* nCacheId, const sal_uInt16 nIndex ); public: virtual ~SwCacheAccess(); @@ -233,11 +233,11 @@ inline SwCacheAccess::SwCacheAccess( SwCache &rC, const void *pOwn, bool bSeek ) m_pObj->Lock(); } -inline SwCacheAccess::SwCacheAccess( SwCache &rC, const void *pOwn, +inline SwCacheAccess::SwCacheAccess( SwCache &rC, const void* nCacheId, const sal_uInt16 nIndex ) : m_rCache( rC ), m_pObj( nullptr ), - m_pOwner( pOwn ) + m_pOwner( nCacheId ) { if ( m_pOwner && nullptr != (m_pObj = m_rCache.Get( m_pOwner, nIndex )) ) m_pObj->Lock(); diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index 19596895847c..043836bad096 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -51,7 +51,7 @@ sal_uInt16 UnMapDirection( sal_uInt16 nDir, const bool bVertFormat ); class SwSubFont : public SvxFont { friend class SwFont; - const void *m_pMagic; // "MagicNumber" within the font cache + const void* m_nFontCacheId; // "MagicNumber" within the font cache Size m_aSize; // foreigners only see this size sal_uInt16 m_nFontIndex; // index in the font cache sal_uInt16 m_nOrgHeight; // height including escapement/proportion @@ -110,10 +110,10 @@ class SwSubFont : public SvxFont short CheckKerning() { return GetFixKerning() >= 0 ? GetFixKerning() : CheckKerning_( ); } void SetPropWidth( const sal_uInt16 nNew ) - { m_pMagic = nullptr; m_nProportionalWidth = nNew; } + { m_nFontCacheId = nullptr; m_nProportionalWidth = nNew; } public: SwSubFont() : m_aSize(0,0) - { m_pMagic = nullptr; m_nFontIndex = m_nOrgHeight = m_nOrgAscent = 0; m_nProportionalWidth =100; m_bSmallCapsPercentage66 = false; } + { m_nFontCacheId = nullptr; m_nFontIndex = m_nOrgHeight = m_nOrgAscent = 0; m_nProportionalWidth =100; m_bSmallCapsPercentage66 = false; } sal_uInt16 GetPropWidth() const { return m_nProportionalWidth; } }; @@ -182,23 +182,23 @@ public: inline void SetActual( SwFontScript nNew ); const SvxFont& GetActualFont() const { return m_aSub[m_nActual]; } - // gets a MagicNumber via SwFntAccess - void GoMagic( SwViewShell const *pSh, SwFontScript nWhich ); + // gets a font cache id via SwFntAccess + void AllocFontCacheId( SwViewShell const *pSh, SwFontScript nWhich ); // set background color void SetBackColor( Color* pNewColor ); const Color* GetBackColor() const{ return m_pBackColor.get(); } void SetHighlightColor( const Color& aNewColor ); const Color& GetHighlightColor() const { return m_aHighlightColor; } - void ChkMagic( SwViewShell const *pSh, SwFontScript nWhich ) - { if( !m_aSub[ nWhich ].m_pMagic ) GoMagic( pSh, nWhich ); } - void GetMagic( const void* &rMagic, sal_uInt16 &rIdx, SwFontScript nWhich ) - { rMagic = m_aSub[nWhich].m_pMagic; rIdx = m_aSub[nWhich].m_nFontIndex; } - void SetMagic( const void* pNew, const sal_uInt16 nIdx, SwFontScript nWhich ) - { m_aSub[nWhich].m_pMagic = pNew; m_aSub[nWhich].m_nFontIndex = nIdx; } - bool DifferentMagic( const SwFont* pFnt, SwFontScript nWhich ) - { return m_aSub[nWhich].m_pMagic != pFnt->m_aSub[nWhich].m_pMagic || - !m_aSub[nWhich].m_pMagic || !pFnt->m_aSub[nWhich].m_pMagic; } + void CheckFontCacheId( SwViewShell const *pSh, SwFontScript nWhich ) + { if( !m_aSub[ nWhich ].m_nFontCacheId ) AllocFontCacheId( pSh, nWhich ); } + void GetFontCacheId( const void* &rnFontCacheId, sal_uInt16 &rIdx, SwFontScript nWhich ) + { rnFontCacheId = m_aSub[nWhich].m_nFontCacheId; rIdx = m_aSub[nWhich].m_nFontIndex; } + void SetFontCacheId( const void* nNewFontCacheId, const sal_uInt16 nIdx, SwFontScript nWhich ) + { m_aSub[nWhich].m_nFontCacheId = nNewFontCacheId; m_aSub[nWhich].m_nFontIndex = nIdx; } + bool DifferentFontCacheId( const SwFont* pFnt, SwFontScript nWhich ) + { return m_aSub[nWhich].m_nFontCacheId != pFnt->m_aSub[nWhich].m_nFontCacheId || + !m_aSub[nWhich].m_nFontCacheId || !pFnt->m_aSub[nWhich].m_nFontCacheId; } const Size &GetSize( SwFontScript nWhich ) const { return m_aSub[nWhich].m_aSize; } @@ -409,14 +409,14 @@ inline void SwFont::SetColor( const Color& rColor ) // encapsulated SV-Font-method inline void SwSubFont::SetColor( const Color& rColor ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetColor( rColor ); } // encapsulated SV-Font-method inline void SwSubFont::SetFillColor( const Color& rColor ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetFillColor( rColor ); } @@ -431,7 +431,7 @@ inline void SwFont::SetFillColor( const Color& rColor ) // encapsulated SV-Font-method inline void SwSubFont::SetFamily( const FontFamily eFamily ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetFamily( eFamily ); } @@ -444,7 +444,7 @@ inline void SwFont::SetFamily( const FontFamily eFamily, const SwFontScript nWhi // encapsulated SV-Font-method inline void SwSubFont::SetName( const OUString& rName ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetFamilyName( rName ); } @@ -457,7 +457,7 @@ inline void SwFont::SetName( const OUString& rName, const SwFontScript nWhich ) // encapsulated SV-Font-method inline void SwSubFont::SetStyleName( const OUString& rStyleName ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetStyleName( rStyleName ); } @@ -470,7 +470,7 @@ inline void SwFont::SetStyleName( const OUString& rStyle, const SwFontScript nWh // encapsulated SV-Font-method inline void SwSubFont::SetCharSet( const rtl_TextEncoding eCharSet ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetCharSet( eCharSet ); } @@ -483,7 +483,7 @@ inline void SwFont::SetCharSet( const rtl_TextEncoding eCharSet, const SwFontScr // encapsulated SV-Font-method inline void SwSubFont::SetPitch( const FontPitch ePitch ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetPitch( ePitch ); } @@ -497,7 +497,7 @@ inline void SwFont::SetPitch( const FontPitch ePitch, const SwFontScript nWhich // encapsulated SV-Font-method inline void SwSubFont::SetAlign( const FontAlign eAlign ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetAlignment( eAlign ); } @@ -512,7 +512,7 @@ inline void SwFont::SetAlign( const FontAlign eAlign ) // encapsulated SV-Font-method inline void SwSubFont::SetWeight( const FontWeight eWeight ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetWeight( eWeight ); } @@ -525,7 +525,7 @@ inline void SwFont::SetWeight( const FontWeight eWeight, const SwFontScript nWhi // encapsulated SV-Font-method inline void SwSubFont::SetUnderline( const FontLineStyle eUnderline ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetUnderline( eUnderline ); } @@ -540,7 +540,7 @@ inline void SwFont::SetUnderline( const FontLineStyle eUnderline ) // encapsulated SV-Font-method inline void SwSubFont::SetOverline( const FontLineStyle eOverline ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetOverline( eOverline ); } @@ -555,7 +555,7 @@ inline void SwFont::SetOverline( const FontLineStyle eOverline ) // encapsulated SV-Font-method inline void SwSubFont::SetStrikeout( const FontStrikeout eStrikeout ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetStrikeout( eStrikeout ); } @@ -570,7 +570,7 @@ inline void SwFont::SetStrikeout( const FontStrikeout eStrikeout ) // encapsulated SV-Font-method inline void SwSubFont::SetItalic( const FontItalic eItalic ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetItalic( eItalic ); } @@ -583,7 +583,7 @@ inline void SwFont::SetItalic( const FontItalic eItalic, const SwFontScript nWhi // encapsulated SV-Font-method inline void SwSubFont::SetOutline( const bool bOutline ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetOutline( bOutline ); } @@ -598,7 +598,7 @@ inline void SwFont::SetOutline( const bool bOutline ) // encapsulated SV-Font-method inline void SwSubFont::SetShadow( const bool bShadow ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetShadow( bShadow ); } @@ -613,7 +613,7 @@ inline void SwFont::SetShadow( const bool bShadow ) // encapsulated SV-Font-method inline void SwSubFont::SetAutoKern( FontKerning nAutoKern ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetKerning( nAutoKern ); } @@ -651,7 +651,7 @@ inline void SwFont::SetCaseMap( const SvxCaseMap eNew ) // encapsulated SV-Font-method inline void SwSubFont::SetWordLineMode( const bool bWordLineMode ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetWordLineMode( bWordLineMode ); } @@ -665,7 +665,7 @@ inline void SwFont::SetWordLineMode( const bool bWordLineMode ) // encapsulated SV-Font-method inline void SwSubFont::SetEmphasisMark( const FontEmphasisMark eValue ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetEmphasisMark( eValue ); } @@ -691,7 +691,7 @@ inline void SwFont::SetPropWidth( const sal_uInt16 nNew ) // encapsulated SV-Font-method inline void SwSubFont::SetRelief( const FontRelief eNew ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetRelief( eNew ); } @@ -718,7 +718,7 @@ inline void SwSubFont::SetSize( const Size& rSize ) m_aSize.Width() * GetPropr() / 100, m_aSize.Height() * GetPropr() / 100 ) ); } - m_pMagic = nullptr; + m_nFontCacheId = nullptr; } inline void SwFont::SetSize( const Size& rSize, const SwFontScript nWhich ) @@ -743,7 +743,7 @@ inline void SwFont::SetActual( SwFontScript nNew ) inline void SwSubFont::SetProportion( const sal_uInt8 nNewPropr ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetFontSize( Size( m_aSize.Width() * nNewPropr / 100, m_aSize.Height() * nNewPropr / 100 ) ); SvxFont::SetPropr( nNewPropr ); @@ -764,7 +764,7 @@ inline void SwFont::SetProportion( const sal_uInt8 nNewPropr ) inline void SwSubFont::SetEscapement( const short nNewEsc ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; SvxFont::SetEscapement( nNewEsc ); } @@ -785,7 +785,7 @@ inline void SwFont::SetEscapement( const short nNewEsc ) inline void SwSubFont::SetLanguage( LanguageType eNewLang ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; if( eNewLang == LANGUAGE_SYSTEM ) eNewLang = GetAppLanguage(); SvxFont::SetLanguage( eNewLang ); @@ -814,7 +814,7 @@ inline void SwFont::SetGreyWave( const bool bNew ) inline void SwSubFont::SetVertical( const sal_uInt16 nDir, const bool bVertFormat ) { - m_pMagic = nullptr; + m_nFontCacheId = nullptr; Font::SetVertical( bVertFormat ); Font::SetOrientation( nDir ); } @@ -823,28 +823,28 @@ inline void SwFont::SetTopBorderDist( const sal_uInt16 nTopDist ) { m_nTopBorderDist = nTopDist; m_bFontChg = true; - m_aSub[SwFontScript::Latin].m_pMagic = m_aSub[SwFontScript::CJK].m_pMagic = m_aSub[SwFontScript::CTL].m_pMagic = nullptr; + m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } inline void SwFont::SetBottomBorderDist( const sal_uInt16 nBottomDist ) { m_nBottomBorderDist = nBottomDist; m_bFontChg = true; - m_aSub[SwFontScript::Latin].m_pMagic = m_aSub[SwFontScript::CJK].m_pMagic = m_aSub[SwFontScript::CTL].m_pMagic = nullptr; + m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } inline void SwFont::SetRightBorderDist( const sal_uInt16 nRightDist ) { m_nRightBorderDist = nRightDist; m_bFontChg = true; - m_aSub[SwFontScript::Latin].m_pMagic = m_aSub[SwFontScript::CJK].m_pMagic = m_aSub[SwFontScript::CTL].m_pMagic = nullptr; + m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } inline void SwFont::SetLeftBorderDist( const sal_uInt16 nLeftDist ) { m_nLeftBorderDist = nLeftDist; m_bFontChg = true; - m_aSub[SwFontScript::Latin].m_pMagic = m_aSub[SwFontScript::CJK].m_pMagic = m_aSub[SwFontScript::CTL].m_pMagic = nullptr; + m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } inline sal_uInt16 SwFont::GetTopBorderSpace() const @@ -916,28 +916,28 @@ inline void SwFont::SetShadowColor( const Color& rColor ) { m_aShadowColor = rColor; m_bFontChg = true; - m_aSub[SwFontScript::Latin].m_pMagic = m_aSub[SwFontScript::CJK].m_pMagic = m_aSub[SwFontScript::CTL].m_pMagic = nullptr; + m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } inline void SwFont::SetShadowWidth( const sal_uInt16 nWidth ) { m_nShadowWidth = nWidth; m_bFontChg = true; - m_aSub[SwFontScript::Latin].m_pMagic = m_aSub[SwFontScript::CJK].m_pMagic = m_aSub[SwFontScript::CTL].m_pMagic = nullptr; + m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } inline void SwFont::SetShadowLocation( const SvxShadowLocation aLocation ) { m_aShadowLocation = aLocation; m_bFontChg = true; - m_aSub[SwFontScript::Latin].m_pMagic = m_aSub[SwFontScript::CJK].m_pMagic = m_aSub[SwFontScript::CTL].m_pMagic = nullptr; + m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } inline void SwFont::SetHighlightColor( const Color& aNewColor ) { m_aHighlightColor = aNewColor; m_bFontChg = true; - m_aSub[SwFontScript::Latin].m_pMagic = m_aSub[SwFontScript::CJK].m_pMagic = m_aSub[SwFontScript::CTL].m_pMagic = nullptr; + m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } // Used for the "continuous underline" feature. diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index 7e90e16f654f..8cb7a18aedcf 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -1374,7 +1374,7 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const { SwFontAccess aFontAccess( pColl, pSh ); pFnt = new SwFont( aFontAccess.Get()->GetFont() ); - pFnt->ChkMagic( pSh, pFnt->GetActual() ); + pFnt->CheckFontCacheId( pSh, pFnt->GetActual() ); } OutputDevice* pOut = pSh->GetOut(); if( !pSh->GetViewOptions()->getBrowseMode() || pSh->GetViewOptions()->IsPrtFormat() ) diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 29411db3e296..38f78f19ff8d 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1846,7 +1846,7 @@ SwFontSave::SwFontSave(const SwTextSizeInfo &rInf, SwFont *pNew, // 1. the fonts have a different magic number // 2. they have different script types // 3. their background colors differ (this is not covered by 1.) - if( pFnt->DifferentMagic( pNew, pFnt->GetActual() ) || + if( pFnt->DifferentFontCacheId( pNew, pFnt->GetActual() ) || pNew->GetActual() != pFnt->GetActual() || ( ! pNew->GetBackColor() && pFnt->GetBackColor() ) || ( pNew->GetBackColor() && ! pFnt->GetBackColor() ) || diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 6e81b4539e60..44df9ea35304 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -82,7 +82,7 @@ SwAttrIter::SwAttrIter(SwTextNode const * pTextNode) , m_pTextNode(pTextNode) , m_pMergedPara(nullptr) { - m_aMagicNo[SwFontScript::Latin] = m_aMagicNo[SwFontScript::CJK] = m_aMagicNo[SwFontScript::CTL] = nullptr; + m_aFontCacheIds[SwFontScript::Latin] = m_aFontCacheIds[SwFontScript::CJK] = m_aFontCacheIds[SwFontScript::CTL] = nullptr; } SwAttrIter::SwAttrIter(SwTextNode& rTextNode, SwScriptInfo& rScrInf, SwTextFrame const*const pFrame) @@ -169,9 +169,9 @@ bool SwAttrIter::SeekAndChgAttrIter(TextFrameIndex const nNewPos, OutputDevice* } if( bChg ) { - // if the change counter is zero, we know the MagicNo of the wanted font + // if the change counter is zero, we know the cache id of the wanted font if ( !m_nChgCnt && !m_nPropFont ) - m_pFont->SetMagic( m_aMagicNo[ m_pFont->GetActual() ], + m_pFont->SetFontCacheId( m_aFontCacheIds[ m_pFont->GetActual() ], m_aFontIdx[ m_pFont->GetActual() ], m_pFont->GetActual() ); m_pFont->ChgPhysFnt( m_pViewShell, *pOut ); } @@ -183,7 +183,7 @@ bool SwAttrIter::IsSymbol(TextFrameIndex const nNewPos) { Seek( nNewPos ); if ( !m_nChgCnt && !m_nPropFont ) - m_pFont->SetMagic( m_aMagicNo[ m_pFont->GetActual() ], + m_pFont->SetFontCacheId( m_aFontCacheIds[ m_pFont->GetActual() ], m_aFontIdx[ m_pFont->GetActual() ], m_pFont->GetActual() ); return m_pFont->IsSymbol( m_pViewShell ); } @@ -243,9 +243,9 @@ bool SwAttrIter::SeekStartAndChgAttrIter( OutputDevice* pOut, const bool bParaFo } if( bChg ) { - // if the application counter is zero, we know the MagicNo of the wanted font + // if the application counter is zero, we know the cache id of the wanted font if ( !m_nChgCnt && !m_nPropFont ) - m_pFont->SetMagic( m_aMagicNo[ m_pFont->GetActual() ], + m_pFont->SetFontCacheId( m_aFontCacheIds[ m_pFont->GetActual() ], m_aFontIdx[ m_pFont->GetActual() ], m_pFont->GetActual() ); m_pFont->ChgPhysFnt( m_pViewShell, *pOut ); } diff --git a/sw/source/core/text/itratr.hxx b/sw/source/core/text/itratr.hxx index d6e0d7f24a56..99741c87b965 100644 --- a/sw/source/core/text/itratr.hxx +++ b/sw/source/core/text/itratr.hxx @@ -57,7 +57,7 @@ private: /// current iteration index in text node sal_Int32 m_nPosition; sal_uInt8 m_nPropFont; - o3tl::enumarray<SwFontScript, const void*> m_aMagicNo; + o3tl::enumarray<SwFontScript, const void*> m_aFontCacheIds; o3tl::enumarray<SwFontScript, sal_uInt16> m_aFontIdx; /// input: the current text node const SwTextNode* m_pTextNode; diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 818a15d8e26f..f1fd08a76cb4 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -317,7 +317,7 @@ bool SwFieldPortion::Format( SwTextFormatInfo &rInf ) rInf.SetUnderScorePos( rInf.GetIdx() ); if( m_pFont ) - m_pFont->GoMagic( rInf.GetVsh(), m_pFont->GetActual() ); + m_pFont->AllocFontCacheId( rInf.GetVsh(), m_pFont->GetActual() ); SwFontSave aSave( rInf, m_pFont.get() ); diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 24778b6ec9d6..867c2b9927c2 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -236,7 +236,7 @@ SwTwips SwTextFrame::EmptyHeight() const { SwFontAccess aFontAccess( &rTextNode.GetAnyFormatColl(), pSh); pFnt = new SwFont( aFontAccess.Get()->GetFont() ); - pFnt->ChkMagic( pSh, pFnt->GetActual() ); + pFnt->CheckFontCacheId( pSh, pFnt->GetActual() ); } if ( IsVertical() ) diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index f95682e18d6b..7c51eed6aaa6 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -154,7 +154,7 @@ void SwAttrIter::InitFontAndAttrHandler(SwTextNode const& rTextNode, *rTextNode.getIDocumentSettingAccess(), m_pViewShell, *m_pFont, pbVertLayout ? *pbVertLayout : m_aAttrHandler.IsVertLayout() ); - m_aMagicNo[SwFontScript::Latin] = m_aMagicNo[SwFontScript::CJK] = m_aMagicNo[SwFontScript::CTL] = nullptr; + m_aFontCacheIds[SwFontScript::Latin] = m_aFontCacheIds[SwFontScript::CJK] = m_aFontCacheIds[SwFontScript::CTL] = nullptr; assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is()); @@ -171,18 +171,18 @@ void SwAttrIter::InitFontAndAttrHandler(SwTextNode const& rTextNode, SwFontScript nTmp = SW_SCRIPTS; switch ( m_pScriptInfo->GetScriptType( nCnt++ ) ) { case i18n::ScriptType::ASIAN : - if( !m_aMagicNo[SwFontScript::CJK] ) nTmp = SwFontScript::CJK; + if( !m_aFontCacheIds[SwFontScript::CJK] ) nTmp = SwFontScript::CJK; break; case i18n::ScriptType::COMPLEX : - if( !m_aMagicNo[SwFontScript::CTL] ) nTmp = SwFontScript::CTL; + if( !m_aFontCacheIds[SwFontScript::CTL] ) nTmp = SwFontScript::CTL; break; default: - if( !m_aMagicNo[SwFontScript::Latin ] ) nTmp = SwFontScript::Latin; + if( !m_aFontCacheIds[SwFontScript::Latin ] ) nTmp = SwFontScript::Latin; } if( nTmp < SW_SCRIPTS ) { - m_pFont->ChkMagic( m_pViewShell, nTmp ); - m_pFont->GetMagic( m_aMagicNo[ nTmp ], m_aFontIdx[ nTmp ], nTmp ); + m_pFont->CheckFontCacheId( m_pViewShell, nTmp ); + m_pFont->GetFontCacheId( m_aFontCacheIds[ nTmp ], m_aFontIdx[ nTmp ], nTmp ); } } while (nChg < TextFrameIndex(rText.getLength())); 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 diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx index b16e0ee9083e..a59bd8a3cef8 100644 --- a/sw/source/core/text/txthyph.cxx +++ b/sw/source/core/text/txthyph.cxx @@ -300,13 +300,13 @@ bool SwTextPortion::CreateHyphen( SwTextFormatInfo &rInf, SwTextGuess const &rGu pHyphPor = new SwHyphPortion; pHyphPor->SetLen(TextFrameIndex(1)); - static const void* pLastMagicNo = nullptr; + static const void* nLastFontCacheId = nullptr; static sal_uInt16 aMiniCacheH = 0, aMiniCacheW = 0; - const void* pTmpMagic; + const void* nTmpFontCacheId; sal_uInt16 nFntIdx; - rInf.GetFont()->GetMagic( pTmpMagic, nFntIdx, rInf.GetFont()->GetActual() ); - if( !pLastMagicNo || pLastMagicNo != pTmpMagic ) { - pLastMagicNo = pTmpMagic; + rInf.GetFont()->GetFontCacheId( nTmpFontCacheId, nFntIdx, rInf.GetFont()->GetActual() ); + if( !nLastFontCacheId || nLastFontCacheId != nTmpFontCacheId ) { + nLastFontCacheId = nTmpFontCacheId; static_cast<SwPosSize&>(*pHyphPor) = pHyphPor->GetTextSize( rInf ); aMiniCacheH = pHyphPor->Height(); aMiniCacheW = pHyphPor->Width(); diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 2845d223db86..8fa3eee79aa8 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -67,7 +67,7 @@ SwFntCache *pFntCache = nullptr; // last Font set by ChgFntCache SwFntObj *pLastFont = nullptr; // "MagicNumber" used to identify Fonts -sal_uInt8* pMagicNo = nullptr; +sal_uInt8* mnFontCacheIdCounter = nullptr; static constexpr Color gWaveCol(COL_GRAY); @@ -160,8 +160,8 @@ void SwFntCache::Flush( ) SwCache::Flush( ); } -SwFntObj::SwFntObj(const SwSubFont &rFont, const void *pOwn, SwViewShell const *pSh) - : SwCacheObj(pOwn) +SwFntObj::SwFntObj(const SwSubFont &rFont, const void* nFontCacheId, SwViewShell const *pSh) + : SwCacheObj(nFontCacheId) , m_aFont(rFont) , m_pScrFont(nullptr) , m_pPrtFont(&m_aFont) @@ -2240,16 +2240,16 @@ TextFrameIndex SwFntObj::GetCursorOfst(SwDrawTextInfo &rInf) return nCnt; } -SwFntAccess::SwFntAccess( const void* &rMagic, +SwFntAccess::SwFntAccess( const void* & rnFontCacheId, sal_uInt16 &rIndex, const void *pOwn, SwViewShell const *pSh, bool bCheck ) : - SwCacheAccess( *pFntCache, rMagic, rIndex ), + SwCacheAccess( *pFntCache, rnFontCacheId, rIndex ), pShell( pSh ) { - // the used ctor of SwCacheAccess searches for rMagic+rIndex in the cache + // the used ctor of SwCacheAccess searches for rnFontCacheId+rIndex in the cache if ( IsAvail() ) { - // fast case: known Font (rMagic), no need to check printer and zoom + // fast case: known Font (rnFontCacheId), no need to check printer and zoom if ( !bCheck ) return; @@ -2338,8 +2338,8 @@ SwFntAccess::SwFntAccess( const void* &rMagic, // no matter if new or found, now the Owner of the Object is a // MagicNumber, and will be given to the SwFont, as well as the Index // for later direct access - rMagic = pFntObj->GetOwner(); - SwCacheAccess::m_pOwner = rMagic; + rnFontCacheId = reinterpret_cast<void*>(reinterpret_cast<sal_IntPtr>(pFntObj->GetOwner())); + SwCacheAccess::m_pOwner = pFntObj->GetOwner(); rIndex = pFntObj->GetCachePos(); } } @@ -2347,7 +2347,7 @@ SwFntAccess::SwFntAccess( const void* &rMagic, SwCacheObj *SwFntAccess::NewObj( ) { // a new Font, a new "MagicNumber". - return new SwFntObj( *static_cast<SwSubFont const *>(m_pOwner), ++pMagicNo, pShell ); + return new SwFntObj( *static_cast<SwSubFont const *>(m_pOwner), ++mnFontCacheIdCounter, pShell ); } TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const & rInf, long nTextWidth) diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx index 062f8aa2bc37..14a38f7846e7 100644 --- a/sw/source/core/txtnode/fntcap.cxx +++ b/sw/source/core/txtnode/fntcap.cxx @@ -491,7 +491,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) SwFntAccess *pSpaceFontAccess = nullptr; SwFntObj *pSpaceFont = nullptr; - const void *pMagic2 = nullptr; + const void* nFontCacheId2 = nullptr; sal_uInt16 nIndex2 = 0; SwSubFont aFont( *this ); Point aStartPos( rDo.GetInf().GetPos() ); @@ -508,7 +508,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) if ( bWordWise ) { aFont.SetWordLineMode( false ); - pSpaceFontAccess = new SwFntAccess( pMagic2, nIndex2, &aFont, + pSpaceFontAccess = new SwFntAccess( nFontCacheId2, nIndex2, &aFont, rDo.GetInf().GetShell() ); pSpaceFont = pSpaceFontAccess->Get(); } @@ -519,9 +519,9 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) aFont.SetUnderline( LINESTYLE_NONE ); aFont.SetOverline( LINESTYLE_NONE ); aFont.SetStrikeout( STRIKEOUT_NONE ); - pMagic2 = nullptr; + nFontCacheId2 = nullptr; nIndex2 = 0; - pBigFontAccess = new SwFntAccess( pMagic2, nIndex2, &aFont, + pBigFontAccess = new SwFntAccess( nFontCacheId2, nIndex2, &aFont, rDo.GetInf().GetShell() ); pBigFont = pBigFontAccess->Get(); } @@ -535,9 +535,9 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) // the option there). int smallCapsPercentage = m_bSmallCapsPercentage66 ? 66 : SMALL_CAPS_PERCENTAGE; aFont.SetProportion( (aFont.GetPropr() * smallCapsPercentage ) / 100 ); - pMagic2 = nullptr; + nFontCacheId2 = nullptr; nIndex2 = 0; - SwFntAccess *pSmallFontAccess = new SwFntAccess( pMagic2, nIndex2, &aFont, + SwFntAccess *pSmallFontAccess = new SwFntAccess( nFontCacheId2, nIndex2, &aFont, rDo.GetInf().GetShell() ); SwFntObj *pSmallFont = pSmallFontAccess->Get(); diff --git a/sw/source/core/txtnode/swfntcch.cxx b/sw/source/core/txtnode/swfntcch.cxx index 3be4d0cc55ab..49783fd25942 100644 --- a/sw/source/core/txtnode/swfntcch.cxx +++ b/sw/source/core/txtnode/swfntcch.cxx @@ -36,7 +36,7 @@ SwFontObj::SwFontObj( const void *pOwn, SwViewShell *pSh ) : SwCacheObj( pOwn ), m_aSwFont( &static_cast<SwTextFormatColl const *>(pOwn)->GetAttrSet(), pSh ? &pSh->getIDocumentSettingAccess() : nullptr ) { - m_aSwFont.GoMagic( pSh, m_aSwFont.GetActual() ); + m_aSwFont.AllocFontCacheId( pSh, m_aSwFont.GetActual() ); const SwAttrSet& rAttrSet = static_cast<SwTextFormatColl const *>(pOwn)->GetAttrSet(); for (sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++) m_pDefaultArray[ StackPos[ i ] ] = &rAttrSet.Get( i ); diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 844e176d35ab..f028b973e601 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -70,7 +70,7 @@ void SwFont::SetBackColor( Color* pNewColor ) { m_pBackColor.reset( pNewColor ); m_bFontChg = true; - m_aSub[SwFontScript::Latin].m_pMagic = m_aSub[SwFontScript::CJK].m_pMagic = m_aSub[SwFontScript::CTL].m_pMagic = nullptr; + m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } void SwFont::SetTopBorder( const editeng::SvxBorderLine* pTopBorder ) @@ -83,7 +83,7 @@ void SwFont::SetTopBorder( const editeng::SvxBorderLine* pTopBorder ) m_nTopBorderDist = 0; } m_bFontChg = true; - m_aSub[SwFontScript::Latin].m_pMagic = m_aSub[SwFontScript::CJK].m_pMagic = m_aSub[SwFontScript::CTL].m_pMagic = nullptr; + m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } void SwFont::SetBottomBorder( const editeng::SvxBorderLine* pBottomBorder ) @@ -96,7 +96,7 @@ void SwFont::SetBottomBorder( const editeng::SvxBorderLine* pBottomBorder ) m_nBottomBorderDist = 0; } m_bFontChg = true; - m_aSub[SwFontScript::Latin].m_pMagic = m_aSub[SwFontScript::CJK].m_pMagic = m_aSub[SwFontScript::CTL].m_pMagic = nullptr; + m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } void SwFont::SetRightBorder( const editeng::SvxBorderLine* pRightBorder ) @@ -109,7 +109,7 @@ void SwFont::SetRightBorder( const editeng::SvxBorderLine* pRightBorder ) m_nRightBorderDist = 0; } m_bFontChg = true; - m_aSub[SwFontScript::Latin].m_pMagic = m_aSub[SwFontScript::CJK].m_pMagic = m_aSub[SwFontScript::CTL].m_pMagic = nullptr; + m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } void SwFont::SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder ) @@ -122,7 +122,7 @@ void SwFont::SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder ) m_nLeftBorderDist = 0; } m_bFontChg = true; - m_aSub[SwFontScript::Latin].m_pMagic = m_aSub[SwFontScript::CJK].m_pMagic = m_aSub[SwFontScript::CTL].m_pMagic = nullptr; + m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr; } const boost::optional<editeng::SvxBorderLine>& @@ -920,15 +920,15 @@ SwFont& SwFont::operator=( const SwFont &rFont ) return *this; } -void SwFont::GoMagic( SwViewShell const *pSh, SwFontScript nWhich ) +void SwFont::AllocFontCacheId( SwViewShell const *pSh, SwFontScript nWhich ) { - SwFntAccess aFntAccess( m_aSub[nWhich].m_pMagic, m_aSub[nWhich].m_nFontIndex, + SwFntAccess aFntAccess( m_aSub[nWhich].m_nFontCacheId, m_aSub[nWhich].m_nFontIndex, &m_aSub[nWhich], pSh, true ); } bool SwSubFont::IsSymbol( SwViewShell const *pSh ) { - SwFntAccess aFntAccess( m_pMagic, m_nFontIndex, this, pSh, false ); + SwFntAccess aFntAccess( m_nFontCacheId, m_nFontIndex, this, pSh, false ); return aFntAccess.Get()->IsSymbol(); } @@ -936,7 +936,7 @@ bool SwSubFont::ChgFnt( SwViewShell const *pSh, OutputDevice& rOut ) { if ( pLastFont ) pLastFont->Unlock(); - SwFntAccess aFntAccess( m_pMagic, m_nFontIndex, this, pSh, true ); + SwFntAccess aFntAccess( m_nFontCacheId, m_nFontIndex, this, pSh, true ); SV_STAT( nChangeFont ); pLastFont = aFntAccess.Get(); @@ -956,7 +956,7 @@ void SwFont::ChgPhysFnt( SwViewShell const *pSh, OutputDevice& rOut ) const sal_uInt8 nOldProp = m_aSub[m_nActual].GetPropr(); SetProportion( 100 ); ChgFnt( pSh, rOut ); - SwFntAccess aFntAccess( m_aSub[m_nActual].m_pMagic, m_aSub[m_nActual].m_nFontIndex, + SwFntAccess aFntAccess( m_aSub[m_nActual].m_nFontCacheId, m_aSub[m_nActual].m_nFontIndex, &m_aSub[m_nActual], pSh ); m_aSub[m_nActual].m_nOrgHeight = aFntAccess.Get()->GetFontHeight( pSh, rOut ); m_aSub[m_nActual].m_nOrgAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut ); @@ -1006,7 +1006,7 @@ short SwSubFont::CheckKerning_( ) sal_uInt16 SwSubFont::GetAscent( SwViewShell const *pSh, const OutputDevice& rOut ) { - SwFntAccess aFntAccess( m_pMagic, m_nFontIndex, this, pSh ); + SwFntAccess aFntAccess( m_nFontCacheId, m_nFontIndex, this, pSh ); const sal_uInt16 nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut ); return GetEscapement() ? CalcEscAscent( nAscent ) : nAscent; } @@ -1014,7 +1014,7 @@ sal_uInt16 SwSubFont::GetAscent( SwViewShell const *pSh, const OutputDevice& rOu sal_uInt16 SwSubFont::GetHeight( SwViewShell const *pSh, const OutputDevice& rOut ) { SV_STAT( nGetTextSize ); - SwFntAccess aFntAccess( m_pMagic, m_nFontIndex, this, pSh ); + SwFntAccess aFntAccess( m_nFontCacheId, m_nFontIndex, this, pSh ); const sal_uInt16 nHeight = aFntAccess.Get()->GetFontHeight( pSh, rOut ); if ( GetEscapement() ) { @@ -1028,7 +1028,7 @@ Size SwSubFont::GetTextSize_( SwDrawTextInfo& rInf ) { // Robust: the font is supposed to be set already, but better safe than // sorry... - if ( !pLastFont || pLastFont->GetOwner()!=m_pMagic || + if ( !pLastFont || pLastFont->GetOwner() != reinterpret_cast<const void*>(m_nFontCacheId) || !IsSameInstance( rInf.GetpOut()->GetFont() ) ) ChgFnt( rInf.GetShell(), rInf.GetOut() ); @@ -1144,7 +1144,7 @@ void SwSubFont::DrawText_( SwDrawTextInfo &rInf, const bool bGrey ) pUnderFnt = rInf.GetUnderFnt(); } - if( !pLastFont || pLastFont->GetOwner()!=m_pMagic ) + if( !pLastFont || pLastFont->GetOwner() != reinterpret_cast<const void*>(m_nFontCacheId) ) ChgFnt( rInf.GetShell(), rInf.GetOut() ); SwDigitModeModifier aDigitModeModifier( rInf.GetOut(), rInf.GetFont()->GetLanguage() ); @@ -1273,7 +1273,7 @@ void SwSubFont::DrawStretchText_( SwDrawTextInfo &rInf ) pUnderFnt = rInf.GetUnderFnt(); } - if ( !pLastFont || pLastFont->GetOwner() != m_pMagic ) + if ( !pLastFont || pLastFont->GetOwner() != reinterpret_cast<const void*>(m_nFontCacheId) ) ChgFnt( rInf.GetShell(), rInf.GetOut() ); SwDigitModeModifier aDigitModeModifier( rInf.GetOut(), rInf.GetFont()->GetLanguage() ); @@ -1342,7 +1342,7 @@ void SwSubFont::DrawStretchText_( SwDrawTextInfo &rInf ) TextFrameIndex SwSubFont::GetCursorOfst_( SwDrawTextInfo& rInf ) { - if ( !pLastFont || pLastFont->GetOwner()!=m_pMagic ) + if ( !pLastFont || pLastFont->GetOwner() != reinterpret_cast<const void*>(m_nFontCacheId) ) ChgFnt( rInf.GetShell(), rInf.GetOut() ); SwDigitModeModifier aDigitModeModifier( rInf.GetOut(), rInf.GetFont()->GetLanguage() ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits