diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-24 10:59:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-24 19:55:25 +0100 |
commit | 897c3c8308ccfed1001e0ebc7b3461fbc0811f44 (patch) | |
tree | f3f63821eb7ab8d110279e97fade94a653013e8d /sw | |
parent | 9e12f49c6c1683f9a7545cc0b7f1082110d27df9 (diff) |
loplugin:constantparam
Change-Id: Ic5fe48315ed86d72371191df75866b8a1d72b249
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132033
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/IDocumentContentOperations.hxx | 7 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 37 | ||||
-rw-r--r-- | sw/source/core/inc/DocumentContentOperationsManager.hxx | 11 |
3 files changed, 18 insertions, 37 deletions
diff --git a/sw/inc/IDocumentContentOperations.hxx b/sw/inc/IDocumentContentOperations.hxx index 8f082a632d73..c9445ebc9281 100644 --- a/sw/inc/IDocumentContentOperations.hxx +++ b/sw/inc/IDocumentContentOperations.hxx @@ -138,13 +138,8 @@ public: virtual bool DelFullPara(SwPaM&) = 0; /** complete delete of a given PaM - - #i100466# - Add optional parameter <bForceJoinNext>, default value <false> - Needed for hiding of deletion redlines */ - virtual bool DeleteAndJoin( SwPaM&, - const bool bForceJoinNext = false ) = 0; + virtual bool DeleteAndJoin( SwPaM& ) = 0; virtual bool MoveRange(SwPaM&, SwPosition&, SwMoveFlags) = 0; diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index d94632d3b92a..1355c7a488b3 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -639,7 +639,7 @@ namespace { bool lcl_DoWithBreaks(::sw::DocumentContentOperationsManager & rDocumentContentOperations, SwPaM & rPam, - bool (::sw::DocumentContentOperationsManager::*pFunc)(SwPaM&, bool), const bool bForceJoinNext = false) + bool (::sw::DocumentContentOperationsManager::*pFunc)(SwPaM&)) { std::vector<std::pair<SwNodeOffset, sal_Int32>> Breaks; @@ -647,7 +647,7 @@ namespace if (Breaks.empty()) { - return (rDocumentContentOperations.*pFunc)(rPam, bForceJoinNext); + return (rDocumentContentOperations.*pFunc)(rPam); } // Deletion must be split into several parts if the text node @@ -671,7 +671,7 @@ namespace rStart = SwPosition(*rNodes[iter->first - nOffset]->GetTextNode(), iter->second + 1); if (rStart < rEnd) // check if part is empty { - bRet &= (rDocumentContentOperations.*pFunc)(aPam, bForceJoinNext); + bRet &= (rDocumentContentOperations.*pFunc)(aPam); nOffset = iter->first - rStart.nNode.GetIndex(); // deleted fly nodes... } rEnd = SwPosition(*rNodes[iter->first - nOffset]->GetTextNode(), iter->second); @@ -681,7 +681,7 @@ namespace rStart = *rPam.Start(); // set to original start if (rStart < rEnd) // check if part is empty { - bRet &= (rDocumentContentOperations.*pFunc)(aPam, bForceJoinNext); + bRet &= (rDocumentContentOperations.*pFunc)(aPam); } return bRet; @@ -2292,17 +2292,14 @@ bool DocumentContentOperationsManager::DelFullPara( SwPaM& rPam ) return true; } -// #i100466# Add handling of new optional parameter <bForceJoinNext> -bool DocumentContentOperationsManager::DeleteAndJoin( SwPaM & rPam, - const bool bForceJoinNext ) +bool DocumentContentOperationsManager::DeleteAndJoin( SwPaM & rPam ) { if ( lcl_StrLenOverflow( rPam ) ) return false; bool const ret = lcl_DoWithBreaks( *this, rPam, (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn()) ? &DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl - : &DocumentContentOperationsManager::DeleteAndJoinImpl, - bForceJoinNext ); + : &DocumentContentOperationsManager::DeleteAndJoinImpl ); return ret; } @@ -3494,7 +3491,7 @@ bool DocumentContentOperationsManager::ReplaceRange( SwPaM& rPam, const OUString { bRet &= (m_rDoc.getIDocumentRedlineAccess().IsRedlineOn()) ? DeleteAndJoinWithRedlineImpl(aPam) - : DeleteAndJoinImpl(aPam, false); + : DeleteAndJoinImpl(aPam); nOffset = iter->first - rStart.nNode.GetIndex(); // deleted fly nodes... } rEnd = SwPosition(*rNodes[iter->first - nOffset]->GetTextNode(), iter->second); @@ -4067,7 +4064,7 @@ DocumentContentOperationsManager::~DocumentContentOperationsManager() } //Private methods -bool DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPam, const bool ) +bool DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPam ) { assert(m_rDoc.getIDocumentRedlineAccess().IsRedlineOn()); @@ -4209,22 +4206,14 @@ bool DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPa return true; } -bool DocumentContentOperationsManager::DeleteAndJoinImpl( SwPaM & rPam, - const bool bForceJoinNext ) +bool DocumentContentOperationsManager::DeleteAndJoinImpl( SwPaM & rPam ) { bool bJoinText, bJoinPrev; ::sw_GetJoinFlags( rPam, bJoinText, bJoinPrev ); - // #i100466# - if ( bForceJoinNext ) - { - bJoinPrev = false; - } - { - bool const bSuccess( DeleteRangeImpl( rPam ) ); - if (!bSuccess) - return false; - } + bool const bSuccess( DeleteRangeImpl( rPam ) ); + if (!bSuccess) + return false; if( bJoinText ) { @@ -4240,7 +4229,7 @@ bool DocumentContentOperationsManager::DeleteAndJoinImpl( SwPaM & rPam, return true; } -bool DocumentContentOperationsManager::DeleteRangeImpl(SwPaM & rPam, const bool) +bool DocumentContentOperationsManager::DeleteRangeImpl(SwPaM & rPam) { // Move all cursors out of the deleted range, but first copy the // passed PaM, because it could be a cursor that would be moved! diff --git a/sw/source/core/inc/DocumentContentOperationsManager.hxx b/sw/source/core/inc/DocumentContentOperationsManager.hxx index e81c62d1d9e0..89f0f81da62d 100644 --- a/sw/source/core/inc/DocumentContentOperationsManager.hxx +++ b/sw/source/core/inc/DocumentContentOperationsManager.hxx @@ -44,10 +44,7 @@ public: bool DelFullPara(SwPaM&) override; - // Add optional parameter <bForceJoinNext>, default value <false> - // Needed for hiding of deletion redlines - bool DeleteAndJoin( SwPaM&, - const bool bForceJoinNext = false ) override; + bool DeleteAndJoin( SwPaM& ) override; bool MoveRange(SwPaM&, SwPosition&, SwMoveFlags) override; @@ -163,9 +160,9 @@ private: bool m_bIME = false; - bool DeleteAndJoinImpl(SwPaM&, const bool); - bool DeleteAndJoinWithRedlineImpl(SwPaM&, const bool unused = false); - bool DeleteRangeImpl(SwPaM&, const bool unused = false); + bool DeleteAndJoinImpl(SwPaM&); + bool DeleteAndJoinWithRedlineImpl(SwPaM&); + bool DeleteRangeImpl(SwPaM&); bool DeleteRangeImplImpl(SwPaM &); bool ReplaceRangeImpl(SwPaM&, OUString const&, const bool); SwFlyFrameFormat* InsNoTextNode( const SwPosition&rPos, SwNoTextNode*, |