[Libreoffice-commits] core.git: sc/inc sc/source
Noel Grandin
noel.grandin at collabora.co.uk
Sun Dec 31 19:33:51 UTC 2017
sc/inc/postit.hxx | 9 ++++++---
sc/source/core/data/postit.cxx | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
New commits:
commit 0a045a00e48978c72ba5053d8e663c193afdfc85
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Sun Dec 31 18:05:29 2017 +0200
improve const-correctness in ScCaptionPtr
mostly to make my passstuffbyref loplugin happier
Change-Id: I148b6b418100de860dfc49aaec6c544d0fe14c72
Reviewed-on: https://gerrit.libreoffice.org/47225
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index c13169f1b960..345d1e03b22d 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -52,9 +52,12 @@ public:
ScCaptionPtr& operator=( const ScCaptionPtr& r );
ScCaptionPtr& operator=( ScCaptionPtr&& r );
explicit operator bool() const { return mpCaption != nullptr; }
- SdrCaptionObj* get() const { return mpCaption; }
- SdrCaptionObj* operator->() const { return mpCaption; }
- SdrCaptionObj& operator*() const { return *mpCaption; }
+ const SdrCaptionObj* get() const { return mpCaption; }
+ SdrCaptionObj* get() { return mpCaption; }
+ const SdrCaptionObj* operator->() const { return mpCaption; }
+ SdrCaptionObj* operator->() { return mpCaption; }
+ const SdrCaptionObj& operator*() const { return *mpCaption; }
+ SdrCaptionObj& operator*() { return *mpCaption; }
// Does not default to nullptr to make it visually obvious where such is used.
void reset( SdrCaptionObj* p );
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 879f74e03a47..e35c7708c71a 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -401,7 +401,7 @@ public:
/** Create a new caption object and inserts it into the document. */
explicit ScNoteCaptionCreator( ScDocument& rDoc, const ScAddress& rPos, ScNoteData& rNoteData );
/** Manipulate an existing caption. */
- explicit ScNoteCaptionCreator( ScDocument& rDoc, const ScAddress& rPos, const ScCaptionPtr& xCaption, bool bShown );
+ explicit ScNoteCaptionCreator( ScDocument& rDoc, const ScAddress& rPos, ScCaptionPtr& xCaption, bool bShown );
};
ScNoteCaptionCreator::ScNoteCaptionCreator( ScDocument& rDoc, const ScAddress& rPos, ScNoteData& rNoteData ) :
@@ -425,7 +425,7 @@ ScNoteCaptionCreator::ScNoteCaptionCreator( ScDocument& rDoc, const ScAddress& r
}
}
-ScNoteCaptionCreator::ScNoteCaptionCreator( ScDocument& rDoc, const ScAddress& rPos, const ScCaptionPtr& xCaption, bool bShown ) :
+ScNoteCaptionCreator::ScNoteCaptionCreator( ScDocument& rDoc, const ScAddress& rPos, ScCaptionPtr& xCaption, bool bShown ) :
ScCaptionCreator( rDoc, rPos, xCaption )
{
SdrPage* pDrawPage = GetDrawPage();
More information about the Libreoffice-commits
mailing list