From 233fb078ba9adff0ff2dba3455a7ba185aa308f6 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 4046cbc59f..18c9a0d90d 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 9526112d0e..8beea93a9b 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 4e8d3d088722cf6ee142b182e4d2b808a9a7fa11 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 95ba6541c4..bb15b47941 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