summaryrefslogtreecommitdiff
path: root/sw/source/core/undo
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/undo')
-rw-r--r--sw/source/core/undo/rolbck.cxx2
-rw-r--r--sw/source/core/undo/unattr.cxx16
-rw-r--r--sw/source/core/undo/undel.cxx4
-rw-r--r--sw/source/core/undo/undobj.cxx6
-rw-r--r--sw/source/core/undo/undobj1.cxx91
-rw-r--r--sw/source/core/undo/undraw.cxx37
-rw-r--r--sw/source/core/undo/untbl.cxx10
-rw-r--r--sw/source/core/undo/untblk.cxx16
8 files changed, 100 insertions, 82 deletions
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 7f868d770100..24fde84fc35d 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -922,7 +922,7 @@ SwHistoryChangeFlyAnchor::SwHistoryChangeFlyAnchor( SwFrmFmt& rFmt )
: SwHistoryHint( HSTRY_CHGFLYANCHOR )
, m_rFmt( rFmt )
, m_nOldNodeIndex( rFmt.GetAnchor().GetCntntAnchor()->nNode.GetIndex() )
- , m_nOldContentIndex( ( FLY_AUTO_CNTNT == rFmt.GetAnchor().GetAnchorId() )
+ , m_nOldContentIndex( (FLY_AT_CHAR == rFmt.GetAnchor().GetAnchorId())
? rFmt.GetAnchor().GetCntntAnchor()->nContent.GetIndex()
: STRING_MAXLEN )
{
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index 87e0531dd893..74cf2883c3b8 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -462,10 +462,10 @@ void SwUndoFmtAttr::SaveFlyAnchor( bool bSvDrwPt )
xub_StrLen nCntnt = 0;
switch( rAnchor.GetAnchorId() )
{
- case FLY_IN_CNTNT:
- case FLY_AUTO_CNTNT:
+ case FLY_AS_CHAR:
+ case FLY_AT_CHAR:
nCntnt = rAnchor.GetCntntAnchor()->nContent.GetIndex();
- case FLY_AT_CNTNT:
+ case FLY_AT_PARA:
case FLY_AT_FLY:
m_nNodeIndex = rAnchor.GetCntntAnchor()->nNode.GetIndex();
break;
@@ -489,7 +489,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter )
static_cast<const SwFmtAnchor&>( m_pOldSet->Get( RES_ANCHOR, FALSE ) );
SwFmtAnchor aNewAnchor( rAnchor.GetAnchorId() );
- if( FLY_PAGE != rAnchor.GetAnchorId() )
+ if (FLY_AT_PAGE != rAnchor.GetAnchorId())
{
SwNode* pNd = pDoc->GetNodes()[ m_nNodeIndex ];
@@ -505,8 +505,8 @@ bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter )
}
SwPosition aPos( *pNd );
- if( FLY_IN_CNTNT == rAnchor.GetAnchorId() ||
- FLY_AUTO_CNTNT == rAnchor.GetAnchorId() )
+ if ((FLY_AS_CHAR == rAnchor.GetAnchorId()) ||
+ (FLY_AT_CHAR == rAnchor.GetAnchorId()))
{
aPos.nContent.Assign( (SwTxtNode*)pNd, rAnchor.GetPageNum() );
if ( aPos.nContent.GetIndex() >
@@ -549,7 +549,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter )
const SwFmtAnchor &rOldAnch = pFrmFmt->GetAnchor();
// --> OD 2006-03-13 #i54336#
// Consider case, that as-character anchored object has moved its anchor position.
- if ( FLY_IN_CNTNT == rOldAnch.GetAnchorId() )
+ if (FLY_AS_CHAR == rOldAnch.GetAnchorId())
// <--
{
//Bei InCntnt's wird es spannend: Das TxtAttribut muss vernichtet
@@ -613,7 +613,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter )
SwFmtFrmSize( ATT_VAR_SIZE, aDrawOldPt.X(), aDrawOldPt.Y() ) );
}
- if( FLY_IN_CNTNT == aNewAnchor.GetAnchorId() )
+ if (FLY_AS_CHAR == aNewAnchor.GetAnchorId())
{
const SwPosition* pPos = aNewAnchor.GetCntntAnchor();
SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode();
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index d9a2e6e8486c..dfa0ee9d469e 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -81,7 +81,7 @@ void lcl_MakeAutoFrms( const SwSpzFrmFmts& rSpzArr, ULONG nMovedIndex )
{
pFmt = (SwFlyFrmFmt*)rSpzArr[n];
pAnchor = &pFmt->GetAnchor();
- if( pAnchor->GetAnchorId() == FLY_AUTO_CNTNT )
+ if (pAnchor->GetAnchorId() == FLY_AT_CHAR)
{
const SwPosition* pAPos = pAnchor->GetCntntAnchor();
if( pAPos && nMovedIndex == pAPos->nNode.GetIndex() )
@@ -632,7 +632,7 @@ void lcl_ReAnchorAtCntntFlyFrames( const SwSpzFrmFmts& rSpzArr, SwPosition &rPos
{
pFmt = (SwFlyFrmFmt*)rSpzArr[n];
pAnchor = &pFmt->GetAnchor();
- if( pAnchor->GetAnchorId() == FLY_AT_CNTNT )
+ if (pAnchor->GetAnchorId() == FLY_AT_PARA)
{
pAPos = pAnchor->GetCntntAnchor();
if( pAPos && nOldIdx == pAPos->nNode.GetIndex() )
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 6a9b61c7aeb8..6a466da1a880 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -593,7 +593,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
pAnchor = &pFmt->GetAnchor();
switch( pAnchor->GetAnchorId() )
{
- case FLY_IN_CNTNT:
+ case FLY_AS_CHAR:
if( 0 != (pAPos = pAnchor->GetCntntAnchor() ) &&
(( nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType )
? ( pStt->nNode <= pAPos->nNode &&
@@ -611,7 +611,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
n = n >= rSpzArr.Count() ? rSpzArr.Count() : n+1;
}
break;
- case FLY_AT_CNTNT:
+ case FLY_AT_PARA:
{
pAPos = pAnchor->GetCntntAnchor();
if( pAPos )
@@ -660,7 +660,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
}
}
break;
- case FLY_AUTO_CNTNT:
+ case FLY_AT_CHAR:
if( 0 != (pAPos = pAnchor->GetCntntAnchor() ) &&
( pStt->nNode <= pAPos->nNode && pAPos->nNode <= pEnd->nNode ) )
{
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 10bcae715f28..da23e3fa70de 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -93,15 +93,19 @@ void SwUndoFlyBase::InsFly( SwUndoIter& rUndoIter, BOOL bShowSelFrm )
SwFmtAnchor aAnchor( (RndStdIds)nRndId );
- if( FLY_PAGE == nRndId )
+ if (FLY_AT_PAGE == nRndId)
+ {
aAnchor.SetPageNum( (USHORT)nNdPgPos );
+ }
else
{
SwPosition aNewPos( *rUndoIter.pAktPam->GetPoint() );
aNewPos.nNode = nNdPgPos;
- if( FLY_IN_CNTNT == nRndId || FLY_AUTO_CNTNT == nRndId )
+ if ((FLY_AS_CHAR == nRndId) || (FLY_AT_CHAR == nRndId))
+ {
aNewPos.nContent.Assign( aNewPos.nNode.GetNode().GetCntntNode(),
nCntPos );
+ }
aAnchor.SetAnchor( &aNewPos );
}
@@ -119,7 +123,7 @@ void SwUndoFlyBase::InsFly( SwUndoIter& rUndoIter, BOOL bShowSelFrm )
// vorhanden ist! Sonst wuerde das Layout den Fly vorher
// formatieren, aber keine Inhalt finden; so geschene bei
// Grafiken aus dem Internet
- if( FLY_IN_CNTNT == nRndId )
+ if (FLY_AS_CHAR == nRndId)
{
// es muss mindestens das Attribut im TextNode stehen
SwCntntNode* pCNd = aAnchor.GetCntntAnchor()->nNode.GetNode().GetCntntNode();
@@ -138,22 +142,22 @@ void SwUndoFlyBase::InsFly( SwUndoIter& rUndoIter, BOOL bShowSelFrm )
switch( nRndId )
{
- case FLY_IN_CNTNT:
- case FLY_AUTO_CNTNT:
+ case FLY_AS_CHAR:
+ case FLY_AT_CHAR:
{
const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor();
nNdPgPos = rAnchor.GetCntntAnchor()->nNode.GetIndex();
nCntPos = rAnchor.GetCntntAnchor()->nContent.GetIndex();
}
break;
- case FLY_AT_CNTNT:
+ case FLY_AT_PARA:
case FLY_AT_FLY:
{
const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor();
nNdPgPos = rAnchor.GetCntntAnchor()->nNode.GetIndex();
}
break;
- case FLY_PAGE:
+ case FLY_AT_PAGE:
break;
}
bDelFmt = FALSE;
@@ -193,7 +197,8 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor();
const SwPosition* pPos = rAnchor.GetCntntAnchor();
// die Positionen im Nodes-Array haben sich verschoben
- if( FLY_IN_CNTNT == ( nRndId = static_cast<USHORT>(rAnchor.GetAnchorId()) ) )
+ nRndId = static_cast<USHORT>(rAnchor.GetAnchorId());
+ if (FLY_AS_CHAR == nRndId)
{
nNdPgPos = pPos->nNode.GetIndex();
nCntPos = pPos->nContent.GetIndex();
@@ -210,15 +215,19 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
pTxtNd->EraseText( aIdx, 1 );
}
}
- else if( FLY_AUTO_CNTNT == nRndId )
+ else if (FLY_AT_CHAR == nRndId)
{
nNdPgPos = pPos->nNode.GetIndex();
nCntPos = pPos->nContent.GetIndex();
}
- else if( FLY_AT_CNTNT == nRndId || FLY_AT_FLY == nRndId )
+ else if ((FLY_AT_PARA == nRndId) || (FLY_AT_FLY == nRndId))
+ {
nNdPgPos = pPos->nNode.GetIndex();
+ }
else
+ {
nNdPgPos = rAnchor.GetPageNum();
+ }
pFrmFmt->ResetFmtAttr( RES_ANCHOR ); // Anchor loeschen
@@ -240,15 +249,15 @@ SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, ULONG nNodeIdx, xub_StrLen
bDelFmt = FALSE;
switch( nRndId )
{
- case FLY_PAGE:
+ case FLY_AT_PAGE:
nNdPgPos = rAnchor.GetPageNum();
break;
- case FLY_AT_CNTNT:
+ case FLY_AT_PARA:
case FLY_AT_FLY:
nNdPgPos = rAnchor.GetCntntAnchor()->nNode.GetIndex();
break;
- case FLY_IN_CNTNT:
- case FLY_AUTO_CNTNT:
+ case FLY_AS_CHAR:
+ case FLY_AT_CHAR:
{
const SwPosition* pPos = rAnchor.GetCntntAnchor();
nCntPos = pPos->nContent.GetIndex();
@@ -305,13 +314,15 @@ void SwUndoInsLayFmt::Repeat( SwUndoIter& rUndoIter )
SwDoc* pDoc = &rUndoIter.GetDoc();
// erfrage und setze den Anker neu
SwFmtAnchor aAnchor( pFrmFmt->GetAnchor() );
- if( FLY_AT_CNTNT == aAnchor.GetAnchorId() ||
- FLY_AUTO_CNTNT == aAnchor.GetAnchorId() ||
- FLY_IN_CNTNT == aAnchor.GetAnchorId() )
+ if ((FLY_AT_PARA == aAnchor.GetAnchorId()) ||
+ (FLY_AT_CHAR == aAnchor.GetAnchorId()) ||
+ (FLY_AS_CHAR == aAnchor.GetAnchorId()))
{
SwPosition aPos( *rUndoIter.pAktPam->GetPoint() );
- if( FLY_AT_CNTNT == aAnchor.GetAnchorId() )
+ if (FLY_AT_PARA == aAnchor.GetAnchorId())
+ {
aPos.nContent.Assign( 0, 0 );
+ }
aAnchor.SetAnchor( &aPos );
}
else if( FLY_AT_FLY == aAnchor.GetAnchorId() )
@@ -328,7 +339,7 @@ void SwUndoInsLayFmt::Repeat( SwUndoIter& rUndoIter )
return ;
}
}
- else if( FLY_PAGE == aAnchor.GetAnchorId() )
+ else if (FLY_AT_PAGE == aAnchor.GetAnchorId())
{
aAnchor.SetPageNum( pDoc->GetRootFrm()->GetCurrPage(
rUndoIter.pAktPam ));
@@ -482,7 +493,7 @@ void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor,
ULONG nNode, xub_StrLen nCntnt )
{
RndStdIds nAnchorTyp = rAnchor.GetAnchorId();
- if( FLY_PAGE != nAnchorTyp )
+ if (FLY_AT_PAGE != nAnchorTyp)
{
SwNode* pNd = pFrmFmt->GetDoc()->GetNodes()[ nNode ];
@@ -490,26 +501,34 @@ void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor,
? ( !pNd->IsStartNode() || SwFlyStartNode !=
((SwStartNode*)pNd)->GetStartNodeType() )
: !pNd->IsTxtNode() )
- pNd = 0; // ungueltige Position
+ {
+ pNd = 0; // invalid position
+ }
else
{
SwPosition aPos( *pNd );
- if( FLY_IN_CNTNT == nAnchorTyp ||
- FLY_AUTO_CNTNT == nAnchorTyp )
+ if ((FLY_AS_CHAR == nAnchorTyp) ||
+ (FLY_AT_CHAR == nAnchorTyp))
{
- if( nCntnt > ((SwTxtNode*)pNd)->GetTxt().Len() )
- pNd = 0; // ungueltige Position
+ if ( nCntnt > static_cast<SwTxtNode*>(pNd)->GetTxt().Len() )
+ {
+ pNd = 0; // invalid position
+ }
else
- aPos.nContent.Assign( (SwTxtNode*)pNd, nCntnt );
+ {
+ aPos.nContent.Assign(static_cast<SwTxtNode*>(pNd), nCntnt);
+ }
}
- if( pNd )
+ if ( pNd )
+ {
rAnchor.SetAnchor( &aPos );
+ }
}
if( !pNd )
{
// ungueltige Position - setze auf 1. Seite
- rAnchor.SetType( FLY_PAGE );
+ rAnchor.SetType( FLY_AT_PAGE );
rAnchor.SetPageNum( 1 );
}
}
@@ -548,7 +567,7 @@ void SwUndoSetFlyFmt::Undo( SwUndoIter& rIter )
if( bAnchorChgd )
{
const SwFmtAnchor& rOldAnch = pFrmFmt->GetAnchor();
- if( FLY_IN_CNTNT == rOldAnch.GetAnchorId() )
+ if (FLY_AS_CHAR == rOldAnch.GetAnchorId())
{
// Bei InCntnt's wird es spannend: Das TxtAttribut muss
// vernichtet werden. Leider reisst dies neben den Frms
@@ -577,7 +596,7 @@ void SwUndoSetFlyFmt::Undo( SwUndoIter& rIter )
GetAnchor( aNewAnchor, nOldNode, nOldCntnt );
pFrmFmt->SetFmtAttr( aNewAnchor );
- if( FLY_IN_CNTNT == aNewAnchor.GetAnchorId() )
+ if (FLY_AS_CHAR == aNewAnchor.GetAnchorId())
{
SwPosition* pPos = (SwPosition*)aNewAnchor.GetCntntAnchor();
SwFmtFlyCnt aFmt( pFrmFmt );
@@ -629,10 +648,10 @@ void SwUndoSetFlyFmt::PutAttr( USHORT nWhich, const SfxPoolItem* pItem )
const SwFmtAnchor* pAnchor = (SwFmtAnchor*)pItem;
switch( nOldAnchorTyp = static_cast<USHORT>(pAnchor->GetAnchorId()) )
{
- case FLY_IN_CNTNT:
- case FLY_AUTO_CNTNT:
+ case FLY_AS_CHAR:
+ case FLY_AT_CHAR:
nOldCntnt = pAnchor->GetCntntAnchor()->nContent.GetIndex();
- case FLY_AT_CNTNT:
+ case FLY_AT_PARA:
case FLY_AT_FLY:
nOldNode = pAnchor->GetCntntAnchor()->nNode.GetIndex();
break;
@@ -644,10 +663,10 @@ void SwUndoSetFlyFmt::PutAttr( USHORT nWhich, const SfxPoolItem* pItem )
pAnchor = (SwFmtAnchor*)&pFrmFmt->GetAnchor();
switch( nNewAnchorTyp = static_cast<USHORT>(pAnchor->GetAnchorId()) )
{
- case FLY_IN_CNTNT:
- case FLY_AUTO_CNTNT:
+ case FLY_AS_CHAR:
+ case FLY_AT_CHAR:
nNewCntnt = pAnchor->GetCntntAnchor()->nContent.GetIndex();
- case FLY_AT_CNTNT:
+ case FLY_AT_PARA:
case FLY_AT_FLY:
nNewNode = pAnchor->GetCntntAnchor()->nNode.GetIndex();
break;
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 54ed7ea8421d..2c09ff4f3da6 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -32,15 +32,9 @@
#include "precompiled_sw.hxx"
#include <rtl/string.h>
-
-#ifndef _RTL_MEMORY_H
#include <rtl/memory.h>
-#endif
#include <hintids.hxx>
-#ifndef _RTL_STRING_H
-#include <rtl/string.h>
-#endif
#include <svx/svdogrp.hxx>
#include <svx/svdundo.hxx>
#include <svx/svdpage.hxx>
@@ -61,6 +55,7 @@
#include <rootfrm.hxx>
#include <viewsh.hxx>
+
struct SwUndoGroupObjImpl
{
SwDrawFrmFmt* pFmt;
@@ -142,15 +137,15 @@ void lcl_SendRemoveToUno( SwFmt& rFmt )
void lcl_SaveAnchor( SwFrmFmt* pFmt, ULONG& rNodePos )
{
const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
- if( FLY_AT_CNTNT == rAnchor.GetAnchorId() ||
- FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ||
- FLY_AT_FLY == rAnchor.GetAnchorId() ||
- FLY_IN_CNTNT == rAnchor.GetAnchorId() )
+ if ((FLY_AT_PARA == rAnchor.GetAnchorId()) ||
+ (FLY_AT_CHAR == rAnchor.GetAnchorId()) ||
+ (FLY_AT_FLY == rAnchor.GetAnchorId()) ||
+ (FLY_AS_CHAR == rAnchor.GetAnchorId()))
{
rNodePos = rAnchor.GetCntntAnchor()->nNode.GetIndex();
xub_StrLen nCntntPos = 0;
- if( FLY_IN_CNTNT == rAnchor.GetAnchorId() )
+ if (FLY_AS_CHAR == rAnchor.GetAnchorId())
{
nCntntPos = rAnchor.GetCntntAnchor()->nContent.GetIndex();
@@ -168,8 +163,10 @@ void lcl_SaveAnchor( SwFrmFmt* pFmt, ULONG& rNodePos )
pTxtNd->EraseText( aIdx, 1 );
}
}
- else if( FLY_AUTO_CNTNT == rAnchor.GetAnchorId() )
+ else if (FLY_AT_CHAR == rAnchor.GetAnchorId())
+ {
nCntntPos = rAnchor.GetCntntAnchor()->nContent.GetIndex();
+ }
pFmt->SetFmtAttr( SwFmtAnchor( rAnchor.GetAnchorId(), nCntntPos ) );
}
@@ -178,10 +175,10 @@ void lcl_SaveAnchor( SwFrmFmt* pFmt, ULONG& rNodePos )
void lcl_RestoreAnchor( SwFrmFmt* pFmt, ULONG& rNodePos )
{
const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
- if( FLY_AT_CNTNT == rAnchor.GetAnchorId() ||
- FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ||
- FLY_AT_FLY == rAnchor.GetAnchorId() ||
- FLY_IN_CNTNT == rAnchor.GetAnchorId() )
+ if ((FLY_AT_PARA == rAnchor.GetAnchorId()) ||
+ (FLY_AT_CHAR == rAnchor.GetAnchorId()) ||
+ (FLY_AT_FLY == rAnchor.GetAnchorId()) ||
+ (FLY_AS_CHAR == rAnchor.GetAnchorId()))
{
xub_StrLen nCntntPos = rAnchor.GetPageNum();
SwNodes& rNds = pFmt->GetDoc()->GetNodes();
@@ -190,13 +187,15 @@ void lcl_RestoreAnchor( SwFrmFmt* pFmt, ULONG& rNodePos )
SwPosition aPos( aIdx );
SwFmtAnchor aTmp( rAnchor.GetAnchorId() );
- if( FLY_IN_CNTNT == rAnchor.GetAnchorId() ||
- FLY_AUTO_CNTNT == rAnchor.GetAnchorId() )
+ if ((FLY_AS_CHAR == rAnchor.GetAnchorId()) ||
+ (FLY_AT_CHAR == rAnchor.GetAnchorId()))
+ {
aPos.nContent.Assign( aIdx.GetNode().GetCntntNode(), nCntntPos );
+ }
aTmp.SetAnchor( &aPos );
pFmt->SetFmtAttr( aTmp );
- if( FLY_IN_CNTNT == rAnchor.GetAnchorId() )
+ if (FLY_AS_CHAR == rAnchor.GetAnchorId())
{
SwTxtNode *pTxtNd = aIdx.GetNode().GetTxtNode();
ASSERT( pTxtNd, "no Text Node" );
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index a90807e53877..985a368e8953 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -448,12 +448,12 @@ SwUndoTblToTxt::SwUndoTblToTxt( const SwTable& rTbl, sal_Unicode cCh )
const SwSpzFrmFmts& rFrmFmtTbl = *pTblNd->GetDoc()->GetSpzFrmFmts();
for( USHORT n = 0; n < rFrmFmtTbl.Count(); ++n )
{
- const SwPosition* pAPos;
SwFrmFmt* pFmt = rFrmFmtTbl[ n ];
- const SwFmtAnchor* pAnchor = &pFmt->GetAnchor();
- if( 0 != ( pAPos = pAnchor->GetCntntAnchor()) &&
- ( FLY_AUTO_CNTNT == pAnchor->GetAnchorId() ||
- FLY_AT_CNTNT == pAnchor->GetAnchorId() ) &&
+ SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor();
+ SwPosition const*const pAPos = pAnchor->GetCntntAnchor();
+ if (pAPos &&
+ ((FLY_AT_CHAR == pAnchor->GetAnchorId()) ||
+ (FLY_AT_PARA == pAnchor->GetAnchorId())) &&
nTblStt <= pAPos->nNode.GetIndex() &&
pAPos->nNode.GetIndex() < nTblEnd )
{
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index 1c076a05dcce..6a6618935155 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -69,10 +69,10 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
for( USHORT n = 0; n < nArrLen; ++n )
{
SwFrmFmt* pFmt = (*pDoc->GetSpzFrmFmts())[n];
- const SwFmtAnchor* pAnchor = &pFmt->GetAnchor();
- const SwPosition* pAPos;
- if ( pAnchor->GetAnchorId() == FLY_AT_CNTNT &&
- 0 != ( pAPos = pAnchor->GetCntntAnchor()) &&
+ SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor();
+ const SwPosition* pAPos = pAnchor->GetCntntAnchor();
+ if (pAPos &&
+ (pAnchor->GetAnchorId() == FLY_AT_PARA) &&
nSttNode == pAPos->nNode.GetIndex() )
{
if( !pFrmFmts )
@@ -124,10 +124,10 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, BOOL bScanFlys,
for( USHORT n = 0; n < nArrLen; ++n )
{
SwFrmFmt* pFmt = (*pDoc->GetSpzFrmFmts())[n];
- const SwFmtAnchor* pAnchor = &pFmt->GetAnchor();
- const SwPosition* pAPos;
- if( pAnchor->GetAnchorId() == FLY_AT_CNTNT &&
- 0 != ( pAPos = pAnchor->GetCntntAnchor()) &&
+ SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor();
+ SwPosition const*const pAPos = pAnchor->GetCntntAnchor();
+ if (pAPos &&
+ (pAnchor->GetAnchorId() == FLY_AT_PARA) &&
nSttNode == pAPos->nNode.GetIndex() )
{
if( !pFrmFmts ||