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