diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-20 15:27:45 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-12-01 08:44:44 +0100 |
commit | c2932c1005968b9d0f1500c6a018704e2ccd4658 (patch) | |
tree | 52031f4e4cb8c06edd356291e29e2945912dd764 /sw | |
parent | 68093f957d936f938213290c790443ed83435361 (diff) |
sw_redlinehide_4a: more adapting of SwDoc::SetCounted()/SetNumRule()
Apply to/reset only the paragraph properties node.
Change-Id: I4dd3973a758f4afcc30f905b7351e9687d050e33
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/doc.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docnum.cxx | 26 | ||||
-rw-r--r-- | sw/source/core/edit/ednumber.cxx | 4 |
3 files changed, 20 insertions, 12 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 4905ede420ee..2a259413a5f3 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1030,7 +1030,7 @@ public: const OUString& sContinuedListId = OUString(), bool bSetItem = true, const bool bResetIndentAttrs = false ); - void SetCounted( const SwPaM&, bool bCounted); + void SetCounted(const SwPaM&, bool bCounted, SwRootFrame const* pLayout); void MakeUniqueNumRules(const SwPaM & rPaM); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 508ff29ecd91..852cd0c8ff48 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -65,7 +65,8 @@ namespace { - void lcl_ResetIndentAttrs(SwDoc *pDoc, const SwPaM &rPam, sal_uInt16 marker ) + void lcl_ResetIndentAttrs(SwDoc *pDoc, const SwPaM &rPam, sal_uInt16 marker, + SwRootFrame const*const pLayout) { std::set<sal_uInt16> aResetAttrsArray; aResetAttrsArray.insert( marker ); @@ -79,11 +80,11 @@ namespace { rPam.End()->nNode ); aPam.Start()->nContent = 0; aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTextNode()->Len(); - pDoc->ResetAttrs( aPam, false, aResetAttrsArray ); + pDoc->ResetAttrs( aPam, false, aResetAttrsArray, true, pLayout ); } else { - pDoc->ResetAttrs( rPam, false, aResetAttrsArray ); + pDoc->ResetAttrs( rPam, false, aResetAttrsArray, true, pLayout ); } } @@ -914,7 +915,9 @@ OUString SwDoc::SetNumRule( const SwPaM& rPam, } if (!sListId.isEmpty()) { - getIDocumentContentOperations().InsertPoolItem(aPam, SfxStringItem(RES_PARATR_LIST_ID, sListId)); + getIDocumentContentOperations().InsertPoolItem(aPam, + SfxStringItem(RES_PARATR_LIST_ID, sListId), + SetAttrMode::DEFAULT, pLayout); } } @@ -955,13 +958,15 @@ OUString SwDoc::SetNumRule( const SwPaM& rPam, if ( bSetItem ) { - getIDocumentContentOperations().InsertPoolItem(aPam, SwNumRuleItem(pNewOrChangedNumRule->GetName())); + getIDocumentContentOperations().InsertPoolItem(aPam, + SwNumRuleItem(pNewOrChangedNumRule->GetName()), + SetAttrMode::DEFAULT, pLayout); } if ( bResetIndentAttrs && pNewOrChangedNumRule->Get( 0 ).GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) { - ::lcl_ResetIndentAttrs(this, aPam, RES_LR_SPACE); + ::lcl_ResetIndentAttrs(this, aPam, RES_LR_SPACE, pLayout); } if (GetIDocumentUndoRedo().DoesUndo()) @@ -974,15 +979,18 @@ OUString SwDoc::SetNumRule( const SwPaM& rPam, return sListId; } -void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted) +void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted, + SwRootFrame const*const pLayout) { if ( bCounted ) { - ::lcl_ResetIndentAttrs(this, rPam, RES_PARATR_LIST_ISCOUNTED); + ::lcl_ResetIndentAttrs(this, rPam, RES_PARATR_LIST_ISCOUNTED, pLayout); } else { - getIDocumentContentOperations().InsertPoolItem( rPam, SfxBoolItem( RES_PARATR_LIST_ISCOUNTED, false ) ); + getIDocumentContentOperations().InsertPoolItem(rPam, + SfxBoolItem(RES_PARATR_LIST_ISCOUNTED, false), + SetAttrMode::DEFAULT, pLayout); } } diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index ee35d6e8be8e..8a484b085406 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -798,7 +798,7 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, bCreateNewList = false; } - GetDoc()->SetCounted( aPam, true ); + GetDoc()->SetCounted(aPam, true, GetLayout()); } } else @@ -806,7 +806,7 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, GetDoc()->SetNumRule( *pCursor, rRule, bCreateNewList, GetLayout(), rContinuedListId, true, bResetIndentAttrs ); - GetDoc()->SetCounted( *pCursor, true ); + GetDoc()->SetCounted( *pCursor, true, GetLayout() ); } GetDoc()->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr ); |