diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-20 18:26:18 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-12-01 08:44:44 +0100 |
commit | b070202b420129b5edd368420e0e50ec45261d01 (patch) | |
tree | 64967f05ceaf342270658a440346a2e9a9649b05 | |
parent | a382ecb5689ee425e77f830fd81b8696dc90a68b (diff) |
sw_redlinehide_4a: SwEditShell::IsMoveLeftMargin(), MoveLeftMargin()
Change-Id: I2bc29816af93ae265c0f0d11977b2d694e00ad6c
-rw-r--r-- | sw/inc/doc.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/edit/edattr.cxx | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 2a259413a5f3..a12024ffbd36 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1378,7 +1378,8 @@ public: /** Adjust left margin via object bar (similar to adjustment of numerations). One can either change the margin "by" adding or subtracting a given offset or set it "to" this position (bModulus = true). */ - void MoveLeftMargin( const SwPaM& rPam, bool bRight, bool bModulus ); + void MoveLeftMargin(const SwPaM& rPam, bool bRight, bool bModulus, + SwRootFrame const* pLayout = nullptr); // Query NumberFormatter. inline SvNumberFormatter* GetNumberFormatter( bool bCreate = true ); diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 9f75eecb6925..9f1391d683dd 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1638,7 +1638,8 @@ SwFormat* SwDoc::FindFormatByName( const SwFormatsBase& rFormatArr, return pFnd; } -void SwDoc::MoveLeftMargin( const SwPaM& rPam, bool bRight, bool bModulus ) +void SwDoc::MoveLeftMargin(const SwPaM& rPam, bool bRight, bool bModulus, + SwRootFrame const*const pLayout) { SwHistory* pHistory = nullptr; if (GetIDocumentUndoRedo().DoesUndo()) @@ -1658,6 +1659,7 @@ void SwDoc::MoveLeftMargin( const SwPaM& rPam, bool bRight, bool bModulus ) SwTextNode* pTNd = aIdx.GetNode().GetTextNode(); if( pTNd ) { + pTNd = sw::GetParaPropsNode(*pLayout, aIdx); SvxLRSpaceItem aLS( static_cast<const SvxLRSpaceItem&>(pTNd->SwContentNode::GetAttr( RES_LR_SPACE )) ); // #i93873# See also lcl_MergeListLevelIndentAsLRSpaceItem in thints.cxx @@ -1693,6 +1695,7 @@ void SwDoc::MoveLeftMargin( const SwPaM& rPam, bool bRight, bool bModulus ) SwRegHistory aRegH( pTNd, *pTNd, pHistory ); pTNd->SetAttr( aLS ); + aIdx = *sw::GetFirstAndLastNode(*pLayout, aIdx).second; } ++aIdx; } diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 53712252e315..b2c2eab75197 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -524,6 +524,7 @@ bool SwEditShell::IsMoveLeftMargin( bool bRight, bool bModulus ) const for( sal_uLong n = nSttNd; bRet && n <= nEndNd; ++n ) if( nullptr != ( pCNd = GetDoc()->GetNodes()[ n ]->GetTextNode() )) { + pCNd = sw::GetParaPropsNode(*GetLayout(), *pCNd); const SvxLRSpaceItem& rLS = static_cast<const SvxLRSpaceItem&>( pCNd->GetAttr( RES_LR_SPACE )); if( bRight ) @@ -563,10 +564,10 @@ void SwEditShell::MoveLeftMargin( bool bRight, bool bModulus ) SwPaM aPam( *pCursor->GetPoint() ); for( size_t n = 0; n < aRangeArr.Count(); ++n ) GetDoc()->MoveLeftMargin( aRangeArr.SetPam( n, aPam ), - bRight, bModulus ); + bRight, bModulus, GetLayout() ); } else - GetDoc()->MoveLeftMargin( *pCursor, bRight, bModulus ); + GetDoc()->MoveLeftMargin( *pCursor, bRight, bModulus, GetLayout() ); EndUndo( SwUndoId::END ); EndAllAction(); |