Kaydet (Commit) 5ddd93f4 authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS aig01 (1.31.26); FILE MERGED

2003/05/16 15:01:07 fme 1.31.26.2: #108778# Fly frame and drawing positioning - changes
2003/05/15 15:23:49 fme 1.31.26.1: #108778# Fly frame and drawing positioning
üst 623dc61f
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: flycnt.cxx,v $ * $RCSfile: flycnt.cxx,v $
* *
* $Revision: 1.31 $ * $Revision: 1.32 $
* *
* last change: $Author: vg $ $Date: 2003-04-17 14:11:54 $ * last change: $Author: vg $ $Date: 2003-05-22 09:47:03 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -1186,28 +1186,41 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) ...@@ -1186,28 +1186,41 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
else else
nY = rNew.Y() - pCnt->Frm().Top(); nY = rNew.Y() - pCnt->Frm().Top();
} }
SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
const SwFmtSurround& rSurround = pFmt->GetSurround();
const FASTBOOL bWrapThrough =
rSurround.GetSurround() == SURROUND_THROUGHT;
SwTwips nBaseOfstForFly = 0;
const SwFrm* pTmpFrm = pFrm ? pFrm : pCnt;
if ( pTmpFrm->IsTxtFrm() )
nBaseOfstForFly =
((SwTxtFrm*)pTmpFrm)->GetBaseOfstForFly( !bWrapThrough );
if( bVert ) if( bVert )
{ {
if( !pFrm ) if( !pFrm )
nX += rNew.Y() - pCnt->Frm().Top(); nX += rNew.Y() - pCnt->Frm().Top() - nBaseOfstForFly;
else else
nX = rNew.Y() - pFrm->Frm().Top(); nX = rNew.Y() - pFrm->Frm().Top() - nBaseOfstForFly;
} }
else else
{ {
if( !pFrm ) if( !pFrm )
{ {
if ( pCnt->IsRightToLeft() ) if ( pCnt->IsRightToLeft() )
nX += pCnt->Frm().Right() - rNew.X() - Frm().Width(); nX += pCnt->Frm().Right() - rNew.X() - Frm().Width() +
nBaseOfstForFly;
else else
nX += rNew.X() - pCnt->Frm().Left(); nX += rNew.X() - pCnt->Frm().Left() - nBaseOfstForFly;
} }
else else
{ {
if ( pFrm->IsRightToLeft() ) if ( pFrm->IsRightToLeft() )
nX += pFrm->Frm().Right() - rNew.X() - Frm().Width(); nX += pFrm->Frm().Right() - rNew.X() - Frm().Width() +
nBaseOfstForFly;
else else
nX = rNew.X() - pFrm->Frm().Left(); nX = rNew.X() - pFrm->Frm().Left() - nBaseOfstForFly;
} }
} }
GetFmt()->GetDoc()->StartUndo( UNDO_START ); GetFmt()->GetDoc()->StartUndo( UNDO_START );
...@@ -1216,7 +1229,6 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) ...@@ -1216,7 +1229,6 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
GetFmt()->GetDoc()->IsHTMLMode() ) ) GetFmt()->GetDoc()->IsHTMLMode() ) )
{ {
//Das Ankerattribut auf den neuen Cnt setzen. //Das Ankerattribut auf den neuen Cnt setzen.
SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
SwFmtAnchor aAnch( pFmt->GetAnchor() ); SwFmtAnchor aAnch( pFmt->GetAnchor() );
SwPosition *pPos = (SwPosition*)aAnch.GetCntntAnchor(); SwPosition *pPos = (SwPosition*)aAnch.GetCntntAnchor();
if( IsAutoPos() && pCnt->IsTxtFrm() ) if( IsAutoPos() && pCnt->IsTxtFrm() )
...@@ -1599,8 +1611,12 @@ void SwFlyAtCntFrm::MakeFlyPos() ...@@ -1599,8 +1611,12 @@ void SwFlyAtCntFrm::MakeFlyPos()
/// OD 02.10.2002 #102646# - NOTE /// OD 02.10.2002 #102646# - NOTE
/// determine, if fly frame has no surrounding. /// determine, if fly frame has no surrounding.
const FASTBOOL bNoSurround const SwFmtSurround& rSurround = pFmt->GetSurround();
= pFmt->GetSurround().GetSurround() == SURROUND_NONE; const FASTBOOL bNoSurround =
rSurround.GetSurround() == SURROUND_NONE;
const FASTBOOL bWrapThrough =
rSurround.GetSurround() == SURROUND_THROUGHT;
BOOL bGrow = BOOL bGrow =
!GetAnchor()->IsInTab() || !pFmt->GetFrmSize().GetHeightPercent(); !GetAnchor()->IsInTab() || !pFmt->GetFrmSize().GetHeightPercent();
...@@ -2037,6 +2053,8 @@ void SwFlyAtCntFrm::MakeFlyPos() ...@@ -2037,6 +2053,8 @@ void SwFlyAtCntFrm::MakeFlyPos()
{ {
nWidth = (pOrient->Prt().*fnRect->fnGetWidth)(); nWidth = (pOrient->Prt().*fnRect->fnGetWidth)();
nAdd = (pOrient->*fnRect->fnGetLeftMargin)(); nAdd = (pOrient->*fnRect->fnGetLeftMargin)();
if ( pOrient->IsTxtFrm() )
nAdd += ((SwTxtFrm*)pOrient)->GetBaseOfstForFly( !bWrapThrough );
break; break;
} }
case REL_PG_LEFT: case REL_PG_LEFT:
...@@ -2106,7 +2124,9 @@ void SwFlyAtCntFrm::MakeFlyPos() ...@@ -2106,7 +2124,9 @@ void SwFlyAtCntFrm::MakeFlyPos()
default: default:
{ {
nWidth = (pOrient->Frm().*fnRect->fnGetWidth)(); nWidth = (pOrient->Frm().*fnRect->fnGetWidth)();
nAdd = 0; nAdd = pOrient->IsTxtFrm() ?
((SwTxtFrm*)pOrient)->GetBaseOfstForFly( !bWrapThrough ) :
0;
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment