LCOV - code coverage report
Current view: top level - sw/inc - swtable.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 55 60 91.7 %
Date: 2015-06-13 12:38:46 Functions: 47 53 88.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : #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             : #include <swtblfmt.hxx>
      28             : 
      29             : #include <memory>
      30             : #include <boost/noncopyable.hpp>
      31             : #include <vector>
      32             : #include <algorithm>
      33             : #include <o3tl/sorted_vector.hxx>
      34             : 
      35             : class SwStartNode;
      36             : class SwFormat;
      37             : class Color;
      38             : class SwFrameFormat;
      39             : class SwTableFormat;
      40             : class SwTableLineFormat;
      41             : class SwTableBoxFormat;
      42             : class SwHTMLTableLayout;
      43             : class SwTableLine;
      44             : class SwTableBox;
      45             : class SwTableNode;
      46             : class SwTabCols;
      47             : class SwDoc;
      48             : class SwSelBoxes;
      49             : class SwTableCalcPara;
      50             : struct SwPosition;
      51             : class SwNodeIndex;
      52             : class SwNode;
      53             : class SfxPoolItem;
      54             : class SwUndoTableMerge;
      55             : class SwUndo;
      56             : class SwPaM;
      57             : class SwTableBox_Impl;
      58             : class SwUndoTableCpyTable;
      59             : class SwBoxSelection;
      60             : struct SwSaveRowSpan;
      61             : struct Parm;
      62             : class SwServerObject;
      63             : 
      64             : void sw_GetTableBoxColStr( sal_uInt16 nCol, OUString& rNm );
      65             : 
      66       12954 : class SwTableLines : public std::vector<SwTableLine*> {
      67             : public:
      68             :     // free's any remaining child objects
      69             :     ~SwTableLines();
      70             : 
      71             :     // return USHRT_MAX if not found, else index of position
      72        4076 :     sal_uInt16 GetPos(const SwTableLine* pBox) const
      73             :     {
      74        4076 :         const_iterator it = std::find(begin(), end(), pBox);
      75        4076 :         return it == end() ? USHRT_MAX : it - begin();
      76             :     }
      77             : };
      78             : 
      79        8254 : class SwTableBoxes : public std::vector<SwTableBox*> {
      80             : public:
      81             :     // return USHRT_MAX if not found, else index of position
      82         870 :     sal_uInt16 GetPos(const SwTableBox* pBox) const
      83             :     {
      84         870 :         const_iterator it = std::find(begin(), end(), pBox);
      85         870 :         return it == end() ? USHRT_MAX : it - begin();
      86             :     }
      87             : };
      88             : 
      89             : // Save content-bearing box-pointers additionally in a sorted array
      90             : // (for calculation in table).
      91        2205 : class SwTableSortBoxes : public o3tl::sorted_vector<SwTableBox*> {};
      92             : 
      93             : /// SwTable is one table in the document model, containing rows (which contain cells).
      94             : class SW_DLLPUBLIC SwTable: public SwClient          //Client of FrameFormat.
      95             : {
      96             : 
      97             : protected:
      98             :     SwTableLines aLines;
      99             :     SwTableSortBoxes m_TabSortContentBoxes;
     100             :     tools::SvRef<SwServerObject> refObj;   // In case DataServer -> pointer is set.
     101             : 
     102             :     SwHTMLTableLayout *pHTMLLayout;
     103             : 
     104             :     // Usually, the table node of a SwTable can be accessed by getting a box
     105             :     // out of m_TabSortContentBoxes, which know their SwStartNode. But in some rare
     106             :     // cases, we need to know the table node of a SwTable, before the table
     107             :     // boxes have been build (SwTableNode::MakeCopy with tables in tables).
     108             :     SwTableNode* pTableNode;
     109             : 
     110             :     // Should that be adjustable for every table?
     111             :     TableChgMode  eTableChgMode;
     112             : 
     113             :     sal_uInt16      nGrfsThatResize;    // Count of Grfs that initiate a resize of table
     114             :                                         // at HTML-import.
     115             :     sal_uInt16      nRowsToRepeat;      // Number of rows to repeat on every page.
     116             : 
     117             :     bool        bModifyLocked   :1;
     118             :     bool        bNewModel       :1; // false: old SubTableModel; true: new RowSpanModel
     119             : #ifdef DBG_UTIL
     120             :     /// This is set by functions (like Merge()) to forbid a late model change.
     121             :     bool m_bDontChangeModel;
     122             : #endif
     123             : 
     124         766 :     bool IsModifyLocked(){ return bModifyLocked;}
     125             : 
     126             :    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) SAL_OVERRIDE;
     127             : 
     128             : public:
     129             :     enum SearchType
     130             :     {
     131             :         SEARCH_NONE, // Default: expand to rectangle
     132             :         SEARCH_ROW, // row selection
     133             :         SEARCH_COL  // column selection
     134             :     };
     135             : 
     136             :     TYPEINFO_OVERRIDE();
     137             : 
     138             :     // single argument ctors shall be explicit.
     139             :     explicit SwTable( SwTableFormat* );
     140             :     virtual ~SwTable();
     141             : 
     142             :     // @@@ public copy ctor, but no copy assignment?
     143             :     SwTable( const SwTable& rTable );       // no copy of the lines !!
     144             : private:
     145             :     // @@@ public copy ctor, but no copy assignment?
     146             :     SwTable & operator= (const SwTable &) SAL_DELETED_FUNCTION;
     147             :     // no default ctor.
     148             :     SwTable();
     149             :     bool OldMerge( SwDoc*, const SwSelBoxes&, SwTableBox*, SwUndoTableMerge* );
     150             :     bool OldSplitRow( SwDoc*, const SwSelBoxes&, sal_uInt16, bool );
     151             :     bool NewMerge( SwDoc*, const SwSelBoxes&, const SwSelBoxes& rMerged,
     152             :                    SwTableBox*, SwUndoTableMerge* );
     153             :     bool NewSplitRow( SwDoc*, const SwSelBoxes&, sal_uInt16, bool );
     154             :     SwBoxSelection* CollectBoxSelection( const SwPaM& rPam ) const;
     155             :     void InsertSpannedRow( SwDoc* pDoc, sal_uInt16 nIdx, sal_uInt16 nCnt );
     156             :     bool _InsertRow( SwDoc*, const SwSelBoxes&, sal_uInt16 nCnt, bool bBehind );
     157             :     bool NewInsertCol( SwDoc*, const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool );
     158             :     void _FindSuperfluousRows( SwSelBoxes& rBoxes, SwTableLine*, SwTableLine* );
     159             :     void AdjustWidths( const long nOld, const long nNew );
     160             :     void NewSetTabCols( Parm &rP, const SwTabCols &rNew, const SwTabCols &rOld,
     161             :                         const SwTableBox *pStart, bool bCurRowOnly );
     162             : 
     163             : public:
     164             : 
     165        9627 :     SwHTMLTableLayout *GetHTMLTableLayout() { return pHTMLLayout; }
     166        1035 :     const SwHTMLTableLayout *GetHTMLTableLayout() const { return pHTMLLayout; }
     167             :     void SetHTMLTableLayout( SwHTMLTableLayout *p );    //Change of property!
     168             : 
     169           0 :     sal_uInt16 IncGrfsThatResize() { return ++nGrfsThatResize; }
     170           0 :     sal_uInt16 DecGrfsThatResize() { return nGrfsThatResize ? --nGrfsThatResize : 0; }
     171             : 
     172           6 :     void LockModify()   { bModifyLocked = true; }   // Must be used always
     173           6 :     void UnlockModify() { bModifyLocked = false;}   // in pairs!
     174             : 
     175         591 :     void SetTableModel( bool bNew ){ bNewModel = bNew; }
     176        6925 :     bool IsNewModel() const { return bNewModel; }
     177             : 
     178       47312 :     sal_uInt16 GetRowsToRepeat() const { return std::min( (sal_uInt16)GetTabLines().size(), nRowsToRepeat ); }
     179           0 :     sal_uInt16 _GetRowsToRepeat() const { return nRowsToRepeat; }
     180        1265 :     void SetRowsToRepeat( sal_uInt16 nNumOfRows ) { nRowsToRepeat = nNumOfRows; }
     181             : 
     182             :     bool IsHeadline( const SwTableLine& rLine ) const;
     183             : 
     184       38141 :           SwTableLines &GetTabLines() { return aLines; }
     185       81586 :     const SwTableLines &GetTabLines() const { return aLines; }
     186             : 
     187       26839 :     SwTableFormat* GetFrameFormat()       { return static_cast<SwTableFormat*>(GetRegisteredIn()); }
     188       32952 :     SwTableFormat* GetFrameFormat() const { return const_cast<SwTableFormat*>(static_cast<const SwTableFormat*>(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           3 :     bool Merge( SwDoc* pDoc, const SwSelBoxes& rBoxes, const SwSelBoxes& rMerged,
     216             :                 SwTableBox* pMergeBox, SwUndoTableMerge* pUndo = 0 )
     217             :     {
     218             : #ifdef DBG_UTIL
     219             :         m_bDontChangeModel = true;
     220             : #endif
     221             :         return bNewModel ? NewMerge( pDoc, rBoxes, rMerged, pMergeBox, pUndo ) :
     222           3 :                            OldMerge( pDoc, rBoxes, pMergeBox, pUndo );
     223             :     }
     224           1 :     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           1 :         return bNewModel ? NewSplitRow( pDoc, rBoxes, nCnt, bSameHeight ) :
     231           2 :                            OldSplitRow( pDoc, rBoxes, nCnt, bSameHeight );
     232             :     }
     233             :     bool PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
     234             :         SwSelBoxes& rMerged, SwTableBox** ppMergeBox, SwUndoTableMerge* 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, SwUndoTableMerge* = 0 );
     248             : 
     249           5 :     void FindSuperfluousRows( SwSelBoxes& rBoxes )
     250           5 :         { _FindSuperfluousRows( rBoxes, 0, 0 ); }
     251             :     void CheckRowSpan( SwTableLine* &rpLine, bool bUp ) const;
     252             : 
     253      265841 :           SwTableSortBoxes& GetTabSortBoxes()       { return m_TabSortContentBoxes; }
     254       23963 :     const SwTableSortBoxes& GetTabSortBoxes() const { return m_TabSortContentBoxes; }
     255             : 
     256             :     // Read 1st number and delete it from string (used by GetTableBox and SwTableField).
     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* GetTableBox( 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& rCpyTable, const SwNodeIndex&,
     276             :                     SwUndoTableCpyTable* pUndo = 0 );
     277             :     bool InsTable( const SwTable& rCpyTable, const SwSelBoxes&,
     278             :                     SwUndoTableCpyTable* pUndo = 0 );
     279             :     bool InsNewTable( const SwTable& rCpyTable, const SwSelBoxes&,
     280             :                       SwUndoTableCpyTable* pUndo );
     281             :     // Copy headline of table (with content!) into an other one.
     282             :     bool CopyHeadlineIntoTable( SwTableNode& rTableNd );
     283             : 
     284             :     // Get box, whose start index is set on nBoxStt.
     285             :           SwTableBox* GetTableBox( sal_uLong nSttIdx );
     286        8181 :     const SwTableBox* GetTableBox( sal_uLong nSttIdx ) const
     287        8181 :                         {   return const_cast<SwTable*>(this)->GetTableBox( nSttIdx );  }
     288             : 
     289             :     // Returns true if table contains nestings.
     290             :     bool IsTableComplex() const;
     291             : 
     292             :     // Returns true if table or selection is balanced.
     293             :     bool IsTableComplexForChart( 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, false-> else only line of box.
     299             :     static SwSelBoxes& SelLineFromBox( const SwTableBox* pBox,
     300             :                             SwSelBoxes& rBoxes, bool bToTop = true );
     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( SwFrameFormat const*const pFormat );
     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         568 :     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         284 :     TableChgMode GetTableChgMode() const        { return eTableChgMode; }
     324         284 :     void SetTableChgMode( TableChgMode eMode )  { eTableChgMode = 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( SwFormat& rFormat );
     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 FrameFormat.
     340             : {
     341             :     SwTableBoxes aBoxes;
     342             :     SwTableBox *pUpper;
     343             : 
     344             : public:
     345             :     TYPEINFO_OVERRIDE();
     346             : 
     347             :     SwTableLine() : pUpper(0) {}
     348             : 
     349             :     SwTableLine( SwTableLineFormat*, sal_uInt16 nBoxes, SwTableBox *pUp );
     350             :     virtual ~SwTableLine();
     351             : 
     352      114122 :           SwTableBoxes &GetTabBoxes() { return aBoxes; }
     353       62153 :     const SwTableBoxes &GetTabBoxes() const { return aBoxes; }
     354             : 
     355        4054 :           SwTableBox *GetUpper() { return pUpper; }
     356       28895 :     const SwTableBox *GetUpper() const { return pUpper; }
     357           0 :     void SetUpper( SwTableBox *pNew ) { pUpper = pNew; }
     358             : 
     359       12836 :     SwFrameFormat* GetFrameFormat()       { return static_cast<SwFrameFormat*>(GetRegisteredIn()); }
     360       66948 :     SwFrameFormat* GetFrameFormat() const { return const_cast<SwFrameFormat*>(static_cast<const SwFrameFormat*>(GetRegisteredIn())); }
     361             : 
     362             :     // Creates a own FrameFormat if more lines depend on it.
     363             :     SwFrameFormat* ClaimFrameFormat();
     364             :     void ChgFrameFormat( SwTableLineFormat* pNewFormat );
     365             : 
     366             :     // Search next/previous box with content.
     367             :     SwTableBox* FindNextBox( const SwTable&, const SwTableBox* =0,
     368             :                             bool bOvrTableLns=true ) const;
     369             :     SwTableBox* FindPreviousBox( const SwTable&, const SwTableBox* =0,
     370             :                             bool bOvrTableLns=true ) const;
     371             : 
     372             :     SwTwips GetTableLineHeight( bool& bLayoutAvailable ) const;
     373             : 
     374             :     bool hasSoftPageBreak() const;
     375             :     void RegisterToFormat( SwFormat& rFormat );
     376             : };
     377             : 
     378             : /// SwTableBox is one table cell in the document model.
     379             : class SW_DLLPUBLIC SwTableBox: public SwClient      //Client of FrameFormat.
     380             : {
     381             :     friend class SwNodes;           // Transpose index.
     382             :     friend void DelBoxNode(SwTableSortBoxes&);  // Delete StartNode* !
     383             :     friend class SwXMLTableContext;
     384             : 
     385             :     SwTableBox( const SwTableBox & ) SAL_DELETED_FUNCTION;
     386             :     SwTableBox &operator=( const SwTableBox &) SAL_DELETED_FUNCTION;
     387             : 
     388             :     SwTableLines aLines;
     389             :     const SwStartNode * pSttNd;
     390             :     SwTableLine *pUpper;
     391             :     SwTableBox_Impl* pImpl;
     392             : 
     393             :     // In case Format contains formulas/values already,
     394             :     // a new one must be created for the new box.
     395             :     static SwTableBoxFormat* CheckBoxFormat( SwTableBoxFormat* );
     396             : 
     397             : public:
     398             :     TYPEINFO_OVERRIDE();
     399             : 
     400             :     SwTableBox() : pSttNd(0), pUpper(0), pImpl(0) {}
     401             : 
     402             :     SwTableBox( SwTableBoxFormat*, sal_uInt16 nLines, SwTableLine *pUp = 0 );
     403             :     SwTableBox( SwTableBoxFormat*, const SwStartNode&, SwTableLine *pUp = 0 );
     404             :     SwTableBox( SwTableBoxFormat*, const SwNodeIndex&, SwTableLine *pUp = 0 );
     405             :     virtual ~SwTableBox();
     406             : 
     407       20570 :           SwTableLines &GetTabLines() { return aLines; }
     408       10579 :     const SwTableLines &GetTabLines() const { return aLines; }
     409             : 
     410        4732 :           SwTableLine *GetUpper() { return pUpper; }
     411       47383 :     const SwTableLine *GetUpper() const { return pUpper; }
     412         102 :     void SetUpper( SwTableLine *pNew ) { pUpper = pNew; }
     413             : 
     414      227563 :     SwFrameFormat* GetFrameFormat()       { return static_cast<SwFrameFormat*>(GetRegisteredIn()); }
     415      109690 :     SwFrameFormat* GetFrameFormat() const { return const_cast<SwFrameFormat*>(static_cast<const SwFrameFormat*>(GetRegisteredIn())); }
     416             : 
     417             :     // Creates its own FrameFormat if more boxes depend on it.
     418             :     SwFrameFormat* ClaimFrameFormat();
     419             :     void ChgFrameFormat( SwTableBoxFormat *pNewFormat );
     420             : 
     421             :     void RemoveFromTable();
     422      165081 :     const SwStartNode *GetSttNd() const { return pSttNd; }
     423             :     sal_uLong GetSttIdx() const;
     424             : 
     425             :     // Search next/previous box with content.
     426             :     SwTableBox* FindNextBox( const SwTable&, const SwTableBox* =0,
     427             :                             bool bOvrTableLns=true ) const;
     428             :     SwTableBox* FindPreviousBox( const SwTable&, const SwTableBox* =0,
     429             :                             bool bOvrTableLns=true ) const;
     430             :     // Return name of this box. It is determined dynamically and
     431             :     // is calculated from the position in the lines/boxes/table.
     432             :     OUString GetName() const;
     433             :     // Return "value" of box (for calculating in table).
     434             :     double GetValue( SwTableCalcPara& rPara ) const;
     435             : 
     436             :     // Computes "coordinates" of a box, used to computed selection
     437             :     // width or height when inserting cols or rows
     438             :     Point GetCoordinates() const;
     439             : 
     440             :     bool IsInHeadline( const SwTable* pTable = 0 ) const;
     441             : 
     442             :     // Contains box contents, that can be formatted as a number?
     443             :     bool HasNumContent( double& rNum, sal_uInt32& rFormatIndex,
     444             :                     bool& rIsEmptyTextNd ) const;
     445             :     sal_uLong IsValidNumTextNd( bool bCheckAttr = true ) const;
     446             :     // If a table formula is set, test if box contents is congruent with number.
     447             :     // (For Redo of change of NumFormat!).
     448             :     bool IsNumberChanged() const;
     449             : 
     450             :     // Is that a formula box or a box with numeric contents (AutoSum)?
     451             :     // What it is indicated by the return value - the WhichId of the attribute.
     452             :     // Empty boxes have the return value USHRT_MAX !!
     453             :     sal_uInt16 IsFormulaOrValueBox() const;
     454             : 
     455             :     // Loading of a document requires an actualisation of cells with values
     456             :     void ActualiseValueBox();
     457             : 
     458       23708 :     DECL_FIXEDMEMPOOL_NEWDEL(SwTableBox)
     459             : 
     460             :     // Access on internal data - currently used for the NumFormatter.
     461             :     inline const Color* GetSaveUserColor()  const;
     462             :     inline const Color* GetSaveNumFormatColor() const;
     463             :     inline void SetSaveUserColor(const Color* p );
     464             :     inline void SetSaveNumFormatColor( const Color* p );
     465             : 
     466             :     long getRowSpan() const;
     467             :     void setRowSpan( long nNewRowSpan );
     468             :     bool getDummyFlag() const;
     469             :     void setDummyFlag( bool bDummy );
     470             : 
     471             :     SwTableBox& FindStartOfRowSpan( const SwTable&, sal_uInt16 nMaxStep = USHRT_MAX );
     472         572 :     const SwTableBox& FindStartOfRowSpan( const SwTable& rTable,
     473             :         sal_uInt16 nMaxStep = USHRT_MAX ) const
     474         572 :         { return const_cast<SwTableBox*>(this)->FindStartOfRowSpan( rTable, nMaxStep ); }
     475             : 
     476             :     SwTableBox& FindEndOfRowSpan( const SwTable&, sal_uInt16 nMaxStep = USHRT_MAX );
     477         132 :     const SwTableBox& FindEndOfRowSpan( const SwTable& rTable,
     478             :         sal_uInt16 nMaxStep = USHRT_MAX ) const
     479         132 :         { return const_cast<SwTableBox*>(this)->FindEndOfRowSpan( rTable, nMaxStep ); }
     480             :     void RegisterToFormat( SwFormat& rFormat ) ;
     481             : };
     482             : 
     483             : class SwCellFrm;
     484             : class SW_DLLPUBLIC SwTableCellInfo : public ::boost::noncopyable
     485             : {
     486             :     struct Impl;
     487             :     ::std::unique_ptr<Impl> m_pImpl;
     488             : 
     489             :     const SwCellFrm * getCellFrm() const ;
     490             : 
     491             : public:
     492             :     SwTableCellInfo(const SwTable * pTable);
     493             :     ~SwTableCellInfo();
     494             : 
     495             :     bool getNext();
     496             :     SwRect getRect() const;
     497             :     const SwTableBox * getTableBox() const;
     498             : };
     499             : 
     500             : #endif // INCLUDED_SW_INC_SWTABLE_HXX
     501             : 
     502             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11