summaryrefslogtreecommitdiff
path: root/sw/source/core/layout
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/layout')
-rw-r--r--sw/source/core/layout/calcmove.cxx17
-rw-r--r--sw/source/core/layout/colfrm.cxx3
-rw-r--r--sw/source/core/layout/findfrm.cxx3
-rw-r--r--sw/source/core/layout/fly.cxx12
-rw-r--r--sw/source/core/layout/flycnt.cxx169
-rw-r--r--sw/source/core/layout/ftnfrm.cxx6
-rw-r--r--sw/source/core/layout/layact.cxx10
-rw-r--r--sw/source/core/layout/newfrm.cxx58
-rw-r--r--sw/source/core/layout/pagechg.cxx13
-rw-r--r--sw/source/core/layout/paintfrm.cxx20
-rw-r--r--sw/source/core/layout/ssfrm.cxx13
-rw-r--r--sw/source/core/layout/tabfrm.cxx6
-rw-r--r--sw/source/core/layout/trvlfrm.cxx3
-rw-r--r--sw/source/core/layout/wsfrm.cxx54
14 files changed, 317 insertions, 70 deletions
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;