diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-05-07 15:28:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-05-07 18:23:56 +0200 |
commit | 525292acab017dcfd50ef0c0b6dc4a5229e32a4e (patch) | |
tree | 2a63767e1803525107e48af874fe1b3e62e730e2 /editeng | |
parent | f5c0d7508b972898153bbf4069c9ea48f53d64d5 (diff) |
create color config in ctor instead of on-demand
Change-Id: Id45b6cba3665c11074dbdc52757d1b6f0084b020
Reviewed-on: https://gerrit.libreoffice.org/37346
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 9 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 10 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 3 |
3 files changed, 4 insertions, 18 deletions
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 19333a665575..bb8f4e894a49 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -31,6 +31,7 @@ #include <editeng/eedata.hxx> #include "editeng/editeng.hxx" #include <editeng/editview.hxx> +#include <svtools/colorcfg.hxx> #include <vcl/virdev.hxx> #include <vcl/gdimtf.hxx> #include <vcl/cursor.hxx> @@ -84,10 +85,6 @@ namespace clipboard { class XClipboard; }}}}} -namespace svtools { - class ColorConfig; -} - namespace editeng { struct MisspellRanges; } @@ -425,7 +422,7 @@ private: VclPtr< OutputDevice > pRefDev; VclPtr<VirtualDevice> mpOwnDev; - svtools::ColorConfig* pColorConfig; + svtools::ColorConfig maColorConfig; mutable SvtCTLOptions* pCTLOptions; SfxItemSet* pEmptyItemSet; @@ -866,7 +863,7 @@ public: void FormatAndUpdate( EditView* pCurView = nullptr, bool bCalledFromUndo = false ); inline void IdleFormatAndUpdate( EditView* pCurView ); - svtools::ColorConfig& GetColorConfig(); + const svtools::ColorConfig& GetColorConfig() const { return maColorConfig; } bool IsVisualCursorTravelingEnabled(); bool DoVisualCursorTraveling(); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index df975e1eb882..950a5bf79f1b 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -120,7 +120,6 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : pUndoManager = nullptr; pUndoMarkSelection = nullptr; pTextRanger = nullptr; - pColorConfig = nullptr; pCTLOptions = nullptr; nCurTextHeight = 0; @@ -200,7 +199,6 @@ ImpEditEngine::~ImpEditEngine() delete pUndoManager; delete pTextRanger; delete mpIMEInfos; - delete pColorConfig; delete pCTLOptions; delete pSpellInfo; } @@ -4347,14 +4345,6 @@ void ImpEditEngine::SetForbiddenCharsTable( const rtl::Reference<SvxForbiddenCha EditDLL::Get().GetGlobalData()->SetForbiddenCharsTable( xForbiddenChars ); } -svtools::ColorConfig& ImpEditEngine::GetColorConfig() -{ - if ( !pColorConfig ) - pColorConfig = new svtools::ColorConfig; - - return *pColorConfig; -} - bool ImpEditEngine::IsVisualCursorTravelingEnabled() { bool bVisualCursorTravaling = false; diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 85360b100f1a..f002bb3c31c9 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -4393,7 +4393,7 @@ Reference < i18n::XExtendedInputSequenceChecker > const & ImpEditEngine::ImplGet Color ImpEditEngine::GetAutoColor() const { - Color aColor = const_cast<ImpEditEngine*>(this)->GetColorConfig().GetColorValue( svtools::FONTCOLOR ).nColor; + Color aColor = GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor; if ( GetBackgroundColor() != COL_AUTO ) { @@ -4406,7 +4406,6 @@ Color ImpEditEngine::GetAutoColor() const return aColor; } - bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode, TextPortion* pTextPortion, sal_Int32 nStartPos, long* pDXArray, sal_uInt16 n100thPercentFromMax, |