From f49a6361ce4d7dc4efaca0b1701a3ca0e0702eb2 Mon Sep 17 00:00:00 2001 From: Noel Date: Mon, 26 Oct 2020 10:03:47 +0200 Subject: std::unique_ptr -> std::optional Change-Id: Icf8168423af437fda88a6bd26679fecb699606e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104795 Tested-by: Jenkins Reviewed-by: Noel Grandin --- editeng/source/editeng/impedit.cxx | 2 +- editeng/source/editeng/impedit.hxx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'editeng/source') diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 2c18762e1f9d..9e82cedf32f4 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -214,7 +214,7 @@ ImpEditView::~ImpEditView() void ImpEditView::SetBackgroundColor( const Color& rColor ) { - pBackgroundColor.reset( new Color( rColor ) ); + mxBackgroundColor = rColor; } void ImpEditView::RegisterViewShell(OutlinerViewShell* pViewShell) diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 921c0dfe5498..dc28f3db2a65 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -257,7 +257,7 @@ class ImpEditView : public vcl::unohelper::DragAndDropClient private: EditView* pEditView; std::unique_ptr> pCursor; - std::unique_ptr pBackgroundColor; + std::optional mxBackgroundColor; /// Containing view shell, if any. OutlinerViewShell* mpViewShell; /// Another shell, just listening to our state, if any. @@ -436,9 +436,9 @@ public: bool DoAutoHeight() const { return bool( nControl & EVControlBits::AUTOSIZEY); } bool DoInvalidateMore() const { return bool( nControl & EVControlBits::INVONEMORE ); } - void SetBackgroundColor( const Color& rColor ); - const Color& GetBackgroundColor() const { - return ( pBackgroundColor ? *pBackgroundColor : pOutWin->GetBackground().GetColor() ); } + void SetBackgroundColor( const Color& rColor ); + const Color & GetBackgroundColor() const { + return ( mxBackgroundColor ? *mxBackgroundColor : pOutWin->GetBackground().GetColor() ); } /// Informs this edit view about which view shell contains it. void RegisterViewShell(OutlinerViewShell* pViewShell); -- cgit