LCOV - code coverage report
Current view: top level - sw/inc - swtable.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 56 61 91.8 %
Date: 2014-11-03 Functions: 48 54 88.9 %
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 INCLUDED_SW_INC_SWTABLE_HXX
      20             : #define INCLUDED_SW_INC_SWTABLE_HXX
      21             : #include <tools/mempool.hxx>
      22             : #include <tools/ref.hxx>
      23             : #include <tblenum.hxx>
      24             : #include <swtypes.hxx>
      25             : #include <calbck.hxx>
      26             : #include <swrect.hxx>
      27             : 
      28             : #include <memory>
      29             : #include <boost/noncopyable.hpp>
      30             : #include <vector>
      31             : #include <algorithm>
      32             : #include <o3tl/sorted_vector.hxx>
      33             : 
      34             : class SwStartNode;
      35             : class SwFmt;
      36             : class Color;
      37             : class SwFrmFmt;
      38             : class SwTableFmt;
      39             : class SwTableLineFmt;
      40             : class SwTableBoxFmt;
      41             : class SwHTMLTableLayout;
      42             : class SwTableLine;
      43             : class SwTableBox;
      44             : class SwTableNode;
      45             : class SwTabCols;
      46             : class SwDoc;
      47             : class SwSelBoxes;
      48             : class SwTblCalcPara;
      49             : struct SwPosition;
      50             : class SwNodeIndex;
      51             : class SwNode;
      52             : class SfxPoolItem;
      53             : class SwUndoTblMerge;
      54             : class SwUndo;
      55             : class SwPaM;
      56             : class SwTableBox_Impl;
      57             : class SwUndoTblCpyTbl;
      58             : class SwBoxSelection;
      59             : struct SwSaveRowSpan;
      60             : struct Parm;
      61             : class SwServerObject;
      62             : 
      63             : void sw_GetTblBoxColStr( sal_uInt16 nCol, OUString& rNm );
      64             : 
      65       22752 : class SwTableLines : public std::vector<SwTableLine*> {
      66             : public:
      67             :     // free's any remaining child objects
      68             :     ~SwTableLines();
      69             : 
      70             :     // return USHRT_MAX if not found, else index of position
      71        7480 :     sal_uInt16 GetPos(const SwTableLine* pBox) const
      72             :     {
      73        7480 :         const_iterator it = std::find(begin(), end(), pBox);
      74        7480 :         return it == end() ? USHRT_MAX : it - begin();
      75             :     }
      76             : };
      77             : 
      78       14492 : class SwTableBoxes : public std::vector<SwTableBox*> {
      79             : public:
      80             :     // return USHRT_MAX if not found, else index of position
      81        1746 :     sal_uInt16 GetPos(const SwTableBox* pBox) const
      82             :     {
      83        1746 :         const_iterator it = std::find(begin(), end(), pBox);
      84        1746 :         return it == end() ? USHRT_MAX : it - begin();
      85             :     }
      86             : };
      87             : 
      88             : // Save content-bearing box-pointers additionally in a sorted array
      89             : // (for calculation in table).
      90        3650 : class SwTableSortBoxes : public o3tl::sorted_vector<SwTableBox*> {};
      91             : 
      92             : /// SwTable is one table in the document model, containing rows (which contain cells).
      93             : class SW_DLLPUBLIC SwTable: public SwClient          //Client of FrmFmt.
      94             : {
      95             : 
      96             : protected:
      97             :     SwTableLines aLines;
      98             :     SwTableSortBoxes m_TabSortContentBoxes;
      99             :     tools::SvRef<SwServerObject> refObj;   // In case DataServer -> pointer is set.
     100             : 
     101             :     SwHTMLTableLayout *pHTMLLayout;
     102             : 
     103             :     // Usually, the table node of a SwTable can be accessed by getting a box
     104             :     // out of m_TabSortContentBoxes, which know their SwStartNode. But in some rare
     105             :     // cases, we need to know the table node of a SwTable, before the table
     106             :     // boxes have been build (SwTableNode::MakeCopy with tables in tables).
     107             :     SwTableNode* pTableNode;
     108             : 
     109             :     // Should that be adjustable for every table?
     110             :     TblChgMode  eTblChgMode;
     111             : 
     112             :     sal_uInt16      nGrfsThatResize;    // Count of Grfs that initiate a resize of table
     113             :                                         // at HTML-import.
     114             :     sal_uInt16      nRowsToRepeat;      // Number of rows to repeat on every page.
     115             : 
     116             :     bool        bModifyLocked   :1;
     117             :     bool        bNewModel       :1; // sal_False: old SubTableModel; sal_True: new RowSpanModel
     118             : #ifdef DBG_UTIL
     119             :     /// This is set by functions (like Merge()) to forbid a late model change.
     120             :     bool m_bDontChangeModel;
     121             : #endif
     122             : 
     123        1306 :     bool IsModifyLocked(){ return bModifyLocked;}
     124             : 
     125             :    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) SAL_OVERRIDE;
     126             : 
     127             : public:
     128             :     enum SearchType
     129             :     {
     130             :         SEARCH_NONE, // Default: expand to rectangle
     131             :         SEARCH_ROW, // row selection
     132             :         SEARCH_COL  // column selection
     133             :     };
     134             : 
     135             :     TYPEINFO_OVERRIDE();
     136             : 
     137             :     // single argument ctors shall be explicit.
     138             :     explicit SwTable( SwTableFmt* );
     139             :     virtual ~SwTable();
     140             : 
     141             :     // @@@ public copy ctor, but no copy assignment?
     142             :     SwTable( const SwTable& rTable );       // no copy of the lines !!
     143             : private:
     144             :     // @@@ public copy ctor, but no copy assignment?
     145             :     SwTable & operator= (const SwTable &);
     146             :     // no default ctor.
     147             :     SwTable();
     148             :     bool OldMerge( SwDoc*, const SwSelBoxes&, SwTableBox*, SwUndoTblMerge* );
     149             :     bool OldSplitRow( SwDoc*, const SwSelBoxes&, sal_uInt16, bool );
     150             :     bool NewMerge( SwDoc*, const SwSelBoxes&, const SwSelBoxes& rMerged,
     151             :                    SwTableBox*, SwUndoTblMerge* );
     152             :     bool NewSplitRow( SwDoc*, const SwSelBoxes&, sal_uInt16, bool );
     153             :     SwBoxSelection* CollectBoxSelection( const SwPaM& rPam ) const;
     154             :     void InsertSpannedRow( SwDoc* pDoc, sal_uInt16 nIdx, sal_uInt16 nCnt );
     155             :     bool _InsertRow( SwDoc*, const SwSelBoxes&, sal_uInt16 nCnt, bool bBehind );
     156             :     bool NewInsertCol( SwDoc*, const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool );
     157             :     void _FindSuperfluousRows( SwSelBoxes& rBoxes, SwTableLine*, SwTableLine* );
     158             :     void AdjustWidths( const long nOld, const long nNew );
     159             :     void NewSetTabCols( Parm &rP, const SwTabCols &rNew, const SwTabCols &rOld,
     160             :                         const SwTableBox *pStart, bool bCurRowOnly );
     161             : 
     162             : public:
     163             : 
     164       17900 :     SwHTMLTableLayout *GetHTMLTableLayout() { return pHTMLLayout; }
     165         314 :     const SwHTMLTableLayout *GetHTMLTableLayout() const { return pHTMLLayout; }
     166             :     void SetHTMLTableLayout( SwHTMLTableLayout *p );    //Change of property!
     167             : 
     168           0 :     sal_uInt16 IncGrfsThatResize() { return ++nGrfsThatResize; }
     169           0 :     sal_uInt16 DecGrfsThatResize() { return nGrfsThatResize ? --nGrfsThatResize : 0; }
     170             : 
     171           2 :     void LockModify()   { bModifyLocked = true; }   // Must be used always
     172           2 :     void UnlockModify() { bModifyLocked = false;}   // in pairs!
     173             : 
     174         856 :     void SetTableModel( bool bNew ){ bNewModel = bNew; }
     175       12280 :     bool IsNewModel() const { return bNewModel; }
     176             : 
     177       44356 :     sal_uInt16 GetRowsToRepeat() const { return std::min( (sal_uInt16)GetTabLines().size(), nRowsToRepeat ); }
     178           0 :     sal_uInt16 _GetRowsToRepeat() const { return nRowsToRepeat; }
     179        2062 :     void SetRowsToRepeat( sal_uInt16 nNumOfRows ) { nRowsToRepeat = nNumOfRows; }
     180             : 
     181             :     bool IsHeadline( const SwTableLine& rLine ) const;
     182             : 
     183       68794 :           SwTableLines &GetTabLines() { return aLines; }
     184      120914 :     const SwTableLines &GetTabLines() const { return aLines; }
     185             : 
     186       46214 :     SwFrmFmt* GetFrmFmt()       { return (SwFrmFmt*)GetRegisteredIn(); }
     187       49854 :     SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
     188         386 :     SwTableFmt* GetTableFmt() const { return (SwTableFmt*)GetRegisteredIn(); }
     189             : 
     190             :     void GetTabCols( SwTabCols &rToFill, const SwTableBox *pStart,
     191             :                      bool bHidden = false, bool bCurRowOnly = false ) const;
     192             :     void SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
     193             :                      const SwTableBox *pStart, bool bCurRowOnly );
     194             : 
     195             : // The following functions are for new table model only...
     196             :     void CreateSelection(  const SwPaM& rPam, SwSelBoxes& rBoxes,
     197             :         const SearchType eSearchType, bool bProtect ) const;
     198             :     void CreateSelection( const SwNode* pStart, const SwNode* pEnd,
     199             :         SwSelBoxes& rBoxes, const SearchType eSearchType, bool bProtect ) const;
     200             :     void ExpandSelection( SwSelBoxes& rBoxes ) const;
     201             :     // When a table is splitted into two tables, the row spans which overlaps
     202             :     // the split have to be corrected and stored for undo
     203             :     // SwSavRowSpan is the structure needed by Undo to undo the split operation
     204             :     // CleanUpRowSpan corrects the (top of the) second table and delviers the structure
     205             :     // for Undo
     206             :     SwSaveRowSpan* CleanUpTopRowSpan( sal_uInt16 nSplitLine );
     207             :     // RestoreRowSpan is called by Undo to restore the old row span values
     208             :     void RestoreRowSpan( const SwSaveRowSpan& );
     209             :     // CleanUpBottomRowSpan corrects the overhanging row spans at the end of the first table
     210             :     void CleanUpBottomRowSpan( sal_uInt16 nDelLines );
     211             : 
     212             : // The following functions are "pseudo-virtual", i.e. they are different for old and new table model
     213             : // It's not allowed to change the table model after the first call of one of these functions.
     214             : 
     215           6 :     bool Merge( SwDoc* pDoc, const SwSelBoxes& rBoxes, const SwSelBoxes& rMerged,
     216             :                 SwTableBox* pMergeBox, SwUndoTblMerge* pUndo = 0 )
     217             :     {
     218             : #ifdef DBG_UTIL
     219             :         m_bDontChangeModel = true;
     220             : #endif
     221             :         return bNewModel ? NewMerge( pDoc, rBoxes, rMerged, pMergeBox, pUndo ) :
     222           6 :                            OldMerge( pDoc, rBoxes, pMergeBox, pUndo );
     223             :     }
     224           2 :     bool SplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt=1,
     225             :                    bool bSameHeight = false )
     226             :     {
     227             : #ifdef DBG_UTIL
     228             :         m_bDontChangeModel = true;
     229             : #endif
     230           2 :         return bNewModel ? NewSplitRow( pDoc, rBoxes, nCnt, bSameHeight ) :
     231           4 :                            OldSplitRow( pDoc, rBoxes, nCnt, bSameHeight );
     232             :     }
     233             :     bool PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
     234             :         SwSelBoxes& rMerged, SwTableBox** ppMergeBox, SwUndoTblMerge* pUndo );
     235             :     void ExpandColumnSelection( SwSelBoxes& rBoxes, long &rMin, long &rMax ) const;
     236             :     void PrepareDeleteCol( long nMin, long nMax );
     237             : 
     238             :     bool InsertCol( SwDoc*, const SwSelBoxes& rBoxes,
     239             :                     sal_uInt16 nCnt = 1, bool bBehind = true );
     240             :     bool InsertRow( SwDoc*, const SwSelBoxes& rBoxes,
     241             :                     sal_uInt16 nCnt = 1, bool bBehind = true );
     242             :     void PrepareDelBoxes( const SwSelBoxes& rBoxes );
     243             :     bool DeleteSel( SwDoc*, const SwSelBoxes& rBoxes, const SwSelBoxes* pMerged,
     244             :         SwUndo* pUndo, const bool bDelMakeFrms, const bool bCorrBorder );
     245             :     bool SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt=1 );
     246             :     bool Merge( const SwSelBoxes& rBoxes,
     247             :                 SwTableBox* pMergeBox, SwUndoTblMerge* = 0 );
     248             : 
     249          12 :     void FindSuperfluousRows( SwSelBoxes& rBoxes )
     250          12 :         { _FindSuperfluousRows( rBoxes, 0, 0 ); }
     251             :     void CheckRowSpan( SwTableLine* &rpLine, bool bUp ) const;
     252             : 
     253      482505 :           SwTableSortBoxes& GetTabSortBoxes()       { return m_TabSortContentBoxes; }
     254       35072 :     const SwTableSortBoxes& GetTabSortBoxes() const { return m_TabSortContentBoxes; }
     255             : 
     256             :     // Read 1st number and delete it from string (used by GetTblBox and SwTblFld).
     257             : 
     258             :     // #i80314#
     259             :     // add 3rd parameter in order to control validation check on <rStr>
     260             :     static sal_uInt16 _GetBoxNum( OUString& rStr,
     261             :                               bool bFirst = false,
     262             :                               const bool bPerformValidCheck = false );
     263             : 
     264             :     // Search content-bearing box with that name.
     265             : 
     266             :     // #i80314#
     267             :     // add 2nd parameter in order to control validation check in called method
     268             :     // <_GetBoxNum(..)>
     269             :     const SwTableBox* GetTblBox( const OUString& rName,
     270             :                                  const bool bPerformValidCheck = false ) const;
     271             :     // Copy selected boxes to another document.
     272             :     bool MakeCopy( SwDoc*, const SwPosition&, const SwSelBoxes&,
     273             :                     bool bCpyNds = true, bool bCpyName = false ) const;
     274             :     // Copy table in this
     275             :     bool InsTable( const SwTable& rCpyTbl, const SwNodeIndex&,
     276             :                     SwUndoTblCpyTbl* pUndo = 0 );
     277             :     bool InsTable( const SwTable& rCpyTbl, const SwSelBoxes&,
     278             :                     SwUndoTblCpyTbl* pUndo = 0 );
     279             :     bool InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes&,
     280             :                       SwUndoTblCpyTbl* pUndo );
     281             :     // Copy headline of table (with content!) into an other one.
     282             :     bool CopyHeadlineIntoTable( SwTableNode& rTblNd );
     283             : 
     284             :     // Get box, whose start index is set on nBoxStt.
     285             :           SwTableBox* GetTblBox( sal_uLong nSttIdx );
     286       14714 :     const SwTableBox* GetTblBox( sal_uLong nSttIdx ) const
     287       14714 :                         {   return ((SwTable*)this)->GetTblBox( nSttIdx );  }
     288             : 
     289             :     // Returns true if table contains nestings.
     290             :     bool IsTblComplex() const;
     291             : 
     292             :     // Returns true if table or selection is balanced.
     293             :     bool IsTblComplexForChart( const OUString& rSel ) const;
     294             : 
     295             :     // Search all content-bearing boxes of the base line on which this box stands.
     296             :     // rBoxes as a return value for immediate use.
     297             :     // steht. rBoxes auch als Return-Wert, um es gleich weiter zu benutzen
     298             :     // bToTop = true -> up to base line, sal_False-> else only line of box.
     299             :     SwSelBoxes& SelLineFromBox( const SwTableBox* pBox,
     300             :                             SwSelBoxes& rBoxes, bool bToTop = true ) const;
     301             : 
     302             :     // Get information from client.
     303             :     virtual bool GetInfo( SfxPoolItem& ) const SAL_OVERRIDE;
     304             : 
     305             :     // Search in format for registered table.
     306             :     static SwTable * FindTable( SwFrmFmt const*const pFmt );
     307             : 
     308             :     // Clean up structure a bit.
     309             :     void GCLines();
     310             : 
     311             :     // Returns the table node via m_TabSortContentBoxes or pTableNode.
     312             :     SwTableNode* GetTableNode() const;
     313         880 :     void SetTableNode( SwTableNode* pNode ) { pTableNode = pNode; }
     314             : 
     315             :     // Data server methods.
     316             :     void SetRefObject( SwServerObject* );
     317             :     const SwServerObject* GetObject() const     {  return &refObj; }
     318           0 :           SwServerObject* GetObject()           {  return &refObj; }
     319             : 
     320             :     // Fill data for chart.
     321             :     void UpdateCharts() const;
     322             : 
     323         440 :     TblChgMode GetTblChgMode() const        { return eTblChgMode; }
     324         440 :     void SetTblChgMode( TblChgMode eMode )  { eTblChgMode = eMode; }
     325             : 
     326             :     bool SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType,
     327             :                         SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo );
     328             :     bool SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
     329             :                         SwTwips nAbsDiff, SwTwips nRelDiff, SwUndo** ppUndo );
     330             :     void RegisterToFormat( SwFmt& rFmt );
     331             : #ifdef DBG_UTIL
     332             :     void CheckConsistency() const;
     333             : #endif
     334             : 
     335             :     bool HasLayout() const;
     336             : };
     337             : 
     338             : /// SwTableLine is one table row in the document model.
     339             : class SW_DLLPUBLIC SwTableLine: public SwClient     // Client of FrmFmt.
     340             : {
     341             :     SwTableBoxes aBoxes;
     342             :     SwTableBox *pUpper;
     343             : 
     344             : public:
     345             :     TYPEINFO_OVERRIDE();
     346             : 
     347             :     SwTableLine() : pUpper(0) {}
     348             : 
     349             :     SwTableLine( SwTableLineFmt*, sal_uInt16 nBoxes, SwTableBox *pUp );
     350             :     virtual ~SwTableLine();
     351             : 
     352      177982 :           SwTableBoxes &GetTabBoxes() { return aBoxes; }
     353       80806 :     const SwTableBoxes &GetTabBoxes() const { return aBoxes; }
     354             : 
     355        4858 :           SwTableBox *GetUpper() { return pUpper; }
     356       58612 :     const SwTableBox *GetUpper() const { return pUpper; }
     357           0 :     void SetUpper( SwTableBox *pNew ) { pUpper = pNew; }
     358             : 
     359       23094 :     SwFrmFmt* GetFrmFmt()       { return (SwFrmFmt*)GetRegisteredIn(); }
     360       49752 :     SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
     361             : 
     362             :     // Creates a own FrmFmt if more lines depend on it.
     363             :     SwFrmFmt* ClaimFrmFmt();
     364             :     void ChgFrmFmt( SwTableLineFmt* pNewFmt );
     365             : 
     366             :     // Search next/previous box with content.
     367             :     SwTableBox* FindNextBox( const SwTable&, const SwTableBox* =0,
     368             :                             bool bOvrTblLns=true ) const;
     369             :     SwTableBox* FindPreviousBox( const SwTable&, const SwTableBox* =0,
     370             :                             bool bOvrTblLns=true ) const;
     371             : 
     372             :     SwTwips GetTableLineHeight( bool& bLayoutAvailable ) const;
     373             : 
     374             :     bool hasSoftPageBreak() const;
     375             :     void RegisterToFormat( SwFmt& rFmt );
     376             : };
     377             : 
     378             : /// SwTableBox is one table cell in the document model.
     379             : class SW_DLLPUBLIC SwTableBox: public SwClient      //Client of FrmFmt.
     380             : {
     381             :     friend class SwNodes;           // Transpose index.
     382             :     friend void DelBoxNode(SwTableSortBoxes&);  // Delete StartNode* !
     383             :     friend class SwXMLTableContext;
     384             : 
     385             :     // Not implemented (any more).
     386             :     SwTableBox( const SwTableBox & );
     387             :     SwTableBox &operator=( const SwTableBox &); // Does not exist.
     388             : 
     389             :     SwTableLines aLines;
     390             :     const SwStartNode * pSttNd;
     391             :     SwTableLine *pUpper;
     392             :     SwTableBox_Impl* pImpl;
     393             : 
     394             :     // In case Format contains formulas/values already,
     395             :     // a new one must be created for the new box.
     396             :     SwTableBoxFmt* CheckBoxFmt( SwTableBoxFmt* );
     397             : 
     398             : public:
     399             :     TYPEINFO_OVERRIDE();
     400             : 
     401             :     SwTableBox() : pSttNd(0), pUpper(0), pImpl(0) {}
     402             : 
     403             :     SwTableBox( SwTableBoxFmt*, sal_uInt16 nLines, SwTableLine *pUp = 0 );
     404             :     SwTableBox( SwTableBoxFmt*, const SwStartNode&, SwTableLine *pUp = 0 );
     405             :     SwTableBox( SwTableBoxFmt*, const SwNodeIndex&, SwTableLine *pUp = 0 );
     406             :     virtual ~SwTableBox();
     407             : 
     408       36830 :           SwTableLines &GetTabLines() { return aLines; }
     409       18694 :     const SwTableLines &GetTabLines() const { return aLines; }
     410             : 
     411        5962 :           SwTableLine *GetUpper() { return pUpper; }
     412       81772 :     const SwTableLine *GetUpper() const { return pUpper; }
     413         104 :     void SetUpper( SwTableLine *pNew ) { pUpper = pNew; }
     414             : 
     415      406480 :     SwFrmFmt* GetFrmFmt()       { return (SwFrmFmt*)GetRegisteredIn(); }
     416       90912 :     SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
     417             : 
     418             :     // Creates its own FrmFmt if more boxes depend on it.
     419             :     SwFrmFmt* ClaimFrmFmt();
     420             :     void ChgFrmFmt( SwTableBoxFmt *pNewFmt );
     421             : 
     422             :     void RemoveFromTable();
     423      124706 :     const SwStartNode *GetSttNd() const { return pSttNd; }
     424             :     sal_uLong GetSttIdx() const;
     425             : 
     426             :     // Search next/previous box with content.
     427             :     SwTableBox* FindNextBox( const SwTable&, const SwTableBox* =0,
     428             :                             bool bOvrTblLns=true ) const;
     429             :     SwTableBox* FindPreviousBox( const SwTable&, const SwTableBox* =0,
     430             :                             bool bOvrTblLns=true ) const;
     431             :     // Return name of this box. It is determined dynamically and
     432             :     // is calculated from the position in the lines/boxes/table.
     433             :     OUString GetName() const;
     434             :     // Return "value" of box (for calculating in table).
     435             :     double GetValue( SwTblCalcPara& rPara ) const;
     436             : 
     437             :     bool IsInHeadline( const SwTable* pTbl = 0 ) const;
     438             : 
     439             :     // Contains box contents, that can be formated as a number?
     440             :     bool HasNumCntnt( double& rNum, sal_uInt32& rFmtIndex,
     441             :                     bool& rIsEmptyTxtNd ) const;
     442             :     sal_uLong IsValidNumTxtNd( bool bCheckAttr = true ) const;
     443             :     // If a table formula is set, test if box contents is congruent with number.
     444             :     // (For Redo of change of NumFormat!).
     445             :     bool IsNumberChanged() const;
     446             : 
     447             :     // Is that a formula box or a box with numeric contents (AutoSum)?
     448             :     // What it is is indicated by the return value - the WhichId of the attribute.
     449             :     // Empty boxes have the return value USHRT_MAX !!
     450             :     sal_uInt16 IsFormulaOrValueBox() const;
     451             : 
     452             :     // Loading of a document requires an actualisation of cells with values
     453             :     void ActualiseValueBox();
     454             : 
     455       41864 :     DECL_FIXEDMEMPOOL_NEWDEL(SwTableBox)
     456             : 
     457             :     // Access on internal data - currently used for the NumFormatter.
     458             :     inline const Color* GetSaveUserColor()  const;
     459             :     inline const Color* GetSaveNumFmtColor() const;
     460             :     inline void SetSaveUserColor(const Color* p );
     461             :     inline void SetSaveNumFmtColor( const Color* p );
     462             : 
     463             :     long getRowSpan() const;
     464             :     void setRowSpan( long nNewRowSpan );
     465             :     bool getDummyFlag() const;
     466             :     void setDummyFlag( bool bDummy );
     467             : 
     468             :     SwTableBox& FindStartOfRowSpan( const SwTable&, sal_uInt16 nMaxStep = USHRT_MAX );
     469         920 :     const SwTableBox& FindStartOfRowSpan( const SwTable& rTable,
     470             :         sal_uInt16 nMaxStep = USHRT_MAX ) const
     471         920 :         { return const_cast<SwTableBox*>(this)->FindStartOfRowSpan( rTable, nMaxStep ); }
     472             : 
     473             :     SwTableBox& FindEndOfRowSpan( const SwTable&, sal_uInt16 nMaxStep = USHRT_MAX );
     474         232 :     const SwTableBox& FindEndOfRowSpan( const SwTable& rTable,
     475             :         sal_uInt16 nMaxStep = USHRT_MAX ) const
     476         232 :         { return const_cast<SwTableBox*>(this)->FindEndOfRowSpan( rTable, nMaxStep ); }
     477             :     void RegisterToFormat( SwFmt& rFmt ) ;
     478             : };
     479             : 
     480             : class SwCellFrm;
     481             : class SW_DLLPUBLIC SwTableCellInfo : public ::boost::noncopyable
     482             : {
     483             :     struct Impl;
     484             :     ::std::unique_ptr<Impl> m_pImpl;
     485             : 
     486             :     const SwCellFrm * getCellFrm() const ;
     487             : 
     488             : public:
     489             :     SwTableCellInfo(const SwTable * pTable);
     490             :     ~SwTableCellInfo();
     491             : 
     492             :     bool getNext();
     493             :     SwRect getRect() const;
     494             :     const SwTableBox * getTableBox() const;
     495             : };
     496             : 
     497             : #endif // INCLUDED_SW_INC_SWTABLE_HXX
     498             : 
     499             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10