summaryrefslogtreecommitdiff
path: root/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx')
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx109
1 files changed, 87 insertions, 22 deletions
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index aa8fdfe888b8..71e85c9d94fa 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -268,9 +268,20 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// determine relative vertical position
SwTwips nRelPosY = nAlignAreaOffset;
- SwTwips nObjHeight = (aObjBoundRect.*fnRect->fnGetHeight)();
- SwTwips nUpperSpace = bVert ? rLR.GetRight() : rUL.GetUpper();
- SwTwips nLowerSpace = bVert ? rLR.GetLeft() : rUL.GetLower();
+ const SwTwips nObjHeight = (aObjBoundRect.*fnRect->fnGetHeight)();
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ const SwTwips nUpperSpace = bVert
+ ? ( bVertL2R
+ ? rLR.GetLeft()
+ : rLR.GetRight() )
+ : rUL.GetUpper();
+ // --> OD 2009-08-31 #monglianlayout#
+ const SwTwips nLowerSpace = bVert
+ ? ( bVertL2R
+ ? rLR.GetLeft()
+ : rLR.GetRight() )
+ : rUL.GetLower();
+ // <--
switch ( aVert.GetVertOrient() )
{
case text::VertOrientation::CHAR_BOTTOM:
@@ -279,8 +290,11 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
{
// bottom (to character anchored)
nRelPosY += nAlignAreaHeight + nUpperSpace;
- if ( bVert )
+ //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ if ( bVert && !bVertL2R )
+ {
nRelPosY += nObjHeight;
+ }
break;
}
}
@@ -402,7 +416,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
aEnvOfObj.GetVertEnvironmentLayoutFrm(
*(pOrientFrm->GetUpper()) );
const bool bCheckBottom = !DoesObjFollowsTextFlow();
- nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm, nRelPosY,
DoesObjFollowsTextFlow(),
bCheckBottom );
@@ -584,7 +598,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// anchored object would fit into environment layout frame, if
// anchored object has to follow the text flow.
const bool bCheckBottom = !DoesObjFollowsTextFlow();
- nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm, nRelPosY,
DoesObjFollowsTextFlow(),
bCheckBottom );
@@ -625,7 +639,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// anchored object would fit into environment layout
// frame, if anchored object has to follow the text flow.
const bool bCheckBottom = !DoesObjFollowsTextFlow();
- nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm,
nTmpRelPosY,
DoesObjFollowsTextFlow(),
@@ -714,7 +728,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// align at 'page areas', but stay inside given environment
const SwFrm& rVertEnvironLayFrm =
aEnvOfObj.GetVertEnvironmentLayoutFrm( *pUpperOfOrientFrm );
- nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm,
nRelPosY,
DoesObjFollowsTextFlow() );
@@ -735,9 +749,19 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert );
if( bVert )
{
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- ( aRelPos.X() - nRelDiff ) -
- aObjBoundRect.Width() );
+ // --> OD 2009-08-31 #monglianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ ( aRelPos.X() - nRelDiff ) -
+ aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch +
+ ( aRelPos.X() - nRelDiff ) );
+ }
+ // <--
}
else
{
@@ -828,7 +852,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
nTmpRelPosY = aRelPos.Y() + nDist;
const SwLayoutFrm& rVertEnvironLayFrm =
aEnvOfObj.GetVertEnvironmentLayoutFrm( *pUpperOfOrientFrm );
- nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert,
+ nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
rVertEnvironLayFrm,
nTmpRelPosY,
DoesObjFollowsTextFlow(),
@@ -836,9 +860,18 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
if ( bVert )
{
aRelPos.X() = nTmpRelPosY;
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- aRelPos.X() -
- aObjBoundRect.Width() );
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ aRelPos.X() -
+ aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() );
+ }
+ // <--
}
else
{
@@ -918,9 +951,21 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
SWREFRESHFN( pUpperOfOrientFrm )
bMoveable = rAnchorTxtFrm.IsMoveable( (SwLayoutFrm*)pUpperOfOrientFrm );
if( bVertX )
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- aRelPos.X() -
- aObjBoundRect.Width() );
+ {
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ aRelPos.X() -
+ aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch +
+ aRelPos.X() );
+ }
+ // <--
+ }
else
GetAnchoredObj().SetObjTop( nTopOfAnch +
aRelPos.Y() );
@@ -972,8 +1017,19 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// frame, the horizontal position is oriented at.
const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert );
if( bVert )
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- aRelPos.X() - aObjBoundRect.Width() );
+ {
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ aRelPos.X() - aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() );
+ }
+ // <--
+ }
else
GetAnchoredObj().SetObjTop( nTopOfAnch + aRelPos.Y() );
@@ -1023,8 +1079,17 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert );
if( bVert )
{
- GetAnchoredObj().SetObjLeft( nTopOfAnch -
- aRelPos.X() - aObjBoundRect.Width() );
+ // --> OD 2009-08-31 #mongolianlayout#
+ if ( !bVertL2R )
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch -
+ aRelPos.X() - aObjBoundRect.Width() );
+ }
+ else
+ {
+ GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() );
+ }
+ // <--
GetAnchoredObj().SetObjTop( rAnchorTxtFrm.Frm().Top() +
aRelPos.Y() );
}