summaryrefslogtreecommitdiff
path: root/sw/source/core/undo/undobj.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/undo/undobj.cxx')
-rw-r--r--sw/source/core/undo/undobj.cxx44
1 files changed, 25 insertions, 19 deletions
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index eaf548d31d04..505863ff1421 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,7 +64,7 @@ public:
SwNodeIndex* GetMvSttIdx() const
{ return SwUndoSaveSection::GetMvSttIdx(); }
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_uInt16 nRedlineCount;
#endif
};
@@ -499,7 +500,7 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx,
}
else {
- ASSERT( sal_False, "was ist es denn nun?" );
+ OSL_FAIL( "was ist es denn nun?" );
}
}
@@ -548,7 +549,7 @@ void SwUndoSaveCntnt::MovePtForward( SwPaM& rPam, sal_Bool bMvBkwrd )
- Bookmarks
- Verzeichnisse
*/
-// --> OD 2007-10-17 #i81002# - extending method:
+// #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.
void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
@@ -597,7 +598,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
pHistory = new SwHistory;
SwTxtAttr* const pFtnHnt =
pTxtNd->GetTxtAttrForCharAt( nFtnSttIdx );
- ASSERT( pFtnHnt, "kein FtnAttribut" );
+ OSL_ENSURE( pFtnHnt, "kein FtnAttribut" );
SwIndex aIdx( pTxtNd, nFtnSttIdx );
pHistory->Add( pFtnHnt, pTxtNd->GetIndex(), false );
pTxtNd->EraseText( aIdx, 1 );
@@ -621,7 +622,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
pHistory = new SwHistory;
SwTxtAttr* const pFtnHnt =
pTxtNd->GetTxtAttrForCharAt( nFtnSttIdx );
- ASSERT( pFtnHnt, "kein FtnAttribut" );
+ OSL_ENSURE( pFtnHnt, "kein FtnAttribut" );
SwIndex aIdx( pTxtNd, nFtnSttIdx );
pHistory->Add( pFtnHnt, pTxtNd->GetIndex(), false );
pTxtNd->EraseText( aIdx, 1 );
@@ -661,7 +662,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
pAPos->nNode.GetNode().GetTxtNode();
SwTxtAttr* const pFlyHnt = pTxtNd->GetTxtAttrForCharAt(
pAPos->nContent.GetIndex());
- ASSERT( pFlyHnt, "kein FlyAttribut" );
+ OSL_ENSURE( pFlyHnt, "kein FlyAttribut" );
pHistory->Add( pFlyHnt, 0, false );
// n wieder zurueck, damit nicht ein Format uebesprungen wird !
n = n >= rSpzArr.Count() ? rSpzArr.Count() : n+1;
@@ -775,7 +776,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
for( sal_uInt16 n = 0; n < pMarkAccess->getMarksCount(); ++n )
{
- // --> OD 2007-10-17 #i81002#
+ // #i81002#
bool bSavePos = false;
bool bSaveOtherPos = false;
const ::sw::mark::IMark* pBkmk = (pMarkAccess->getMarksBegin() + n)->get();
@@ -791,7 +792,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
}
else
{
- // --> OD 2009-08-06 #i92125#
+ // #i92125#
bool bKeepCrossRefBkmk( false );
{
if ( rMark.nNode == rPoint.nNode &&
@@ -826,14 +827,12 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
}
}
}
- // <--
- // --> OD 2007-10-17 #i81002#
+ // #i81002#
const bool bDifferentTxtNodesAtMarkAndPoint(
rMark.nNode != rPoint.nNode &&
rMark.nNode.GetNode().GetTxtNode() &&
rPoint.nNode.GetNode().GetTxtNode() );
- // <--
if( !bSavePos && !bSaveOtherPos && bDifferentTxtNodesAtMarkAndPoint &&
dynamic_cast< const ::sw::mark::CrossRefBookmark* >(pBkmk))
{
@@ -939,8 +938,8 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, SwNodeIndex* pIdx,
{
// ueberpruefe, ob der Inhalt an der alten Position steht
SwNodeIndex aSttIdx( pDoc->GetNodes(), nStartPos );
- OSL_ENSURE(!aSttIdx.GetNode().GetCntntNode(),
- "RestoreSection(): Position on content node");
+// OSL_ENSURE( !pDoc->GetNodes()[ aSttIdx ]->GetCntntNode(),
+// "RestoreSection(): Position on content node");
// move den Inhalt aus dem UndoNodes-Array in den Fly
SwStartNode* pSttNd = pDoc->GetNodes().MakeEmptySection( aSttIdx,
@@ -984,7 +983,7 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
: SwUndRng( rRedl ),
SwRedlineData( rRedl.GetRedlineData(), bCopyNext )
{
- ASSERT( POS_OUTSIDE == eCmpPos ||
+ OSL_ENSURE( POS_OUTSIDE == eCmpPos ||
!rRedl.GetContentIdx(), "Redline mit Content" );
switch( eCmpPos )
@@ -1018,10 +1017,10 @@ SwRedlineSaveData::SwRedlineSaveData( SwComparePosition eCmpPos,
break;
default:
- ASSERT( !this, "keine gueltigen Daten!" )
+ OSL_ENSURE( !this, "keine gueltigen Daten!" );
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
nRedlineCount = rSttPos.nNode.GetNode().GetDoc()->GetRedlineTbl().Count();
#endif
}
@@ -1052,7 +1051,7 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
RedlineMode_t eOld = rDoc.GetRedlineMode();
rDoc.SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_DONTCOMBINE_REDLINES));
//#i92154# let UI know about a new redline with comment
- if (rDoc.GetDocShell() && (pRedl->GetComment() != String(::rtl::OUString::createFromAscii(""))) )
+ if (rDoc.GetDocShell() && (pRedl->GetComment() != String()) )
rDoc.GetDocShell()->Broadcast(SwRedlineHint(pRedl,SWREDLINE_INSERTED));
//
#if OSL_DEBUG_LEVEL > 0
@@ -1135,10 +1134,12 @@ void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData )
for( sal_uInt16 n = rSData.Count(); n; )
rSData[ --n ]->RedlineToDoc( aPam );
+#if OSL_DEBUG_LEVEL > 1
// check redline count against count saved in RedlineSaveData object
- DBG_ASSERT( (rSData.Count() == 0) ||
+ OSL_ENSURE( (rSData.Count() == 0) ||
(rSData[0]->nRedlineCount == rDoc.GetRedlineTbl().Count()),
"redline count not restored properly" );
+#endif
rDoc.SetRedlineMode_intern( eOld );
}
@@ -1192,7 +1193,7 @@ sal_Bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr,
// #111827#
String ShortenString(const String & rStr, xub_StrLen nLength, const String & rFillStr)
{
- ASSERT( nLength - rFillStr.Len() >= 2, "improper arguments")
+ OSL_ENSURE( nLength - rFillStr.Len() >= 2, "improper arguments");
String aResult;
@@ -1337,3 +1338,8 @@ bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
);
}
+const String UNDO_ARG1("$1", RTL_TEXTENCODING_ASCII_US);
+const String UNDO_ARG2("$2", RTL_TEXTENCODING_ASCII_US);
+const String UNDO_ARG3("$3", RTL_TEXTENCODING_ASCII_US);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */