diff options
Diffstat (limited to 'sw/source/core/text')
-rw-r--r-- | sw/source/core/text/frmcrsr.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/text/frmform.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/text/frmpaint.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/inftxt.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/text/itrtxt.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/text/txtfrm.cxx | 89 | ||||
-rw-r--r-- | sw/source/core/text/txttab.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/text/widorp.cxx | 10 |
8 files changed, 121 insertions, 32 deletions
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; } |