diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-26 10:03:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-26 11:51:07 +0100 |
commit | f49a6361ce4d7dc4efaca0b1701a3ca0e0702eb2 (patch) | |
tree | 40b6fe6056fc68ad9fd129cef6b5b450be5ef53c /editeng | |
parent | 1629244a83092dc726276380115481283644986d (diff) |
std::unique_ptr -> std::optional
Change-Id: Icf8168423af437fda88a6bd26679fecb699606e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104795
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 8 |
2 files changed, 5 insertions, 5 deletions
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<vcl::Cursor, o3tl::default_delete<vcl::Cursor>> pCursor; - std::unique_ptr<Color> pBackgroundColor; + std::optional<Color> 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); |