summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-11-01 17:10:22 +0100
committerVladimir Glazunov <vg@openoffice.org>2010-11-01 17:10:22 +0100
commitca2e5d3b551e1b7bcc0b4f0c37b431927f6cbbff (patch)
treece52e47afdd7b6e0997ae25055eab9cf79ee4678
parentde31797d644e96938062ceb4c69c1cc2a89c7090 (diff)
parent9d2a02354ee9f95e43c8a5d5ad04335783a98fa5 (diff)
CWS-TOOLING: integrate CWS sw34bf02
Notes
split repo tag: writer_ooo/DEV300_m92
-rw-r--r--sw/source/core/doc/docnum.cxx71
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx11
-rw-r--r--sw/source/core/undo/rolbck.cxx8
3 files changed, 49 insertions, 41 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();
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index a708b2d60312..d6a6dfb045ac 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2570,9 +2570,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
+ // <SwTxtFrm> 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. <SwTxtNode::NumRuleChgd()> uses such a "noop" modify
+// if ( m_pHistory && ( pOld || pNew ) )
+ if ( m_pHistory && ( pOld || pNew ) &&
+ pOld != pNew )
+ // <--
{
if ( pNew->Which() < POOLATTR_END )
{