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