diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2011-02-16 13:15:38 +0100 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2011-02-16 13:15:38 +0100 |
commit | 9d11d6a1954317d3ed753a2feb34a7f8fdc81201 (patch) | |
tree | 9ff4a74b1ad11956c5fedacd2c195c5bde2b2990 /sw | |
parent | 2866c516dbd205d09b35aac7d934c9e215be625e (diff) | |
parent | 0a9e48f8e95723b42c0d4f52013e627a4b6d135d (diff) |
CWS-TOOLING: integrate CWS mongolianlayout
Diffstat (limited to 'sw')
39 files changed, 995 insertions, 281 deletions
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index 3beaff17ade8..0d659aee244d 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -374,7 +374,10 @@ public: void SetFlyPos( const Point &rAbsPos); Point FindAnchorPos( const Point &rAbsPos, sal_Bool bMoveIt = sal_False ); // determines whether a frame or its environment is vertically formatted and right-to-left - sal_Bool IsFrmVertical(sal_Bool bEnvironment, sal_Bool& bRightToLeft) const; + // --> OD 2009-08-31 #mongolianlayout# + // also determines, if frame or its environmane is in mongolianlayout (vertical left-to-right) + // - add output parameter <bVertL2R> + sal_Bool IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRightToLeft, sal_Bool& bVertL2R) const; SwFrmFmt* GetCurFrmFmt() const; //Wenn Rahmen, dann Rahmenvorlage, sonst 0 void SetFrmFmt( SwFrmFmt *pFmt, sal_Bool bKeepOrient = sal_False, Point* pDocPos = 0 ); //Wenn Rahmen, dann Rahmenvorlage setzen diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 051efd2b0948..91d99221e1fd 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -140,11 +140,12 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt, { case FRMDIR_VERT_TOP_LEFT: { - // vertical from left-to-right - not supported yet + // vertical from left-to-right - Badaa: supported now! bVert = true; bR2L = true; - ASSERT( false, - "<lcl_AdjustPositioningAttr(..)> - vertical from left-to-right not supported." ); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + //ASSERT( false, "<lcl_AdjustPositioningAttr(..)> - vertical from left-to-right not supported." ); + //End } break; case FRMDIR_VERT_TOP_RIGHT: @@ -173,10 +174,18 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt, } // use geometry of drawing object const SwRect aObjRect = _rSdrObj.GetSnapRect(); + if ( bVert ) { - nHoriRelPos = aObjRect.Top() - aAnchorPos.Y(); - nVertRelPos = aAnchorPos.X() - aObjRect.Right(); + if ( bR2L ) { + //FRMDIR_VERT_TOP_LEFT + nHoriRelPos = aObjRect.Left() - aAnchorPos.X(); + nVertRelPos = aObjRect.Top() - aAnchorPos.Y(); + } else { + //FRMDIR_VERT_TOP_RIGHT + nHoriRelPos = aObjRect.Top() - aAnchorPos.Y(); + nVertRelPos = aAnchorPos.X() - aObjRect.Right(); + } } else if ( bR2L ) { @@ -188,6 +197,7 @@ void lcl_AdjustPositioningAttr( SwDrawFrmFmt* _pFrmFmt, nHoriRelPos = aObjRect.Left() - aAnchorPos.X(); nVertRelPos = aObjRect.Top() - aAnchorPos.Y(); } + //End of SCMS } _pFrmFmt->SetFmtAttr( SwFmtHoriOrient( nHoriRelPos, text::HoriOrientation::NONE, text::RelOrientation::FRAME ) ); diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index e8b5c378a2ec..492b44e5c89f 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -679,8 +679,19 @@ void __EXPORT SwVirtFlyDrawObj::NbcMove(const Size& rSiz) long lYDiff = aNewPos.Y() - aOldPos.Y(); if( GetFlyFrm()->GetAnchorFrm()->IsVertical() ) { - lXDiff -= rVert.GetPos(); - lYDiff += rHori.GetPos(); + //lXDiff -= rVert.GetPos(); + //lYDiff += rHori.GetPos(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( GetFlyFrm()->GetAnchorFrm()->IsVertLR() ) + { + lXDiff += rVert.GetPos(); + lXDiff = -lXDiff; + } + else + { + lXDiff -= rVert.GetPos(); + lYDiff += rHori.GetPos(); + } } else { @@ -791,7 +802,9 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef, const sal_Bool bRTL = pTmpFrm->IsRightToLeft(); - const Point aNewPos( bVertX || bRTL ? + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + const bool bVertL2RX = pTmpFrm->IsVertLR(); + const Point aNewPos( ( bVertX && !bVertL2RX ) || bRTL ? aOutRect.Right() + 1 : aOutRect.Left(), aOutRect.Top() ); @@ -856,10 +869,9 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef, } //Position kann auch veraendert sein! - const Point aOldPos( bVertX || bRTL ? + const Point aOldPos( ( bVertX && !bVertL2RX ) || bRTL ? GetFlyFrm()->Frm().TopRight() : GetFlyFrm()->Frm().Pos() ); - if ( aNewPos != aOldPos ) { //Kann sich durch das ChgSize veraendert haben! @@ -867,7 +879,12 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef, { if( aOutRect.TopRight() != aNewPos ) { - SwTwips nDeltaX = aNewPos.X() - aOutRect.Right(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + SwTwips nDeltaX; + if ( bVertL2RX ) + nDeltaX = aNewPos.X() - aOutRect.Left(); + else + nDeltaX = aNewPos.X() - aOutRect.Right(); SwTwips nDeltaY = aNewPos.Y() - aOutRect.Top(); MoveRect( aOutRect, Size( nDeltaX, nDeltaY ) ); } diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index e7e1ae88f266..f449dac13bc3 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -279,7 +279,8 @@ void SwDrawView::AddCustomHdl() } // add anchor handle: - aHdl.AddHdl( new SwSdrHdl( aPos, pAnch->IsVertical() || + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + aHdl.AddHdl( new SwSdrHdl( aPos, ( pAnch->IsVertical() && !pAnch->IsVertLR() ) || pAnch->IsRightToLeft() ) ); } @@ -829,9 +830,10 @@ const SwFrm* SwDrawView::CalcAnchor() aMyRect = pObj->GetSnapRect(); } - const sal_Bool bTopRight = pAnch && ( pAnch->IsVertical() || - pAnch->IsRightToLeft() ); - + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + const sal_Bool bTopRight = pAnch && ( ( pAnch->IsVertical() && + !pAnch->IsVertLR() ) || + pAnch->IsRightToLeft() ); const Point aMyPt = bTopRight ? aMyRect.TopRight() : aMyRect.TopLeft(); Point aPt; diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 965d7c4ffe87..1f7fa08ad242 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -772,8 +772,11 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, _bMirror = _bMirror && !pPage->OnRightPage(); Point aPos; - sal_Bool bVertic = sal_False; + bool bVertic = false; sal_Bool bRTL = sal_False; + // --> OD 2009-09-01 #mongolianlayout# + bool bVerticalL2R = false; + // <-- if ((FLY_AT_PAGE == _nAnchorId) || (FLY_AT_FLY == _nAnchorId)) // LAYER_IMPL { @@ -798,9 +801,14 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, else aPos = (pFrm->Frm().*fnRect->fnGetPos)(); - if( bVert ) + // --> OD 2009-09-01 #mongolianlayout# + if( bVert || bVertL2R ) + // <-- { - bVertic = sal_True; + // --> OD 2009-09-01 #mongolianlayout# + bVertic = bVert ? true : false; + bVerticalL2R = bVertL2R ? true : false; + // <-- _bMirror = false; // no mirroring in vertical environment switch ( _eHoriRelOrient ) { @@ -849,8 +857,9 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, default:break; } } - // --> OD 2006-12-12 #i67221# - proposed patch - if( bVert ) + // --> OD 2009-09-01 #mongolianlayout# + if ( bVert && !bVertL2R ) + // <-- { switch ( _eVertRelOrient ) { @@ -862,6 +871,20 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, break; } } + // --> OD 2009-09-01 #mongolianlayout# + else if ( bVertL2R ) + { + switch ( _eVertRelOrient ) + { + case text::RelOrientation::PRINT_AREA: + case text::RelOrientation::PAGE_PRINT_AREA: + { + aPos.X() += pFrm->GetLeftMargin(); + } + break; + } + } + // <-- else { switch ( _eVertRelOrient ) @@ -926,10 +949,17 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, // to page areas. if ( _eVertRelOrient == text::RelOrientation::PAGE_FRAME || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) { - if ( bVert ) + // --> OD 2009-09-01 #mongolianlayout# + if ( bVert && !bVertL2R ) + // <-- { aPos.X() = aVertEnvironRect.Right(); } + // --> OD 2009-09-01 #mongolianlayout# + else if ( bVertL2R ) + { + aPos.X() = aVertEnvironRect.Left(); + } else { aPos.Y() = aVertEnvironRect.Top(); @@ -946,7 +976,9 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, // to page areas. if ( _eVertRelOrient == text::RelOrientation::PAGE_FRAME || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) { - if ( bVert ) + // --> OD 2009-09-01 #mongolianlayout# + if ( bVert && !bVertL2R ) + // <-- { aPos.X() = aVertEnvironRect.Right(); if ( _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) @@ -954,6 +986,16 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, aPos.X() -= rVertEnvironLayFrm.GetRightMargin(); } } + // --> OD 2009-09-01 #mongolianlayout# + else if ( bVertL2R ) + { + aPos.X() = aVertEnvironRect.Left(); + if ( _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) + { + aPos.X() += rVertEnvironLayFrm.GetLeftMargin(); + } + } + // <-- else { aPos.Y() = aVertEnvironRect.Top(); @@ -1013,10 +1055,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, pTxtFrm->GetTopOfLine( nTop, aDefaultCntntPos ); } } - if ( bVert ) + // --> OD 2009-09-01 #mongolianlayout# + if ( bVert || bVertL2R ) { aPos.X() = nTop; } + // <-- else { aPos.Y() = nTop; @@ -1043,10 +1087,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, pTxtFrm->GetAutoPos( aChRect, aDefaultCntntPos ); } nLeft = (aChRect.*fnRect->fnGetLeft)(); - if ( bVert ) + // --> OD 2009-09-01 #mongolianlayout# + if ( bVert || bVertL2R ) { aPos.Y() = nLeft; } + // <-- else { aPos.X() = nLeft; @@ -1054,7 +1100,9 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, } // <-- - if ( bVert ) + // --> OD 2009-09-01 #mongolianlayout# + if ( bVert || bVertL2R ) + // <-- { _orRect = SwRect( aVertEnvironRect.Left(), aHoriEnvironRect.Top(), @@ -1088,7 +1136,9 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, } // bei zeichengebundenen lieber nur 90% der Hoehe ausnutzen { - if( bVert ) + // --> OD 2009-09-01 #mongolianlayout# + if( bVert || bVertL2R ) + // <-- _orRect.Width( (_orRect.Width()*9)/10 ); else _orRect.Height( (_orRect.Height()*9)/10 ); @@ -1098,26 +1148,51 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, const SwTwips nBaseOfstForFly = ( pFrm->IsTxtFrm() && pFly ) ? ((SwTxtFrm*)pFrm)->GetBaseOfstForFly( !bWrapThrough ) : 0; - if( bVert ) + // --> OD 2009-09-01 #mongolianlayout# + if( bVert || bVertL2R ) + // <-- { - bVertic = sal_True; + // --> OD 2009-09-01 #mongolianlayout# + bVertic = bVert ? true : false; + bVerticalL2R = bVertL2R ? true : false; + // <-- _bMirror = false; switch ( _eHoriRelOrient ) { - case text::RelOrientation::FRAME_RIGHT: aPos.Y() += pFrm->Prt().Height(); - aPos += (pFrm->Prt().*fnRect->fnGetPos)(); - break; - case text::RelOrientation::PRINT_AREA: aPos += (pFrm->Prt().*fnRect->fnGetPos)(); - aPos.Y() += nBaseOfstForFly; - break; - case text::RelOrientation::PAGE_RIGHT: aPos.Y() = pPage->Frm().Top() - + pPage->Prt().Bottom(); break; - case text::RelOrientation::PAGE_PRINT_AREA: aPos.Y() = pPage->Frm().Top() - + pPage->Prt().Top(); break; + case text::RelOrientation::FRAME_RIGHT: + { + aPos.Y() += pFrm->Prt().Height(); + aPos += (pFrm->Prt().*fnRect->fnGetPos)(); + break; + } + case text::RelOrientation::PRINT_AREA: + { + aPos += (pFrm->Prt().*fnRect->fnGetPos)(); + aPos.Y() += nBaseOfstForFly; + break; + } + case text::RelOrientation::PAGE_RIGHT: + { + aPos.Y() = pPage->Frm().Top() + pPage->Prt().Bottom(); + break; + } + case text::RelOrientation::PAGE_PRINT_AREA: + { + aPos.Y() = pPage->Frm().Top() + pPage->Prt().Top(); + break; + } case text::RelOrientation::PAGE_LEFT: - case text::RelOrientation::PAGE_FRAME: aPos.Y() = pPage->Frm().Top(); break; - case text::RelOrientation::FRAME: aPos.Y() += nBaseOfstForFly; break; + case text::RelOrientation::PAGE_FRAME: + { + aPos.Y() = pPage->Frm().Top(); + break; + } + case text::RelOrientation::FRAME: + { + aPos.Y() += nBaseOfstForFly; + break; + } default: break; } } @@ -1175,19 +1250,27 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, { switch ( _eHoriRelOrient ) { - case text::RelOrientation::FRAME_RIGHT: aPos.X() += pFrm->Prt().Width(); - aPos += pFrm->Prt().Pos(); - break; - case text::RelOrientation::PRINT_AREA: aPos += pFrm->Prt().Pos(); - aPos.X() += nBaseOfstForFly; - break; - case text::RelOrientation::PAGE_RIGHT: aPos.X() = pPage->Frm().Left() - + pPage->Prt().Right(); break; - case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() = pPage->Frm().Left() - + pPage->Prt().Left(); break; + case text::RelOrientation::FRAME_RIGHT: + aPos.X() += pFrm->Prt().Width(); + aPos += pFrm->Prt().Pos(); + break; + case text::RelOrientation::PRINT_AREA: + aPos += pFrm->Prt().Pos(); + aPos.X() += nBaseOfstForFly; + break; + case text::RelOrientation::PAGE_RIGHT: + aPos.X() = pPage->Frm().Left() + pPage->Prt().Right(); + break; + case text::RelOrientation::PAGE_PRINT_AREA: + aPos.X() = pPage->Frm().Left() + pPage->Prt().Left(); + break; case text::RelOrientation::PAGE_LEFT: - case text::RelOrientation::PAGE_FRAME: aPos.X() = pPage->Frm().Left(); break; - case text::RelOrientation::FRAME: aPos.X() += nBaseOfstForFly; break; + case text::RelOrientation::PAGE_FRAME: + aPos.X() = pPage->Frm().Left(); + break; + case text::RelOrientation::FRAME: + aPos.X() += nBaseOfstForFly; + break; default: break; } } @@ -1195,8 +1278,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, } if( !_opRef ) { - if( bVertic ) + if( bVertic && !bVerticalL2R ) _orRect.Pos( aPos.X() - _orRect.Width() - _orRect.Left(), _orRect.Top() - aPos.Y() ); + // --> OD 2009-09-01 #mongolianlayout# + else if( bVerticalL2R ) + _orRect.Pos( _orRect.Left() - aPos.X(), _orRect.Top() - aPos.Y() ); + // <-- else if ( bRTL ) _orRect.Pos( - ( _orRect.Right() - aPos.X() ), _orRect.Top() - aPos.Y() ); else @@ -1239,10 +1326,13 @@ Size SwFEShell::GetGraphicDefaultSize() const /* -----------------------------12.08.2002 12:51------------------------------ ---------------------------------------------------------------------------*/ -sal_Bool SwFEShell::IsFrmVertical(sal_Bool bEnvironment, sal_Bool& bRTL) const +// --> OD 2009-08-31 #mongolianlayou# +// add output parameter <bVertL2R> +sal_Bool SwFEShell::IsFrmVertical(sal_Bool bEnvironment, sal_Bool& bRTL, sal_Bool& bVertL2R) const { sal_Bool bVert = sal_False; bRTL = sal_False; + bVertL2R = sal_False; if ( Imp()->HasDrawView() ) { @@ -1284,10 +1374,12 @@ sal_Bool SwFEShell::IsFrmVertical(sal_Bool bEnvironment, sal_Bool& bRTL) const bVert = pRef->IsVertical(); bRTL = pRef->IsRightToLeft(); + bVertL2R = pRef->IsVertLR(); } return bVert; } +// <-- void SwFEShell::MoveObjectIfActive( svt::EmbeddedObjectRef&, const Point& ) { diff --git a/sw/source/core/inc/anchoredobjectposition.hxx b/sw/source/core/inc/anchoredobjectposition.hxx index 966b1a43f428..178a07c7bec7 100644 --- a/sw/source/core/inc/anchoredobjectposition.hxx +++ b/sw/source/core/inc/anchoredobjectposition.hxx @@ -83,12 +83,14 @@ namespace objectpositioning void _GetInfoAboutObj(); // --> OD 2006-03-15 #i62875# - SwTwips _ImplAdjustVertRelPos( const SwTwips _nTopOfAnch, - const bool _bVert, - const SwFrm& _rPageAlignLayFrm, - const SwTwips _nProposedRelPosY, - const bool _bFollowTextFlow, - const bool _bCheckBottom = true ) const; + // --> OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R> + SwTwips _ImplAdjustVertRelPos( const SwTwips nTopOfAnch, + const bool bVert, + const bool bVertL2R, + const SwFrm& rPageAlignLayFrm, + const SwTwips nProposedRelPosY, + const bool bFollowTextFlow, + const bool bCheckBottom = true ) const; SwTwips _ImplAdjustHoriRelPos( const SwFrm& _rPageAlignLayFrm, const SwTwips _nProposedRelPosX ) const; // <-- @@ -170,53 +172,59 @@ namespace objectpositioning /** adjust calculated vertical in order to keep object inside 'page' alignment layout frame. - OD 2004-07-22 #i31805# - add parameter <_bCheckBottom> - OD 2004-10-08 #i26945# - add parameter <_bFollowTextFlow> + OD 2004-07-22 #i31805# - add parameter <bCheckBottom> + OD 2004-10-08 #i26945# - add parameter <bFollowTextFlow> OD 2006-03-15 #i62875# - made inline, intrinsic actions moved to private method <_ImplAdjustVertRelPos>, which is only called, if <mbDoNotCaptureAnchoredObj> not set. + OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R> - @param _nTopOfAnch + @param nTopOfAnch input parameter - 'vertical' position, at which the relative position of the object is calculated from. - @param _bVert + @param bVert input parameter - boolean, indicating, if object is in vertical layout. - @param _rPageAlignLayFrm + @param bVertL2R + input parameter - boolean, indicating, if object is in mongolian + layout (vertical left-to-right layout). + + @param rPageAlignLayFrm input parameter - layout frame, which determines the 'page area' the object has to be vertical positioned in. - @param _nProposedRelPosY + @param nProposedRelPosY input parameter - proposed relative vertical position, which will be adjusted. - @param _bFollowTextFlow + @param bFollowTextFlow input parameter - value of attribute 'Follow text flow' of the anchored object. - @param _bCheckBottom + @param bCheckBottom input parameter - boolean indicating, if bottom of anchored object has to be checked and thus, (if needed) the proposed relative position has to be adjusted. default value <true> @author OD */ - inline SwTwips _AdjustVertRelPos( const SwTwips _nTopOfAnch, - const bool _bVert, - const SwFrm& _rPageAlignLayFrm, - const SwTwips _nProposedRelPosY, - const bool _bFollowTextFlow, - const bool _bCheckBottom = true ) const + inline SwTwips _AdjustVertRelPos( const SwTwips nTopOfAnch, + const bool bVert, + const bool bVertL2R, + const SwFrm& rPageAlignLayFrm, + const SwTwips nProposedRelPosY, + const bool bFollowTextFlow, + const bool bCheckBottom = true ) const { return !mbDoNotCaptureAnchoredObj - ? _ImplAdjustVertRelPos( _nTopOfAnch, _bVert, - _rPageAlignLayFrm, - _nProposedRelPosY, - _bFollowTextFlow, - _bCheckBottom ) - : _nProposedRelPosY; + ? _ImplAdjustVertRelPos( nTopOfAnch, bVert, bVertL2R, + rPageAlignLayFrm, + nProposedRelPosY, + bFollowTextFlow, + bCheckBottom ) + : nProposedRelPosY; } // ********************************************************************* diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 9b3599ac977f..1b8762f71edd 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -198,8 +198,8 @@ struct SwRectFnCollection }; typedef SwRectFnCollection* SwRectFn; +/* extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R; - #define SWRECTFN( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \ sal_Bool bRev = pFrm->IsReverse(); \ SwRectFn fnRect = bVert ? \ @@ -221,6 +221,36 @@ extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R; sal_Bool bNeighb = pFrm->IsNeighbourFrm(); \ SwRectFn fnRect = bVert == bNeighb ? \ fnRectHori : fnRectVert; +*/ + +//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin +extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R, fnRectVertL2R; +#define SWRECTFN( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \ + sal_Bool bRev = pFrm->IsReverse(); \ + sal_Bool bVertL2R = pFrm->IsVertLR(); \ + SwRectFn fnRect = bVert ? \ + ( bRev ? fnRectVL2R : ( bVertL2R ? fnRectVertL2R : fnRectVert ) ): \ + ( bRev ? fnRectB2T : fnRectHori ); +#define SWRECTFNX( pFrm ) sal_Bool bVertX = pFrm->IsVertical(); \ + sal_Bool bRevX = pFrm->IsReverse(); \ + sal_Bool bVertL2RX = pFrm->IsVertLR(); \ + SwRectFn fnRectX = bVertX ? \ + ( bRevX ? fnRectVL2R : ( bVertL2RX ? fnRectVertL2R : fnRectVert ) ): \ + ( bRevX ? fnRectB2T : fnRectHori ); +#define SWREFRESHFN( pFrm ) { if( bVert != pFrm->IsVertical() || \ + bRev != pFrm->IsReverse() ) \ + bVert = pFrm->IsVertical(); \ + bRev = pFrm->IsReverse(); \ + bVertL2R = pFrm->IsVertLR(); \ + fnRect = bVert ? \ + ( bRev ? fnRectVL2R : ( bVertL2R ? fnRectVertL2R : fnRectVert ) ): \ + ( bRev ? fnRectB2T : fnRectHori ); } +#define SWRECTFN2( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \ + sal_Bool bVertL2R = pFrm->IsVertLR(); \ + sal_Bool bNeighb = pFrm->IsNeighbourFrm(); \ + SwRectFn fnRect = bVert == bNeighb ? \ + fnRectHori : ( bVertL2R ? fnRectVertL2R : fnRectVert ); +//End of SCMS #define POS_DIFF( aFrm1, aFrm2 ) \ ( (aFrm1.*fnRect->fnGetTop)() != (aFrm2.*fnRect->fnGetTop)() || \ (aFrm1.*fnRect->fnGetLeft)() != (aFrm2.*fnRect->fnGetLeft)() ) @@ -371,6 +401,9 @@ protected: sal_uInt16 bInvalidVert: 1; sal_uInt16 bDerivedVert: 1; sal_uInt16 bVertical: 1; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + sal_uInt16 bVertLR: 1; + //End of SCMS sal_uInt16 nType: 4; //Who am I? sal_Bool bValidPos: 1; @@ -562,8 +595,14 @@ public: inline sal_Bool IsReverse() const { return bReverse; } inline void SetReverse( sal_Bool bNew ){ bReverse = bNew ? 1 : 0; } inline sal_Bool IsVertical() const; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + inline sal_Bool IsVertLR() const; + //End of SCMS inline sal_Bool GetVerticalFlag() const; inline void SetVertical( sal_Bool bNew ){ bVertical = bNew ? 1 : 0; } + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + inline void SetbVertLR( sal_Bool bNew ) { bVertLR = bNew ? 1 : 0; } + //End of SCMS inline void SetDerivedVert( sal_Bool bNew ){ bDerivedVert = bNew ? 1 : 0; } inline void SetInvalidVert( sal_Bool bNew) { bInvalidVert = bNew ? 1 : 0; } inline sal_Bool IsRightToLeft() const; @@ -571,6 +610,7 @@ public: inline void SetRightToLeft( sal_Bool bNew ){ bRightToLeft = bNew ? 1 : 0; } inline void SetDerivedR2L( sal_Bool bNew ) { bDerivedR2L = bNew ? 1 : 0; } inline void SetInvalidR2L( sal_Bool bNew ) { bInvalidR2L = bNew ? 1 : 0; } + void CheckDirChange(); // returns upper left frame position for LTR and // upper right frame position for Asian / RTL frames @@ -950,6 +990,12 @@ sal_Bool SwFrm::IsVertical() const ((SwFrm*)this)->SetDirFlags( sal_True ); return bVertical != 0; } +//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin +inline sal_Bool SwFrm::IsVertLR() const +{ + return bVertLR != 0; +} +//End of SCMS sal_Bool SwFrm::GetVerticalFlag() const { return bVertical != 0; diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 0f4a60c3fa5b..08c9f9d11e36 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -577,7 +577,13 @@ void SwFrm::MakePos() if( bReverse ) aFrm.Pos().X() += pPrv->Frm().Width(); else - aFrm.Pos().X() -= aFrm.Width(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + { + if ( bVertL2R ) + aFrm.Pos().X() += pPrv->Frm().Width(); + else + aFrm.Pos().X() -= aFrm.Width(); + } } else aFrm.Pos().Y() += pPrv->Frm().Height(); @@ -645,13 +651,15 @@ void SwFrm::MakePos() aFrm.Pos().X() += GetUpper()->Prt().Width() - aFrm.Width(); } - else if( bVert && FRM_NOTE_VERT & nMyType && !bReverse ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + else if( bVert && !bVertL2R && FRM_NOTE_VERT & nMyType && !bReverse ) aFrm.Pos().X() -= aFrm.Width() - GetUpper()->Prt().Width(); } } else aFrm.Pos().X() = aFrm.Pos().Y() = 0; - if( IsBodyFrm() && bVert && !bReverse && GetUpper() ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( IsBodyFrm() && bVert && !bVertL2R && !bReverse && GetUpper() ) aFrm.Pos().X() += GetUpper()->Prt().Width() - aFrm.Width(); bValidPos = sal_True; } @@ -873,7 +881,8 @@ void SwLayoutFrm::MakeAll() //uebernimmt im DTor die Benachrichtigung const SwLayNotify aNotify( this ); sal_Bool bVert = IsVertical(); - SwRectFn fnRect = ( IsNeighbourFrm() == bVert )? fnRectHori : fnRectVert; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + SwRectFn fnRect = ( IsNeighbourFrm() == bVert )? fnRectHori : ( IsVertLR() ? fnRectVertL2R : fnRectVert ); SwBorderAttrAccess *pAccess = 0; const SwBorderAttrs*pAttrs = 0; diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx index 854012ca9e57..df076ca751de 100644 --- a/sw/source/core/layout/colfrm.cxx +++ b/sw/source/core/layout/colfrm.cxx @@ -336,7 +336,8 @@ void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, sal_Bool bAdjustAttribut } const sal_Bool bVert = IsVertical(); - SwRectFn fnRect = bVert ? fnRectVert : fnRectHori; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori; //Ist ein Pointer da, oder sollen wir die Attribute einstellen, //so stellen wir auf jeden Fall die Spaltenbreiten ein. Andernfalls diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index dfdc9dc04c53..c6e8f4d823d8 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -1460,6 +1460,9 @@ void SwFrm::SetDirFlags( sal_Bool bVert ) { bVertical = pAsk->IsVertical() ? 1 : 0; bReverse = pAsk->IsReverse() ? 1 : 0; + + bVertLR = pAsk->IsVertLR() ? 1 : 0; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin if ( !pAsk->bInvalidVert ) bInvalidVert = sal_False; } diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 38ce56f902d4..8cd4253f6ddc 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -154,9 +154,21 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) : bDerivedR2L = 0; if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir || pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + { bVertical = 0; + bVertLR = 0; + } else + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + { bVertical = 1; + if ( FRMDIR_VERT_TOP_LEFT == nDir ) + bVertLR = 1; + else + bVertLR = 0; + } + bVert = bVertical; bInvalidR2L = 0; if( FRMDIR_HORI_RIGHT_TOP == nDir ) diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index aa0661f126b3..2a5b688e7110 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -661,13 +661,20 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, while( pUp->IsSctFrm() ) pUp = pUp->GetUpper(); const bool bVert = pUp->IsVertical(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + const bool bVertL2R = pUp->IsVertLR(); + //Dem Textflus folgen. // --> OD 2009-01-12 #i70582# + // --> OD 2009-03-05 - adopted for Support for Classical Mongolian Script const SwTwips nTopForObjPos = bVert - ? ( pCnt->Frm().Left() + - pCnt->Frm().Width() - - pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) + ? ( bVertL2R + ? ( pCnt->Frm().Left() + + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) + : ( pCnt->Frm().Left() + + pCnt->Frm().Width() - + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) ) : ( pCnt->Frm().Top() + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ); // <-- @@ -676,7 +683,13 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, // OD 26.09.2003 - <rPt> point is inside environment of given content frame // --> OD 2009-01-12 #i70582# if( bVert ) - rRet.nMain = nTopForObjPos - rPt.X(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + { + if ( bVertL2R ) + rRet.nMain = rPt.X() - nTopForObjPos; + else + rRet.nMain = nTopForObjPos - rPt.X(); + } else rRet.nMain = rPt.Y() - nTopForObjPos; // <-- @@ -701,7 +714,13 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, // OD 26.09.2003 - <rPt> point is in left border of environment // --> OD 2009-01-12 #i70582# if( bVert ) - rRet.nMain = nTopForObjPos - rPt.X(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + { + if ( bVertL2R ) + rRet.nMain = rPt.X() - nTopForObjPos; + else + rRet.nMain = nTopForObjPos - rPt.X(); + } else rRet.nMain = rPt.Y() - nTopForObjPos; // <-- @@ -712,11 +731,13 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, } else { + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin // --> OD 2009-01-12 #i70582# rRet.nMain = bVert - ? nTopForObjPos - (pUp->Frm().Left() + pUp->Prt().Left()) - : (pUp->Frm().Top() + pUp->Prt().Bottom()) - nTopForObjPos; - // <-- + ? ( bVertL2R + ? ( (pUp->Frm().Left() + pUp->Prt().Right()) - nTopForObjPos ) + : ( 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, sal_True, pCnt ); @@ -737,7 +758,11 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, { if( pLay->IsVertical() ) { - nFrmTop = pLay->Frm().Left() + pLay->Frm().Width(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( pLay->IsVertLR() ) + nFrmTop = pLay->Frm().Left(); + else + nFrmTop = pLay->Frm().Left() + pLay->Frm().Width(); nPrtHeight = pLay->Prt().Width(); } else @@ -752,9 +777,20 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, pLay = pSect->GetUpper(); if( pLay->IsVertical() ) { - nFrmTop = pSect->Frm().Left(); - nPrtHeight = pSect->Frm().Left() - pLay->Frm().Left() + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( pLay->IsVertLR() ) + { + nFrmTop = pSect->Frm().Right(); + nPrtHeight = pLay->Frm().Left() + pLay->Prt().Left() + + pLay->Prt().Width() - pSect->Frm().Left() + - pSect->Frm().Width(); + } + else + { + nFrmTop = pSect->Frm().Left(); + nPrtHeight = pSect->Frm().Left() - pLay->Frm().Left() - pLay->Prt().Left(); + } } else { @@ -770,8 +806,17 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, { if( pLay->IsVertical() ) { - nFrmTop = pLay->Frm().Left() + pLay->Frm().Width(); - nPrtHeight = pLay->Prt().Width(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( pLay->IsVertLR() ) + { + nFrmTop = pLay->Frm().Left(); + nPrtHeight = pLay->Prt().Width(); + } + else + { + nFrmTop = pLay->Frm().Left() + pLay->Frm().Width(); + nPrtHeight = pLay->Prt().Width(); + } } else { @@ -815,8 +860,17 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, pSect = pNxtSect; if( pLay->IsVertical() ) { - nFrmTop = pLay->Frm().Left() + pLay->Frm().Width(); - nPrtHeight = pLay->Prt().Width(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( pLay->IsVertLR() ) + { + nFrmTop = pLay->Frm().Left(); + nPrtHeight = pLay->Prt().Width(); + } + else + { + nFrmTop = pLay->Frm().Left() + pLay->Frm().Width(); + nPrtHeight = pLay->Prt().Width(); + } } else { @@ -829,9 +883,20 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, pLay = pSect->GetUpper(); if( pLay->IsVertical() ) { - nFrmTop = pSect->Frm().Left(); - nPrtHeight = pSect->Frm().Left() - - pLay->Frm().Left() - pLay->Prt().Left(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( pLay->IsVertLR() ) + { + nFrmTop = pSect->Frm().Right(); + nPrtHeight = pLay->Frm().Left()+pLay->Prt().Left() + + pLay->Prt().Width() - pSect->Frm().Left() + - pSect->Frm().Width(); + } + else + { + nFrmTop = pSect->Frm().Left(); + nPrtHeight = pSect->Frm().Left() - + pLay->Frm().Left() - pLay->Prt().Left(); + } } else { @@ -847,8 +912,17 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, { if( pLay->IsVertical() ) { - nFrmTop = pLay->Frm().Left() + pLay->Frm().Width(); - nPrtHeight = pLay->Prt().Width(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( pLay->IsVertLR() ) + { + nFrmTop = pLay->Frm().Left(); + nPrtHeight = pLay->Prt().Width(); + } + else + { + nFrmTop = pLay->Frm().Left() + pLay->Frm().Width(); + nPrtHeight = pLay->Prt().Width(); + } } else { @@ -863,7 +937,8 @@ const SwFrm * MA_FASTCALL lcl_CalcDownDist( SwDistance &rRet, { if ( pLay->Frm().IsInside( rPt ) ) { - SwTwips nDiff = pLay->IsVertical() ? ( nFrmTop - rPt.X() ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + SwTwips nDiff = pLay->IsVertical() ? ( pLay->IsVertLR() ? ( rPt.X() - nFrmTop ) : ( nFrmTop - rPt.X() ) ) : ( rPt.Y() - nFrmTop ); if( bSct || pSect ) rRet.nSub += nDiff; @@ -1219,9 +1294,8 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) SwPageFrm *pOldPage = FindPageFrm(); const SwRect aOld( GetObjRectWithSpaces() ); Point aNew( rNew ); - - if( GetAnchorFrm()->IsVertical() || GetAnchorFrm()->IsRightToLeft() ) - + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( ( GetAnchorFrm()->IsVertical() && !GetAnchorFrm()->IsVertLR() ) || GetAnchorFrm()->IsRightToLeft() ) aNew.X() += Frm().Width(); SwCntntFrm *pCnt = (SwCntntFrm*)::FindAnchor( GetAnchorFrm(), aNew ); if( pCnt->IsProtected() ) @@ -1229,6 +1303,8 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) SwPageFrm *pTmpPage = 0; const bool bVert = pCnt->IsVertical(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + const bool bVertL2R = pCnt->IsVertLR(); const sal_Bool bRTL = pCnt->IsRightToLeft(); if( ( !bVert != !GetAnchorFrm()->IsVertical() ) || @@ -1261,14 +1337,21 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) // --> OD 2009-01-12 #i70582# const SwTwips nTopForObjPos = bVert - ? ( pCnt->Frm().Left() + - pCnt->Frm().Width() - - pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) + ? ( bVertL2R + ? ( pCnt->Frm().Left() + + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) + : ( pCnt->Frm().Left() + + pCnt->Frm().Width() - + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) ) : ( pCnt->Frm().Top() + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ); - if ( bVert ) + if( bVert ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin { - nY = nTopForObjPos - rNew.X() - Frm().Width(); + if ( bVertL2R ) + nY = rNew.X() - nTopForObjPos; + else + nY = nTopForObjPos - rNew.X() - Frm().Width(); } else { @@ -1302,8 +1385,14 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) do { const SwFrm *pUp = pFollow->GetUpper(); if( pUp->IsVertical() ) - nDiff += pFollow->Frm().Left() + pFollow->Frm().Width() - - pUp->Frm().Left() - pUp->Prt().Left(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + { + if ( pUp->IsVertLR() ) + nDiff += pUp->Prt().Width() - pFollow->GetRelPos().X(); + else + nDiff += pFollow->Frm().Left() + pFollow->Frm().Width() + - pUp->Frm().Left() - pUp->Prt().Left(); + } else nDiff += pUp->Prt().Height() - pFollow->GetRelPos().Y(); pFollow = pFollow->GetFollow(); @@ -1320,14 +1409,21 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) // --> OD 2009-01-12 #i70582# const SwTwips nTopForObjPos = bVert - ? ( pCnt->Frm().Left() + - pCnt->Frm().Width() - - pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) + ? ( bVertL2R + ? ( pCnt->Frm().Left() + + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) + : ( pCnt->Frm().Left() + + pCnt->Frm().Width() - + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ) ) : ( pCnt->Frm().Top() + pCnt->GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() ); - if ( bVert ) + if( bVert ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin { - nY = nTopForObjPos - rNew.X(); + if ( bVertL2R ) + nY = rNew.X() - nTopForObjPos; + else + nY = nTopForObjPos - rNew.X(); } else { @@ -1421,6 +1517,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) GetPageFrm()->MoveFly( this, pTmpPage ); const Point aRelPos = bVert ? Point( -nY, nX ) : Point( nX, nY ); + ChgRelPos( aRelPos ); GetFmt()->GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index aacb9dcadd66..08dee8d2e40e 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -421,7 +421,8 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool ) if ( !bTst ) { (Frm().*fnRect->fnSetHeight)( (Frm().*fnRect->fnGetHeight)() + nDist ); - if( IsVertical() && !IsReverse() ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( IsVertical() && !IsVertLR() && !IsReverse() ) Frm().Pos().X() -= nDist; } long nGrow = nDist - nAvail, @@ -463,7 +464,8 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool ) nDist -= nReal; //Den masslosen Wunsch koennen wir leider nur in Grenzen erfuellen. Frm().SSize().Height() -= nDist; - if( IsVertical() && !IsReverse() ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( IsVertical() && !IsVertLR() && !IsReverse() ) Frm().Pos().X() += nDist; } diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 762c1caa3d84..1608425d94ab 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -1648,13 +1648,21 @@ sal_Bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly ) bChanged = aOldRect != pFly->Frm(); if ( IsPaint() && (pFly->IsCompletePaint() || bChanged) && - pFly->Frm().Top() > 0 && pFly->Frm().Left() > 0 ) + pFly->Frm().Top() > 0 && pFly->Frm().Left() > 0 ) pImp->GetShell()->AddPaintRect( pFly->Frm() ); if ( bChanged ) pFly->Invalidate(); else pFly->Validate(); +/* + //mba: it's unclear why we should invalidate always, so I remove it + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( IsPaint() && bAddRect && pFly->Frm().Top() > 0 && pFly->Frm().Left() > 0 ) + pImp->GetShell()->AddPaintRect( pFly->Frm() ); + + pFly->Invalidate(); +*/ bAddRect = false; pFly->ResetCompletePaint(); } diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 512998248fe1..9da088849559 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -290,9 +290,67 @@ static SwRectFnCollection aVerticalRightToLeft = { &SwRect::SetBottomAndHeight, &SwRect::SetLeftAndWidth }; +//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin +static SwRectFnCollection aVerticalLeftToRight = { + /* fnRectGet */ + &SwRect::_Left, + &SwRect::_Right, + &SwRect::_Top, + &SwRect::_Bottom, + &SwRect::_Height, + &SwRect::_Width, + &SwRect::TopLeft, + &SwRect::SwappedSize, + /* fnRectSet */ + &SwRect::_Left, + &SwRect::_Right, + &SwRect::_Top, + &SwRect::_Bottom, + &SwRect::_Height, + &SwRect::_Width, + + &SwRect::SubLeft, + &SwRect::AddRight, + &SwRect::SubTop, + &SwRect::AddBottom, + &SwRect::AddHeight, + &SwRect::AddWidth, + + &SwRect::SetPosY, + &SwRect::SetPosX, + &SwFrm::GetLeftMargin, + &SwFrm::GetRightMargin, + &SwFrm::GetTopMargin, + &SwFrm::GetBottomMargin, + &SwFrm::SetTopBottomMargins, + &SwFrm::SetLeftRightMargins, + &SwFrm::GetPrtLeft, + &SwFrm::GetPrtRight, + &SwFrm::GetPrtTop, + &SwFrm::GetPrtBottom, + &SwRect::GetLeftDistance, + &SwRect::GetRightDistance, + &SwRect::GetTopDistance, + &SwRect::GetBottomDistance, + &SwFrm::SetMaxRight, + &SwRect::OverStepRight, + + &SwRect::SetUpperLeftCorner, + &SwFrm::MakeRightPos, + &FirstMinusSecond, + &FirstMinusSecond, + &SwIncrement, + &SwIncrement, + &SwRect::SetTopAndHeight, + &SwRect::SetLeftAndWidth +}; +//End of SCMS SwRectFn fnRectHori = &aHorizontal; SwRectFn fnRectVert = &aVertical; +//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin +SwRectFn fnRectVertL2R = &aVerticalLeftToRight; +//End of SCMS SwRectFn fnRectB2T = &aBottomToTop; SwRectFn fnRectVL2R = &aVerticalRightToLeft; diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index d17940a1fec3..9792fc09ed42 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -131,7 +131,8 @@ void SwBodyFrm::Format( const SwBorderAttrs * ) if ( nHeight < 0 ) nHeight = 0; Frm().Height( nHeight ); - if( IsVertical() && !IsReverse() && nWidth != Frm().Width() ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( IsVertical() && !IsVertLR() && !IsReverse() && nWidth != Frm().Width() ) Frm().Pos().X() += Frm().Width() - nWidth; Frm().Width( nWidth ); } @@ -342,9 +343,19 @@ void SwPageFrm::CheckDirection( sal_Bool bVert ) { if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir || GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + { bVertical = 0; + bVertLR = 0; + } else + { bVertical = 1; + if(FRMDIR_VERT_TOP_RIGHT == nDir) + bVertLR = 0; + else if(FRMDIR_VERT_TOP_LEFT==nDir) + bVertLR = 1; + } /* if( pDesc && pDesc->GetName().GetChar(0)=='x') bReverse = 1; diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index fa767ec36958..e0f4914da529 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1214,7 +1214,9 @@ void MA_FASTCALL lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm, if ( rAttrs.IsLine() || rAttrs.IsBorderDist() || (bShadow && rAttrs.GetShadow().GetLocation() != SVX_SHADOW_NONE) ) { - SwRectFn fnRect = pFrm->IsVertical() ? fnRectVert : fnRectHori; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + SwRectFn fnRect = pFrm->IsVertical() ? ( pFrm->IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori; + const SvxBoxItem &rBox = rAttrs.GetBox(); const sal_Bool bTop = 0 != (pFrm->*fnRect->fnGetTopMargin)(); if ( bTop ) @@ -3168,8 +3170,17 @@ SwShortCut::SwShortCut( const SwFrm& rFrm, const SwRect& rRect ) } else { - fnCheck = &SwRect::GetRightDistance; - nLimit = rRect.Left(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( rFrm.IsVertLR() ) + { + fnCheck = &SwRect::GetLeftDistance; + nLimit = rRect.Right(); + } + else + { + fnCheck = &SwRect::GetRightDistance; + nLimit = rRect.Left(); + } } } @@ -4880,8 +4891,9 @@ void SwLayoutFrm::PaintColLines( const SwRect &rRect, const SwFmtCol &rFmtCol, const SwFrm *pCol = Lower(); if ( !pCol || !pCol->IsColumnFrm() ) return; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + SwRectFn fnRect = pCol->IsVertical() ? ( pCol->IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori; - SwRectFn fnRect = pCol->IsVertical() ? fnRectVert : fnRectHori; SwRect aLineRect = Prt(); aLineRect += Frm().Pos(); diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index fd0a0ce1f838..512c45a67b41 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -230,7 +230,9 @@ void SwFrm::CheckDirChange() SetInvalidVert( sal_True ); SetInvalidR2L( sal_True ); sal_Bool bChg = bOldR2L != IsRightToLeft(); - if( ( IsVertical() != bOldVert ) || bChg || IsReverse() != bOldRev ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + sal_Bool bOldVertL2R = IsVertLR(); + if( ( IsVertical() != bOldVert ) || bChg || IsReverse() != bOldRev || bOldVertL2R != IsVertLR() ) { InvalidateAll(); if( IsLayoutFrm() ) @@ -324,7 +326,8 @@ void SwFrm::CheckDirChange() Point SwFrm::GetFrmAnchorPos( sal_Bool bIgnoreFlysAnchoredAtThisFrame ) const { Point aAnchor = Frm().Pos(); - if ( IsVertical() || IsRightToLeft() ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( ( IsVertical() && !IsVertLR() ) || IsRightToLeft() ) aAnchor.X() += Frm().Width(); if ( IsTxtFrm() ) @@ -612,7 +615,8 @@ const SwRect SwFrm::PaintArea() const // Cell frames may not leave their upper: SwRect aRect = IsRowFrm() ? GetUpper()->Frm() : Frm(); const sal_Bool bVert = IsVertical(); - SwRectFn fnRect = bVert ? fnRectVert : fnRectHori; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori; long nRight = (aRect.*fnRect->fnGetRight)(); long nLeft = (aRect.*fnRect->fnGetLeft)(); const SwFrm* pTmp = this; @@ -711,7 +715,8 @@ const SwRect SwFrm::PaintArea() const const SwRect SwFrm::UnionFrm( sal_Bool bBorder ) const { sal_Bool bVert = IsVertical(); - SwRectFn fnRect = bVert ? fnRectVert : fnRectHori; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori; long nLeft = (Frm().*fnRect->fnGetLeft)(); long nWidth = (Frm().*fnRect->fnGetWidth)(); long nPrtLeft = (Prt().*fnRect->fnGetLeft)(); diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index f0d67a191ded..90a3656d1ab7 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -4778,7 +4778,8 @@ SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) { SwTwips nHeight = (Frm().*fnRect->fnGetHeight)(); (Frm().*fnRect->fnSetHeight)( nHeight - nReal ); - if( IsVertical() && !bRev ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( IsVertical() && !IsVertLR() && !bRev ) Frm().Pos().X() += nReal; } @@ -4792,7 +4793,8 @@ SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) nReal -= nTmp; SwTwips nHeight = (Frm().*fnRect->fnGetHeight)(); (Frm().*fnRect->fnSetHeight)( nHeight + nReal ); - if( IsVertical() && !bRev ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( IsVertical() && !IsVertLR() && !bRev ) Frm().Pos().X() -= nReal; } nReal = nTmp; diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index c295e6d4542c..c04b13e3c3e5 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -2564,7 +2564,8 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode ) //At least the endframe... bVert = pEndFrm->IsVertical(); bRev = pEndFrm->IsReverse(); - fnRect = bVert ? ( bRev ? fnRectVL2R : fnRectVert ) : + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + fnRect = bVert ? ( bRev ? fnRectVL2R : ( pEndFrm->IsVertLR() ? fnRectVertL2R : fnRectVert ) ) : ( bRev ? fnRectB2T : fnRectHori ); nTmpTwips = (aEndRect.*fnRect->fnGetTop)(); if( (aEndFrm.*fnRect->fnGetTop)() != nTmpTwips ) diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 9909b6147d83..4ebca620e4e2 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -108,7 +108,9 @@ SwFrm::SwFrm( SwModify *pMod ) : ASSERT( pMod, "Kein Frameformat uebergeben." ); bInvalidR2L = bInvalidVert = 1; - bDerivedR2L = bDerivedVert = bRightToLeft = bVertical = bReverse = 0; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + bDerivedR2L = bDerivedVert = bRightToLeft = bVertical = bReverse = bVertLR = 0; + bValidPos = bValidPrtArea = bValidSize = bValidLineNum = bRetouche = bFixSize = bColLocked = sal_False; bCompletePaint = bInfInvalid = sal_True; @@ -138,9 +140,19 @@ void SwFrm::CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_B bInvalidVert = 0; if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir || bBrowse ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + { bVertical = 0; + bVertLR = 0; + } else + { bVertical = 1; + if(FRMDIR_VERT_TOP_RIGHT == nDir) + bVertLR = 0; + else if(FRMDIR_VERT_TOP_LEFT==nDir) + bVertLR = 1; + } } else { @@ -1134,9 +1146,12 @@ void SwLayoutFrm::Paste( SwFrm* pParent, SwFrm* pSibling) if ( IsHeaderFrm() || IsFooterFrm() ) fnRect = fnRectHori; else if ( IsCellFrm() || IsColumnFrm() ) - fnRect = GetUpper()->IsVertical() ? fnRectHori : fnRectVert; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + fnRect = GetUpper()->IsVertical() ? fnRectHori : ( GetUpper()->IsVertLR() ? fnRectVertL2R : fnRectVert ); else - fnRect = GetUpper()->IsVertical() ? fnRectVert : fnRectHori; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + fnRect = GetUpper()->IsVertical() ? ( GetUpper()->IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori; + if( (Frm().*fnRect->fnGetWidth)() != (pParent->Prt().*fnRect->fnGetWidth)()) _InvalidateSize(); @@ -1621,7 +1636,8 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst ) if ( !bTst ) { (pFrm->GetNext()->Frm().*fnRect->fnSetHeight)(nAddMax-nAdd); - if( bVert && !bRev ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( bVert && !bVertL2R && !bRev ) pFrm->GetNext()->Frm().Pos().X() += nAdd; pFrm->GetNext()->InvalidatePrt(); if ( pFrm->GetNext()->GetNext() ) @@ -1635,7 +1651,8 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst ) { SwTwips nTmp = (pFrm->Frm().*fnRect->fnGetHeight)(); (pFrm->Frm().*fnRect->fnSetHeight)( nTmp - nReal ); - if( bVert && !bRev ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( bVert && !bVertL2R && !bRev ) pFrm->Frm().Pos().X() += nReal; pFrm->InvalidatePrt(); if ( pFrm->GetNext() ) @@ -1896,7 +1913,8 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) if ( !bTst ) { (Frm().*fnRect->fnSetHeight)( nFrmHeight + nDist ); - if( IsVertical() && !IsReverse() ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( IsVertical() && !IsVertLR() && !IsReverse() ) Frm().Pos().X() -= nDist; if ( GetNext() ) { @@ -1928,7 +1946,8 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) //Cntnts werden immer auf den gewuenschten Wert gebracht. long nOld = (Frm().*fnRect->fnGetHeight)(); (Frm().*fnRect->fnSetHeight)( nOld + nDist ); - if( IsVertical() && !IsReverse() ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( IsVertical()&& !IsVertLR() && !IsReverse() ) Frm().Pos().X() -= nDist; if ( nOld && IsInTab() ) { @@ -2024,7 +2043,8 @@ SwTwips SwCntntFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) else nRstHeight = nDist; (Frm().*fnRect->fnSetHeight)( (Frm().*fnRect->fnGetHeight)() - nDist ); - if( IsVertical() ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( IsVertical() && !IsVertLR() ) Frm().Pos().X() += nDist; nDist = nRstHeight; if ( IsInTab() ) @@ -2443,7 +2463,8 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) if ( !bTst ) { (Frm().*fnRect->fnSetHeight)( nFrmHeight + nDist ); - if( bChgPos ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( bChgPos && !IsVertLR() ) Frm().Pos().X() -= nDist; bMoveAccFrm = sal_True; } @@ -2524,7 +2545,8 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) ( !IsCellFrm() || static_cast<SwCellFrm*>(this)->GetLayoutRowSpan() > 1 ) ) { (Frm().*fnRect->fnSetHeight)( nFrmHeight + nReal ); - if( bChgPos ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( bChgPos && !IsVertLR() ) Frm().Pos().X() = nFrmPos - nReal; bMoveAccFrm = sal_True; } @@ -2615,7 +2637,8 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) if ( !bTst ) { (Frm().*fnRect->fnSetHeight)( nFrmHeight - nReal ); - if( bChgPos ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( bChgPos && !IsVertLR() ) Frm().Pos().X() += nReal; bMoveAccFrm = sal_True; } @@ -2636,7 +2659,8 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) { (Frm().*fnRect->fnSetHeight)( (Frm().*fnRect->fnGetHeight)() + nRealDist - nReal ); - if( bChgPos ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( bChgPos && !IsVertLR() ) Frm().Pos().X() += nRealDist - nReal; ASSERT( !IsAccessibleFrm(), "bMoveAccFrm has to be set!" ); } @@ -2649,7 +2673,8 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) { (Frm().*fnRect->fnSetHeight)( (Frm().*fnRect->fnGetHeight)() + nReal - nTmp ); - if( bChgPos ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( bChgPos && !IsVertLR() ) Frm().Pos().X() += nTmp - nReal; ASSERT( !IsAccessibleFrm(), "bMoveAccFrm has to be set!" ); nReal = nTmp; @@ -3169,7 +3194,8 @@ void SwLayoutFrm::Format( const SwBorderAttrs *pAttrs ) const sal_uInt16 nRight = (sal_uInt16)((SwBorderAttrs*)pAttrs)->CalcRight( this ); const sal_uInt16 nLower = pAttrs->CalcBottom(); sal_Bool bVert = IsVertical() && !IsPageFrm(); - SwRectFn fnRect = bVert ? fnRectVert : fnRectHori; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori; if ( !bValidPrtArea ) { bValidPrtArea = sal_True; diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index cf3017426f31..dc8fe3ad9fdd 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -375,7 +375,12 @@ SwTwips SwAnchoredObjectPosition::_GetVertRelPos( break; case text::VertOrientation::TOP: { - nRelPosY += bVert ? _rLRSpacing.GetRight() : _rULSpacing.GetUpper(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + nRelPosY += bVert + ? ( bVertL2R + ? _rLRSpacing.GetLeft() + : _rLRSpacing.GetRight() ) + : _rULSpacing.GetUpper(); } break; case text::VertOrientation::CENTER: @@ -385,8 +390,13 @@ SwTwips SwAnchoredObjectPosition::_GetVertRelPos( break; case text::VertOrientation::BOTTOM: { + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin nRelPosY += nAlignAreaHeight - - ( nObjHeight + ( bVert ? _rLRSpacing.GetLeft() : _rULSpacing.GetLower() ) ); + ( nObjHeight + ( bVert + ? ( bVertL2R + ? _rLRSpacing.GetRight() + : _rLRSpacing.GetLeft() ) + : _rULSpacing.GetLower() ) ); } break; default: @@ -405,21 +415,23 @@ SwTwips SwAnchoredObjectPosition::_GetVertRelPos( /** adjust calculated vertical in order to keep object inside 'page' alignment layout frame. - OD 2004-07-01 #i28701# - parameter <_nTopOfAnch> and <_bVert> added - OD 2004-07-22 #i31805# - add parameter <_bCheckBottom> - OD 2004-10-08 #i26945# - add parameter <_bFollowTextFlow> + OD 2004-07-01 #i28701# - parameter <nTopOfAnch> and <bVert> added + OD 2004-07-22 #i31805# - add parameter <bCheckBottom> + OD 2004-10-08 #i26945# - add parameter <bFollowTextFlow> OD 2006-03-15 #i62875# - method now private and renamed. + OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R> @author OD */ -SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips _nTopOfAnch, - const bool _bVert, - const SwFrm& _rPageAlignLayFrm, - const SwTwips _nProposedRelPosY, - const bool _bFollowTextFlow, - const bool _bCheckBottom ) const +SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnch, + const bool bVert, + const bool bVertL2R, + const SwFrm& rPageAlignLayFrm, + const SwTwips nProposedRelPosY, + const bool bFollowTextFlow, + const bool bCheckBottom ) const { - SwTwips nAdjustedRelPosY = _nProposedRelPosY; + SwTwips nAdjustedRelPosY = nProposedRelPosY; const Size aObjSize( GetAnchoredObj().GetObjRect().SSize() ); @@ -436,57 +448,67 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips _nTopOfAn // --> OD 2004-10-08 #i26945# - no extension of restricted area, if // object's attribute follow text flow is set and its inside a table if ( GetFrmFmt().getIDocumentSettingAccess()->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION) && - ( !_bFollowTextFlow || + ( !bFollowTextFlow || !GetAnchoredObj().GetAnchorFrm()->IsInTab() ) ) { - aPgAlignArea = _rPageAlignLayFrm.FindPageFrm()->Frm(); + aPgAlignArea = rPageAlignLayFrm.FindPageFrm()->Frm(); } else { - aPgAlignArea = _rPageAlignLayFrm.Frm(); + aPgAlignArea = rPageAlignLayFrm.Frm(); } } - if ( _bVert ) + if ( bVert ) { - // OD 2004-07-22 #i31805# - consider value of <_bCheckBottom> - if ( _bCheckBottom && - _nTopOfAnch - nAdjustedRelPosY - aObjSize.Width() < - aPgAlignArea.Left() ) + // --> OD 2009-09-01 #mongolianlayout# + if ( !bVertL2R ) + // <-- { - nAdjustedRelPosY = aPgAlignArea.Left() + - _nTopOfAnch - - aObjSize.Width(); + if ( bCheckBottom && + nTopOfAnch - nAdjustedRelPosY - aObjSize.Width() < + aPgAlignArea.Left() ) + { + nAdjustedRelPosY = aPgAlignArea.Left() + + nTopOfAnch - + aObjSize.Width(); + } + if ( nTopOfAnch - nAdjustedRelPosY > aPgAlignArea.Right() ) + { + nAdjustedRelPosY = nTopOfAnch - aPgAlignArea.Right(); + } } - // --> OD 2004-08-13 #i32964# - correction - if ( _nTopOfAnch - nAdjustedRelPosY > aPgAlignArea.Right() ) + // --> OD 2009-09-01 #mongolianlayout# + else { - nAdjustedRelPosY = _nTopOfAnch - aPgAlignArea.Right(); + if ( bCheckBottom && + nTopOfAnch + nAdjustedRelPosY + aObjSize.Width() > + aPgAlignArea.Right() ) + { + nAdjustedRelPosY = aPgAlignArea.Right() - + nTopOfAnch - + aObjSize.Width(); + } + if ( nTopOfAnch + nAdjustedRelPosY < aPgAlignArea.Left() ) + { + nAdjustedRelPosY = aPgAlignArea.Left() - nTopOfAnch; + } } // <-- } else { - // OD 2004-07-22 #i31805# - consider value of <_bCheckBottom> - if ( _bCheckBottom && - _nTopOfAnch + nAdjustedRelPosY + aObjSize.Height() > - // --> OD 2006-01-13 #129959# - // Do not mix usage of <top + height> and <bottom> -// aPgAlignArea.Bottom() ) + if ( bCheckBottom && + nTopOfAnch + nAdjustedRelPosY + aObjSize.Height() > aPgAlignArea.Top() + aPgAlignArea.Height() ) - // <-- { - // --> OD 2006-01-13 #129959# - // Do not mix usage of <top + height> and <bottom> -// nAdjustedRelPosY = aPgAlignArea.Bottom() - nAdjustedRelPosY = aPgAlignArea.Top() + aPgAlignArea.Height() - - // <-- - _nTopOfAnch - + nTopOfAnch - aObjSize.Height(); } - if ( _nTopOfAnch + nAdjustedRelPosY < aPgAlignArea.Top() ) + if ( nTopOfAnch + nAdjustedRelPosY < aPgAlignArea.Top() ) { - nAdjustedRelPosY = aPgAlignArea.Top() - _nTopOfAnch; + nAdjustedRelPosY = aPgAlignArea.Top() - nTopOfAnch; } } 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() ); } diff --git a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx index 729a1eabaded..cf02ed8e45cd 100644 --- a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx @@ -120,7 +120,11 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() if( bVert ) { ASSERT( !bRev, "<SwToLayoutAnchoredObjectPosition::CalcPosition()> - reverse layout set." ); - aRelPos.X() = -nRelPosY - aObjBoundRect.Width(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( bVertL2R ) + aRelPos.X() = nRelPosY; + else + aRelPos.X() = -nRelPosY - aObjBoundRect.Width(); maOffsetToFrmAnchorPos.X() = nVertOffsetToFrmAnchorPos; } else @@ -204,8 +208,12 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() // determine absolute 'horizontal' position, depending on layout-direction // --> OD 2004-06-17 #i26791# - determine offset to 'horizontal' frame // anchor position, depending on layout-direction - if ( bVert ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + // --> OD 2009-09-04 #mongolianlayout# + if( bVert || bVertL2R ) + // <-- { + aRelPos.Y() = nRelPosX; maOffsetToFrmAnchorPos.Y() = nOffset; } diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index 37fb9fbc5747..810efc66f1da 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -224,8 +224,9 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, const SwTwips nFrmMaxY = (pFrm->*fnRect->fnGetPrtBottom)(); // nMaxY is an absolute value + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin SwTwips nMaxY = bVert ? - Max( nFrmMaxY, nUpperMaxY ) : + ( bVertL2R ? Min( nFrmMaxY, nUpperMaxY ) : Max( nFrmMaxY, nUpperMaxY ) ) : Min( nFrmMaxY, nUpperMaxY ); sal_Bool bRet = sal_False; @@ -242,8 +243,8 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, { if( nFirstOffset > 0 ) aPnt1.Y() += nFirstOffset; - - if ( aPnt1.X() < nMaxY ) + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( aPnt1.X() < nMaxY && !bVertL2R ) aPnt1.X() = nMaxY; aPnt2.X() = aPnt1.X() + pFrm->Prt().Width(); aPnt2.Y() = aPnt1.Y(); @@ -396,8 +397,9 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const SwTwips nUpperMaxY = (pTmpFrm->*fnRect->fnGetPrtBottom)(); // nMaxY is in absolute value + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin SwTwips nMaxY = bVert ? - Max( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) : + ( bVertL2R ? Min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) : Max( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) ) : Min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ); if ( pFrm->IsEmpty() || ! (pFrm->Prt().*fnRect->fnGetHeight)() ) @@ -406,8 +408,9 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const Point aPnt2; if ( bVert ) { - if ( aPnt1.X() < nMaxY ) + if ( aPnt1.X() < nMaxY && !bVertL2R ) aPnt1.X() = nMaxY; + aPnt2.X() = aPnt1.X() + pFrm->Prt().Width(); aPnt2.Y() = aPnt1.Y(); if( aPnt2.X() < nMaxY ) diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 27473ccac4fc..4fac26a7a08d 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -482,9 +482,17 @@ void SwTxtFrm::AdjustFrm( const SwTwips nChgHght, sal_Bool bHasToFit ) if ( IsVertical() ) { ASSERT( ! IsSwapped(),"Swapped frame while calculating nRstHeight" ); - nRstHeight = Frm().Left() + Frm().Width() - - ( GetUpper()->Frm().Left() + GetUpper()->Prt().Left() ); - } + + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( IsVertLR() ) + nRstHeight = GetUpper()->Frm().Left() + + GetUpper()->Prt().Left() + + GetUpper()->Prt().Width() + - Frm().Left(); + else + nRstHeight = Frm().Left() + Frm().Width() - + ( GetUpper()->Frm().Left() + GetUpper()->Prt().Left() ); + } else nRstHeight = GetUpper()->Frm().Top() + GetUpper()->Prt().Top() @@ -1137,7 +1145,9 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine, // If the frame grows (or shirks) the repaint rectangle cannot simply // be rotated back after formatting, because we use the upper left point // of the frame for rotation. This point changes when growing/shrinking. - if ( IsVertical() && nChg ) + + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( IsVertical() && !IsVertLR() && nChg ) { SwRect &rRepaint = *(pPara->GetRepaint()); rRepaint.Left( rRepaint.Left() - nChg ); diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index 369109efb918..d9f9597d472c 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -448,6 +448,10 @@ SwRect SwTxtFrm::Paint() // d.h. als linken Rand den berechneten PaintOfst! SwRepaint *pRepaint = GetPara()->GetRepaint(); long l; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( IsVertLR() ) // mba: the following line was added, but we don't need it for the existing directions; kept for IsVertLR(), but should be checked + pRepaint->Chg( ( GetUpper()->Frm() ).Pos() + ( GetUpper()->Prt() ).Pos(), ( GetUpper()->Prt() ).SSize() ); + if( pRepaint->GetOfst() ) pRepaint->Left( pRepaint->GetOfst() ); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index c8300820a8f2..557d44045d95 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -814,7 +814,11 @@ void SwTxtPaintInfo::CalcRect( const SwLinePortion& rPor, else { aPoint.A() = X(); - aPoint.B() = Y() - rPor.GetAscent(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( GetTxtFrm()->IsVertLR() ) + aPoint.B() = Y() - rPor.Height() + rPor.GetAscent(); + else + aPoint.B() = Y() - rPor.GetAscent(); } // Adjust x coordinate if we are inside a bidi portion diff --git a/sw/source/core/text/itrtxt.cxx b/sw/source/core/text/itrtxt.cxx index 798faee0d58d..c042634eaf60 100644 --- a/sw/source/core/text/itrtxt.cxx +++ b/sw/source/core/text/itrtxt.cxx @@ -367,7 +367,11 @@ sal_uInt16 SwTxtCursor::AdjustBaseLine( const SwLineLayout& rLine, case SvxParaVertAlignItem::AUTOMATIC : if ( bAutoToCentered || GetInfo().GetTxtFrm()->IsVertical() ) { - nOfst += ( rLine.Height() - nPorHeight ) / 2 + nPorAscent; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( GetInfo().GetTxtFrm()->IsVertLR() ) + nOfst += rLine.Height() - ( rLine.Height() - nPorHeight ) / 2 - nPorAscent; + else + nOfst += ( rLine.Height() - nPorHeight ) / 2 + nPorAscent; break; } case SvxParaVertAlignItem::BASELINE : diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 125f3f52908f..25b425df729c 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -104,13 +104,22 @@ void SwTxtFrm::SwapWidthAndHeight() { const long nPrtOfstX = Prt().Pos().X(); Prt().Pos().X() = Prt().Pos().Y(); - Prt().Pos().Y() = Frm().Width() - ( nPrtOfstX + Prt().Width() ); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( IsVertLR() ) + Prt().Pos().Y() = nPrtOfstX; + else + Prt().Pos().Y() = Frm().Width() - ( nPrtOfstX + Prt().Width() ); + } else { const long nPrtOfstY = Prt().Pos().Y(); Prt().Pos().Y() = Prt().Pos().X(); - Prt().Pos().X() = Frm().Height() - ( nPrtOfstY + Prt().Height() ); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if( IsVertLR() ) + Prt().Pos().X() = nPrtOfstY; + else + Prt().Pos().X() = Frm().Height() - ( nPrtOfstY + Prt().Height() ); } const long nFrmWidth = Frm().Width(); @@ -128,16 +137,33 @@ void SwTxtFrm::SwapWidthAndHeight() void SwTxtFrm::SwitchHorizontalToVertical( SwRect& rRect ) const { // calc offset inside frame - const long nOfstX = rRect.Left() - Frm().Left(); - const long nOfstY = rRect.Top() + rRect.Height() - Frm().Top(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + long nOfstX, nOfstY; + if ( IsVertLR() ) + { + nOfstX = rRect.Left() - Frm().Left(); + nOfstY = rRect.Top() - Frm().Top(); + } + else + { + nOfstX = rRect.Left() - Frm().Left(); + nOfstY = rRect.Top() + rRect.Height() - Frm().Top(); + } + const long nWidth = rRect.Width(); const long nHeight = rRect.Height(); - if ( bIsSwapped ) - rRect.Left( Frm().Left() + Frm().Height() - nOfstY ); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( IsVertLR() ) + rRect.Left(Frm().Left() + nOfstY); else - // frame is rotated - rRect.Left( Frm().Left() + Frm().Width() - nOfstY ); + { + if ( bIsSwapped ) + rRect.Left( Frm().Left() + Frm().Height() - nOfstY ); + else + // frame is rotated + rRect.Left( Frm().Left() + Frm().Width() - nOfstY ); + } rRect.Top( Frm().Top() + nOfstX ); rRect.Width( nHeight ); @@ -151,12 +177,17 @@ void SwTxtFrm::SwitchHorizontalToVertical( Point& rPoint ) const // calc offset inside frame const long nOfstX = rPoint.X() - Frm().Left(); const long nOfstY = rPoint.Y() - Frm().Top(); - - if ( bIsSwapped ) - rPoint.X() = Frm().Left() + Frm().Height() - nOfstY; + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( IsVertLR() ) + rPoint.X() = Frm().Left() + nOfstY; else - // calc rotated coords - rPoint.X() = Frm().Left() + Frm().Width() - nOfstY; + { + if ( bIsSwapped ) + rPoint.X() = Frm().Left() + Frm().Height() - nOfstY; + else + // calc rotated coords + rPoint.X() = Frm().Left() + Frm().Width() - nOfstY; + } rPoint.Y() = Frm().Top() + nOfstX; } @@ -177,10 +208,17 @@ void SwTxtFrm::SwitchVerticalToHorizontal( SwRect& rRect ) const long nOfstX; // calc offset inside frame - if ( bIsSwapped ) - nOfstX = Frm().Left() + Frm().Height() - ( rRect.Left() + rRect.Width() ); + + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( IsVertLR() ) + nOfstX = rRect.Left() - Frm().Left(); else - nOfstX = Frm().Left() + Frm().Width() - ( rRect.Left() + rRect.Width() ); + { + if ( bIsSwapped ) + nOfstX = Frm().Left() + Frm().Height() - ( rRect.Left() + rRect.Width() ); + else + nOfstX = Frm().Left() + Frm().Width() - ( rRect.Left() + rRect.Width() ); + } const long nOfstY = rRect.Top() - Frm().Top(); const long nWidth = rRect.Height(); @@ -200,10 +238,17 @@ void SwTxtFrm::SwitchVerticalToHorizontal( Point& rPoint ) const long nOfstX; // calc offset inside frame - if ( bIsSwapped ) - nOfstX = Frm().Left() + Frm().Height() - rPoint.X(); + + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + if ( IsVertLR() ) + nOfstX = rPoint.X() - Frm().Left(); else - nOfstX = Frm().Left() + Frm().Width() - rPoint.X(); + { + if ( bIsSwapped ) + nOfstX = Frm().Left() + Frm().Height() - rPoint.X(); + else + nOfstX = Frm().Left() + Frm().Width() - rPoint.X(); + } const long nOfstY = rPoint.Y() - Frm().Top(); @@ -2547,6 +2592,12 @@ void SwTxtFrm::ChgThisLines() else //Paragraphs which are not counted should not manipulate the AllLines. nThisLines = nNew; } + + //mba: invalidating is not necessary; if mongolian script has a problem, it should be fixed at the ritgh place + //with invalidating we probably get too much flickering + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + //Ugly. How can we hack if better? + //InvalidatePage(); } diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 4a715ba3b27b..a83fe42c265d 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -140,7 +140,12 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto ) nLinePos - nTabPos : nLinePos + nTabPos; - SwTwips nMyRight = Right(); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + SwTwips nMyRight; + if ( pFrm->IsVertLR() ) + nMyRight = Left(); + else + nMyRight = Right(); if ( pFrm->IsVertical() ) { diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx index d5a45beb41d1..f0fe98e44987 100644 --- a/sw/source/core/text/widorp.cxx +++ b/sw/source/core/text/widorp.cxx @@ -222,9 +222,17 @@ void SwTxtFrmBreak::SetRstHeight( const SwTxtMargin &rLine ) { // OD, FME 2004-02-27 #106629# - consider bottom margin SWRECTFN( pFrm ) + nRstHeight = (pFrm->*fnRect->fnGetBottomMargin)(); + if ( bVert ) - nRstHeight += nOrigin - pFrm->SwitchHorizontalToVertical( rLine.Y() ); + //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin + { + if ( pFrm->IsVertLR() ) + nRstHeight = (*fnRect->fnYDiff)( pFrm->SwitchHorizontalToVertical( rLine.Y() ) , nOrigin ); + else + nRstHeight += nOrigin - pFrm->SwitchHorizontalToVertical( rLine.Y() ); + } else nRstHeight += rLine.Y() - nOrigin; } diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 396c71f9f4a9..07f76bc30b56 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -1208,8 +1208,8 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir ) { // --> FME 2005-04-26 #i47138# // Check if object is anchored as character and move direction - sal_Bool bDummy; - const bool bVertAnchor = rSh.IsFrmVertical( sal_True, bDummy ); + sal_Bool bDummy1, bDummy2; + const bool bVertAnchor = rSh.IsFrmVertical( sal_True, bDummy1, bDummy2 ); const bool bHoriMove = !bVertAnchor == !( nDir % 2 ); const bool bMoveAllowed = !bHoriMove || (rSh.GetAnchorId() != FLY_AS_CHAR); @@ -1365,11 +1365,14 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) if( ( bVertText && ( !bTblCrsr || bVertTable ) ) || ( bTblCrsr && bVertTable ) ) { + // Attempt to integrate cursor travelling for mongolian layout does not work. + // Thus, back to previous mapping of cursor keys to direction keys. if( KEY_UP == nKey ) nKey = KEY_LEFT; else if( KEY_DOWN == nKey ) nKey = KEY_RIGHT; else if( KEY_LEFT == nKey ) nKey = KEY_DOWN; else if( KEY_RIGHT == nKey ) nKey = KEY_UP; } + if ( rSh.IsInRightToLeftText() ) { if( KEY_LEFT == nKey ) nKey = KEY_RIGHT; @@ -1979,6 +1982,7 @@ KEYINPUT_CHECKTABLE_INSDEL: { #ifdef SW_CRSR_TIMER sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False ); + sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False ); #endif if (rSh.IsFormProtected() || rSh.GetCurrentFieldmark()|| rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT) { eKeyState=KS_GotoPrevFieldMark; diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx index 09c9764c460e..dd709b8243d4 100644 --- a/sw/source/ui/frmdlg/frmmgr.cxx +++ b/sw/source/ui/frmdlg/frmmgr.cxx @@ -71,7 +71,8 @@ SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, sal_uInt8 nTyp pOwnSh( pSh ), bAbsPos( sal_False ), bNewFrm( bNew ), - bIsInVertical( sal_False ) + bIsInVertical( sal_False ), + bIsInVerticalL2R( sal_False ) { if ( bNewFrm ) { @@ -92,7 +93,7 @@ SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, sal_uInt8 nTyp { pOwnSh->GetFlyFrmAttr( aSet ); sal_Bool bRightToLeft; - bIsInVertical = pOwnSh->IsFrmVertical(sal_True, bRightToLeft); + bIsInVertical = pOwnSh->IsFrmVertical(sal_True, bRightToLeft, bIsInVerticalL2R); } ::PrepareBoxInfo( aSet, *pOwnSh ); } @@ -102,12 +103,13 @@ SwFlyFrmAttrMgr::SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, const SfxItemS pOwnSh( pSh ), bAbsPos( sal_False ), bNewFrm( bNew ), - bIsInVertical(sal_False) + bIsInVertical(sal_False), + bIsInVerticalL2R(sal_False) { if(!bNew) { sal_Bool bRightToLeft; - bIsInVertical = pSh->IsFrmVertical(sal_True, bRightToLeft); + bIsInVertical = pSh->IsFrmVertical(sal_True, bRightToLeft, bIsInVerticalL2R); } } @@ -297,7 +299,9 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, if (bOnlyPercentRefValue) return; - if(bIsInVertical) + // --> OD 2009-09-01 #mongolianlayout# + if ( bIsInVertical || bIsInVerticalL2R ) + // <-- { Point aPos(aBoundRect.Pos()); long nTmp = aPos.X(); @@ -494,7 +498,9 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, rVal.nMaxVPos = -aBoundRect.Height(); } } - if(bIsInVertical) + // --> OD 2009-09-01 #mongolianlayout# + if ( bIsInVertical || bIsInVerticalL2R ) + // <-- { //restore width/height exchange long nTmp = rVal.nWidth; diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 9c107582aed9..64e36f378f09 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -500,17 +500,32 @@ void lcl_InsertVectors(ListBox& rBox, /* -----------------------------20.08.2002 16:12------------------------------ ---------------------------------------------------------------------------*/ -SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString::StringId eStringId, sal_Bool bVertical, sal_Bool bRTL) +// --> OD 2009-08-31 #mongolianlayout# +// add input parameter +SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString::StringId eStringId, sal_Bool bVertical, sal_Bool bVerticalL2R, sal_Bool bRTL) { //special handling of STR_FROMLEFT - if(SwFPos::FROMLEFT == eStringId) + if ( SwFPos::FROMLEFT == eStringId ) + { + eStringId = bVertical + ? ( bRTL + ? SwFPos::FROMBOTTOM + : SwFPos::FROMTOP ) + : ( bRTL + ? SwFPos::FROMRIGHT + : SwFPos::FROMLEFT ); + return eStringId; + } + // --> OD 2009-08-31 #mongolianlayout# + // special handling of STR_FROMTOP in case of mongolianlayout (vertical left-to-right) + if ( SwFPos::FROMTOP == eStringId && + bVertical && bVerticalL2R ) { - eStringId = bVertical ? - bRTL ? SwFPos::FROMBOTTOM : SwFPos::FROMTOP : - bRTL ? SwFPos::FROMRIGHT : SwFPos::FROMLEFT; + eStringId = SwFPos::FROMLEFT; return eStringId; } - if(bVertical) + // <-- + if ( bVertical ) { //exchange horizontal strings with vertical strings and vice versa static const StringIdPair_Impl aHoriIds[] = @@ -535,6 +550,19 @@ SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString {SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT }, {SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT } }; + // --> OD 2009-08-31 #monglianlayout# + static const StringIdPair_Impl aVertL2RIds[] = + { + {SwFPos::TOP, SwFPos::LEFT }, + {SwFPos::BOTTOM, SwFPos::RIGHT }, + {SwFPos::CENTER_VERT, SwFPos::CENTER_HORI }, + {SwFPos::FROMTOP, SwFPos::FROMLEFT }, + {SwFPos::REL_PG_TOP, SwFPos::REL_PG_LEFT }, + {SwFPos::REL_PG_BOTTOM, SwFPos::REL_PG_RIGHT } , + {SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT }, + {SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT } + }; + // <-- sal_uInt16 nIndex; for(nIndex = 0; nIndex < sizeof(aHoriIds) / sizeof(StringIdPair_Impl); ++nIndex) { @@ -547,11 +575,24 @@ SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString nIndex = 0; for(nIndex = 0; nIndex < sizeof(aVertIds) / sizeof(StringIdPair_Impl); ++nIndex) { - if(aVertIds[nIndex].eHori == eStringId) + // --> OD 2009-08-31 #mongolianlayout# + if ( !bVerticalL2R ) { - eStringId = aVertIds[nIndex].eVert; - break; + if(aVertIds[nIndex].eHori == eStringId) + { + eStringId = aVertIds[nIndex].eVert; + break; + } } + else + { + if(aVertL2RIds[nIndex].eHori == eStringId) + { + eStringId = aVertL2RIds[nIndex].eVert; + break; + } + } + // <-- } } return eStringId; @@ -656,12 +697,16 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) : bAtHorzPosModified( sal_False ), bAtVertPosModified( sal_False ), - bFormat(sal_False), bNew(sal_True), bNoModifyHdl(sal_True), - bVerticalChanged(sal_False), + // --> OD 2009-08-31 #mongolianlayout# - no used +// bVerticalChanged(FALSE), + // <-- bIsVerticalFrame(sal_False), + // --> OD 2009-08-31 #mongolianlayou# + bIsVerticalL2R(sal_False), + // <-- bIsInRightToLeft(sal_False), bHtmlMode(sal_False), nHtmlMode(0), @@ -811,7 +856,10 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) { if (rAnchor.GetAnchorId() != FLY_AT_FLY && !pSh->IsFlyInFly()) aAnchorAtFrameRB.Hide(); - if(!bVerticalChanged && pSh->IsFrmVertical(sal_True, bIsInRightToLeft)) + // --> OD 2009-08-31 #mongolianlayout# +// if ( !bVerticalChanged && pSh->IsFrmVertical(sal_True, bIsInRightToLeft) ) + if ( pSh->IsFrmVertical( sal_True, bIsInRightToLeft, bIsVerticalL2R ) ) + // <-- { String sHLabel = aHorizontalFT.GetText(); aHorizontalFT.SetText(aVerticalFT.GetText()); @@ -1323,7 +1371,12 @@ sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap, // if (!bFormat || (pMap[i].eStrId != SwFPos::FROMLEFT && pMap[i].eStrId != SwFPos::FROMTOP)) { SvxSwFramePosString::StringId eStrId = aMirrorPagesCB.IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId; - eStrId = lcl_ChangeResIdToVerticalOrRTL(eStrId, bIsVerticalFrame, bIsInRightToLeft); + // --> OD 2009-08-31 #mongolianlayout# + eStrId = lcl_ChangeResIdToVerticalOrRTL( eStrId, + bIsVerticalFrame, + bIsVerticalL2R, + bIsInRightToLeft); + // <-- String sEntry(aFramePosString.GetString(eStrId)); if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND) { @@ -1387,7 +1440,13 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap, { SvxSwFramePosString::StringId sStrId1 = aAsCharRelationMap[nRelPos].eStrId; - sStrId1 = lcl_ChangeResIdToVerticalOrRTL(sStrId1, bIsVerticalFrame, bIsInRightToLeft); + // --> OD 2009-08-31 #mongolianlayout# + sStrId1 = + lcl_ChangeResIdToVerticalOrRTL( sStrId1, + bIsVerticalFrame, + bIsVerticalL2R, + bIsInRightToLeft); + // <-- String sEntry = aFramePosString.GetString(sStrId1); sal_uInt16 nPos = _rLB.InsertEntry(sEntry); _rLB.SetEntryData(nPos, &aAsCharRelationMap[nRelPos]); @@ -1447,7 +1506,13 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap, { SvxSwFramePosString::StringId eStrId1 = aMirrorPagesCB.IsChecked() ? aRelationMap[nRelPos].eMirrorStrId : aRelationMap[nRelPos].eStrId; - eStrId1 = lcl_ChangeResIdToVerticalOrRTL(eStrId1, bIsVerticalFrame, bIsInRightToLeft); + // --> OD 2009-08-31 #mongolianlayout# + eStrId1 = + lcl_ChangeResIdToVerticalOrRTL( eStrId1, + bIsVerticalFrame, + bIsVerticalL2R, + bIsInRightToLeft); + // <-- String sEntry = aFramePosString.GetString(eStrId1); sal_uInt16 nPos = _rLB.InsertEntry(sEntry); _rLB.SetEntryData(nPos, &aRelationMap[nRelPos]); diff --git a/sw/source/ui/inc/frmmgr.hxx b/sw/source/ui/inc/frmmgr.hxx index 8a38df73a1bd..0d4d0131de43 100644 --- a/sw/source/ui/inc/frmmgr.hxx +++ b/sw/source/ui/inc/frmmgr.hxx @@ -65,6 +65,9 @@ class SW_DLLPUBLIC SwFlyFrmAttrMgr sal_Bool bAbsPos, bNewFrm; sal_Bool bIsInVertical; + // --> OD 2009-09-01 #mongolianlayout# + sal_Bool bIsInVerticalL2R; + // <-- // interne Verrechnung fuer Umrandung SW_DLLPRIVATE SwTwips CalcTopSpace(); diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx index 0af7ae0b1602..b7c47531a173 100644 --- a/sw/source/ui/inc/frmpage.hxx +++ b/sw/source/ui/inc/frmpage.hxx @@ -109,6 +109,9 @@ class SwFrmPage: public SfxTabPage sal_Bool bNoModifyHdl; sal_Bool bVerticalChanged; //check done whether frame is in vertical environment sal_Bool bIsVerticalFrame; //current frame is in vertical environment - strings are exchanged + // --> OD 2009-08-31 #mongolianlayou# + sal_Bool bIsVerticalL2R; + // <-- sal_Bool bIsInRightToLeft; // current frame is in right-to-left environment - strings are exchanged sal_Bool bHtmlMode; sal_uInt16 nHtmlMode; diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx index 3d5023c311eb..70aba0ae2a8f 100644 --- a/sw/source/ui/shells/drwbassh.cxx +++ b/sw/source/ui/shells/drwbassh.cxx @@ -266,7 +266,8 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_ANCHOR, nAnchor)); sal_Bool bRTL; - aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT, pSh->IsFrmVertical(sal_True, bRTL))); + sal_Bool bVertL2R; + aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT, pSh->IsFrmVertical(sal_True, bRTL, bVertL2R))); aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_RTL_TEXT, bRTL)); SwFrmFmt* pFrmFmt = FindFrmFmt( pObj ); @@ -832,8 +833,12 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation*, pValidation pValidation->bFollowTextFlow, pValidation->bMirror, NULL, &pValidation->aPercentSize); - sal_Bool bRTL; - sal_Bool bIsInVertical = pSh->IsFrmVertical(sal_True, bRTL); + sal_Bool bIsInVertical( sal_False ); + { + sal_Bool bRTL; + sal_Bool bVertL2R; + bIsInVertical = pSh->IsFrmVertical(sal_True, bRTL, bVertL2R); + } if(bIsInVertical) { Point aPos(aBoundRect.Pos()); diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx index ee5522595f96..1e96297a3464 100644 --- a/sw/source/ui/uiview/viewtab.cxx +++ b/sw/source/ui/uiview/viewtab.cxx @@ -313,8 +313,14 @@ void SwView::ExecTabWin( SfxRequest& rReq ) SwFrmFmt* pFmt = ((SwFrmFmt*)rSh.GetFlyFrmFmt()); const SwRect &rRect = rSh.GetAnyCurRect(RECT_FLY_EMBEDDED); - sal_Bool bRTL; - sal_Bool bVerticalFrame = (bFrmSelection && rSh.IsFrmVertical(sal_True, bRTL))|| (!bFrmSelection && bVerticalWriting); + sal_Bool bVerticalFrame(sal_False); + { + sal_Bool bRTL; + sal_Bool bVertL2R; + bVerticalFrame = ( bFrmSelection && + rSh.IsFrmVertical(sal_True, bRTL, bVertL2R) ) || + ( !bFrmSelection && bVerticalWriting); + } long nDeltaX = bVerticalFrame ? rRect.Right() - rPageRect.Right() + aLongLR.GetRight() : rPageRect.Left() + aLongLR.GetLeft() - rRect.Left(); @@ -452,7 +458,10 @@ void SwView::ExecTabWin( SfxRequest& rReq ) RES_VERT_ORIENT, RES_HORI_ORIENT, 0 ); //which of the orientation attributes is to be put depends on the frame's environment sal_Bool bRTL; - if((bFrmSelection && rSh.IsFrmVertical(sal_True, bRTL))|| (!bFrmSelection && bVerticalWriting)) + sal_Bool bVertL2R; + if ( ( bFrmSelection && + rSh.IsFrmVertical(sal_True, bRTL, bVertL2R ) ) || + ( !bFrmSelection && bVerticalWriting ) ) { SwFmtHoriOrient aHoriOrient(pFmt->GetHoriOrient()); aHoriOrient.SetHoriOrient(text::HoriOrientation::NONE); @@ -1274,8 +1283,13 @@ void SwView::StateTabWin(SfxItemSet& rSet) case SID_RULER_BORDERS_VERTICAL: case SID_RULER_BORDERS: { - sal_Bool bFrameRTL; - sal_Bool bFrameHasVerticalColumns = rSh.IsFrmVertical(sal_False, bFrameRTL) && bFrmSelection; + sal_Bool bFrameHasVerticalColumns(sal_False); + { + sal_Bool bFrameRTL; + sal_Bool bFrameVertL2R; + bFrameHasVerticalColumns = rSh.IsFrmVertical(sal_False, bFrameRTL, bFrameVertL2R) && + bFrmSelection; + } sal_Bool bHasTable = ( IsTabColFromDoc() || ( rSh.GetTableFmt() && !bFrmSelection && !(nFrmType & FRMTYPE_COLSECT ) ) ); @@ -1498,8 +1512,13 @@ void SwView::StateTabWin(SfxItemSet& rSet) case SID_RULER_ROWS : case SID_RULER_ROWS_VERTICAL: { - sal_Bool bFrameRTL; - sal_Bool bFrameHasVerticalColumns = rSh.IsFrmVertical(sal_False, bFrameRTL) && bFrmSelection; + sal_Bool bFrameHasVerticalColumns(sal_False); + { + sal_Bool bFrameRTL; + sal_Bool bFrameVertL2R; + bFrameHasVerticalColumns = rSh.IsFrmVertical(sal_False, bFrameRTL, bFrameVertL2R) && + bFrmSelection; + } if( ( (SID_RULER_ROWS == nWhich) && ((!bVerticalWriting && !bFrmSelection) || (bFrmSelection && !bFrameHasVerticalColumns)) ) || |