LCOV - code coverage report
Current view: top level - sw/source/core/inc - ftnfrm.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 24 26 92.3 %
Date: 2012-08-25 Functions: 21 23 91.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 2 4 50.0 %

           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 _FTNFRM_HXX
      30                 :            : #define _FTNFRM_HXX
      31                 :            : 
      32                 :            : #include "layfrm.hxx"
      33                 :            : 
      34                 :            : class SwCntntFrm;
      35                 :            : class SwTxtFtn;
      36                 :            : class SwBorderAttrs;
      37                 :            : class SwFtnFrm;
      38                 :            : 
      39                 :            : // There exists a special section on a page for footnotes. It's called
      40                 :            : // SwFtnContFrm. Each footnote is separated by a SwFtnFrm which contains
      41                 :            : // the paragraphs of a footnote. SwFtnFrm can be splitted and will then
      42                 :            : // continue on another page.
      43         [ -  + ]:         84 : class SwFtnContFrm: public SwLayoutFrm
      44                 :            : {
      45                 :            : public:
      46                 :            :     SwFtnContFrm( SwFrmFmt*, SwFrm* );
      47                 :            : 
      48                 :            :     const SwFtnFrm* FindFootNote() const;
      49                 :            : 
      50                 :            :     virtual SwTwips ShrinkFrm( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
      51                 :            :     virtual SwTwips GrowFrm  ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
      52                 :            :     virtual void    Format( const SwBorderAttrs *pAttrs = 0 );
      53                 :            :     virtual void    PaintBorder( const SwRect &, const SwPageFrm *pPage,
      54                 :            :                                  const SwBorderAttrs & ) const;
      55                 :            :     virtual void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const;
      56                 :            :             void    PaintLine( const SwRect &, const SwPageFrm * ) const;
      57                 :            : };
      58                 :            : 
      59         [ -  + ]:        124 : class SwFtnFrm: public SwLayoutFrm
      60                 :            : {
      61                 :            :     // Pointer to FtnFrm in which the footnote will be continued:
      62                 :            :     //  - 0     no following existent
      63                 :            :     //  - this  for the last one
      64                 :            :     //  - otherwise the following FtnFrm
      65                 :            :     SwFtnFrm     *pFollow;
      66                 :            :     SwFtnFrm     *pMaster;      // FtnFrm from which I am the following
      67                 :            :     SwCntntFrm   *pRef;         // in this CntntFrm is the footnote reference
      68                 :            :     SwTxtFtn     *pAttr;        // footnote attribute (for recognition)
      69                 :            : 
      70                 :            :     // if true paragraphs in this footnote are NOT permitted to flow backwards
      71                 :            :     sal_Bool bBackMoveLocked : 1;
      72                 :            :     // #i49383# - control unlock of position of lower anchored objects.
      73                 :            :     bool mbUnlockPosOfLowerObjs : 1;
      74                 :            : #ifdef DBG_UTIL
      75                 :            : protected:
      76                 :            :     virtual SwTwips ShrinkFrm( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
      77                 :            :     virtual SwTwips GrowFrm  ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
      78                 :            : #endif
      79                 :            : 
      80                 :            : public:
      81                 :            :     SwFtnFrm( SwFrmFmt*, SwFrm*, SwCntntFrm*, SwTxtFtn* );
      82                 :            : 
      83                 :            :     virtual void Cut();
      84                 :            :     virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
      85                 :            : 
      86                 :            :     virtual void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const;
      87                 :            : 
      88                 :            :     sal_Bool operator<( const SwTxtFtn* pTxtFtn ) const;
      89                 :            : 
      90                 :            : #ifdef DBG_UTIL
      91                 :            :     const SwCntntFrm *GetRef() const;
      92                 :            :          SwCntntFrm  *GetRef();
      93                 :            : #else
      94                 :        259 :     const SwCntntFrm *GetRef() const    { return pRef; }
      95                 :       1511 :          SwCntntFrm  *GetRef()          { return pRef; }
      96                 :            : #endif
      97                 :            :     const SwCntntFrm *GetRefFromAttr()  const;
      98                 :            :           SwCntntFrm *GetRefFromAttr();
      99                 :            : 
     100                 :          0 :     const SwFtnFrm *GetFollow() const   { return pFollow; }
     101                 :        360 :           SwFtnFrm *GetFollow()         { return pFollow; }
     102                 :            : 
     103                 :        217 :     const SwFtnFrm *GetMaster() const   { return pMaster; }
     104                 :        742 :           SwFtnFrm *GetMaster()         { return pMaster; }
     105                 :            : 
     106                 :        536 :     const SwTxtFtn   *GetAttr() const   { return pAttr; }
     107                 :       1512 :           SwTxtFtn   *GetAttr()         { return pAttr; }
     108                 :            : 
     109                 :         62 :     void SetFollow( SwFtnFrm *pNew ) { pFollow = pNew; }
     110                 :         62 :     void SetMaster( SwFtnFrm *pNew ) { pMaster = pNew; }
     111                 :          0 :     void SetRef   ( SwCntntFrm *pNew ) { pRef = pNew; }
     112                 :            : 
     113                 :            :     void InvalidateNxtFtnCnts( SwPageFrm* pPage );
     114                 :            : 
     115                 :         75 :     void LockBackMove()     { bBackMoveLocked = sal_True; }
     116                 :         75 :     void UnlockBackMove()   { bBackMoveLocked = sal_False;}
     117                 :        329 :     sal_Bool IsBackMoveLocked() { return bBackMoveLocked; }
     118                 :            : 
     119                 :            :     // prevents that the last content deletes the SwFtnFrm as well (Cut())
     120                 :         85 :     inline void ColLock()       { bColLocked = sal_True; }
     121                 :         85 :     inline void ColUnlock()     { bColLocked = sal_False; }
     122                 :            : 
     123                 :            :     // #i49383#
     124                 :        154 :     inline void UnlockPosOfLowerObjs()
     125                 :            :     {
     126                 :        154 :         mbUnlockPosOfLowerObjs = true;
     127                 :        154 :     }
     128                 :        154 :     inline void KeepLockPosOfLowerObjs()
     129                 :            :     {
     130                 :        154 :         mbUnlockPosOfLowerObjs = false;
     131                 :        154 :     }
     132                 :        166 :     inline bool IsUnlockPosOfLowerObjs()
     133                 :            :     {
     134                 :        166 :         return mbUnlockPosOfLowerObjs;
     135                 :            :     }
     136                 :            : 
     137                 :            :     /** search for last content in the current footnote frame
     138                 :            : 
     139                 :            :         OD 2005-12-02 #i27138#
     140                 :            : 
     141                 :            :         @return SwCntntFrm*
     142                 :            :         pointer to found last content frame. NULL, if none is found.
     143                 :            :     */
     144                 :            :     SwCntntFrm* FindLastCntnt();
     145                 :            : };
     146                 :            : 
     147                 :            : #endif
     148                 :            : 
     149                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10