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