diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-08-10 18:34:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-08-13 10:13:00 +0200 |
commit | 8d99841e2c2884d3305d1643b95f88f460bb8b6e (patch) | |
tree | 216aa69df00788c7e78f6a134ceb9838fcca2021 | |
parent | 0cedac9c64fe4d636be66d43d89c4c939865359b (diff) |
pass SwNode instead of SwNodeIndex to SwNodes::MergeTable
part of the process of hiding the internals of SwPosition
Change-Id: Ia3b2563c23aaaf86f58b56bcdd60ded3c9d8404f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138219
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/inc/ndarr.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/undo/untbl.cxx | 2 |
3 files changed, 5 insertions, 7 deletions
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx index e95d5bf7e7dc..386b01aae663 100644 --- a/sw/inc/ndarr.hxx +++ b/sw/inc/ndarr.hxx @@ -293,7 +293,7 @@ public: SwTableNode* SplitTable( const SwNodeIndex& rPos, bool bAfter = true, bool bCalcNewSize = false ); /// Two Tables that are following one another are merged. - bool MergeTable( const SwNodeIndex& rPos, bool bWithPrev = true, + bool MergeTable( SwNode& rPos, bool bWithPrev = true, sal_uInt16 nMode = 0 ); /// Insert a new SwSection. diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 9f8c6833ff3d..7b0641da54dc 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -3508,8 +3508,7 @@ bool SwDoc::MergeTable( const SwPosition& rPos, bool bWithPrev, sal_uInt16 nMode getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); // The actual merge - SwNodeIndex aIdx( bWithPrev ? *pTableNd : *pDelTableNd ); - bool bRet = rNds.MergeTable( aIdx, !bWithPrev, nMode ); + bool bRet = rNds.MergeTable( bWithPrev ? *pTableNd : *pDelTableNd, !bWithPrev, nMode ); if( pHistory ) { @@ -3527,10 +3526,9 @@ bool SwDoc::MergeTable( const SwPosition& rPos, bool bWithPrev, sal_uInt16 nMode return bRet; } -bool SwNodes::MergeTable( const SwNodeIndex& rPos, bool bWithPrev, - sal_uInt16 nMode ) +bool SwNodes::MergeTable( SwNode& rPos, bool bWithPrev, sal_uInt16 nMode ) { - SwTableNode* pDelTableNd = rPos.GetNode().GetTableNode(); + SwTableNode* pDelTableNd = rPos.GetTableNode(); OSL_ENSURE( pDelTableNd, "Where did the TableNode go?" ); SwTableNode* pTableNd = (*this)[ rPos.GetIndex() - 1]->FindTableNode(); diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 7e96d8fe04bb..e27f534bd8a4 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -2893,7 +2893,7 @@ void SwUndoSplitTable::UndoImpl(::sw::UndoRedoContext & rContext) default: break; } - pDoc->GetNodes().MergeTable( rIdx ); + pDoc->GetNodes().MergeTable( rIdx.GetNode() ); if( m_pHistory ) { |