xref: /AOO41X/main/sw/source/core/text/porlay.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _PORLAY_HXX
24cdf0e10cSrcweir #define _PORLAY_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <tools/string.hxx>
27cdf0e10cSrcweir #include <tools/fract.hxx>
28cdf0e10cSrcweir #include <scriptinfo.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include "swrect.hxx"   // SwRepaint
31cdf0e10cSrcweir #include "portxt.hxx"
32cdf0e10cSrcweir #include "swfont.hxx"
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #include <vector>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir class SwMarginPortion;
37cdf0e10cSrcweir class SwDropPortion;
38cdf0e10cSrcweir class SvStream;
39cdf0e10cSrcweir class SwTxtFormatter;
40cdf0e10cSrcweir 
41cdf0e10cSrcweir /*************************************************************************
42cdf0e10cSrcweir  *						class SwCharRange
43cdf0e10cSrcweir  *************************************************************************/
44cdf0e10cSrcweir 
45cdf0e10cSrcweir class SwCharRange
46cdf0e10cSrcweir {
47cdf0e10cSrcweir 	xub_StrLen nStart, nLen;
48cdf0e10cSrcweir public:
SwCharRange(const xub_StrLen nInitStart=0,const xub_StrLen nInitLen=0)49cdf0e10cSrcweir 	inline SwCharRange( const xub_StrLen nInitStart = 0,
50cdf0e10cSrcweir 		const xub_StrLen nInitLen = 0):	nStart( nInitStart ), nLen(nInitLen) {}
Start()51cdf0e10cSrcweir 	inline xub_StrLen &Start() { return nStart; }
Start() const52cdf0e10cSrcweir 	inline const xub_StrLen &Start() const { return nStart; }
LeftMove(xub_StrLen nNew)53cdf0e10cSrcweir 	inline void LeftMove( xub_StrLen nNew )
54cdf0e10cSrcweir 			{ if ( nNew < nStart ) { nLen += nStart-nNew; nStart = nNew; } }
End() const55cdf0e10cSrcweir 	inline xub_StrLen End() const
56cdf0e10cSrcweir 				{ return nStart + nLen; }
Len()57cdf0e10cSrcweir 	inline xub_StrLen &Len() { return nLen; }
Len() const58cdf0e10cSrcweir 	inline const xub_StrLen &Len() const { return nLen; }
operator <(const SwCharRange & rRange) const59cdf0e10cSrcweir 	inline sal_Bool operator<(const SwCharRange &rRange) const
60cdf0e10cSrcweir 				{ return nStart < rRange.nStart; }
operator >(const SwCharRange & rRange) const61cdf0e10cSrcweir 	inline sal_Bool operator>(const SwCharRange &rRange) const
62cdf0e10cSrcweir 				{ return nStart + nLen > rRange.nStart + rRange.nLen; }
operator !=(const SwCharRange & rRange) const63cdf0e10cSrcweir 	inline sal_Bool operator!=(const SwCharRange &rRange) const
64cdf0e10cSrcweir 				{ return *this < rRange || *this > rRange; }
65cdf0e10cSrcweir 	SwCharRange &operator+=(const SwCharRange &rRange);
66cdf0e10cSrcweir };
67cdf0e10cSrcweir 
68cdf0e10cSrcweir /*************************************************************************
69cdf0e10cSrcweir  *						class SwRepaint
70cdf0e10cSrcweir  *************************************************************************/
71cdf0e10cSrcweir 
72cdf0e10cSrcweir // SwRepaint ist ein dokumentglobales SwRect mit einem nOfst der angibt,
73cdf0e10cSrcweir // ab wo in der ersten Zeile gepaintet werden soll
74cdf0e10cSrcweir // und einem nRightOfst, der den rechten Rand bestimmt
75cdf0e10cSrcweir class SwRepaint : public SwRect
76cdf0e10cSrcweir {
77cdf0e10cSrcweir 	SwTwips nOfst;
78cdf0e10cSrcweir 	SwTwips nRightOfst;
79cdf0e10cSrcweir public:
SwRepaint()80cdf0e10cSrcweir 	SwRepaint() : SwRect(), nOfst( 0 ), nRightOfst( 0 ) {}
SwRepaint(const SwRepaint & rRep)81cdf0e10cSrcweir 	SwRepaint( const SwRepaint& rRep ) : SwRect( rRep ), nOfst( rRep.nOfst ),
82cdf0e10cSrcweir 		nRightOfst( rRep.nRightOfst ) {}
83cdf0e10cSrcweir 
GetOfst() const84cdf0e10cSrcweir 	SwTwips GetOfst() const { return nOfst; }
SetOfst(const SwTwips nNew)85cdf0e10cSrcweir 	void   SetOfst( const SwTwips nNew ) { nOfst = nNew; }
GetRightOfst() const86cdf0e10cSrcweir 	SwTwips GetRightOfst() const { return nRightOfst; }
SetRightOfst(const SwTwips nNew)87cdf0e10cSrcweir 	void   SetRightOfst( const SwTwips nNew ) { nRightOfst = nNew; }
88cdf0e10cSrcweir };
89cdf0e10cSrcweir 
90cdf0e10cSrcweir /*************************************************************************
91cdf0e10cSrcweir  *						class SwLineLayout
92cdf0e10cSrcweir  *************************************************************************/
93cdf0e10cSrcweir 
94cdf0e10cSrcweir class SwLineLayout : public SwTxtPortion
95cdf0e10cSrcweir {
96cdf0e10cSrcweir private:
97cdf0e10cSrcweir     SwLineLayout *pNext;                // Die naechste Zeile.
98cdf0e10cSrcweir     std::vector<long>* pLLSpaceAdd;     // Used for justified alignment.
99cdf0e10cSrcweir     SvUShorts* pKanaComp;               // Used for Kana compression.
100cdf0e10cSrcweir     KSHORT nRealHeight;                 // Die aus Zeilenabstand/Register resultierende Hoehe.
101cdf0e10cSrcweir 	sal_Bool bFormatAdj : 1;
102cdf0e10cSrcweir 	sal_Bool bDummy 	: 1;
103cdf0e10cSrcweir 	sal_Bool bFntChg	: 1;
104cdf0e10cSrcweir 	sal_Bool bEndHyph	: 1;
105cdf0e10cSrcweir 	sal_Bool bMidHyph	: 1;
106cdf0e10cSrcweir 	sal_Bool bTab		: 1;
107cdf0e10cSrcweir     sal_Bool bFly       : 1;
108cdf0e10cSrcweir 	sal_Bool bRest		: 1;
109cdf0e10cSrcweir 	sal_Bool bBlinking	: 1;
110cdf0e10cSrcweir 	sal_Bool bClipping	: 1; // Clipping erforderlich wg. exakter Zeilenhoehe
111cdf0e10cSrcweir 	sal_Bool bContent	: 1; // enthaelt Text, fuer Zeilennumerierung
112cdf0e10cSrcweir 	sal_Bool bRedline	: 1; // enthaelt Redlining
113cdf0e10cSrcweir 	sal_Bool bForcedLeftMargin : 1; // vom Fly verschobener linker Einzug
114cdf0e10cSrcweir 	sal_Bool bHanging : 1; // contents a hanging portion in the margin
115cdf0e10cSrcweir     sal_Bool bUnderscore : 1;
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 	SwTwips _GetHangingMargin() const;
118cdf0e10cSrcweir 
119cdf0e10cSrcweir public:
120cdf0e10cSrcweir 	// von SwLinePortion
121cdf0e10cSrcweir 	virtual SwLinePortion *Insert( SwLinePortion *pPortion );
122cdf0e10cSrcweir 	virtual SwLinePortion *Append( SwLinePortion *pPortion );
123cdf0e10cSrcweir 	inline SwLinePortion *GetFirstPortion() const;
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 	// Flags
126cdf0e10cSrcweir 	inline void ResetFlags();
SetFormatAdj(const sal_Bool bNew)127cdf0e10cSrcweir 	inline void SetFormatAdj( const sal_Bool bNew ) { bFormatAdj = bNew; }
IsFormatAdj() const128cdf0e10cSrcweir 	inline sal_Bool IsFormatAdj() const { return bFormatAdj; }
SetFntChg(const sal_Bool bNew)129cdf0e10cSrcweir 	inline void SetFntChg( const sal_Bool bNew ) { bFntChg = bNew; }
IsFntChg() const130cdf0e10cSrcweir 	inline sal_Bool IsFntChg() const { return bFntChg; }
SetEndHyph(const sal_Bool bNew)131cdf0e10cSrcweir 	inline void SetEndHyph( const sal_Bool bNew ) { bEndHyph = bNew; }
IsEndHyph() const132cdf0e10cSrcweir 	inline sal_Bool IsEndHyph() const { return bEndHyph; }
SetMidHyph(const sal_Bool bNew)133cdf0e10cSrcweir 	inline void SetMidHyph( const sal_Bool bNew ) { bMidHyph = bNew; }
IsMidHyph() const134cdf0e10cSrcweir 	inline sal_Bool IsMidHyph() const { return bMidHyph; }
SetTab(const sal_Bool bNew)135cdf0e10cSrcweir 	inline void SetTab( const sal_Bool bNew ) { bTab = bNew; }
IsTab() const136cdf0e10cSrcweir 	inline sal_Bool IsTab() const { return bTab; }
SetFly(const sal_Bool bNew)137cdf0e10cSrcweir     inline void SetFly( const sal_Bool bNew ) { bFly = bNew; }
IsFly() const138cdf0e10cSrcweir     inline sal_Bool IsFly() const { return bFly; }
SetRest(const sal_Bool bNew)139cdf0e10cSrcweir 	inline void SetRest( const sal_Bool bNew ) { bRest = bNew; }
IsRest() const140cdf0e10cSrcweir 	inline sal_Bool IsRest() const { return bRest; }
SetBlinking(const sal_Bool bNew=sal_True)141cdf0e10cSrcweir 	inline void SetBlinking( const sal_Bool bNew = sal_True ) { bBlinking = bNew; }
IsBlinking() const142cdf0e10cSrcweir 	inline sal_Bool IsBlinking() const { return bBlinking; }
SetCntnt(const sal_Bool bNew=sal_True)143cdf0e10cSrcweir 	inline void SetCntnt( const sal_Bool bNew = sal_True ) { bContent = bNew; }
HasCntnt() const144cdf0e10cSrcweir 	inline sal_Bool HasCntnt() const { return bContent; }
SetRedline(const sal_Bool bNew=sal_True)145cdf0e10cSrcweir 	inline void SetRedline( const sal_Bool bNew = sal_True ) { bRedline = bNew; }
HasRedline() const146cdf0e10cSrcweir 	inline sal_Bool HasRedline() const { return bRedline; }
SetForcedLeftMargin(const sal_Bool bNew=sal_True)147cdf0e10cSrcweir 	inline void SetForcedLeftMargin( const sal_Bool bNew = sal_True ) { bForcedLeftMargin = bNew; }
HasForcedLeftMargin() const148cdf0e10cSrcweir 	inline sal_Bool HasForcedLeftMargin() const { return bForcedLeftMargin; }
SetHanging(const sal_Bool bNew=sal_True)149cdf0e10cSrcweir 	inline void SetHanging( const sal_Bool bNew = sal_True ) { bHanging = bNew; }
IsHanging() const150cdf0e10cSrcweir 	inline sal_Bool IsHanging() const { return bHanging; }
SetUnderscore(const sal_Bool bNew=sal_True)151cdf0e10cSrcweir     inline void SetUnderscore( const sal_Bool bNew = sal_True ) { bUnderscore = bNew; }
HasUnderscore() const152cdf0e10cSrcweir     inline sal_Bool HasUnderscore() const { return bUnderscore; }
153cdf0e10cSrcweir 
154cdf0e10cSrcweir 	// Beruecksichtigung von Dummyleerzeilen
155cdf0e10cSrcweir 	// 4147, 8221:
SetDummy(const sal_Bool bNew)156cdf0e10cSrcweir 	inline void SetDummy( const sal_Bool bNew ) { bDummy = bNew; }
IsDummy() const157cdf0e10cSrcweir 	inline sal_Bool IsDummy() const { return bDummy; }
158cdf0e10cSrcweir 
SetClipping(const sal_Bool bNew)159cdf0e10cSrcweir 	inline void SetClipping( const sal_Bool bNew ) { bClipping = bNew; }
IsClipping() const160cdf0e10cSrcweir 	inline sal_Bool IsClipping() const { return bClipping; }
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 	inline SwLineLayout();
163cdf0e10cSrcweir 	virtual ~SwLineLayout();
164cdf0e10cSrcweir 
GetNext()165cdf0e10cSrcweir 	inline SwLineLayout *GetNext() { return pNext; }
GetNext() const166cdf0e10cSrcweir 	inline const SwLineLayout *GetNext() const { return pNext; }
SetNext(SwLineLayout * pNew)167cdf0e10cSrcweir 	inline void SetNext( SwLineLayout *pNew ) { pNext = pNew; }
168cdf0e10cSrcweir 
169cdf0e10cSrcweir 	void Init( SwLinePortion *pNextPortion = NULL);
170cdf0e10cSrcweir 
171cdf0e10cSrcweir 	// Sammelt die Daten fuer die Zeile.
172cdf0e10cSrcweir 	void CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf );
173cdf0e10cSrcweir 
SetRealHeight(KSHORT nNew)174cdf0e10cSrcweir 	inline void SetRealHeight( KSHORT nNew ) { nRealHeight = nNew; }
GetRealHeight() const175cdf0e10cSrcweir 	inline KSHORT GetRealHeight() const { return nRealHeight; }
176cdf0e10cSrcweir 
177cdf0e10cSrcweir 	// Erstellt bei kurzen Zeilen die Glue-Kette.
178cdf0e10cSrcweir 	SwMarginPortion *CalcLeftMargin();
179cdf0e10cSrcweir 
GetHangingMargin() const180cdf0e10cSrcweir 	inline SwTwips GetHangingMargin() const
181cdf0e10cSrcweir         { return _GetHangingMargin(); }
182cdf0e10cSrcweir 
183cdf0e10cSrcweir 	// fuer die Sonderbehandlung bei leeren Zeilen
184cdf0e10cSrcweir 	virtual sal_Bool Format( SwTxtFormatInfo &rInf );
185cdf0e10cSrcweir 
186cdf0e10cSrcweir     //
187cdf0e10cSrcweir     // STUFF FOR JUSTIFIED ALIGNMENT
188cdf0e10cSrcweir     //
IsSpaceAdd()189cdf0e10cSrcweir     inline sal_Bool IsSpaceAdd() { return pLLSpaceAdd != NULL; }
190cdf0e10cSrcweir     void InitSpaceAdd();     // Creates pLLSpaceAdd if necessary
191cdf0e10cSrcweir     void CreateSpaceAdd( const long nInit = 0 );
FinishSpaceAdd()192cdf0e10cSrcweir     inline void FinishSpaceAdd() { delete pLLSpaceAdd; pLLSpaceAdd = NULL; }
GetLLSpaceAddCount() const193cdf0e10cSrcweir     inline sal_uInt16 GetLLSpaceAddCount() const { return sal::static_int_cast< sal_uInt16 >(pLLSpaceAdd->size()); }
SetLLSpaceAdd(long nNew,sal_uInt16 nIdx)194cdf0e10cSrcweir     inline void SetLLSpaceAdd( long nNew, sal_uInt16 nIdx )
195cdf0e10cSrcweir     {
196cdf0e10cSrcweir         if ( nIdx == GetLLSpaceAddCount() )
197cdf0e10cSrcweir             pLLSpaceAdd->push_back( nNew );
198cdf0e10cSrcweir         else
199cdf0e10cSrcweir             (*pLLSpaceAdd)[ nIdx ] = nNew;
200cdf0e10cSrcweir     }
GetLLSpaceAdd(sal_uInt16 nIdx)201cdf0e10cSrcweir     inline long GetLLSpaceAdd( sal_uInt16 nIdx ) { return (*pLLSpaceAdd)[ nIdx ]; }
RemoveFirstLLSpaceAdd()202cdf0e10cSrcweir     inline void RemoveFirstLLSpaceAdd() { pLLSpaceAdd->erase( pLLSpaceAdd->begin() ); }
GetpLLSpaceAdd() const203cdf0e10cSrcweir     inline std::vector<long>* GetpLLSpaceAdd() const { return pLLSpaceAdd; }
204cdf0e10cSrcweir 
205cdf0e10cSrcweir     //
206cdf0e10cSrcweir     // STUFF FOR KANA COMPRESSION
207cdf0e10cSrcweir     //
SetKanaComp(SvUShorts * pNew)208cdf0e10cSrcweir     inline void SetKanaComp( SvUShorts* pNew ){ pKanaComp = pNew; }
FinishKanaComp()209cdf0e10cSrcweir     inline void FinishKanaComp() { delete pKanaComp; pKanaComp = NULL; }
GetpKanaComp() const210cdf0e10cSrcweir     inline SvUShorts* GetpKanaComp() const { return pKanaComp; }
GetKanaComp()211cdf0e10cSrcweir     inline SvUShorts& GetKanaComp() { return *pKanaComp; }
212cdf0e10cSrcweir 
213cdf0e10cSrcweir     /** determine ascent and descent for positioning of as-character anchored
214cdf0e10cSrcweir         object
215cdf0e10cSrcweir 
216cdf0e10cSrcweir         OD 07.01.2004 #i11859# - previously local method <lcl_MaxAscDescent>
217cdf0e10cSrcweir         Method calculates maximum ascents and descents of the line layout.
218cdf0e10cSrcweir         One value considering as-character anchored objects, one without these
219cdf0e10cSrcweir         objects.
220cdf0e10cSrcweir         Portions for other anchored objects aren't considered.
221cdf0e10cSrcweir         OD 2005-05-20 #i47162# - add optional parameter <_bNoFlyCntPorAndLinePor>
222cdf0e10cSrcweir         to control, if the fly content portions and line portion are considered.
223cdf0e10cSrcweir 
224cdf0e10cSrcweir         @param _orAscent
225cdf0e10cSrcweir         output parameter - maximum ascent without as-character anchored objects
226cdf0e10cSrcweir 
227cdf0e10cSrcweir         @param _orDescent
228cdf0e10cSrcweir         output parameter - maximum descent without as-character anchored objects
229cdf0e10cSrcweir 
230cdf0e10cSrcweir         @param _orObjAscent
231cdf0e10cSrcweir         output parameter - maximum ascent with as-character anchored objects
232cdf0e10cSrcweir 
233cdf0e10cSrcweir         @param _orObjDescent
234cdf0e10cSrcweir         output parameter - maximum descent with as-character anchored objects
235cdf0e10cSrcweir 
236cdf0e10cSrcweir         @param _pDontConsiderPortion
237cdf0e10cSrcweir         input parameter - portion, which isn't considered for calculating
238cdf0e10cSrcweir         <_orObjAscent> and <_orObjDescent>, if it isn't a portion for a
239cdf0e10cSrcweir         as-character anchored object or it isn't as high as the line.
240cdf0e10cSrcweir 
241cdf0e10cSrcweir         @param _bNoFlyCntPorAndLinePor
242cdf0e10cSrcweir         optional input parameter - boolean, indicating that fly content portions
243cdf0e10cSrcweir         and the line portion are considered or not.
244cdf0e10cSrcweir 
245cdf0e10cSrcweir         @author OD
246cdf0e10cSrcweir     */
247cdf0e10cSrcweir     void MaxAscentDescent( SwTwips& _orAscent,
248cdf0e10cSrcweir                            SwTwips& _orDescent,
249cdf0e10cSrcweir                            SwTwips& _orObjAscent,
250cdf0e10cSrcweir                            SwTwips& _orObjDescent,
251cdf0e10cSrcweir                            const SwLinePortion* _pDontConsiderPortion = NULL,
252cdf0e10cSrcweir                            const bool _bNoFlyCntPorAndLinePor = false ) const;
253cdf0e10cSrcweir 
254cdf0e10cSrcweir #ifdef DBG_UTIL
255cdf0e10cSrcweir 	void DebugPortions( SvStream &rOs, const XubString &rTxt,
256cdf0e10cSrcweir 						const xub_StrLen nStart ); //$ ostream
257cdf0e10cSrcweir #endif
258cdf0e10cSrcweir 
259cdf0e10cSrcweir 	OUTPUT_OPERATOR
260cdf0e10cSrcweir 	DECL_FIXEDMEMPOOL_NEWDEL(SwLineLayout)
261cdf0e10cSrcweir };
262cdf0e10cSrcweir 
263cdf0e10cSrcweir class SwParaPortion : public SwLineLayout
264cdf0e10cSrcweir {
265cdf0e10cSrcweir 	// neu zu paintender Bereich
266cdf0e10cSrcweir 	SwRepaint aRepaint;
267cdf0e10cSrcweir 	// neu zu formatierender Bereich
268cdf0e10cSrcweir 	SwCharRange aReformat;
269cdf0e10cSrcweir 	SwScriptInfo aScriptInfo;
270cdf0e10cSrcweir //   Fraction aZoom;
271cdf0e10cSrcweir     long nDelta;
272cdf0e10cSrcweir 
273cdf0e10cSrcweir 	// Wenn ein SwTxtFrm gelocked ist, werden keine Veraenderungen an den
274cdf0e10cSrcweir 	// Formatierungsdaten (unter pLine) vorgenommen (vgl. ORPHANS)
275cdf0e10cSrcweir 	sal_Bool bFlys			: 1; // Ueberlappen Flys ?
276cdf0e10cSrcweir 	sal_Bool bPrep			: 1; // PREP_*
277cdf0e10cSrcweir 	sal_Bool bPrepWidows	: 1; // PREP_WIDOWS
278cdf0e10cSrcweir 	sal_Bool bPrepAdjust	: 1; // PREP_ADJUST_FRM
279cdf0e10cSrcweir 	sal_Bool bPrepMustFit	: 1; // PREP_MUST_FIT
280cdf0e10cSrcweir 	sal_Bool bFollowField	: 1; // Es steht noch ein Feldrest fuer den Follow an.
281cdf0e10cSrcweir 
282cdf0e10cSrcweir 	sal_Bool bFixLineHeight	: 1; // Feste Zeilenhoehe
283cdf0e10cSrcweir 	sal_Bool bFtnNum	: 1; // contents a footnotenumberportion
284cdf0e10cSrcweir 	sal_Bool bMargin	: 1; // contents a hanging punctuation in the margin
285cdf0e10cSrcweir 
286cdf0e10cSrcweir 	sal_Bool bFlag00	: 1; //
287cdf0e10cSrcweir 	sal_Bool bFlag11	: 1; //
288cdf0e10cSrcweir 	sal_Bool bFlag12	: 1; //
289cdf0e10cSrcweir 	sal_Bool bFlag13	: 1; //
290cdf0e10cSrcweir 	sal_Bool bFlag14	: 1; //
291cdf0e10cSrcweir 	sal_Bool bFlag15	: 1; //
292cdf0e10cSrcweir 	sal_Bool bFlag16	: 1; //
293cdf0e10cSrcweir 
294cdf0e10cSrcweir public:
295cdf0e10cSrcweir 	SwParaPortion();
296cdf0e10cSrcweir     virtual ~SwParaPortion();
297cdf0e10cSrcweir 
298cdf0e10cSrcweir 	// setzt alle Formatinformationen zurueck (ausser bFlys wg. 9916)
299cdf0e10cSrcweir 	inline void FormatReset();
300cdf0e10cSrcweir 
301cdf0e10cSrcweir 	// Setzt die Flags zurueck
302cdf0e10cSrcweir 	inline void ResetPreps();
303cdf0e10cSrcweir 
304cdf0e10cSrcweir 	// Get/Set-Methoden
GetRepaint()305cdf0e10cSrcweir 	inline SwRepaint *GetRepaint() { return &aRepaint; }
GetRepaint() const306cdf0e10cSrcweir 	inline const SwRepaint *GetRepaint() const { return &aRepaint; }
GetReformat()307cdf0e10cSrcweir 	inline SwCharRange *GetReformat() { return &aReformat; }
GetReformat() const308cdf0e10cSrcweir 	inline const SwCharRange *GetReformat() const { return &aReformat; }
GetDelta()309cdf0e10cSrcweir 	inline long *GetDelta() { return &nDelta; }
GetDelta() const310cdf0e10cSrcweir 	inline const long *GetDelta() const { return &nDelta; }
GetScriptInfo()311cdf0e10cSrcweir     inline SwScriptInfo& GetScriptInfo() { return aScriptInfo; }
GetScriptInfo() const312cdf0e10cSrcweir     inline const SwScriptInfo& GetScriptInfo() const { return aScriptInfo; }
313cdf0e10cSrcweir 
314cdf0e10cSrcweir     // fuer SwTxtFrm::Format: liefert die aktuelle Laenge des Absatzes
315cdf0e10cSrcweir 	xub_StrLen GetParLen() const;
316cdf0e10cSrcweir 
317cdf0e10cSrcweir 	// fuer Prepare()
318cdf0e10cSrcweir 	sal_Bool UpdateQuoVadis( const XubString &rQuo );
319cdf0e10cSrcweir 
320cdf0e10cSrcweir 	// Flags
SetFly(const sal_Bool bNew=sal_True)321cdf0e10cSrcweir 	inline void SetFly( const sal_Bool bNew = sal_True ) { bFlys = bNew; }
HasFly() const322cdf0e10cSrcweir 	inline sal_Bool HasFly() const { return bFlys; }
323cdf0e10cSrcweir 
324cdf0e10cSrcweir 	// Preps
SetPrep(const sal_Bool bNew=sal_True)325cdf0e10cSrcweir 	inline void SetPrep( const sal_Bool bNew = sal_True ) { bPrep = bNew; }
IsPrep() const326cdf0e10cSrcweir 	inline sal_Bool IsPrep() const { return bPrep; }
SetPrepWidows(const sal_Bool bNew=sal_True)327cdf0e10cSrcweir 	inline void SetPrepWidows( const sal_Bool bNew = sal_True ) { bPrepWidows = bNew; }
IsPrepWidows() const328cdf0e10cSrcweir 	inline sal_Bool IsPrepWidows() const { return bPrepWidows; }
SetPrepMustFit(const sal_Bool bNew=sal_True)329cdf0e10cSrcweir 	inline void SetPrepMustFit( const sal_Bool bNew = sal_True ) { bPrepMustFit = bNew; }
IsPrepMustFit() const330cdf0e10cSrcweir 	inline sal_Bool IsPrepMustFit() const { return bPrepMustFit; }
SetPrepAdjust(const sal_Bool bNew=sal_True)331cdf0e10cSrcweir 	inline void SetPrepAdjust( const sal_Bool bNew = sal_True ) { bPrepAdjust = bNew; }
IsPrepAdjust() const332cdf0e10cSrcweir 	inline sal_Bool IsPrepAdjust() const { return bPrepAdjust; }
SetFollowField(const sal_Bool bNew=sal_True)333cdf0e10cSrcweir 	inline void SetFollowField( const sal_Bool bNew = sal_True ) { bFollowField = bNew; }
IsFollowField() const334cdf0e10cSrcweir 	inline sal_Bool IsFollowField() const { return bFollowField; }
SetFixLineHeight(const sal_Bool bNew=sal_True)335cdf0e10cSrcweir 	inline void SetFixLineHeight( const sal_Bool bNew = sal_True ) { bFixLineHeight = bNew; }
IsFixLineHeight() const336cdf0e10cSrcweir 	inline sal_Bool  IsFixLineHeight() const { return bFixLineHeight; }
337cdf0e10cSrcweir 
SetFtnNum(const sal_Bool bNew=sal_True)338cdf0e10cSrcweir 	inline void SetFtnNum( const sal_Bool bNew = sal_True ) { bFtnNum = bNew; }
IsFtnNum() const339cdf0e10cSrcweir 	inline sal_Bool  IsFtnNum() const { return bFtnNum; }
SetMargin(const sal_Bool bNew=sal_True)340cdf0e10cSrcweir 	inline void SetMargin( const sal_Bool bNew = sal_True ) { bMargin = bNew; }
IsMargin() const341cdf0e10cSrcweir 	inline sal_Bool  IsMargin() const { return bMargin; }
SetFlag00(const sal_Bool bNew=sal_True)342cdf0e10cSrcweir 	inline void SetFlag00( const sal_Bool bNew = sal_True ) { bFlag00 = bNew; }
IsFlag00() const343cdf0e10cSrcweir 	inline sal_Bool  IsFlag00() const { return bFlag00; }
SetFlag11(const sal_Bool bNew=sal_True)344cdf0e10cSrcweir 	inline void SetFlag11( const sal_Bool bNew = sal_True ) { bFlag11 = bNew; }
IsFlag11() const345cdf0e10cSrcweir 	inline sal_Bool  IsFlag11() const { return bFlag11; }
SetFlag12(const sal_Bool bNew=sal_True)346cdf0e10cSrcweir 	inline void SetFlag12( const sal_Bool bNew = sal_True ) { bFlag12 = bNew; }
IsFlag12() const347cdf0e10cSrcweir 	inline sal_Bool  IsFlag12() const { return bFlag12; }
SetFlag13(const sal_Bool bNew=sal_True)348cdf0e10cSrcweir 	inline void SetFlag13( const sal_Bool bNew = sal_True ) { bFlag13 = bNew; }
IsFlag13() const349cdf0e10cSrcweir 	inline sal_Bool  IsFlag13() const { return bFlag13; }
SetFlag14(const sal_Bool bNew=sal_True)350cdf0e10cSrcweir 	inline void SetFlag14( const sal_Bool bNew = sal_True ) { bFlag14 = bNew; }
IsFlag14() const351cdf0e10cSrcweir 	inline sal_Bool  IsFlag14() const { return bFlag14; }
SetFlag15(const sal_Bool bNew=sal_True)352cdf0e10cSrcweir 	inline void SetFlag15( const sal_Bool bNew = sal_True ) { bFlag15 = bNew; }
IsFlag15() const353cdf0e10cSrcweir 	inline sal_Bool  IsFlag15() const { return bFlag15; }
SetFlag16(const sal_Bool bNew=sal_True)354cdf0e10cSrcweir 	inline void SetFlag16( const sal_Bool bNew = sal_True ) { bFlag16 = bNew; }
IsFlag16() const355cdf0e10cSrcweir 	inline sal_Bool  IsFlag16() const { return bFlag16; }
356cdf0e10cSrcweir 
357cdf0e10cSrcweir 	// schneller, hoeher, weiter: Read/Write-Methoden fuer den SWG-Filter
358cdf0e10cSrcweir 	SvStream &ReadSwg ( SvStream& rStream ); //$ istream
359cdf0e10cSrcweir 	SvStream &WriteSwg( SvStream& rStream ); //$ ostream
360cdf0e10cSrcweir 
361cdf0e10cSrcweir 	// nErgo in der QuoVadisPortion setzen
362cdf0e10cSrcweir 	void SetErgoSumNum( const XubString &rErgo );
363cdf0e10cSrcweir 
364cdf0e10cSrcweir 	const SwDropPortion *FindDropPortion() const;
365cdf0e10cSrcweir 
366cdf0e10cSrcweir 	OUTPUT_OPERATOR
367cdf0e10cSrcweir 	DECL_FIXEDMEMPOOL_NEWDEL(SwParaPortion)
368cdf0e10cSrcweir };
369cdf0e10cSrcweir 
370cdf0e10cSrcweir /*************************************************************************
371cdf0e10cSrcweir  *						Inline-Implementierungen
372cdf0e10cSrcweir  *************************************************************************/
373cdf0e10cSrcweir 
ResetFlags()374cdf0e10cSrcweir inline void SwLineLayout::ResetFlags()
375cdf0e10cSrcweir {
376cdf0e10cSrcweir     bFormatAdj = bDummy = bFntChg = bTab = bEndHyph = bMidHyph = bFly
377cdf0e10cSrcweir 	= bRest = bBlinking = bClipping = bContent = bRedline
378cdf0e10cSrcweir     = bForcedLeftMargin = bHanging = sal_False;
379cdf0e10cSrcweir }
380cdf0e10cSrcweir 
SwLineLayout()381cdf0e10cSrcweir inline SwLineLayout::SwLineLayout()
382cdf0e10cSrcweir     : pNext( 0 ), pLLSpaceAdd( 0 ), pKanaComp( 0 ), nRealHeight( 0 ),
383cdf0e10cSrcweir       bUnderscore( sal_False )
384cdf0e10cSrcweir {
385cdf0e10cSrcweir 	ResetFlags();
386cdf0e10cSrcweir 	SetWhichPor( POR_LAY );
387cdf0e10cSrcweir }
388cdf0e10cSrcweir 
ResetPreps()389cdf0e10cSrcweir inline void SwParaPortion::ResetPreps()
390cdf0e10cSrcweir {
391cdf0e10cSrcweir 	bPrep = bPrepWidows = bPrepAdjust = bPrepMustFit = sal_False;
392cdf0e10cSrcweir }
393cdf0e10cSrcweir 
FormatReset()394cdf0e10cSrcweir inline void SwParaPortion::FormatReset()
395cdf0e10cSrcweir {
396cdf0e10cSrcweir 	nDelta = 0;
397cdf0e10cSrcweir 	aReformat = SwCharRange( 0, STRING_LEN );
398cdf0e10cSrcweir //	AMA 9916: bFlys muss in SwTxtFrm::_Format() erhalten bleiben, damit
399cdf0e10cSrcweir //	leere Absaetze, die Rahmen ohne Umfluss ausweichen mussten, sich
400cdf0e10cSrcweir //	neu formatieren, wenn der Rahmen aus dem Bereich verschwindet.
401cdf0e10cSrcweir //	bFlys = sal_False;
402cdf0e10cSrcweir 	ResetPreps();
403cdf0e10cSrcweir 	bFollowField = bFixLineHeight = bMargin = sal_False;
404cdf0e10cSrcweir }
405cdf0e10cSrcweir 
406cdf0e10cSrcweir #ifdef UNX
407cdf0e10cSrcweir // C30 ist mit dem ternaeren Ausdruck ueberfordert.
GetFirstPortion() const408cdf0e10cSrcweir inline SwLinePortion *SwLineLayout::GetFirstPortion() const
409cdf0e10cSrcweir {
410cdf0e10cSrcweir 	SwLinePortion *pTmp = pPortion;
411cdf0e10cSrcweir 	if ( !pPortion )
412cdf0e10cSrcweir 		pTmp = (SwLinePortion*)this;
413cdf0e10cSrcweir 	return( pTmp );
414cdf0e10cSrcweir }
415cdf0e10cSrcweir #else
GetFirstPortion() const416cdf0e10cSrcweir inline SwLinePortion *SwLineLayout::GetFirstPortion() const
417cdf0e10cSrcweir { return( pPortion ? pPortion : (SwLinePortion*)this ); }
418cdf0e10cSrcweir #endif
419cdf0e10cSrcweir 
420cdf0e10cSrcweir CLASSIO( SwLineLayout )
421cdf0e10cSrcweir CLASSIO( SwParaPortion )
422cdf0e10cSrcweir 
423cdf0e10cSrcweir #endif
424