summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-20 15:27:45 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-12-07 13:08:56 +0100
commitdb4ee864396a6a8813e800560454cf4053546ed2 (patch)
tree3b8ed5e010e09757688ded473110d9961b40e487
parentc96b562c7077089c8d4a903a8677c1bbd3b25b3a (diff)
sw_redlinehide_4a: more adapting of SwDoc::SetCounted()/SetNumRule()
Apply to/reset only the paragraph properties node. Change-Id: I4dd3973a758f4afcc30f905b7351e9687d050e33 (cherry picked from commit c2932c1005968b9d0f1500c6a018704e2ccd4658)
-rw-r--r--sw/inc/doc.hxx2
-rw-r--r--sw/source/core/doc/docnum.cxx26
-rw-r--r--sw/source/core/edit/ednumber.cxx4
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 );