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