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

Clean up and translate comments

Change-Id: I7ecc27535622d7ee63251005f0768ea3cb47623b
üst c4f0da46
This diff is collapsed.
...@@ -26,9 +26,7 @@ ...@@ -26,9 +26,7 @@
* *
************************************************************************/ ************************************************************************/
#include <svl/itemiter.hxx> #include <svl/itemiter.hxx>
#include <hintids.hxx> #include <hintids.hxx>
#include <hints.hxx> #include <hints.hxx>
#include <fmtflcnt.hxx> #include <fmtflcnt.hxx>
...@@ -50,10 +48,6 @@ ...@@ -50,10 +48,6 @@
#include <dcontact.hxx> #include <dcontact.hxx>
#include <ndole.hxx> #include <ndole.hxx>
//---------------------------------------------------------------------
// SwUndoLayBase /////////////////////////////////////////////////////////
SwUndoFlyBase::SwUndoFlyBase( SwFrmFmt* pFormat, SwUndoId nUndoId ) SwUndoFlyBase::SwUndoFlyBase( SwFrmFmt* pFormat, SwUndoId nUndoId )
: SwUndo( nUndoId ), pFrmFmt( pFormat ) : SwUndo( nUndoId ), pFrmFmt( pFormat )
{ {
...@@ -115,10 +109,9 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm) ...@@ -115,10 +109,9 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm)
pFrmFmt->SetFmtAttr( SwFmtCntnt( aIdx.GetNode().GetStartNode() )); pFrmFmt->SetFmtAttr( SwFmtCntnt( aIdx.GetNode().GetStartNode() ));
} }
//JP 18.12.98: Bug 60505 - set InCntntAttribute not until there is content! // Set InCntntAttribute not until there is content!
// Otherwise the layout would format the Fly beforehand but // Otherwise the layout would format the Fly beforehand but would not find
// would not find content; this happend with graphics from the // content; this happend with graphics from the internet.
// internet
if (FLY_AS_CHAR == nRndId) if (FLY_AS_CHAR == nRndId)
{ {
// there must be at least the attribute in a TextNode // there must be at least the attribute in a TextNode
...@@ -235,8 +228,6 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc ) ...@@ -235,8 +228,6 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
rFlyFmts.Remove( rFlyFmts.GetPos( pFrmFmt )); rFlyFmts.Remove( rFlyFmts.GetPos( pFrmFmt ));
} }
// SwUndoInsLayFmt ///////////////////////////////////////////////////////
SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, sal_uLong nNodeIdx, xub_StrLen nCntIdx ) SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, sal_uLong nNodeIdx, xub_StrLen nCntIdx )
: SwUndoFlyBase( pFormat, RES_DRAWFRMFMT == pFormat->Which() ? : SwUndoFlyBase( pFormat, RES_DRAWFRMFMT == pFormat->Which() ?
UNDO_INSDRAWFMT : UNDO_INSLAYFMT ), UNDO_INSDRAWFMT : UNDO_INSLAYFMT ),
...@@ -347,8 +338,6 @@ void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext) ...@@ -347,8 +338,6 @@ void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext)
SwFrmFmt* pFlyFmt = pDoc->CopyLayoutFmt( *pFrmFmt, aAnchor, true, true ); SwFrmFmt* pFlyFmt = pDoc->CopyLayoutFmt( *pFrmFmt, aAnchor, true, true );
(void) pFlyFmt; (void) pFlyFmt;
//FIXME nobody ever did anything with this selection:
// rContext.SetSelections(pFlyFmt, 0);
} }
// #111827# // #111827#
...@@ -367,7 +356,6 @@ rtl::OUString SwUndoInsLayFmt::GetComment() const ...@@ -367,7 +356,6 @@ rtl::OUString SwUndoInsLayFmt::GetComment() const
If frame format is present and has an SdrObject use the undo If frame format is present and has an SdrObject use the undo
comment of the SdrObject. Otherwise use the default comment. comment of the SdrObject. Otherwise use the default comment.
*/ */
bool bDone = false; bool bDone = false;
if (pFrmFmt) if (pFrmFmt)
{ {
...@@ -388,8 +376,6 @@ rtl::OUString SwUndoInsLayFmt::GetComment() const ...@@ -388,8 +376,6 @@ rtl::OUString SwUndoInsLayFmt::GetComment() const
return aResult; return aResult;
} }
// SwUndoDelLayFmt ///////////////////////////////////////////////////////
static SwUndoId static SwUndoId
lcl_GetSwUndoId(SwFrmFmt *const pFrmFmt) lcl_GetSwUndoId(SwFrmFmt *const pFrmFmt)
{ {
...@@ -473,8 +459,6 @@ void SwUndoDelLayFmt::RedoForRollback() ...@@ -473,8 +459,6 @@ void SwUndoDelLayFmt::RedoForRollback()
DelFly( pFrmFmt->GetDoc() ); DelFly( pFrmFmt->GetDoc() );
} }
// SwUndoSetFlyFmt ///////////////////////////////////////////////////////
SwUndoSetFlyFmt::SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt ) SwUndoSetFlyFmt::SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt )
: SwUndo( UNDO_SETFLYFRMFMT ), SwClient( &rFlyFmt ), pFrmFmt( &rFlyFmt ), : SwUndo( UNDO_SETFLYFRMFMT ), SwClient( &rFlyFmt ), pFrmFmt( &rFlyFmt ),
pOldFmt( (SwFrmFmt*)rFlyFmt.DerivedFrom() ), pNewFmt( &rNewFrmFmt ), pOldFmt( (SwFrmFmt*)rFlyFmt.DerivedFrom() ), pNewFmt( &rNewFrmFmt ),
...@@ -496,7 +480,6 @@ SwRewriter SwUndoSetFlyFmt::GetRewriter() const ...@@ -496,7 +480,6 @@ SwRewriter SwUndoSetFlyFmt::GetRewriter() const
return aRewriter; return aRewriter;
} }
SwUndoSetFlyFmt::~SwUndoSetFlyFmt() SwUndoSetFlyFmt::~SwUndoSetFlyFmt()
{ {
delete pItemSet; delete pItemSet;
......
...@@ -26,9 +26,7 @@ ...@@ -26,9 +26,7 @@
* *
************************************************************************/ ************************************************************************/
#include <UndoSplitMove.hxx> #include <UndoSplitMove.hxx>
#include <doc.hxx> #include <doc.hxx>
#include <IDocumentUndoRedo.hxx> #include <IDocumentUndoRedo.hxx>
#include <pam.hxx> #include <pam.hxx>
...@@ -37,9 +35,7 @@ ...@@ -37,9 +35,7 @@
#include <UndoCore.hxx> #include <UndoCore.hxx>
#include <rolbck.hxx> #include <rolbck.hxx>
// MOVE // MOVE
SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos ) SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
: SwUndo( UNDO_MOVE ), SwUndRng( rRange ), : SwUndo( UNDO_MOVE ), SwUndRng( rRange ),
nMvDestNode( rMvPos.nNode.GetIndex() ), nMvDestNode( rMvPos.nNode.GetIndex() ),
...@@ -91,7 +87,6 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos ) ...@@ -91,7 +87,6 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
pHistory->CopyFmtAttr( *pTxtNd->GetpSwAttrSet(), nMvDestNode ); pHistory->CopyFmtAttr( *pTxtNd->GetpSwAttrSet(), nMvDestNode );
} }
nFtnStt = pHistory->Count(); nFtnStt = pHistory->Count();
DelFtn( rRange ); DelFtn( rRange );
...@@ -99,7 +94,6 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos ) ...@@ -99,7 +94,6 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
DELETEZ( pHistory ); DELETEZ( pHistory );
} }
SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg, SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
const SwNodeIndex& rMvPos ) const SwNodeIndex& rMvPos )
: SwUndo( UNDO_MOVE ), : SwUndo( UNDO_MOVE ),
...@@ -115,6 +109,7 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg, ...@@ -115,6 +109,7 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
nEndNode = rRg.aEnd.GetIndex(); nEndNode = rRg.aEnd.GetIndex();
// DelFtn( rRange ); // DelFtn( rRange );
// FIXME: duplication of the method body of DelFtn below
// is the current move from CntntArea into the special section? // is the current move from CntntArea into the special section?
sal_uLong nCntntStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex(); sal_uLong nCntntStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex();
...@@ -138,8 +133,6 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg, ...@@ -138,8 +133,6 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
nFtnStt = 0; nFtnStt = 0;
} }
void SwUndoMove::SetDestRange( const SwPaM& rRange, void SwUndoMove::SetDestRange( const SwPaM& rRange,
const SwPosition& rInsPos, const SwPosition& rInsPos,
sal_Bool bJoin, sal_Bool bCorrPam ) sal_Bool bJoin, sal_Bool bCorrPam )
...@@ -169,7 +162,6 @@ void SwUndoMove::SetDestRange( const SwPaM& rRange, ...@@ -169,7 +162,6 @@ void SwUndoMove::SetDestRange( const SwPaM& rRange,
bJoinPrev = bJoin; bJoinPrev = bJoin;
} }
void SwUndoMove::SetDestRange( const SwNodeIndex& rStt, void SwUndoMove::SetDestRange( const SwNodeIndex& rStt,
const SwNodeIndex& rEnd, const SwNodeIndex& rEnd,
const SwNodeIndex& rInsPos ) const SwNodeIndex& rInsPos )
...@@ -186,7 +178,6 @@ void SwUndoMove::SetDestRange( const SwNodeIndex& rStt, ...@@ -186,7 +178,6 @@ void SwUndoMove::SetDestRange( const SwNodeIndex& rStt,
nDestSttCntnt = nDestEndCntnt = nInsPosCntnt = STRING_MAXLEN; nDestSttCntnt = nDestEndCntnt = nInsPosCntnt = STRING_MAXLEN;
} }
void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext) void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
{ {
SwDoc *const pDoc = & rContext.GetDoc(); SwDoc *const pDoc = & rContext.GetDoc();
...@@ -212,8 +203,8 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext) ...@@ -212,8 +203,8 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
SwPaM aPam( aIdx.GetNode(), nDestSttCntnt, SwPaM aPam( aIdx.GetNode(), nDestSttCntnt,
*pDoc->GetNodes()[ nDestEndNode ], nDestEndCntnt ); *pDoc->GetNodes()[ nDestEndNode ], nDestEndCntnt );
// #i17764# if redlines are to be moved, we may not remove them before // #i17764# if redlines are to be moved, we may not remove them
// pDoc->Move gets a chance to handle them // before pDoc->Move gets a chance to handle them
if( ! bMoveRedlines ) if( ! bMoveRedlines )
RemoveIdxFromRange( aPam, sal_False ); RemoveIdxFromRange( aPam, sal_False );
...@@ -236,7 +227,6 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext) ...@@ -236,7 +227,6 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
aPam.Exchange(); aPam.Exchange();
aPam.DeleteMark(); aPam.DeleteMark();
// pDoc->ResetAttr( aPam, sal_False );
if( aPam.GetNode()->IsCntntNode() ) if( aPam.GetNode()->IsCntntNode() )
aPam.GetNode()->GetCntntNode()->ResetAllAttr(); aPam.GetNode()->GetCntntNode()->ResetAllAttr();
// the Pam will be dropped now // the Pam will be dropped now
...@@ -281,7 +271,6 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext) ...@@ -281,7 +271,6 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
} }
} }
void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext) void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext)
{ {
SwPaM *const pPam = & AddUndoRedoPaM(rContext); SwPaM *const pPam = & AddUndoRedoPaM(rContext);
...@@ -334,7 +323,6 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext) ...@@ -334,7 +323,6 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext)
} }
} }
void SwUndoMove::DelFtn( const SwPaM& rRange ) void SwUndoMove::DelFtn( const SwPaM& rRange )
{ {
// is the current move from CntntArea into the special section? // is the current move from CntntArea into the special section?
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
* *
************************************************************************/ ************************************************************************/
#include <hintids.hxx> #include <hintids.hxx>
#include <fmtanchr.hxx> #include <fmtanchr.hxx>
#include <frmfmt.hxx> #include <frmfmt.hxx>
...@@ -34,15 +33,13 @@ ...@@ -34,15 +33,13 @@
#include <IDocumentUndoRedo.hxx> #include <IDocumentUndoRedo.hxx>
#include <IShellCursorSupplier.hxx> #include <IShellCursorSupplier.hxx>
#include <docary.hxx> #include <docary.hxx>
#include <swundo.hxx> // fuer die UndoIds #include <swundo.hxx>
#include <pam.hxx> #include <pam.hxx>
#include <ndtxt.hxx> #include <ndtxt.hxx>
#include <UndoCore.hxx> #include <UndoCore.hxx>
#include <rolbck.hxx> #include <rolbck.hxx>
#include <redline.hxx> #include <redline.hxx>
SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam ) SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
: SwUndo( nUndoId ), SwUndRng( rPam ), : SwUndo( nUndoId ), SwUndRng( rPam ),
pTxtFmtColl( 0 ), pLastNdColl(0), pFrmFmts( 0 ), pRedlData( 0 ), pTxtFmtColl( 0 ), pLastNdColl(0), pFrmFmts( 0 ), pRedlData( 0 ),
...@@ -60,7 +57,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam ) ...@@ -60,7 +57,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
if( pTxtNd->HasSwAttrSet() ) if( pTxtNd->HasSwAttrSet() )
pHistory->CopyFmtAttr( *pTxtNd->GetpSwAttrSet(), nSttNode ); pHistory->CopyFmtAttr( *pTxtNd->GetpSwAttrSet(), nSttNode );
if( !nSttCntnt ) // dann werden Flys mitgenommen !! if( !nSttCntnt ) // than take the Flys along
{ {
sal_uInt16 nArrLen = pDoc->GetSpzFrmFmts()->Count(); sal_uInt16 nArrLen = pDoc->GetSpzFrmFmts()->Count();
for( sal_uInt16 n = 0; n < nArrLen; ++n ) for( sal_uInt16 n = 0; n < nArrLen; ++n )
...@@ -79,7 +76,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam ) ...@@ -79,7 +76,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
} }
} }
} }
// Redline beachten // consider Redline
if( pDoc->IsRedlineOn() ) if( pDoc->IsRedlineOn() )
{ {
pRedlData = new SwRedlineData( nsRedlineType_t::REDLINE_INSERT, pDoc->GetRedlineAuthor() ); pRedlData = new SwRedlineData( nsRedlineType_t::REDLINE_INSERT, pDoc->GetRedlineAuthor() );
...@@ -87,8 +84,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam ) ...@@ -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, void SwUndoInserts::SetInsertRange( const SwPaM& rPam, sal_Bool bScanFlys,
sal_Bool bSttIsTxtNd ) sal_Bool bSttIsTxtNd )
{ {
...@@ -105,16 +101,16 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, sal_Bool bScanFlys, ...@@ -105,16 +101,16 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, sal_Bool bScanFlys,
nSttNode = pTmpPos->nNode.GetIndex(); nSttNode = pTmpPos->nNode.GetIndex();
nSttCntnt = pTmpPos->nContent.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; bSttWasTxtNd = sal_False;
} }
} }
if( bScanFlys && !nSttCntnt ) if( bScanFlys && !nSttCntnt )
{ {
// dann alle neuen Flys zusammen sammeln !! // than collect all new Flys
SwDoc* pDoc = (SwDoc*)rPam.GetDoc(); SwDoc* pDoc = (SwDoc*)rPam.GetDoc();
sal_uInt16 nFndPos, nArrLen = pDoc->GetSpzFrmFmts()->Count(); sal_uInt16 nFndPos, nArrLen = pDoc->GetSpzFrmFmts()->Count();
for( sal_uInt16 n = 0; n < nArrLen; ++n ) for( sal_uInt16 n = 0; n < nArrLen; ++n )
...@@ -141,18 +137,17 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, sal_Bool bScanFlys, ...@@ -141,18 +137,17 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, sal_Bool bScanFlys,
} }
} }
SwUndoInserts::~SwUndoInserts() 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(); 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(); SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode();
OSL_ENSURE( pTxtNd, "kein TextNode, aus dem geloescht werden soll" ); OSL_ENSURE( pTxtNd, "no TextNode to delete from" );
if( pTxtNd ) // Robust if( pTxtNd ) // robust
{ {
pTxtNd->EraseText( pPos->nContent ); pTxtNd->EraseText( pPos->nContent );
} }
...@@ -167,7 +162,6 @@ SwUndoInserts::~SwUndoInserts() ...@@ -167,7 +162,6 @@ SwUndoInserts::~SwUndoInserts()
delete pRedlData; delete pRedlData;
} }
void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
{ {
SwDoc *const pDoc = & rContext.GetDoc(); SwDoc *const pDoc = & rContext.GetDoc();
...@@ -176,14 +170,13 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) ...@@ -176,14 +170,13 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() )) if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
pDoc->DeleteRedline( *pPam, true, USHRT_MAX ); pDoc->DeleteRedline( *pPam, true, USHRT_MAX );
// sind an Point/Mark 2 unterschiedliche TextNodes, dann muss ein // if Point and Mark are different text nodes so a JoinNext has to be done
// JoinNext ausgefuehrt werden.
sal_Bool bJoinNext = nSttNode != nEndNode && sal_Bool bJoinNext = nSttNode != nEndNode &&
pPam->GetMark()->nNode.GetNode().GetTxtNode() && pPam->GetMark()->nNode.GetNode().GetTxtNode() &&
pPam->GetPoint()->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 || nSttCntnt != nEndCntnt )
{ {
if( nSttNode != nEndNode ) if( nSttNode != nEndNode )
...@@ -196,7 +189,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) ...@@ -196,7 +189,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
RemoveIdxFromRange( *pPam, sal_False ); RemoveIdxFromRange( *pPam, sal_False );
SetPaM(*pPam); SetPaM(*pPam);
// sind Fussnoten oder CntntFlyFrames im Text ?? // are there Footnotes or CntntFlyFrames in text?
nSetPos = pHistory->Count(); nSetPos = pHistory->Count();
nNdDiff = pPam->GetMark()->nNode.GetIndex(); nNdDiff = pPam->GetMark()->nNode.GetIndex();
DelCntntIndex( *pPam->GetMark(), *pPam->GetPoint() ); DelCntntIndex( *pPam->GetMark(), *pPam->GetPoint() );
...@@ -226,12 +219,14 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) ...@@ -226,12 +219,14 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
SwTxtNode* pTxtNode = rIdx.GetNode().GetTxtNode(); SwTxtNode* pTxtNode = rIdx.GetNode().GetTxtNode();
if( pTxtNode ) if( pTxtNode )
{ {
if( !pTxtFmtColl ) // falls 0, dann war hier auch kein TextNode, if( !pTxtFmtColl ) // if 0 than it's no TextNode -> delete
{ // dann muss dieser geloescht werden, {
SwNodeIndex aDelIdx( rIdx ); SwNodeIndex aDelIdx( rIdx );
rIdx++; rIdx++;
SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode(); 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->GetPoint()->nContent.Assign( pCNd, nCnt );
pPam->SetMark(); pPam->SetMark();
pPam->DeleteMark(); pPam->DeleteMark();
...@@ -254,7 +249,6 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) ...@@ -254,7 +249,6 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
pTxtNode->RstAttr( SwIndex(pTxtNode, 0), pTxtNode->Len(), pTxtNode->RstAttr( SwIndex(pTxtNode, 0), pTxtNode->Len(),
0, 0, true ); 0, 0, true );
// setze alle Attribute im Node zurueck
pTxtNode->ResetAllAttr(); pTxtNode->ResetAllAttr();
if( USHRT_MAX != pDoc->GetTxtFmtColls()->GetPos( pTxtFmtColl )) if( USHRT_MAX != pDoc->GetTxtFmtColls()->GetPos( pTxtFmtColl ))
...@@ -268,7 +262,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) ...@@ -268,7 +262,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
void SwUndoInserts::RedoImpl(::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()); SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor());
SwDoc* pDoc = pPam->GetDoc(); SwDoc* pDoc = pPam->GetDoc();
pPam->DeleteMark(); pPam->DeleteMark();
...@@ -282,12 +276,12 @@ void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & rContext) ...@@ -282,12 +276,12 @@ void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & rContext)
pHistory->SetTmpEnd( nSetPos ); pHistory->SetTmpEnd( nSetPos );
// alte Anfangs-Position fuers Rollback zurueckholen // retrieve start position for rollback
if( ( nSttNode != nEndNode || nSttCntnt != nEndCntnt ) && pPos ) if( ( nSttNode != nEndNode || nSttCntnt != nEndCntnt ) && pPos )
{ {
sal_Bool bMvBkwrd = MovePtBackward( *pPam ); sal_Bool bMvBkwrd = MovePtBackward( *pPam );
// Inhalt wieder einfuegen. (erst pPos abmelden !!) // re-insert content again (first detach pPos!)
sal_uLong nMvNd = pPos->nNode.GetIndex(); sal_uLong nMvNd = pPos->nNode.GetIndex();
xub_StrLen nMvCnt = pPos->nContent.GetIndex(); xub_StrLen nMvCnt = pPos->nContent.GetIndex();
DELETEZ( pPos ); DELETEZ( pPos );
...@@ -340,9 +334,6 @@ void SwUndoInserts::RepeatImpl(::sw::RepeatContext & rContext) ...@@ -340,9 +334,6 @@ void SwUndoInserts::RepeatImpl(::sw::RepeatContext & rContext)
aPam.GetDoc()->CopyRange( aPam, *rRepeatPaM.GetPoint(), false ); aPam.GetDoc()->CopyRange( aPam, *rRepeatPaM.GetPoint(), false );
} }
//////////////////////////////////////////////////////////////////////////
SwUndoInsDoc::SwUndoInsDoc( const SwPaM& rPam ) SwUndoInsDoc::SwUndoInsDoc( const SwPaM& rPam )
: SwUndoInserts( UNDO_INSDOKUMENT, rPam ) : SwUndoInserts( UNDO_INSDOKUMENT, rPam )
{ {
......
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