xref: /aoo42x/main/sw/source/core/inc/frame.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef SW_FRAME_HXX
24 #define SW_FRAME_HXX
25 
26 #include <svl/svarray.hxx>
27 #include "swtypes.hxx"	// fuer SwTwips
28 #include "swrect.hxx"
29 #include "calbck.hxx"	// fuer SwClient
30 #include <svl/brdcst.hxx>
31 
32 class SwLayoutFrm;
33 class SwRootFrm;
34 class SwPageFrm;
35 class SwFlyFrm;
36 class SwSectionFrm;
37 class SdrObject;
38 class SwFtnFrm;
39 class SwFtnBossFrm;
40 class SwTabFrm;
41 class SwRowFrm;
42 class SwFlowFrm;
43 class SwCntntFrm;
44 class SfxPoolItem;
45 class SwAttrSet;
46 class ViewShell;
47 class Color;
48 class SwBorderAttrs;
49 class SwCache;
50 class SvxBrushItem;
51 class SwSelectionList;
52 struct SwPosition;
53 struct SwCrsrMoveState;
54 class SwFmt;
55 class SwPrintData;
56 class SwSortedObjs;
57 class SwAnchoredObject;
58 
59 //Jeder FrmTyp findet sich hier in einem Bit wieder.
60 //Die Bits muessen so gesetzt werden, dass mit einer Maskierung festgestellt
61 //werden kann was fuer ein FrmTyp eine Instanz ist _und_ von welchen Klassen
62 //sie abgeleitet ist.
63 //Der Frm hat in der Basisklasse einen Member der von den CToren der
64 //einzelnen Frms entsprechend gesetzt werden muss.
65 #define	FRM_ROOT		0x0001
66 #define	FRM_PAGE		0x0002
67 #define	FRM_COLUMN		0x0004
68 #define	FRM_HEADER		0x0008
69 #define FRM_FOOTER		0x0010
70 #define	FRM_FTNCONT		0x0020
71 #define	FRM_FTN			0x0040
72 #define	FRM_BODY		0x0080
73 #define	FRM_FLY     	0x0100
74 #define	FRM_SECTION  	0x0200
75 #define	FRM_UNUSED    	0x0400
76 #define	FRM_TAB			0x0800
77 #define	FRM_ROW			0x1000
78 #define	FRM_CELL		0x2000
79 #define	FRM_TXT			0x4000
80 #define	FRM_NOTXT		0x8000
81 
82 //Fuer den internen Gebrauch ein paar gebraeuchliche Verknuepfungen.
83 #define FRM_LAYOUT		0x3FFF
84 #define FRM_CNTNT		0xC000
85 #define FRM_FTNBOSS		0x0006
86 #define FRM_ACCESSIBLE (FRM_HEADER|FRM_FOOTER|FRM_FTN|FRM_TXT|FRM_ROOT|FRM_FLY|FRM_TAB|FRM_CELL|FRM_PAGE)
87 
88 		//Weils so schon ist das ganze als Bitfeld....
89 //0000 0000 0000 0001	ROOT
90 //0000 0000 0000 0010	PAGE
91 //0000 0000 0000 0100	COLUMN
92 //0000 0000 0000 1000	HEADER
93 //0000 0000 0001 0000	FOOTER
94 //0000 0000 0010 0000	FTNCONT
95 //0000 0000 0100 0000	FTN
96 //0000 0000 1000 0000	BODY
97 //0000 0001 0000 0000	FLY
98 //0000 0010 0000 0000	SECTION
99 //0000 0100 0000 0000	UNUSED
100 //0000 1000 0000 0000	TAB
101 //0001 0000 0000 0000	ROW
102 //0010 0000 0000 0000	CELL
103 //0100 0000 0000 0000	TXT
104 //1000 0000 0000 0000	NOTXT
105 
106 // The type of the frame is internal represented by the 4-bit value nType,
107 // which can expanded to the types above by shifting a bit (0x1 << nType)
108 // Here are the corresponding defines for the compressed representation:
109 
110 #define FRMC_ROOT        0
111 #define FRMC_PAGE        1
112 #define FRMC_COLUMN      2
113 #define FRMC_HEADER      3
114 #define FRMC_FOOTER      4
115 #define FRMC_FTNCONT     5
116 #define FRMC_FTN         6
117 #define FRMC_BODY        7
118 #define FRMC_FLY         8
119 #define FRMC_SECTION     9
120 #define FRMC_UNUSED      10
121 #define FRMC_TAB         11
122 #define FRMC_ROW         12
123 #define FRMC_CELL        13
124 #define FRMC_TXT         14
125 #define FRMC_NOTXT       15
126 
127 #define FRM_NEIGHBOUR   0x2004
128 #define FRM_NOTE_VERT   0x7a60
129 #define FRM_HEADFOOT    0x0018
130 #define FRM_BODYFTNC    0x00a0
131 
132 class SwFrm;
133 typedef long (SwFrm:: *SwFrmGet)() const;
134 typedef sal_Bool (SwFrm:: *SwFrmMax)( long );
135 typedef void (SwFrm:: *SwFrmMakePos)( const SwFrm*, const SwFrm*, sal_Bool );
136 typedef long (*SwOperator)( long, long );
137 typedef void (SwFrm:: *SwFrmSet)( long, long );
138 
139 struct SwRectFnCollection
140 {
141     SwRectGet     fnGetTop;
142     SwRectGet     fnGetBottom;
143     SwRectGet     fnGetLeft;
144     SwRectGet     fnGetRight;
145     SwRectGet     fnGetWidth;
146     SwRectGet     fnGetHeight;
147     SwRectPoint   fnGetPos;
148     SwRectSize    fnGetSize;
149 
150     SwRectSet     fnSetTop;
151     SwRectSet     fnSetBottom;
152     SwRectSet     fnSetLeft;
153     SwRectSet     fnSetRight;
154     SwRectSet     fnSetWidth;
155     SwRectSet     fnSetHeight;
156 
157     SwRectSet     fnSubTop;
158     SwRectSet     fnAddBottom;
159     SwRectSet     fnSubLeft;
160     SwRectSet     fnAddRight;
161     SwRectSet     fnAddWidth;
162     SwRectSet     fnAddHeight;
163 
164     SwRectSet     fnSetPosX;
165     SwRectSet     fnSetPosY;
166 
167     SwFrmGet      fnGetTopMargin;
168     SwFrmGet      fnGetBottomMargin;
169     SwFrmGet      fnGetLeftMargin;
170     SwFrmGet      fnGetRightMargin;
171     SwFrmSet      fnSetXMargins;
172     SwFrmSet      fnSetYMargins;
173     SwFrmGet      fnGetPrtTop;
174     SwFrmGet      fnGetPrtBottom;
175     SwFrmGet      fnGetPrtLeft;
176     SwFrmGet      fnGetPrtRight;
177     SwRectDist    fnTopDist;
178     SwRectDist    fnBottomDist;
179     SwRectDist    fnLeftDist;
180     SwRectDist    fnRightDist;
181     SwFrmMax      fnSetLimit;
182     SwRectMax     fnOverStep;
183 
184     SwRectSetPos  fnSetPos;
185     SwFrmMakePos  fnMakePos;
186     SwOperator    fnXDiff;
187     SwOperator    fnYDiff;
188     SwOperator    fnXInc;
189     SwOperator    fnYInc;
190 
191     SwRectSetTwice fnSetLeftAndWidth;
192     SwRectSetTwice fnSetTopAndHeight;
193 };
194 
195 typedef SwRectFnCollection* SwRectFn;
196 /*
197 extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R;
198 #define SWRECTFN( pFrm )    sal_Bool bVert = pFrm->IsVertical(); \
199                             sal_Bool bRev = pFrm->IsReverse(); \
200                             SwRectFn fnRect = bVert ? \
201                                 ( bRev ? fnRectVL2R : fnRectVert ): \
202                                 ( bRev ? fnRectB2T : fnRectHori );
203 #define SWRECTFNX( pFrm )   sal_Bool bVertX = pFrm->IsVertical(); \
204                             sal_Bool bRevX = pFrm->IsReverse(); \
205                             SwRectFn fnRectX = bVertX ? \
206                                 ( bRevX ? fnRectVL2R : fnRectVert ): \
207                                 ( bRevX ? fnRectB2T : fnRectHori );
208 #define SWREFRESHFN( pFrm ) { if( bVert != pFrm->IsVertical() || \
209                                   bRev  != pFrm->IsReverse() ) \
210                                 bVert = pFrm->IsVertical(); \
211                                 bRev = pFrm->IsReverse(); \
212                                 fnRect = bVert ? \
213                                     ( bRev ? fnRectVL2R : fnRectVert ): \
214                                     ( bRev ? fnRectB2T : fnRectHori ); }
215 #define SWRECTFN2( pFrm )   sal_Bool bVert = pFrm->IsVertical(); \
216                             sal_Bool bNeighb = pFrm->IsNeighbourFrm(); \
217                             SwRectFn fnRect = bVert == bNeighb ? \
218                                 fnRectHori : fnRectVert;
219 */
220 
221 //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
222 extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R, fnRectVertL2R;
223 #define SWRECTFN( pFrm )    sal_Bool bVert = pFrm->IsVertical(); \
224                             sal_Bool bRev = pFrm->IsReverse(); \
225                             sal_Bool bVertL2R = pFrm->IsVertLR(); \
226                             SwRectFn fnRect = bVert ? \
227                                 ( bRev ? fnRectVL2R : ( bVertL2R ? fnRectVertL2R : fnRectVert ) ): \
228                                 ( bRev ? fnRectB2T : fnRectHori );
229 #define SWRECTFNX( pFrm )   sal_Bool bVertX = pFrm->IsVertical(); \
230                             sal_Bool bRevX = pFrm->IsReverse(); \
231                             sal_Bool bVertL2RX = pFrm->IsVertLR(); \
232                             SwRectFn fnRectX = bVertX ? \
233                                 ( bRevX ? fnRectVL2R : ( bVertL2RX ? fnRectVertL2R : fnRectVert ) ): \
234                                 ( bRevX ? fnRectB2T : fnRectHori );
235 #define SWREFRESHFN( pFrm ) { if( bVert != pFrm->IsVertical() || \
236                                   bRev  != pFrm->IsReverse() ) \
237                                 bVert = pFrm->IsVertical(); \
238                                 bRev = pFrm->IsReverse(); \
239                                 bVertL2R = pFrm->IsVertLR(); \
240                                 fnRect = bVert ? \
241                                     ( bRev ? fnRectVL2R : ( bVertL2R ? fnRectVertL2R : fnRectVert ) ): \
242                                     ( bRev ? fnRectB2T : fnRectHori ); }
243 #define SWRECTFN2( pFrm )   sal_Bool bVert = pFrm->IsVertical(); \
244 			    sal_Bool bVertL2R = pFrm->IsVertLR(); \
245                             sal_Bool bNeighb = pFrm->IsNeighbourFrm(); \
246                             SwRectFn fnRect = bVert == bNeighb ? \
247                                 fnRectHori : ( bVertL2R ? fnRectVertL2R : fnRectVert );
248 //End of SCMS
249 #define POS_DIFF( aFrm1, aFrm2 ) \
250             ( (aFrm1.*fnRect->fnGetTop)() != (aFrm2.*fnRect->fnGetTop)() || \
251             (aFrm1.*fnRect->fnGetLeft)() != (aFrm2.*fnRect->fnGetLeft)() )
252 
253 
254 //Fuer GetNextLeaf/GetPrevLeaf.
255 enum MakePageType
256 {
257 	MAKEPAGE_NONE,		//Keine Seite bzw. Fussnote anlegen
258 	MAKEPAGE_APPEND,	//Nur ggf. Seite anhaengen
259 	MAKEPAGE_INSERT,	//Seite ggf. anhaengen oder einfuegen.
260 	MAKEPAGE_FTN,		//Fussnote ggf. einfuegen.
261 	MAKEPAGE_NOSECTION	// Don't create section frames
262 };
263 
264 // OD 2004-05-06 #i28701# - replaced by new class <SwSortedObjs>
265 //typedef SdrObject* SdrObjectPtr;
266 //SV_DECL_PTRARR(SwDrawObjs,SdrObjectPtr,1,1);
267 
268 class SwFrm: public SwClient, public SfxBroadcaster
269 {
270 	//Der verkappte Frm
271 	friend class SwFlowFrm;
272 	friend class SwLayoutFrm;		// Sw3FrameIo: fuer pNext, pPrev
273 	friend class SwLooping;         // LoopControlling  (layouter.cxx)
274 
275     //Hebt die Lower waehrend eines Spaltenumbaus auf.
276 	friend SwFrm *SaveCntnt( SwLayoutFrm *, SwFrm* pStart = NULL );
277     friend void   RestoreCntnt( SwFrm *, SwLayoutFrm *, SwFrm *pSibling, bool bGrow );
278 
279 #if OSL_DEBUG_LEVEL > 1
280 	//entfernt leere SwSectionFrms aus einer Kette
281 	friend SwFrm* SwClearDummies( SwFrm* pFrm );
282 #endif
283 
284 		//Zum validieren eines unsinnig invalidierten in SwCntntFrm::MakeAll
285 	friend void ValidateSz( SwFrm *pFrm );
286 		// Implementiert in text/txtftn.cxx, verhindert Ftn-Oszillation
287 	friend void ValidateTxt( SwFrm *pFrm );
288 
289 //	friend void CalcAnchorAndKeep( SwFlyFrm * );
290 
291 	friend void MakeNxt( SwFrm *pFrm, SwFrm *pNxt );
292 
293 	//Cache fuer (Umrandungs-)Attribute.
294 	static SwCache *pCache;
295 
296     // --> OD 2006-05-10 #i65250#
297     // frame ID is now in general available - used for layout loop control
298     static sal_uInt32 mnLastFrmId;
299     const  sal_uInt32 mnFrmId;
300     // <--
301 
302     SwRootFrm   *mpRoot;
303 	SwLayoutFrm *pUpper;
304     SwFrm       *pNext;
305     SwFrm       *pPrev;
306 
307     SwFrm *_FindNext();
308 	SwFrm *_FindPrev();
309 
310     /** method to determine next content frame in the same environment
311         for a flow frame (content frame, table frame, section frame)
312 
313         OD 2005-11-30 #i27138# - adding documentation:
314         Travelling downwards through the layout to determine the next content
315         frame in the same environment. There are several environments in a
316         document, which form a closed context regarding this function. These
317         environments are:
318         - Each page header
319         - Each page footer
320         - Each unlinked fly frame
321         - Each group of linked fly frames
322         - All footnotes
323         - All document body frames
324         OD 2005-11-30 #i27138# - adding parameter <_bInSameFtn>
325         Its default value is <false>. If its value is <true>, the environment
326         'All footnotes' is no longer treated. Instead each footnote is treated
327         as an own environment.
328 
329         @author OD
330 
331         @param _bInSameFtn
332         input parameter - boolean indicating, that the found next content
333         frame has to be in the same footnote frame. This parameter is only
334         relevant for flow frames in footnotes.
335 
336         @return SwCntntFrm*
337         pointer to the found next content frame. It's NULL, if none exists.
338     */
339     SwCntntFrm* _FindNextCnt( const bool _bInSameFtn = false );
340 
341     /** method to determine previous content frame in the same environment
342         for a flow frame (content frame, table frame, section frame)
343 
344         OD 2005-11-30 #i27138#
345         Travelling upwards through the layout to determine the previous content
346         frame in the same environment. There are several environments in a
347         document, which form a closed context regarding this function. These
348         environments are:
349         - Each page header
350         - Each page footer
351         - Each unlinked fly frame
352         - Each group of linked fly frames
353         - All footnotes
354         - All document body frames
355         OD 2005-11-30 #i27138# - adding parameter <_bInSameFtn>
356         Its default value is <false>. If its value is <true>, the environment
357         'All footnotes' is no longer treated. Instead each footnote is treated
358         as an own environment.
359 
360         @author OD
361 
362         @param _bInSameFtn
363         input parameter - boolean indicating, that the found previous content
364         frame has to be in the same footnote frame. This parameter is only
365         relevant for flow frames in footnotes.
366 
367         @return SwCntntFrm*
368         pointer to the found previous content frame. It's NULL, if none exists.
369     */
370     SwCntntFrm* _FindPrevCnt( const bool _bInSameFtn = false );
371 
372 
373 	void _UpdateAttrFrm( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 & );
374 	SwFrm* _GetIndNext();
375     void SetDirFlags( sal_Bool bVert );
376 
377 	SwFrm( SwFrm & );		//Kopieren ist nicht erlaubt.
378 
379     const SwLayoutFrm* ImplGetNextLayoutLeaf( bool bFwd ) const;
380 
381 protected:
382     SwSortedObjs* pDrawObjs;    //Hier haengen die DrawObjs, kann 0 sein
383 
384 	SwRect	aFrm;	//Absolute Dokumentposition und groesse des Frm
385 	SwRect	aPrt;	//Position der PrtArea rel zum Frm und groesse der PrtArea
386 
387     sal_uInt16 bFlag01:         1;
388     sal_uInt16 bFlag02:         1;
389     sal_uInt16 bFlag03:         1;
390     sal_uInt16 bFlag04:         1;
391     sal_uInt16 bFlag05:         1;
392     sal_uInt16 bReverse:        1; // Next line above/at the right side instead
393                                // under/at the left side of the previous line.
394     sal_uInt16 bInvalidR2L:     1;
395     sal_uInt16 bDerivedR2L:     1;
396     sal_uInt16 bRightToLeft:    1;
397     sal_uInt16 bInvalidVert:    1;
398     sal_uInt16 bDerivedVert:    1;
399     sal_uInt16 bVertical:       1;
400     //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
401     sal_uInt16 bVertLR:         1;
402     //End of SCMS
403     sal_uInt16 nType:         4;  //Who am I?
404 
405 	sal_Bool bValidPos:			1;
406 	sal_Bool bValidPrtArea:		1;
407 	sal_Bool bValidSize:		1;
408 	sal_Bool bValidLineNum:		1;
409     sal_Bool bFixSize:          1;
410     sal_Bool bUnUsed1:          1;
411 	sal_Bool bCompletePaint:	1;	//Frame wird ganz gepaintet wenn sal_True, auch
412 								//wenn der Inhalt nur teilw. veraendert ist;
413 								//Bei CntntFrms wird ausschliesslich wenn sal_True
414 								//der Border (von Action) gemalt.
415 	sal_Bool bRetouche:			1;	//Der Frame ist fuer Retusche verantwortlich
416 								//wenn sal_True.
417 public:
418     sal_Bool bUnUsed2:          1;
419 protected:
420 	sal_Bool bInfInvalid:		1;	//InfoFlags sind Invalid.
421 	sal_Bool bInfBody:			1;	//Frm steht im DokumentBody.
422 	sal_Bool bInfTab:			1;	//Frm steht in einer Tabelle.
423 	sal_Bool bInfFly:			1;	//Frm steht in einem Fly.
424 	sal_Bool bInfFtn:			1;	//Frm steht in einer Fussnote.
425 	sal_Bool bInfSct:			1;  //Frm steht in einem Bereich.
426 	sal_Bool bColLocked:		1;  //Grow/Shrink sperren bei spaltigen Section-
427 								//oder Fly-Frames, wird im Format gesetzt
428 
429 	void ColLock()		{ bColLocked = sal_True; }
430 	void ColUnlock()   	{ bColLocked = sal_False; }
431 
432     // Only used by SwRootFrm Ctor to get 'this' into mpRoot...
433 	void setRootFrm( SwRootFrm* pRoot )	{ mpRoot = pRoot; }
434 
435 	SwPageFrm *InsertPage( SwPageFrm *pSibling, sal_Bool bFtn );
436 	void PrepareMake();
437 	void OptPrepareMake();
438 	void MakePos();
439     // --> OD 2005-09-28 #b6329202#
440     // method formats next frame of table frame to assure keep attribute.
441     // in case of nested tables method <SwFrm::MakeAll()> is called to
442     // avoid format of superior table frame.
443     friend SwFrm* lcl_FormatNextCntntForKeep( SwTabFrm* pTabFrm );
444     // <--
445     virtual void MakeAll() = 0;
446 		//Adjustierung der Frames einer Seite
447 	SwTwips AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst = sal_False );
448 
449 
450 		//Aendern nur die Framesize, nicht die PrtArea-SSize
451     virtual SwTwips ShrinkFrm( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ) = 0;
452     virtual SwTwips GrowFrm  ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ) = 0;
453 
454 	SwModify	  	*GetDep()		{ return GetRegisteredInNonConst(); }
455 	const SwModify	*GetDep() const { return GetRegisteredIn(); }
456 
457 	SwFrm( SwModify*, SwFrm* );
458 
459     void CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_Bool bBrowse );
460 
461     /** enumeration for the different invalidations
462 
463         OD 2004-05-19 #i28701#
464 
465         @author OD
466     */
467     enum InvalidationType
468     {
469         INVALID_SIZE, INVALID_PRTAREA, INVALID_POS, INVALID_LINENUM, INVALID_ALL
470     };
471 
472     /** method to determine, if an invalidation is allowed.
473 
474         OD 2004-05-19 #i28701
475 
476         @author OD
477     */
478     virtual bool _InvalidationAllowed( const InvalidationType _nInvalid ) const;
479 
480     /** method to perform additional actions on an invalidation
481 
482         OD 2004-05-19 #i28701#
483         Method has *only* to contain actions, which has to be performed on
484         *every* assignment of the corresponding flag to <sal_False>.
485 
486         @author OD
487     */
488     virtual void _ActionOnInvalidation( const InvalidationType _nInvalid );
489 
490         //Schatten und Umrandung painten
491     void PaintShadow( const SwRect&, SwRect&, const SwBorderAttrs& ) const;
492 	virtual	void  Modify( const SfxPoolItem*, const SfxPoolItem* );
493 
494 public:
495 	TYPEINFO();	//Bereits in Basisklasse Client drin.
496 
497     sal_uInt16 GetType() const { return 0x1 << nType; }
498 
499 	static SwCache &GetCache() 				  { return *pCache; }
500 	static SwCache *GetCachePtr()			  { return pCache;	}
501 	static void		SetCache( SwCache *pNew ) { pCache = pNew;	}
502 
503 		//Aendern die PrtArea-SSize und die FrmSize.
504     SwTwips Shrink( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
505     SwTwips Grow  ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
506 
507 	//Wir brauchen unterschiedliche Methoden (wg. Performance) fuer das
508 	//Einfuegenin den Layout Baum:
509 
510 	//Einfuegen vor pBehind  oder am Ende der Kette unter pUpper
511 	void InsertBefore( SwLayoutFrm* pParent, SwFrm* pBehind );
512 	//Einfuegen hinter pBefore oder am Anfang der Kette unter pUpper
513 	void InsertBehind( SwLayoutFrm *pParent, SwFrm *pBefore );
514 	//Einfuegen vor pBehind oder am Ende der Kette, unter Beruecksichtigung
515 	//der Geschwister von pSct
516 	void InsertGroupBefore( SwFrm* pParent, SwFrm* pWhere, SwFrm* pSct );
517 	void Remove();
518 
519 	//For internal use only; wer es anders macht wird
520 	//in einen Sack gesteckt und muss zwei Tage drin hocken bleiben.
521 	//Fuert Spezialbehandlung fuer _Get[Next|Prev]Leaf() durch (Tabellen).
522 	SwLayoutFrm *GetLeaf( MakePageType eMakePage, sal_Bool bFwd );
523 	SwLayoutFrm *GetNextLeaf   ( MakePageType eMakePage );
524 	SwLayoutFrm *GetNextFtnLeaf( MakePageType eMakePage );
525 	SwLayoutFrm *GetNextSctLeaf( MakePageType eMakePage );
526     SwLayoutFrm *GetNextCellLeaf( MakePageType eMakePage );
527     SwLayoutFrm *GetPrevLeaf   ( MakePageType eMakeFtn = MAKEPAGE_FTN );
528 	SwLayoutFrm *GetPrevFtnLeaf( MakePageType eMakeFtn = MAKEPAGE_FTN );
529 	SwLayoutFrm *GetPrevSctLeaf( MakePageType eMakeFtn = MAKEPAGE_FTN );
530     SwLayoutFrm *GetPrevCellLeaf( MakePageType eMakeFtn = MAKEPAGE_FTN );
531     const SwLayoutFrm *GetLeaf ( MakePageType eMakePage, sal_Bool bFwd,
532 								 const SwFrm *pAnch ) const;
533 
534     sal_Bool WrongPageDesc( SwPageFrm* pNew );
535 
536     // --> OD 2004-07-02 #i28701# - new methods to append/remove drawing objects
537     void AppendDrawObj( SwAnchoredObject& _rNewObj );
538     void RemoveDrawObj( SwAnchoredObject& _rToRemoveObj );
539     // <--
540 
541 	//Arbeiten mit der Kette der FlyFrms
542 	void  AppendFly( SwFlyFrm *pNew );
543 	void  RemoveFly( SwFlyFrm *pToRemove );
544     const SwSortedObjs *GetDrawObjs() const { return pDrawObjs; }
545           SwSortedObjs *GetDrawObjs()         { return pDrawObjs; }
546     // --> OD 2004-07-01 #i28701# - change purpose of method and adjust its name
547     void InvalidateObjs( const bool _bInvaPosOnly,
548                          const bool _bNoInvaOfAsCharAnchoredObjs = true );
549 
550 	virtual	void PaintBorder( const SwRect&, const SwPageFrm *pPage,
551 							  const SwBorderAttrs & ) const;
552 	void PaintBaBo( const SwRect&, const SwPageFrm *pPage = 0,
553 					const sal_Bool bLowerBorder = sal_False ) const;
554 	void PaintBackground( const SwRect&, const SwPageFrm *pPage,
555 						  const SwBorderAttrs &,
556 						  const sal_Bool bLowerMode = sal_False,
557 						  const sal_Bool bLowerBorder = sal_False ) const;
558 	void PaintBorderLine( const SwRect&, const SwRect&, const SwPageFrm*,
559 						  const Color *pColor ) const;
560 
561 	//Retouche, nicht im Bereich des uebergebenen Rect!
562 	void Retouche( const SwPageFrm *pPage, const SwRect &rRect ) const;
563 
564 	sal_Bool GetBackgroundBrush( const SvxBrushItem*& rpBrush,
565 							 const Color*& rpColor,
566 							 SwRect &rOrigRect,
567 							 sal_Bool bLowerMode ) const;
568 
569 	inline void SetCompletePaint() const;
570 	inline void ResetCompletePaint() const;
571 	inline sal_Bool IsCompletePaint() const { return bCompletePaint; }
572 
573 	inline void SetRetouche() const;
574 	inline void ResetRetouche() const;
575 	inline sal_Bool IsRetouche() const { return bRetouche; }
576 
577 	void SetInfFlags();					//Setzen der InfoFlags
578 	inline void InvalidateInfFlags() { bInfInvalid = sal_True; }
579 	inline sal_Bool	IsInDocBody() const;	//Benutzen die InfoFlags.
580 	inline sal_Bool	IsInFtn() const;		//ggf. werden die Flags ermittelt.
581 	inline sal_Bool IsInTab() const;
582 	inline sal_Bool IsInFly() const;
583 	inline sal_Bool IsInSct() const;
584 
585     // If frame is inside a split table row, this function returns
586     // the corresponding row frame in the follow table.
587     const SwRowFrm* IsInSplitTableRow() const;
588 
589     // If frame is inside a follow flow row, this function returns
590     // the corresponding row frame master table
591     const SwRowFrm* IsInFollowFlowRow() const;
592 
593     bool IsInBalancedSection() const;
594 
595     inline sal_Bool IsReverse() const { return bReverse; }
596     inline void SetReverse( sal_Bool bNew ){ bReverse = bNew ? 1 : 0; }
597     inline sal_Bool IsVertical() const;
598     //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
599     inline sal_Bool IsVertLR() const;
600     //End of SCMS
601     inline sal_Bool GetVerticalFlag() const;
602     inline void SetVertical( sal_Bool bNew ){ bVertical = bNew ? 1 : 0; }
603     //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
604     inline void SetbVertLR( sal_Bool bNew ) { bVertLR = bNew ? 1 : 0; }
605     //End of SCMS
606     inline void SetDerivedVert( sal_Bool bNew ){ bDerivedVert = bNew ? 1 : 0; }
607     inline void SetInvalidVert( sal_Bool bNew) { bInvalidVert = bNew ? 1 : 0; }
608     inline sal_Bool IsRightToLeft() const;
609     inline sal_Bool GetRightToLeftFlag() const;
610     inline void SetRightToLeft( sal_Bool bNew ){ bRightToLeft = bNew ? 1 : 0; }
611     inline void SetDerivedR2L( sal_Bool bNew ) { bDerivedR2L  = bNew ? 1 : 0; }
612     inline void SetInvalidR2L( sal_Bool bNew ) { bInvalidR2L  = bNew ? 1 : 0; }
613 
614     void CheckDirChange();
615     // returns upper left frame position for LTR and
616     // upper right frame position for Asian / RTL frames
617     Point   GetFrmAnchorPos( sal_Bool bIgnoreFlysAnchoredAtThisFrame ) const;
618 
619     /** determine, if frame is moveable in given environment
620 
621         OD 08.08.2003 #110978#
622         method replaced 'old' method <sal_Bool IsMoveable() const>.
623         Determines, if frame is moveable in given environment. if no environment
624         is given (parameter _pLayoutFrm == 0L), the movability in the actual
625         environment (<this->GetUpper()) is checked.
626 
627         @author OD
628 
629         @param _pLayoutFrm
630         input parameter - given environment (layout frame), in which the movability
631         will be checked. If not set ( == 0L ), actual environment is taken.
632 
633         @return boolean, indicating, if frame is moveable in given environment
634     */
635 //    sal_Bool IsMoveable() const;
636     bool IsMoveable( const SwLayoutFrm* _pLayoutFrm = 0L ) const;
637 
638 	//Ist es fuer den (Txt)Frm in der aktuellen Umgebung erlaubt eine
639 	//Fussnote einzufuegen (nicht z.B. in wiederholten TabellenHeadlines).
640 	sal_Bool IsFtnAllowed() const;
641 
642 	virtual void  Format( const SwBorderAttrs *pAttrs = 0 );
643 
644     virtual void  CheckDirection( sal_Bool bVert );
645 
646 	void ReinitializeFrmSizeAttrFlags();
647 
648 	const SwAttrSet	*GetAttrSet() const;
649 
650     inline sal_Bool HasFixSize() const { return bFixSize; }
651     inline void SetFixSize( sal_Bool bNew ) { bFixSize = bNew; }
652 
653 	//Prueft alle Seiten ab der Uebergebenen und korrigiert ggf.
654 	static void CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields = sal_True );
655 
656 		//Koennen 0 liefern, einmal const einmal nicht
657 	SwFrm				*GetNext()	{ return pNext; }
658 	SwFrm				*GetPrev()	{ return pPrev; }
659 	SwLayoutFrm			*GetUpper()	{ return pUpper; }
660 	SwRootFrm			*getRootFrm(){ return mpRoot; }
661 	SwPageFrm	   		*FindPageFrm();
662 	SwFrm				*FindColFrm();
663 	SwFtnBossFrm		*FindFtnBossFrm( sal_Bool bFootnotes = sal_False );
664 	SwTabFrm			*ImplFindTabFrm();
665 	SwFtnFrm			*ImplFindFtnFrm();
666 	SwFlyFrm 			*ImplFindFlyFrm();
667 	SwSectionFrm		*ImplFindSctFrm();
668 	SwFrm				*FindFooterOrHeader();
669 	SwFrm				*GetLower();
670 	const SwFrm			*GetNext()	const { return pNext; }
671 	const SwFrm			*GetPrev()	const { return pPrev; }
672 	const SwLayoutFrm	*GetUpper()	const { return pUpper; }
673 	const SwRootFrm     *getRootFrm()	const { return mpRoot; }
674 	inline SwTabFrm		*FindTabFrm();
675 	inline SwFtnFrm		*FindFtnFrm();
676 	inline SwFlyFrm 	*FindFlyFrm();
677 	inline SwSectionFrm	*FindSctFrm();
678 	inline SwFrm		*FindNext();
679     // --> OD 2005-12-01 #i27138# - add parameter <_bInSameFtn>
680     inline SwCntntFrm* FindNextCnt( const bool _bInSameFtn = false );
681     // <--
682 	inline SwFrm		*FindPrev();
683 	inline const SwPageFrm *FindPageFrm() const;
684 	inline const SwFtnBossFrm *FindFtnBossFrm( sal_Bool bFtn = sal_False ) const;
685 	inline const SwFrm     *FindColFrm() const;
686 	inline const SwFrm     *FindFooterOrHeader() const;
687 	inline const SwTabFrm  *FindTabFrm() const;
688 	inline const SwFtnFrm  *FindFtnFrm() const;
689 	inline const SwFlyFrm  *FindFlyFrm() const;
690 	inline const SwSectionFrm *FindSctFrm() const;
691 	inline const SwFrm	   *FindNext() const;
692     // --> OD 2005-12-01 #i27138# - add parameter <_bInSameFtn>
693     inline const SwCntntFrm* FindNextCnt( const bool _bInSameFtn = false ) const;
694     // <--
695 	inline const SwFrm	   *FindPrev() const;
696 		   const SwFrm	   *GetLower()	const;
697 
698     /** inline wrapper method for <_FindPrevCnt(..)>
699 
700         OD 2005-11-30 #i27138#
701 
702         @author OD
703     */
704     inline SwCntntFrm* FindPrevCnt( const bool _bInSameFtn = false )
705     {
706         if ( GetPrev() && GetPrev()->IsCntntFrm() )
707             return (SwCntntFrm*)(GetPrev());
708         else
709             return _FindPrevCnt( _bInSameFtn );
710     }
711 
712     /** inline const wrapper method for <_FindPrevCnt(..)>
713 
714         OD 2005-11-30 #i27138#
715 
716         @author OD
717     */
718     inline const SwCntntFrm* FindPrevCnt( const bool _bInSameFtn = false ) const
719     {
720         if ( GetPrev() && GetPrev()->IsCntntFrm() )
721             return (const SwCntntFrm*)(GetPrev());
722         else
723             return const_cast<SwFrm*>(this)->_FindPrevCnt( _bInSameFtn );
724     }
725 
726     // --> OD 2007-09-04 #i79774#, #b6596954#
727     SwFrm* _GetIndPrev() const;
728     SwFrm* GetIndPrev() const
729 		{ return ( pPrev || !IsInSct() ) ? pPrev : _GetIndPrev(); }
730 //    const SwFrm* GetIndPrev() const { return ((SwFrm*)this)->GetIndPrev(); }
731     // <--
732 	SwFrm* GetIndNext()
733 		{ return ( pNext || !IsInSct() ) ? pNext : _GetIndNext(); }
734 	const SwFrm* GetIndNext() const { return ((SwFrm*)this)->GetIndNext(); }
735 
736 	sal_uInt16 GetPhyPageNum() const;	//Seitennummer ohne Offset
737 	sal_uInt16 GetVirtPageNum() const;	//Seitenummer mit Offset
738 	sal_Bool OnRightPage() const { return 0 != GetPhyPageNum() % 2; };
739 	sal_Bool WannaRightPage() const;
740 
741 
742     inline const  SwLayoutFrm *GetPrevLayoutLeaf() const;
743     inline const  SwLayoutFrm *GetNextLayoutLeaf() const;
744     inline SwLayoutFrm *GetPrevLayoutLeaf();
745 	inline SwLayoutFrm *GetNextLayoutLeaf();
746 
747     inline void Calc() const;       //Hier wird ggf. 'Formatiert'
748 	inline void OptCalc() const;    //Hier wird zur Optimierung davon ausgegangen,
749 									//das die Vorgaenger bereits formatiert sind.
750 
751 	inline Point   GetRelPos() const;
752 	const  SwRect &Frm() const { return aFrm; }
753 	const  SwRect &Prt() const { return aPrt; }
754 
755 	// The PaintArea is the area, where content may be displayed.
756 	// The margin of the page or the space between columns belongs to her.
757 	const SwRect PaintArea() const;
758 	// The UnionFrm is the union of frm- and prt-area, normally identical
759 	// to the frm-area except the case of negative prt-margins.
760 	const SwRect UnionFrm( sal_Bool bBorder = sal_False ) const;
761 
762 	//Der Zugriff auf die Member wird hier ausnahmsweiste gestattet,
763 	//dies soll aber nicht dazu dienen die Werte wahllos zu veraendern;
764 	//es ist nur die einzige Moeglichkeit die Compilerprobleme zu umgehen
765 	//(gleiche Methode mal public mal protected).
766 	SwRect &Frm() { return aFrm; }
767 	SwRect &Prt() { return aPrt; }
768 
769 	virtual Size ChgSize( const Size& aNewSize );
770 
771 	virtual void Cut() = 0;
772 	virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ) = 0;
773 
774 	void ValidateLineNum() { bValidLineNum = sal_True; }
775 
776 	sal_Bool GetValidPosFlag()	  const { return bValidPos; }
777 	sal_Bool GetValidPrtAreaFlag()const { return bValidPrtArea; }
778 	sal_Bool GetValidSizeFlag()	  const { return bValidSize; }
779 	sal_Bool GetValidLineNumFlag()const { return bValidLineNum; }
780 	sal_Bool IsValid() const { return bValidPos && bValidSize && bValidPrtArea; }
781 
782     //Invalideren nur den Frm
783     // OD 2004-05-19 #i28701# - add call to method <_ActionOnInvalidation(..)>
784     // for all invalidation methods.
785     // OD 2004-05-19 #i28701# - use method <_InvalidationAllowed(..)> to
786     // decide, if invalidation will to be performed or not.
787     // --> OD 2004-10-08 #i26945# - no additional invalidation, if it's already
788     // invalidate.
789     void _InvalidateSize()
790     {
791         if ( bValidSize && _InvalidationAllowed( INVALID_SIZE ) )
792         {
793             bValidSize = sal_False;
794             _ActionOnInvalidation( INVALID_SIZE );
795         }
796     }
797     void _InvalidatePrt()
798     {
799         if ( bValidPrtArea && _InvalidationAllowed( INVALID_PRTAREA ) )
800         {
801             bValidPrtArea = sal_False;
802             _ActionOnInvalidation( INVALID_PRTAREA );
803         }
804     }
805     void _InvalidatePos()
806     {
807         if ( bValidPos && _InvalidationAllowed( INVALID_POS ) )
808         {
809             bValidPos = sal_False;
810             _ActionOnInvalidation( INVALID_POS );
811         }
812     }
813     void _InvalidateLineNum()
814     {
815         if ( bValidLineNum && _InvalidationAllowed( INVALID_LINENUM ) )
816         {
817             bValidLineNum = sal_False;
818             _ActionOnInvalidation( INVALID_LINENUM );
819         }
820     }
821     void _InvalidateAll()
822     {
823         if ( ( bValidSize || bValidPrtArea || bValidPos ) &&
824              _InvalidationAllowed( INVALID_ALL ) )
825         {
826             bValidSize = bValidPrtArea = bValidPos = sal_False;
827             _ActionOnInvalidation( INVALID_ALL );
828         }
829     }
830     // <--
831 	//Benachrichtigen gleich die Seite mit.
832 	inline void InvalidateSize();
833 	inline void InvalidatePrt();
834 	inline void InvalidatePos();
835 	inline void InvalidateLineNum();
836 	inline void InvalidateAll();
837 	void ImplInvalidateSize();
838 	void ImplInvalidatePrt();
839 	void ImplInvalidatePos();
840 	void ImplInvalidateLineNum();
841 
842 	inline void InvalidateNextPos( sal_Bool bNoFtn = sal_False );
843 	void ImplInvalidateNextPos( sal_Bool bNoFtn = sal_False );
844 
845     /** method to invalidate printing area of next frame
846 
847         OD 09.01.2004 #i11859#
848 
849         @author OD
850     */
851     void InvalidateNextPrtArea();
852 
853 	void InvalidatePage( const SwPageFrm *pPage = 0 ) const;
854 
855 	virtual bool    FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
856 
857 	virtual sal_Bool	GetCrsrOfst( SwPosition *, Point&,
858 								 SwCrsrMoveState* = 0 ) const;
859 	virtual sal_Bool	GetCharRect( SwRect &, const SwPosition&,
860 								 SwCrsrMoveState* = 0 ) const;
861     virtual void Paint( SwRect const&,
862                         SwPrintData const*const pPrintData = NULL ) const;
863 
864 	// der "kurze Dienstweg" zwischen den Frames und der Formatierung.
865 	// Wer den void* falsch Casted ist selbst schuld!
866 	// Auf jedenfall muss der void* auf 0 geprueft werden.
867 	virtual void Prepare( const PrepareHint ePrep = PREP_CLEAR,
868 						  const void *pVoid = 0, sal_Bool bNotify = sal_True );
869 
870 	//sal_True wenn's die richtige Klasse ist, sal_False sonst
871 	inline sal_Bool IsLayoutFrm() const;
872 	inline sal_Bool IsRootFrm() const;
873 	inline sal_Bool IsPageFrm() const;
874 	inline sal_Bool IsColumnFrm() const;
875 	inline sal_Bool IsFtnBossFrm() const; // Fussnotenbosse sind PageFrms und ColumnFrms
876 	inline sal_Bool IsHeaderFrm() const;
877 	inline sal_Bool IsFooterFrm() const;
878 	inline sal_Bool IsFtnContFrm() const;
879 	inline sal_Bool IsFtnFrm() const;
880 	inline sal_Bool IsBodyFrm() const;
881 	inline sal_Bool IsColBodyFrm() const;	// in layfrm.hxx implementiert, BodyFrm unterhalb ColumnFrm
882 	inline sal_Bool IsPageBodyFrm() const;  // in layfrm.hxx implementiert, BodyFrm unterhalb PageFrm
883 	inline sal_Bool IsFlyFrm() const;
884 	inline sal_Bool IsSctFrm() const;
885 	inline sal_Bool IsTabFrm() const;
886 	inline sal_Bool IsRowFrm() const;
887 	inline sal_Bool IsCellFrm() const;
888 	inline sal_Bool IsCntntFrm() const;
889 	inline sal_Bool IsTxtFrm() const;
890 	inline sal_Bool IsNoTxtFrm() const;
891 	inline sal_Bool IsFlowFrm() const;		//Frms deren PrtArea von den Nachbarn
892 										//abhaengen und die halt im Inhaltsfluss
893 										//stehen.
894 	inline sal_Bool IsRetoucheFrm() const;	//Frms die Retouchefaehig sind bzw. die
895 										//u.U. hinter sich Retouchieren muessen.
896 	inline sal_Bool IsAccessibleFrm() const;
897 
898 	void PrepareCrsr();					//Die CrsrShell darf.
899 
900 	//Ist der Frm (bzw. die Section in der er steht) geschuetzt?
901 	//Auch Fly in Fly in ... und Fussnoten
902 	sal_Bool IsProtected() const;
903 
904 	sal_Bool IsColLocked()	const { return bColLocked; }
905 
906 	virtual ~SwFrm();
907 
908     // No inline cause we need the function pointers
909     long GetTopMargin() const;
910     long GetBottomMargin() const;
911     long GetLeftMargin() const;
912     long GetRightMargin() const;
913     void SetTopBottomMargins( long, long );
914     void SetBottomTopMargins( long, long );
915     void SetLeftRightMargins( long, long );
916     void SetRightLeftMargins( long, long );
917     void SetLeftAndWidth( long nLeft, long nWidth );
918     void SetTopAndHeight( long nTop, long nHeight );
919     void SetRightAndWidth( long nRight, long nWidth );
920     void SetBottomAndHeight( long nBottom, long nHeight );
921     long GetPrtLeft() const;
922     long GetPrtBottom() const;
923     long GetPrtRight() const;
924     long GetPrtTop() const;
925     sal_Bool SetMinLeft( long );
926     sal_Bool SetMaxBottom( long );
927     sal_Bool SetMaxRight( long );
928     sal_Bool SetMinTop( long );
929     void MakeBelowPos( const SwFrm*, const SwFrm*, sal_Bool );
930     void MakeUpperPos( const SwFrm*, const SwFrm*, sal_Bool );
931     void MakeLeftPos( const SwFrm*, const SwFrm*, sal_Bool );
932     void MakeRightPos( const SwFrm*, const SwFrm*, sal_Bool );
933     inline sal_Bool IsNeighbourFrm() const
934         { return GetType() & FRM_NEIGHBOUR ? sal_True : sal_False; }
935 
936     // --> OD 2006-05-10 #i65250#
937     inline sal_uInt32 GetFrmId() const { return mnFrmId; }
938     inline sal_uInt32 GetLastFrmId() const { return mnLastFrmId; }
939     // <--
940 
941     // NEW TABELS
942     // Some functions for covered/covering table cells. This way unnessessary
943     // includes can be avoided
944     bool IsLeaveUpperAllowed() const;
945     bool IsCoveredCell() const;
946     bool IsInCoveredCell() const;
947 
948     // FME 2007-08-30 #i81146# new loop control
949     bool KnowsFormat( const SwFmt& rFmt ) const;
950     void RegisterToFormat( SwFmt& rFmt );
951     void ValidateThisAndAllLowers( const sal_uInt16 nStage );
952 };
953 
954 inline sal_Bool	SwFrm::IsInDocBody() const
955 {
956 	if ( bInfInvalid )
957 		((SwFrm*)this)->SetInfFlags();
958 	return bInfBody;
959 }
960 inline sal_Bool	SwFrm::IsInFtn() const
961 {
962 	if ( bInfInvalid )
963 		((SwFrm*)this)->SetInfFlags();
964 	return bInfFtn;
965 }
966 inline sal_Bool SwFrm::IsInTab() const
967 {
968 	if ( bInfInvalid )
969 		((SwFrm*)this)->SetInfFlags();
970 	return bInfTab;
971 }
972 inline sal_Bool SwFrm::IsInFly() const
973 {
974 	if ( bInfInvalid )
975 		((SwFrm*)this)->SetInfFlags();
976 	return bInfFly;
977 }
978 inline sal_Bool SwFrm::IsInSct() const
979 {
980 	if ( bInfInvalid )
981 		((SwFrm*)this)->SetInfFlags();
982 	return bInfSct;
983 }
984 sal_Bool SwFrm::IsVertical() const
985 {
986     if( bInvalidVert )
987         ((SwFrm*)this)->SetDirFlags( sal_True );
988     return bVertical != 0;
989 }
990 //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
991 inline sal_Bool SwFrm::IsVertLR() const
992 {
993 	return bVertLR != 0;
994 }
995 //End of SCMS
996 sal_Bool SwFrm::GetVerticalFlag() const
997 {
998     return bVertical != 0;
999 }
1000 inline sal_Bool SwFrm::IsRightToLeft() const
1001 {
1002     if( bInvalidR2L )
1003         ((SwFrm*)this)->SetDirFlags( sal_False );
1004     return bRightToLeft != 0;
1005 }
1006 sal_Bool SwFrm::GetRightToLeftFlag() const
1007 {
1008     return bRightToLeft != 0;
1009 }
1010 
1011 inline void SwFrm::SetCompletePaint() const
1012 {
1013 	((SwFrm*)this)->bCompletePaint = sal_True;
1014 }
1015 inline void SwFrm::ResetCompletePaint() const
1016 {
1017 	((SwFrm*)this)->bCompletePaint = sal_False;
1018 }
1019 
1020 inline void SwFrm::SetRetouche() const
1021 {
1022 	((SwFrm*)this)->bRetouche = sal_True;
1023 }
1024 inline void SwFrm::ResetRetouche() const
1025 {
1026 	((SwFrm*)this)->bRetouche = sal_False;
1027 }
1028 
1029 inline SwLayoutFrm *SwFrm::GetNextLayoutLeaf()
1030 {
1031     return (SwLayoutFrm*)((const SwFrm*)this)->GetNextLayoutLeaf();
1032 }
1033 
1034 inline SwLayoutFrm *SwFrm::GetPrevLayoutLeaf()
1035 {
1036 	return (SwLayoutFrm*)((const SwFrm*)this)->GetPrevLayoutLeaf();
1037 }
1038 
1039 inline const SwLayoutFrm *SwFrm::GetNextLayoutLeaf() const
1040 {
1041     return ImplGetNextLayoutLeaf( true );
1042 }
1043 
1044 inline const SwLayoutFrm *SwFrm::GetPrevLayoutLeaf() const
1045 {
1046     return ImplGetNextLayoutLeaf( false );
1047 }
1048 
1049 inline void SwFrm::InvalidateSize()
1050 {
1051 	if ( bValidSize )
1052 		ImplInvalidateSize();
1053 }
1054 inline void SwFrm::InvalidatePrt()
1055 {
1056 	if ( bValidPrtArea )
1057 		ImplInvalidatePrt();
1058 }
1059 inline void SwFrm::InvalidatePos()
1060 {
1061 	if ( bValidPos )
1062 		ImplInvalidatePos();
1063 }
1064 inline void SwFrm::InvalidateLineNum()
1065 {
1066 	if ( bValidLineNum )
1067 		ImplInvalidateLineNum();
1068 }
1069 
1070 inline void SwFrm::InvalidateAll()
1071 {
1072     if ( _InvalidationAllowed( INVALID_ALL ) )
1073     {
1074         if ( bValidPrtArea && bValidSize && bValidPos  )
1075             ImplInvalidatePos();
1076         bValidPrtArea = bValidSize = bValidPos = sal_False;
1077 
1078         // OD 2004-05-19 #i28701#
1079         _ActionOnInvalidation( INVALID_ALL );
1080     }
1081 }
1082 
1083 inline void SwFrm::InvalidateNextPos( sal_Bool bNoFtn )
1084 {
1085 	if ( pNext && !pNext->IsSctFrm() )
1086 		pNext->InvalidatePos();
1087 #ifndef C30 // vielleicht geht es ja bei C40 ?
1088 	else
1089 		ImplInvalidateNextPos( bNoFtn );
1090 #else
1091 	if ( !pNext )
1092 		ImplInvalidateNextPos( bNoFtn );
1093 #endif
1094 }
1095 
1096 inline void SwFrm::Calc() const
1097 {
1098 	if ( !bValidPos || !bValidPrtArea || !bValidSize )
1099 		((SwFrm*)this)->PrepareMake();
1100 }
1101 inline void SwFrm::OptCalc() const
1102 {
1103 	if ( !bValidPos || !bValidPrtArea || !bValidSize )
1104 		((SwFrm*)this)->OptPrepareMake();
1105 }
1106 
1107 inline Point SwFrm::GetRelPos() const
1108 {
1109 	Point aRet( aFrm.Pos() );
1110 		//hier wird gecasted, weil die Klasse SwLayoutFrm nur vorward-
1111 		//declariert ist.
1112 	aRet -= ((SwFrm*)GetUpper())->Prt().Pos();
1113 	aRet -= ((SwFrm*)GetUpper())->Frm().Pos();
1114 	return aRet;
1115 }
1116 
1117 inline const SwPageFrm *SwFrm::FindPageFrm() const
1118 {
1119 	return ((SwFrm*)this)->FindPageFrm();
1120 }
1121 inline const SwFrm *SwFrm::FindColFrm() const
1122 {
1123 	return ((SwFrm*)this)->FindColFrm();
1124 }
1125 inline const SwFrm *SwFrm::FindFooterOrHeader() const
1126 {
1127 	return ((SwFrm*)this)->FindFooterOrHeader();
1128 }
1129 inline SwTabFrm *SwFrm::FindTabFrm()
1130 {
1131 	return IsInTab() ? ImplFindTabFrm() : 0;
1132 }
1133 inline const SwFtnBossFrm *SwFrm::FindFtnBossFrm( sal_Bool bFtn ) const
1134 {
1135 	return ((SwFrm*)this)->FindFtnBossFrm( bFtn );
1136 }
1137 inline SwFtnFrm *SwFrm::FindFtnFrm()
1138 {
1139 	return IsInFtn() ? ImplFindFtnFrm() : 0;
1140 }
1141 inline SwFlyFrm *SwFrm::FindFlyFrm()
1142 {
1143 	return IsInFly() ? ImplFindFlyFrm() : 0;
1144 }
1145 inline SwSectionFrm *SwFrm::FindSctFrm()
1146 {
1147 	return IsInSct() ? ImplFindSctFrm() : 0;
1148 }
1149 
1150 inline const SwTabFrm *SwFrm::FindTabFrm() const
1151 {
1152 	return IsInTab() ? ((SwFrm*)this)->ImplFindTabFrm() : 0;
1153 }
1154 inline const SwFtnFrm *SwFrm::FindFtnFrm() const
1155 {
1156 	return IsInFtn() ? ((SwFrm*)this)->ImplFindFtnFrm() : 0;
1157 }
1158 inline const SwFlyFrm *SwFrm::FindFlyFrm() const
1159 {
1160 	return IsInFly() ? ((SwFrm*)this)->ImplFindFlyFrm() : 0;
1161 }
1162 inline const SwSectionFrm *SwFrm::FindSctFrm() const
1163 {
1164 	return IsInSct() ? ((SwFrm*)this)->ImplFindSctFrm() : 0;
1165 }
1166 inline SwFrm *SwFrm::FindNext()
1167 {
1168 	if ( pNext )
1169 		return pNext;
1170 	else
1171 		return _FindNext();
1172 }
1173 inline const SwFrm *SwFrm::FindNext() const
1174 {
1175 	if ( pNext )
1176 		return pNext;
1177 	else
1178 		return ((SwFrm*)this)->_FindNext();
1179 }
1180 // --> OD 2005-12-01 #i27138# - add parameter <_bInSameFtn>
1181 inline SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn )
1182 {
1183 	if ( pNext && pNext->IsCntntFrm() )
1184 		return (SwCntntFrm*)pNext;
1185 	else
1186         return _FindNextCnt( _bInSameFtn );
1187 }
1188 // <--
1189 // --> OD 2005-12-01 #i27138# - add parameter <_bInSameFtn>
1190 inline const SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn ) const
1191 {
1192 	if ( pNext && pNext->IsCntntFrm() )
1193 		return (SwCntntFrm*)pNext;
1194 	else
1195         return ((SwFrm*)this)->_FindNextCnt( _bInSameFtn );
1196 }
1197 // <--
1198 inline SwFrm *SwFrm::FindPrev()
1199 {
1200 	if ( pPrev && !pPrev->IsSctFrm() )
1201 		return pPrev;
1202 	else
1203 		return _FindPrev();
1204 }
1205 inline const SwFrm *SwFrm::FindPrev() const
1206 {
1207 	if ( pPrev && !pPrev->IsSctFrm() )
1208 		return pPrev;
1209 	else
1210 		return ((SwFrm*)this)->_FindPrev();
1211 }
1212 
1213 
1214 inline sal_Bool SwFrm::IsLayoutFrm() const
1215 {
1216     return GetType() & FRM_LAYOUT ? sal_True : sal_False;
1217 }
1218 inline sal_Bool SwFrm::IsRootFrm() const
1219 {
1220     return nType == FRMC_ROOT;
1221 }
1222 inline sal_Bool SwFrm::IsPageFrm() const
1223 {
1224     return nType == FRMC_PAGE;
1225 }
1226 inline sal_Bool SwFrm::IsColumnFrm() const
1227 {
1228     return nType == FRMC_COLUMN;
1229 }
1230 inline sal_Bool SwFrm::IsFtnBossFrm() const
1231 {
1232     return GetType() & FRM_FTNBOSS ? sal_True : sal_False;
1233 }
1234 inline sal_Bool SwFrm::IsHeaderFrm() const
1235 {
1236     return nType == FRMC_HEADER;
1237 }
1238 inline sal_Bool SwFrm::IsFooterFrm() const
1239 {
1240     return nType == FRMC_FOOTER;
1241 }
1242 inline sal_Bool SwFrm::IsFtnContFrm() const
1243 {
1244     return nType == FRMC_FTNCONT;
1245 }
1246 inline sal_Bool SwFrm::IsFtnFrm() const
1247 {
1248     return nType == FRMC_FTN;
1249 }
1250 inline sal_Bool SwFrm::IsBodyFrm() const
1251 {
1252     return nType == FRMC_BODY;
1253 }
1254 inline sal_Bool SwFrm::IsFlyFrm() const
1255 {
1256     return nType == FRMC_FLY;
1257 }
1258 inline sal_Bool SwFrm::IsSctFrm() const
1259 {
1260     return nType == FRMC_SECTION;
1261 }
1262 inline sal_Bool SwFrm::IsTabFrm() const
1263 {
1264     return nType == FRMC_TAB;
1265 }
1266 inline sal_Bool SwFrm::IsRowFrm() const
1267 {
1268     return nType == FRMC_ROW;
1269 }
1270 inline sal_Bool SwFrm::IsCellFrm() const
1271 {
1272     return nType == FRMC_CELL;
1273 }
1274 inline sal_Bool SwFrm::IsCntntFrm() const
1275 {
1276     return GetType() & FRM_CNTNT ? sal_True : sal_False;
1277 }
1278 inline sal_Bool SwFrm::IsTxtFrm() const
1279 {
1280     return nType == FRMC_TXT;
1281 }
1282 inline sal_Bool SwFrm::IsNoTxtFrm() const
1283 {
1284     return nType == FRMC_NOTXT;
1285 }
1286 inline sal_Bool SwFrm::IsFlowFrm() const
1287 {
1288     return GetType() & 0xCA00 ? sal_True : sal_False;   //TabFrm, CntntFrm, SectionFrm
1289 }
1290 inline sal_Bool SwFrm::IsRetoucheFrm() const
1291 {
1292     return GetType() & 0xCA40 ? sal_True : sal_False;   //TabFrm, CntntFrm, SectionFrm, Ftnfrm
1293 }
1294 inline sal_Bool SwFrm::IsAccessibleFrm() const
1295 {
1296     return GetType() & FRM_ACCESSIBLE ? sal_True : sal_False;
1297 }
1298 #endif
1299