Kaydet (Commit) 1b081132 authored tarafından Andreas Martens's avatar Andreas Martens

Fix #81821#: 2-line attribut on whole paragraph

üst 3f2977d9
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: inftxt.hxx,v $ * $RCSfile: inftxt.hxx,v $
* *
* $Revision: 1.14 $ * $Revision: 1.15 $
* *
* last change: $Author: ama $ $Date: 2001-01-19 15:18:57 $ * last change: $Author: ama $ $Date: 2001-02-06 15:19:24 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -98,6 +98,7 @@ class SwViewOption; ...@@ -98,6 +98,7 @@ class SwViewOption;
class ViewShell; class ViewShell;
class SwTxtFtn; class SwTxtFtn;
class SwAttrIter; class SwAttrIter;
struct SwMultiCreator;
/* Minimum: Prozentwert fuers kernen */ /* Minimum: Prozentwert fuers kernen */
#define MINKERNPERCENT 5 #define MINKERNPERCENT 5
...@@ -223,7 +224,7 @@ public: ...@@ -223,7 +224,7 @@ public:
// GetMultiAttr returns the text attribute of the multiportion, // GetMultiAttr returns the text attribute of the multiportion,
// if rPos is inside any multi-line part. // if rPos is inside any multi-line part.
// rPos will set to the end of the multi-line part. // rPos will set to the end of the multi-line part.
const SwTxtAttr* GetMultiAttr( xub_StrLen &rPos ) const; SwMultiCreator* GetMultiCreator( xub_StrLen &rPos ) const;
inline sal_Bool OnWin() const { return bOnWin; } inline sal_Bool OnWin() const { return bOnWin; }
inline void SetOnWin( const sal_Bool bNew ) { bOnWin = bNew; } inline void SetOnWin( const sal_Bool bNew ) { bOnWin = bNew; }
......
This diff is collapsed.
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: itrform2.cxx,v $ * $RCSfile: itrform2.cxx,v $
* *
* $Revision: 1.16 $ * $Revision: 1.17 $
* *
* last change: $Author: ama $ $Date: 2001-02-01 14:01:34 $ * last change: $Author: ama $ $Date: 2001-02-06 15:26:49 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -1229,12 +1229,12 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf ) ...@@ -1229,12 +1229,12 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
{ // We open a multiportion part, if we enter a multi-line part { // We open a multiportion part, if we enter a multi-line part
// of the paragraph. // of the paragraph.
xub_StrLen nEnd = rInf.GetIdx(); xub_StrLen nEnd = rInf.GetIdx();
const SwTxtAttr* pTwoLines = rInf.GetMultiAttr( nEnd ); SwMultiCreator* pCreate = rInf.GetMultiCreator( nEnd );
if( pTwoLines ) if( pCreate )
{ {
SwMultiPortion* pTmp = NULL; SwMultiPortion* pTmp = NULL;
if( RES_TXTATR_CJK_RUBY == pTwoLines->Which() ) if( SW_MC_RUBY == pCreate->nId )
pTmp = new SwRubyPortion( *pTwoLines,*rInf.GetFont(),nEnd ); pTmp = new SwRubyPortion( *pCreate, *rInf.GetFont(), nEnd );
else else
#ifdef ROTATION_TEST #ifdef ROTATION_TEST
{ {
...@@ -1245,12 +1245,13 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf ) ...@@ -1245,12 +1245,13 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
case 3 : pTmp = new SwRotatedPortion( nEnd, nTst ); case 3 : pTmp = new SwRotatedPortion( nEnd, nTst );
break; break;
default: default:
pTmp = new SwDoubleLinePortion( *pTwoLines, nEnd ); pTmp = new SwDoubleLinePortion( *pCreate, nEnd );
} }
} }
#else #else
pTmp = new SwDoubleLinePortion( *pTwoLines, nEnd ); pTmp = new SwDoubleLinePortion( *pCreate, nEnd );
#endif #endif
delete pCreate;
return pTmp; return pTmp;
} }
} }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: itrtxt.hxx,v $ * $RCSfile: itrtxt.hxx,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: ama $ $Date: 2000-10-30 09:59:26 $ * last change: $Author: ama $ $Date: 2001-02-06 15:24:26 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -187,7 +187,7 @@ private: ...@@ -187,7 +187,7 @@ private:
protected: protected:
// fuer FormatQuoVadis // fuer FormatQuoVadis
inline void Right( const KSHORT nNew ) { nRight = nNew; } inline void Right( const SwTwips nNew ) { nRight = nNew; }
// fuer CalcFlyAdjust // fuer CalcFlyAdjust
inline void SetDropLeft( const KSHORT nNew ) { nDropLeft = nNew; } inline void SetDropLeft( const KSHORT nNew ) { nDropLeft = nNew; }
...@@ -208,6 +208,7 @@ public: ...@@ -208,6 +208,7 @@ public:
inline sal_Bool IsLastBlock() const { return bLastBlock; } inline sal_Bool IsLastBlock() const { return bLastBlock; }
inline sal_Bool IsLastCenter() const { return bLastCenter; } inline sal_Bool IsLastCenter() const { return bLastCenter; }
inline MSHORT GetAdjust() const { return nAdjust; } inline MSHORT GetAdjust() const { return nAdjust; }
inline void SetAdjust( const MSHORT nNew ) { nAdjust = nNew; }
inline KSHORT GetLineWidth() const inline KSHORT GetLineWidth() const
{ return KSHORT( Right() - GetLeftMargin() + 1 ); } { return KSHORT( Right() - GetLeftMargin() + 1 ); }
inline SwTwips GetLeftMin() const { return nFirst < nLeft ? nFirst : nLeft; } inline SwTwips GetLeftMin() const { return nFirst < nLeft ? nFirst : nLeft; }
...@@ -291,6 +292,7 @@ class SwTxtCursor : public SwTxtAdjuster ...@@ -291,6 +292,7 @@ class SwTxtCursor : public SwTxtAdjuster
// 1170: Mehrdeutigkeiten // 1170: Mehrdeutigkeiten
static sal_Bool bRightMargin; static sal_Bool bRightMargin;
void _GetCharRect(SwRect *, const xub_StrLen, SwCrsrMoveState* );
protected: protected:
void CtorInit( SwTxtFrm *pFrm, SwTxtSizeInfo *pInf ); void CtorInit( SwTxtFrm *pFrm, SwTxtSizeInfo *pInf );
inline SwTxtCursor() { } inline SwTxtCursor() { }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: pormulti.hxx,v $ * $RCSfile: pormulti.hxx,v $
* *
* $Revision: 1.12 $ * $Revision: 1.13 $
* *
* last change: $Author: ama $ $Date: 2001-02-01 14:42:39 $ * last change: $Author: ama $ $Date: 2001-02-06 15:20:58 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -71,6 +71,28 @@ class SwTxtCursor; ...@@ -71,6 +71,28 @@ class SwTxtCursor;
class SwLineLayout; class SwLineLayout;
class SwBlankPortion; class SwBlankPortion;
class SwTxtPaintInfo; class SwTxtPaintInfo;
class SwTxtAttr;
class SfxPoolItem;
class SwFont;
/*-----------------02.02.01 15:01-------------------
* SwMultiCreator is a small structur to create a multiportion.
* It contains the kind of multiportion and a textattribute
* or a poolitem.
* The GetMultiCreator-function fills this structur and
* the Ctor of the SwMultiPortion uses it.
* --------------------------------------------------*/
#define SW_MC_DOUBLE 0
#define SW_MC_RUBY 1
#define SW_MC_ROTATE 2
struct SwMultiCreator
{
const SwTxtAttr* pAttr;
const SfxPoolItem* pItem;
BYTE nId;
};
/*-----------------25.10.00 16:19------------------- /*-----------------25.10.00 16:19-------------------
* A two-line-portion (SwMultiPortion) could have surrounding brackets, * A two-line-portion (SwMultiPortion) could have surrounding brackets,
...@@ -169,7 +191,7 @@ class SwDoubleLinePortion : public SwMultiPortion ...@@ -169,7 +191,7 @@ class SwDoubleLinePortion : public SwMultiPortion
xub_StrLen nBlank2; // Number of blanks in the second line xub_StrLen nBlank2; // Number of blanks in the second line
public: public:
SwDoubleLinePortion( SwDoubleLinePortion& rDouble, xub_StrLen nEnd ); SwDoubleLinePortion( SwDoubleLinePortion& rDouble, xub_StrLen nEnd );
SwDoubleLinePortion( const SwTxtAttr& rAttr, xub_StrLen nEnd ); SwDoubleLinePortion( const SwMultiCreator& rCreate, xub_StrLen nEnd );
~SwDoubleLinePortion(); ~SwDoubleLinePortion();
inline SwBracket* GetBrackets() const { return pBracket; } inline SwBracket* GetBrackets() const { return pBracket; }
...@@ -205,8 +227,8 @@ public: ...@@ -205,8 +227,8 @@ public:
SwRubyPortion( xub_StrLen nEnd, USHORT nAdj, USHORT nPos, xub_StrLen nOfst ) SwRubyPortion( xub_StrLen nEnd, USHORT nAdj, USHORT nPos, xub_StrLen nOfst )
: SwMultiPortion( nEnd ), nRubyOffset( nOfst ), nAdjustment( nAdj ) : SwMultiPortion( nEnd ), nRubyOffset( nOfst ), nAdjustment( nAdj )
{ SetRuby(); SetTop(!nPos); } { SetRuby(); SetTop(!nPos); }
SwRubyPortion( const SwTxtAttr& rAttr, const SwFont& rFnt, xub_StrLen nEnd, SwRubyPortion( const SwMultiCreator& rCreate, const SwFont& rFnt,
xub_StrLen nOffs = 0 ); xub_StrLen nEnd, xub_StrLen nOffs = 0 );
void CalcRubyOffset(); void CalcRubyOffset();
inline void Adjust( SwTxtFormatInfo &rInf ) inline void Adjust( SwTxtFormatInfo &rInf )
{ if(nAdjustment && GetRoot().GetNext()) _Adjust(rInf); } { if(nAdjustment && GetRoot().GetNext()) _Adjust(rInf); }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: txtftn.cxx,v $ * $RCSfile: txtftn.cxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: ama $ $Date: 2000-12-07 08:59:26 $ * last change: $Author: ama $ $Date: 2001-02-06 15:23:10 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -1118,7 +1118,7 @@ xub_StrLen SwTxtFormatter::FormatQuoVadis( const xub_StrLen nOffset ) ...@@ -1118,7 +1118,7 @@ xub_StrLen SwTxtFormatter::FormatQuoVadis( const xub_StrLen nOffset )
rInf.GetParaPortion()->GetReformat()->Start() = rInf.GetIdx(); rInf.GetParaPortion()->GetReformat()->Start() = rInf.GetIdx();
// Jetzt wird formatiert // Jetzt wird formatiert
Right( KSHORT(Right()) - pQuo->Width() ); Right( Right() - pQuo->Width() );
const xub_StrLen nRet = FormatLine( nStart ); const xub_StrLen nRet = FormatLine( nStart );
Right( rInf.Left() + nOldRealWidth - 1 ); Right( rInf.Left() + nOldRealWidth - 1 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment