summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docfly.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/doc/docfly.cxx')
-rw-r--r--sw/source/core/doc/docfly.cxx222
1 files changed, 125 insertions, 97 deletions
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 14d7c8ef02e3..e26669f7b604 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <hintids.hxx>
#include <svl/itemiter.hxx>
#include <svx/svdobj.hxx>
@@ -43,6 +42,7 @@
#include <ndgrf.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <ndindex.hxx>
#include <docary.hxx>
#include <fmtcntnt.hxx>
@@ -61,24 +61,32 @@
#include <swundo.hxx>
#include <swtable.hxx>
#include <crstate.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
+#include <UndoAttribute.hxx>
#include <fmtcnct.hxx>
#include <dflyobj.hxx>
#include <undoflystrattr.hxx>
#include <switerator.hxx>
-extern USHORT GetHtmlMode( const SwDocShell* );
+extern sal_uInt16 GetHtmlMode( const SwDocShell* );
using namespace ::com::sun::star;
+<<<<<<< local
USHORT SwDoc::GetFlyCount( FlyCntType eType ) const
+=======
+/*-----------------17.02.98 08:35-------------------
+
+--------------------------------------------------*/
+sal_uInt16 SwDoc::GetFlyCount( FlyCntType eType ) const
+>>>>>>> other
{
const SwSpzFrmFmts& rFmts = *GetSpzFrmFmts();
- USHORT nSize = rFmts.Count();
- USHORT nCount = 0;
+ sal_uInt16 nSize = rFmts.Count();
+ sal_uInt16 nCount = 0;
const SwNodeIndex* pIdx;
- for ( USHORT i = 0; i < nSize; i++)
+ for ( sal_uInt16 i = 0; i < nSize; i++)
{
const SwFrmFmt* pFlyFmt = rFmts[ i ];
if( RES_FLYFRMFMT == pFlyFmt->Which()
@@ -114,14 +122,14 @@ USHORT SwDoc::GetFlyCount( FlyCntType eType ) const
}
// If you change this, also update SwXFrameEnumeration in unocoll.
-SwFrmFmt* SwDoc::GetFlyNum( USHORT nIdx, FlyCntType eType )
+SwFrmFmt* SwDoc::GetFlyNum( sal_uInt16 nIdx, FlyCntType eType )
{
SwSpzFrmFmts& rFmts = *GetSpzFrmFmts();
SwFrmFmt* pRetFmt = 0;
- USHORT nSize = rFmts.Count();
+ sal_uInt16 nSize = rFmts.Count();
const SwNodeIndex* pIdx;
- USHORT nCount = 0;
- for( USHORT i = 0; !pRetFmt && i < nSize; ++i )
+ sal_uInt16 nCount = 0;
+ for( sal_uInt16 i = 0; !pRetFmt && i < nSize; ++i )
{
SwFrmFmt* pFlyFmt = rFmts[ i ];
if( RES_FLYFRMFMT == pFlyFmt->Which()
@@ -163,7 +171,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
case FLY_AS_CHAR:
if( pFlyFmt && rAnch.GetCntntAnchor() )
{
- const SwFrm* pOld = ((SwFlyFrmFmt*)pFlyFmt)->GetFrm( &aRet, FALSE );
+ const SwFrm* pOld = ((SwFlyFrmFmt*)pFlyFmt)->GetFrm( &aRet, sal_False );
if( pOld )
aRet = pOld->Frm().Pos();
}
@@ -175,7 +183,11 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
{
const SwPosition *pPos = rAnch.GetCntntAnchor();
const SwCntntNode* pNd = pPos->nNode.GetNode().GetCntntNode();
+<<<<<<< local
const SwFrm* pOld = pNd ? pNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aRet, 0, FALSE ) : 0;
+=======
+ const SwFrm* pOld = pNd ? pNd->GetFrm( &aRet, 0, sal_False ) : 0;
+>>>>>>> other
if( pOld )
aRet = pOld->Frm().Pos();
}
@@ -186,7 +198,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
{
const SwFlyFrmFmt* pFmt = (SwFlyFrmFmt*)rAnch.GetCntntAnchor()->
nNode.GetNode().GetFlyFmt();
- const SwFrm* pOld = pFmt ? pFmt->GetFrm( &aRet, FALSE ) : 0;
+ const SwFrm* pOld = pFmt ? pFmt->GetFrm( &aRet, sal_False ) : 0;
if( pOld )
aRet = pOld->Frm().Pos();
}
@@ -194,9 +206,15 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
case FLY_AT_PAGE:
{
+<<<<<<< local
USHORT nPgNum = rAnch.GetPageNum();
const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetCurrentLayout()->Lower();
for( USHORT i = 1; (i <= nPgNum) && pPage; ++i,
+=======
+ sal_uInt16 nPgNum = rAnch.GetPageNum();
+ const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetRootFrm()->Lower();
+ for( sal_uInt16 i = 1; (i <= nPgNum) && pPage; ++i,
+>>>>>>> other
pPage = (const SwPageFrm*)pPage->GetNext() )
if( i == nPgNum )
{
@@ -215,7 +233,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
#define IGNOREANCHOR 1
#define DONTMAKEFRMS 2
-sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms )
+sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, sal_Bool bNewFrms )
{
//Ankerwechsel sind fast immer in alle 'Richtungen' erlaubt.
//Ausnahme: Absatz- bzw. Zeichengebundene Rahmen duerfen wenn sie in
@@ -289,10 +307,10 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms
pNd->InsertItem( aFmt, pPos->nContent.GetIndex(), 0 );
}
- if( SFX_ITEM_SET != rSet.GetItemState( RES_VERT_ORIENT, FALSE, &pItem ))
+ if( SFX_ITEM_SET != rSet.GetItemState( RES_VERT_ORIENT, sal_False, &pItem ))
{
SwFmtVertOrient aOldV( rFmt.GetVertOrient() );
- BOOL bSet = TRUE;
+ sal_Bool bSet = sal_True;
switch( aOldV.GetVertOrient() )
{
case text::VertOrientation::LINE_TOP: aOldV.SetVertOrient( text::VertOrientation::TOP ); break;
@@ -300,7 +318,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms
case text::VertOrientation::LINE_BOTTOM: aOldV.SetVertOrient( text::VertOrientation::BOTTOM); break;
case text::VertOrientation::NONE: aOldV.SetVertOrient( text::VertOrientation::CENTER); break;
default:
- bSet = FALSE;
+ bSet = sal_False;
}
if( bSet )
rSet.Put( aOldV );
@@ -318,7 +336,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms
//Chg: Wenn sich in den Positionsattributen lediglich die
//Ausrichtung veraendert (text::RelOrientation::FRAME vs. text::RelOrientation::PRTAREA), dann wird die
//Position ebenfalls korrigiert.
- if( SFX_ITEM_SET != rSet.GetItemState( RES_HORI_ORIENT, FALSE, &pItem ))
+ if( SFX_ITEM_SET != rSet.GetItemState( RES_HORI_ORIENT, sal_False, &pItem ))
pItem = 0;
SwFmtHoriOrient aOldH( rFmt.GetHoriOrient() );
@@ -339,7 +357,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms
rSet.Put( aOldH );
}
- if( SFX_ITEM_SET != rSet.GetItemState( RES_VERT_ORIENT, FALSE, &pItem ))
+ if( SFX_ITEM_SET != rSet.GetItemState( RES_VERT_ORIENT, sal_False, &pItem ))
pItem = 0;
SwFmtVertOrient aOldV( rFmt.GetVertOrient() );
@@ -371,35 +389,27 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms
return MAKEFRMS;
}
-BOOL SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
+static bool
+lcl_SetFlyFrmAttr(SwDoc & rDoc,
+ sal_Int8 (SwDoc::*pSetFlyFrmAnchor)(SwFrmFmt &, SfxItemSet &, sal_Bool),
+ SwFrmFmt & rFlyFmt, SfxItemSet & rSet)
{
- if( !rSet.Count() )
- return FALSE;
-
- ::std::auto_ptr<SwUndoFmtAttrHelper> pSaveUndo;
- const bool bDoesUndo = DoesUndo();
-
- if( DoesUndo() )
- {
- ClearRedo();
- pSaveUndo.reset( new SwUndoFmtAttrHelper( rFlyFmt ) );
- // --> FME 2004-10-13 #i32968#
- // Inserting columns in the frame causes MakeFrmFmt to put two
- // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
- DoUndo( FALSE );
- // <--
- }
+ // #i32968# Inserting columns in the frame causes MakeFrmFmt to put two
+ // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
+ ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
//Ist das Ankerattribut dabei? Falls ja ueberlassen wir die Verarbeitung
- //desselben einer Spezialmethode. Sie Returnt TRUE wenn der Fly neu
+ //desselben einer Spezialmethode. Sie Returnt sal_True wenn der Fly neu
//erzeugt werden muss (z.B. weil ein Wechsel des FlyTyps vorliegt).
- sal_Int8 nMakeFrms = SFX_ITEM_SET == rSet.GetItemState( RES_ANCHOR, FALSE )?
- SetFlyFrmAnchor( rFlyFmt, rSet, FALSE ) : DONTMAKEFRMS;
+ sal_Int8 const nMakeFrms =
+ (SFX_ITEM_SET == rSet.GetItemState( RES_ANCHOR, sal_False ))
+ ? (rDoc.*pSetFlyFrmAnchor)( rFlyFmt, rSet, sal_False )
+ : DONTMAKEFRMS;
const SfxPoolItem* pItem;
SfxItemIter aIter( rSet );
- SfxItemSet aTmpSet( GetAttrPool(), aFrmFmtSetRange );
- USHORT nWhich = aIter.GetCurItem()->Which();
+ SfxItemSet aTmpSet( rDoc.GetAttrPool(), aFrmFmtSetRange );
+ sal_uInt16 nWhich = aIter.GetCurItem()->Which();
do {
switch( nWhich )
{
@@ -408,7 +418,7 @@ BOOL SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
case RES_PAGEDESC:
case RES_CNTNT:
case RES_FOOTER:
- ASSERT( !this, ":-) Unbekanntes Attribut fuer Fly." );
+ OSL_ENSURE(false, ":-) unknown Attribute for Fly.");
// kein break;
case RES_CHAIN:
rSet.ClearItem( nWhich );
@@ -419,7 +429,7 @@ BOOL SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
default:
if( !IsInvalidItem( aIter.GetCurItem() ) && ( SFX_ITEM_SET !=
- rFlyFmt.GetAttrSet().GetItemState( nWhich, TRUE, &pItem ) ||
+ rFlyFmt.GetAttrSet().GetItemState( nWhich, sal_True, &pItem ) ||
*pItem != *aIter.GetCurItem() ))
aTmpSet.Put( *aIter.GetCurItem() );
break;
@@ -436,21 +446,36 @@ BOOL SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
if( MAKEFRMS == nMakeFrms )
rFlyFmt.MakeFrms();
- if ( pSaveUndo.get() )
+ return aTmpSet.Count() || MAKEFRMS == nMakeFrms;
+}
+
+sal_Bool SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet )
+{
+ if( !rSet.Count() )
+ return sal_False;
+
+ ::std::auto_ptr<SwUndoFmtAttrHelper> pSaveUndo;
+
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- // --> FME 2004-10-13 #i32968#
- DoUndo( bDoesUndo );
- // <--
+ GetIDocumentUndoRedo().ClearRedo(); // AppendUndo far below, so leave it
+ pSaveUndo.reset( new SwUndoFmtAttrHelper( rFlyFmt ) );
+ }
+
+ bool const bRet =
+ lcl_SetFlyFrmAttr(*this, &SwDoc::SetFlyFrmAnchor, rFlyFmt, rSet);
+ if ( pSaveUndo.get() )
+ {
if ( pSaveUndo->GetUndo() )
{
- AppendUndo( pSaveUndo->ReleaseUndo() );
+ GetIDocumentUndoRedo().AppendUndo( pSaveUndo->ReleaseUndo() );
}
}
SetModified();
- return aTmpSet.Count() || MAKEFRMS == nMakeFrms;
+ return bRet;
}
// --> OD 2009-07-20 #i73249#
@@ -462,13 +487,11 @@ void SwDoc::SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt,
return;
}
- const bool bFormerIsNoDrawUndoObj( IsNoDrawUndoObj() );
- SetNoDrawUndoObj( true );
+ ::sw::DrawUndoGuard const drawUndoGuard(GetIDocumentUndoRedo());
- if ( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt,
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt,
UNDO_FLYFRMFMT_TITLE,
rFlyFrmFmt.GetObjTitle(),
sNewTitle ) );
@@ -476,8 +499,6 @@ void SwDoc::SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt,
rFlyFrmFmt.SetObjTitle( sNewTitle, true );
- SetNoDrawUndoObj( bFormerIsNoDrawUndoObj );
-
SetModified();
}
@@ -489,13 +510,11 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
return;
}
- const bool bFormerIsNoDrawUndoObj( IsNoDrawUndoObj() );
- SetNoDrawUndoObj( true );
+ ::sw::DrawUndoGuard const drawUndoGuard(GetIDocumentUndoRedo());
- if ( DoesUndo() )
+ if (GetIDocumentUndoRedo().DoesUndo())
{
- ClearRedo();
- AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt,
+ GetIDocumentUndoRedo().AppendUndo( new SwUndoFlyStrAttr( rFlyFrmFmt,
UNDO_FLYFRMFMT_DESCRIPTION,
rFlyFrmFmt.GetObjDescription(),
sNewDescription ) );
@@ -503,33 +522,43 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt,
rFlyFrmFmt.SetObjDescription( sNewDescription, true );
- SetNoDrawUndoObj( bFormerIsNoDrawUndoObj );
-
SetModified();
}
// <--
+<<<<<<< local
BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
SfxItemSet* pSet, BOOL bKeepOrient )
+=======
+/***************************************************************************
+ * Methode : sal_Bool SwDoc::SetFrmFmtToFly( SwFlyFrm&, SwFrmFmt& )
+ * Beschreibung:
+ * Erstellt : OK 14.04.94 15:40
+ * Aenderung : JP 23.04.98
+ ***************************************************************************/
+
+sal_Bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
+ SfxItemSet* pSet, sal_Bool bKeepOrient )
+>>>>>>> other
{
- BOOL bChgAnchor = FALSE, bFrmSz = FALSE;
+ sal_Bool bChgAnchor = sal_False, bFrmSz = sal_False;
const SwFmtFrmSize aFrmSz( rFmt.GetFrmSize() );
const SwFmtVertOrient aVert( rFmt.GetVertOrient() );
const SwFmtHoriOrient aHori( rFmt.GetHoriOrient() );
SwUndoSetFlyFmt* pUndo = 0;
- if( DoesUndo() )
+ bool const bUndo = GetIDocumentUndoRedo().DoesUndo();
+ if (bUndo)
{
- ClearRedo();
- AppendUndo( pUndo = new SwUndoSetFlyFmt( rFmt, rNewFmt ) );
- // --> FME 2004-10-13 #i32968#
- // Inserting columns in the section causes MakeFrmFmt to put two
- // objects of type SwUndoFrmFmt on the undo stack. We don't want them.
- DoUndo( FALSE );
- // <--
+ pUndo = new SwUndoSetFlyFmt( rFmt, rNewFmt );
+ GetIDocumentUndoRedo().AppendUndo(pUndo);
}
+ // #i32968# Inserting columns in the section causes MakeFrmFmt to put
+ // 2 objects of type SwUndoFrmFmt on the undo stack. We don't want them.
+ ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
+
//Erstmal die Spalten setzen, sonst gibts nix als Aerger mit dem
//Set/Reset/Abgleich usw.
const SfxPoolItem* pItem;
@@ -542,20 +571,20 @@ BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
// 1. wenn nicht automatisch -> ignorieren, sonst -> wech
// 2. wech damit, MB!
- if( SFX_ITEM_SET == rNewFmt.GetAttrSet().GetItemState( RES_FRM_SIZE, FALSE ))
+ if( SFX_ITEM_SET == rNewFmt.GetAttrSet().GetItemState( RES_FRM_SIZE, sal_False ))
{
rFmt.ResetFmtAttr( RES_FRM_SIZE );
- bFrmSz = TRUE;
+ bFrmSz = sal_True;
}
const SfxItemSet* pAsk = pSet;
if( !pAsk ) pAsk = &rNewFmt.GetAttrSet();
- if( SFX_ITEM_SET == pAsk->GetItemState( RES_ANCHOR, FALSE, &pItem )
+ if( SFX_ITEM_SET == pAsk->GetItemState( RES_ANCHOR, sal_False, &pItem )
&& ((SwFmtAnchor*)pItem)->GetAnchorId() !=
rFmt.GetAnchor().GetAnchorId() )
{
if( pSet )
- bChgAnchor = MAKEFRMS == SetFlyFrmAnchor( rFmt, *pSet, FALSE );
+ bChgAnchor = MAKEFRMS == SetFlyFrmAnchor( rFmt, *pSet, sal_False );
else
{
//JP 23.04.98: muss den FlyFmt-Range haben, denn im SetFlyFrmAnchor
@@ -563,7 +592,7 @@ BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
SfxItemSet aFlySet( *rNewFmt.GetAttrSet().GetPool(),
rNewFmt.GetAttrSet().GetRanges() );
aFlySet.Put( *pItem );
- bChgAnchor = MAKEFRMS == SetFlyFrmAnchor( rFmt, aFlySet, FALSE);
+ bChgAnchor = MAKEFRMS == SetFlyFrmAnchor( rFmt, aFlySet, sal_False);
}
}
}
@@ -596,11 +625,6 @@ BOOL SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt,
SetModified();
- // --> FME 2004-10-13 #i32968#
- if ( pUndo )
- DoUndo( TRUE );
- // <--
-
return bChgAnchor;
}
@@ -626,10 +650,10 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
return false;
}
- StartUndo( UNDO_INSATTR, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_INSATTR, NULL );
- BOOL bUnmark = FALSE;
- for ( USHORT i = 0; i < _rMrkList.GetMarkCount(); ++i )
+ sal_Bool bUnmark = sal_False;
+ for ( sal_uInt16 i = 0; i < _rMrkList.GetMarkCount(); ++i )
{
SdrObject* pObj = _rMrkList.GetMark( i )->GetMarkedSdrObj();
if ( !pObj->ISA(SwVirtFlyDrawObj) )
@@ -720,7 +744,11 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
// OD 20.06.2003 #108784# - consider that drawing objects
// can be in header/footer. Thus, <GetFrm()> by left-top-corner
pTxtFrm = aPos.nNode.GetNode().
+<<<<<<< local
GetCntntNode()->getLayoutFrm( GetCurrentLayout(), &aPt, 0, FALSE );
+=======
+ GetCntntNode()->GetFrm( &aPt, 0, sal_False );
+>>>>>>> other
}
const SwFrm *pTmp = ::FindAnchor( pTxtFrm, aPt );
pNewAnchorFrm = pTmp->FindFlyFrm();
@@ -857,7 +885,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
}
- EndUndo( UNDO_END, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
SetModified();
return bUnmark;
@@ -900,16 +928,16 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
if( !pTxtNd )
return SW_CHAIN_NOT_FOUND;
- const ULONG nFlySttNd = pCntIdx->GetIndex();
+ const sal_uLong nFlySttNd = pCntIdx->GetIndex();
if( 2 != ( pCntIdx->GetNode().EndOfSectionIndex() - nFlySttNd ) ||
pTxtNd->GetTxt().Len() )
return SW_CHAIN_NOT_EMPTY;
- USHORT nArrLen = GetSpzFrmFmts()->Count();
- for( USHORT n = 0; n < nArrLen; ++n )
+ sal_uInt16 nArrLen = GetSpzFrmFmts()->Count();
+ for( sal_uInt16 n = 0; n < nArrLen; ++n )
{
const SwFmtAnchor& rAnchor = (*GetSpzFrmFmts())[ n ]->GetAnchor();
- ULONG nTstSttNd;
+ sal_uLong nTstSttNd;
// OD 11.12.2003 #i20622# - to-frame anchored objects are allowed.
if ( ((rAnchor.GetAnchorId() == FLY_AT_PARA) ||
(rAnchor.GetAnchorId() == FLY_AT_CHAR)) &&
@@ -931,14 +959,14 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
// both in the same fly, header, footer or on the page?
const SwFmtAnchor &rSrcAnchor = rSource.GetAnchor(),
&rDstAnchor = rDest.GetAnchor();
- ULONG nEndOfExtras = GetNodes().GetEndOfExtras().GetIndex();
- BOOL bAllowed = FALSE;
+ sal_uLong nEndOfExtras = GetNodes().GetEndOfExtras().GetIndex();
+ sal_Bool bAllowed = sal_False;
if ( FLY_AT_PAGE == rSrcAnchor.GetAnchorId() )
{
if ( (FLY_AT_PAGE == rDstAnchor.GetAnchorId()) ||
( rDstAnchor.GetCntntAnchor() &&
rDstAnchor.GetCntntAnchor()->nNode.GetIndex() > nEndOfExtras ))
- bAllowed = TRUE;
+ bAllowed = sal_True;
}
else if( rSrcAnchor.GetCntntAnchor() && rDstAnchor.GetCntntAnchor() )
{
@@ -957,7 +985,7 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
pSttNd == rDstIdx.GetNode().FindHeaderStartNode() ) ||
( !pSttNd && rDstIdx.GetIndex() > nEndOfExtras &&
rSrcIdx.GetIndex() > nEndOfExtras ))
- bAllowed = TRUE;
+ bAllowed = sal_True;
}
return bAllowed ? SW_CHAIN_OK : SW_CHAIN_WRONG_AREA;
@@ -968,7 +996,7 @@ int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
int nErr = Chainable( rSource, rDest );
if ( !nErr )
{
- StartUndo( UNDO_CHAINE, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_CHAINE, NULL );
SwFlyFrmFmt& rDestFmt = (SwFlyFrmFmt&)rDest;
@@ -1001,7 +1029,7 @@ int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
}
SetAttr( aSet, rSource );
- EndUndo( UNDO_CHAINE, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_CHAINE, NULL );
}
return nErr;
}
@@ -1011,14 +1039,14 @@ void SwDoc::Unchain( SwFrmFmt &rFmt )
SwFmtChain aChain( rFmt.GetChain() );
if ( aChain.GetNext() )
{
- StartUndo( UNDO_UNCHAIN, NULL );
+ GetIDocumentUndoRedo().StartUndo( UNDO_UNCHAIN, NULL );
SwFrmFmt *pFollow = aChain.GetNext();
aChain.SetNext( 0 );
SetAttr( aChain, rFmt );
aChain = pFollow->GetChain();
aChain.SetPrev( 0 );
SetAttr( aChain, *pFollow );
- EndUndo( UNDO_UNCHAIN, NULL );
+ GetIDocumentUndoRedo().EndUndo( UNDO_UNCHAIN, NULL );
}
}