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