Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SW_FRAME_HXX
30 : : #define SW_FRAME_HXX
31 : :
32 : : #include <vector>
33 : : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
34 : : #include <drawinglayer/processor2d/baseprocessor2d.hxx>
35 : : #include <editeng/borderline.hxx>
36 : : #include "swtypes.hxx"
37 : : #include "swrect.hxx"
38 : : #include "calbck.hxx"
39 : : #include <svl/brdcst.hxx>
40 : : #include "IDocumentDrawModelAccess.hxx"
41 : :
42 : : class SwLayoutFrm;
43 : : class SwRootFrm;
44 : : class SwPageFrm;
45 : : class SwFlyFrm;
46 : : class SwSectionFrm;
47 : : class SwFtnFrm;
48 : : class SwFtnBossFrm;
49 : : class SwTabFrm;
50 : : class SwRowFrm;
51 : : class SwFlowFrm;
52 : : class SwCntntFrm;
53 : : class SfxPoolItem;
54 : : class SwAttrSet;
55 : : class ViewShell;
56 : : class Color;
57 : : class SwBorderAttrs;
58 : : class SwCache;
59 : : class SvxBrushItem;
60 : : class SwSelectionList;
61 : : struct SwPosition;
62 : : struct SwCrsrMoveState;
63 : : class SwFmt;
64 : : class SwPrintData;
65 : : class SwSortedObjs;
66 : : class SwAnchoredObject;
67 : : typedef struct _xmlTextWriter *xmlTextWriterPtr;
68 : :
69 : : // Each FrmType is represented here as a bit.
70 : : // The bits must be set in a way that it can be determined with masking of
71 : : // which kind of FrmType an instance is _and_ from what classes it was derived.
72 : : // Each frame has in its base class a member that must be set by the
73 : : // constructors accordingly.
74 : : #define FRM_ROOT 0x0001
75 : : #define FRM_PAGE 0x0002
76 : : #define FRM_COLUMN 0x0004
77 : : #define FRM_HEADER 0x0008
78 : : #define FRM_FOOTER 0x0010
79 : : #define FRM_FTNCONT 0x0020
80 : : #define FRM_FTN 0x0040
81 : : #define FRM_BODY 0x0080
82 : : #define FRM_FLY 0x0100
83 : : #define FRM_SECTION 0x0200
84 : : #define FRM_UNUSED 0x0400
85 : : #define FRM_TAB 0x0800
86 : : #define FRM_ROW 0x1000
87 : : #define FRM_CELL 0x2000
88 : : #define FRM_TXT 0x4000
89 : : #define FRM_NOTXT 0x8000
90 : :
91 : : // for internal use some common combinations
92 : : #define FRM_LAYOUT 0x3FFF
93 : : #define FRM_CNTNT 0xC000
94 : : #define FRM_FTNBOSS 0x0006
95 : : #define FRM_ACCESSIBLE (FRM_HEADER|FRM_FOOTER|FRM_FTN|FRM_TXT|FRM_ROOT|FRM_FLY|FRM_TAB|FRM_CELL|FRM_PAGE)
96 : :
97 : : // The type of the frame is internal represented by the 4-bit value nType,
98 : : // which can expanded to the types above by shifting a bit (0x1 << nType)
99 : : // Here are the corresponding defines for the compressed representation:
100 : : #define FRMC_ROOT 0
101 : : #define FRMC_PAGE 1
102 : : #define FRMC_COLUMN 2
103 : : #define FRMC_HEADER 3
104 : : #define FRMC_FOOTER 4
105 : : #define FRMC_FTNCONT 5
106 : : #define FRMC_FTN 6
107 : : #define FRMC_BODY 7
108 : : #define FRMC_FLY 8
109 : : #define FRMC_SECTION 9
110 : : #define FRMC_UNUSED 10
111 : : #define FRMC_TAB 11
112 : : #define FRMC_ROW 12
113 : : #define FRMC_CELL 13
114 : : #define FRMC_TXT 14
115 : : #define FRMC_NOTXT 15
116 : :
117 : : #define FRM_NEIGHBOUR 0x2004
118 : : #define FRM_NOTE_VERT 0x7a60
119 : : #define FRM_HEADFOOT 0x0018
120 : : #define FRM_BODYFTNC 0x00a0
121 : :
122 : : class SwFrm;
123 : : typedef long (SwFrm:: *SwFrmGet)() const;
124 : : typedef sal_Bool (SwFrm:: *SwFrmMax)( long );
125 : : typedef void (SwFrm:: *SwFrmMakePos)( const SwFrm*, const SwFrm*, sal_Bool );
126 : : typedef long (*SwOperator)( long, long );
127 : : typedef void (SwFrm:: *SwFrmSet)( long, long );
128 : :
129 : : struct SwRectFnCollection
130 : : {
131 : : SwRectGet fnGetTop;
132 : : SwRectGet fnGetBottom;
133 : : SwRectGet fnGetLeft;
134 : : SwRectGet fnGetRight;
135 : : SwRectGet fnGetWidth;
136 : : SwRectGet fnGetHeight;
137 : : SwRectPoint fnGetPos;
138 : : SwRectSize fnGetSize;
139 : :
140 : : SwRectSet fnSetTop;
141 : : SwRectSet fnSetBottom;
142 : : SwRectSet fnSetLeft;
143 : : SwRectSet fnSetRight;
144 : : SwRectSet fnSetWidth;
145 : : SwRectSet fnSetHeight;
146 : :
147 : : SwRectSet fnSubTop;
148 : : SwRectSet fnAddBottom;
149 : : SwRectSet fnSubLeft;
150 : : SwRectSet fnAddRight;
151 : : SwRectSet fnAddWidth;
152 : : SwRectSet fnAddHeight;
153 : :
154 : : SwRectSet fnSetPosX;
155 : : SwRectSet fnSetPosY;
156 : :
157 : : SwFrmGet fnGetTopMargin;
158 : : SwFrmGet fnGetBottomMargin;
159 : : SwFrmGet fnGetLeftMargin;
160 : : SwFrmGet fnGetRightMargin;
161 : : SwFrmSet fnSetXMargins;
162 : : SwFrmSet fnSetYMargins;
163 : : SwFrmGet fnGetPrtTop;
164 : : SwFrmGet fnGetPrtBottom;
165 : : SwFrmGet fnGetPrtLeft;
166 : : SwFrmGet fnGetPrtRight;
167 : : SwRectDist fnTopDist;
168 : : SwRectDist fnBottomDist;
169 : : SwRectDist fnLeftDist;
170 : : SwRectDist fnRightDist;
171 : : SwFrmMax fnSetLimit;
172 : : SwRectMax fnOverStep;
173 : :
174 : : SwRectSetPos fnSetPos;
175 : : SwFrmMakePos fnMakePos;
176 : : SwOperator fnXDiff;
177 : : SwOperator fnYDiff;
178 : : SwOperator fnXInc;
179 : : SwOperator fnYInc;
180 : :
181 : : SwRectSetTwice fnSetLeftAndWidth;
182 : : SwRectSetTwice fnSetTopAndHeight;
183 : : };
184 : :
185 : : typedef SwRectFnCollection* SwRectFn;
186 : :
187 : : // Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
188 : : extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R, fnRectVertL2R;
189 : : #define SWRECTFN( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
190 : : sal_Bool bRev = pFrm->IsReverse(); \
191 : : sal_Bool bVertL2R = pFrm->IsVertLR(); \
192 : : SwRectFn fnRect = bVert ? \
193 : : ( bRev ? fnRectVL2R : ( bVertL2R ? fnRectVertL2R : fnRectVert ) ): \
194 : : ( bRev ? fnRectB2T : fnRectHori );
195 : : #define SWRECTFNX( pFrm ) sal_Bool bVertX = pFrm->IsVertical(); \
196 : : sal_Bool bRevX = pFrm->IsReverse(); \
197 : : sal_Bool bVertL2RX = pFrm->IsVertLR(); \
198 : : SwRectFn fnRectX = bVertX ? \
199 : : ( bRevX ? fnRectVL2R : ( bVertL2RX ? fnRectVertL2R : fnRectVert ) ): \
200 : : ( bRevX ? fnRectB2T : fnRectHori );
201 : : #define SWREFRESHFN( pFrm ) { if( bVert != pFrm->IsVertical() || \
202 : : bRev != pFrm->IsReverse() ) \
203 : : bVert = pFrm->IsVertical(); \
204 : : bRev = pFrm->IsReverse(); \
205 : : bVertL2R = pFrm->IsVertLR(); \
206 : : fnRect = bVert ? \
207 : : ( bRev ? fnRectVL2R : ( bVertL2R ? fnRectVertL2R : fnRectVert ) ): \
208 : : ( bRev ? fnRectB2T : fnRectHori ); }
209 : : #define SWRECTFN2( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
210 : : sal_Bool bVertL2R = pFrm->IsVertLR(); \
211 : : sal_Bool bNeighb = pFrm->IsNeighbourFrm(); \
212 : : SwRectFn fnRect = bVert == bNeighb ? \
213 : : fnRectHori : ( bVertL2R ? fnRectVertL2R : fnRectVert );
214 : : //End of SCMS
215 : : #define POS_DIFF( aFrm1, aFrm2 ) \
216 : : ( (aFrm1.*fnRect->fnGetTop)() != (aFrm2.*fnRect->fnGetTop)() || \
217 : : (aFrm1.*fnRect->fnGetLeft)() != (aFrm2.*fnRect->fnGetLeft)() )
218 : :
219 : : // for GetNextLeaf/GetPrevLeaf.
220 : : enum MakePageType
221 : : {
222 : : MAKEPAGE_NONE, // do not create page/footnote
223 : : MAKEPAGE_APPEND, // only append page if needed
224 : : MAKEPAGE_INSERT, // add or append page if needed
225 : : MAKEPAGE_FTN, // add footnote if needed
226 : : MAKEPAGE_NOSECTION // Don't create section frames
227 : : };
228 : :
229 : : /**
230 : : * Base class of the Writer layout elements.
231 : : *
232 : : * This includes not only fly frames, but everything down to the paragraph
233 : : * level: pages, headers, footers, etc. (Inside a paragraph SwLinePortion
234 : : * instances are used.)
235 : : */
236 : : class SwFrm: public SwClient, public SfxBroadcaster
237 : : {
238 : : // the hidden Frm
239 : : friend class SwFlowFrm;
240 : : friend class SwLayoutFrm;
241 : : friend class SwLooping;
242 : :
243 : : // voids lower during creation of a column
244 : : friend SwFrm *SaveCntnt( SwLayoutFrm *, SwFrm* pStart = NULL );
245 : : friend void RestoreCntnt( SwFrm *, SwLayoutFrm *, SwFrm *pSibling, bool bGrow );
246 : :
247 : : #ifdef DBG_UTIL
248 : : // remove empty SwSectionFrms from a chain
249 : : friend SwFrm* SwClearDummies( SwFrm* pFrm );
250 : : #endif
251 : :
252 : : // for validating a mistakenly invalidated one in SwCntntFrm::MakeAll
253 : : friend void ValidateSz( SwFrm *pFrm );
254 : : // implemented in text/txtftn.cxx, prevents Ftn oscillation
255 : : friend void ValidateTxt( SwFrm *pFrm );
256 : :
257 : : friend void MakeNxt( SwFrm *pFrm, SwFrm *pNxt );
258 : :
259 : : // cache for (border) attributes
260 : : static SwCache *pCache;
261 : :
262 : : // #i65250#
263 : : // frame ID is now in general available - used for layout loop control
264 : : static sal_uInt32 mnLastFrmId;
265 : : const sal_uInt32 mnFrmId;
266 : :
267 : : SwRootFrm *mpRoot;
268 : : SwLayoutFrm *pUpper;
269 : : SwFrm *pNext;
270 : : SwFrm *pPrev;
271 : :
272 : : SwFrm *_FindNext();
273 : : SwFrm *_FindPrev();
274 : :
275 : : /** method to determine next content frame in the same environment
276 : : for a flow frame (content frame, table frame, section frame)
277 : :
278 : : #i27138# - adding documentation:
279 : : Travelling downwards through the layout to determine the next content
280 : : frame in the same environment. There are several environments in a
281 : : document, which form a closed context regarding this function. These
282 : : environments are:
283 : : - Each page header
284 : : - Each page footer
285 : : - Each unlinked fly frame
286 : : - Each group of linked fly frames
287 : : - All footnotes
288 : : - All document body frames
289 : : #i27138# - adding parameter <_bInSameFtn>
290 : : Its default value is <false>. If its value is <true>, the environment
291 : : 'All footnotes' is no longer treated. Instead each footnote is treated
292 : : as an own environment.
293 : :
294 : : @param _bInSameFtn
295 : : input parameter - boolean indicating, that the found next content
296 : : frame has to be in the same footnote frame. This parameter is only
297 : : relevant for flow frames in footnotes.
298 : :
299 : : @return SwCntntFrm*
300 : : pointer to the found next content frame. It's NULL, if none exists.
301 : : */
302 : : SwCntntFrm* _FindNextCnt( const bool _bInSameFtn = false );
303 : :
304 : : /** method to determine previous content frame in the same environment
305 : : for a flow frame (content frame, table frame, section frame)
306 : :
307 : : #i27138#
308 : : Travelling upwards through the layout to determine the previous content
309 : : frame in the same environment. There are several environments in a
310 : : document, which form a closed context regarding this function. These
311 : : environments are:
312 : : - Each page header
313 : : - Each page footer
314 : : - Each unlinked fly frame
315 : : - Each group of linked fly frames
316 : : - All footnotes
317 : : - All document body frames
318 : : #i27138# - adding parameter <_bInSameFtn>
319 : : Its default value is <false>. If its value is <true>, the environment
320 : : 'All footnotes' is no longer treated. Instead each footnote is treated
321 : : as an own environment.
322 : :
323 : : @param _bInSameFtn
324 : : input parameter - boolean indicating, that the found previous content
325 : : frame has to be in the same footnote frame. This parameter is only
326 : : relevant for flow frames in footnotes.
327 : :
328 : : @return SwCntntFrm*
329 : : pointer to the found previous content frame. It's NULL, if none exists.
330 : : */
331 : : SwCntntFrm* _FindPrevCnt( const bool _bInSameFtn = false );
332 : :
333 : : void _UpdateAttrFrm( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 & );
334 : : SwFrm* _GetIndNext();
335 : : void SetDirFlags( sal_Bool bVert );
336 : :
337 : : const SwLayoutFrm* ImplGetNextLayoutLeaf( bool bFwd ) const;
338 : :
339 : : protected:
340 : : SwSortedObjs* pDrawObjs; // draw objects, can be 0
341 : :
342 : : SwRect aFrm; // absolute position in document and size of the Frm
343 : : SwRect aPrt; // position relatively to Frm and size of PrtArea
344 : :
345 : : sal_uInt16 bReverse : 1; // Next line above/at the right side instead
346 : : // under/at the left side of the previous line
347 : : sal_uInt16 bInvalidR2L : 1;
348 : : sal_uInt16 bDerivedR2L : 1;
349 : : sal_uInt16 bRightToLeft : 1;
350 : : sal_uInt16 bInvalidVert : 1;
351 : : sal_uInt16 bDerivedVert : 1;
352 : : sal_uInt16 bVertical : 1;
353 : : // Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
354 : : sal_uInt16 bVertLR : 1;
355 : : sal_uInt16 nType : 4; //Who am I?
356 : :
357 : : sal_Bool bValidPos : 1;
358 : : sal_Bool bValidPrtArea : 1;
359 : : sal_Bool bValidSize : 1;
360 : : sal_Bool bValidLineNum : 1;
361 : : sal_Bool bFixSize : 1;
362 : : sal_Bool bUnUsed1 : 1;
363 : : // if sal_True, frame will be painted completely even content was changed
364 : : // only partially. For CntntFrms a border (from Action) will exclusively
365 : : // painted if <bCompletePaint> is sal_True.
366 : : sal_Bool bCompletePaint : 1;
367 : : sal_Bool bRetouche : 1; // frame is responsible for retouching
368 : :
369 : : protected:
370 : : sal_Bool bInfInvalid : 1; // InfoFlags are invalid
371 : : sal_Bool bInfBody : 1; // Frm is in document body
372 : : sal_Bool bInfTab : 1; // Frm is in a table
373 : : sal_Bool bInfFly : 1; // Frm is in a Fly
374 : : sal_Bool bInfFtn : 1; // Frm is in a footnote
375 : : sal_Bool bInfSct : 1; // Frm is in a section
376 : : sal_Bool bColLocked : 1; // lock Grow/Shrink for column-wise section
377 : : // or fly frames, will be set in Format
378 : :
379 : 1687 : void ColLock() { bColLocked = sal_True; }
380 : 1687 : void ColUnlock() { bColLocked = sal_False; }
381 : :
382 : : void Destroy(); // for ~SwRootFrm
383 : :
384 : : // Only used by SwRootFrm Ctor to get 'this' into mpRoot...
385 : 1318 : void setRootFrm( SwRootFrm* pRoot ) { mpRoot = pRoot; }
386 : :
387 : : SwPageFrm *InsertPage( SwPageFrm *pSibling, sal_Bool bFtn );
388 : : void PrepareMake();
389 : : void OptPrepareMake();
390 : : void MakePos();
391 : : // Format next frame of table frame to assure keeping attributes.
392 : : // In case of nested tables method <SwFrm::MakeAll()> is called to
393 : : // avoid formating of superior table frame.
394 : : friend SwFrm* lcl_FormatNextCntntForKeep( SwTabFrm* pTabFrm );
395 : :
396 : : virtual void MakeAll() = 0;
397 : : // adjust frames of a page
398 : : SwTwips AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst = sal_False );
399 : :
400 : : // change only frame size not the size of PrtArea
401 : : virtual SwTwips ShrinkFrm( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ) = 0;
402 : : virtual SwTwips GrowFrm ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ) = 0;
403 : :
404 : 2501717 : SwModify *GetDep() { return GetRegisteredInNonConst(); }
405 : 1309554 : const SwModify *GetDep() const { return GetRegisteredIn(); }
406 : :
407 : : SwFrm( SwModify*, SwFrm* );
408 : :
409 : : void CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_Bool bBrowse );
410 : :
411 : : /** enumeration for the different invalidations
412 : : #i28701#
413 : : */
414 : : enum InvalidationType
415 : : {
416 : : INVALID_SIZE, INVALID_PRTAREA, INVALID_POS, INVALID_LINENUM, INVALID_ALL
417 : : };
418 : :
419 : : /** method to determine, if an invalidation is allowed.
420 : : #i28701
421 : : */
422 : : virtual bool _InvalidationAllowed( const InvalidationType _nInvalid ) const;
423 : :
424 : : /** method to perform additional actions on an invalidation
425 : :
426 : : #i28701#
427 : : Method has *only* to contain actions, which has to be performed on
428 : : *every* assignment of the corresponding flag to <sal_False>.
429 : : */
430 : : virtual void _ActionOnInvalidation( const InvalidationType _nInvalid );
431 : :
432 : : // draw shadow and borders
433 : : void PaintShadow( const SwRect&, SwRect&, const SwBorderAttrs& ) const;
434 : : virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
435 : :
436 : : virtual const IDocumentDrawModelAccess* getIDocumentDrawModelAccess( );
437 : :
438 : : public:
439 : : TYPEINFO(); // already in base class
440 : :
441 : 4791738 : sal_uInt16 GetType() const { return 0x1 << nType; }
442 : :
443 : 171651 : static SwCache &GetCache() { return *pCache; }
444 : 73 : static SwCache *GetCachePtr() { return pCache; }
445 : 73 : static void SetCache( SwCache *pNew ) { pCache = pNew; }
446 : :
447 : : // change PrtArea size and FrmSize
448 : : SwTwips Shrink( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
449 : : SwTwips Grow ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
450 : :
451 : : // different methods for inserting in layout tree (for performance reasons)
452 : :
453 : : // insert before pBehind or at the end of the chain below pUpper
454 : : void InsertBefore( SwLayoutFrm* pParent, SwFrm* pBehind );
455 : : // insert after pBefore or at the beginnig of the chain below pUpper
456 : : void InsertBehind( SwLayoutFrm *pParent, SwFrm *pBefore );
457 : : // insert before pBehind or at the end of the chain while considering
458 : : // the siblings of pSct
459 : : void InsertGroupBefore( SwFrm* pParent, SwFrm* pWhere, SwFrm* pSct );
460 : : void Remove();
461 : :
462 : : // For internal use only - who ignores this will be put in a sack and has
463 : : // to stay there for two days
464 : : // Does special treatment for _Get[Next|Prev]Leaf() (for tables).
465 : : SwLayoutFrm *GetLeaf( MakePageType eMakePage, sal_Bool bFwd );
466 : : SwLayoutFrm *GetNextLeaf ( MakePageType eMakePage );
467 : : SwLayoutFrm *GetNextFtnLeaf( MakePageType eMakePage );
468 : : SwLayoutFrm *GetNextSctLeaf( MakePageType eMakePage );
469 : : SwLayoutFrm *GetNextCellLeaf( MakePageType eMakePage );
470 : : SwLayoutFrm *GetPrevLeaf ( MakePageType eMakeFtn = MAKEPAGE_FTN );
471 : : SwLayoutFrm *GetPrevFtnLeaf( MakePageType eMakeFtn = MAKEPAGE_FTN );
472 : : SwLayoutFrm *GetPrevSctLeaf( MakePageType eMakeFtn = MAKEPAGE_FTN );
473 : : SwLayoutFrm *GetPrevCellLeaf( MakePageType eMakeFtn = MAKEPAGE_FTN );
474 : : const SwLayoutFrm *GetLeaf ( MakePageType eMakePage, sal_Bool bFwd,
475 : : const SwFrm *pAnch ) const;
476 : :
477 : : sal_Bool WrongPageDesc( SwPageFrm* pNew );
478 : :
479 : : //#i28701# - new methods to append/remove drawing objects
480 : : void AppendDrawObj( SwAnchoredObject& _rNewObj );
481 : : void RemoveDrawObj( SwAnchoredObject& _rToRemoveObj );
482 : :
483 : : // work with chain of FlyFrms
484 : : void AppendFly( SwFlyFrm *pNew );
485 : : void RemoveFly( SwFlyFrm *pToRemove );
486 : 125039 : const SwSortedObjs *GetDrawObjs() const { return pDrawObjs; }
487 : 221824 : SwSortedObjs *GetDrawObjs() { return pDrawObjs; }
488 : : // #i28701# - change purpose of method and adjust its name
489 : : void InvalidateObjs( const bool _bInvaPosOnly,
490 : : const bool _bNoInvaOfAsCharAnchoredObjs = true );
491 : :
492 : : virtual void PaintBorder( const SwRect&, const SwPageFrm *pPage,
493 : : const SwBorderAttrs & ) const;
494 : : void PaintBaBo( const SwRect&, const SwPageFrm *pPage = 0,
495 : : const sal_Bool bLowerBorder = sal_False ) const;
496 : : void PaintBackground( const SwRect&, const SwPageFrm *pPage,
497 : : const SwBorderAttrs &,
498 : : const sal_Bool bLowerMode = sal_False,
499 : : const sal_Bool bLowerBorder = sal_False ) const;
500 : : void PaintBorderLine( const SwRect&, const SwRect&, const SwPageFrm*,
501 : : const Color *pColor, const editeng::SvxBorderStyle =
502 : : ::com::sun::star::table::BorderLineStyle::SOLID ) const;
503 : :
504 : : drawinglayer::processor2d::BaseProcessor2D * CreateProcessor2D( ) const;
505 : : void ProcessPrimitives( const drawinglayer::primitive2d::Primitive2DSequence& rSequence ) const;
506 : :
507 : : // FIXME: EasyHack (refactoring): rename method name in all files
508 : : // retouch, not in the area of the given Rect!
509 : : void Retouche( const SwPageFrm *pPage, const SwRect &rRect ) const;
510 : :
511 : : sal_Bool GetBackgroundBrush( const SvxBrushItem*& rpBrush,
512 : : const Color*& rpColor,
513 : : SwRect &rOrigRect,
514 : : sal_Bool bLowerMode ) const;
515 : :
516 : : inline void SetCompletePaint() const;
517 : : inline void ResetCompletePaint() const;
518 : 89716 : inline sal_Bool IsCompletePaint() const { return bCompletePaint; }
519 : :
520 : : inline void SetRetouche() const;
521 : : inline void ResetRetouche() const;
522 : 79965 : inline sal_Bool IsRetouche() const { return bRetouche; }
523 : :
524 : : void SetInfFlags();
525 : 8 : inline void InvalidateInfFlags() { bInfInvalid = sal_True; }
526 : : inline sal_Bool IsInDocBody() const; // use InfoFlags, determine flags
527 : : inline sal_Bool IsInFtn() const; // if necessary
528 : : inline sal_Bool IsInTab() const;
529 : : inline sal_Bool IsInFly() const;
530 : : inline sal_Bool IsInSct() const;
531 : :
532 : : // If frame is inside a split table row, this function returns
533 : : // the corresponding row frame in the follow table.
534 : : const SwRowFrm* IsInSplitTableRow() const;
535 : :
536 : : // If frame is inside a follow flow row, this function returns
537 : : // the corresponding row frame master table
538 : : const SwRowFrm* IsInFollowFlowRow() const;
539 : :
540 : : bool IsInBalancedSection() const;
541 : :
542 : 650046 : inline sal_Bool IsReverse() const { return bReverse; }
543 : : inline void SetReverse( sal_Bool bNew ){ bReverse = bNew ? 1 : 0; }
544 : : inline sal_Bool IsVertical() const;
545 : : //Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
546 : : inline sal_Bool IsVertLR() const;
547 : : inline sal_Bool GetVerticalFlag() const;
548 : : inline void SetVertical( sal_Bool bNew ){ bVertical = bNew ? 1 : 0; }
549 : : //Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
550 : : inline void SetbVertLR( sal_Bool bNew ) { bVertLR = bNew ? 1 : 0; }
551 [ - + ]: 1493 : inline void SetDerivedVert( sal_Bool bNew ){ bDerivedVert = bNew ? 1 : 0; }
552 [ + + ]: 21899 : inline void SetInvalidVert( sal_Bool bNew) { bInvalidVert = bNew ? 1 : 0; }
553 : : inline sal_Bool IsRightToLeft() const;
554 : : inline sal_Bool GetRightToLeftFlag() const;
555 : : inline void SetRightToLeft( sal_Bool bNew ){ bRightToLeft = bNew ? 1 : 0; }
556 [ - + ]: 1521 : inline void SetDerivedR2L( sal_Bool bNew ) { bDerivedR2L = bNew ? 1 : 0; }
557 [ + - ]: 639 : inline void SetInvalidR2L( sal_Bool bNew ) { bInvalidR2L = bNew ? 1 : 0; }
558 : :
559 : : void CheckDirChange();
560 : : // returns upper left frame position for LTR and
561 : : // upper right frame position for Asian / RTL frames
562 : : Point GetFrmAnchorPos( sal_Bool bIgnoreFlysAnchoredAtThisFrame ) const;
563 : :
564 : : /** determine, if frame is moveable in given environment
565 : :
566 : : method replaced 'old' method <sal_Bool IsMoveable() const>.
567 : : Determines, if frame is moveable in given environment. if no environment
568 : : is given (parameter _pLayoutFrm == 0L), the movability in the actual
569 : : environment (<this->GetUpper()) is checked.
570 : :
571 : : @param _pLayoutFrm
572 : : input parameter - given environment (layout frame), in which the movability
573 : : will be checked. If not set ( == 0L ), actual environment is taken.
574 : :
575 : : @return boolean, indicating, if frame is moveable in given environment
576 : : */
577 : : bool IsMoveable( const SwLayoutFrm* _pLayoutFrm = 0L ) const;
578 : :
579 : : // Is it permitted for the (Txt)Frm to add a footnote in the current
580 : : // environment (not e.g. for repeating table headlines)
581 : : sal_Bool IsFtnAllowed() const;
582 : :
583 : : virtual void Format( const SwBorderAttrs *pAttrs = 0 );
584 : :
585 : : virtual void CheckDirection( sal_Bool bVert );
586 : :
587 : : void ReinitializeFrmSizeAttrFlags();
588 : :
589 : : const SwAttrSet *GetAttrSet() const;
590 : :
591 : 22504 : inline sal_Bool HasFixSize() const { return bFixSize; }
592 : : inline void SetFixSize( sal_Bool bNew ) { bFixSize = bNew; }
593 : :
594 : : // check all pages (starting from the given) and correct them if needed
595 : : static void CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields = sal_True );
596 : :
597 : : // might return 0, with and without const
598 : 420403 : SwFrm *GetNext() { return pNext; }
599 : 186939 : SwFrm *GetPrev() { return pPrev; }
600 : 6336722 : SwLayoutFrm *GetUpper() { return pUpper; }
601 : 959782 : SwRootFrm *getRootFrm(){ return mpRoot; }
602 : : SwPageFrm *FindPageFrm();
603 : : SwFrm *FindColFrm();
604 : : SwRowFrm *FindRowFrm();
605 : : SwFtnBossFrm *FindFtnBossFrm( sal_Bool bFootnotes = sal_False );
606 : : SwTabFrm *ImplFindTabFrm();
607 : : SwFtnFrm *ImplFindFtnFrm();
608 : : SwFlyFrm *ImplFindFlyFrm();
609 : : SwSectionFrm *ImplFindSctFrm();
610 : : SwFrm *FindFooterOrHeader();
611 : : SwFrm *GetLower();
612 : 892766 : const SwFrm *GetNext() const { return pNext; }
613 : 349303 : const SwFrm *GetPrev() const { return pPrev; }
614 : 2513860 : const SwLayoutFrm *GetUpper() const { return pUpper; }
615 : 707247 : const SwRootFrm *getRootFrm() const { return mpRoot; }
616 : : inline SwTabFrm *FindTabFrm();
617 : : inline SwFtnFrm *FindFtnFrm();
618 : : inline SwFlyFrm *FindFlyFrm();
619 : : inline SwSectionFrm *FindSctFrm();
620 : : inline SwFrm *FindNext();
621 : : // #i27138# - add parameter <_bInSameFtn>
622 : : inline SwCntntFrm* FindNextCnt( const bool _bInSameFtn = false );
623 : : inline SwFrm *FindPrev();
624 : : inline const SwPageFrm *FindPageFrm() const;
625 : : inline const SwFtnBossFrm *FindFtnBossFrm( sal_Bool bFtn = sal_False ) const;
626 : : inline const SwFrm *FindColFrm() const;
627 : : inline const SwFrm *FindFooterOrHeader() const;
628 : : inline const SwTabFrm *FindTabFrm() const;
629 : : inline const SwFtnFrm *FindFtnFrm() const;
630 : : inline const SwFlyFrm *FindFlyFrm() const;
631 : : inline const SwSectionFrm *FindSctFrm() const;
632 : : inline const SwFrm *FindNext() const;
633 : : // #i27138# - add parameter <_bInSameFtn>
634 : : inline const SwCntntFrm* FindNextCnt( const bool _bInSameFtn = false ) const;
635 : : inline const SwFrm *FindPrev() const;
636 : : const SwFrm *GetLower() const;
637 : :
638 : : /** inline wrapper method for <_FindPrevCnt(..)>
639 : : #i27138#
640 : : */
641 : 0 : inline SwCntntFrm* FindPrevCnt( const bool _bInSameFtn = false )
642 : : {
643 [ # # ][ # # ]: 0 : if ( GetPrev() && GetPrev()->IsCntntFrm() )
[ # # ]
644 : 0 : return (SwCntntFrm*)(GetPrev());
645 : : else
646 : 0 : return _FindPrevCnt( _bInSameFtn );
647 : : }
648 : :
649 : : /** inline const wrapper method for <_FindPrevCnt(..)>
650 : : #i27138#
651 : : */
652 : 6 : inline const SwCntntFrm* FindPrevCnt( const bool _bInSameFtn = false ) const
653 : : {
654 [ + + ][ + - ]: 6 : if ( GetPrev() && GetPrev()->IsCntntFrm() )
[ + + ]
655 : 2 : return (const SwCntntFrm*)(GetPrev());
656 : : else
657 : 6 : return const_cast<SwFrm*>(this)->_FindPrevCnt( _bInSameFtn );
658 : : }
659 : :
660 : : // #i79774#
661 : : SwFrm* _GetIndPrev() const;
662 : 70724 : SwFrm* GetIndPrev() const
663 [ + + ][ + + ]: 70724 : { return ( pPrev || !IsInSct() ) ? pPrev : _GetIndPrev(); }
664 : :
665 : 48529 : SwFrm* GetIndNext()
666 [ + + ][ + + ]: 48529 : { return ( pNext || !IsInSct() ) ? pNext : _GetIndNext(); }
667 : : const SwFrm* GetIndNext() const { return ((SwFrm*)this)->GetIndNext(); }
668 : :
669 : : sal_uInt16 GetPhyPageNum() const; // page number without offset
670 : : sal_uInt16 GetVirtPageNum() const; // page number with offset
671 : 866 : sal_Bool OnRightPage() const { return 0 != GetPhyPageNum() % 2; };
672 : : sal_Bool WannaRightPage() const;
673 : : bool OnFirstPage() const;
674 : :
675 : : inline const SwLayoutFrm *GetPrevLayoutLeaf() const;
676 : : inline const SwLayoutFrm *GetNextLayoutLeaf() const;
677 : : inline SwLayoutFrm *GetPrevLayoutLeaf();
678 : : inline SwLayoutFrm *GetNextLayoutLeaf();
679 : :
680 : : inline void Calc() const; // here might be "formatted"
681 : : inline void OptCalc() const; // here we assume (for optimization) that
682 : : // the predecessors are already formatted
683 : :
684 : : inline Point GetRelPos() const;
685 : 2579282 : const SwRect &Frm() const { return aFrm; }
686 : 962340 : const SwRect &Prt() const { return aPrt; }
687 : :
688 : : // PaintArea is the area where content might be displayed.
689 : : // The margin of a page or the space between columns belongs to it.
690 : : const SwRect PaintArea() const;
691 : : // UnionFrm is the union of Frm- and PrtArea, normally identical
692 : : // to the FrmArea except in case of negative Prt margins.
693 : : const SwRect UnionFrm( sal_Bool bBorder = sal_False ) const;
694 : :
695 : : // HACK: Here we exceptionally allow direct access to members.
696 : : // This should not delude into changing those value randomly; it is the
697 : : // only option to circumvent compiler problems (same method with public
698 : : // and protected).
699 : 1873439 : SwRect &Frm() { return aFrm; }
700 : 1309624 : SwRect &Prt() { return aPrt; }
701 : :
702 : : virtual Size ChgSize( const Size& aNewSize );
703 : :
704 : : virtual void Cut() = 0;
705 : : virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ) = 0;
706 : :
707 : 10346 : void ValidateLineNum() { bValidLineNum = sal_True; }
708 : :
709 : 1887 : sal_Bool GetValidPosFlag() const { return bValidPos; }
710 : 2583 : sal_Bool GetValidPrtAreaFlag()const { return bValidPrtArea; }
711 : 53844 : sal_Bool GetValidSizeFlag() const { return bValidSize; }
712 : 33184 : sal_Bool GetValidLineNumFlag()const { return bValidLineNum; }
713 [ + + ][ + + ]: 174611 : sal_Bool IsValid() const { return bValidPos && bValidSize && bValidPrtArea; }
[ + + ]
714 : :
715 : : // Only invalidate Frm
716 : : // #i28701# - add call to method <_ActionOnInvalidation(..)>
717 : : // for all invalidation methods.
718 : : // #i28701# - use method <_InvalidationAllowed(..)> to
719 : : // decide, if invalidation will to be performed or not.
720 : : // #i26945# - no additional invalidation, if it's already
721 : : // invalidate.
722 : 12460 : void _InvalidateSize()
723 : : {
724 [ + + ][ + - ]: 12460 : if ( bValidSize && _InvalidationAllowed( INVALID_SIZE ) )
[ + + ]
725 : : {
726 : 3906 : bValidSize = sal_False;
727 : 3906 : _ActionOnInvalidation( INVALID_SIZE );
728 : : }
729 : 12460 : }
730 : 14312 : void _InvalidatePrt()
731 : : {
732 [ + + ][ + - ]: 14312 : if ( bValidPrtArea && _InvalidationAllowed( INVALID_PRTAREA ) )
[ + + ]
733 : : {
734 : 8414 : bValidPrtArea = sal_False;
735 : 8414 : _ActionOnInvalidation( INVALID_PRTAREA );
736 : : }
737 : 14312 : }
738 : 9970 : void _InvalidatePos()
739 : : {
740 [ + + ][ + - ]: 9970 : if ( bValidPos && _InvalidationAllowed( INVALID_POS ) )
[ + + ]
741 : : {
742 : 3385 : bValidPos = sal_False;
743 : 3385 : _ActionOnInvalidation( INVALID_POS );
744 : : }
745 : 9970 : }
746 : 3482 : void _InvalidateLineNum()
747 : : {
748 [ + + ][ + - ]: 3482 : if ( bValidLineNum && _InvalidationAllowed( INVALID_LINENUM ) )
[ + + ]
749 : : {
750 : 1584 : bValidLineNum = sal_False;
751 : 1584 : _ActionOnInvalidation( INVALID_LINENUM );
752 : : }
753 : 3482 : }
754 : 12024 : void _InvalidateAll()
755 : : {
756 [ + + ][ + + ]: 16586 : if ( ( bValidSize || bValidPrtArea || bValidPos ) &&
[ + + + - ]
[ + + ]
757 : 4562 : _InvalidationAllowed( INVALID_ALL ) )
758 : : {
759 : 4562 : bValidSize = bValidPrtArea = bValidPos = sal_False;
760 : 4562 : _ActionOnInvalidation( INVALID_ALL );
761 : : }
762 : 12024 : }
763 : : // also notify page at the same time
764 : : inline void InvalidateSize();
765 : : inline void InvalidatePrt();
766 : : inline void InvalidatePos();
767 : : inline void InvalidateLineNum();
768 : : inline void InvalidateAll();
769 : : void ImplInvalidateSize();
770 : : void ImplInvalidatePrt();
771 : : void ImplInvalidatePos();
772 : : void ImplInvalidateLineNum();
773 : :
774 : : inline void InvalidateNextPos( sal_Bool bNoFtn = sal_False );
775 : : void ImplInvalidateNextPos( sal_Bool bNoFtn = sal_False );
776 : :
777 : : /** method to invalidate printing area of next frame
778 : : #i11859#
779 : : */
780 : : void InvalidateNextPrtArea();
781 : :
782 : : void InvalidatePage( const SwPageFrm *pPage = 0 ) const;
783 : :
784 : : virtual bool FillSelection( SwSelectionList& rList, const SwRect& rRect ) const;
785 : :
786 : : virtual sal_Bool GetCrsrOfst( SwPosition *, Point&,
787 : : SwCrsrMoveState* = 0 ) const;
788 : : virtual sal_Bool GetCharRect( SwRect &, const SwPosition&,
789 : : SwCrsrMoveState* = 0 ) const;
790 : : virtual void Paint( SwRect const&,
791 : : SwPrintData const*const pPrintData = NULL ) const;
792 : :
793 : : // HACK: shortcut between frame and formatting
794 : : // It's your own fault if you cast void* incorrectly! In any case check
795 : : // the void* for 0.
796 : : virtual void Prepare( const PrepareHint ePrep = PREP_CLEAR,
797 : : const void *pVoid = 0, sal_Bool bNotify = sal_True );
798 : :
799 : : // sal_True if it is the correct class, sal_False otherwise
800 : : inline sal_Bool IsLayoutFrm() const;
801 : : inline sal_Bool IsRootFrm() const;
802 : : inline sal_Bool IsPageFrm() const;
803 : : inline sal_Bool IsColumnFrm() const;
804 : : inline sal_Bool IsFtnBossFrm() const; // footnote bosses might be PageFrms or ColumnFrms
805 : : inline sal_Bool IsHeaderFrm() const;
806 : : inline sal_Bool IsFooterFrm() const;
807 : : inline sal_Bool IsFtnContFrm() const;
808 : : inline sal_Bool IsFtnFrm() const;
809 : : inline sal_Bool IsBodyFrm() const;
810 : : inline sal_Bool IsColBodyFrm() const; // implemented in layfrm.hxx, BodyFrm above ColumnFrm
811 : : inline sal_Bool IsPageBodyFrm() const; // implemented in layfrm.hxx, BodyFrm above PageFrm
812 : : inline sal_Bool IsFlyFrm() const;
813 : : inline sal_Bool IsSctFrm() const;
814 : : inline sal_Bool IsTabFrm() const;
815 : : inline sal_Bool IsRowFrm() const;
816 : : inline sal_Bool IsCellFrm() const;
817 : : inline sal_Bool IsCntntFrm() const;
818 : : inline sal_Bool IsTxtFrm() const;
819 : : inline sal_Bool IsNoTxtFrm() const;
820 : : // Frms where its PrtArea depends on their neighbors and that are
821 : : // positioned in the content flow
822 : : inline sal_Bool IsFlowFrm() const;
823 : : // Frms that are capable of retouching or that might need to retouch behind
824 : : // themselves
825 : : inline sal_Bool IsRetoucheFrm() const;
826 : : inline sal_Bool IsAccessibleFrm() const;
827 : :
828 : : void PrepareCrsr(); // CrsrShell is allowed to call this
829 : :
830 : : // Is the Frm (or the section containing it) protected? Same for Fly in
831 : : // Fly in ... and footnotes
832 : : sal_Bool IsProtected() const;
833 : :
834 : 6439 : sal_Bool IsColLocked() const { return bColLocked; }
835 : :
836 : : virtual ~SwFrm();
837 : :
838 : : // No inline cause we need the function pointers
839 : : long GetTopMargin() const;
840 : : long GetBottomMargin() const;
841 : : long GetLeftMargin() const;
842 : : long GetRightMargin() const;
843 : : void SetTopBottomMargins( long, long );
844 : : void SetBottomTopMargins( long, long );
845 : : void SetLeftRightMargins( long, long );
846 : : void SetRightLeftMargins( long, long );
847 : : void SetLeftAndWidth( long nLeft, long nWidth );
848 : : void SetTopAndHeight( long nTop, long nHeight );
849 : : void SetRightAndWidth( long nRight, long nWidth );
850 : : void SetBottomAndHeight( long nBottom, long nHeight );
851 : : long GetPrtLeft() const;
852 : : long GetPrtBottom() const;
853 : : long GetPrtRight() const;
854 : : long GetPrtTop() const;
855 : : sal_Bool SetMinLeft( long );
856 : : sal_Bool SetMaxBottom( long );
857 : : sal_Bool SetMaxRight( long );
858 : : sal_Bool SetMinTop( long );
859 : : void MakeBelowPos( const SwFrm*, const SwFrm*, sal_Bool );
860 : : void MakeUpperPos( const SwFrm*, const SwFrm*, sal_Bool );
861 : : void MakeLeftPos( const SwFrm*, const SwFrm*, sal_Bool );
862 : : void MakeRightPos( const SwFrm*, const SwFrm*, sal_Bool );
863 : 220301 : inline sal_Bool IsNeighbourFrm() const
864 [ + + ]: 220301 : { return GetType() & FRM_NEIGHBOUR ? sal_True : sal_False; }
865 : :
866 : : // #i65250#
867 : 218 : inline sal_uInt32 GetFrmId() const { return mnFrmId; }
868 : : inline sal_uInt32 GetLastFrmId() const { return mnLastFrmId; }
869 : :
870 : : // NEW TABELS
871 : : // Some functions for covered/covering table cells. This way unnessessary
872 : : // includes can be avoided
873 : : bool IsLeaveUpperAllowed() const;
874 : : bool IsCoveredCell() const;
875 : : bool IsInCoveredCell() const;
876 : :
877 : : // #i81146# new loop control
878 : : bool KnowsFormat( const SwFmt& rFmt ) const;
879 : : void RegisterToFormat( SwFmt& rFmt );
880 : : void ValidateThisAndAllLowers( const sal_uInt16 nStage );
881 : :
882 : : public:
883 : : // if writer is NULL, dumps the layout structure as XML in layout.xml
884 : : virtual void dumpAsXml(xmlTextWriterPtr writer = NULL);
885 : : virtual void dumpInfosAsXml(xmlTextWriterPtr writer);
886 : : virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
887 : : void dumpChildrenAsXml(xmlTextWriterPtr writer);
888 : : bool IsCollapse() const;
889 : : };
890 : :
891 : 318363 : inline sal_Bool SwFrm::IsInDocBody() const
892 : : {
893 [ + + ]: 318363 : if ( bInfInvalid )
894 : 1675 : ((SwFrm*)this)->SetInfFlags();
895 : 318363 : return bInfBody;
896 : : }
897 : 220045 : inline sal_Bool SwFrm::IsInFtn() const
898 : : {
899 [ + + ]: 220045 : if ( bInfInvalid )
900 : 194 : ((SwFrm*)this)->SetInfFlags();
901 : 220045 : return bInfFtn;
902 : : }
903 : 525861 : inline sal_Bool SwFrm::IsInTab() const
904 : : {
905 [ + + ]: 525861 : if ( bInfInvalid )
906 : 3136 : ((SwFrm*)this)->SetInfFlags();
907 : 525861 : return bInfTab;
908 : : }
909 : 319241 : inline sal_Bool SwFrm::IsInFly() const
910 : : {
911 [ + + ]: 319241 : if ( bInfInvalid )
912 : 3632 : ((SwFrm*)this)->SetInfFlags();
913 : 319241 : return bInfFly;
914 : : }
915 : 291446 : inline sal_Bool SwFrm::IsInSct() const
916 : : {
917 [ + + ]: 291446 : if ( bInfInvalid )
918 : 5837 : ((SwFrm*)this)->SetInfFlags();
919 : 291446 : return bInfSct;
920 : : }
921 : 2413116 : sal_Bool SwFrm::IsVertical() const
922 : : {
923 [ + + ]: 2413116 : if( bInvalidVert )
924 : 109840 : ((SwFrm*)this)->SetDirFlags( sal_True );
925 : 2413116 : return bVertical != 0;
926 : : }
927 : : //Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
928 : 692384 : inline sal_Bool SwFrm::IsVertLR() const
929 : : {
930 : 692384 : return bVertLR != 0;
931 : : }
932 : : //End of SCMS
933 : 639 : sal_Bool SwFrm::GetVerticalFlag() const
934 : : {
935 : 639 : return bVertical != 0;
936 : : }
937 : 1385845 : inline sal_Bool SwFrm::IsRightToLeft() const
938 : : {
939 [ + + ]: 1385845 : if( bInvalidR2L )
940 : 12739 : ((SwFrm*)this)->SetDirFlags( sal_False );
941 : 1385845 : return bRightToLeft != 0;
942 : : }
943 : 639 : sal_Bool SwFrm::GetRightToLeftFlag() const
944 : : {
945 : 639 : return bRightToLeft != 0;
946 : : }
947 : :
948 : 43519 : inline void SwFrm::SetCompletePaint() const
949 : : {
950 : 43519 : ((SwFrm*)this)->bCompletePaint = sal_True;
951 : 43519 : }
952 : 52518 : inline void SwFrm::ResetCompletePaint() const
953 : : {
954 : 52518 : ((SwFrm*)this)->bCompletePaint = sal_False;
955 : 52518 : }
956 : :
957 : 15336 : inline void SwFrm::SetRetouche() const
958 : : {
959 : 15336 : ((SwFrm*)this)->bRetouche = sal_True;
960 : 15336 : }
961 : 7138 : inline void SwFrm::ResetRetouche() const
962 : : {
963 : 7138 : ((SwFrm*)this)->bRetouche = sal_False;
964 : 7138 : }
965 : :
966 : 470 : inline SwLayoutFrm *SwFrm::GetNextLayoutLeaf()
967 : : {
968 : 470 : return (SwLayoutFrm*)((const SwFrm*)this)->GetNextLayoutLeaf();
969 : : }
970 : 12577 : inline SwLayoutFrm *SwFrm::GetPrevLayoutLeaf()
971 : : {
972 : 12577 : return (SwLayoutFrm*)((const SwFrm*)this)->GetPrevLayoutLeaf();
973 : : }
974 : 5755 : inline const SwLayoutFrm *SwFrm::GetNextLayoutLeaf() const
975 : : {
976 : 5755 : return ImplGetNextLayoutLeaf( true );
977 : : }
978 : 12682 : inline const SwLayoutFrm *SwFrm::GetPrevLayoutLeaf() const
979 : : {
980 : 12682 : return ImplGetNextLayoutLeaf( false );
981 : : }
982 : :
983 : 30082 : inline void SwFrm::InvalidateSize()
984 : : {
985 [ + + ]: 30082 : if ( bValidSize )
986 : 14921 : ImplInvalidateSize();
987 : 30082 : }
988 : 7073 : inline void SwFrm::InvalidatePrt()
989 : : {
990 [ + + ]: 7073 : if ( bValidPrtArea )
991 : 6322 : ImplInvalidatePrt();
992 : 7073 : }
993 : 20235 : inline void SwFrm::InvalidatePos()
994 : : {
995 [ + + ]: 20235 : if ( bValidPos )
996 : 8230 : ImplInvalidatePos();
997 : 20235 : }
998 : 5752 : inline void SwFrm::InvalidateLineNum()
999 : : {
1000 [ + + ]: 5752 : if ( bValidLineNum )
1001 : 3765 : ImplInvalidateLineNum();
1002 : 5752 : }
1003 : 66 : inline void SwFrm::InvalidateAll()
1004 : : {
1005 [ + - ]: 66 : if ( _InvalidationAllowed( INVALID_ALL ) )
1006 : : {
1007 [ + + ][ + + ]: 66 : if ( bValidPrtArea && bValidSize && bValidPos )
[ + - ]
1008 : 43 : ImplInvalidatePos();
1009 : 66 : bValidPrtArea = bValidSize = bValidPos = sal_False;
1010 : :
1011 : : // #i28701#
1012 : 66 : _ActionOnInvalidation( INVALID_ALL );
1013 : : }
1014 : 66 : }
1015 : 13101 : inline void SwFrm::InvalidateNextPos( sal_Bool bNoFtn )
1016 : : {
1017 [ + + ][ + + ]: 13101 : if ( pNext && !pNext->IsSctFrm() )
[ + + ]
1018 : 129 : pNext->InvalidatePos();
1019 : : #ifndef C30 // maybe it works for C40?
1020 : : else
1021 : 12972 : ImplInvalidateNextPos( bNoFtn );
1022 : : #else
1023 : : if ( !pNext )
1024 : : ImplInvalidateNextPos( bNoFtn );
1025 : : #endif
1026 : 13101 : }
1027 : :
1028 : 241672 : inline void SwFrm::Calc() const
1029 : : {
1030 [ + + ][ + + ]: 241672 : if ( !bValidPos || !bValidPrtArea || !bValidSize )
[ + + ]
1031 : 32715 : ((SwFrm*)this)->PrepareMake();
1032 : 241672 : }
1033 : 21316 : inline void SwFrm::OptCalc() const
1034 : : {
1035 [ + + ][ + + ]: 21316 : if ( !bValidPos || !bValidPrtArea || !bValidSize )
[ + + ]
1036 : 10486 : ((SwFrm*)this)->OptPrepareMake();
1037 : 21316 : }
1038 : :
1039 : 0 : inline Point SwFrm::GetRelPos() const
1040 : : {
1041 : 0 : Point aRet( aFrm.Pos() );
1042 : : // here we cast since SwLayoutFrm is declared only as forwarded
1043 : 0 : aRet -= ((SwFrm*)GetUpper())->Prt().Pos();
1044 : 0 : aRet -= ((SwFrm*)GetUpper())->Frm().Pos();
1045 : 0 : return aRet;
1046 : : }
1047 : :
1048 : 167459 : inline const SwPageFrm *SwFrm::FindPageFrm() const
1049 : : {
1050 : 167459 : return ((SwFrm*)this)->FindPageFrm();
1051 : : }
1052 : 458 : inline const SwFrm *SwFrm::FindColFrm() const
1053 : : {
1054 : 458 : return ((SwFrm*)this)->FindColFrm();
1055 : : }
1056 : 4275 : inline const SwFrm *SwFrm::FindFooterOrHeader() const
1057 : : {
1058 : 4275 : return ((SwFrm*)this)->FindFooterOrHeader();
1059 : : }
1060 : 26920 : inline SwTabFrm *SwFrm::FindTabFrm()
1061 : : {
1062 [ + - ]: 26920 : return IsInTab() ? ImplFindTabFrm() : 0;
1063 : : }
1064 : 476 : inline const SwFtnBossFrm *SwFrm::FindFtnBossFrm( sal_Bool bFtn ) const
1065 : : {
1066 : 476 : return ((SwFrm*)this)->FindFtnBossFrm( bFtn );
1067 : : }
1068 : 14602 : inline SwFtnFrm *SwFrm::FindFtnFrm()
1069 : : {
1070 [ + + ]: 14602 : return IsInFtn() ? ImplFindFtnFrm() : 0;
1071 : : }
1072 : 10692 : inline SwFlyFrm *SwFrm::FindFlyFrm()
1073 : : {
1074 [ + + ]: 10692 : return IsInFly() ? ImplFindFlyFrm() : 0;
1075 : : }
1076 : 3981 : inline SwSectionFrm *SwFrm::FindSctFrm()
1077 : : {
1078 [ + + ]: 3981 : return IsInSct() ? ImplFindSctFrm() : 0;
1079 : : }
1080 : :
1081 : 46329 : inline const SwTabFrm *SwFrm::FindTabFrm() const
1082 : : {
1083 [ + + ]: 46329 : return IsInTab() ? ((SwFrm*)this)->ImplFindTabFrm() : 0;
1084 : : }
1085 : 448 : inline const SwFtnFrm *SwFrm::FindFtnFrm() const
1086 : : {
1087 [ + - ]: 448 : return IsInFtn() ? ((SwFrm*)this)->ImplFindFtnFrm() : 0;
1088 : : }
1089 : 134818 : inline const SwFlyFrm *SwFrm::FindFlyFrm() const
1090 : : {
1091 [ + + ]: 134818 : return IsInFly() ? ((SwFrm*)this)->ImplFindFlyFrm() : 0;
1092 : : }
1093 : 252 : inline const SwSectionFrm *SwFrm::FindSctFrm() const
1094 : : {
1095 [ + + ]: 252 : return IsInSct() ? ((SwFrm*)this)->ImplFindSctFrm() : 0;
1096 : : }
1097 : 20465 : inline SwFrm *SwFrm::FindNext()
1098 : : {
1099 [ + + ]: 20465 : if ( pNext )
1100 : 19805 : return pNext;
1101 : : else
1102 : 20465 : return _FindNext();
1103 : : }
1104 : 0 : inline const SwFrm *SwFrm::FindNext() const
1105 : : {
1106 [ # # ]: 0 : if ( pNext )
1107 : 0 : return pNext;
1108 : : else
1109 : 0 : return ((SwFrm*)this)->_FindNext();
1110 : : }
1111 : : // #i27138# - add parameter <_bInSameFtn>
1112 : 12329 : inline SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn )
1113 : : {
1114 [ + + ][ + + ]: 12329 : if ( pNext && pNext->IsCntntFrm() )
[ + + ]
1115 : 1029 : return (SwCntntFrm*)pNext;
1116 : : else
1117 : 12329 : return _FindNextCnt( _bInSameFtn );
1118 : : }
1119 : : // #i27138# - add parameter <_bInSameFtn>
1120 : 28 : inline const SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn ) const
1121 : : {
1122 [ + + ][ + - ]: 28 : if ( pNext && pNext->IsCntntFrm() )
[ + + ]
1123 : 4 : return (SwCntntFrm*)pNext;
1124 : : else
1125 : 28 : return ((SwFrm*)this)->_FindNextCnt( _bInSameFtn );
1126 : : }
1127 : 44187 : inline SwFrm *SwFrm::FindPrev()
1128 : : {
1129 [ + + ][ + + ]: 44187 : if ( pPrev && !pPrev->IsSctFrm() )
[ + + ]
1130 : 15112 : return pPrev;
1131 : : else
1132 : 44187 : return _FindPrev();
1133 : : }
1134 : 8810 : inline const SwFrm *SwFrm::FindPrev() const
1135 : : {
1136 [ + + ][ + - ]: 8810 : if ( pPrev && !pPrev->IsSctFrm() )
[ + + ]
1137 : 7312 : return pPrev;
1138 : : else
1139 : 8810 : return ((SwFrm*)this)->_FindPrev();
1140 : : }
1141 : :
1142 : :
1143 : 712070 : inline sal_Bool SwFrm::IsLayoutFrm() const
1144 : : {
1145 [ + + ]: 712070 : return GetType() & FRM_LAYOUT ? sal_True : sal_False;
1146 : : }
1147 : 384719 : inline sal_Bool SwFrm::IsRootFrm() const
1148 : : {
1149 : 384719 : return nType == FRMC_ROOT;
1150 : : }
1151 : 4188339 : inline sal_Bool SwFrm::IsPageFrm() const
1152 : : {
1153 : 4188339 : return nType == FRMC_PAGE;
1154 : : }
1155 : 441409 : inline sal_Bool SwFrm::IsColumnFrm() const
1156 : : {
1157 : 441409 : return nType == FRMC_COLUMN;
1158 : : }
1159 : 55062 : inline sal_Bool SwFrm::IsFtnBossFrm() const
1160 : : {
1161 [ + + ]: 55062 : return GetType() & FRM_FTNBOSS ? sal_True : sal_False;
1162 : : }
1163 : 255998 : inline sal_Bool SwFrm::IsHeaderFrm() const
1164 : : {
1165 : 255998 : return nType == FRMC_HEADER;
1166 : : }
1167 : 316121 : inline sal_Bool SwFrm::IsFooterFrm() const
1168 : : {
1169 : 316121 : return nType == FRMC_FOOTER;
1170 : : }
1171 : 72917 : inline sal_Bool SwFrm::IsFtnContFrm() const
1172 : : {
1173 : 72917 : return nType == FRMC_FTNCONT;
1174 : : }
1175 : 151508 : inline sal_Bool SwFrm::IsFtnFrm() const
1176 : : {
1177 : 151508 : return nType == FRMC_FTN;
1178 : : }
1179 : 163099 : inline sal_Bool SwFrm::IsBodyFrm() const
1180 : : {
1181 : 163099 : return nType == FRMC_BODY;
1182 : : }
1183 : 2837570 : inline sal_Bool SwFrm::IsFlyFrm() const
1184 : : {
1185 : 2837570 : return nType == FRMC_FLY;
1186 : : }
1187 : 981721 : inline sal_Bool SwFrm::IsSctFrm() const
1188 : : {
1189 : 981721 : return nType == FRMC_SECTION;
1190 : : }
1191 : 716493 : inline sal_Bool SwFrm::IsTabFrm() const
1192 : : {
1193 : 716493 : return nType == FRMC_TAB;
1194 : : }
1195 : 1335763 : inline sal_Bool SwFrm::IsRowFrm() const
1196 : : {
1197 : 1335763 : return nType == FRMC_ROW;
1198 : : }
1199 : 1288436 : inline sal_Bool SwFrm::IsCellFrm() const
1200 : : {
1201 : 1288436 : return nType == FRMC_CELL;
1202 : : }
1203 : 2218279 : inline sal_Bool SwFrm::IsCntntFrm() const
1204 : : {
1205 [ + + ]: 2218279 : return GetType() & FRM_CNTNT ? sal_True : sal_False;
1206 : : }
1207 : 1175960 : inline sal_Bool SwFrm::IsTxtFrm() const
1208 : : {
1209 : 1175960 : return nType == FRMC_TXT;
1210 : : }
1211 : 32042 : inline sal_Bool SwFrm::IsNoTxtFrm() const
1212 : : {
1213 : 32042 : return nType == FRMC_NOTXT;
1214 : : }
1215 : 719667 : inline sal_Bool SwFrm::IsFlowFrm() const
1216 : : {
1217 [ + + ]: 719667 : return GetType() & 0xCA00 ? sal_True : sal_False; //TabFrm, CntntFrm, SectionFrm
1218 : : }
1219 : 22390 : inline sal_Bool SwFrm::IsRetoucheFrm() const
1220 : : {
1221 [ + + ]: 22390 : return GetType() & 0xCA40 ? sal_True : sal_False; //TabFrm, CntntFrm, SectionFrm, Ftnfrm
1222 : : }
1223 : 57667 : inline sal_Bool SwFrm::IsAccessibleFrm() const
1224 : : {
1225 [ + + ]: 57667 : return GetType() & FRM_ACCESSIBLE ? sal_True : sal_False;
1226 : : }
1227 : : #endif
1228 : :
1229 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|