[Libreoffice-commits] core.git: sw/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 18 12:59:35 UTC 2019


 sw/source/core/inc/fntcache.hxx     |    1 -
 sw/source/core/txtnode/fntcache.cxx |    6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 92bded1ca06df4a5f989040c2de825bb314db4a9
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Oct 18 12:46:00 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Oct 18 14:58:23 2019 +0200

    mnFontCacheIdCounter is only used in SwFntAccess::NewObj
    
    (and while at it, drop the misleading "m" prefix)
    
    Change-Id: Ib52ef1bb54c8fc627503bdf74e594df1fe4a5801
    Reviewed-on: https://gerrit.libreoffice.org/81035
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx
index d5759ed9def3..f46acd966a75 100644
--- a/sw/source/core/inc/fntcache.hxx
+++ b/sw/source/core/inc/fntcache.hxx
@@ -56,7 +56,6 @@ void SwClearFntCacheTextGlyphs();
 // Font cache, global variable, created/destroyed in txtinit.cxx
 extern SwFntCache *pFntCache;
 extern SwFntObj *pLastFont;
-extern sal_uInt8* mnFontCacheIdCounter;
 
 /**
  * Defines a substring on a given output device, to be used as an std::map<>
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index d5999b8f9bbe..1809f631c380 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -67,8 +67,6 @@ using namespace ::com::sun::star;
 SwFntCache *pFntCache = nullptr;
 // last Font set by ChgFntCache
 SwFntObj *pLastFont = nullptr;
-// "MagicNumber" used to identify Fonts
-sal_uInt8* mnFontCacheIdCounter = nullptr;
 
 static constexpr Color gWaveCol(COL_GRAY);
 
@@ -2374,8 +2372,10 @@ SwFntAccess::SwFntAccess( const void* & rnFontCacheId,
 
 SwCacheObj *SwFntAccess::NewObj( )
 {
+    // "MagicNumber" used to identify Fonts
+    static sal_uInt8* fontCacheIdCounter = nullptr;
     // a new Font, a new "MagicNumber".
-    return new SwFntObj( *static_cast<SwSubFont const *>(m_pOwner), ++mnFontCacheIdCounter, m_pShell );
+    return new SwFntObj( *static_cast<SwSubFont const *>(m_pOwner), ++fontCacheIdCounter, m_pShell );
 }
 
 TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const & rInf, long nTextWidth)


More information about the Libreoffice-commits mailing list