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