diff options
Diffstat (limited to 'sw/source/core/layout/flycnt.cxx')
-rw-r--r-- | sw/source/core/layout/flycnt.cxx | 68 |
1 files changed, 54 insertions, 14 deletions
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index 3d30aee66efb..41d0e97ec6d6 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -663,13 +663,24 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, pUp = pUp->GetUpper(); const bool bVert = pUp->IsVertical(); //Dem Textflus folgen. + // --> OD 2009-01-12 #i70582# + const SwTwips nTopForObjPos = + bVert + ? ( pCnt->Frm().Left() + + pCnt->Frm().Width() - + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) + : ( pCnt->Frm().Top() + + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ); + // <-- if ( pUp->Frm().IsInside( rPt ) ) { // OD 26.09.2003 - <rPt> point is inside environment of given content frame + // --> OD 2009-01-12 #i70582# if( bVert ) - rRet.nMain = pCnt->Frm().Left() + pCnt->Frm().Width() -rPt.X(); + rRet.nMain = nTopForObjPos - rPt.X(); else - rRet.nMain = rPt.Y() - pCnt->Frm().Top(); + rRet.nMain = rPt.Y() - nTopForObjPos; + // <-- return pCnt; } else if ( rPt.Y() <= pUp->Frm().Top() ) @@ -689,11 +700,12 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, (!bVert && (pLay->Frm().Left() + pLay->Prt().Right())<rPt.X()) ) { // OD 26.09.2003 - <rPt> point is in left border of environment + // --> OD 2009-01-12 #i70582# if( bVert ) - rRet.nMain = pCnt->Frm().Left() + pCnt->Frm().Width() - - rPt.X(); + rRet.nMain = nTopForObjPos - rPt.X(); else - rRet.nMain = rPt.Y() - pCnt->Frm().Top(); + rRet.nMain = rPt.Y() - nTopForObjPos; + // <-- return pCnt; } else @@ -701,9 +713,11 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, } else { - rRet.nMain = bVert ? pCnt->Frm().Left() + pCnt->Frm().Width() - - (pUp->Frm().Left() + pUp->Prt().Left()) - : (pUp->Frm().Top() + pUp->Prt().Bottom()) - pCnt->Frm().Top(); + // --> OD 2009-01-12 #i70582# + rRet.nMain = bVert + ? nTopForObjPos - (pUp->Frm().Left() + pUp->Prt().Left()) + : (pUp->Frm().Top() + pUp->Prt().Bottom()) - nTopForObjPos; + // <-- const SwFrm *pPre = pCnt; const SwFrm *pLay = pUp->GetLeaf( MAKEPAGE_NONE, TRUE, pCnt ); @@ -1245,10 +1259,23 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) SwTwips nY; if ( pCnt->Frm().IsInside( aNew ) ) { - if( bVert ) - nY = pCnt->Frm().Left()+pCnt->Frm().Width()-rNew.X()-Frm().Width(); + // --> OD 2009-01-12 #i70582# + const SwTwips nTopForObjPos = + bVert + ? ( pCnt->Frm().Left() + + pCnt->Frm().Width() - + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) + : ( pCnt->Frm().Top() + + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ); + if ( bVert ) + { + nY = nTopForObjPos - rNew.X() - Frm().Width(); + } else - nY = rNew.Y() - pCnt->Frm().Top(); + { + nY = rNew.Y() - nTopForObjPos; + } + // <-- } else { @@ -1291,10 +1318,23 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) if ( nY == LONG_MAX ) { - if( bVert ) - nY = pCnt->Frm().Left() + pCnt->Frm().Width() - rNew.X(); + // --> OD 2009-01-12 #i70582# + const SwTwips nTopForObjPos = + bVert + ? ( pCnt->Frm().Left() + + pCnt->Frm().Width() - + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) + : ( pCnt->Frm().Top() + + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ); + if ( bVert ) + { + nY = nTopForObjPos - rNew.X(); + } else - nY = rNew.Y() - pCnt->Frm().Top(); + { + nY = rNew.Y() - nTopForObjPos; + } + // <-- } SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt(); |