From a85597f1483a6727ae57ae6ac64776e0895fb938 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Tue, 5 Oct 2010 11:23:32 +0200 Subject: sw34bf02: #i114861# method - do not handle a "noop" modify --- sw/source/core/txtnode/ndtxt.cxx | 11 ++++++++--- sw/source/core/undo/rolbck.cxx | 8 +++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 76560bae91d7..21b5b17000d8 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -2566,9 +2566,14 @@ void SwTxtNode::NumRuleChgd() } SetInSwFntCache( FALSE ); - SvxLRSpaceItem& rLR = (SvxLRSpaceItem&)GetSwAttrSet().GetLRSpace(); - - SwModify::Modify( &rLR, &rLR ); + // Sending "noop" modify in order to cause invalidations of registered + // instances to get the list style change respectively the change + // in the list tree reflected in the layout. + // Important note: + { + SvxLRSpaceItem& rLR = (SvxLRSpaceItem&)GetSwAttrSet().GetLRSpace(); + SwModify::Modify( &rLR, &rLR ); + } } // -> #i27615# diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 6df9f9aa24b8..d9a0cc8514a4 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -1389,7 +1389,13 @@ SwRegHistory::SwRegHistory( const SwNode& rNd, SwHistory* pHst ) void SwRegHistory::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) { - if ( m_pHistory && ( pOld || pNew ) ) + // --> OD 2010-10-05 #i114861# + // Do not handle a "noop" modify + // - e.g. uses such a "noop" modify +// if ( m_pHistory && ( pOld || pNew ) ) + if ( m_pHistory && ( pOld || pNew ) && + pOld != pNew ) + // <-- { if ( pNew->Which() < POOLATTR_END ) { -- cgit v1.2.3 From 9f18a1180e87ff4391b1be18226ccd781e370aeb Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Tue, 5 Oct 2010 16:30:33 +0200 Subject: sw34bf02: #i114929# methods and - on reset of indentation/list-counted attribute assure that all paragraphs are covered --- sw/source/core/doc/docnum.cxx | 71 +++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 1224c5c02f17..6ba37816b0dc 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -1092,7 +1092,23 @@ void SwDoc::SetNumRule( const SwPaM& rPam, { SvUShortsSort aResetAttrsArray; aResetAttrsArray.Insert( RES_LR_SPACE ); - ResetAttrs( rPam, sal_True, &aResetAttrsArray ); + // --> OD 2010-10-05 #i114929# + // On a selection setup a corresponding Point-and-Mark in order to get + // the indentation attribute reset on all paragraphs touched by the selection + if ( rPam.HasMark() && + rPam.End()->nNode.GetNode().GetTxtNode() ) + { + SwPaM aPam( rPam.Start()->nNode, + rPam.End()->nNode ); + aPam.Start()->nContent = 0; + aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTxtNode()->Len(); + ResetAttrs( aPam, FALSE, &aResetAttrsArray ); + } + else + { + ResetAttrs( rPam, FALSE, &aResetAttrsArray ); + } + // <-- } // <-- @@ -1104,22 +1120,27 @@ void SwDoc::SetNumRule( const SwPaM& rPam, void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted) { - // --> OD 2008-04-03 #refactorlists# -// ULONG nStartPos = rPam.Start()->nNode.GetIndex(); -// ULONG nEndPos = rPam.End()->nNode.GetIndex(); - -// for (ULONG n = nStartPos; n <= nEndPos; n++) -// { -// SwTxtNode * pNd = GetNodes()[n]->GetTxtNode(); - -// if (pNd) -// pNd->SetCountedInList(bCounted); -// } if ( bCounted ) { SvUShortsSort aResetAttrsArray; aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED ); - ResetAttrs( rPam, sal_True, &aResetAttrsArray ); + // --> OD 2010-10-05 #i114929# + // On a selection setup a corresponding Point-and-Mark in order to get + // the list-is-counted attribute reset on all paragraphs touched by the selection + if ( rPam.HasMark() && + rPam.End()->nNode.GetNode().GetTxtNode() ) + { + SwPaM aPam( rPam.Start()->nNode, + rPam.End()->nNode ); + aPam.Start()->nContent = 0; + aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTxtNode()->Len(); + ResetAttrs( aPam, FALSE, &aResetAttrsArray ); + } + else + { + ResetAttrs( rPam, FALSE, &aResetAttrsArray ); + } + // <-- } else { @@ -1128,30 +1149,6 @@ void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted) } } -//void SwDoc::ReplaceNumRule(const SwPaM & rPaM, const SwNumRule & rNumRule) -//{ -// if (DoesUndo()) -// StartUndo(UNDO_START, NULL); - -// ULONG nStt = rPaM.Start()->nNode.GetIndex(); -// ULONG nEnd = rPaM.End()->nNode.GetIndex(); - -// for (ULONG n = nStt; n <= nEnd; n++) -// { -// SwTxtNode * pCNd = GetNodes()[n]->GetTxtNode(); - -// if (pCNd && NULL != pCNd->GetNumRule()) -// { -// SwPaM aPam(*pCNd); - -// InsertPoolItem(aPam, SwNumRuleItem(rNumRule.GetName()), 0); -// } -// } - -// if (DoesUndo()) -// EndUndo(UNDO_START, NULL); -//} - void SwDoc::SetNumRuleStart( const SwPosition& rPos, BOOL bFlag ) { SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode(); -- cgit v1.2.3