From 2d4cf6a3405be27cd95942038f63015411fdcd97 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 31 Aug 2018 12:26:09 +0200 Subject: 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 --- 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(-) 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]; -- cgit