summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Martens <ama@openoffice.org>2001-01-19 14:27:04 +0000
committerAndreas Martens <ama@openoffice.org>2001-01-19 14:27:04 +0000
commit59ed5348e17111eb8657f47717ddae5d893adccf (patch)
tree404da3c6d9896c51afb34ce1046ddab5d9cb1a93
parent536600bd9517d8bd4386bd165c0565c5e8d82a6a (diff)
New: Writing direction from top to bottom and revers
-rw-r--r--sw/source/core/inc/swfont.hxx24
-rw-r--r--sw/source/core/text/inftxt.cxx13
-rw-r--r--sw/source/core/text/inftxt.hxx15
-rw-r--r--sw/source/core/text/itrcrsr.cxx33
-rw-r--r--sw/source/core/text/porlin.cxx16
-rw-r--r--sw/source/core/text/pormulti.cxx66
-rw-r--r--sw/source/core/text/pormulti.hxx20
7 files changed, 116 insertions, 71 deletions
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index eb485f83e3b1..59db8e0e5adb 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swfont.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: ama $ $Date: 2000-12-20 15:49:45 $
+ * last change: $Author: ama $ $Date: 2001-01-19 15:17:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -164,7 +164,7 @@ class SwSubFont : public SvxFont
inline void SetStrikeout( const FontStrikeout eStrikeout );
inline void SetItalic( const FontItalic eItalic );
inline void SetOutline( const BOOL bOutline );
- inline void SetVertical( const BOOL bNew );
+ inline void SetVertical( const USHORT nDir );
inline void SetShadow( const BOOL bShadow );
inline void SetAutoKern( const BOOL bAutoKern );
inline void SetWordLineMode( const BOOL bWordLineMode );
@@ -264,7 +264,7 @@ public:
inline void SetUnderColor( const Color &rColor ) { aUnderColor = rColor; }
inline void SetStrikeout( const FontStrikeout eStrikeout );
inline void SetOutline( const BOOL bOutline );
- inline void SetVertical( const BOOL bNew );
+ inline void SetVertical( const USHORT nDir );
inline void SetShadow( const BOOL bShadow );
inline void SetAutoKern( const BOOL bAutoKern );
inline void SetTransparent( const BOOL bTrans );
@@ -818,21 +818,21 @@ inline void SwFont::SetNoCol( const BOOL bNew )
bNoColReplace = bNew;
}
-inline void SwSubFont::SetVertical( const BOOL bNew )
+inline void SwSubFont::SetVertical( const USHORT nDir )
{
pMagic = 0;
- Font::SetVertical( bNew );
- Font::SetOrientation( bNew ? 900 : 0 );
+ Font::SetVertical( nDir != 0 );
+ Font::SetOrientation( nDir );
}
-inline void SwFont::SetVertical( const BOOL bNew )
+inline void SwFont::SetVertical( const USHORT nDir )
{
- if( bNew != aSub[0].IsVertical() )
+ if( nDir != aSub[0].GetOrientation() )
{
bFntChg = TRUE;
- aSub[0].SetVertical( bNew );
- aSub[1].SetVertical( bNew );
- aSub[2].SetVertical( bNew );
+ aSub[0].SetVertical( nDir );
+ aSub[1].SetVertical( nDir );
+ aSub[2].SetVertical( nDir );
}
}
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 605bc041d11c..828a04945302 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: inftxt.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: ama $ $Date: 2000-12-21 09:00:46 $
+ * last change: $Author: ama $ $Date: 2001-01-19 15:20:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -293,7 +293,7 @@ SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew )
bHanging( rNew.IsHanging() ),
bScriptSpace( rNew.HasScriptSpace() ),
bForbiddenChars( rNew.HasForbiddenChars() ),
- bRotated( rNew.IsRotated() )
+ nDirection( rNew.GetDirection() )
{
#ifndef PRODUCT
ChkOutDev( *this );
@@ -363,7 +363,8 @@ void SwTxtSizeInfo::CtorInit( SwTxtFrm *pFrame, SwFont *pNewFnt,
bStopUnderFlow = sal_False;
bSpecialUnderline = sal_False;
bMulti = bFirstMulti = bRuby = bHanging = bScriptSpace =
- bForbiddenChars = bRotated = sal_False;
+ bForbiddenChars = sal_False;
+ nDirection = DIR_LEFT2RIGHT;
SetLen( GetMinLen( *this ) );
}
@@ -390,7 +391,7 @@ SwTxtSizeInfo::SwTxtSizeInfo( const SwTxtSizeInfo &rNew, const XubString &rTxt,
bHanging( rNew.IsHanging() ),
bScriptSpace( rNew.HasScriptSpace() ),
bForbiddenChars( rNew.HasForbiddenChars() ),
- bRotated( rNew.IsRotated() )
+ nDirection( rNew.GetDirection() )
{
#ifndef PRODUCT
ChkOutDev( *this );
@@ -608,7 +609,7 @@ void SwTxtPaintInfo::DrawTab( const SwLinePortion &rPor ) const
#ifndef PRODUCT
#ifdef DEBUG
if( IsOptDbg() )
- pWin->DrawRect( aRect );
+ pWin->DrawRect( aRect.SVRect() );
#endif
#endif
pOpt->PaintTab( pWin, aRect );
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 5470d0ba2afd..544a3bea3a94 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: inftxt.hxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: ama $ $Date: 2000-12-21 09:01:13 $
+ * last change: $Author: ama $ $Date: 2001-01-19 15:18:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -102,6 +102,10 @@ class SwAttrIter;
/* Minimum: Prozentwert fuers kernen */
#define MINKERNPERCENT 5
#define ARROW_WIDTH 200
+#define DIR_LEFT2RIGHT 0
+#define DIR_BOTTOM2TOP 1
+#define DIR_RIGHT2LEFT 2
+#define DIR_TOP2BOTTOM 3
#ifndef PRODUCT
#define OPTCALM( rInf ) (rInf).IsOptCalm()
@@ -196,7 +200,7 @@ protected:
sal_Bool bHanging : 1; // formatting of hanging punctuation allowed
sal_Bool bScriptSpace : 1; // space between different scripts (Asian/Latin)
sal_Bool bForbiddenChars : 1; // Forbidden start/endline characters
- sal_Bool bRotated : 1; // 90 degree rotation
+ sal_uInt8 nDirection : 2; // writing direction: 0/90/180/270 degree
protected:
void _NoteAnimation();
@@ -244,8 +248,9 @@ public:
inline void SetScriptSpace( const sal_Bool bNew ) { bScriptSpace = bNew; }
inline sal_Bool HasForbiddenChars() const { return bForbiddenChars; }
inline void SetForbiddenChars( const sal_Bool bN ) { bForbiddenChars = bN; }
- inline sal_Bool IsRotated() const { return bRotated; }
- inline void SetRotated( const sal_Bool bNew ) { bRotated = bNew; }
+ inline sal_uInt8 GetDirection() const { return nDirection; }
+ inline void SetDirection( const sal_uInt8 nNew ) { nDirection = nNew; }
+ inline sal_Bool IsRotated() const { return 0 != ( 1 & nDirection ); }
inline ViewShell *GetVsh() { return pVsh; }
inline const ViewShell *GetVsh() const { return pVsh; }
inline OutputDevice *GetOut() { return pOut; }
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 5612bff9cf7e..da88eec6cb22 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: itrcrsr.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: ama $ $Date: 2000-12-21 14:17:09 $
+ * last change: $Author: ama $ $Date: 2001-01-19 15:23:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -449,7 +449,8 @@ sal_Bool SwTxtCursor::GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
nPorHeight = pPor->Height();
nPorAscent = pPor->GetAscent();
}
- if ( aInf.GetIdx() + pPor->GetLen() <= nOfst )
+ if ( aInf.GetIdx() + pPor->GetLen() < nOfst +
+ ( pPor->IsMultiPortion() && !bWidth ? 0 : 1 ) )
{
if ( pPor->InSpaceGrp() && nSpaceAdd )
nX += pPor->PrtWidth() +
@@ -515,15 +516,22 @@ sal_Bool SwTxtCursor::GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
ChgSpaceAdd( pCurr, nSpaceAdd );
Point aOldPos = pOrig->Pos();
bRet = GetCharRect( pOrig, nOfst, pCMS, nMax );
- if( ((SwMultiPortion*)pPor)->GetRotation() )
+ if( ((SwMultiPortion*)pPor)->HasRotation() )
{
long nTmp = pOrig->Width();
pOrig->Width( pOrig->Height() );
pOrig->Height( nTmp );
nTmp = pOrig->Left() - aOldPos.X();
pOrig->Pos().X() = nX + aOldPos.X();
- pOrig->Pos().Y() = aOldPos.Y() + nTmpAscent
- + pPor->Height() - pPor->GetAscent() - nTmp;
+ if( ((SwMultiPortion*)pPor)->IsRevers() )
+ pOrig->Pos().Y() = aOldPos.Y() + nTmpAscent
+ - pPor->GetAscent() + nTmp;
+ else
+ pOrig->Pos().Y() = aOldPos.Y() + nTmpAscent
+ + pPor->Height() - pPor->GetAscent() - nTmp
+ - pOrig->Height();
+ if ( pCMS && pCMS->bRealHeight )
+ pCMS->aRealHeight.Y() = -pCMS->aRealHeight.Y();
}
else
{
@@ -1004,9 +1012,18 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
if( pPor->IsMultiPortion() )
{
// In a multi-portion we use GetCrsrOfst()-funtion rekursively
+ SwTwips nTmpY = rPoint.Y() - pCurr->GetAscent() + pPor->GetAscent();
SwTxtCursorSave aSave( (SwTxtCursor*)this, (SwMultiPortion*)pPor,
- rPoint.Y() - pCurr->GetAscent() + pPor->GetAscent(),
- nCurrStart, nSpaceAdd );
+ nTmpY, nCurrStart, nSpaceAdd );
+ if( ((SwMultiPortion*)pPor)->HasRotation() )
+ {
+ nTmpY -= nY;
+ if( !((SwMultiPortion*)pPor)->IsRevers() )
+ nTmpY = pPor->Height() - nTmpY;
+ if( nTmpY < 0 )
+ nTmpY = 0;
+ nX = nTmpY;
+ }
if( ((SwMultiPortion*)pPor)->HasBrackets() )
nX -= ((SwDoubleLinePortion*)pPor)->PreWidth();
return GetCrsrOfst( pPos, Point( nLeftMargin + nX, rPoint.Y() ),
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index ce28683a73bf..7a392b7800dd 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: porlin.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: ama $ $Date: 2000-12-21 09:09:33 $
+ * last change: $Author: ama $ $Date: 2001-01-19 15:21:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -377,11 +377,12 @@ void SwLinePortion::FormatEOL( SwTxtFormatInfo &rInf )
void SwLinePortion::Move( SwTxtPaintInfo &rInf )
{
+ BOOL bB2T = rInf.GetDirection() == DIR_BOTTOM2TOP;
if ( InSpaceGrp() && rInf.GetSpaceAdd() )
{
SwTwips nTmp = PrtWidth() + CalcSpacing( rInf.GetSpaceAdd(), rInf );
if( rInf.IsRotated() )
- rInf.Y( rInf.Y() - nTmp );
+ rInf.Y( rInf.Y() + ( bB2T ? -nTmp : nTmp ) );
else
rInf.X( rInf.X() + nTmp );
}
@@ -389,17 +390,18 @@ void SwLinePortion::Move( SwTxtPaintInfo &rInf )
{
if( InFixMargGrp() )
{
- if( rInf.GetSpaceAdd() < 0 )
+ short nSpAdd = rInf.GetSpaceAdd();
+ if( nSpAdd < 0 )
{
if( rInf.IsRotated() )
- rInf.Y( rInf.Y() - rInf.GetSpaceAdd() );
+ rInf.Y( rInf.Y() + (bB2T ? -nSpAdd : nSpAdd) );
else
- rInf.X( rInf.X() + rInf.GetSpaceAdd() );
+ rInf.X( rInf.X() + nSpAdd );
}
rInf.IncSpaceIdx();
}
if( rInf.IsRotated() )
- rInf.Y( rInf.Y() - PrtWidth() );
+ rInf.Y( rInf.Y() + ( bB2T ? -PrtWidth() : PrtWidth() ) );
else
rInf.X( rInf.X() + PrtWidth() );
}
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index b123b95a2384..a6db86360128 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: pormulti.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: ama $ $Date: 2000-12-21 09:07:22 $
+ * last change: $Author: ama $ $Date: 2001-01-19 15:27:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -259,7 +259,6 @@ SwDoubleLinePortion::SwDoubleLinePortion( const SwTxtAttr& rAttr,
xub_StrLen nEnd ) : SwMultiPortion( nEnd ), pBracket( new SwBracket() )
{
SetDouble();
-
pBracket->nStart = *rAttr.GetStart();
if( RES_CHRATR_TWO_LINES == rAttr.Which() )
@@ -927,7 +926,7 @@ class SwSpaceManipulator
MSHORT nOldSpIdx;
short nSpaceAdd;
sal_Bool bSpaceChg : 1;
- sal_Bool bRotate : 1;
+ sal_uInt8 nOldDir : 2;
public:
SwSpaceManipulator( SwTxtPaintInfo& rInf, SwMultiPortion& rMult );
~SwSpaceManipulator();
@@ -940,8 +939,8 @@ SwSpaceManipulator::SwSpaceManipulator( SwTxtPaintInfo& rInf,
{
pOldSpaceAdd = rInfo.GetpSpaceAdd();
nOldSpIdx = rInfo.GetSpaceIdx();
- bRotate = rInfo.IsRotated();
- rInfo.SetRotated( rMulti.GetRotation() );
+ nOldDir = rInfo.GetDirection();
+ rInfo.SetDirection( rMulti.GetDirection() );
bSpaceChg = sal_False;
if( rMulti.IsDouble() )
{
@@ -994,7 +993,7 @@ SwSpaceManipulator::~SwSpaceManipulator()
}
rInfo.SetSpaceAdd( pOldSpaceAdd );
rInfo.SetSpaceIdx( nOldSpIdx);
- rInfo.SetRotated( bRotate );
+ rInfo.SetDirection( nOldDir );
}
/*-----------------13.10.00 16:24-------------------
@@ -1020,7 +1019,7 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
SwFontSave *pFontSave;
SwFont* pTmpFnt;
- if( rMulti.IsDouble() || rMulti.GetRotation() )
+ if( rMulti.IsDouble() || rMulti.HasRotation() )
{
pTmpFnt = new SwFont( *GetInfo().GetFont() );
if( rMulti.IsDouble() )
@@ -1028,7 +1027,7 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
SetPropFont( 50 );
pTmpFnt->SetProportion( GetPropFont() );
}
- pTmpFnt->SetVertical( rMulti.GetRotation() );
+ pTmpFnt->SetVertical( rMulti.GetFontRotation() );
pFontSave = new SwFontSave( GetInfo(), pTmpFnt, this );
}
else
@@ -1053,10 +1052,18 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
// GetInfo().Y() is the baseline from the surrounding line. We must switch
// this temporary to the baseline of the inner lines of the multiportion.
- if( rMulti.GetRotation() )
+ if( rMulti.HasRotation() )
{
- GetInfo().Y( nOldY - rMulti.GetAscent() + rMulti.Height() );
- GetInfo().X( nTmpX + pLay->GetAscent() );
+ if( rMulti.IsRevers() )
+ {
+ GetInfo().Y( nOldY - rMulti.GetAscent() );
+ GetInfo().X( nTmpX - pLay->GetAscent() + rMulti.Width() );
+ }
+ else
+ {
+ GetInfo().Y( nOldY - rMulti.GetAscent() + rMulti.Height() );
+ GetInfo().X( nTmpX + pLay->GetAscent() );
+ }
}
else
GetInfo().Y( nOldY - rMulti.GetAscent() + pLay->GetAscent() );
@@ -1115,11 +1122,19 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
pPor = pLay->GetFirstPortion();
bRest = pLay->IsRest();
aManip.SecondLine();
- if( rMulti.GetRotation() )
+ if( rMulti.HasRotation() )
{
- GetInfo().X( nTmpX + rMulti.Width()
- - pLay->Height() + pLay->GetAscent() );
- GetInfo().Y( nOldY - rMulti.GetAscent() + rMulti.Height() );
+ if( rMulti.IsRevers() )
+ {
+ GetInfo().X( nTmpX + pLay->Height() - pLay->GetAscent() );
+ GetInfo().Y( nOldY - rMulti.GetAscent() );
+ }
+ else
+ {
+ GetInfo().X( nTmpX + rMulti.Width()
+ - pLay->Height() + pLay->GetAscent() );
+ GetInfo().Y( nOldY - rMulti.GetAscent() + rMulti.Height() );
+ }
}
else
{
@@ -1198,12 +1213,12 @@ BOOL SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
SeekAndChg( rInf );
SwFontSave *pFontSave;
- if( rMulti.IsDouble() || rMulti.GetRotation() )
+ if( rMulti.IsDouble() || rMulti.HasRotation() )
{
SwFont* pTmpFnt = new SwFont( *rInf.GetFont() );
- if( rMulti.GetRotation() )
+ if( rMulti.HasRotation() )
{
- pTmpFnt->SetVertical( sal_True );
+ pTmpFnt->SetVertical( rMulti.GetFontRotation() );
nMaxWidth = GetTxtFrm()->GetUpper()->Prt().Height();
}
if( rMulti.IsDouble() )
@@ -1282,7 +1297,7 @@ BOOL SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
BuildPortions( aInf );
rMulti.CalcSize( *this, aInf );
pCurr->SetRealHeight( pCurr->Height() );
- if( rMulti.GetRotation() )
+ if( rMulti.HasRotation() && !rMulti.IsDouble() )
break;
else if( pCurr->GetLen()<nMultiLen || rMulti.IsRuby() || aInf.GetRest())
{
@@ -1384,7 +1399,7 @@ BOOL SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
((SwRubyPortion&)rMulti).CalcRubyOffset();
}
}
- if( rMulti.GetRotation() )
+ if( rMulti.HasRotation() )
{
SwTwips nH = rMulti.Width();
rMulti.Width( rMulti.Height() );
@@ -1425,8 +1440,9 @@ BOOL SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
}
pTmp->SetFollowFld();
}
- else if( rMulti.GetRotation() )
- pTmp = new SwRotatedPortion( nMultiLen + rInf.GetIdx() );
+ else if( rMulti.HasRotation() )
+ pTmp = new SwRotatedPortion( nMultiLen + rInf.GetIdx(),
+ rMulti.GetDirection() );
else
pTmp = NULL;
if( pNextFirst && pTmp )
@@ -1556,8 +1572,8 @@ SwLinePortion* SwTxtFormatter::MakeRestPortion( const SwLineLayout* pLine,
else if( pMulti->IsRuby() )
pTmp = new SwRubyPortion( *pHint, *GetInfo().GetFont(), nMultiPos,
((SwRubyPortion*)pMulti)->GetRubyOffset() );
- else if( pMulti->GetRotation() )
- pTmp = new SwRotatedPortion( nMultiPos );
+ else if( pMulti->GetDirection() )
+ pTmp = new SwRotatedPortion( nMultiPos, pMulti->GetDirection() );
else
return pRest;
pTmp->SetFollowFld();
diff --git a/sw/source/core/text/pormulti.hxx b/sw/source/core/text/pormulti.hxx
index f4da32d10771..b4f534cfcf22 100644
--- a/sw/source/core/text/pormulti.hxx
+++ b/sw/source/core/text/pormulti.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: pormulti.hxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: ama $ $Date: 2000-12-21 09:07:10 $
+ * last change: $Author: ama $ $Date: 2001-01-19 15:26:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -110,18 +110,18 @@ class SwMultiPortion : public SwLinePortion
sal_Bool bTop :1; // Phonetic position
sal_Bool bFormatted :1; // Already formatted
sal_Bool bFollowFld :1; // Field follow inside
- sal_Bool bRotation :1; // Rotation (horizontal <-> vertical)
+ sal_uInt8 nDirection:2; // Direction (0/90/180/270 degrees)
protected:
SwMultiPortion( xub_StrLen nEnd ) : pFldRest( 0 ), bTab1( sal_False ),
bTab2( sal_False ), bDouble( sal_False ), bRuby( sal_False ),
- bFormatted( sal_False ), bFollowFld( sal_False ), bRotation( sal_False )
+ bFormatted( sal_False ), bFollowFld( sal_False ), nDirection( 0 )
{ SetWhichPor( POR_MULTI ); SetLen( nEnd ); }
inline void SetDouble() { bDouble = sal_True; }
inline void SetRuby() { bRuby = sal_True; }
inline void SetTop( sal_Bool bNew ) { bTop = bNew; }
inline void SetTab1( sal_Bool bNew ) { bTab1 = bNew; }
inline void SetTab2( sal_Bool bNew ) { bTab2 = bNew; }
- inline void SetRotation( sal_Bool bNew ) { bRotation = bNew; }
+ inline void SetDirection( sal_uInt8 nNew ) { nDirection = nNew; }
inline sal_Bool GetTab1() const { return bTab1; }
inline sal_Bool GetTab2() const { return bTab2; }
public:
@@ -149,7 +149,11 @@ public:
inline sal_Bool ChgSpaceAdd( SwLineLayout* pCurr, short nSpaceAdd );
inline sal_Bool HasBrackets() const;
- inline sal_Bool GetRotation() const { return bRotation; }
+ inline sal_Bool HasRotation() const { return 0 != (1 & nDirection); }
+ inline sal_Bool IsRevers() const { return 0 != (2 & nDirection); }
+ inline sal_uInt8 GetDirection() const { return nDirection; }
+ inline USHORT GetFontRotation() const
+ { return ( HasRotation() ? ( IsRevers() ? 2700 : 900 ) : 0 ); }
OUTPUT_OPERATOR
};
@@ -209,8 +213,8 @@ public:
class SwRotatedPortion : public SwMultiPortion
{
public:
- SwRotatedPortion( xub_StrLen nEnd )
- : SwMultiPortion( nEnd ) { SetRotation( sal_True ); }
+ SwRotatedPortion( xub_StrLen nEnd, sal_uInt8 nDir = 1 )
+ : SwMultiPortion( nEnd ) { SetDirection( nDir ); }
};
// For cursor travelling in multiportions