diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-16 10:41:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-21 12:44:55 +0100 |
commit | 2dbd02b576f28224204ac962f6ce20fde6687093 (patch) | |
tree | 28b3f8807d5909e7bcc3c5a629dadd6f475ad9d3 /editeng | |
parent | 48314f25241e014a634dd5371543b90137ffd2bc (diff) |
loplugin:redundantfcast improvements
check for calls to constructors, and extend the list of types we check
for unnecessary temporary creation
Change-Id: Ia2c1f202b41ed6866779fff5343c821128033eec
Reviewed-on: https://gerrit.libreoffice.org/63472
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/inc/editdoc.hxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx index 4e7efff897fa..31c15e201a5e 100644 --- a/editeng/inc/editdoc.hxx +++ b/editeng/inc/editdoc.hxx @@ -322,7 +322,7 @@ public: sal_Int32 GetIndex() const { return nIndex; } void SetIndex( sal_Int32 n ) { nIndex = n; } - bool DbgIsBuggy( EditDoc const & rDoc ); + bool DbgIsBuggy( EditDoc const & rDoc ) const; friend bool operator == ( const EditPaM& r1, const EditPaM& r2 ); friend bool operator != ( const EditPaM& r1, const EditPaM& r2 ); @@ -697,7 +697,7 @@ public: bool HasRange() const { return aStartPaM != aEndPaM; } bool IsInvalid() const { return !aStartPaM || !aEndPaM; } - bool DbgIsBuggy( EditDoc const & rDoc ); + bool DbgIsBuggy( EditDoc const & rDoc ) const; void Adjust( const EditDoc& rNodes ); diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index cbe547d33dff..86e4b53fced9 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -1113,14 +1113,14 @@ void EditPaM::SetNode(ContentNode* p) pNode = p; } -bool EditPaM::DbgIsBuggy( EditDoc const & rDoc ) +bool EditPaM::DbgIsBuggy( EditDoc const & rDoc ) const { return !pNode || rDoc.GetPos( pNode ) >= rDoc.Count() || nIndex > pNode->Len(); } -bool EditSelection::DbgIsBuggy( EditDoc const & rDoc ) +bool EditSelection::DbgIsBuggy( EditDoc const & rDoc ) const { return aStartPaM.DbgIsBuggy( rDoc ) || aEndPaM.DbgIsBuggy( rDoc ); } diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 0511f68bec09..e8dab77f120f 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -2304,7 +2304,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 nMode, DeleteMode nDelMode ) { - OSL_ENSURE( !EditSelection( rSel ).DbgIsBuggy( aEditDoc ), "Index out of range in DeleteLeftOrRight" ); + OSL_ENSURE( !rSel.DbgIsBuggy( aEditDoc ), "Index out of range in DeleteLeftOrRight" ); if ( rSel.HasRange() ) // only then Delete Selection return ImpDeleteSelection( rSel ); |