diff options
author | Mathias Bauer <mba@openoffice.org> | 2010-12-21 20:49:11 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2010-12-21 20:49:11 +0100 |
commit | 3275b3cb9871b62354de77531b5f2826acec9388 (patch) | |
tree | 2b3a6ed891aacbf225636751d9820c225f1cec51 /sw/source/core/doc/docnum.cxx | |
parent | b6678b3510a7dca0dec5588e1c5dbdbf8e85d303 (diff) | |
parent | e41098c7b4b08da66511301d834782effa50915d (diff) |
CWS swlayoutrefactoring: resync to m96, no conflict resolution
Diffstat (limited to 'sw/source/core/doc/docnum.cxx')
-rw-r--r-- | sw/source/core/doc/docnum.cxx | 71 |
1 files changed, 34 insertions, 37 deletions
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 648500d36d..f79d0abcfd 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -1087,7 +1087,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 ); + } + // <-- } // <-- @@ -1099,22 +1115,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 { @@ -1123,30 +1144,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(); |