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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Aug 31 13:43:31 UTC 2018


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

New commits:
commit 2d4cf6a3405be27cd95942038f63015411fdcd97
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Aug 31 12:26:09 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Aug 31 15:43:05 2018 +0200

    pWaveCol can just be a file local constant
    
    Change-Id: Iff44dae790793701e00f5394d5fb786059bd7c7c
    Reviewed-on: https://gerrit.libreoffice.org/59862
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx
index 6a1e82c5b8ee..9edfd6d0e17b 100644
--- a/sw/source/core/inc/fntcache.hxx
+++ b/sw/source/core/inc/fntcache.hxx
@@ -53,7 +53,6 @@ public:
 extern SwFntCache *pFntCache;
 extern SwFntObj *pLastFont;
 extern sal_uInt8 *pMagicNo;
-extern Color *pWaveCol;
 
 class SwFntObj : public SwCacheObj
 {
diff --git a/sw/source/core/text/txtinit.cxx b/sw/source/core/text/txtinit.cxx
index 784d6108703e..83e4cf8de3d0 100644
--- a/sw/source/core/text/txtinit.cxx
+++ b/sw/source/core/text/txtinit.cxx
@@ -57,7 +57,6 @@ void TextInit_()
 #endif
     );
     SwTextFrame::SetTextCache( pTextCache );
-    pWaveCol = new Color(COL_GRAY);
     PROTOCOL_INIT
 }
 
@@ -68,7 +67,6 @@ void TextFinit()
     delete pSwFontCache;
     delete pFntCache;
     delete pBlink;
-    delete pWaveCol;
     delete pContourCache;
     SwDropPortion::DeleteDropCapCache();
 }
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 985ffab1c87b..49b1224501ed 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -69,7 +69,7 @@ SwFntObj *pLastFont = nullptr;
 // "MagicNumber" used to identify Fonts
 sal_uInt8* pMagicNo = nullptr;
 
-Color *pWaveCol = nullptr;
+static constexpr Color gWaveCol(COL_GRAY);
 
 long SwFntObj::nPixWidth;
 MapMode* SwFntObj::pPixMap = nullptr;
@@ -1682,9 +1682,9 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
                             rInf.GetOut().Push();
 
                         Color aCol( rInf.GetOut().GetLineColor() );
-                        bool bColSave = aCol != *pWaveCol;
+                        bool bColSave = aCol != gWaveCol;
                         if ( bColSave )
-                            rInf.GetOut().SetLineColor( *pWaveCol );
+                            rInf.GetOut().SetLineColor( gWaveCol );
 
                         Point aEnd;
                         long nKernVal = pKernArray[sal_Int32(rInf.GetLen()) - 1];


More information about the Libreoffice-commits mailing list