summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorPhilipp Riemer <ruderphilipp@gmail.com>2012-05-30 20:16:56 +0200
committerTor Lillqvist <tml@iki.fi>2012-05-30 23:42:43 +0300
commit8f7e92fcb140d39dc20884bd35b1dca572b49ab8 (patch)
tree739c32d0c97e3d728afd7f9ba1dd51f8bacd86ef /sw
parente519306d498208484b72d935a3923af4a9adbbcb (diff)
Clean up comments, whitespace, commented out code
Change-Id: Ieedc214a0810b9ecbe69c5308ee3bdcf98ae461a
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/undo/rolbck.cxx115
-rw-r--r--sw/source/core/undo/unattr.cxx46
-rw-r--r--sw/source/core/undo/unnum.cxx25
-rw-r--r--sw/source/core/undo/unovwr.cxx22
-rw-r--r--sw/source/core/undo/unredln.cxx17
-rw-r--r--sw/source/core/undo/untbl.cxx12
6 files changed, 21 insertions, 216 deletions
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index d16c95183f50..41f10c440839 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 dad2ccc0cc71..dccfd83843b5 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 31752209798a..e1b9da720012 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 17e8c7fd605c..944d45f27d4b 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 c6241c836cee..4f74499ce9ec 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 cbfa343d8822..ee169414b464 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();