Kaydet (Commit) 0a045a00 authored tarafından Noel Grandin's avatar Noel Grandin

improve const-correctness in ScCaptionPtr

mostly to make my passstuffbyref loplugin happier

Change-Id: I148b6b418100de860dfc49aaec6c544d0fe14c72
Reviewed-on: https://gerrit.libreoffice.org/47225Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 0b6aad2d
......@@ -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 );
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment