LCOV - code coverage report
Current view: top level - sw/source/core/inc - frame.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 253 268 94.4 %
Date: 2014-11-03 Functions: 116 120 96.7 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10