summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-12-31 18:05:29 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-12-31 20:33:26 +0100
commit0a045a00e48978c72ba5053d8e663c193afdfc85 (patch)
tree91166fcadd67d26bb7596559034803f09557084a /sc
parent0b6aad2da3ef9c4c37fe141eb068e40d1ed4dfc0 (diff)
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@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/postit.hxx9
-rw-r--r--sc/source/core/data/postit.cxx4
2 files changed, 8 insertions, 5 deletions
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();