diff options
-rw-r--r-- | sw/source/core/inc/flyfrms.hxx | 7 | ||||
-rw-r--r-- | sw/source/core/layout/flyincnt.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 25 | ||||
-rw-r--r-- | sw/source/core/text/itrform2.hxx | 7 | ||||
-rw-r--r-- | sw/source/core/text/porlay.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/text/possiz.hxx | 11 | ||||
-rw-r--r-- | sw/source/core/text/txtfly.cxx | 93 |
7 files changed, 124 insertions, 40 deletions
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx index f3e82c5cc0..a664521de7 100644 --- a/sw/source/core/inc/flyfrms.hxx +++ b/sw/source/core/inc/flyfrms.hxx @@ -2,9 +2,9 @@ * * $RCSfile: flyfrms.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:20 $ + * last change: $Author: ama $ $Date: 2001-02-01 13:56:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -162,7 +162,8 @@ public: virtual void Format( const SwBorderAttrs *pAttrs = 0 ); virtual void Modify( SfxPoolItem*, SfxPoolItem* ); - void SetRefPoint( const Point& rPoint, const Point &rRelPos ); + void SetRefPoint( const Point& rPoint, const Point &rRelAttr, + const Point &rRelPos ); const Point &GetRefPoint() const { return aRef; } const Point &GetRelPos() const; long GetLineHeight() const { return nLine; } diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx index 576499a1b6..29cc5640a4 100644 --- a/sw/source/core/layout/flyincnt.cxx +++ b/sw/source/core/layout/flyincnt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: flyincnt.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:22 $ + * last change: $Author: ama $ $Date: 2001-02-01 13:57:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -123,12 +123,13 @@ SwFlyInCntFrm::~SwFlyInCntFrm() |* Letzte Aenderung MA 06. Aug. 95 |* |*************************************************************************/ -void SwFlyInCntFrm::SetRefPoint( const Point& rPoint, const Point& rRelPos ) +void SwFlyInCntFrm::SetRefPoint( const Point& rPoint, const Point& rRelAttr, + const Point& rRelPos ) { - ASSERT( rPoint != aRef || rRelPos != aRelPos, "SetRefPoint: no change" ); + ASSERT( rPoint != aRef || rRelAttr != aRelPos, "SetRefPoint: no change" ); const SwFlyNotify aNotify( this ); aRef = rPoint; - aRelPos = rRelPos; + aRelPos = rRelAttr; Frm().Pos( rPoint + rRelPos ); /* //Kein InvalidatePos hier, denn das wuerde dem Cntnt ein Prepare diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 3068ab31ee..a3003e8bf0 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: itrform2.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: ama $ $Date: 2000-12-21 09:10:30 $ + * last change: $Author: ama $ $Date: 2001-02-01 14:01:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -769,7 +769,8 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf ) && ( rInf.X() + GetLeftMargin() >= rInf.GetPaintOfst() ) ) rInf.SetPaintOfst( 0 ); - if ( pPor->IsFlyCntPortion() ) + if( pPor->IsFlyCntPortion() || ( pPor->IsMultiPortion() && + ((SwMultiPortion*)pPor)->HasFlyInCntnt() ) ) SetFlyInCntBase(); rInf.SetFull( bFull ); @@ -834,7 +835,7 @@ void SwTxtFormatter::CalcAdjustLine( SwLineLayout *pCurr ) CalcAdjLine( pCurr ); // 23348: z.B. bei zentrierten Flys muessen wir den RefPoint // auf jeden Fall umsetzen, deshalb bAllWays = sal_True - UpdatePos( pCurr, sal_True ); + UpdatePos( pCurr, GetTopLeft(), GetStart(), sal_True ); } } } @@ -1233,10 +1234,20 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf ) { SwMultiPortion* pTmp = NULL; if( RES_TXTATR_CJK_RUBY == pTwoLines->Which() ) - pTmp = new SwRubyPortion( *pTwoLines,*rInf.GetFont(),nEnd ); + pTmp = new SwRubyPortion( *pTwoLines,*rInf.GetFont(),nEnd ); else #ifdef ROTATION_TEST - pTmp = new SwRotatedPortion( nEnd ); + { + static sal_uInt8 nTst = 1; + switch ( nTst ) + { + case 1 : + case 3 : pTmp = new SwRotatedPortion( nEnd, nTst ); + break; + default: + pTmp = new SwDoubleLinePortion( *pTwoLines, nEnd ); + } + } #else pTmp = new SwDoubleLinePortion( *pTwoLines, nEnd ); #endif @@ -1447,7 +1458,7 @@ xub_StrLen SwTxtFormatter::FormatLine( const xub_StrLen nStart ) } if ( IsFlyInCntBase() && !IsQuick() ) - UpdatePos( pCurr ); + UpdatePos( pCurr, GetTopLeft(), GetStart() ); return nNewStart; } diff --git a/sw/source/core/text/itrform2.hxx b/sw/source/core/text/itrform2.hxx index 66a3225c93..59d485ba2d 100644 --- a/sw/source/core/text/itrform2.hxx +++ b/sw/source/core/text/itrform2.hxx @@ -2,9 +2,9 @@ * * $RCSfile: itrform2.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: ama $ $Date: 2000-11-09 13:37:53 $ + * last change: $Author: ama $ $Date: 2001-02-01 14:00:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -136,7 +136,8 @@ class SwTxtFormatter : public SwTxtPainter { return GetInfo().GetIdx() < GetInfo().GetReformatStart(); } // durch das Adjustment aendert sich die Position der Portions - void UpdatePos( SwLineLayout *pCurr, sal_Bool bAllWays = sal_False ) const; + void UpdatePos( SwLineLayout *pCurr, Point aStart, xub_StrLen nStartIdx, + sal_Bool bAllWays = sal_False ) const; // Setze alle FlyInCntFrms auf die uebergebene BaseLine void AlignFlyInCntBase( long nBaseLine ) const; diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index ad5a9cf9c2..942ac39ab5 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -2,9 +2,9 @@ * * $RCSfile: porlay.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: ama $ $Date: 2000-12-21 09:04:35 $ + * last change: $Author: ama $ $Date: 2001-02-01 14:02:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,6 +78,9 @@ #ifndef _PORRST_HXX #include <porrst.hxx> // SwHangingPortion #endif +#ifndef _PORMULTI_HXX +#include <pormulti.hxx> // SwMultiPortion +#endif /************************************************************************* @@ -342,7 +345,8 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf ) { if( Height() < nPosHeight ) Height( nPosHeight ); - if( pPos->IsFlyCntPortion() ) + if( pPos->IsFlyCntPortion() || ( pPos->IsMultiPortion() + && ((SwMultiPortion*)pPos)->HasFlyInCntnt() ) ) rLine.SetFlyInCntBase(); if( pPos->IsFlyCntPortion() && ((SwFlyCntPortion*)pPos)->GetAlign() ) diff --git a/sw/source/core/text/possiz.hxx b/sw/source/core/text/possiz.hxx index 23c47cb367..c50606b5f4 100644 --- a/sw/source/core/text/possiz.hxx +++ b/sw/source/core/text/possiz.hxx @@ -2,9 +2,9 @@ * * $RCSfile: possiz.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:26 $ + * last change: $Author: ama $ $Date: 2001-02-01 13:59:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -84,6 +84,7 @@ public: inline Size SvLSize() const { return Size( nWidth, nHeight ); } inline void SvLSize( const Size &rSize ); + inline void SvXSize( const Size &rSize ); inline sal_Bool operator==( const SwPosSize &rSize ) const; inline SwPosSize &operator=( const SwPosSize &rSize ); inline SwPosSize &operator=( const Size &rSize ); @@ -108,6 +109,12 @@ inline void SwPosSize::SvLSize( const Size &rSize ) nHeight = KSHORT(rSize.Height()); } +inline void SwPosSize::SvXSize( const Size &rSize ) +{ + nHeight = KSHORT(rSize.Width()); + nWidth = KSHORT(rSize.Height()); +} + inline SwPosSize &SwPosSize::operator=( const Size &rSize ) { nWidth = KSHORT(rSize.Width()); diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 824e7a5f49..b3c0b11c79 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtfly.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ama $ $Date: 2000-10-17 10:21:27 $ + * last change: $Author: ama $ $Date: 2001-02-01 14:05:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,6 +78,9 @@ #include "flyfrm.hxx" // SwFlyFrm #include "frmtool.hxx" // ::DrawGraphic #include "porfld.hxx" // SwGrfNumPortion +#ifndef _PORMULTI_HXX +#include <pormulti.hxx> // SwMultiPortion +#endif #ifdef VERT_DISTANCE #include <math.h> @@ -252,7 +255,8 @@ void SwTxtFormatter::CalcUnclipped( SwTwips& rTop, SwTwips& rBottom ) * ( hauptsaechlich Korrrektur der X-Position ) *************************************************************************/ -void SwTxtFormatter::UpdatePos( SwLineLayout *pCurr, sal_Bool bAllWays ) const +void SwTxtFormatter::UpdatePos( SwLineLayout *pCurr, Point aStart, + xub_StrLen nStartIdx, sal_Bool bAllWays ) const { if( GetInfo().IsTest() ) return; @@ -262,14 +266,33 @@ void SwTxtFormatter::UpdatePos( SwLineLayout *pCurr, sal_Bool bAllWays ) const aTmpInf.SetSpaceAdd( pCurr->GetpSpaceAdd() ); aTmpInf.ResetSpaceIdx(); // Die Groesse des Frames - aTmpInf.SetIdx( GetStart() ); - aTmpInf.SetPos( GetTopLeft() ); + aTmpInf.SetIdx( nStartIdx ); + aTmpInf.SetPos( aStart ); long nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc; lcl_MaxAscDescent( pPos, nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc ); - KSHORT nAscent, nTmpHeight; - CalcAscentAndHeight( nAscent, nTmpHeight ); - long nTmpY = Y() + nAscent; + KSHORT nTmpHeight = pCurr->GetRealHeight(); + KSHORT nAscent = pCurr->GetAscent() + nTmpHeight - pCurr->Height(); + sal_uInt8 nFlags = SETBASE_ULSPACE; + if( GetMulti() ) + { + aTmpInf.SetDirection( GetMulti()->GetDirection() ); + if( GetMulti()->HasRotation() ) + { + nFlags |= SETBASE_ROTATE; + if( GetMulti()->IsRevers() ) + { + nFlags |= SETBASE_REVERSE; + aTmpInf.X( aTmpInf.X() - nAscent ); + } + else + aTmpInf.X( aTmpInf.X() + nAscent ); + } + else + aTmpInf.Y( aTmpInf.Y() + nAscent ); + } + else + aTmpInf.Y( aTmpInf.Y() + nAscent ); while( pPos ) { @@ -295,11 +318,35 @@ void SwTxtFormatter::UpdatePos( SwLineLayout *pCurr, sal_Bool bAllWays ) const } else { - const Point aBase( aTmpInf.X(), nTmpY ); - ((SwFlyCntPortion*)pPos)->SetBase( aBase, nTmpAscent, - nTmpDescent, nFlyAsc, nFlyDesc, SETBASE_ULSPACE ); + ((SwFlyCntPortion*)pPos)->SetBase( aTmpInf.GetPos(), nTmpAscent, + nTmpDescent, nFlyAsc, nFlyDesc, nFlags ); } } + if( pPos->IsMultiPortion() && ((SwMultiPortion*)pPos)->HasFlyInCntnt() ) + { + ASSERT( !GetMulti(), "Too much multi" ); + ((SwTxtFormatter*)this)->pMulti = (SwMultiPortion*)pPos; + SwLineLayout *pLay = &GetMulti()->GetRoot(); + Point aSt( aStart ); + if( GetMulti()->HasRotation() ) + { + aSt.X() = aTmpInf.X(); + aSt.Y() += pCurr->GetAscent() - GetMulti()->GetAscent(); + if( GetMulti()->IsRevers() ) + aSt.X() += GetMulti()->Width(); + else + aSt.Y() += GetMulti()->Height(); + } + xub_StrLen nStIdx = aTmpInf.GetIdx(); + do + { + UpdatePos( pLay, aSt, nStIdx, bAllWays ); + nStIdx += pLay->GetLen(); + aSt.Y() += pLay->Height(); + pLay = pLay->GetNext(); + } while ( pLay ); + ((SwTxtFormatter*)this)->pMulti = NULL; + } pPos->Move( aTmpInf ); pPos = pPos->GetPortion(); } @@ -316,6 +363,13 @@ void SwTxtFormatter::AlignFlyInCntBase( long nBaseLine ) const return; SwLinePortion *pFirst = pCurr->GetFirstPortion(); SwLinePortion *pPos = pFirst; + sal_uInt8 nFlags = SETBASE_NOFLAG; + if( GetMulti() && GetMulti()->HasRotation() ) + { + nFlags |= SETBASE_ROTATE; + if( GetMulti()->IsRevers() ) + nFlags |= SETBASE_REVERSE; + } long nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc; @@ -333,7 +387,7 @@ void SwTxtFormatter::AlignFlyInCntBase( long nBaseLine ) const const Point aBase( ( (SwFlyCntPortion*)pPos)->GetRefPoint().X(), nBaseLine ); ((SwFlyCntPortion*)pPos)->SetBase( aBase, nTmpAscent, nTmpDescent, - nFlyAsc, nFlyDesc, SETBASE_NOFLAG ); + nFlyAsc, nFlyDesc, nFlags ); } } pPos = pPos->GetPortion(); @@ -578,11 +632,18 @@ SwFlyCntPortion *SwTxtFormatter::NewFlyCntPortion( SwTxtFormatInfo &rInf, nFlyAsc = nAscent; Point aBase( GetLeftMargin() + rInf.X(), Y() + nAscent ); + sal_uInt8 nMode = IsQuick() ? SETBASE_QUICK : 0; + if( GetMulti() && GetMulti()->HasRotation() ) + { + nMode |= SETBASE_ROTATE; + if( GetMulti()->IsRevers() ) + nMode |= SETBASE_REVERSE; + } if( pFly ) { pRet = new SwFlyCntPortion( pFly, aBase, nTmpAscent, nTmpDescent, - nFlyAsc, nFlyDesc, IsQuick() ); + nFlyAsc, nFlyDesc, nMode ); // Wir muessen sicherstellen, dass unser Font wieder im OutputDevice // steht. Es koennte sein, dass der FlyInCnt frisch eingefuegt wurde, // dann hat GetFlyFrm dazu gefuehrt, dass er neu angelegt wird. @@ -592,9 +653,7 @@ SwFlyCntPortion *SwTxtFormatter::NewFlyCntPortion( SwTxtFormatInfo &rInf, if( pRet->GetAscent() > nAscent ) { aBase.Y() = Y() + pRet->GetAscent(); - sal_uInt8 nMode = SETBASE_ULSPACE; - if( IsQuick() ) - nMode |= SETBASE_QUICK; + nMode |= SETBASE_ULSPACE; if( !rInf.IsTest() ) pRet->SetBase( aBase, nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc, nMode ); @@ -603,7 +662,7 @@ SwFlyCntPortion *SwTxtFormatter::NewFlyCntPortion( SwTxtFormatInfo &rInf, else { pRet = new SwFlyCntPortion( (SwDrawContact*)pFrmFmt->FindContactObj(), - aBase, nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc, IsQuick() ); + aBase, nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc, nMode ); } return pRet; } |