[Libreoffice-commits] .: 3 commits - sw/source
Tor Lillqvist
tml at kemper.freedesktop.org
Wed May 30 13:47:32 PDT 2012
sw/source/core/undo/rolbck.cxx | 115 +++++----------------------------------
sw/source/core/undo/unattr.cxx | 46 ---------------
sw/source/core/undo/undel.cxx | 116 ++++++++++++++++++++--------------------
sw/source/core/undo/undobj.cxx | 103 +++++++++++++++--------------------
sw/source/core/undo/undobj1.cxx | 23 +------
sw/source/core/undo/unmove.cxx | 18 +-----
sw/source/core/undo/unnum.cxx | 25 --------
sw/source/core/undo/unovwr.cxx | 22 -------
sw/source/core/undo/unredln.cxx | 17 -----
sw/source/core/undo/untbl.cxx | 12 ----
sw/source/core/undo/untblk.cxx | 55 +++++++-----------
11 files changed, 153 insertions(+), 399 deletions(-)
New commits:
commit 4e22b45d383cdcb660bcc335322a4c4957b55b43
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Wed May 30 21:17:44 2012 +0200
Clean up and translate comments
Change-Id: I7ecc27535622d7ee63251005f0768ea3cb47623b
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index b0a42ff..d397680 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -26,8 +26,6 @@
*
************************************************************************/
-
-
#include <IShellCursorSupplier.hxx>
#include <txtftn.hxx>
#include <fmtanchr.hxx>
@@ -69,8 +67,6 @@ public:
SV_IMPL_PTRARR( SwRedlineSaveDatas, SwRedlineSaveDataPtr )
-
-//------------------------------------------------------------
// This class saves the Pam as sal_uInt16s and can recompose those into a PaM
SwUndRng::SwUndRng()
: nSttNode( 0 ), nEndNode( 0 ), nSttCntnt( 0 ), nEndCntnt( 0 )
@@ -137,10 +133,6 @@ SwPaM & SwUndRng::AddUndoRedoPaM(
return rPaM;
}
-
-//------------------------------------------------------------
-
-
void SwUndo::RemoveIdxFromSection( SwDoc& rDoc, sal_uLong nSttIdx,
sal_uLong* pEndIdx )
{
@@ -180,7 +172,8 @@ void SwUndo::RemoveIdxFromRange( SwPaM& rPam, sal_Bool bMoveNext )
void SwUndo::RemoveIdxRel( sal_uLong nIdx, const SwPosition& rPos )
{
- // Move only the Crsr. Bookmarks/TOXMarks/etc. are done by the corresponding JoinNext/JoinPrev
+ // Move only the Crsr. Bookmarks/TOXMarks/etc. are done by the corresponding
+ // JoinNext/JoinPrev
SwNodeIndex aIdx( rPos.nNode.GetNode().GetNodes(), nIdx );
::PaMCorrRel( aIdx, rPos );
}
@@ -202,7 +195,6 @@ SwUndo::~SwUndo()
delete pComment;
}
-
class UndoRedoRedlineGuard
{
public:
@@ -322,9 +314,6 @@ SwRewriter SwUndo::GetRewriter() const
return aResult;
}
-
-//------------------------------------------------------------
-
SwUndoSaveCntnt::SwUndoSaveCntnt()
: pHistory( 0 )
{}
@@ -334,15 +323,14 @@ SwUndoSaveCntnt::~SwUndoSaveCntnt()
delete pHistory;
}
- // This is needed when deleting content. For REDO all contents will be moved into the
- // UndoNodesArray. These methods add a seperator for the attributes to the end of TextNodes.
- // As a result, the attributes will not be expanded.
- // - MoveTo moves from NodesArray into UndoNodesArray
- // - MoveFrom moves from UndoNodesArray into NodesArray
-
- // 2.8.93: If pEndNdIdx is given, Undo/Redo calls -Ins/DelFly.
- // In that case the whole section should be moved.
-
+// This is needed when deleting content. For REDO all contents will be moved
+// into the UndoNodesArray. These methods add a seperator for the attributes to
+// the end of TextNodes. As a result, the attributes will not be expanded.
+// - MoveTo moves from NodesArray into UndoNodesArray
+// - MoveFrom moves from UndoNodesArray into NodesArray
+//
+// If pEndNdIdx is given, Undo/Redo calls -Ins/DelFly. In that case the whole
+// section should be moved.
void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx,
SwIndex* pCntIdx, sal_uLong* pEndNdIdx, xub_StrLen* pEndCntIdx )
{
@@ -389,13 +377,14 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx,
SwTxtNode* pTxtNd = aPos.nNode.GetNode().GetTxtNode();
if( pTxtNd ) // add a seperator for the attributes
{
- // But since all attributes will be touched at an insert (meaning deleted from the
- // array and re-added again), attributes might disappear (e.g. "no bold" for 10-20,
- // "bold" for 12-15 -> when inserting/deleting, the "bold" will be deleted, which is
- // not wanted here!)! Thus do not touch the hints but manipulate the string directly.
-
+ // But since all attributes will be touched at an insert (meaning
+ // deleted from the array and re-added again), attributes might
+ // disappear (e.g. "no bold" for 10-20, "bold" for 12-15 -> when
+ // inserting/deleting, the "bold" will be deleted, which is not
+ // wanted here!)! Thus do not touch the hints but manipulate the
+ // string directly.
String& rStr = (String&)pTxtNd->GetTxt();
- // For security reasons better only if positioned at the end
+ // For safety reasons better only if positioned at the end
if( rStr.Len() == aPos.nContent.GetIndex() )
{
rStr.Insert( ' ' );
@@ -494,10 +483,10 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx,
}
}
-// These two methods move the Point of Pam backwards/forwards. With that, one can span an area for
-// a Undo/Redo. (The Point is then positioned in front of the area to manipulate!!)
+// These two methods move the Point of Pam backwards/forwards. With that, one
+// can span an area for a Undo/Redo. (The Point is then positioned in front of
+// the area to manipulate!)
// The flag indicates if there is still content in front of Point.
-
sal_Bool SwUndoSaveCntnt::MovePtBackward( SwPaM& rPam )
{
rPam.SetMark();
@@ -517,7 +506,7 @@ void SwUndoSaveCntnt::MovePtForward( SwPaM& rPam, sal_Bool bMvBkwrd )
if( bMvBkwrd )
rPam.Move( fnMoveForward );
else
- { // set Point to the next position
+ {
rPam.GetPoint()->nNode++;
SwCntntNode* pCNd = rPam.GetCntntNode();
if( pCNd )
@@ -528,14 +517,13 @@ void SwUndoSaveCntnt::MovePtForward( SwPaM& rPam, sal_Bool bMvBkwrd )
}
-/*
- JP 21.03.94: Delete all objects that have ContentIndices to the given area.
- Currently these exist:
- - Footnotes
- - Flys
- - Bookmarks
- - Directories
-*/
+// Delete all objects that have ContentIndices to the given area.
+// Currently (1994) these exist:
+// - Footnotes
+// - Flys
+// - Bookmarks
+// - Directories
+//
// #i81002# - extending method
// delete certain (not all) cross-reference bookmarks at text node of <rMark>
// and at text node of <rPoint>, if these text nodes aren't the same.
@@ -578,8 +566,10 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
continue;
}
- // Unfortunately an index needs to be created. Otherwise there will be problems
- // with TextNode because the index will be deleted in the DTOR of SwFtn!
+// FIXME: duplicated code here and below -> refactor?
+ // Unfortunately an index needs to be created. Otherwise there
+ // will be problems with TextNode because the index will be
+ // deleted in the DTOR of SwFtn!
SwTxtNode* pTxtNd = (SwTxtNode*)pFtnNd;
if( !pHistory )
pHistory = new SwHistory;
@@ -602,8 +592,9 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
nFtnSttIdx >= pEnd->nContent.GetIndex() )))
continue; // continue searching
- // Unfortunately an index needs to be created. Otherwise there will be problems
- // with TextNode because the index will be deleted in the DTOR of SwFtn!
+ // Unfortunately an index needs to be created. Otherwise there
+ // will be problems with TextNode because the index will be
+ // deleted in the DTOR of SwFtn!
SwTxtNode* pTxtNd = (SwTxtNode*)pFtnNd;
if( !pHistory )
pHistory = new SwHistory;
@@ -822,8 +813,8 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
if( !bSavePos && !bSaveOtherPos && bDifferentTxtNodesAtMarkAndPoint &&
dynamic_cast< const ::sw::mark::CrossRefBookmark* >(pBkmk))
{
- // delete cross-reference bookmark at <pStt>, if only part of
- // <pEnd> text node content is deleted.
+ // delete cross-reference bookmark at <pStt>, if only
+ // part of <pEnd> text node content is deleted.
if( pStt->nNode == pBkmk->GetMarkPos().nNode &&
pEnd->nContent.GetIndex() !=
pEnd->nNode.GetNode().GetTxtNode()->Len() )
@@ -831,8 +822,8 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
bSavePos = true;
bSaveOtherPos = false;
}
- // delete cross-reference bookmark at <pEnd>, if only part of
- // <pStt> text node content is deleted.
+ // delete cross-reference bookmark at <pEnd>, if only
+ // part of <pStt> text node content is deleted.
else if( pEnd->nNode == pBkmk->GetMarkPos().nNode &&
pStt->nContent.GetIndex() != 0 )
{
@@ -859,9 +850,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
}
}
-
// save a complete section into UndoNodes array
-
SwUndoSaveSection::SwUndoSaveSection()
: pMvStt( 0 ), pRedlSaveData( 0 ), nMvLen( 0 ), nStartPos( ULONG_MAX )
{
@@ -886,7 +875,6 @@ void SwUndoSaveSection::SaveSection( SwDoc* pDoc, const SwNodeIndex& rSttIdx )
SaveSection( pDoc, aRg );
}
-
void SwUndoSaveSection::SaveSection( SwDoc* , const SwNodeRange& rRange )
{
SwPaM aPam( rRange.aStart, rRange.aEnd );
@@ -923,8 +911,6 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, SwNodeIndex* pIdx,
{
// check if the content is at the old position
SwNodeIndex aSttIdx( pDoc->GetNodes(), nStartPos );
-// OSL_ENSURE( !pDoc->GetNodes()[ aSttIdx ]->GetCntntNode(),
-// "RestoreSection(): Position on content node");
// move the content from UndoNodes array into Fly
SwStartNode* pSttNd = pDoc->GetNodes().MakeEmptySection( aSttIdx,
@@ -957,8 +943,7 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, const SwNodeIndex& rInsPos
}
}
- // save and set the RedlineData
-
+// save and set the RedlineData
SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
const SwPosition& rSttPos,
const SwPosition& rEndPos,
@@ -1027,9 +1012,9 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
pRedl->SetContentIdx( &aIdx );
}
SetPaM( *pRedl );
- // First, delete the "old" so that in an Append no unexpected things will happen, e.g. a delete
- // in an insert. In the latter case the just restored content will be deleted and not the one
- // you originally wanted.
+ // First, delete the "old" so that in an Append no unexpected things will
+ // happen, e.g. a delete in an insert. In the latter case the just restored
+ // content will be deleted and not the one you originally wanted.
rDoc.DeleteRedline( *pRedl, false, USHRT_MAX );
RedlineMode_t eOld = rDoc.GetRedlineMode();
@@ -1037,7 +1022,7 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
//#i92154# let UI know about a new redline with comment
if (rDoc.GetDocShell() && (pRedl->GetComment() != String()) )
rDoc.GetDocShell()->Broadcast(SwRedlineHint(pRedl,SWREDLINE_INSERTED));
- //
+
bool const bSuccess = rDoc.AppendRedline( pRedl, true );
assert(bSuccess); // SwRedlineSaveData::RedlineToDoc: insert redline failed
(void) bSuccess; // unused in non-debug
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index cbeb084..58f6e5e 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -26,9 +26,7 @@
*
************************************************************************/
-
#include <svl/itemiter.hxx>
-
#include <hintids.hxx>
#include <hints.hxx>
#include <fmtflcnt.hxx>
@@ -50,10 +48,6 @@
#include <dcontact.hxx>
#include <ndole.hxx>
-
-//---------------------------------------------------------------------
-// SwUndoLayBase /////////////////////////////////////////////////////////
-
SwUndoFlyBase::SwUndoFlyBase( SwFrmFmt* pFormat, SwUndoId nUndoId )
: SwUndo( nUndoId ), pFrmFmt( pFormat )
{
@@ -115,10 +109,9 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm)
pFrmFmt->SetFmtAttr( SwFmtCntnt( aIdx.GetNode().GetStartNode() ));
}
- //JP 18.12.98: Bug 60505 - set InCntntAttribute not until there is content!
- // Otherwise the layout would format the Fly beforehand but
- // would not find content; this happend with graphics from the
- // internet
+ // Set InCntntAttribute not until there is content!
+ // Otherwise the layout would format the Fly beforehand but would not find
+ // content; this happend with graphics from the internet.
if (FLY_AS_CHAR == nRndId)
{
// there must be at least the attribute in a TextNode
@@ -235,8 +228,6 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
rFlyFmts.Remove( rFlyFmts.GetPos( pFrmFmt ));
}
-// SwUndoInsLayFmt ///////////////////////////////////////////////////////
-
SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, sal_uLong nNodeIdx, xub_StrLen nCntIdx )
: SwUndoFlyBase( pFormat, RES_DRAWFRMFMT == pFormat->Which() ?
UNDO_INSDRAWFMT : UNDO_INSLAYFMT ),
@@ -347,8 +338,6 @@ void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext)
SwFrmFmt* pFlyFmt = pDoc->CopyLayoutFmt( *pFrmFmt, aAnchor, true, true );
(void) pFlyFmt;
-//FIXME nobody ever did anything with this selection:
-// rContext.SetSelections(pFlyFmt, 0);
}
// #111827#
@@ -367,7 +356,6 @@ rtl::OUString SwUndoInsLayFmt::GetComment() const
If frame format is present and has an SdrObject use the undo
comment of the SdrObject. Otherwise use the default comment.
*/
-
bool bDone = false;
if (pFrmFmt)
{
@@ -388,8 +376,6 @@ rtl::OUString SwUndoInsLayFmt::GetComment() const
return aResult;
}
-// SwUndoDelLayFmt ///////////////////////////////////////////////////////
-
static SwUndoId
lcl_GetSwUndoId(SwFrmFmt *const pFrmFmt)
{
@@ -473,8 +459,6 @@ void SwUndoDelLayFmt::RedoForRollback()
DelFly( pFrmFmt->GetDoc() );
}
-// SwUndoSetFlyFmt ///////////////////////////////////////////////////////
-
SwUndoSetFlyFmt::SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt )
: SwUndo( UNDO_SETFLYFRMFMT ), SwClient( &rFlyFmt ), pFrmFmt( &rFlyFmt ),
pOldFmt( (SwFrmFmt*)rFlyFmt.DerivedFrom() ), pNewFmt( &rNewFrmFmt ),
@@ -496,7 +480,6 @@ SwRewriter SwUndoSetFlyFmt::GetRewriter() const
return aRewriter;
}
-
SwUndoSetFlyFmt::~SwUndoSetFlyFmt()
{
delete pItemSet;
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index 8bc5923..7d1b59c 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -26,9 +26,7 @@
*
************************************************************************/
-
#include <UndoSplitMove.hxx>
-
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
@@ -37,9 +35,7 @@
#include <UndoCore.hxx>
#include <rolbck.hxx>
-
// MOVE
-
SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
: SwUndo( UNDO_MOVE ), SwUndRng( rRange ),
nMvDestNode( rMvPos.nNode.GetIndex() ),
@@ -91,7 +87,6 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
pHistory->CopyFmtAttr( *pTxtNd->GetpSwAttrSet(), nMvDestNode );
}
-
nFtnStt = pHistory->Count();
DelFtn( rRange );
@@ -99,7 +94,6 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
DELETEZ( pHistory );
}
-
SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
const SwNodeIndex& rMvPos )
: SwUndo( UNDO_MOVE ),
@@ -115,6 +109,7 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
nEndNode = rRg.aEnd.GetIndex();
// DelFtn( rRange );
+// FIXME: duplication of the method body of DelFtn below
// is the current move from CntntArea into the special section?
sal_uLong nCntntStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex();
@@ -138,8 +133,6 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
nFtnStt = 0;
}
-
-
void SwUndoMove::SetDestRange( const SwPaM& rRange,
const SwPosition& rInsPos,
sal_Bool bJoin, sal_Bool bCorrPam )
@@ -169,7 +162,6 @@ void SwUndoMove::SetDestRange( const SwPaM& rRange,
bJoinPrev = bJoin;
}
-
void SwUndoMove::SetDestRange( const SwNodeIndex& rStt,
const SwNodeIndex& rEnd,
const SwNodeIndex& rInsPos )
@@ -186,7 +178,6 @@ void SwUndoMove::SetDestRange( const SwNodeIndex& rStt,
nDestSttCntnt = nDestEndCntnt = nInsPosCntnt = STRING_MAXLEN;
}
-
void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc *const pDoc = & rContext.GetDoc();
@@ -212,8 +203,8 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
SwPaM aPam( aIdx.GetNode(), nDestSttCntnt,
*pDoc->GetNodes()[ nDestEndNode ], nDestEndCntnt );
- // #i17764# if redlines are to be moved, we may not remove them before
- // pDoc->Move gets a chance to handle them
+ // #i17764# if redlines are to be moved, we may not remove them
+ // before pDoc->Move gets a chance to handle them
if( ! bMoveRedlines )
RemoveIdxFromRange( aPam, sal_False );
@@ -236,7 +227,6 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
aPam.Exchange();
aPam.DeleteMark();
-// pDoc->ResetAttr( aPam, sal_False );
if( aPam.GetNode()->IsCntntNode() )
aPam.GetNode()->GetCntntNode()->ResetAllAttr();
// the Pam will be dropped now
@@ -281,7 +271,6 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
}
}
-
void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext)
{
SwPaM *const pPam = & AddUndoRedoPaM(rContext);
@@ -334,7 +323,6 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext)
}
}
-
void SwUndoMove::DelFtn( const SwPaM& rRange )
{
// is the current move from CntntArea into the special section?
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index 02ca169..7e212c3 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -26,7 +26,6 @@
*
************************************************************************/
-
#include <hintids.hxx>
#include <fmtanchr.hxx>
#include <frmfmt.hxx>
@@ -34,15 +33,13 @@
#include <IDocumentUndoRedo.hxx>
#include <IShellCursorSupplier.hxx>
#include <docary.hxx>
-#include <swundo.hxx> // fuer die UndoIds
+#include <swundo.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <UndoCore.hxx>
#include <rolbck.hxx>
#include <redline.hxx>
-
-
SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
: SwUndo( nUndoId ), SwUndRng( rPam ),
pTxtFmtColl( 0 ), pLastNdColl(0), pFrmFmts( 0 ), pRedlData( 0 ),
@@ -60,7 +57,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
if( pTxtNd->HasSwAttrSet() )
pHistory->CopyFmtAttr( *pTxtNd->GetpSwAttrSet(), nSttNode );
- if( !nSttCntnt ) // dann werden Flys mitgenommen !!
+ if( !nSttCntnt ) // than take the Flys along
{
sal_uInt16 nArrLen = pDoc->GetSpzFrmFmts()->Count();
for( sal_uInt16 n = 0; n < nArrLen; ++n )
@@ -79,7 +76,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
}
}
}
- // Redline beachten
+ // consider Redline
if( pDoc->IsRedlineOn() )
{
pRedlData = new SwRedlineData( nsRedlineType_t::REDLINE_INSERT, pDoc->GetRedlineAuthor() );
@@ -87,8 +84,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
}
}
-// setze den Destination-Bereich nach dem Einlesen.
-
+// set destination after reading input
void SwUndoInserts::SetInsertRange( const SwPaM& rPam, sal_Bool bScanFlys,
sal_Bool bSttIsTxtNd )
{
@@ -105,16 +101,16 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, sal_Bool bScanFlys,
nSttNode = pTmpPos->nNode.GetIndex();
nSttCntnt = pTmpPos->nContent.GetIndex();
- if( !bSttIsTxtNd ) // wird eine Tabellenselektion eingefuegt,
+ if( !bSttIsTxtNd ) // if a table selection is added ...
{
- ++nSttNode; // dann stimmt der CopyPam nicht ganz
+ ++nSttNode; // ... than the CopyPam is not fully correct
bSttWasTxtNd = sal_False;
}
}
if( bScanFlys && !nSttCntnt )
{
- // dann alle neuen Flys zusammen sammeln !!
+ // than collect all new Flys
SwDoc* pDoc = (SwDoc*)rPam.GetDoc();
sal_uInt16 nFndPos, nArrLen = pDoc->GetSpzFrmFmts()->Count();
for( sal_uInt16 n = 0; n < nArrLen; ++n )
@@ -141,18 +137,17 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, sal_Bool bScanFlys,
}
}
-
SwUndoInserts::~SwUndoInserts()
{
- if( pPos ) // loesche noch den Bereich aus dem UndoNodes Array
+ if( pPos ) // delete also the section from UndoNodes array
{
- // Insert speichert den Inhalt in der IconSection
+ // Insert saves content in IconSection
SwNodes& rUNds = pPos->nNode.GetNodes();
- if( pPos->nContent.GetIndex() ) // nicht den gesamten Node loeschen
+ if( pPos->nContent.GetIndex() ) // do not delete complete Node
{
SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode();
- OSL_ENSURE( pTxtNd, "kein TextNode, aus dem geloescht werden soll" );
- if( pTxtNd ) // Robust
+ OSL_ENSURE( pTxtNd, "no TextNode to delete from" );
+ if( pTxtNd ) // robust
{
pTxtNd->EraseText( pPos->nContent );
}
@@ -167,7 +162,6 @@ SwUndoInserts::~SwUndoInserts()
delete pRedlData;
}
-
void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc *const pDoc = & rContext.GetDoc();
@@ -176,14 +170,13 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
pDoc->DeleteRedline( *pPam, true, USHRT_MAX );
- // sind an Point/Mark 2 unterschiedliche TextNodes, dann muss ein
- // JoinNext ausgefuehrt werden.
+ // if Point and Mark are different text nodes so a JoinNext has to be done
sal_Bool bJoinNext = nSttNode != nEndNode &&
pPam->GetMark()->nNode.GetNode().GetTxtNode() &&
pPam->GetPoint()->nNode.GetNode().GetTxtNode();
- // gibts ueberhaupt Inhalt ? (laden von Zeichenvorlagen hat kein Inhalt!)
+ // Is there any content? (loading from template does not have content)
if( nSttNode != nEndNode || nSttCntnt != nEndCntnt )
{
if( nSttNode != nEndNode )
@@ -196,7 +189,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
RemoveIdxFromRange( *pPam, sal_False );
SetPaM(*pPam);
- // sind Fussnoten oder CntntFlyFrames im Text ??
+ // are there Footnotes or CntntFlyFrames in text?
nSetPos = pHistory->Count();
nNdDiff = pPam->GetMark()->nNode.GetIndex();
DelCntntIndex( *pPam->GetMark(), *pPam->GetPoint() );
@@ -226,12 +219,14 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
SwTxtNode* pTxtNode = rIdx.GetNode().GetTxtNode();
if( pTxtNode )
{
- if( !pTxtFmtColl ) // falls 0, dann war hier auch kein TextNode,
- { // dann muss dieser geloescht werden,
+ if( !pTxtFmtColl ) // if 0 than it's no TextNode -> delete
+ {
SwNodeIndex aDelIdx( rIdx );
rIdx++;
SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode();
- xub_StrLen nCnt = 0; if( pCNd ) nCnt = pCNd->Len();
+ xub_StrLen nCnt = 0;
+ if( pCNd )
+ nCnt = pCNd->Len();
pPam->GetPoint()->nContent.Assign( pCNd, nCnt );
pPam->SetMark();
pPam->DeleteMark();
@@ -254,7 +249,6 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
pTxtNode->RstAttr( SwIndex(pTxtNode, 0), pTxtNode->Len(),
0, 0, true );
- // setze alle Attribute im Node zurueck
pTxtNode->ResetAllAttr();
if( USHRT_MAX != pDoc->GetTxtFmtColls()->GetPos( pTxtFmtColl ))
@@ -268,7 +262,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & rContext)
{
- // setze noch den Cursor auf den Redo-Bereich
+ // position cursor onto REDO section
SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
SwDoc* pDoc = pPam->GetDoc();
pPam->DeleteMark();
@@ -282,12 +276,12 @@ void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & rContext)
pHistory->SetTmpEnd( nSetPos );
- // alte Anfangs-Position fuers Rollback zurueckholen
+ // retrieve start position for rollback
if( ( nSttNode != nEndNode || nSttCntnt != nEndCntnt ) && pPos )
{
sal_Bool bMvBkwrd = MovePtBackward( *pPam );
- // Inhalt wieder einfuegen. (erst pPos abmelden !!)
+ // re-insert content again (first detach pPos!)
sal_uLong nMvNd = pPos->nNode.GetIndex();
xub_StrLen nMvCnt = pPos->nContent.GetIndex();
DELETEZ( pPos );
@@ -340,9 +334,6 @@ void SwUndoInserts::RepeatImpl(::sw::RepeatContext & rContext)
aPam.GetDoc()->CopyRange( aPam, *rRepeatPaM.GetPoint(), false );
}
-
-//////////////////////////////////////////////////////////////////////////
-
SwUndoInsDoc::SwUndoInsDoc( const SwPaM& rPam )
: SwUndoInserts( UNDO_INSDOKUMENT, rPam )
{
commit c4f0da46d90620585efddc6fb18c574581730d24
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Wed May 30 20:39:23 2012 +0200
Re-format comments
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 1243890..8895c29 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -26,7 +26,6 @@
*
************************************************************************/
-
#include <UndoDelete.hxx>
#include <hintids.hxx>
#include <unotools/charclass.hxx>
@@ -47,19 +46,17 @@
#include <redline.hxx>
#include <docary.hxx>
#include <sfx2/app.hxx>
-
#include <fldbas.hxx>
#include <fmtfld.hxx>
#include <comcore.hrc> // #111827#
#include <undo.hrc>
#include <vector>
-
// DELETE
-/* lcl_MakeAutoFrms has to call MakeFrms for objects bounded "AtChar" ( == AUTO ),
- if the anchor frame has be moved via _MoveNodes(..) and DelFrms(..)
+/* lcl_MakeAutoFrms has to call MakeFrms for objects bounded "AtChar"
+ ( == AUTO ), if the anchor frame has be moved via _MoveNodes(..) and
+ DelFrms(..)
*/
-
void lcl_MakeAutoFrms( const SwSpzFrmFmts& rSpzArr, sal_uLong nMovedIndex )
{
if( rSpzArr.Count() )
@@ -80,28 +77,31 @@ void lcl_MakeAutoFrms( const SwSpzFrmFmts& rSpzArr, sal_uLong nMovedIndex )
}
}
-/*
-SwUndoDelete has to perform a deletion and to record anything that is needed to restore the
-situation before the deletion. Unfortunately a part of the deletion will be done after calling
-this Ctor, this has to be kept in mind! In this Ctor only the complete paragraphs will be deleted,
-the joining of the first and last paragraph of the selection will be handled outside this function.
-Here are the main steps of the function:
-1. Deletion/recording of content indizes of the selection: footnotes, fly frames and bookmarks
-Step 1 could shift all nodes by deletion of footnotes => nNdDiff will be set.
-2. If the paragraph where the selection ends, is the last content of a section so that this
-section becomes empty when the paragraphs will be joined we have to do some smart actions ;-)
-The paragraph will be moved outside the section and replaced by a dummy text node, the complete
-section will be deleted in step 3. The difference between replacement dummy and original is
-nReplacementDummy.
-3. Moving complete selected nodes into the UndoArray. Before this happens the selection has to be
-extended if there are sections which would become empty otherwise. BTW: sections will be moved into
-the UndoArray if they are complete part of the selection. Sections starting or ending outside of the
-selection will not be removed from the DocNodeArray even they got a "dummy"-copy in the UndoArray.
-4. We have to anticipate the joining of the two paragraphs if the start paragraph is inside a
-section and the end paragraph not. Then we have to move the paragraph into this section and to
-record this in nSectDiff.
-*/
-
+// SwUndoDelete has to perform a deletion and to record anything that is needed
+// to restore the situation before the deletion. Unfortunately a part of the
+// deletion will be done after calling this Ctor, this has to be kept in mind!
+// In this Ctor only the complete paragraphs will be deleted, the joining of
+// the first and last paragraph of the selection will be handled outside this
+// function.
+// Here are the main steps of the function:
+// 1. Deletion/recording of content indizes of the selection: footnotes, fly
+// frames and bookmarks
+// Step 1 could shift all nodes by deletion of footnotes => nNdDiff will be set.
+// 2. If the paragraph where the selection ends, is the last content of a
+// section so that this section becomes empty when the paragraphs will be
+// joined we have to do some smart actions ;-) The paragraph will be moved
+// outside the section and replaced by a dummy text node, the complete
+// section will be deleted in step 3. The difference between replacement
+// dummy and original is nReplacementDummy.
+// 3. Moving complete selected nodes into the UndoArray. Before this happens the
+// selection has to be extended if there are sections which would become
+// empty otherwise. BTW: sections will be moved into the UndoArray if they
+// are complete part of the selection. Sections starting or ending outside
+// of the selection will not be removed from the DocNodeArray even they got
+// a "dummy"-copy in the UndoArray.
+// 4. We have to anticipate the joining of the two paragraphs if the start
+// paragraph is inside a section and the end paragraph not. Then we have to
+// move the paragraph into this section and to record this in nSectDiff.
SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByTblCpy )
: SwUndo(UNDO_DELETE), SwUndRng( rPam ),
pMvStt( 0 ), pSttStr(0), pEndStr(0), pRedlData(0), pRedlSaveData(0),
@@ -110,7 +110,8 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
bDelFullPara( bFullPara ), bResetPgDesc( sal_False ), bResetPgBrk( sal_False ),
bFromTableCopy( bCalledByTblCpy )
{
- bDelFullPara = bFullPara; // This is set e.g. if an empty paragraph before a table is deleted
+ // bFullPara is set e.g. if an empty paragraph before a table is deleted
+ bDelFullPara = bFullPara;
bCacheComment = false;
@@ -174,9 +175,9 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
if( !bJoinNext ) // Selection from bottom to top
{
- // When using JoinPrev() all AUTO-PageBreak's will be copied correctly. To restore them
- // with UNDO, Auto-PageBreak of the EndNode needs to be reset. Same for PageDesc and
- // ColBreak.
+ // When using JoinPrev() all AUTO-PageBreak's will be copied
+ // correctly. To restore them with UNDO, Auto-PageBreak of the
+ // EndNode needs to be reset. Same for PageDesc and ColBreak.
if( pEndTxtNd->HasSwAttrSet() )
{
SwRegHistory aRegHist( *pEndTxtNd, pHistory );
@@ -191,7 +192,6 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
}
}
-
// Move now also the PaM. The SPoint is at the beginning of a SSelection.
if( pEnd == rPam.GetPoint() && ( !bFullPara || pSttTxtNd || pEndTxtNd ) )
rPam.Exchange();
@@ -222,8 +222,8 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
// Step 2: Expand selection if necessary
if( bJoinNext || bFullPara )
{
- // If all content of a section will be moved into Undo, the section itself should be
- // moved completely.
+ // If all content of a section will be moved into Undo, the section
+ // itself should be moved completely.
while( aRg.aEnd.GetIndex() + 2 < rDocNds.Count() &&
( (pTmpNd = rDocNds[ aRg.aEnd.GetIndex()+1 ])->IsEndNode() &&
pTmpNd->StartOfSectionNode()->IsSectionNode() &&
@@ -236,7 +236,8 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
if( pEndTxtNd )
{
// The end text node has to leave the (expanded) selection
- // The dummy is needed because _MoveNodes deletes empty sections
+ // The dummy is needed because _MoveNodes deletes empty
+ // sections
++nReplaceDummy;
SwNodeRange aMvRg( *pEndTxtNd, 0, *pEndTxtNd, 1 );
SwPosition aSplitPos( *pEndTxtNd );
@@ -289,14 +290,16 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
nNode = rNds.GetEndOfContent().GetIndex();
rDocNds._MoveNodes( aRg, rNds, SwNodeIndex( rNds.GetEndOfContent() ));
pMvStt = new SwNodeIndex( rNds, nNode );
- nNode = rNds.GetEndOfContent().GetIndex() - nNode; // remember difference!
+ // remember difference!
+ nNode = rNds.GetEndOfContent().GetIndex() - nNode;
+
if( pSttTxtNd && pEndTxtNd )
{
//Step 4: Moving around sections
nSectDiff = aRg.aEnd.GetIndex() - aRg.aStart.GetIndex();
- // nSect is the number of sections which starts(ends) between start and end node of the
- // selection. The "loser" paragraph has to be moved into the section(s) of the
- // "winner" paragraph
+ // nSect is the number of sections which starts(ends) between start
+ // and end node of the selection. The "loser" paragraph has to be
+ // moved into the section(s) of the "winner" paragraph
if( nSectDiff )
{
if( bJoinNext )
@@ -318,7 +321,8 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByT
else
nNode = 0; // moved no node -> no difference at the end
- // Are there any Nodes that got deleted before that (FootNotes have ContentNodes)?
+ // Are there any Nodes that got deleted before that (FootNotes
+ // have ContentNodes)?
if( !pSttTxtNd && !pEndTxtNd )
{
nNdDiff = nSttNode - rPam.GetPoint()->nNode.GetIndex() - (bFullPara ? 0 : 1);
@@ -362,8 +366,8 @@ sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd
nLen = ( bOneNode ? pEnd->nContent.GetIndex() : pSttTxtNd->GetTxt().Len() )
- pStt->nContent.GetIndex();
-
- // delete now also the text (all attribute changes are added to UNDO history)
+ // delete now also the text (all attribute changes are added to
+ // UNDO history)
pSttStr = (String*)new String( pSttTxtNd->GetTxt().Copy( nSttCntnt, nLen ));
pSttTxtNd->EraseText( pStt->nContent, nLen );
if( pSttTxtNd->GetpSwpHints() )
@@ -382,7 +386,6 @@ sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd
return sal_False; // stop moving more nodes
}
-
// 2 - copy end into End-String
if( pEndTxtNd )
{
@@ -390,15 +393,16 @@ sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd
nNdIdx = pEnd->nNode.GetIndex();
SwRegHistory aRHst( *pEndTxtNd, pHistory );
- // always save all text atttibutes because of possibly overlapping areas of on/off
+ // always save all text atttibutes because of possibly overlapping
+ // areas of on/off
pHistory->CopyAttr( pEndTxtNd->GetpSwpHints(), nNdIdx, 0,
pEndTxtNd->GetTxt().Len(), true );
if( pEndTxtNd->HasSwAttrSet() )
pHistory->CopyFmtAttr( *pEndTxtNd->GetpSwAttrSet(), nNdIdx );
-
- // delete now also the text (all attribute changes are added to UNDO history)
+ // delete now also the text (all attribute changes are added to
+ // UNDO history)
pEndStr = (String*)new String( pEndTxtNd->GetTxt().Copy( 0,
pEnd->nContent.GetIndex() ));
pEndTxtNd->EraseText( aEndIdx, pEnd->nContent.GetIndex() );
@@ -420,7 +424,6 @@ sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd
return sal_True; // move Nodes lying in between
}
-
sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
{
// Is Undo greater than one Node (that is Start and EndString)?
@@ -441,8 +444,8 @@ sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
pEnd->nNode != nSttNode )
return sal_False;
- // Distinguish between BackSpace and Delete because the Undo array needs to be constructed
- // differently!
+ // Distinguish between BackSpace and Delete because the Undo array needs to
+ // be constructed differently!
if( pEnd->nContent == nSttCntnt )
{
if( bGroup && !bBackSp ) return sal_False;
@@ -498,8 +501,6 @@ sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
return sal_True;
}
-
-
SwUndoDelete::~SwUndoDelete()
{
delete pSttStr;
@@ -787,9 +788,10 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
{
sal_uLong nOldIdx = aPos.nNode.GetIndex();
pDoc->SplitNode( aPos, false );
- // After the split all objects are anchored at the first paragraph,
- // but the pHistory of the fly frame formats relies on anchoring at
- // the start of the selection => selection backwards needs a correction.
+ // After the split all objects are anchored at the first
+ // paragraph, but the pHistory of the fly frame formats relies
+ // on anchoring at the start of the selection
+ // => selection backwards needs a correction.
if( bBackSp )
lcl_ReAnchorAtCntntFlyFrames( *pDoc->GetSpzFrmFmts(), aPos, nOldIdx );
pTxtNd = aPos.nNode.GetNode().GetTxtNode();
@@ -876,8 +878,8 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext)
{
aPos.nNode = nSttNode - nNdDiff + ( bJoinNext ? 0 : nReplaceDummy );
SwTxtNode * pTxtNd = aPos.nNode.GetNode().GetTxtNode();
- // If more than a single Node got deleted, also all "Node" attributes were saved
-
+ // If more than a single Node got deleted, also all "Node"
+ // attributes were saved
if (pTxtNd != NULL)
{
if( pTxtNd->HasSwAttrSet() && bNodeMove && !pEndStr )
commit 8f7e92fcb140d39dc20884bd35b1dca572b49ab8
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Wed May 30 20:16:56 2012 +0200
Clean up comments, whitespace, commented out code
Change-Id: Ieedc214a0810b9ecbe69c5308ee3bdcf98ae461a
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index d16c951..41f10c4 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -26,15 +26,10 @@
*
************************************************************************/
-
#include <rolbck.hxx>
-
#include <tools/resid.hxx>
-
#include <svl/itemiter.hxx>
-
#include <editeng/brkitem.hxx>
-
#include <hints.hxx>
#include <hintids.hxx>
#include <fmtftn.hxx>
@@ -56,8 +51,8 @@
#include <IDocumentUndoRedo.hxx>
#include <docary.hxx>
#include <ndtxt.hxx> // SwTxtNode
-#include <paratr.hxx> //
-#include <cellatr.hxx> //
+#include <paratr.hxx>
+#include <cellatr.hxx>
#include <fldbas.hxx>
#include <pam.hxx>
#include <swtable.hxx>
@@ -74,7 +69,6 @@ String SwHistoryHint::GetDescription() const
return String();
}
-
SwHistorySetFmt::SwHistorySetFmt( const SfxPoolItem* pFmtHt, sal_uLong nNd )
: SwHistoryHint( HSTRY_SETFMTHNT )
, m_pAttr( pFmtHt->Clone() )
@@ -90,7 +84,7 @@ SwHistorySetFmt::SwHistorySetFmt( const SfxPoolItem* pFmtHt, sal_uLong nNd )
break;
case RES_BOXATR_FORMULA:
{
- //JP 30.07.98: Bug 54295 - save formulas always in plain text
+ // save formulas always in plain text
SwTblBoxFormula& rNew = static_cast<SwTblBoxFormula&>(*m_pAttr);
if ( rNew.IsIntrnlName() )
{
@@ -117,7 +111,7 @@ SwHistorySetFmt::SwHistorySetFmt( const SfxPoolItem* pFmtHt, sal_uLong nNd )
String SwHistorySetFmt::GetDescription() const
{
- String aResult ;
+ String aResult;
sal_uInt16 nWhich = m_pAttr->Which();
switch (nWhich)
@@ -184,7 +178,6 @@ SwHistorySetFmt::~SwHistorySetFmt()
{
}
-
SwHistoryResetFmt::SwHistoryResetFmt(const SfxPoolItem* pFmtHt, sal_uLong nNodeIdx)
: SwHistoryHint( HSTRY_RESETFMTHNT )
, m_nNodeIndex( nNodeIdx )
@@ -192,7 +185,6 @@ SwHistoryResetFmt::SwHistoryResetFmt(const SfxPoolItem* pFmtHt, sal_uLong nNodeI
{
}
-
void SwHistoryResetFmt::SetInDoc( SwDoc* pDoc, bool )
{
SwNode * pNode = pDoc->GetNodes()[ m_nNodeIndex ];
@@ -207,7 +199,6 @@ void SwHistoryResetFmt::SetInDoc( SwDoc* pDoc, bool )
}
}
-
SwHistorySetTxt::SwHistorySetTxt( SwTxtAttr* pTxtHt, sal_uLong nNodePos )
: SwHistoryHint( HSTRY_SETTXTHNT )
, m_nNodeIndex( nNodePos )
@@ -231,12 +222,10 @@ SwHistorySetTxt::SwHistorySetTxt( SwTxtAttr* pTxtHt, sal_uLong nNodePos )
}
}
-
SwHistorySetTxt::~SwHistorySetTxt()
{
}
-
void SwHistorySetTxt::SetInDoc( SwDoc* pDoc, bool )
{
if ( !m_pAttr.get() )
@@ -261,7 +250,6 @@ void SwHistorySetTxt::SetInDoc( SwDoc* pDoc, bool )
}
}
-
SwHistorySetTxtFld::SwHistorySetTxtFld( SwTxtFld* pTxtFld, sal_uLong nNodePos )
: SwHistoryHint( HSTRY_SETTXTFLDHNT )
, m_pFldType( 0 )
@@ -293,7 +281,6 @@ SwHistorySetTxtFld::~SwHistorySetTxtFld()
{
}
-
void SwHistorySetTxtFld::SetInDoc( SwDoc* pDoc, bool )
{
if ( !m_pFld.get() )
@@ -322,8 +309,6 @@ void SwHistorySetTxtFld::SetInDoc( SwDoc* pDoc, bool )
}
}
-
-
SwHistorySetRefMark::SwHistorySetRefMark( SwTxtRefMark* pTxtHt, sal_uLong nNodePos )
: SwHistoryHint( HSTRY_SETREFMARKHNT )
, m_RefName( pTxtHt->GetRefMark().GetRefName() )
@@ -333,7 +318,6 @@ SwHistorySetRefMark::SwHistorySetRefMark( SwTxtRefMark* pTxtHt, sal_uLong nNodeP
{
}
-
void SwHistorySetRefMark::SetInDoc( SwDoc* pDoc, bool )
{
SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode();
@@ -352,7 +336,6 @@ void SwHistorySetRefMark::SetInDoc( SwDoc* pDoc, bool )
}
}
-
SwHistorySetTOXMark::SwHistorySetTOXMark( SwTxtTOXMark* pTxtHt, sal_uLong nNodePos )
: SwHistoryHint( HSTRY_SETTOXMARKHNT )
, m_TOXMark( pTxtHt->GetTOXMark() )
@@ -365,7 +348,6 @@ SwHistorySetTOXMark::SwHistorySetTOXMark( SwTxtTOXMark* pTxtHt, sal_uLong nNodeP
m_TOXMark.DeRegister();
}
-
void SwHistorySetTOXMark::SetInDoc( SwDoc* pDoc, bool )
{
SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode();
@@ -397,7 +379,6 @@ void SwHistorySetTOXMark::SetInDoc( SwDoc* pDoc, bool )
nsSetAttrMode::SETATTR_NOTXTATRCHR );
}
-
int SwHistorySetTOXMark::IsEqual( const SwTOXMark& rCmp ) const
{
return m_TOXName == rCmp.GetTOXType()->GetTypeName() &&
@@ -410,7 +391,6 @@ int SwHistorySetTOXMark::IsEqual( const SwTOXMark& rCmp ) const
);
}
-
SwHistoryResetTxt::SwHistoryResetTxt( sal_uInt16 nWhich,
xub_StrLen nAttrStart, xub_StrLen nAttrEnd, sal_uLong nNodePos )
: SwHistoryHint( HSTRY_RESETTXTHNT )
@@ -419,7 +399,6 @@ SwHistoryResetTxt::SwHistoryResetTxt( sal_uInt16 nWhich,
{
}
-
void SwHistoryResetTxt::SetInDoc( SwDoc* pDoc, bool )
{
SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode();
@@ -430,7 +409,6 @@ void SwHistoryResetTxt::SetInDoc( SwDoc* pDoc, bool )
}
}
-
SwHistorySetFootnote::SwHistorySetFootnote( SwTxtFtn* pTxtFtn, sal_uLong nNodePos )
: SwHistoryHint( HSTRY_SETFTNHNT )
, m_pUndo( new SwUndoSaveSection )
@@ -477,7 +455,6 @@ SwHistorySetFootnote::~SwHistorySetFootnote()
{
}
-
void SwHistorySetFootnote::SetInDoc( SwDoc* pDoc, bool )
{
SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode();
@@ -524,7 +501,6 @@ void SwHistorySetFootnote::SetInDoc( SwDoc* pDoc, bool )
}
}
-
SwHistoryChangeFmtColl::SwHistoryChangeFmtColl( SwFmtColl* pFmtColl, sal_uLong nNd,
sal_uInt8 nNodeWhich )
: SwHistoryHint( HSTRY_CHGFMTCOLL )
@@ -559,7 +535,6 @@ void SwHistoryChangeFmtColl::SetInDoc( SwDoc* pDoc, bool )
}
}
-
SwHistoryTxtFlyCnt::SwHistoryTxtFlyCnt( SwFrmFmt* const pFlyFmt )
: SwHistoryHint( HSTRY_FLYCNT )
, m_pUndo( new SwUndoDelLayFmt( pFlyFmt ) )
@@ -568,12 +543,10 @@ SwHistoryTxtFlyCnt::SwHistoryTxtFlyCnt( SwFrmFmt* const pFlyFmt )
m_pUndo->ChgShowSel( sal_False );
}
-
SwHistoryTxtFlyCnt::~SwHistoryTxtFlyCnt()
{
}
-
void SwHistoryTxtFlyCnt::SetInDoc( SwDoc* pDoc, bool )
{
::sw::IShellCursorSupplier *const pISCS(pDoc->GetIShellCursorSupplier());
@@ -582,8 +555,6 @@ void SwHistoryTxtFlyCnt::SetInDoc( SwDoc* pDoc, bool )
m_pUndo->UndoImpl(context);
}
-
-
SwHistoryBookmark::SwHistoryBookmark(
const ::sw::mark::IMark& rBkmk,
bool bSavePos,
@@ -620,7 +591,6 @@ SwHistoryBookmark::SwHistoryBookmark(
}
}
-
void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
{
::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
@@ -696,7 +666,6 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
}
}
-
bool SwHistoryBookmark::IsEqualBookmark(const ::sw::mark::IMark& rBkmk)
{
return m_nNode == rBkmk.GetMarkPos().nNode.GetIndex()
@@ -709,9 +678,6 @@ const ::rtl::OUString& SwHistoryBookmark::GetName() const
return m_aName;
}
-/*************************************************************************/
-
-
SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet,
sal_uLong nNodePos, const std::set<sal_uInt16> &rSetArr )
: SwHistoryHint( HSTRY_SETATTRSET )
@@ -744,10 +710,9 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet,
case RES_BOXATR_FORMULA:
{
- //JP 20.04.98: Bug 49502 - When a formula is set, never save
- // the value. It possibly must be recalculated!
- //JP 30.07.98: Bug 54295 - Save formulas always in plain
- // text
+ // When a formula is set, never save the value. It
+ // possibly must be recalculated!
+ // Save formulas always in plain text
m_OldSet.ClearItem( RES_BOXATR_VALUE );
SwTblBoxFormula& rNew =
@@ -811,9 +776,6 @@ void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool )
}
}
-/*************************************************************************/
-
-
SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet,
sal_uLong nNodePos, xub_StrLen nAttrStt, xub_StrLen nAttrEnd )
: SwHistoryHint( HSTRY_RESETATTRSET )
@@ -868,7 +830,6 @@ SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet,
}
}
-
void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool )
{
::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
@@ -899,10 +860,6 @@ void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool )
}
}
-
-/*************************************************************************/
-
-
SwHistoryChangeFlyAnchor::SwHistoryChangeFlyAnchor( SwFrmFmt& rFmt )
: SwHistoryHint( HSTRY_CHGFLYANCHOR )
, m_rFmt( rFmt )
@@ -946,9 +903,6 @@ void SwHistoryChangeFlyAnchor::SetInDoc( SwDoc* pDoc, bool )
}
}
-
-/*************************************************************************/
-
SwHistoryChangeFlyChain::SwHistoryChangeFlyChain( SwFlyFrmFmt& rFmt,
const SwFmtChain& rAttr )
: SwHistoryHint( HSTRY_CHGFLYCHAIN )
@@ -958,7 +912,6 @@ SwHistoryChangeFlyChain::SwHistoryChangeFlyChain( SwFlyFrmFmt& rFmt,
{
}
-
void SwHistoryChangeFlyChain::SetInDoc( SwDoc* pDoc, bool )
{
if ( USHRT_MAX != pDoc->GetSpzFrmFmts()->GetPos( m_pFlyFmt ) )
@@ -990,7 +943,6 @@ void SwHistoryChangeFlyChain::SetInDoc( SwDoc* pDoc, bool )
}
}
-
// -> #i27615#
SwHistoryChangeCharFmt::SwHistoryChangeCharFmt(const SfxItemSet & rSet,
const String & sFmt)
@@ -1011,7 +963,6 @@ void SwHistoryChangeCharFmt::SetInDoc(SwDoc * pDoc, bool )
// <- #i27615#
-
SwHistory::SwHistory( sal_uInt16 nInitSz )
: m_SwpHstry()
, m_nEndDiff( 0 )
@@ -1019,20 +970,11 @@ SwHistory::SwHistory( sal_uInt16 nInitSz )
m_SwpHstry.reserve( (sal_uInt8)nInitSz );
}
-
SwHistory::~SwHistory()
{
Delete( 0 );
}
-
-/*************************************************************************
-|*
-|* void SwHistory::Add()
-|*
-|*
-*************************************************************************/
-
void SwHistory::Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue,
sal_uLong nNodeIdx )
{
@@ -1055,7 +997,7 @@ void SwHistory::Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue,
m_SwpHstry.push_back( pHt );
}
-
+// FIXME: refactor the following "Add" methods (DRY)?
void SwHistory::Add( SwTxtAttr* pHint, sal_uLong nNodeIdx, bool bNewAttr )
{
OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
@@ -1100,7 +1042,6 @@ void SwHistory::Add( SwTxtAttr* pHint, sal_uLong nNodeIdx, bool bNewAttr )
m_SwpHstry.push_back( pHt );
}
-
void SwHistory::Add( SwFmtColl* pColl, sal_uLong nNodeIdx, sal_uInt8 nWhichNd )
{
OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
@@ -1110,7 +1051,6 @@ void SwHistory::Add( SwFmtColl* pColl, sal_uLong nNodeIdx, sal_uInt8 nWhichNd )
m_SwpHstry.push_back( pHt );
}
-
void SwHistory::Add(const ::sw::mark::IMark& rBkmk, bool bSavePos, bool bSaveOtherPos)
{
OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" );
@@ -1119,7 +1059,6 @@ void SwHistory::Add(const ::sw::mark::IMark& rBkmk, bool bSavePos, bool bSaveOth
m_SwpHstry.push_back( pHt );
}
-
void SwHistory::Add( SwFrmFmt& rFmt )
{
SwHistoryHint * pHt = new SwHistoryChangeFlyAnchor( rFmt );
@@ -1177,14 +1116,6 @@ void SwHistory::Add(const SfxItemSet & rSet, const SwCharFmt & rFmt)
m_SwpHstry.push_back( pHt );
}
-/*************************************************************************
-|*
-|* sal_Bool SwHistory::Rollback()
-|*
-|*
-*************************************************************************/
-
-
bool SwHistory::Rollback( SwDoc* pDoc, sal_uInt16 nStart )
{
if ( !Count() )
@@ -1203,8 +1134,6 @@ bool SwHistory::Rollback( SwDoc* pDoc, sal_uInt16 nStart )
return true;
}
-
-
bool SwHistory::TmpRollback( SwDoc* pDoc, sal_uInt16 nStart, bool bToFirst )
{
sal_uInt16 nEnd = Count() - m_nEndDiff;
@@ -1231,7 +1160,6 @@ bool SwHistory::TmpRollback( SwDoc* pDoc, sal_uInt16 nStart, bool bToFirst )
return true;
}
-
void SwHistory::Delete( sal_uInt16 nStart )
{
for ( sal_uInt16 n = Count(); n > nStart; )
@@ -1242,10 +1170,9 @@ void SwHistory::Delete( sal_uInt16 nStart )
m_nEndDiff = 0;
}
-
sal_uInt16 SwHistory::SetTmpEnd( sal_uInt16 nNewTmpEnd )
{
- OSL_ENSURE( nNewTmpEnd <= Count(), "SwHistory::SetTmpEnd: out of bounds" );
+ OSL_ENSURE( nNewTmpEnd <= Count(), "SwHistory::SetTmpEnd: out of bounds" );
sal_uInt16 nOld = Count() - m_nEndDiff;
m_nEndDiff = Count() - nNewTmpEnd;
@@ -1294,11 +1221,9 @@ void SwHistory::CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx,
const xub_StrLen * pEndIdx;
for( sal_uInt16 n = 0; n < pHts->Count(); n++ )
{
- // BP: nAttrStt must even be set when !pEndIdx
+ // nAttrStt must even be set when !pEndIdx
pHt = pHts->GetTextHint(n);
nAttrStt = *pHt->GetStart();
-// JP: ???? why nAttrStt >= nEnd
-// if( 0 != ( pEndIdx = pHt->GetEnd() ) && nAttrStt >= nEnd )
if( 0 != ( pEndIdx = pHt->GetEnd() ) && nAttrStt > nEnd )
break;
@@ -1324,8 +1249,6 @@ void SwHistory::CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx,
if ( nStart <= nAttrStt )
{
if ( nEnd > nAttrStt
-// JP: ???? why nAttrStt >= nEnd
-// || (nEnd == nAttrStt && (!pEndIdx || nEnd == pEndIdx->GetIndex()))
)
{
Add( pHt, nNodeIdx, false );
@@ -1338,11 +1261,7 @@ void SwHistory::CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx,
}
}
-
-/*************************************************************************/
-
// Class to register the history at a Node, Format, HintsArray, ...
-
SwRegHistory::SwRegHistory( SwHistory* pHst )
: SwClient( 0 )
, m_pHistory( pHst )
@@ -1373,7 +1292,6 @@ void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
// #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 )
{
@@ -1408,14 +1326,11 @@ void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
}
}
-
-
void SwRegHistory::AddHint( SwTxtAttr* pHt, const bool bNew )
{
m_pHistory->Add( pHt, m_nNodeIndex, bNew );
}
-
bool SwRegHistory::InsertItems( const SfxItemSet& rSet,
xub_StrLen const nStart, xub_StrLen const nEnd, SetAttrMode const nFlags )
{
@@ -1436,11 +1351,11 @@ bool SwRegHistory::InsertItems( const SfxItemSet& rSet,
const bool bInserted = pTxtNode->SetAttr( rSet, nStart, nEnd, nFlags );
- // Caution: The array can be deleted when inserting an attribute!
- // This can happen when the value that should be added first deletes
- // an existing attribute but does not need to be added itself because
- // the paragraph attributes are identical
- // ( -> bForgetAttr in SwpHints::Insert )
+ // Caution: The array can be deleted when inserting an attribute!
+ // This can happen when the value that should be added first deletes
+ // an existing attribute but does not need to be added itself because
+ // the paragraph attributes are identical
+ // ( -> bForgetAttr in SwpHints::Insert )
if ( pTxtNode->GetpSwpHints() && m_pHistory )
{
pTxtNode->GetpSwpHints()->DeRegister();
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index dad2ccc..dccfd83 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -26,16 +26,11 @@
*
************************************************************************/
-
#include <UndoAttribute.hxx>
-
#include <svl/itemiter.hxx>
-
#include <editeng/tstpitem.hxx>
-
#include <svx/svdmodel.hxx>
#include <svx/svdpage.hxx>
-
#include <hintids.hxx>
#include <fmtflcnt.hxx>
#include <txtftn.hxx>
@@ -65,9 +60,6 @@
#include <charfmt.hxx>
#include <switerator.hxx>
-
-// -----------------------------------------------------
-
SwUndoFmtAttrHelper::SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSvDrwPt )
: SwClient( &rFmt )
, m_pUndo( 0 )
@@ -123,8 +115,6 @@ void SwUndoFmtAttrHelper::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pN
}
}
-// -----------------------------------------------------
-
SwUndoFmtAttr::SwUndoFmtAttr( const SfxItemSet& rOldSet,
SwFmt& rChgFmt,
bool bSaveDrawPt )
@@ -365,8 +355,6 @@ void SwUndoFmtAttr::RepeatImpl(::sw::RepeatContext & rContext)
}
}
break;
-// case RES_CHRFMT:
-// case RES_FRMFMT:
case RES_FLYFRMFMT:
{
@@ -431,12 +419,7 @@ void SwUndoFmtAttr::SaveFlyAnchor( bool bSvDrwPt )
// store old value as attribute, to keep SwUndoFmtAttr small
m_pOldSet->Put( SwFmtFrmSize( ATT_VAR_SIZE, aPt.X(), aPt.Y() ) );
}
-/* else
- {
- pOldSet->Put( pFmt->GetVertOrient() );
- pOldSet->Put( pFmt->GetHoriOrient() );
- }
-*/ }
+ }
const SwFmtAnchor& rAnchor =
static_cast<const SwFmtAnchor&>( m_pOldSet->Get( RES_ANCHOR, sal_False ) );
@@ -519,8 +502,6 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
// write the current value into cache
aDrawOldPt = pFrmFmt->FindSdrObject()->GetRelativePos();
-// According to AMA/MA not needed anymore
-// pCont->DisconnectFromLayout();
}
else
{
@@ -576,8 +557,6 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
// The Draw model also prepared an Undo object for its right positioning
// which unfortunately is relative. Therefore block here a position
// change of the Contact object by setting the anchor.
-//JP 08.10.97: ist laut AMA/MA nicht mehr noetig
-// pCont->ConnectToLayout();
SdrObject* pObj = pCont->GetMaster();
if( pCont->GetAnchorFrm() && !pObj->IsInserted() )
@@ -611,7 +590,6 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
return true;
}
-// -----------------------------------------------------
SwUndoFmtResetAttr::SwUndoFmtResetAttr( SwFmt& rChangedFormat,
const sal_uInt16 nWhichId )
: SwUndo( UNDO_RESETATTR )
@@ -646,8 +624,6 @@ void SwUndoFmtResetAttr::RedoImpl(::sw::UndoRedoContext &)
}
}
-// -----------------------------------------------------
-
SwUndoResetAttr::SwUndoResetAttr( const SwPaM& rRange, sal_uInt16 nFmtId )
: SwUndo( UNDO_RESETATTR ), SwUndRng( rRange )
, m_pHistory( new SwHistory )
@@ -775,9 +751,6 @@ void SwUndoResetAttr::SetAttrs( const std::set<sal_uInt16> &rAttrs )
m_Ids.insert( rAttrs.begin(), rAttrs.end() );
}
-// -----------------------------------------------------
-
-
SwUndoAttr::SwUndoAttr( const SwPaM& rRange, const SfxPoolItem& rAttr,
const SetAttrMode nFlags )
: SwUndo( UNDO_INSATTR ), SwUndRng( rRange )
@@ -926,7 +899,6 @@ void SwUndoAttr::RedoImpl(::sw::UndoRedoContext & rContext)
}
}
-
void SwUndoAttr::RemoveIdx( SwDoc& rDoc )
{
if ( SFX_ITEM_SET != m_AttrSet.GetItemState( RES_TXTATR_FTN, sal_False ))
@@ -996,8 +968,6 @@ void SwUndoAttr::RemoveIdx( SwDoc& rDoc )
}
}
-// -----------------------------------------------------
-
SwUndoDefaultAttr::SwUndoDefaultAttr( const SfxItemSet& rSet )
: SwUndo( UNDO_SETDEFTATTR )
, m_pOldSet( 0 )
@@ -1052,8 +1022,6 @@ void SwUndoDefaultAttr::RedoImpl(::sw::UndoRedoContext & rContext)
UndoImpl(rContext);
}
-// -----------------------------------------------------
-
SwUndoMoveLeftMargin::SwUndoMoveLeftMargin(
const SwPaM& rPam, sal_Bool bFlag, sal_Bool bMod )
: SwUndo( bFlag ? UNDO_INC_LEFTMARGIN : UNDO_DEC_LEFTMARGIN )
@@ -1094,8 +1062,6 @@ void SwUndoMoveLeftMargin::RepeatImpl(::sw::RepeatContext & rContext)
m_bModulus );
}
-// -----------------------------------------------------
-
SwUndoChangeFootNote::SwUndoChangeFootNote(
const SwPaM& rRange, const String& rTxt,
sal_uInt16 nNum, bool bIsEndNote )
@@ -1137,10 +1103,6 @@ void SwUndoChangeFootNote::RepeatImpl(::sw::RepeatContext & rContext)
rDoc.SetCurFtn( rContext.GetRepeatPaM(), m_Text, m_nNumber, m_bEndNote );
}
-
-// -----------------------------------------------------
-
-
SwUndoFootNoteInfo::SwUndoFootNoteInfo( const SwFtnInfo &rInfo )
: SwUndo( UNDO_FTNINFO )
, m_pFootNoteInfo( new SwFtnInfo( rInfo ) )
@@ -1167,9 +1129,6 @@ void SwUndoFootNoteInfo::RedoImpl(::sw::UndoRedoContext & rContext)
m_pFootNoteInfo.reset( pInf );
}
-
-// -----------------------------------------------------
-
SwUndoEndNoteInfo::SwUndoEndNoteInfo( const SwEndNoteInfo &rInfo )
: SwUndo( UNDO_FTNINFO )
, m_pEndNoteInfo( new SwEndNoteInfo( rInfo ) )
@@ -1196,8 +1155,6 @@ void SwUndoEndNoteInfo::RedoImpl(::sw::UndoRedoContext & rContext)
m_pEndNoteInfo.reset( pInf );
}
-// -----------------------------------------------------
-
SwUndoDontExpandFmt::SwUndoDontExpandFmt( const SwPosition& rPos )
: SwUndo( UNDO_DONTEXPAND )
, m_nNodeIndex( rPos.nNode.GetIndex() )
@@ -1216,7 +1173,6 @@ void SwUndoDontExpandFmt::UndoImpl(::sw::UndoRedoContext & rContext)
pDoc->DontExpandFmt( rPos, sal_False );
}
-
void SwUndoDontExpandFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx
index 3175220..e1b9da7 100644
--- a/sw/source/core/undo/unnum.cxx
+++ b/sw/source/core/undo/unnum.cxx
@@ -26,9 +26,7 @@
*
************************************************************************/
-
#include <UndoNumbering.hxx>
-
#include <hintids.hxx>
#include <editeng/lrspitem.hxx>
#include <doc.hxx>
@@ -39,7 +37,6 @@
#include <UndoCore.hxx>
#include <rolbck.hxx>
-
SwUndoInsNum::SwUndoInsNum( const SwNumRule& rOldRule,
const SwNumRule& rNewRule,
SwUndoId nUndoId )
@@ -178,9 +175,6 @@ void SwUndoInsNum::SaveOldNumRule( const SwNumRule& rOld )
pOldNumRule = new SwNumRule( rOld );
}
-/* */
-
-
SwUndoDelNum::SwUndoDelNum( const SwPaM& rPam )
: SwUndo( UNDO_DELNUM ), SwUndRng( rPam )
{
@@ -254,10 +248,6 @@ void SwUndoMoveNum::UndoImpl(::sw::UndoRedoContext & rContext)
}
nSttNode = nNewStt;
-// We want to keep the Bookmarks/Directories, don't we?
-// SetPaM( rUndoIter );
-// RemoveIdxFromRange( *rUndoIter.pAktPam, sal_True );
-
SwPaM & rPam( AddUndoRedoPaM(rContext) );
rContext.GetDoc().MoveParagraph( rPam, -nOffset,
UNDO_OUTLINE_UD == GetId() );
@@ -267,10 +257,6 @@ void SwUndoMoveNum::UndoImpl(::sw::UndoRedoContext & rContext)
void SwUndoMoveNum::RedoImpl(::sw::UndoRedoContext & rContext)
{
-// We want to keep the Bookmarks/Directories, don't we?
-// SetPaM( rUndoIter );
-// RemoveIdxFromRange( *rUndoIter.pAktPam, sal_True );
-
SwPaM & rPam( AddUndoRedoPaM(rContext) );
rContext.GetDoc().MoveParagraph(rPam, nOffset, UNDO_OUTLINE_UD == GetId());
}
@@ -289,9 +275,6 @@ void SwUndoMoveNum::RepeatImpl(::sw::RepeatContext & rContext)
}
}
-/* */
-
-
SwUndoNumUpDown::SwUndoNumUpDown( const SwPaM& rPam, short nOff )
: SwUndo( nOff > 0 ? UNDO_NUMUP : UNDO_NUMDOWN ), SwUndRng( rPam ),
nOffset( nOff )
@@ -317,8 +300,6 @@ void SwUndoNumUpDown::RepeatImpl(::sw::RepeatContext & rContext)
rContext.GetDoc().NumUpDown(rContext.GetRepeatPaM(), 1 == nOffset);
}
-/* */
-
// #115901#
SwUndoNumOrNoNum::SwUndoNumOrNoNum( const SwNodeIndex& rIdx, sal_Bool bOldNum,
sal_Bool bNewNum)
@@ -365,8 +346,6 @@ void SwUndoNumOrNoNum::RepeatImpl(::sw::RepeatContext & rContext)
}
}
-/* */
-
SwUndoNumRuleStart::SwUndoNumRuleStart( const SwPosition& rPos, sal_Bool bFlg )
: SwUndo( UNDO_SETNUMRULESTART ),
nIdx( rPos.nNode.GetIndex() ), nOldStt( USHRT_MAX ),
@@ -393,7 +372,6 @@ SwUndoNumRuleStart::SwUndoNumRuleStart( const SwPosition& rPos, sal_uInt16 nStt
}
}
-
void SwUndoNumRuleStart::UndoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc & rDoc = rContext.GetDoc();
@@ -408,7 +386,6 @@ void SwUndoNumRuleStart::UndoImpl(::sw::UndoRedoContext & rContext)
}
}
-
void SwUndoNumRuleStart::RedoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc & rDoc = rContext.GetDoc();
@@ -423,7 +400,6 @@ void SwUndoNumRuleStart::RedoImpl(::sw::UndoRedoContext & rContext)
}
}
-
void SwUndoNumRuleStart::RepeatImpl(::sw::RepeatContext & rContext)
{
SwDoc & rDoc = rContext.GetDoc();
@@ -437,5 +413,4 @@ void SwUndoNumRuleStart::RepeatImpl(::sw::RepeatContext & rContext)
}
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index 17e8c7f..944d45f 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -26,16 +26,11 @@
*
************************************************************************/
-
#include <UndoOverwrite.hxx>
-
#include <tools/resid.hxx>
-
#include <unotools/charclass.hxx>
#include <unotools/transliterationwrapper.hxx>
-
#include <comphelper/processfactory.hxx>
-
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
#include <IShellCursorSupplier.hxx>
@@ -46,7 +41,6 @@
#include <rolbck.hxx>
#include <acorrect.hxx>
#include <docary.hxx>
-
#include <comcore.hrc> // #111827#
#include <undo.hrc>
@@ -54,12 +48,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star::uno;
-
-//------------------------------------------------------------
-
-// OVERWRITE
-
-
SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
sal_Unicode cIns )
: SwUndo(UNDO_OVERWRITE),
@@ -190,10 +178,6 @@ sal_Bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
return sal_True;
}
-
-
-
-
void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc *const pDoc = & rContext.GetDoc();
@@ -243,6 +227,7 @@ void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext)
pTxtNd->SetIgnoreDontExpand( bOldExpFlg );
rIdx--;
}
+
if( pHistory )
{
if( pTxtNd->GetpSwpHints() )
@@ -284,7 +269,7 @@ void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext)
pAktPam->DeleteMark();
pAktPam->GetPoint()->nNode = nSttNode;
SwTxtNode* pTxtNd = pAktPam->GetNode()->GetTxtNode();
- OSL_ENSURE( pTxtNd, "Overwrite nicht im TextNode?" );
+ OSL_ENSURE( pTxtNd, "Overwrite not in TextNode?" );
SwIndex& rIdx = pAktPam->GetPoint()->nContent;
if( pRedlSaveData )
@@ -340,8 +325,6 @@ SwRewriter SwUndoOverwrite::GetRewriter() const
return aResult;
}
-//------------------------------------------------------------
-
struct _UndoTransliterate_Data
{
String sText;
@@ -496,5 +479,4 @@ void _UndoTransliterate_Data::SetChangeAtNode( SwDoc& rDoc )
}
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index c6241c8..4f74499 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -26,9 +26,7 @@
*
************************************************************************/
-
#include <UndoRedline.hxx>
-
#include <hintids.hxx>
#include <unotools/charclass.hxx>
#include <doc.hxx>
@@ -45,14 +43,12 @@
extern void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev );
extern void lcl_GetJoinFlags( SwPaM& rPam, sal_Bool& rJoinTxt, sal_Bool& rJoinPrev );
-//------------------------------------------------------------------
-
SwUndoRedline::SwUndoRedline( SwUndoId nUsrId, const SwPaM& rRange )
: SwUndo( UNDO_REDLINE ), SwUndRng( rRange ),
pRedlData( 0 ), pRedlSaveData( 0 ), nUserId( nUsrId ),
bHiddenRedlines( sal_False )
{
- // mind the Redline
+ // consider Redline
SwDoc& rDoc = *rRange.GetDoc();
if( rDoc.IsRedlineOn() )
{
@@ -97,7 +93,6 @@ sal_uInt16 SwUndoRedline::GetRedlSaveCount() const
return pRedlSaveData ? pRedlSaveData->Count() : 0;
}
-
void SwUndoRedline::UndoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc *const pDoc = & rContext.GetDoc();
@@ -121,7 +116,6 @@ void SwUndoRedline::UndoImpl(::sw::UndoRedoContext & rContext)
}
}
-
void SwUndoRedline::RedoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc *const pDoc = & rContext.GetDoc();
@@ -156,9 +150,6 @@ void SwUndoRedline::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam)
rDoc.DeleteRedline(rPam, true, USHRT_MAX);
}
-
-// SwUndoRedlineDelete ///////////////////////////////////////////////////
-
SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUsrId )
: SwUndoRedline( nUsrId ? nUsrId : UNDO_DELETE, rRange ),
bCanGroup( sal_False ), bIsDelim( sal_False ), bIsBackspace( sal_False )
@@ -228,7 +219,6 @@ sal_Bool SwUndoRedlineDelete::CanGrouping( const SwUndoRedlineDelete& rNext )
return bRet;
}
-
SwUndoRedlineSort::SwUndoRedlineSort( const SwPaM& rRange,
const SwSortOptions& rOpt )
: SwUndoRedline( UNDO_SORT_TXT, rRange ),
@@ -343,8 +333,6 @@ void SwUndoRedlineSort::SetOffset( const SwNodeIndex& rIdx )
nOffset = rIdx.GetIndex() - nSttNode;
}
-// SwUndoAcceptRedline ///////////////////////////////////////////////////
-
SwUndoAcceptRedline::SwUndoAcceptRedline( const SwPaM& rRange )
: SwUndoRedline( UNDO_ACCEPT_REDLINE, rRange )
{
@@ -375,8 +363,6 @@ void SwUndoRejectRedline::RepeatImpl(::sw::RepeatContext & rContext)
rContext.GetDoc().RejectRedline(rContext.GetRepeatPaM(), true);
}
-// SwUndoCompDoc /////////////////////////////////////////////////////////
-
SwUndoCompDoc::SwUndoCompDoc( const SwPaM& rRg, sal_Bool bIns )
: SwUndo( UNDO_COMPAREDOC ), SwUndRng( rRg ), pRedlData( 0 ),
pUnDel( 0 ), pUnDel2( 0 ), pRedlSaveData( 0 ), bInsert( bIns )
@@ -521,5 +507,4 @@ void SwUndoCompDoc::RedoImpl(::sw::UndoRedoContext & rContext)
SetPaM(*pPam, true);
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index cbfa343..ee16941 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -27,7 +27,6 @@
************************************************************************/
#include <UndoTable.hxx>
-
#include <UndoRedline.hxx>
#include <UndoDelete.hxx>
#include <UndoSplitMove.hxx>
@@ -155,7 +154,6 @@ class _SaveLine
sal_uInt16 nItemSet;
public:
-
_SaveLine( _SaveLine* pPrev, const SwTableLine& rLine, _SaveTable& rSTbl );
~_SaveLine();
@@ -1051,7 +1049,6 @@ void _SaveTable::CreateNew( SwTable& rTbl, sal_Bool bCreateFrms,
if( n < nOldLines )
{
// remove remaining lines...
-
for (sal_uInt16 k1 = 0; k1 < nOldLines - n; ++k1)
{
const SwTableBoxes &rBoxes = rTbl.GetTabLines()[n + k1]->GetTabBoxes();
@@ -1372,7 +1369,6 @@ void _SaveBox::CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl
}
// UndoObject for attribute changes on table
-
SwUndoAttrTbl::SwUndoAttrTbl( const SwTableNode& rTblNd, sal_Bool bClearTabCols )
: SwUndo( UNDO_TABLE_ATTR ),
nSttNode( rTblNd.GetIndex() )
@@ -1410,7 +1406,6 @@ void SwUndoAttrTbl::RedoImpl(::sw::UndoRedoContext & rContext)
}
// UndoObject for AutoFormat on Table
-
SwUndoTblAutoFmt::SwUndoTblAutoFmt( const SwTableNode& rTblNd,
const SwTableAutoFmt& rAFmt )
: SwUndo( UNDO_TABLE_AUTOFMT ),
@@ -1940,7 +1935,6 @@ void SwUndoTblMerge::UndoImpl(::sw::UndoRedoContext & rContext)
// ? TL_CHART2: notification or locking of controller required ?
// 1. restore deleted boxes:
-
// Trick: add missing boxes in any line, they will be connected
// correctly when calling CreateNew
SwTableBox *pBox, *pCpyBox = pTblNd->GetTable().GetTabSortBoxes()[0];
@@ -2036,7 +2030,6 @@ CHECKTABLE(pTblNd->GetTable())
SwTableBoxes* pTBoxes = &pBox->GetUpper()->GetTabBoxes();
pTBoxes->erase( std::find(pTBoxes->begin(), pTBoxes->end(), pBox ) );
-
// delete indices from section
{
SwNodeIndex aTmpIdx( *pBox->GetSttNd() );
@@ -2051,7 +2044,6 @@ CHECKTABLE(pTblNd->GetTable())
}
CHECKTABLE(pTblNd->GetTable())
-
pSaveTbl->CreateNew( pTblNd->GetTable(), sal_True, sal_False );
// TL_CHART2: need to inform chart of probably changed cell names
@@ -2260,8 +2252,8 @@ class RedlineModeInternGuard
public:
RedlineModeInternGuard(
- SwDoc& rDoc, /// change mode of this document
- RedlineMode_t eNewRedlineMode, /// new redline mode
+ SwDoc& rDoc, // change mode of this document
+ RedlineMode_t eNewRedlineMode, // new redline mode
RedlineMode_t eRedlineModeMask = (RedlineMode_t)(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_IGNORE /*change only bits set in this mask*/));
~RedlineModeInternGuard();
More information about the Libreoffice-commits
mailing list