LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/sw/source/core/inc - tabfrm.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 33 35 94.3 %
Date: 2013-07-09 Functions: 25 27 92.6 %
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             : #ifndef SW_TABFRM_HXX
      20             : #define SW_TABFRM_HXX
      21             : 
      22             : #include <tools/mempool.hxx>
      23             : #include "layfrm.hxx"
      24             : #include "flowfrm.hxx"
      25             : 
      26             : class SwTable;
      27             : class SwBorderAttrs;
      28             : class SwAttrSetChg;
      29             : 
      30             : class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
      31             : {
      32             :     // OD 14.03.2003 #i11760# - adjustment, because of method signature change
      33             :     //darf mit den Flags spielen.
      34             :     friend void CalcCntnt( SwLayoutFrm *pLay, bool bNoColl, bool bNoCalcFollow );
      35             : 
      36             :     //Fuert Spezialbehandlung fuer _Get[Next|Prev]Leaf() durch.
      37             :     using SwFrm::GetLeaf;
      38             :     SwLayoutFrm *GetLeaf( MakePageType eMakePage, sal_Bool bFwd );
      39             : 
      40             :     SwTable* pTable;
      41             : 
      42             :     sal_Bool bComplete          :1; //Eintrage als Repaint ohne das CompletePaint
      43             :                                 //der Basisklasse gesetzt werden muss. Damit
      44             :                                 //sollen unertraegliche Tabellen-Repaints
      45             :                                 //vermieden werden.
      46             :     sal_Bool bCalcLowers        :1; //Im MakeAll auf jedenfall auch fuer Stabilitaet
      47             :                                 //des Inhaltes sorgen.
      48             :     sal_Bool bLowersFormatted   :1;//Kommunikation zwischen MakeAll und Layact
      49             :     sal_Bool bLockBackMove      :1; //BackMove-Test hat der Master erledigt.
      50             :     sal_Bool bResizeHTMLTable   :1; //Resize des HTMLTableLayout rufen im MakeAll
      51             :                                 //Zur Optimierung, damit dies nicht im
      52             :                                 //CntntFrm::Grow gerufen werden muss, denn dann
      53             :                                 //wird es ggf. fuer jede Zelle gerufen #47483#
      54             :     sal_Bool bONECalcLowers     :1; //Primaer fuer die StarONE-SS. Beim MakeAll werden
      55             :                                 //die Cntnts auf jedenfall per Calc() formatiert.
      56             :                                 //es finden keine zusaetzlichen Invalidierungen
      57             :                                 //statt und dieser Weg kann auch kaum garantien
      58             :                                 //geben.
      59             : 
      60             :     sal_Bool bHasFollowFlowLine :1; // Means that the first line in the follow
      61             :                                 // is indented to contain content from a broken
      62             :                                 // cell
      63             :     sal_Bool bIsRebuildLastLine :1; // Means that currently the last line of the
      64             :                                 // TabFrame is rebuilded. In this case we
      65             :                                 // do not want any notification to the master
      66             :                                 // table
      67             :     sal_Bool bRestrictTableGrowth :1;       // Usually, the table may grow infinite,
      68             :                                         // because the table can be split in
      69             :                                         // SwTabFrm::MakeAll. In MakeAll, this
      70             :                                         // flag is set to indicate that the table
      71             :                                         // may only grow inside its upper. This
      72             :                                         // is necessary, in order to let the text
      73             :                                         // flow into the FollowFlowLine
      74             :     sal_Bool bRemoveFollowFlowLinePending :1;
      75             :     // #i26945#
      76             :     sal_Bool bConsiderObjsForMinCellHeight :1; // Usually, the floating screen objects
      77             :                                            // are considered on the calculation
      78             :                                            // for the minimal cell height.
      79             :                                            // For splitting table rows algorithm
      80             :                                            // it's needed not to consider floating
      81             :                                            // screen object for the preparation
      82             :                                            // of the re-calculation of the
      83             :                                            // last table row.
      84             :     // #i26945#
      85             :     sal_Bool bObjsDoesFit :1; // For splitting table rows algorithm, this boolean
      86             :                           // indicates, if the floating screen objects fits
      87             : 
      88             :     //Split() spaltet den Frm an der angegebenen Stelle, es wird ein
      89             :     //Follow erzeugt und aufgebaut und direkt hinter this gepastet.
      90             :     //Join() Holt sich den Inhalt aus dem Follow und vernichtet diesen.
      91             :     bool Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKeep );
      92             :     bool Join();
      93             : 
      94             :     void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &,
      95             :                       SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
      96             : 
      97             :     virtual sal_Bool ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool bHead, sal_Bool &rReformat );
      98             : 
      99             : protected:
     100             :     virtual void MakeAll();
     101             :     virtual void Format( const SwBorderAttrs *pAttrs = 0 );
     102             :     virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
     103             :         //Aendert nur die Framesize, nicht die PrtArea-SSize
     104             :     virtual SwTwips GrowFrm  ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
     105             : 
     106             : public:
     107             :     SwTabFrm( SwTable &, SwFrm* );  //Immer nach dem erzeugen _und_ pasten das
     108             :                             //Regist Flys rufen!
     109             :     SwTabFrm( SwTabFrm & ); //_Nur_ zum erzeugen von Follows
     110             :     ~SwTabFrm();
     111             : 
     112             :     void JoinAndDelFollows();   //Fuer DelFrms des TableNodes!
     113             : 
     114             :     //Ruft das RegistFlys der Zeilen.
     115             :     void RegistFlys();
     116             : 
     117             :     inline const SwTabFrm *GetFollow() const;
     118             :     inline       SwTabFrm *GetFollow();
     119             :     SwTabFrm* FindMaster( bool bFirstMaster = false ) const;
     120             : 
     121             :     virtual bool GetInfo( SfxPoolItem &rHnt ) const;
     122             :     virtual void Paint( SwRect const&,
     123             :                         SwPrintData const*const pPrintData = NULL ) const;
     124             :     virtual void  CheckDirection( sal_Bool bVert );
     125             : 
     126             :     virtual void Cut();
     127             :     virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
     128             : 
     129             :     virtual void Prepare( const PrepareHint ePrep = PREP_CLEAR,
     130             :                           const void *pVoid = 0, sal_Bool bNotify = sal_True );
     131             : 
     132             :                  SwCntntFrm *FindLastCntnt();
     133             :     inline const SwCntntFrm *FindLastCntnt() const;
     134             : 
     135        2011 :     const SwTable *GetTable() const { return pTable; }
     136        3680 :           SwTable *GetTable()       { return pTable; }
     137             : 
     138         301 :     sal_Bool IsComplete()  { return bComplete; }
     139        1233 :     void SetComplete() { bComplete = sal_True; }
     140         302 :     void ResetComplete() { bComplete = sal_False; }
     141             : 
     142         490 :     sal_Bool IsLowersFormatted() const      { return bLowersFormatted; }
     143         392 :     void SetLowersFormatted( sal_Bool b )   { bLowersFormatted = b;    }
     144             : 
     145           4 :     void SetCalcLowers()        { bCalcLowers = sal_True;      } //Sparsam einsetzen!
     146           0 :     void SetResizeHTMLTable()   { bResizeHTMLTable = sal_True; } //dito
     147         284 :     void SetONECalcLowers()     { bONECalcLowers = sal_True;   }
     148             : 
     149             :     //
     150             :     // Start: New stuff for breaking table rows
     151             :     //
     152        2922 :     sal_Bool HasFollowFlowLine() const { return bHasFollowFlowLine; }
     153        2904 :     void SetFollowFlowLine( sal_Bool bNew ) { bHasFollowFlowLine = bNew; }
     154             :     //return the SwTabFrm (if any) that this SwTabFrm is a follow flow line for
     155             :     SwTabFrm* GetFollowFlowLineFor();
     156             : 
     157        3200 :     sal_Bool IsRebuildLastLine() const { return bIsRebuildLastLine; }
     158           8 :     void SetRebuildLastLine( sal_Bool bNew ) { bIsRebuildLastLine = bNew; }
     159             : 
     160         798 :     sal_Bool IsRestrictTableGrowth() const { return bRestrictTableGrowth; }
     161        1875 :     void SetRestrictTableGrowth( sal_Bool bNew ) { bRestrictTableGrowth = bNew; }
     162             : 
     163         811 :     sal_Bool IsRemoveFollowFlowLinePending() const { return bRemoveFollowFlowLinePending; }
     164           0 :     void SetRemoveFollowFlowLinePending( sal_Bool bNew ) { bRemoveFollowFlowLinePending = bNew; }
     165             : 
     166             :     // #i26945#
     167        5056 :     sal_Bool IsConsiderObjsForMinCellHeight() const
     168             :     {
     169        5056 :         return bConsiderObjsForMinCellHeight;
     170             :     }
     171           8 :     void SetConsiderObjsForMinCellHeight( sal_Bool _bNewConsiderObjsForMinCellHeight )
     172             :     {
     173           8 :         bConsiderObjsForMinCellHeight = _bNewConsiderObjsForMinCellHeight;
     174           8 :     }
     175             :     // #i26945#
     176           4 :     sal_Bool DoesObjsFit() const
     177             :     {
     178           4 :         return bObjsDoesFit;
     179             :     }
     180           8 :     void SetDoesObjsFit( sal_Bool _bNewObjsDoesFit )
     181             :     {
     182           8 :         bObjsDoesFit = _bNewObjsDoesFit;
     183           8 :     }
     184             : 
     185             :     bool RemoveFollowFlowLine();
     186             :     //
     187             :     // End: New stuff for breaking table rows
     188             :     //
     189             : 
     190             :     sal_Bool CalcFlyOffsets( SwTwips& rUpper, long& rLeftOffset,
     191             :                          long& rRightOffset ) const;
     192             : 
     193             :     SwTwips CalcHeightOfFirstContentLine() const;
     194             : 
     195             :     bool IsInHeadline( const SwFrm& rFrm ) const;
     196             :     SwRowFrm* GetFirstNonHeadlineRow() const;
     197             : 
     198             :     bool IsLayoutSplitAllowed() const;
     199             : 
     200             :     // #i29550#
     201             :     bool IsCollapsingBorders() const;
     202             : 
     203             :     // used for collapsing border lines:
     204             :     sal_uInt16 GetBottomLineSize() const;
     205             :     // <-- collapsing
     206             : 
     207             :     virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
     208             : 
     209         332 :     DECL_FIXEDMEMPOOL_NEWDEL(SwTabFrm)
     210             : };
     211             : 
     212          23 : inline const SwCntntFrm *SwTabFrm::FindLastCntnt() const
     213             : {
     214          23 :     return ((SwTabFrm*)this)->FindLastCntnt();
     215             : }
     216             : 
     217       13333 : inline const SwTabFrm *SwTabFrm::GetFollow() const
     218             : {
     219       13333 :     return (const SwTabFrm*)SwFlowFrm::GetFollow();
     220             : }
     221        8183 : inline SwTabFrm *SwTabFrm::GetFollow()
     222             : {
     223        8183 :     return (SwTabFrm*)SwFlowFrm::GetFollow();
     224             : }
     225             : 
     226             : #endif  // SW_TABFRM_HXX
     227             : 
     228             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10