Kaydet (Commit) db4ee864 authored tarafından Michael Stahl's avatar Michael Stahl Kaydeden (comit) Thorsten Behrens

sw_redlinehide_4a: more adapting of SwDoc::SetCounted()/SetNumRule()

Apply to/reset only the paragraph properties node.

Change-Id: I4dd3973a758f4afcc30f905b7351e9687d050e33
(cherry picked from commit c2932c10)
üst c96b562c
...@@ -1030,7 +1030,7 @@ public: ...@@ -1030,7 +1030,7 @@ public:
const OUString& sContinuedListId = OUString(), const OUString& sContinuedListId = OUString(),
bool bSetItem = true, bool bSetItem = true,
const bool bResetIndentAttrs = false ); const bool bResetIndentAttrs = false );
void SetCounted( const SwPaM&, bool bCounted); void SetCounted(const SwPaM&, bool bCounted, SwRootFrame const* pLayout);
void MakeUniqueNumRules(const SwPaM & rPaM); void MakeUniqueNumRules(const SwPaM & rPaM);
......
...@@ -65,7 +65,8 @@ ...@@ -65,7 +65,8 @@
namespace { 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; std::set<sal_uInt16> aResetAttrsArray;
aResetAttrsArray.insert( marker ); aResetAttrsArray.insert( marker );
...@@ -79,11 +80,11 @@ namespace { ...@@ -79,11 +80,11 @@ namespace {
rPam.End()->nNode ); rPam.End()->nNode );
aPam.Start()->nContent = 0; aPam.Start()->nContent = 0;
aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTextNode()->Len(); aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTextNode()->Len();
pDoc->ResetAttrs( aPam, false, aResetAttrsArray ); pDoc->ResetAttrs( aPam, false, aResetAttrsArray, true, pLayout );
} }
else else
{ {
pDoc->ResetAttrs( rPam, false, aResetAttrsArray ); pDoc->ResetAttrs( rPam, false, aResetAttrsArray, true, pLayout );
} }
} }
...@@ -914,7 +915,9 @@ OUString SwDoc::SetNumRule( const SwPaM& rPam, ...@@ -914,7 +915,9 @@ OUString SwDoc::SetNumRule( const SwPaM& rPam,
} }
if (!sListId.isEmpty()) 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, ...@@ -955,13 +958,15 @@ OUString SwDoc::SetNumRule( const SwPaM& rPam,
if ( bSetItem ) if ( bSetItem )
{ {
getIDocumentContentOperations().InsertPoolItem(aPam, SwNumRuleItem(pNewOrChangedNumRule->GetName())); getIDocumentContentOperations().InsertPoolItem(aPam,
SwNumRuleItem(pNewOrChangedNumRule->GetName()),
SetAttrMode::DEFAULT, pLayout);
} }
if ( bResetIndentAttrs if ( bResetIndentAttrs
&& pNewOrChangedNumRule->Get( 0 ).GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) && 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()) if (GetIDocumentUndoRedo().DoesUndo())
...@@ -974,15 +979,18 @@ OUString SwDoc::SetNumRule( const SwPaM& rPam, ...@@ -974,15 +979,18 @@ OUString SwDoc::SetNumRule( const SwPaM& rPam,
return sListId; return sListId;
} }
void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted) void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted,
SwRootFrame const*const pLayout)
{ {
if ( bCounted ) if ( bCounted )
{ {
::lcl_ResetIndentAttrs(this, rPam, RES_PARATR_LIST_ISCOUNTED); ::lcl_ResetIndentAttrs(this, rPam, RES_PARATR_LIST_ISCOUNTED, pLayout);
} }
else else
{ {
getIDocumentContentOperations().InsertPoolItem( rPam, SfxBoolItem( RES_PARATR_LIST_ISCOUNTED, false ) ); getIDocumentContentOperations().InsertPoolItem(rPam,
SfxBoolItem(RES_PARATR_LIST_ISCOUNTED, false),
SetAttrMode::DEFAULT, pLayout);
} }
} }
......
...@@ -798,7 +798,7 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, ...@@ -798,7 +798,7 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule,
bCreateNewList = false; bCreateNewList = false;
} }
GetDoc()->SetCounted( aPam, true ); GetDoc()->SetCounted(aPam, true, GetLayout());
} }
} }
else else
...@@ -806,7 +806,7 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, ...@@ -806,7 +806,7 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule,
GetDoc()->SetNumRule( *pCursor, rRule, GetDoc()->SetNumRule( *pCursor, rRule,
bCreateNewList, GetLayout(), rContinuedListId, bCreateNewList, GetLayout(), rContinuedListId,
true, bResetIndentAttrs ); true, bResetIndentAttrs );
GetDoc()->SetCounted( *pCursor, true ); GetDoc()->SetCounted( *pCursor, true, GetLayout() );
} }
GetDoc()->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr ); GetDoc()->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment