From 5842c3890828cdeda9a209315c9db0240b418f70 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Thu, 20 Jun 2002 08:09:49 +0000 Subject: [PATCH] #98281# Bidi - Direct cursor in rtl environment --- sw/source/core/text/frmcrsr.cxx | 120 ++++---------------------------- sw/source/core/text/porrst.cxx | 97 +++----------------------- 2 files changed, 24 insertions(+), 193 deletions(-) diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index b8a6dae5ea1b..f83ad1cce0ba 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: frmcrsr.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: fme $ $Date: 2002-03-21 08:47:47 $ + * last change: $Author: fme $ $Date: 2002-06-20 09:09:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -239,9 +239,7 @@ SwTxtFrm *SwTxtFrm::GetFrmAtPos( const SwPosition &rPos ) sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, SwCrsrMoveState *pCMS ) const { -#ifdef VERTICAL_LAYOUT ASSERT( ! IsVertical() || ! IsSwapped(),"SwTxtFrm::GetCharRect with swapped frame" ); -#endif if( IsLocked() || IsHiddenNow() ) return sal_False; @@ -260,7 +258,6 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, pFrm->GetFormatted(); const SwFrm* pTmpFrm = (SwFrm*)pFrm->GetUpper(); -#ifdef VERTICAL_LAYOUT SWRECTFN ( pFrm ) const SwTwips nUpperMaxY = (pTmpFrm->*fnRect->fnGetPrtBottom)(); const SwTwips nFrmMaxY = (pFrm->*fnRect->fnGetPrtBottom)(); @@ -270,25 +267,15 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, Max( nFrmMaxY, nUpperMaxY ) : Min( nFrmMaxY, nUpperMaxY ); -#else - SwTwips nUpperMaxY = pTmpFrm->Frm().Top() + pTmpFrm->Prt().Bottom(); - SwTwips nMaxY = Min( pFrm->Frm().Top() + pFrm->Prt().Bottom(), nUpperMaxY ); -#endif - sal_Bool bRet = sal_False; -#ifdef VERTICAL_LAYOUT if ( pFrm->IsEmpty() || ! (pFrm->Prt().*fnRect->fnGetHeight)() ) -#else - if ( pFrm->IsEmpty() || !pFrm->Prt().Height() ) -#endif { Point aPnt1 = pFrm->Frm().Pos() + pFrm->Prt().Pos(); SwTxtNode* pTxtNd = ((SwTxtFrm*)this)->GetTxtNode(); short nFirstOffset; pTxtNd->GetFirstLineOfsWithNum( nFirstOffset ); -#ifdef VERTICAL_LAYOUT Point aPnt2; if ( bVert ) { @@ -314,26 +301,13 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, if( aPnt2.Y() > nMaxY ) aPnt2.Y() = nMaxY; } -#else - if( nFirstOffset > 0 ) - aPnt1.X() += nFirstOffset; - if( aPnt1.Y() > nMaxY ) - aPnt1.Y() = nMaxY; - Point aPnt2( aPnt1.X(), aPnt1.Y() + pFrm->Prt().Height() ); - if( aPnt2.Y() > nMaxY ) - aPnt2.Y() = nMaxY; -#endif rOrig = SwRect( aPnt1, aPnt2 ); if ( pCMS ) { pCMS->aRealHeight.X() = 0; -#ifdef VERTICAL_LAYOUT pCMS->aRealHeight.Y() = bVert ? -rOrig.Width() : rOrig.Height(); -#else - pCMS->aRealHeight.Y() = rOrig.Height(); -#endif } #ifdef BIDI @@ -348,11 +322,9 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, if( !pFrm->HasPara() ) return sal_False; -#ifdef VERTICAL_LAYOUT SwFrmSwapper aSwapper( pFrm, sal_True ); if ( bVert ) nMaxY = pFrm->SwitchVerticalToHorizontal( nMaxY ); -#endif sal_Bool bGoOn = sal_True; xub_StrLen nOffset = rPos.nContent.GetIndex(); @@ -374,19 +346,12 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, if ( pFrm->IsRightToLeft() ) pFrm->SwitchLTRtoRTL( rOrig ); #endif -#ifdef VERTICAL_LAYOUT if ( bVert ) pFrm->SwitchHorizontalToVertical( rOrig ); -#endif if( pFrm->IsUndersized() && pCMS && !pFrm->GetNext() && - -#ifdef VERTICAL_LAYOUT (rOrig.*fnRect->fnGetBottom)() == nUpperMaxY && pFrm->GetOfst() < nOffset && -#else - rOrig.Bottom() == nUpperMaxY && pFrm->GetOfst() < nOffset && -#endif !pFrm->IsFollow() && !bNoScroll && pFrm->GetTxtNode()->GetTxt().Len() != nNextOfst ) bGoOn = lcl_ChangeOffset( pFrm, nNextOfst ); @@ -394,7 +359,6 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, bGoOn = sal_False; } while ( bGoOn ); -#ifdef VERTICAL_LAYOUT if ( pCMS ) { #ifdef BIDI @@ -429,13 +393,11 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, } } -#endif } if( bRet ) { SwPageFrm *pPage = pFrm->FindPageFrm(); ASSERT( pPage, "Text esaped from page?" ); -#ifdef VERTICAL_LAYOUT const SwTwips nOrigTop = (rOrig.*fnRect->fnGetTop)(); const SwTwips nPageTop = (pPage->Frm().*fnRect->fnGetTop)(); const SwTwips nPageBott = (pPage->Frm().*fnRect->fnGetBottom)(); @@ -449,21 +411,6 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, if ( (*fnRect->fnYDiff)( nOrigTop, nPageBott ) > 0 ) (rOrig.*fnRect->fnSetTop)( nPageBott ); -#else - if( rOrig.Top() < pPage->Frm().Top() || - rOrig.Top() > pPage->Frm().Bottom() ) - { - // Following situation: if the frame is in an invalid sectionframe, - // it's possible that the frame is outside the page. If we restrict - // the cursor position to the page area, we enforce the formatting - // of the page, of the section frame and the frame himself. - if( rOrig.Top() < pPage->Frm().Top() ) - rOrig.Pos().Y() = pPage->Frm().Top(); - SwTwips nBott = pPage->Frm().Bottom(); - if( rOrig.Top() > nBott ) - rOrig.Pos().Y() = nBott; - } -#endif } return bRet; @@ -489,7 +436,6 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const pFrm->GetFormatted(); const SwFrm* pTmpFrm = (SwFrm*)pFrm->GetUpper(); -#ifdef VERTICAL_LAYOUT SWRECTFN( pTmpFrm ) SwTwips nUpperMaxY = (pTmpFrm->*fnRect->fnGetPrtBottom)(); @@ -499,15 +445,8 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const Min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ); if ( pFrm->IsEmpty() || ! (pFrm->Prt().*fnRect->fnGetHeight)() ) -#else - SwTwips nUpperMaxY = pTmpFrm->Frm().Top() + pTmpFrm->Prt().Bottom(); - SwTwips nMaxY = Min( pFrm->Frm().Top() + pFrm->Prt().Bottom(), nUpperMaxY ); - - if ( pFrm->IsEmpty() || !pFrm->Prt().Height() ) -#endif { Point aPnt1 = pFrm->Frm().Pos() + pFrm->Prt().Pos(); -#ifdef VERTICAL_LAYOUT Point aPnt2; if ( bVert ) { @@ -527,13 +466,6 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const if( aPnt2.Y() > nMaxY ) aPnt2.Y() = nMaxY; } -#else - if( aPnt1.Y() > nMaxY ) - aPnt1.Y() = nMaxY; - Point aPnt2( aPnt1.X(), aPnt1.Y() + pFrm->Prt().Height() ); - if( aPnt2.Y() > nMaxY ) - aPnt2.Y() = nMaxY; -#endif rOrig = SwRect( aPnt1, aPnt2 ); return sal_True; } @@ -542,11 +474,9 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const if( !pFrm->HasPara() ) return sal_False; -#ifdef VERTICAL_LAYOUT SwFrmSwapper aSwapper( pFrm, sal_True ); if ( bVert ) nMaxY = pFrm->SwitchVerticalToHorizontal( nMaxY ); -#endif SwTxtSizeInfo aInf( pFrm ); SwTxtCursor aLine( pFrm, &aInf ); @@ -560,10 +490,8 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const rOrig.Height( aTmpState.aRealHeight.Y() ); } -#ifdef VERTICAL_LAYOUT if ( bVert ) pFrm->SwitchHorizontalToVertical( rOrig ); -#endif return TRUE; } @@ -599,9 +527,7 @@ struct SwFillData const long Left() const { return aFrm.Left(); } const long Right() const { return aFrm.Right(); } const long Bottom() const { return aFrm.Bottom(); } -#ifdef VERTICAL_LAYOUT SwRect& Frm() { return aFrm; } -#endif SwFillCrsrPos &Fill() const { return *pCMS->pFill; } void SetTab( MSHORT nNew ) { pCMS->pFill->nTabCnt = nNew; } void SetSpace( MSHORT nNew ) { pCMS->pFill->nSpaceCnt = nNew; } @@ -617,14 +543,8 @@ sal_Bool SwTxtFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint, if( IsLocked() || IsHiddenNow() ) return sal_False; -#ifndef VERTICAL_LAYOUT - SwFillData *pFillData = ( pCMS && pCMS->pFill ) ? - new SwFillData( pCMS, pPos, Frm(), rPoint ) : NULL; -#endif - ((SwTxtFrm*)this)->GetFormatted(); -#ifdef VERTICAL_LAYOUT Point aOldPoint( rPoint ); #ifdef BIDI @@ -637,9 +557,9 @@ sal_Bool SwTxtFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint, SwitchVerticalToHorizontal( (Point&)rPoint ); ((SwTxtFrm*)this)->SwapWidthAndHeight(); } + SwFillData *pFillData = ( pCMS && pCMS->pFill ) ? new SwFillData( pCMS, pPos, Frm(), rPoint ) : NULL; -#endif if ( IsEmpty() ) { @@ -717,7 +637,6 @@ sal_Bool SwTxtFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint, } } } -#ifdef VERTICAL_LAYOUT sal_Bool bChgFillData = sal_False; if( pFillData && FindPageFrm()->Frm().IsInside( aOldPoint ) ) { @@ -725,21 +644,26 @@ sal_Bool SwTxtFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint, bChgFillData = sal_True; } -#else - if( pFillData && FindPageFrm()->Frm().IsInside( rPoint ) ) - FillCrsrPos( *pFillData ); -#endif - -#ifdef VERTICAL_LAYOUT if ( IsVertical() ) { if ( bChgFillData ) SwitchHorizontalToVertical( pFillData->Fill().aCrsr.Pos() ); ((SwTxtFrm*)this)->SwapWidthAndHeight(); } + + if ( IsRightToLeft() && bChgFillData ) + { + SwitchLTRtoRTL( pFillData->Fill().aCrsr.Pos() ); + const SwHoriOrient eOrient = pFillData->pCMS->pFill->eOrient; + + if ( HORI_LEFT == eOrient ) + pFillData->SetOrient( HORI_RIGHT ); + else if ( HORI_RIGHT == eOrient ) + pFillData->SetOrient( HORI_LEFT ); + } + (Point&)rPoint = aOldPoint; delete pFillData; -#endif return sal_True; } @@ -1027,10 +951,8 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset, SwRect aCharBox; const SwCntntFrm *pFollow; -#ifdef VERTICAL_LAYOUT if ( IsVertical() ) ((SwTxtFrm*)this)->SwapWidthAndHeight(); -#endif if ( !IsEmpty() && !IsHiddenNow() ) { @@ -1075,10 +997,8 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset, pPam->GetPoint()->nContent = SwIndex( ((SwTxtFrm*)this)->GetTxtNode(), nOfst ); -#ifdef VERTICAL_LAYOUT if ( IsVertical() ) ((SwTxtFrm*)this)->SwapWidthAndHeight(); -#endif return sal_True; } @@ -1095,15 +1015,11 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset, } } if( !pFollow ) // nur noch geschuetzte -#ifdef VERTICAL_LAYOUT { if ( IsVertical() ) ((SwTxtFrm*)this)->SwapWidthAndHeight(); return pTmp->SwCntntFrm::UnitDown( pPam, nOffset, bSetInReadOnly ); } -#else - return pTmp->SwCntntFrm::UnitDown( pPam, nOffset, bSetInReadOnly ); -#endif aLine.GetCharRect( &aCharBox, nPos ); aCharBox.SSize().Width() /= 2; @@ -1129,10 +1045,8 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset, else pFollow = GetFollow(); -#ifdef VERTICAL_LAYOUT if ( IsVertical() ) ((SwTxtFrm*)this)->SwapWidthAndHeight(); -#endif // Bei Follows schlagen wir eine Abkuerzung if( pFollow ) @@ -1543,7 +1457,6 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; pUp->GetUpper()->GetUpper()->IsSctFrm() ) pUp = pUp->GetUpper()->GetUpper()->GetUpper(); } -#ifdef VERTICAL_LAYOUT SWRECTFN( this ) SwTwips nLimit = (pUp->*fnRect->fnGetPrtBottom)(); SwTwips nRectBottom = rRect.Bottom(); @@ -1551,9 +1464,6 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; nRectBottom = SwitchHorizontalToVertical( nRectBottom ); if( (*fnRect->fnYDiff)( nLimit, nRectBottom ) < 0 ) -#else - if( pUp->Frm().Top() + pUp->Prt().Bottom() < rRect.Bottom() ) -#endif bFill = sal_False; else rRect.Width( 1 ); diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 938bb43e1763..3eb1fc20dad3 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -2,9 +2,9 @@ * * $RCSfile: porrst.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: fme $ $Date: 2002-04-24 11:23:21 $ + * last change: $Author: fme $ $Date: 2002-06-20 09:09:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -81,11 +81,9 @@ #ifndef _SVX_LRSPITEM_HXX //autogen #include #endif -#ifdef VERTICAL_LAYOUT #ifndef _SVX_PGRDITEM_HXX #include #endif -#endif #ifndef _WINDOW_HXX //autogen #include #endif @@ -135,11 +133,9 @@ #ifndef _SWFNTCCH_HXX #include // SwFontAccess #endif -#ifdef VERTICAL_LAYOUT #ifndef SW_TGRDITEM_HXX #include #endif -#endif #ifndef _PAGEDESC_HXX #include // SwPageDesc #endif @@ -186,13 +182,8 @@ void SwTmpEndPortion::Paint( const SwTxtPaintInfo &rInf ) const /************************************************************************* * class SwBreakPortion *************************************************************************/ -#ifdef VERTICAL_LAYOUT SwBreakPortion::SwBreakPortion( const SwLinePortion &rPortion ) : SwLinePortion( rPortion ), nRestWidth( 0 ) -#else -SwBreakPortion::SwBreakPortion( const SwLinePortion &rPortion ) - : SwLinePortion( rPortion ), nViewWidth( 0 ), nRestWidth( 0 ) -#endif { nLineLength = 1; SetWhichPor( POR_BRK ); @@ -211,11 +202,7 @@ void SwBreakPortion::Paint( const SwTxtPaintInfo &rInf ) const { if( rInf.OnWin() && rInf.GetOpt().IsLineBreak() ) { -#ifdef VERTICAL_LAYOUT USHORT nViewWidth = ((SwBreakPortion*)this)->CalcViewWidth( rInf ); -#else - ((SwBreakPortion*)this)->CalcViewWidth( rInf ); -#endif if( nViewWidth && nViewWidth <= nRestWidth ) rInf.DrawLineBreak( *this ); @@ -226,11 +213,7 @@ void SwBreakPortion::Paint( const SwTxtPaintInfo &rInf ) const * SwBreakPortion::CalcViewWidth() *************************************************************************/ -#ifdef VERTICAL_LAYOUT USHORT SwBreakPortion::CalcViewWidth( const SwTxtSizeInfo &rInf ) -#else -void SwBreakPortion::CalcViewWidth( const SwTxtSizeInfo &rInf ) -#endif { ASSERT( rInf.GetOpt().IsLineBreak(), "SwBreakPortion::CalcViewWidth: zombie" ); // Im Mormalfall folgt auf ein Break keine weitere Portion, nur wenn im Blocksatz @@ -246,7 +229,6 @@ void SwBreakPortion::CalcViewWidth( const SwTxtSizeInfo &rInf ) else nRestWidth = GetPortion()->Width(); } -#ifdef VERTICAL_LAYOUT USHORT nViewWidth = 0; // The view width is not depending on the zoom factor anymore. @@ -254,16 +236,6 @@ void SwBreakPortion::CalcViewWidth( const SwTxtSizeInfo &rInf ) nViewWidth = LINE_BREAK_WIDTH; return nViewWidth; - -#else - if( rInf.GetWin() && nRestWidth ) - { - if( !nViewWidth ) - nViewWidth = (KSHORT)rInf.GetOpt().GetLineBreakWidth( rInf.GetWin() ); - } - else - nViewWidth = 0; -#endif } /************************************************************************* @@ -292,14 +264,9 @@ void SwBreakPortion::HandlePortion( SwPortionHandler& rPH ) const } -#ifdef VERTICAL_LAYOUT SwKernPortion::SwKernPortion( SwLinePortion &rPortion, short nKrn, sal_Bool bBG, sal_Bool bGK ) : nKern( nKrn ), bBackground( bBG ), bGridKern( bGK ) -#else -SwKernPortion::SwKernPortion( SwLinePortion &rPortion, short nKrn, sal_Bool bBG ) : - nKern( nKrn ), bBackground( bBG ) -#endif { Height( rPortion.Height() ); SetAscent( rPortion.GetAscent() ); @@ -310,7 +277,6 @@ SwKernPortion::SwKernPortion( SwLinePortion &rPortion, short nKrn, sal_Bool bBG rPortion.Insert( this ); } -#ifdef VERTICAL_LAYOUT SwKernPortion::SwKernPortion( const SwLinePortion& rPortion ) : nKern( 0 ), bBackground( sal_False ), bGridKern( sal_True ) { @@ -320,7 +286,6 @@ SwKernPortion::SwKernPortion( const SwLinePortion& rPortion ) : nLineLength = 0; SetWhichPor( POR_KERN ); } -#endif void SwKernPortion::Paint( const SwTxtPaintInfo &rInf ) const { @@ -352,10 +317,8 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; void SwKernPortion::FormatEOL( SwTxtFormatInfo &rInf ) { -#ifdef VERTICAL_LAYOUT if ( bGridKern ) return; -#endif if( rInf.GetLast() == this ) rInf.SetLast( FindPrevPortion( rInf.GetRoot() ) ); @@ -390,40 +353,11 @@ void SwArrowPortion::Paint( const SwTxtPaintInfo &rInf ) const ((SwArrowPortion*)this)->aPos = rInf.GetPos(); } -#ifndef VERTICAL_LAYOUT -void SwArrowPortion::PaintIt( OutputDevice *pOut ) const -{ - Size aSize( 6, 12 ); - aSize = pOut->PixelToLogic( aSize ); - SwRect aRect( GetPos(), aSize ); - if( bLeft ) - { - aRect.Pos().Y() += 20 - GetAscent(); - aRect.Pos().X() += 20; - if( aSize.Height() > Height() ) - aRect.Height( Height() ); - } - else - { - if( aSize.Height() > Height() ) - aRect.Height( Height() ); - aRect.Pos().Y() -= aRect.Height() + 20; - aRect.Pos().X() -= aRect.Width() + 20; - } - - Color aCol( COL_LIGHTRED ); - SvxFont::DrawArrow( *pOut, aRect.SVRect(), aSize, aCol, bLeft ); -} -#endif - SwLinePortion *SwArrowPortion::Compress() { return this; } - SwTwips SwTxtFrm::EmptyHeight() const { -#ifdef VERTICAL_LAYOUT ASSERT( ! IsVertical() || ! IsSwapped(),"SwTxtFrm::EmptyHeight with swapped frame" ); -#endif SwFont *pFnt; const SwTxtNode& rTxtNode = *GetTxtNode(); @@ -440,10 +374,8 @@ SwTwips SwTxtFrm::EmptyHeight() const pFnt->ChkMagic( pSh, pFnt->GetActual() ); } -#ifdef VERTICAL_LAYOUT if ( IsVertical() ) pFnt->SetVertical( 2700 ); -#endif OutputDevice *pOut = pSh ? pSh->GetOut() : 0; if ( !pOut || !rTxtNode.GetDoc()->IsBrowseMode() || @@ -470,13 +402,9 @@ SwTwips SwTxtFrm::EmptyHeight() const SwTwips nRet; if( !pOut ) -#ifdef VERTICAL_LAYOUT nRet = IsVertical() ? Prt().SSize().Width() + 1 : Prt().SSize().Height() + 1; -#else - nRet = Prt().SSize().Height() + 1; -#endif else { pFnt->SetFntChg( sal_True ); @@ -493,9 +421,7 @@ SwTwips SwTxtFrm::EmptyHeight() const sal_Bool SwTxtFrm::FormatEmpty() { -#ifdef VERTICAL_LAYOUT ASSERT( ! IsVertical() || ! IsSwapped(),"SwTxtFrm::FormatEmpty with swapped frame" ); -#endif if ( HasFollow() || GetTxtNode()->GetpSwpHints() || 0 != GetTxtNode()->GetNumRule() || @@ -503,8 +429,15 @@ sal_Bool SwTxtFrm::FormatEmpty() IsInFtn() || ( HasPara() && GetPara()->IsPrepMustFit() ) ) return sal_False; const SwAttrSet& aSet = GetTxtNode()->GetSwAttrSet(); +#ifdef BIDI + const USHORT nAdjust = aSet.GetAdjust().GetAdjust(); + if( ( ( ! IsRightToLeft() && ( SVX_ADJUST_LEFT != nAdjust ) ) || + ( IsRightToLeft() && ( SVX_ADJUST_RIGHT != nAdjust ) ) ) || + aSet.GetRegister().GetValue() ) +#else if( SVX_ADJUST_LEFT != aSet.GetAdjust().GetAdjust() || aSet.GetRegister().GetValue() ) +#endif return sal_False; const SvxLineSpacingItem &rSpacing = aSet.GetLineSpacing(); if( SVX_LINE_SPACE_MIN == rSpacing.GetLineSpaceRule() || @@ -523,7 +456,6 @@ sal_Bool SwTxtFrm::FormatEmpty() { SwTwips nHeight = EmptyHeight(); -#ifdef VERTICAL_LAYOUT if ( GetTxtNode()->GetSwAttrSet().GetParaGrid().GetValue() && IsInDocBody() ) { @@ -534,9 +466,6 @@ sal_Bool SwTxtFrm::FormatEmpty() SWRECTFN( this ) const SwTwips nChg = nHeight - (Prt().*fnRect->fnGetHeight)(); -#else - const SwTwips nChg = nHeight - Prt().SSize().Height(); -#endif if( !nChg ) SetUndersized( sal_False ); @@ -570,12 +499,8 @@ sal_Bool SwTxtFrm::FillRegister( SwTwips& rRegStart, KSHORT& rRegDiff ) pFrm = pFrm->GetUpper(); if( ( FRM_BODY| FRM_FLY ) & pFrm->GetType() ) { -#ifdef VERTICAL_LAYOUT SWRECTFN( pFrm ) rRegStart = (pFrm->*fnRect->fnGetPrtTop)(); -#else - rRegStart = pFrm->Frm().Top() + pFrm->Prt().Top(); -#endif pFrm = pFrm->FindPageFrm(); if( pFrm->IsPageFrm() ) { @@ -658,15 +583,11 @@ sal_Bool SwTxtFrm::FillRegister( SwTwips& rRegStart, KSHORT& rRegDiff ) } } } -#ifdef VERTICAL_LAYOUT const long nTmpDiff = pDesc->GetRegAscent() - rRegDiff; if ( bVert ) rRegStart -= nTmpDiff; else rRegStart += nTmpDiff; -#else - rRegStart += pDesc->GetRegAscent() - rRegDiff; -#endif } } }