LCOV - code coverage report
Current view: top level - sw/source/core/inc - frmtool.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 77 78 98.7 %
Date: 2012-08-25 Functions: 36 36 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 23 32 71.9 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef _FRMTOOL_HXX
      30                 :            : #define _FRMTOOL_HXX
      31                 :            : 
      32                 :            : #include "swtypes.hxx"
      33                 :            : #include "layfrm.hxx"
      34                 :            : #include "frmatr.hxx"
      35                 :            : #include "swcache.hxx"
      36                 :            : // #i96772#
      37                 :            : #include <editeng/lrspitem.hxx>
      38                 :            : 
      39                 :            : class SwPageFrm;
      40                 :            : class SwFlyFrm;
      41                 :            : class SwCntntFrm;
      42                 :            : class SwRootFrm;
      43                 :            : class SwDoc;
      44                 :            : class SwAttrSet;
      45                 :            : class SdrObject;
      46                 :            : class BigInt;
      47                 :            : class SvxBrushItem;
      48                 :            : class SdrMarkList;
      49                 :            : class SwNodeIndex;
      50                 :            : class OutputDevice;
      51                 :            : class SwPageDesc;
      52                 :            : 
      53                 :            : #define FAR_AWAY LONG_MAX - 20000  // initial position of a Fly
      54                 :            : #define BROWSE_HEIGHT 56700L * 10L // 10 Meters
      55                 :            : #define GRFNUM_NO 0
      56                 :            : #define GRFNUM_YES 1
      57                 :            : #define GRFNUM_REPLACE 2
      58                 :            : 
      59                 :            : // draw background with brush or graphics
      60                 :            : // The 6th parameter indicates that the method should consider background
      61                 :            : // transparency, saved in the color of the brush item.
      62                 :            : void DrawGraphic( const SvxBrushItem *, OutputDevice *,
      63                 :            :                   const SwRect &rOrg, const SwRect &rOut, const sal_uInt8 nGrfNum = GRFNUM_NO,
      64                 :            :                   const sal_Bool bConsiderBackgroundTransparency = sal_False );
      65                 :            : 
      66                 :            : // method to align rectangle.
      67                 :            : // Created declaration here to avoid <extern> declarations
      68                 :            : void SwAlignRect( SwRect &rRect, const ViewShell *pSh );
      69                 :            : 
      70                 :            : // method to align graphic rectangle
      71                 :            : // Created declaration here to avoid <extern> declarations
      72                 :            : void SwAlignGrfRect( SwRect *pGrfRect, const OutputDevice &rOut );
      73                 :            : 
      74                 :            : // get Fly, if no List is given use the current shell
      75                 :            : // Implementation in feshview.cxx
      76                 :            : SwFlyFrm *GetFlyFromMarked( const SdrMarkList *pLst, ViewShell *pSh );
      77                 :            : 
      78                 :            : sal_uLong SqRt( BigInt nX );
      79                 :            : 
      80                 :            : SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart );
      81                 :            : void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bGrow );
      82                 :            : 
      83                 :            : // Get CntntNodes, create CntntFrms, and add them to LayFrm.
      84                 :            : void _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, sal_uLong nIndex,
      85                 :            :                  sal_Bool bPages = sal_False, sal_uLong nEndIndex = 0,
      86                 :            :                  SwFrm *pPrv = 0 );
      87                 :            : 
      88                 :            : // Creation of frames for a specific section (uses _InsertCnt)
      89                 :            : void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
      90                 :            :                             const SwNodeIndex &rEndIdx );
      91                 :            : 
      92                 :            : // prevent creation of Flys in _InsertCnt, e.g. for table headlines
      93                 :            : extern sal_Bool bDontCreateObjects;
      94                 :            : 
      95                 :            : // for FlyCnts, see SwFlyAtCntFrm::MakeAll()
      96                 :            : extern sal_Bool bSetCompletePaintOnInvalidate;
      97                 :            : 
      98                 :            : // for table settings via keyboard
      99                 :            : long CalcRowRstHeight( SwLayoutFrm *pRow );
     100                 :            : long CalcHeightWidthFlys( const SwFrm *pFrm );
     101                 :            : 
     102                 :            : SwPageFrm *InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
     103                 :            :                           sal_Bool bOdd, bool bFirst, sal_Bool bInsertEmpty, sal_Bool bFtn,
     104                 :            :                           SwFrm *pSibling );
     105                 :            : 
     106                 :            : // connect Flys with page
     107                 :            : void RegistFlys( SwPageFrm*, const SwLayoutFrm* );
     108                 :            : 
     109                 :            : // notification of Fly's background if needed
     110                 :            : void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld,
     111                 :            :              const SwRect* pOldRect = 0 );
     112                 :            : 
     113                 :            : void Notify_Background( const SdrObject* pObj,
     114                 :            :                         SwPageFrm* pPage,
     115                 :            :                         const SwRect& rRect,
     116                 :            :                         const PrepareHint eHint,
     117                 :            :                         const sal_Bool bInva );
     118                 :            : 
     119                 :            : const SwFrm* GetVirtualUpper( const SwFrm* pFrm, const Point& rPos );
     120                 :            : 
     121                 :            : sal_Bool Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj );
     122                 :            : 
     123                 :            : // FIXME: EasyHack (refactoring): rename method and parameter name in all files
     124                 :            : const SwFrm *FindKontext( const SwFrm *pFrm, sal_uInt16 nAdditionalKontextTyp );
     125                 :            : 
     126                 :            : sal_Bool IsFrmInSameKontext( const SwFrm *pInnerFrm, const SwFrm *pFrm );
     127                 :            : 
     128                 :            : const SwFrm * FindPage( const SwRect &rRect, const SwFrm *pPage );
     129                 :            : 
     130                 :            : // used by SwCntntNode::GetFrm and SwFlyFrm::GetFrm
     131                 :            : SwFrm* GetFrmOfModify( const SwRootFrm* pLayout,
     132                 :            :                        SwModify const&,
     133                 :            :                        sal_uInt16 const nFrmType,
     134                 :            :                        const Point* = 0,
     135                 :            :                        const SwPosition *pPos = 0,
     136                 :            :                        const sal_Bool bCalcFrm = sal_False );
     137                 :            : 
     138                 :            : // Should extra data (reline stroke, line numbers) be painted?
     139                 :            : sal_Bool IsExtraData( const SwDoc *pDoc );
     140                 :            : 
     141                 :            : // #i11760# - method declaration <CalcCntnt(..)>
     142                 :            : void CalcCntnt( SwLayoutFrm *pLay,
     143                 :            :                 bool bNoColl = false,
     144                 :            :                 bool bNoCalcFollow = false );
     145                 :            : 
     146                 :            : // Notify classes memorize the current sizes in their constructor and do
     147                 :            : // the necessary notifications in their destructor if needed
     148                 :            : class SwFrmNotify
     149                 :            : {
     150                 :            : protected:
     151                 :            :     SwFrm *pFrm;
     152                 :            :     const SwRect aFrm;
     153                 :            :     const SwRect aPrt;
     154                 :            :     SwTwips mnFlyAnchorOfst;
     155                 :            :     SwTwips mnFlyAnchorOfstNoWrap;
     156                 :            :     sal_Bool     bHadFollow;
     157                 :            :     sal_Bool     bInvaKeep;
     158                 :            :     sal_Bool     bValidSize;
     159                 :            :     // #i49383#
     160                 :            :     bool mbFrmDeleted;
     161                 :            : 
     162                 :            : public:
     163                 :            :     SwFrmNotify( SwFrm *pFrm );
     164                 :            :     ~SwFrmNotify();
     165                 :            : 
     166                 :        963 :     const SwRect &Frm() const { return aFrm; }
     167                 :            :     const SwRect &Prt() const { return aPrt; }
     168                 :       1289 :     void SetInvaKeep() { bInvaKeep = sal_True; }
     169                 :            :     // #i49383#
     170                 :            :     void FrmDeleted()
     171                 :            :     {
     172                 :            :         mbFrmDeleted = true;
     173                 :            :     }
     174                 :            : };
     175                 :            : 
     176                 :            : class SwLayNotify : public SwFrmNotify
     177                 :            : {
     178                 :            :     sal_Bool bLowersComplete;
     179                 :            : 
     180                 :      17472 :     SwLayoutFrm *GetLay() { return (SwLayoutFrm*)pFrm; }
     181                 :            : 
     182                 :            : public:
     183                 :            :     SwLayNotify( SwLayoutFrm *pLayFrm );
     184                 :            :     ~SwLayNotify();
     185                 :            : 
     186                 :        298 :     void SetLowersComplete( sal_Bool b ) { bLowersComplete = b; }
     187                 :      32822 :     sal_Bool IsLowersComplete()          { return bLowersComplete; }
     188                 :            : };
     189                 :            : 
     190                 :            : class SwFlyNotify : public SwLayNotify
     191                 :            : {
     192                 :            :     SwPageFrm *pOldPage;
     193                 :            :     const SwRect aFrmAndSpace;
     194                 :       3002 :     SwFlyFrm *GetFly() { return (SwFlyFrm*)pFrm; }
     195                 :            : 
     196                 :            : public:
     197                 :            :     SwFlyNotify( SwFlyFrm *pFlyFrm );
     198                 :            :     ~SwFlyNotify();
     199                 :            : 
     200                 :            :     SwPageFrm *GetOldPage() const { return pOldPage; }
     201                 :            : };
     202                 :            : 
     203                 :            : class SwCntntNotify : public SwFrmNotify
     204                 :            : {
     205                 :            : private:
     206                 :            :     // #i11859#
     207                 :            :     bool    mbChkHeightOfLastLine;
     208                 :            :     SwTwips mnHeightOfLastLine;
     209                 :            : 
     210                 :            :     // #i25029#
     211                 :            :     bool        mbInvalidatePrevPrtArea;
     212                 :            :     bool        mbBordersJoinedWithPrev;
     213                 :            : 
     214                 :      23516 :     SwCntntFrm *GetCnt() { return (SwCntntFrm*)pFrm; }
     215                 :            : 
     216                 :            : public:
     217                 :            :     SwCntntNotify( SwCntntFrm *pCntFrm );
     218                 :            :     ~SwCntntNotify();
     219                 :            : 
     220                 :            :     // #i25029#
     221                 :        172 :     void SetInvalidatePrevPrtArea()
     222                 :            :     {
     223                 :        172 :         mbInvalidatePrevPrtArea = true;
     224                 :        172 :     }
     225                 :            : 
     226                 :       5761 :     void SetBordersJoinedWithPrev()
     227                 :            :     {
     228                 :       5761 :         mbBordersJoinedWithPrev = true;
     229                 :       5761 :     }
     230                 :            : };
     231                 :            : 
     232                 :            : // SwBorderAttrs encapsulates the calculation for margin attributes including
     233                 :            : // border. The whole class is cached.
     234                 :            : //
     235                 :            : // WARNING! If more attributes should be cached also adjust the method
     236                 :            : //          Modify::Modify!
     237                 :            : class SwBorderAttrs : public SwCacheObj
     238                 :            : {
     239                 :            :     const SwAttrSet      &rAttrSet;
     240                 :            :     const SvxULSpaceItem &rUL;
     241                 :            :     // #i96772#
     242                 :            :     SvxLRSpaceItem rLR;
     243                 :            :     const SvxBoxItem     &rBox;
     244                 :            :     const SvxShadowItem  &rShadow;
     245                 :            :     const Size            aFrmSize;
     246                 :            : 
     247                 :            :     // Is it a frame that can have a margin without a border?
     248                 :            :     sal_Bool bBorderDist  : 1;
     249                 :            : 
     250                 :            :     // the following bool values set the cached values to INVALID - until they
     251                 :            :     // are calculated for the first time
     252                 :            :     sal_Bool bTopLine     : 1;
     253                 :            :     sal_Bool bBottomLine  : 1;
     254                 :            :     sal_Bool bLeftLine    : 1;
     255                 :            :     sal_Bool bRightLine   : 1;
     256                 :            :     sal_Bool bTop         : 1;
     257                 :            :     sal_Bool bBottom      : 1;
     258                 :            :     sal_Bool bLine        : 1;
     259                 :            : 
     260                 :            :     sal_Bool bIsLine      : 1; // border on at least one side?
     261                 :            : 
     262                 :            :     sal_Bool bCacheGetLine        : 1; // cache GetTopLine(), GetBottomLine()?
     263                 :            :     sal_Bool bCachedGetTopLine    : 1; // is GetTopLine() cached?
     264                 :            :     sal_Bool bCachedGetBottomLine : 1; // is GetBottomLine() cached?
     265                 :            :     // Booleans indicate that <bJoinedWithPrev> and <bJoinedWithNext> are
     266                 :            :     // cached and valid.
     267                 :            :     // Caching depends on value of <bCacheGetLine>.
     268                 :            :     mutable sal_Bool bCachedJoinedWithPrev : 1;
     269                 :            :     mutable sal_Bool bCachedJoinedWithNext : 1;
     270                 :            :     // Booleans indicate that borders are joined with previous/next frame.
     271                 :            :     sal_Bool bJoinedWithPrev :1;
     272                 :            :     sal_Bool bJoinedWithNext :1;
     273                 :            : 
     274                 :            :     // The cached values (un-defined until calculated for the first time)
     275                 :            :     sal_uInt16 nTopLine,
     276                 :            :            nBottomLine,
     277                 :            :            nLeftLine,
     278                 :            :            nRightLine,
     279                 :            :            nTop,
     280                 :            :            nBottom,
     281                 :            :            nGetTopLine,
     282                 :            :            nGetBottomLine;
     283                 :            : 
     284                 :            :     // only calculate lines and shadow
     285                 :            :     void _CalcTopLine();
     286                 :            :     void _CalcBottomLine();
     287                 :            :     void _CalcLeftLine();
     288                 :            :     void _CalcRightLine();
     289                 :            : 
     290                 :            :     // lines + shadow + margin
     291                 :            :     void _CalcTop();
     292                 :            :     void _CalcBottom();
     293                 :            : 
     294                 :            :     void _IsLine();
     295                 :            : 
     296                 :            :     // #i25029# - If <_pPrevFrm> is set, its value is taken for testing, if
     297                 :            :     // borders/shadow have to be joined with previous frame.
     298                 :            :     void _GetTopLine   ( const SwFrm& _rFrm,
     299                 :            :                          const SwFrm* _pPrevFrm = 0L );
     300                 :            :     void _GetBottomLine( const SwFrm& _rFrm );
     301                 :            : 
     302                 :            :     // calculate cached values <bJoinedWithPrev> and <bJoinedWithNext>
     303                 :            :     // #i25029# - If <_pPrevFrm> is set, its value is taken for testing, if
     304                 :            :     // borders/shadow have to be joined with previous frame.
     305                 :            :     void _CalcJoinedWithPrev( const SwFrm& _rFrm,
     306                 :            :                               const SwFrm* _pPrevFrm = 0L );
     307                 :            :     void _CalcJoinedWithNext( const SwFrm& _rFrm );
     308                 :            : 
     309                 :            :     // internal helper method for _CalcJoinedWithPrev and _CalcJoinedWithNext
     310                 :            :     sal_Bool _JoinWithCmp( const SwFrm& _rCallerFrm,
     311                 :            :                        const SwFrm& _rCmpFrm ) const;
     312                 :            : 
     313                 :            :     // Are the left and right line and the LRSpace equal?
     314                 :            :     sal_Bool CmpLeftRight( const SwBorderAttrs &rCmpAttrs,
     315                 :            :                        const SwFrm *pCaller,
     316                 :            :                        const SwFrm *pCmp ) const;
     317                 :            : 
     318                 :            : public:
     319 [ +  - ][ +  - ]:      27526 :     DECL_FIXEDMEMPOOL_NEWDEL(SwBorderAttrs)
     320                 :            : 
     321                 :            :     SwBorderAttrs( const SwModify *pOwner, const SwFrm *pConstructor );
     322                 :            :     ~SwBorderAttrs();
     323                 :            : 
     324                 :      28226 :     inline const SwAttrSet      &GetAttrSet() const { return rAttrSet;  }
     325                 :      42354 :     inline const SvxULSpaceItem &GetULSpace() const { return rUL;       }
     326                 :            :     inline const SvxLRSpaceItem &GetLRSpace() const { return rLR;       }
     327                 :     115338 :     inline const SvxBoxItem     &GetBox()     const { return rBox;      }
     328                 :      76204 :     inline const SvxShadowItem  &GetShadow()  const { return rShadow;   }
     329                 :            : 
     330                 :            :     inline sal_uInt16 CalcTopLine() const;
     331                 :            :     inline sal_uInt16 CalcBottomLine() const;
     332                 :            :     inline sal_uInt16 CalcLeftLine() const;
     333                 :            :     inline sal_uInt16 CalcRightLine() const;
     334                 :            :     inline sal_uInt16 CalcTop() const;
     335                 :            :     inline sal_uInt16 CalcBottom() const;
     336                 :            :            long CalcLeft( const SwFrm *pCaller ) const;
     337                 :            :            long CalcRight( const SwFrm *pCaller ) const;
     338                 :            : 
     339                 :            :     inline sal_Bool IsLine() const;
     340                 :            : 
     341                 :       4911 :     inline const Size &GetSize()     const { return aFrmSize; }
     342                 :            : 
     343                 :      72980 :     inline sal_Bool IsBorderDist() const { return bBorderDist; }
     344                 :            : 
     345                 :            :     // Should upper (or lower) border be evaluated for this frame?
     346                 :            :     // #i25029# - If <_pPrevFrm> is set, its value is taken for testing, if
     347                 :            :     // borders/shadow have to be joined with previous frame.
     348                 :            :     inline sal_uInt16 GetTopLine   ( const SwFrm& _rFrm,
     349                 :            :                                  const SwFrm* _pPrevFrm = 0L ) const;
     350                 :            :     inline sal_uInt16 GetBottomLine( const SwFrm& _rFrm ) const;
     351                 :            :     inline void   SetGetCacheLine( sal_Bool bNew ) const;
     352                 :            : 
     353                 :            :     // Accessors for cached values <bJoinedWithPrev> and <bJoinedWithPrev>
     354                 :            :     // #i25029# - If <_pPrevFrm> is set, its value is taken for testing, if
     355                 :            :     // borders/shadow have to be joined with previous frame.
     356                 :            :     sal_Bool JoinedWithPrev( const SwFrm& _rFrm,
     357                 :            :                          const SwFrm* _pPrevFrm = 0L ) const;
     358                 :            :     sal_Bool JoinedWithNext( const SwFrm& _rFrm ) const;
     359                 :            : };
     360                 :            : 
     361         [ -  + ]:     173791 : class SwBorderAttrAccess : public SwCacheAccess
     362                 :            : {
     363                 :            :     const SwFrm *pConstructor;      //opt: for passing on to SwBorderAttrs
     364                 :            : 
     365                 :            : protected:
     366                 :            :     virtual SwCacheObj *NewObj();
     367                 :            : 
     368                 :            : public:
     369                 :            :     SwBorderAttrAccess( SwCache &rCache, const SwFrm *pOwner );
     370                 :            : 
     371                 :            :     SwBorderAttrs *Get();
     372                 :            : };
     373                 :            : 
     374                 :            : // Iterator for draw objects of a page. The objects will be iterated sorted by
     375                 :            : // their Z-order. Iterating is not cheap since for each operation the _whole_
     376                 :            : // SortArray needs to be traversed.
     377                 :            : class SwOrderIter
     378                 :            : {
     379                 :            :     const SwPageFrm *pPage;
     380                 :            :     const SdrObject *pCurrent;
     381                 :            :     const sal_Bool bFlysOnly;
     382                 :            : 
     383                 :            : public:
     384                 :            :     SwOrderIter( const SwPageFrm *pPage, sal_Bool bFlysOnly = sal_True );
     385                 :            : 
     386                 :       1322 :     void             Current( const SdrObject *pNew ) { pCurrent = pNew; }
     387                 :            :     const SdrObject *Current()    const { return pCurrent; }
     388                 :       5722 :     const SdrObject *operator()() const { return pCurrent; }
     389                 :            :     const SdrObject *Top();
     390                 :            :     const SdrObject *Bottom();
     391                 :            :     const SdrObject *Next();
     392                 :            :     const SdrObject *Prev();
     393                 :            : };
     394                 :            : 
     395                 :            : class StackHack
     396                 :            : {
     397                 :            :     static sal_uInt8 nCnt;
     398                 :            :     static sal_Bool bLocked;
     399                 :            : 
     400                 :            : public:
     401                 :      66450 :     StackHack()
     402                 :            :     {
     403         [ -  + ]:      66450 :         if ( ++StackHack::nCnt > 50 )
     404                 :          0 :             StackHack::bLocked = sal_True;
     405                 :      66450 :     }
     406                 :      66450 :     ~StackHack()
     407                 :            :     {
     408         [ +  + ]:      66450 :         if ( --StackHack::nCnt < 5 )
     409                 :      66136 :             StackHack::bLocked = sal_False;
     410                 :      66450 :     }
     411                 :            : 
     412                 :      35367 :     static sal_Bool IsLocked()  { return StackHack::bLocked; }
     413                 :       1340 :     static sal_uInt8 Count()        { return StackHack::nCnt; }
     414                 :            : };
     415                 :            : 
     416                 :            : // Should upper (or lower) border be evaluated for this frame?
     417                 :            : // #i25029# - If <_pPrevFrm> is set, its value is taken for testing, if
     418                 :            : // borders/shadow have to be joined with previous frame.
     419                 :      18245 : inline sal_uInt16 SwBorderAttrs::GetTopLine ( const SwFrm& _rFrm,
     420                 :            :                                           const SwFrm* _pPrevFrm ) const
     421                 :            : {
     422 [ -  + ][ #  # ]:      18245 :     if ( !bCachedGetTopLine || _pPrevFrm )
     423                 :            :     {
     424                 :      18245 :         const_cast<SwBorderAttrs*>(this)->_GetTopLine( _rFrm, _pPrevFrm );
     425                 :            :     }
     426                 :      18245 :     return nGetTopLine;
     427                 :            : }
     428                 :      15237 : inline sal_uInt16 SwBorderAttrs::GetBottomLine( const SwFrm& _rFrm ) const
     429                 :            : {
     430         [ +  - ]:      15237 :     if ( !bCachedGetBottomLine )
     431                 :      15237 :         const_cast<SwBorderAttrs*>(this)->_GetBottomLine( _rFrm );
     432                 :      15237 :     return nGetBottomLine;
     433                 :            : }
     434                 :        542 : inline void SwBorderAttrs::SetGetCacheLine( sal_Bool bNew ) const
     435                 :            : {
     436                 :        542 :     ((SwBorderAttrs*)this)->bCacheGetLine = bNew;
     437                 :            :     ((SwBorderAttrs*)this)->bCachedGetBottomLine =
     438                 :        542 :     ((SwBorderAttrs*)this)->bCachedGetTopLine = sal_False;
     439                 :            :     // invalidate cache for values <bJoinedWithPrev> and <bJoinedWithNext>
     440                 :        542 :     bCachedJoinedWithPrev = sal_False;
     441                 :        542 :     bCachedJoinedWithNext = sal_False;
     442                 :        542 : }
     443                 :            : 
     444                 :      23221 : inline sal_uInt16 SwBorderAttrs::CalcTopLine() const
     445                 :            : {
     446         [ +  + ]:      23221 :     if ( bTopLine )
     447                 :      10556 :         ((SwBorderAttrs*)this)->_CalcTopLine();
     448                 :      23221 :     return nTopLine;
     449                 :            : }
     450                 :      21266 : inline sal_uInt16 SwBorderAttrs::CalcBottomLine() const
     451                 :            : {
     452         [ +  + ]:      21266 :     if ( bBottomLine )
     453                 :      10556 :         ((SwBorderAttrs*)this)->_CalcBottomLine();
     454                 :      21266 :     return nBottomLine;
     455                 :            : }
     456                 :      45242 : inline sal_uInt16 SwBorderAttrs::CalcLeftLine() const
     457                 :            : {
     458         [ +  + ]:      45242 :     if ( bLeftLine )
     459                 :      10306 :         ((SwBorderAttrs*)this)->_CalcLeftLine();
     460                 :      45242 :     return nLeftLine;
     461                 :            : }
     462                 :      43722 : inline sal_uInt16 SwBorderAttrs::CalcRightLine() const
     463                 :            : {
     464         [ +  + ]:      43722 :     if ( bRightLine )
     465                 :      10306 :         ((SwBorderAttrs*)this)->_CalcRightLine();
     466                 :      43722 :     return nRightLine;
     467                 :            : }
     468                 :       3713 : inline sal_uInt16 SwBorderAttrs::CalcTop() const
     469                 :            : {
     470         [ +  + ]:       3713 :     if ( bTop )
     471                 :       1581 :         ((SwBorderAttrs*)this)->_CalcTop();
     472                 :       3713 :     return nTop;
     473                 :            : }
     474                 :       3664 : inline sal_uInt16 SwBorderAttrs::CalcBottom() const
     475                 :            : {
     476         [ +  + ]:       3664 :     if ( bBottom )
     477                 :       1581 :         ((SwBorderAttrs*)this)->_CalcBottom();
     478                 :       3664 :     return nBottom;
     479                 :            : }
     480                 :      45764 : inline sal_Bool SwBorderAttrs::IsLine() const
     481                 :            : {
     482         [ +  + ]:      45764 :     if ( bLine )
     483                 :       6593 :         ((SwBorderAttrs*)this)->_IsLine();
     484                 :      45764 :     return bIsLine;
     485                 :            : }
     486                 :            : 
     487                 :            : /** method to determine the spacing values of a frame
     488                 :            : 
     489                 :            :     #i28701#
     490                 :            :     Values only provided for flow frames (table, section or text frames)
     491                 :            :     Note: line spacing value is only determined for text frames
     492                 :            :     #i102458#
     493                 :            :     Add output parameter <obIsLineSpacingProportional>
     494                 :            : 
     495                 :            :     @param rFrm
     496                 :            :     input parameter - frame, for which the spacing values are determined.
     497                 :            : 
     498                 :            :     @param onPrevLowerSpacing
     499                 :            :     output parameter - lower spacing of the frame in SwTwips
     500                 :            : 
     501                 :            :     @param onPrevLineSpacing
     502                 :            :     output parameter - line spacing of the frame in SwTwips
     503                 :            : 
     504                 :            :     @param obIsLineSpacingProportional
     505                 :            : */
     506                 :            : void GetSpacingValuesOfFrm( const SwFrm& rFrm,
     507                 :            :                             SwTwips& onLowerSpacing,
     508                 :            :                             SwTwips& onLineSpacing,
     509                 :            :                             bool& obIsLineSpacingProportional );
     510                 :            : 
     511                 :            : /** method to get the content of the table cell
     512                 :            : 
     513                 :            :     Content from any nested tables will be omitted.
     514                 :            :     Note: line spacing value is only determined for text frames
     515                 :            : 
     516                 :            :     @param rCell_
     517                 :            :     input parameter - the cell which should be searched for content.
     518                 :            : 
     519                 :            :     return
     520                 :            :         pointer to the found content frame or 0
     521                 :            : */
     522                 :            : 
     523                 :            : const SwCntntFrm* GetCellCntnt( const SwLayoutFrm& rCell_ );
     524                 :            : 
     525                 :            : 
     526                 :            : /** helper class to check if a frame has been deleted during an operation
     527                 :            :  *  WARNING! This should only be used as a last and desperate means to make the
     528                 :            :  *  code robust.
     529                 :            :  */
     530                 :            : 
     531                 :            : class SwDeletionChecker
     532                 :            : {
     533                 :            : private:
     534                 :            :     const SwFrm* mpFrm;
     535                 :            :     const SwModify* mpRegIn;
     536                 :            : 
     537                 :            : public:
     538                 :          2 :     SwDeletionChecker( const SwFrm* pFrm )
     539                 :            :             : mpFrm( pFrm ),
     540         [ +  - ]:          2 :               mpRegIn( pFrm ? const_cast<SwFrm*>(pFrm)->GetRegisteredIn() : 0 )
     541                 :            :     {
     542                 :          2 :     }
     543                 :            : 
     544                 :            :     /**
     545                 :            :      *  return
     546                 :            :      *    true if mpFrm != 0 and mpFrm is not client of pRegIn
     547                 :            :      *    false otherwise
     548                 :            :      */
     549                 :            :     bool HasBeenDeleted();
     550                 :            : };
     551                 :            : 
     552                 :            : #endif
     553                 :            : 
     554                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10