summaryrefslogtreecommitdiff
path: root/sw/source/core/frmedt/fefly1.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/frmedt/fefly1.cxx')
-rw-r--r--sw/source/core/frmedt/fefly1.cxx84
1 files changed, 49 insertions, 35 deletions
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index a8a19c95f5ab..3cd40a5fea17 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -113,7 +113,7 @@ sal_Bool lcl_SetNewFlyPos( const SwNode& rNode, SwFmtAnchor& rAnchor,
const SwPageFrm *pPg = pCFrm ? pCFrm->FindPageFrm() : 0;
rAnchor.SetPageNum( pPg ? pPg->GetPhyPageNum() : 1 );
- rAnchor.SetType( FLY_PAGE );
+ rAnchor.SetType( FLY_AT_PAGE );
}
return bRet;
}
@@ -130,9 +130,9 @@ BOOL lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
Point aTmpPnt( rPt );
switch( nNew )
{
- case FLY_IN_CNTNT: // sollte der nicht auch mit hinein?
- case FLY_AT_CNTNT:
- case FLY_AUTO_CNTNT: // LAYER_IMPL
+ case FLY_AS_CHAR: // sollte der nicht auch mit hinein?
+ case FLY_AT_PARA:
+ case FLY_AT_CHAR: // LAYER_IMPL
{
//Ausgehend von der linken oberen Ecke des Fly den
//dichtesten CntntFrm suchen.
@@ -146,7 +146,7 @@ BOOL lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
}
SwPosition aPos( *((SwCntntFrm*)pNewAnch)->GetNode() );
- if( FLY_AUTO_CNTNT == nNew || FLY_IN_CNTNT == nNew )
+ if ((FLY_AT_CHAR == nNew) || (FLY_AS_CHAR == nNew))
{
// es muss ein TextNode gefunden werden, denn nur in diesen
// ist ein Inhaltsgebundene Frames zu verankern
@@ -186,10 +186,10 @@ BOOL lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
}
}
- aNewAnch.SetType( nNew = FLY_PAGE );
+ aNewAnch.SetType( nNew = FLY_AT_PAGE );
// no break
- case FLY_PAGE:
+ case FLY_AT_PAGE:
pNewAnch = rFrm.FindPageFrm();
aNewAnch.SetPageNum( pNewAnch->GetPhyPageNum() );
break;
@@ -219,8 +219,8 @@ sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet )
SwDoc* pDoc = (SwDoc*)rFmt.GetDoc();
#ifdef DBG_UTIL
- ASSERT( !(nNew == FLY_PAGE &&
- (FLY_AT_CNTNT==nOld || FLY_AUTO_CNTNT==nOld || FLY_IN_CNTNT==nOld ) &&
+ ASSERT( !(nNew == FLY_AT_PAGE &&
+ (FLY_AT_PARA==nOld || FLY_AT_CHAR==nOld || FLY_AS_CHAR==nOld ) &&
pDoc->IsInHeaderFooter( rOldAnch.GetCntntAnchor()->nNode )),
"Unerlaubter Ankerwechsel in Head/Foot." );
#endif
@@ -441,7 +441,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
RndStdIds nAnchorId = rFmt.GetAnchor().GetAnchorId();
- if ( FLY_IN_CNTNT == nAnchorId )
+ if ( FLY_AS_CHAR == nAnchorId )
return aRet;
sal_Bool bFlyFrame = pObj->ISA(SwVirtFlyDrawObj);
@@ -462,8 +462,10 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
pOldAnch = pFly->GetAnchorFrm();
if( !pOldAnch )
return aRet;
- if( FLY_PAGE != nAnchorId )
+ if ( FLY_AT_PAGE != nAnchorId )
+ {
pFooterOrHeader = pCntnt->FindFooterOrHeader();
+ }
}
// OD 26.06.2003 #108784# - set <pFooterOrHeader> also for drawing
// objects, but not for control objects.
@@ -489,14 +491,18 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
const SwFrm *pNewAnch;
if( pTxtFrm )
{
- if( FLY_PAGE == nAnchorId )
+ if ( FLY_AT_PAGE == nAnchorId )
+ {
pNewAnch = pTxtFrm->FindPageFrm();
+ }
else
{
pNewAnch = ::FindAnchor( pTxtFrm, rAbsPos );
if( FLY_AT_FLY == nAnchorId ) // LAYER_IMPL
+ {
pNewAnch = pNewAnch->FindFlyFrm();
+ }
}
}
else
@@ -522,19 +528,19 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
{
aRet = pNewAnch->GetFrmAnchorPos( ::HasWrap( pObj ) );
- if( bMoveIt || nAnchorId == FLY_AUTO_CNTNT )
+ if ( bMoveIt || (nAnchorId == FLY_AT_CHAR) )
{
SwFmtAnchor aAnch( rFmt.GetAnchor() );
switch ( nAnchorId )
{
- case FLY_AT_CNTNT:
+ case FLY_AT_PARA:
{
SwPosition *pPos = (SwPosition*)aAnch.GetCntntAnchor();
pPos->nNode = *pTxtFrm->GetNode();
pPos->nContent.Assign(0,0);
break;
}
- case FLY_PAGE:
+ case FLY_AT_PAGE:
{
aAnch.SetPageNum( ((const SwPageFrm*)pNewAnch)->
GetPhyPageNum() );
@@ -547,7 +553,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
aAnch.SetAnchor( &aPos );
break;
}
- case FLY_AUTO_CNTNT:
+ case FLY_AT_CHAR:
{
SwPosition *pPos = (SwPosition*)aAnch.GetCntntAnchor();
Point aTmpPnt( rAbsPos );
@@ -666,21 +672,25 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
RndStdIds eRndId = rAnch.GetAnchorId();
switch( eRndId )
{
- case FLY_PAGE:
+ case FLY_AT_PAGE:
if( !rAnch.GetPageNum() ) //HotFix: Bug in UpdateByExample
rAnch.SetPageNum( 1 );
break;
case FLY_AT_FLY:
- case FLY_AT_CNTNT:
- case FLY_AUTO_CNTNT:
- case FLY_IN_CNTNT:
+ case FLY_AT_PARA:
+ case FLY_AT_CHAR:
+ case FLY_AS_CHAR:
if( !bAnchValid )
{
if( FLY_AT_FLY != eRndId )
+ {
rAnch.SetAnchor( &rPos );
+ }
else if( lcl_SetNewFlyPos( rPos.nNode.GetNode(), rAnch, aPt ) )
- eRndId = FLY_PAGE;
+ {
+ eRndId = FLY_AT_PAGE;
+ }
}
break;
@@ -698,7 +708,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
SwFmtVertOrient aOldV;
SwFmtHoriOrient aOldH;
- if( FLY_PAGE != eRndId )
+ if ( FLY_AT_PAGE != eRndId )
{
// erstmal als mit Seitenbindung, Absatz/Zeichenbindung erst wenn
// alles verschoben ist. Dann ist die Position gueltig!
@@ -706,7 +716,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
// umsetzen, damit diese beim Umanker NICHT
// korrigiert wird
pOldAnchor = new SwFmtAnchor( rAnch );
- ((SfxItemSet&)rSet).Put( SwFmtAnchor( FLY_PAGE, 1 ) );
+ const_cast<SfxItemSet&>(rSet).Put( SwFmtAnchor( FLY_AT_PAGE, 1 ) );
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == rSet.GetItemState( RES_HORI_ORIENT, sal_False, &pItem )
@@ -741,8 +751,10 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
const SwFrm* pAnch = ::FindAnchor( GetLayout(), aPt, sal_False );
SwPosition aPos( *((SwCntntFrm*)pAnch)->GetNode() );
- if( FLY_IN_CNTNT == eRndId )
+ if ( FLY_AS_CHAR == eRndId )
+ {
aPos.nContent.Assign( ((SwCntntFrm*)pAnch)->GetNode(), 0 );
+ }
pOldAnchor->SetAnchor( &aPos );
// das verschieben von TabelleSelektion ist noch nicht
@@ -818,9 +830,9 @@ void SwFEShell::Insert( const String& rGrfName, const String& rFltName,
SwFmtAnchor* pAnchor = (SwFmtAnchor*)pItem;
switch( pAnchor->GetAnchorId())
{
- case FLY_AT_CNTNT:
- case FLY_AUTO_CNTNT: // LAYER_IMPL
- case FLY_IN_CNTNT:
+ case FLY_AT_PARA:
+ case FLY_AT_CHAR: // LAYER_IMPL
+ case FLY_AS_CHAR:
if( !pAnchor->GetCntntAnchor() )
{
pAnchor->SetAnchor( pCursor->GetPoint() );
@@ -833,7 +845,7 @@ void SwFEShell::Insert( const String& rGrfName, const String& rFltName,
*pAnchor, GetCrsrDocPos() );
}
break;
- case FLY_PAGE:
+ case FLY_AT_PAGE:
if( !pAnchor->GetPageNum() )
{
pAnchor->SetPageNum( pCursor->GetPageNum(
@@ -912,10 +924,10 @@ void SwFEShell::Insert( SdrObject& rDrawObj,
const SfxPoolItem* pItem;
if( !pFlyAttrSet ||
!pFlyAttrSet->GetItemState( RES_ANCHOR, sal_False, &pItem ) ||
- FLY_PAGE != ((SwFmtAnchor*)pItem)->GetAnchorId() )
+ (FLY_AT_PAGE != ((SwFmtAnchor*)pItem)->GetAnchorId()))
{
pSet = new SfxItemSet( GetDoc()->GetAttrPool(), aFrmFmtSetRange );
- pSet->Put( SwFmtAnchor( FLY_AT_CNTNT ));
+ pSet->Put( SwFmtAnchor( FLY_AT_PARA ));
pFlyAttrSet = pSet;
}
@@ -978,8 +990,10 @@ void SwFEShell::GetPageObjs( SvPtrarr& rFillArr )
for( sal_uInt16 n = 0; n < pDoc->GetSpzFrmFmts()->Count(); ++n )
{
pFmt = (const SwFrmFmt*)(*pDoc->GetSpzFrmFmts())[n];
- if( FLY_PAGE == pFmt->GetAnchor().GetAnchorId() )
+ if (FLY_AT_PAGE == pFmt->GetAnchor().GetAnchorId())
+ {
rFillArr.Insert( (VoidPtr)pFmt, rFillArr.Count() );
+ }
}
}
@@ -1010,7 +1024,7 @@ void SwFEShell::SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset )
{
// FlyFmt ist noch gueltig, also behandeln
SwFmtAnchor aNewAnchor( pFmt->GetAnchor() );
- if( FLY_PAGE != aNewAnchor.GetAnchorId() ||
+ if ((FLY_AT_PAGE != aNewAnchor.GetAnchorId()) ||
0 >= ( nNewPage = aNewAnchor.GetPageNum() + nOffset ) )
// chaos::Anchor wurde veraendert oder ungueltige SeitenNummer,
// also nicht veraendern !!
@@ -1086,12 +1100,12 @@ sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const
SwFmtAnchor* pAnchor = (SwFmtAnchor*)pItem;
RndStdIds eType = pAnchor->GetAnchorId();
- if( FLY_PAGE != eType )
+ if ( FLY_AT_PAGE != eType )
{
// OD 12.11.2003 #i22341# - content anchor of anchor item is needed.
// Thus, don't overwrite anchor item by default contructed anchor item.
//rSet.Put( SwFmtAnchor( eType ) );
- if( FLY_IN_CNTNT == eType )
+ if ( FLY_AS_CHAR == eType )
{
rSet.ClearItem( RES_OPAQUE );
rSet.ClearItem( RES_SURROUND );
@@ -1828,7 +1842,7 @@ ObjCntType SwFEShell::GetObjCntType( const SdrObject& rObj ) const
"<SwFEShell::GetObjCntType(..)> - missing frame format" );
eType = OBJCNT_NONE;
}
- else if ( FLY_IN_CNTNT != pFrmFmt->GetAnchor().GetAnchorId() )
+ else if ( FLY_AS_CHAR != pFrmFmt->GetAnchor().GetAnchorId() )
{
eType = OBJCNT_GROUPOBJ;
}