summaryrefslogtreecommitdiff
path: root/sw/source/core/frmedt/fecopy.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/frmedt/fecopy.cxx')
-rw-r--r--sw/source/core/frmedt/fecopy.cxx73
1 files changed, 39 insertions, 34 deletions
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index c0986ef9185b..5bf894e0fc83 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -151,14 +151,16 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
SwFrmFmt* pFlyFmt = pFly->GetFmt();
SwFmtAnchor aAnchor( pFlyFmt->GetAnchor() );
- if ( FLY_AT_CNTNT == aAnchor.GetAnchorId() ||
- FLY_AUTO_CNTNT == aAnchor.GetAnchorId() ||
- FLY_AT_FLY == aAnchor.GetAnchorId() ||
- FLY_IN_CNTNT == aAnchor.GetAnchorId() )
+ if ((FLY_AT_PARA == aAnchor.GetAnchorId()) ||
+ (FLY_AT_CHAR == aAnchor.GetAnchorId()) ||
+ (FLY_AT_FLY == aAnchor.GetAnchorId()) ||
+ (FLY_AS_CHAR == aAnchor.GetAnchorId()))
{
SwPosition aPos( aSttIdx );
- if( FLY_IN_CNTNT == aAnchor.GetAnchorId() )
+ if ( FLY_AS_CHAR == aAnchor.GetAnchorId() )
+ {
aPos.nContent.Assign( pTxtNd, 0 );
+ }
aAnchor.SetAnchor( &aPos );
}
pFlyFmt = pClpDoc->CopyLayoutFmt( *pFlyFmt, aAnchor, true, true );
@@ -175,7 +177,7 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
rSpzFrmFmts.Insert( pFlyFmt, 0 );
}
- if( FLY_IN_CNTNT == aAnchor.GetAnchorId() )
+ if ( FLY_AS_CHAR == aAnchor.GetAnchorId() )
{
// JP 13.02.99 Bug 61863: wenn eine Rahmenselektion ins Clipboard
// gestellt wird, so muss beim Pasten auch wieder
@@ -206,24 +208,25 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt )
{
SfxItemSet aSet( pClpDoc->GetAttrPool(), aFrmFmtSetRange );
- SwFmtAnchor aAnchor( FLY_AT_CNTNT );
+ SwFmtAnchor aAnchor( FLY_AT_PARA );
aAnchor.SetAnchor( &aPos );
aSet.Put( aAnchor );
- SdrObject* pNew = pClpDoc->CloneSdrObj( *pObj, FALSE, TRUE );
+ SdrObject *const pNew =
+ pClpDoc->CloneSdrObj( *pObj, FALSE, TRUE );
SwPaM aTemp(aPos);
- pClpDoc->Insert(aTemp, *pNew, &aSet, NULL);
+ pClpDoc->Insert(aTemp, *pNew, &aSet, NULL);
}
else
{
SwDrawContact *pContact = (SwDrawContact*)GetUserCall( pObj );
SwFrmFmt *pFmt = pContact->GetFmt();
SwFmtAnchor aAnchor( pFmt->GetAnchor() );
- if ( FLY_AT_CNTNT == aAnchor.GetAnchorId() ||
- FLY_AUTO_CNTNT == aAnchor.GetAnchorId() ||
- FLY_AT_FLY == aAnchor.GetAnchorId() ||
- FLY_IN_CNTNT == aAnchor.GetAnchorId() )
+ if ((FLY_AT_PARA == aAnchor.GetAnchorId()) ||
+ (FLY_AT_CHAR == aAnchor.GetAnchorId()) ||
+ (FLY_AT_FLY == aAnchor.GetAnchorId()) ||
+ (FLY_AS_CHAR == aAnchor.GetAnchorId()))
{
aAnchor.SetAnchor( &aPos );
}
@@ -269,7 +272,9 @@ BOOL lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrm* pFly,
SwCntntFrm* pTmpFrm = rNd.GetCntntNode()->GetFrm( &rInsPt, 0, FALSE );
SwFlyFrm *pTmpFly = pTmpFrm->FindFlyFrm();
if( pTmpFly && bCheckFlyRecur && pFly->IsUpperOf( *pTmpFly ) )
+ {
bRet = FALSE;
+ }
else if ( FLY_AT_FLY == rAnchor.GetAnchorId() )
{
if( pTmpFly )
@@ -281,7 +286,7 @@ BOOL lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrm* pFly,
}
else
{
- rAnchor.SetType( FLY_PAGE );
+ rAnchor.SetType( FLY_AT_PAGE );
rAnchor.SetPageNum( rDestShell.GetPageNumber( rInsPt ) );
const SwFrm *pPg = pTmpFrm->FindPageFrm();
rNewPos = pPg->Frm().Pos();
@@ -329,7 +334,7 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
// in die Gruppe einfuegen, wenns aus einer betretenen Gruppe
// kommt oder das Object nicht zeichengebunden ist
if( pSrcDrwView->IsGroupEntered() ||
- FLY_IN_CNTNT != rAnchor.GetAnchorId() )
+ (FLY_AS_CHAR != rAnchor.GetAnchorId()) )
{
SdrObject* pNew = pDestDoc->CloneSdrObj( *pObj, bIsMove &&
@@ -345,10 +350,10 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
SwFmtAnchor aAnchor( rAnchor );
Point aNewAnch;
- if ( FLY_AT_CNTNT == aAnchor.GetAnchorId() ||
- FLY_AUTO_CNTNT == aAnchor.GetAnchorId() ||
- FLY_AT_FLY == aAnchor.GetAnchorId() ||
- FLY_IN_CNTNT == aAnchor.GetAnchorId() )
+ if ((FLY_AT_PARA == aAnchor.GetAnchorId()) ||
+ (FLY_AT_CHAR == aAnchor.GetAnchorId()) ||
+ (FLY_AT_FLY == aAnchor.GetAnchorId()) ||
+ (FLY_AS_CHAR == aAnchor.GetAnchorId()))
{
if ( this == pDestShell )
{
@@ -378,7 +383,7 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
aNewAnch, FALSE );
}
}
- else if( FLY_PAGE == aAnchor.GetAnchorId() )
+ else if ( FLY_AT_PAGE == aAnchor.GetAnchorId() )
{
aAnchor.SetPageNum( pDestShell->GetPageNumber( rInsPt ) );
const SwRootFrm* pTmpRoot = pDestShell->GetLayout();
@@ -406,7 +411,7 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
if ( pFmt )
{
SdrObject* pNew = pFmt->FindSdrObject();
- if( FLY_IN_CNTNT != aAnchor.GetAnchorId() )
+ if ( FLY_AS_CHAR != aAnchor.GetAnchorId() )
{
Point aPos( rInsPt );
aPos -= aNewAnch;
@@ -496,10 +501,10 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
bRet = TRUE;
Point aNewAnch;
- if ( FLY_AT_CNTNT == aAnchor.GetAnchorId() ||
- FLY_AUTO_CNTNT == aAnchor.GetAnchorId() ||
- FLY_AT_FLY == aAnchor.GetAnchorId() ||
- FLY_IN_CNTNT == aAnchor.GetAnchorId() )
+ if ((FLY_AT_PARA == aAnchor.GetAnchorId()) ||
+ (FLY_AT_CHAR == aAnchor.GetAnchorId()) ||
+ (FLY_AT_FLY == aAnchor.GetAnchorId()) ||
+ (FLY_AS_CHAR == aAnchor.GetAnchorId()))
{
if ( this == pDestShell )
{
@@ -537,7 +542,7 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
aNewAnch, GetDoc() == pDestShell->GetDoc());
}
}
- else if( FLY_PAGE == aAnchor.GetAnchorId() )
+ else if ( FLY_AT_PAGE == aAnchor.GetAnchorId() )
{
aAnchor.SetPageNum( pDestShell->GetPageNumber( rInsPt ) );
const SwRootFrm* pTmpRoot = pDestShell->GetLayout();
@@ -554,7 +559,7 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
SwFrmFmt *pOldFmt = pFlyFmt;
pFlyFmt = pDestShell->GetDoc()->CopyLayoutFmt( *pFlyFmt, aAnchor, true, true );
- if( FLY_IN_CNTNT != aAnchor.GetAnchorId() )
+ if ( FLY_AS_CHAR != aAnchor.GetAnchorId() )
{
Point aPos( rInsPt );
aPos -= aNewAnch;
@@ -918,7 +923,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
if( Imp()->GetDrawView()->IsGroupEntered() &&
RES_DRAWFRMFMT == rCpyFmt.Which() &&
- FLY_IN_CNTNT != rCpyFmt.GetAnchor().GetAnchorId() )
+ (FLY_AS_CHAR != rCpyFmt.GetAnchor().GetAnchorId()) )
{
const SdrObject* pSdrObj = rCpyFmt.FindSdrObject();
if( pSdrObj )
@@ -966,9 +971,9 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
if( bInsWithFmt )
{
SwFmtAnchor aAnchor( rCpyFmt.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* pPos = PCURCRSR->GetPoint();
// #108784# allow shapes (no controls) in header/footer
@@ -979,7 +984,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
aAnchor.SetAnchor( pPos );
}
- else if( FLY_PAGE == aAnchor.GetAnchorId() )
+ else if ( FLY_AT_PAGE == aAnchor.GetAnchorId() )
{
aAnchor.SetPageNum( GetPhyPageNum() );
}
@@ -1091,7 +1096,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
if( bInsWithFmt )
{
SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() );
- if( FLY_PAGE == aAnchor.GetAnchorId() )
+ if ( FLY_AT_PAGE == aAnchor.GetAnchorId() )
{
aAnchor.SetPageNum( aAnchor.GetPageNum() + nStartPageNumber - 1 );
}
@@ -1199,7 +1204,7 @@ BOOL SwFEShell::PastePages( SwFEShell& rToFill, USHORT nStartPage, USHORT nEndPa
{
const SwFrmFmt& rCpyFmt = *(*GetDoc()->GetSpzFrmFmts())[i];
SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() );
- if( FLY_PAGE == aAnchor.GetAnchorId() &&
+ if ((FLY_AT_PAGE == aAnchor.GetAnchorId()) &&
aAnchor.GetPageNum() >= nStartPage && aAnchor.GetPageNum() <= nEndPage)
{
aAnchor.SetPageNum( aAnchor.GetPageNum() - nStartPage + 1);