summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/doclay.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/doc/doclay.cxx')
-rw-r--r--sw/source/core/doc/doclay.cxx29
1 files changed, 17 insertions, 12 deletions
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index c01ad49f78af..6e04d49afb3e 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -651,14 +651,14 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
// Anker noch nicht gesetzt ?
RndStdIds eAnchorId = pAnchor ? pAnchor->GetAnchorId()
: pFmt->GetAnchor().GetAnchorId();
- if( !pAnchor ||
- ((FLY_AT_PAGE != pAnchor->GetAnchorId()) &&
- //Nur Page und nicht:
-// FLY_AT_CNTNT == pAnchor->GetAnchorId() ||
-// FLY_IN_CNTNT == pAnchor->GetAnchorId() ||
-// FLY_AT_FLY == pAnchor->GetAnchorId() ||
-// FLY_AUTO_CNTNT == pAnchor->GetAnchorId() ) &&
- !pAnchor->GetCntntAnchor() ))
+ // --> OD 2010-01-07 #i107811#
+ // Assure that at-page anchored fly frames have a page num or a content anchor set.
+ if ( !pAnchor ||
+ ( FLY_AT_PAGE != pAnchor->GetAnchorId() &&
+ !pAnchor->GetCntntAnchor() ) ||
+ ( FLY_AT_PAGE == pAnchor->GetAnchorId() &&
+ !pAnchor->GetCntntAnchor() &&
+ pAnchor->GetPageNum() == 0 ) )
{
// dann setze ihn, wird im Undo gebraucht
SwFmtAnchor aAnch( pFmt->GetAnchor() );
@@ -672,15 +672,20 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
{
if( eRequestId != aAnch.GetAnchorId() &&
SFX_ITEM_SET != pFmt->GetItemState( RES_ANCHOR, sal_True ) )
+ {
aAnch.SetType( eRequestId );
+ }
eAnchorId = aAnch.GetAnchorId();
- if ( FLY_AT_PAGE != eAnchorId )
- //Nur Page und nicht:
-// if( FLY_AT_CNTNT == eAnchorId || FLY_IN_CNTNT == eAnchorId ||
-// FLY_AT_FLY == eAnchorId || FLY_AUTO_CNTNT == eAnchorId )
+ if ( FLY_AT_PAGE != eAnchorId ||
+ ( FLY_AT_PAGE == eAnchorId &&
+ ( !pAnchor ||
+ aAnch.GetPageNum() == 0 ) ) )
+ {
aAnch.SetAnchor( &rAnchPos );
+ }
}
+ // <--
pFmt->SetFmtAttr( aAnch );
}
else