Kaydet (Commit) 8f7e92fc authored tarafından Philipp Riemer's avatar Philipp Riemer Kaydeden (comit) Tor Lillqvist

Clean up comments, whitespace, commented out code

Change-Id: Ieedc214a0810b9ecbe69c5308ee3bdcf98ae461a
üst e519306d
This diff is collapsed.
......@@ -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());
......
......@@ -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: */
......@@ -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: */
......@@ -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: */
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment