diff options
author | Michael Stahl <mst@openoffice.org> | 2010-12-15 09:14:07 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-12-15 09:14:07 +0100 |
commit | 0cf58fb120e691be7ca22f0537d104e0af0955c3 (patch) | |
tree | ad03277688cd398e5d22e4a06659cf7fcf055864 /sw | |
parent | d97bce1d294db09a49952cab22495838665ec9f0 (diff) |
undoapi: #i115383#: remove duplicative SwUndoSort::RemoveIdx()
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/undobj.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/undo/unsort.cxx | 45 |
2 files changed, 8 insertions, 38 deletions
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index 11da23447f4a..f20018ab91e5 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -1145,7 +1145,6 @@ class SwUndoSort : public SwUndo, private SwUndRng SwRedlineData* pRedlData; ULONG nTblNd; - void RemoveIdx( SwPaM& rPam ); public: SwUndoSort( const SwPaM&, const SwSortOptions& ); SwUndoSort( ULONG nStt, ULONG nEnd, const SwTableNode&, diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx index a79392d8281a..0a32f8e3e084 100644 --- a/sw/source/core/undo/unsort.cxx +++ b/sw/source/core/undo/unsort.cxx @@ -27,6 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include <doc.hxx> #include <swundo.hxx> // fuer die UndoIds #include <pam.hxx> @@ -34,9 +35,7 @@ #include <ndtxt.hxx> #include <undobj.hxx> #include <sortopt.hxx> -#ifndef _DOCSORT_HXX #include <docsort.hxx> -#endif #include <redline.hxx> #include <node2lay.hxx> @@ -69,7 +68,6 @@ SwUndoSort::SwUndoSort(const SwPaM& rRg, const SwSortOptions& rOpt) pSortOpt = new SwSortOptions(rOpt); } - SwUndoSort::SwUndoSort( ULONG nStt, ULONG nEnd, const SwTableNode& rTblNd, const SwSortOptions& rOpt, BOOL bSaveTable ) : SwUndo(UNDO_SORT_TBL), pUndoTblAttr( 0 ), pRedlData( 0 ) @@ -83,8 +81,6 @@ SwUndoSort::SwUndoSort( ULONG nStt, ULONG nEnd, const SwTableNode& rTblNd, pUndoTblAttr = new SwUndoAttrTbl( rTblNd ); } - - SwUndoSort::~SwUndoSort() { delete pSortOpt; @@ -92,8 +88,6 @@ SwUndoSort::~SwUndoSort() delete pRedlData; } - - void SwUndoSort::Undo( SwUndoIter& rIter) { SwDoc& rDoc = rIter.GetDoc(); @@ -141,7 +135,9 @@ void SwUndoSort::Undo( SwUndoIter& rIter) else { // Undo Text - RemoveIdx( *rIter.pAktPam ); + SwPaM & rPam( *rIter.pAktPam ); + SetPaM(rPam); + RemoveIdxFromRange(rPam, true); // fuer die sorted Positions einen Index anlegen. // JP 25.11.97: Die IndexList muss aber nach SourcePosition @@ -172,7 +168,6 @@ void SwUndoSort::Undo( SwUndoIter& rIter) } } - void SwUndoSort::Redo( SwUndoIter& rIter) { SwDoc& rDoc = rIter.GetDoc(); @@ -219,8 +214,10 @@ void SwUndoSort::Redo( SwUndoIter& rIter) } else { - // Redo bei Text - RemoveIdx( *rIter.pAktPam ); + // Redo for Text + SwPaM & rPam( *rIter.pAktPam ); + SetPaM(rPam); + RemoveIdxFromRange(rPam, true); SwUndoSortList aIdxList( (BYTE)aSortList.Count() ); USHORT i; @@ -248,7 +245,6 @@ void SwUndoSort::Redo( SwUndoIter& rIter) } } - void SwUndoSort::Repeat(SwUndoIter& rIter) { // table not repeat capable @@ -262,40 +258,15 @@ void SwUndoSort::Repeat(SwUndoIter& rIter) } } - -void SwUndoSort::RemoveIdx( SwPaM& rPam ) -{ - rPam.DeleteMark(); - rPam.GetPoint()->nNode = nSttNode; - - SwCntntNode* pCNd = rPam.GetCntntNode(); - xub_StrLen nLen = pCNd->Len(); - if( nLen >= nSttCntnt ) - nLen = nSttCntnt; - rPam.GetPoint()->nContent.Assign(pCNd, nLen ); - rPam.SetMark(); - - rPam.GetPoint()->nNode = nEndNode; - pCNd = rPam.GetCntntNode(); - nLen = pCNd->Len(); - if( nLen >= nEndCntnt ) - nLen = nEndCntnt; - rPam.GetPoint()->nContent.Assign(pCNd, nLen ); - RemoveIdxFromRange( rPam, TRUE ); -} - - void SwUndoSort::Insert( const String& rOrgPos, const String& rNewPos) { SwSortUndoElement* pEle = new SwSortUndoElement(rOrgPos, rNewPos); aSortList.C40_INSERT( SwSortUndoElement, pEle, aSortList.Count() ); } - void SwUndoSort::Insert( ULONG nOrgPos, ULONG nNewPos) { SwSortUndoElement* pEle = new SwSortUndoElement(nOrgPos, nNewPos); aSortList.C40_INSERT( SwSortUndoElement, pEle, aSortList.Count() ); } - |