LCOV - code coverage report
Current view: top level - sc/inc - table.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 50 57 87.7 %
Date: 2012-08-25 Functions: 34 38 89.5 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 5 12 41.7 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef SC_TABLE_HXX
      30                 :            : #define SC_TABLE_HXX
      31                 :            : 
      32                 :            : #include <vector>
      33                 :            : #include <utility>
      34                 :            : #include <tools/gen.hxx>
      35                 :            : #include <tools/color.hxx>
      36                 :            : #include <com/sun/star/uno/Sequence.hxx>
      37                 :            : #include "column.hxx"
      38                 :            : #include "sortparam.hxx"
      39                 :            : #include "compressedarray.hxx"
      40                 :            : #include "postit.hxx"
      41                 :            : 
      42                 :            : #include <set>
      43                 :            : #include <map>
      44                 :            : #include <boost/scoped_ptr.hpp>
      45                 :            : #include <boost/noncopyable.hpp>
      46                 :            : 
      47                 :            : namespace utl {
      48                 :            :     class TextSearch;
      49                 :            : }
      50                 :            : 
      51                 :            : namespace com { namespace sun { namespace star {
      52                 :            :     namespace sheet {
      53                 :            :         struct TablePageBreakData;
      54                 :            :     }
      55                 :            : } } }
      56                 :            : 
      57                 :            : class SfxItemSet;
      58                 :            : class SfxStyleSheetBase;
      59                 :            : class SvxBoxInfoItem;
      60                 :            : class SvxBoxItem;
      61                 :            : class SvxSearchItem;
      62                 :            : 
      63                 :            : class ScAutoFormatData;
      64                 :            : class ScBaseCell;
      65                 :            : class ScDocument;
      66                 :            : class ScEditDataArray;
      67                 :            : class ScFormulaCell;
      68                 :            : class ScOutlineTable;
      69                 :            : class ScPrintSaverTab;
      70                 :            : class ScProgress;
      71                 :            : class ScRangeList;
      72                 :            : class ScSheetEvents;
      73                 :            : class ScSortInfoArray;
      74                 :            : class ScConditionalFormat;
      75                 :            : class ScConditionalFormatList;
      76                 :            : class ScStyleSheet;
      77                 :            : class ScTableProtection;
      78                 :            : class ScUserListData;
      79                 :            : struct RowInfo;
      80                 :            : struct ScFunctionData;
      81                 :            : struct ScLineFlags;
      82                 :            : class CollatorWrapper;
      83                 :            : class ScFlatUInt16RowSegments;
      84                 :            : class ScFlatBoolRowSegments;
      85                 :            : class ScFlatBoolColSegments;
      86                 :            : struct ScSetStringParam;
      87                 :            : struct ScColWidthParam;
      88                 :            : struct ScColWidthParam;
      89                 :            : class ScRangeName;
      90                 :            : class ScDBData;
      91                 :            : 
      92                 :            : class ScTable : boost::noncopyable
      93                 :            : {
      94                 :            : private:
      95                 :            :     typedef ::std::vector< ScRange > ScRangeVec;
      96                 :            :     typedef ::std::pair< SCCOL, SCROW > ScAddress2D;
      97                 :            :     typedef ::std::vector< ScAddress2D > ScAddress2DVec;
      98                 :            : 
      99                 :            :     ScColumn        aCol[MAXCOLCOUNT];
     100                 :            : 
     101                 :            :     rtl::OUString aName;
     102                 :            :     rtl::OUString aCodeName;
     103                 :            :     rtl::OUString aComment;
     104                 :            : 
     105                 :            :     rtl::OUString       aLinkDoc;
     106                 :            :     rtl::OUString       aLinkFlt;
     107                 :            :     rtl::OUString       aLinkOpt;
     108                 :            :     rtl::OUString       aLinkTab;
     109                 :            :     sal_uLong           nLinkRefreshDelay;
     110                 :            :     sal_uInt8           nLinkMode;
     111                 :            : 
     112                 :            :     // page style template
     113                 :            :     rtl::OUString   aPageStyle;
     114                 :            :     Size            aPageSizeTwips;                 // size of the print-page
     115                 :            :     SCCOL           nRepeatStartX;                  // repeating rows/columns
     116                 :            :     SCCOL           nRepeatEndX;                    // REPEAT_NONE, if not used
     117                 :            :     SCROW           nRepeatStartY;
     118                 :            :     SCROW           nRepeatEndY;
     119                 :            : 
     120                 :            :     boost::scoped_ptr<ScTableProtection> pTabProtection;
     121                 :            : 
     122                 :            :     sal_uInt16*         pColWidth;
     123                 :            :     boost::scoped_ptr<ScFlatUInt16RowSegments> mpRowHeights;
     124                 :            : 
     125                 :            :     sal_uInt8*          pColFlags;
     126                 :            :     ScBitMaskCompressedArray< SCROW, sal_uInt8>*     pRowFlags;
     127                 :            :     boost::scoped_ptr<ScFlatBoolColSegments>  mpHiddenCols;
     128                 :            :     boost::scoped_ptr<ScFlatBoolRowSegments>  mpHiddenRows;
     129                 :            :     boost::scoped_ptr<ScFlatBoolColSegments>  mpFilteredCols;
     130                 :            :     boost::scoped_ptr<ScFlatBoolRowSegments>  mpFilteredRows;
     131                 :            : 
     132                 :            :     ::std::set<SCROW>                      maRowPageBreaks;
     133                 :            :     ::std::set<SCROW>                      maRowManualBreaks;
     134                 :            :     ::std::set<SCCOL>                      maColPageBreaks;
     135                 :            :     ::std::set<SCCOL>                      maColManualBreaks;
     136                 :            : 
     137                 :            :     ScOutlineTable* pOutlineTable;
     138                 :            : 
     139                 :            :     ScSheetEvents*  pSheetEvents;
     140                 :            : 
     141                 :            :     mutable SCCOL nTableAreaX;
     142                 :            :     mutable SCROW nTableAreaY;
     143                 :            : 
     144                 :            :     SCTAB           nTab;
     145                 :            :     sal_uInt16          nRecalcLvl;             // recursion level Size-Recalc
     146                 :            :     ScDocument*     pDocument;
     147                 :            :     utl::TextSearch*    pSearchText;
     148                 :            : 
     149                 :            :     mutable rtl::OUString aUpperName;             // #i62977# filled only on demand, reset in SetName
     150                 :            : 
     151                 :            :     boost::scoped_ptr<ScAddress2DVec> mxUninitNotes;
     152                 :            : 
     153                 :            :     // sort parameter to minimize stack size of quicksort
     154                 :            :     ScSortParam     aSortParam;
     155                 :            :     CollatorWrapper*    pSortCollator;
     156                 :            : 
     157                 :            :     ScRangeVec      aPrintRanges;
     158                 :            : 
     159                 :            :     ScRange*        pRepeatColRange;
     160                 :            :     ScRange*        pRepeatRowRange;
     161                 :            : 
     162                 :            :     sal_uInt16          nLockCount;
     163                 :            : 
     164                 :            :     ScRangeList*    pScenarioRanges;
     165                 :            :     Color           aScenarioColor;
     166                 :            :     Color           aTabBgColor;
     167                 :            :     sal_uInt16          nScenarioFlags;
     168                 :            :     ScDBData*       pDBDataNoName;
     169                 :            :     mutable ScRangeName* mpRangeName;
     170                 :            : 
     171                 :            :     boost::scoped_ptr<ScConditionalFormatList> mpCondFormatList;
     172                 :            : 
     173                 :            :     ScNotes         maNotes;
     174                 :            : 
     175                 :            :     bool            bScenario:1;
     176                 :            :     bool            bLayoutRTL:1;
     177                 :            :     bool            bLoadingRTL:1;
     178                 :            :     bool            bPageSizeValid:1;
     179                 :            :     mutable bool    bTableAreaValid:1;
     180                 :            :     bool            bVisible:1;
     181                 :            :     bool            bStreamValid:1;
     182                 :            :     bool            bPendingRowHeights:1;
     183                 :            :     bool            bCalcNotification:1;
     184                 :            :     bool            bGlobalKeepQuery:1;
     185                 :            :     bool            bPrintEntireSheet:1;
     186                 :            :     bool            bActiveScenario:1;
     187                 :            :     bool            mbPageBreaksValid:1;
     188                 :            : 
     189                 :            : friend class ScDocument;                    // for FillInfo
     190                 :            : friend class ScDocumentIterator;
     191                 :            : friend class ScValueIterator;
     192                 :            : friend class ScHorizontalValueIterator;
     193                 :            : friend class ScDBQueryDataIterator;
     194                 :            : friend class ScCellIterator;
     195                 :            : friend class ScQueryCellIterator;
     196                 :            : friend class ScHorizontalCellIterator;
     197                 :            : friend class ScHorizontalAttrIterator;
     198                 :            : friend class ScDocAttrIterator;
     199                 :            : friend class ScAttrRectIterator;
     200                 :            : 
     201                 :            : 
     202                 :            : public:
     203                 :            :                 ScTable( ScDocument* pDoc, SCTAB nNewTab, const rtl::OUString& rNewName,
     204                 :            :                          bool bColInfo = true, bool bRowInfo = true );
     205                 :            :                 ~ScTable();
     206                 :            : 
     207                 :       6845 :     ScOutlineTable* GetOutlineTable()               { return pOutlineTable; }
     208                 :            : 
     209                 :            :     SCSIZE      GetCellCount(SCCOL nCol) const;
     210                 :            :     sal_uLong       GetCellCount() const;
     211                 :            :     sal_uLong       GetWeightedCount() const;
     212                 :            :     sal_uLong       GetCodeCount() const;       // RPN code in formula
     213                 :            : 
     214                 :            :     bool        SetOutlineTable( const ScOutlineTable* pNewOutline );
     215                 :            :     void        StartOutlineTable();
     216                 :            : 
     217                 :            :     void        DoAutoOutline( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
     218                 :            : 
     219                 :            :     bool        TestRemoveSubTotals( const ScSubTotalParam& rParam );
     220                 :            :     void        RemoveSubTotals( ScSubTotalParam& rParam );
     221                 :            :     bool        DoSubTotals( ScSubTotalParam& rParam );
     222                 :            : 
     223                 :      28006 :     const ScSheetEvents* GetSheetEvents() const              { return pSheetEvents; }
     224                 :            :     void        SetSheetEvents( const ScSheetEvents* pNew );
     225                 :            : 
     226                 :       2992 :     bool        IsVisible() const                            { return bVisible; }
     227                 :            :     void        SetVisible( bool bVis );
     228                 :            : 
     229                 :     249622 :     bool        IsStreamValid() const                        { return bStreamValid; }
     230                 :            :     void        SetStreamValid( bool bSet, bool bIgnoreLock = false );
     231                 :            : 
     232                 :       4233 :     bool        IsPendingRowHeights() const                  { return bPendingRowHeights; }
     233                 :            :     void        SetPendingRowHeights( bool bSet );
     234                 :            : 
     235                 :        116 :     bool        GetCalcNotification() const                  { return bCalcNotification; }
     236                 :            :     void        SetCalcNotification( bool bSet );
     237                 :            : 
     238                 :     199524 :     bool        IsLayoutRTL() const                          { return bLayoutRTL; }
     239                 :        237 :     bool        IsLoadingRTL() const                         { return bLoadingRTL; }
     240                 :            :     void        SetLayoutRTL( bool bSet );
     241                 :            :     void        SetLoadingRTL( bool bSet );
     242                 :            : 
     243                 :      22243 :     bool        IsScenario() const                           { return bScenario; }
     244                 :            :     void        SetScenario( bool bFlag );
     245                 :          0 :     void        GetScenarioComment( rtl::OUString& rComment) const  { rComment = aComment; }
     246                 :          1 :     void        SetScenarioComment( const rtl::OUString& rComment ) { aComment = rComment; }
     247                 :          0 :     const Color& GetScenarioColor() const                    { return aScenarioColor; }
     248                 :          1 :     void        SetScenarioColor(const Color& rNew)          { aScenarioColor = rNew; }
     249                 :            :     const Color& GetTabBgColor() const;
     250                 :            :     void         SetTabBgColor(const Color& rColor);
     251                 :          0 :     sal_uInt16      GetScenarioFlags() const                     { return nScenarioFlags; }
     252                 :          1 :     void        SetScenarioFlags(sal_uInt16 nNew)                { nScenarioFlags = nNew; }
     253                 :          1 :     void        SetActiveScenario(bool bSet)                 { bActiveScenario = bSet; }
     254                 :          1 :     bool        IsActiveScenario() const                     { return bActiveScenario; }
     255                 :            : 
     256                 :          6 :     sal_uInt8       GetLinkMode() const                         { return nLinkMode; }
     257                 :        824 :     bool        IsLinked() const                            { return nLinkMode != SC_LINK_NONE; }
     258                 :         22 :     const rtl::OUString& GetLinkDoc() const                        { return aLinkDoc; }
     259                 :          2 :     const rtl::OUString& GetLinkFlt() const                        { return aLinkFlt; }
     260                 :          2 :     const rtl::OUString& GetLinkOpt() const                        { return aLinkOpt; }
     261                 :          2 :     const rtl::OUString& GetLinkTab() const                        { return aLinkTab; }
     262                 :          2 :     sal_uLong       GetLinkRefreshDelay() const                 { return nLinkRefreshDelay; }
     263                 :            : 
     264                 :            :     void        SetLink( sal_uInt8 nMode, const String& rDoc, const String& rFlt,
     265                 :            :                         const String& rOpt, const String& rTab, sal_uLong nRefreshDelay );
     266                 :            : 
     267                 :            :     void        GetName( rtl::OUString& rName ) const;
     268                 :            :     void        SetName( const rtl::OUString& rNewName );
     269                 :            : 
     270                 :            :     void        SetAnonymousDBData(ScDBData* pDBData);
     271                 :            :     ScDBData*   GetAnonymousDBData();
     272                 :            : 
     273                 :        260 :     void        GetCodeName( rtl::OUString& rName ) const {  rName = aCodeName; }
     274                 :        390 :     void        SetCodeName( const rtl::OUString& rNewName ) { aCodeName = rNewName; }
     275                 :            : 
     276                 :            :     const rtl::OUString& GetUpperName() const;
     277                 :            : 
     278                 :      21725 :     const rtl::OUString&   GetPageStyle() const                    { return aPageStyle; }
     279                 :            :     void            SetPageStyle( const rtl::OUString& rName );
     280                 :            :     void            PageStyleModified( const String& rNewName );
     281                 :            : 
     282                 :            :     bool            IsProtected() const;
     283                 :            :     void            SetProtection(const ScTableProtection* pProtect);
     284                 :            :     ScTableProtection* GetProtection();
     285                 :            : 
     286                 :            :     Size            GetPageSize() const;
     287                 :            :     void            SetPageSize( const Size& rSize );
     288                 :            :     void            SetRepeatArea( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow );
     289                 :            : 
     290                 :            :     void        RemoveAutoSpellObj();
     291                 :            : 
     292                 :            :     void        LockTable();
     293                 :            :     void        UnlockTable();
     294                 :            : 
     295                 :            :     bool        IsBlockEditable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2,
     296                 :            :                         SCROW nRow2, bool* pOnlyNotBecauseOfMatrix = NULL ) const;
     297                 :            :     bool        IsSelectionEditable( const ScMarkData& rMark,
     298                 :            :                         bool* pOnlyNotBecauseOfMatrix = NULL ) const;
     299                 :            : 
     300                 :            :     bool        HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) const;
     301                 :            :     bool        HasSelectionMatrixFragment( const ScMarkData& rMark ) const;
     302                 :            : 
     303                 :            :     bool        IsBlockEmpty( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bIgnoreNotes = false ) const;
     304                 :            : 
     305                 :            :     void        PutCell( const ScAddress&, ScBaseCell* pCell );
     306                 :            :     void        PutCell( SCCOL nCol, SCROW nRow, ScBaseCell* pCell );
     307                 :            :     void        PutCell(SCCOL nCol, SCROW nRow, sal_uLong nFormatIndex, ScBaseCell* pCell);
     308                 :            :                 //  TRUE = numberformat set
     309                 :            :     bool        SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
     310                 :            :                            ScSetStringParam* pParam = NULL );
     311                 :            :     void        SetValue( SCCOL nCol, SCROW nRow, const double& rVal );
     312                 :            :     void        SetError( SCCOL nCol, SCROW nRow, sal_uInt16 nError);
     313                 :            : 
     314                 :            :     void        GetString( SCCOL nCol, SCROW nRow, rtl::OUString& rString ) const;
     315                 :            :     void        GetInputString( SCCOL nCol, SCROW nRow, rtl::OUString& rString ) const;
     316                 :       1627 :     double      GetValue( const ScAddress& rPos ) const
     317                 :            :                     {
     318                 :       1627 :                         return ValidColRow(rPos.Col(),rPos.Row()) ?
     319                 :       1627 :                             aCol[rPos.Col()].GetValue( rPos.Row() ) :
     320         [ +  - ]:       3254 :                             0.0;
     321                 :            :                     }
     322                 :            :     double      GetValue( SCCOL nCol, SCROW nRow ) const;
     323                 :            :     void        GetFormula( SCCOL nCol, SCROW nRow, rtl::OUString& rFormula );
     324                 :            : 
     325                 :        302 :     CellType    GetCellType( const ScAddress& rPos ) const
     326                 :            :                     {
     327                 :        302 :                         return ValidColRow(rPos.Col(),rPos.Row()) ?
     328                 :        302 :                             aCol[rPos.Col()].GetCellType( rPos.Row() ) :
     329         [ +  - ]:        604 :                             CELLTYPE_NONE;
     330                 :            :                     }
     331                 :            :     CellType    GetCellType( SCCOL nCol, SCROW nRow ) const;
     332                 :      30525 :     ScBaseCell* GetCell( const ScAddress& rPos ) const
     333                 :            :                     {
     334                 :      30525 :                         return ValidColRow(rPos.Col(),rPos.Row()) ?
     335                 :      30525 :                             aCol[rPos.Col()].GetCell( rPos.Row() ) :
     336         [ +  - ]:      61050 :                             NULL;
     337                 :            :                     }
     338                 :            :     ScBaseCell* GetCell( SCCOL nCol, SCROW nRow ) const;
     339                 :            : 
     340                 :            :     void        GetFirstDataPos(SCCOL& rCol, SCROW& rRow) const;
     341                 :            :     void        GetLastDataPos(SCCOL& rCol, SCROW& rRow) const;
     342                 :            : 
     343                 :            :     ScNotes*    GetNotes();
     344                 :            :     /** Creates the captions of all uninitialized cell notes.
     345                 :            :         @param bForced  True = always create all captions, false = skip when Undo is disabled. */
     346                 :            :     void        InitializeNoteCaptions( bool bForced = false );
     347                 :            : 
     348                 :            :     bool        TestInsertRow( SCCOL nStartCol, SCCOL nEndCol, SCSIZE nSize ) const;
     349                 :            :     void        InsertRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize );
     350                 :            :     void        DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize,
     351                 :            :                             bool* pUndoOutline = NULL );
     352                 :            : 
     353                 :            :     bool        TestInsertCol( SCROW nStartRow, SCROW nEndRow, SCSIZE nSize ) const;
     354                 :            :     void        InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize );
     355                 :            :     void        DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize,
     356                 :            :                             bool* pUndoOutline = NULL );
     357                 :            : 
     358                 :            :     void        DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt16 nDelFlag);
     359                 :            :     void        CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pTable,
     360                 :            :                             bool bKeepScenarioFlags, bool bCloneNoteCaptions);
     361                 :            :     void        CopyToClip(const ScRangeList& rRanges, ScTable* pTable,
     362                 :            :                            bool bKeepScenarioFlags, bool bCloneNoteCaptions);
     363                 :            :     void        CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCsCOL nDx, SCsROW nDy,
     364                 :            :                                 sal_uInt16 nInsFlag, bool bAsLink, bool bSkipAttrForEmpty, ScTable* pTable);
     365                 :            :     void        StartListeningInArea( SCCOL nCol1, SCROW nRow1,
     366                 :            :                                         SCCOL nCol2, SCROW nRow2 );
     367                 :            :     void        BroadcastInArea( SCCOL nCol1, SCROW nRow1,
     368                 :            :                                     SCCOL nCol2, SCROW nRow2 );
     369                 :            : 
     370                 :            :     void        CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
     371                 :            :                             sal_uInt16 nFlags, bool bMarked, ScTable* pDestTab,
     372                 :            :                             const ScMarkData* pMarkData = NULL,
     373                 :            :                             bool bAsLink = false, bool bColRowFlags = true);
     374                 :            :     void        UndoToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
     375                 :            :                             sal_uInt16 nFlags, bool bMarked, ScTable* pDestTab,
     376                 :            :                             const ScMarkData* pMarkData = NULL);
     377                 :            : 
     378                 :            :     void        CopyConditionalFormat( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
     379                 :            :                             SCsCOL nDx, SCsROW nDy, ScTable* pTable);
     380                 :            :     void        TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
     381                 :            :                                 ScTable* pTransClip, sal_uInt16 nFlags, bool bAsLink );
     382                 :            : 
     383                 :            :                 // mark of this document
     384                 :            :     void        MixMarked( const ScMarkData& rMark, sal_uInt16 nFunction,
     385                 :            :                             bool bSkipEmpty, ScTable* pSrcTab );
     386                 :            :     void        MixData( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
     387                 :            :                             sal_uInt16 nFunction, bool bSkipEmpty, ScTable* pSrcTab );
     388                 :            : 
     389                 :            :     void        CopyData( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
     390                 :            :                             SCCOL nDestCol, SCROW nDestRow, SCTAB nDestTab );
     391                 :            : 
     392                 :            :     void        CopyScenarioFrom( const ScTable* pSrcTab );
     393                 :            :     void        CopyScenarioTo( ScTable* pDestTab ) const;
     394                 :            :     bool        TestCopyScenarioTo( const ScTable* pDestTab ) const;
     395                 :            :     void        MarkScenarioIn( ScMarkData& rMark, sal_uInt16 nNeededBits ) const;
     396                 :            :     bool        HasScenarioRange( const ScRange& rRange ) const;
     397                 :            :     void        InvalidateScenarioRanges();
     398                 :            :     const ScRangeList* GetScenarioRanges() const;
     399                 :            : 
     400                 :            :     void        CopyUpdated( const ScTable* pPosTab, ScTable* pDestTab ) const;
     401                 :            : 
     402                 :            :     void        InvalidateTableArea();
     403                 :            :     void        InvalidatePageBreaks();
     404                 :            : 
     405                 :            :     bool        GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const;            // FALSE = empty
     406                 :            :     bool        GetTableArea( SCCOL& rEndCol, SCROW& rEndRow ) const;
     407                 :            :     bool        GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, bool bNotes, bool bFullFormattedArea = false ) const;
     408                 :            :     bool        GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow,
     409                 :            :                                 SCCOL& rEndCol, bool bNotes ) const;
     410                 :            :     bool        GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol,
     411                 :            :                                 SCROW& rEndRow, bool bNotes ) const;
     412                 :            : 
     413                 :            :     bool        GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const;
     414                 :            : 
     415                 :            :     void        ExtendPrintArea( OutputDevice* pDev,
     416                 :            :                         SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW nEndRow );
     417                 :            : 
     418                 :            :     void        GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow,
     419                 :            :                              bool bIncludeOld, bool bOnlyDown ) const;
     420                 :            : 
     421                 :            :     bool        ShrinkToUsedDataArea( bool& o_bShrunk, SCCOL& rStartCol, SCROW& rStartRow,
     422                 :            :                                       SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const;
     423                 :            : 
     424                 :            :     SCSIZE      GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow,
     425                 :            :                                         SCCOL nEndCol, SCROW nEndRow, ScDirection eDir ) const;
     426                 :            : 
     427                 :            :     void        FindAreaPos( SCCOL& rCol, SCROW& rRow, ScMoveDirection eDirection ) const;
     428                 :            :     void        GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY,
     429                 :            :                                 bool bMarked, bool bUnprotected, const ScMarkData& rMark ) const;
     430                 :            : 
     431                 :            :     void        LimitChartArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow ) const;
     432                 :            : 
     433                 :            :     bool        HasData( SCCOL nCol, SCROW nRow ) const;
     434                 :            :     bool        HasStringData( SCCOL nCol, SCROW nRow ) const;
     435                 :            :     bool        HasValueData( SCCOL nCol, SCROW nRow ) const;
     436                 :            :     bool        HasStringCells( SCCOL nStartCol, SCROW nStartRow,
     437                 :            :                                 SCCOL nEndCol, SCROW nEndRow ) const;
     438                 :            : 
     439                 :       1657 :     sal_uInt16      GetErrCode( const ScAddress& rPos ) const
     440                 :            :                     {
     441                 :       1657 :                         return ValidColRow(rPos.Col(),rPos.Row()) ?
     442                 :       1657 :                             aCol[rPos.Col()].GetErrCode( rPos.Row() ) :
     443         [ +  - ]:       3314 :                             0;
     444                 :            :                     }
     445                 :            : 
     446                 :            :     void        ResetChanged( const ScRange& rRange );
     447                 :            : 
     448                 :            :     void        SetDirty();
     449                 :            :     void        SetDirty( const ScRange& );
     450                 :            :     void        SetDirtyAfterLoad();
     451                 :            :     void        SetDirtyVar();
     452                 :            :     void        SetTableOpDirty( const ScRange& );
     453                 :            :     void        CalcAll();
     454                 :            :     void        CalcAfterLoad();
     455                 :            :     void        CompileAll();
     456                 :            :     void        CompileXML( ScProgress& rProgress );
     457                 :            : 
     458                 :            :     void        UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
     459                 :            :                                     SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
     460                 :            :                                     SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
     461                 :            :                                     ScDocument* pUndoDoc = NULL, bool bIncludeDraw = true, bool bUpdateNoteCaptionPos = true );
     462                 :            : 
     463                 :            :     void        UpdateDrawRef( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
     464                 :            :                                     SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
     465                 :            :                                     SCsCOL nDx, SCsROW nDy, SCsTAB nDz, bool bUpdateNoteCaptionPos = true );
     466                 :            : 
     467                 :            :     void        UpdateTranspose( const ScRange& rSource, const ScAddress& rDest,
     468                 :            :                                     ScDocument* pUndoDoc );
     469                 :            : 
     470                 :            :     void        UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY );
     471                 :            : 
     472                 :            :     void        UpdateInsertTab(SCTAB nTable, SCTAB nNewSheets = 1);
     473                 :            :     void        UpdateDeleteTab( SCTAB nTable, bool bIsMove, ScTable* pRefUndo = NULL, SCTAB nSheets = 1 );
     474                 :            :     void        UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo, ScProgress* pProgress );
     475                 :            :     void        UpdateCompile( bool bForceIfNameInUse = false );
     476                 :            :     void        SetTabNo(SCTAB nNewTab);
     477                 :            :     void        FindRangeNamesInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
     478                 :            :                                  std::set<sal_uInt16>& rIndexes) const;
     479                 :            :     void        Fill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
     480                 :            :                         sal_uLong nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd,
     481                 :            :                         double nStepValue, double nMaxValue, ScProgress* pProgress);
     482                 :            :     String      GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW nEndY );
     483                 :            : 
     484                 :            :     void        UpdateSelectionFunction( ScFunctionData& rData,
     485                 :            :                         SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
     486                 :            :                         const ScMarkData& rMark );
     487                 :            : 
     488                 :            :     void        AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
     489                 :            :                                     sal_uInt16 nFormatNo );
     490                 :            :     void        GetAutoFormatData(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScAutoFormatData& rData);
     491                 :            :     void        ScReplaceTabsStr( String& rStr, const String& rSrch, const String& rRepl ); // from sw
     492                 :            :     bool        SearchAndReplace(
     493                 :            :         const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark,
     494                 :            :         ScRangeList& rMatchedRanges, rtl::OUString& rUndoStr, ScDocument* pUndoDoc);
     495                 :            : 
     496                 :            :     void        FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2 );
     497                 :            : 
     498                 :            :     void        GetBorderLines( SCCOL nCol, SCROW nRow,
     499                 :            :                                 const ::editeng::SvxBorderLine** ppLeft, const ::editeng::SvxBorderLine** ppTop,
     500                 :            :                                 const ::editeng::SvxBorderLine** ppRight, const ::editeng::SvxBorderLine** ppBottom ) const;
     501                 :            : 
     502                 :            :     bool        HasAttrib( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt16 nMask ) const;
     503                 :            :     bool        HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const;
     504                 :            :     bool        ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
     505                 :            :                                 SCCOL& rEndCol, SCROW& rEndRow,
     506                 :            :                                 bool bRefresh );
     507                 :            :     const SfxPoolItem*      GetAttr( SCCOL nCol, SCROW nRow, sal_uInt16 nWhich ) const;
     508                 :            :     const ScPatternAttr*    GetPattern( SCCOL nCol, SCROW nRow ) const;
     509                 :            :     const ScPatternAttr*    GetMostUsedPattern( SCCOL nCol, SCROW nStartRow, SCROW nEndRow ) const;
     510                 :            : 
     511                 :       9064 :     sal_uLong                   GetNumberFormat( const ScAddress& rPos ) const
     512                 :            :                                 {
     513                 :       9064 :                                     return ValidColRow(rPos.Col(),rPos.Row()) ?
     514                 :       9064 :                                         aCol[rPos.Col()].GetNumberFormat( rPos.Row() ) :
     515         [ +  - ]:      18128 :                                         0;
     516                 :            :                                 }
     517                 :            :     sal_uLong                   GetNumberFormat( SCCOL nCol, SCROW nRow ) const;
     518                 :            :     sal_uInt32              GetNumberFormat( SCCOL nCol, SCROW nStartRow, SCROW nEndRow ) const;
     519                 :            :     void                    MergeSelectionPattern( ScMergePatternState& rState,
     520                 :            :                                                 const ScMarkData& rMark, bool bDeep ) const;
     521                 :            :     void                    MergePatternArea( ScMergePatternState& rState, SCCOL nCol1, SCROW nRow1,
     522                 :            :                                                 SCCOL nCol2, SCROW nRow2, bool bDeep ) const;
     523                 :            :     void                    MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner,
     524                 :            :                                             ScLineFlags& rFlags,
     525                 :            :                                             SCCOL nStartCol, SCROW nStartRow,
     526                 :            :                                             SCCOL nEndCol, SCROW nEndRow ) const;
     527                 :            :     void                    ApplyBlockFrame( const SvxBoxItem* pLineOuter,
     528                 :            :                                             const SvxBoxInfoItem* pLineInner,
     529                 :            :                                             SCCOL nStartCol, SCROW nStartRow,
     530                 :            :                                             SCCOL nEndCol, SCROW nEndRow );
     531                 :            : 
     532                 :            :     void        ApplyAttr( SCCOL nCol, SCROW nRow, const SfxPoolItem& rAttr );
     533                 :            :     void        ApplyPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr );
     534                 :            :     void        ApplyPatternArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
     535                 :            :                                   const ScPatternAttr& rAttr, ScEditDataArray* pDataArray = NULL );
     536                 :            :     bool        SetAttrEntries(SCCOL nCol, ScAttrEntry* pData, SCSIZE nSize);
     537                 :            : 
     538                 :          0 :     void        SetPattern( const ScAddress& rPos, const ScPatternAttr& rAttr, bool bPutToPool = false )
     539                 :            :                     {
     540         [ #  # ]:          0 :                         if (ValidColRow(rPos.Col(),rPos.Row()))
     541                 :          0 :                             aCol[rPos.Col()].SetPattern( rPos.Row(), rAttr, bPutToPool );
     542                 :          0 :                     }
     543                 :            :     void        SetPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr, bool bPutToPool = false );
     544                 :            :     void        ApplyPatternIfNumberformatIncompatible( const ScRange& rRange,
     545                 :            :                             const ScPatternAttr& rPattern, short nNewType );
     546                 :            : 
     547                 :            :     void        ApplyStyle( SCCOL nCol, SCROW nRow, const ScStyleSheet& rStyle );
     548                 :            :     void        ApplyStyleArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScStyleSheet& rStyle );
     549                 :            :     void        ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkData& rMark);
     550                 :            :     void        ApplySelectionLineStyle( const ScMarkData& rMark,
     551                 :            :                                     const ::editeng::SvxBorderLine* pLine, bool bColorOnly );
     552                 :            : 
     553                 :            :     const ScStyleSheet* GetStyle( SCCOL nCol, SCROW nRow ) const;
     554                 :            :     const ScStyleSheet* GetSelectionStyle( const ScMarkData& rMark, bool& rFound ) const;
     555                 :            :     const ScStyleSheet* GetAreaStyle( bool& rFound, SCCOL nCol1, SCROW nRow1,
     556                 :            :                                                     SCCOL nCol2, SCROW nRow2 ) const;
     557                 :            : 
     558                 :            :     void        StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, bool bRemoved,
     559                 :            :                                     OutputDevice* pDev,
     560                 :            :                                     double nPPTX, double nPPTY,
     561                 :            :                                     const Fraction& rZoomX, const Fraction& rZoomY );
     562                 :            : 
     563                 :            :     bool        IsStyleSheetUsed( const ScStyleSheet& rStyle, bool bGatherAllStyles ) const;
     564                 :            : 
     565                 :            :     bool        ApplyFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_Int16 nFlags );
     566                 :            :     bool        RemoveFlags( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_Int16 nFlags );
     567                 :            : 
     568                 :            :     void        ApplySelectionCache( SfxItemPoolCache* pCache, const ScMarkData& rMark, ScEditDataArray* pDataArray = NULL );
     569                 :            :     void        DeleteSelection( sal_uInt16 nDelFlag, const ScMarkData& rMark );
     570                 :            : 
     571                 :            :     void        ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark );
     572                 :            :     void        ChangeSelectionIndent( bool bIncrement, const ScMarkData& rMark );
     573                 :            : 
     574                 :        222 :     const ScRange*  GetRepeatColRange() const   { return pRepeatColRange; }
     575                 :        222 :     const ScRange*  GetRepeatRowRange() const   { return pRepeatRowRange; }
     576                 :            :     void            SetRepeatColRange( const ScRange* pNew );
     577                 :            :     void            SetRepeatRowRange( const ScRange* pNew );
     578                 :            : 
     579                 :        613 :     sal_uInt16          GetPrintRangeCount() const          { return static_cast< sal_uInt16 >( aPrintRanges.size() ); }
     580                 :            :     const ScRange*  GetPrintRange(sal_uInt16 nPos) const;
     581                 :            :     /** Returns true, if the sheet is always printed. */
     582                 :        424 :     bool            IsPrintEntireSheet() const          { return bPrintEntireSheet; }
     583                 :            : 
     584                 :            :     /** Removes all print ranges. */
     585                 :            :     void            ClearPrintRanges();
     586                 :            :     /** Adds a new print ranges. */
     587                 :            :     void            AddPrintRange( const ScRange& rNew );
     588                 :            :     /** Marks the specified sheet to be printed completely. Deletes old print ranges! */
     589                 :            :     void            SetPrintEntireSheet();
     590                 :            : 
     591                 :            :     void            FillPrintSaver( ScPrintSaverTab& rSaveTab ) const;
     592                 :            :     void            RestorePrintRanges( const ScPrintSaverTab& rSaveTab );
     593                 :            : 
     594                 :            :     sal_uInt16      GetOptimalColWidth( SCCOL nCol, OutputDevice* pDev,
     595                 :            :                                     double nPPTX, double nPPTY,
     596                 :            :                                     const Fraction& rZoomX, const Fraction& rZoomY,
     597                 :            :                                     bool bFormula, const ScMarkData* pMarkData,
     598                 :            :                                     const ScColWidthParam* pParam );
     599                 :            :     bool        SetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nExtra,
     600                 :            :                                     OutputDevice* pDev,
     601                 :            :                                     double nPPTX, double nPPTY,
     602                 :            :                                     const Fraction& rZoomX, const Fraction& rZoomY,
     603                 :            :                                     bool bForce,
     604                 :            :                                     ScProgress* pOuterProgress = NULL, sal_uLong nProgressStart = 0 );
     605                 :            : 
     606                 :            :     void        SetOptimalHeightOnly(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nExtra,
     607                 :            :                                      OutputDevice* pDev,
     608                 :            :                                      double nPPTX, double nPPTY,
     609                 :            :                                      const Fraction& rZoomX, const Fraction& rZoomY,
     610                 :            :                                      bool bForce,
     611                 :            :                                      ScProgress* pOuterProgress = NULL, sal_uLong nProgressStart = 0 );
     612                 :            : 
     613                 :            :     long        GetNeededSize( SCCOL nCol, SCROW nRow,
     614                 :            :                                     OutputDevice* pDev,
     615                 :            :                                     double nPPTX, double nPPTY,
     616                 :            :                                     const Fraction& rZoomX, const Fraction& rZoomY,
     617                 :            :                                     bool bWidth, bool bTotalSize );
     618                 :            :     void        SetColWidth( SCCOL nCol, sal_uInt16 nNewWidth );
     619                 :            :     void        SetColWidthOnly( SCCOL nCol, sal_uInt16 nNewWidth );
     620                 :            :     void        SetRowHeight( SCROW nRow, sal_uInt16 nNewHeight );
     621                 :            :     bool        SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nNewHeight,
     622                 :            :                                     double nPPTX, double nPPTY );
     623                 :            : 
     624                 :            :     /**
     625                 :            :      * Set specified row height to specified ranges.  Don't check for drawing
     626                 :            :      * objects etc.  Just set the row height.  Nothing else.
     627                 :            :      *
     628                 :            :      * Note that setting a new row height via this function will not
     629                 :            :      * invalidate page breaks.
     630                 :            :      */
     631                 :            :     void        SetRowHeightOnly( SCROW nStartRow, SCROW nEndRow, sal_uInt16 nNewHeight );
     632                 :            : 
     633                 :            :                         // nPPT to test for modification
     634                 :            :     void        SetManualHeight( SCROW nStartRow, SCROW nEndRow, bool bManual );
     635                 :            : 
     636                 :            :     sal_uInt16      GetColWidth( SCCOL nCol ) const;
     637                 :            :     SC_DLLPUBLIC sal_uInt16 GetRowHeight( SCROW nRow, SCROW* pStartRow = NULL, SCROW* pEndRow = NULL, bool bHiddenAsZero = true ) const;
     638                 :            :     sal_uLong       GetRowHeight( SCROW nStartRow, SCROW nEndRow ) const;
     639                 :            :     sal_uLong       GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fScale ) const;
     640                 :            :     sal_uLong       GetColOffset( SCCOL nCol ) const;
     641                 :            :     sal_uLong       GetRowOffset( SCROW nRow ) const;
     642                 :            : 
     643                 :            :     /**
     644                 :            :      * Get the last row such that the height of row 0 to the end row is as
     645                 :            :      * high as possible without exceeding the specified height value.
     646                 :            :      *
     647                 :            :      * @param nHeight maximum desired height
     648                 :            :      *
     649                 :            :      * @return SCROW last row of the range within specified height.
     650                 :            :      */
     651                 :            :     SCROW       GetRowForHeight(sal_uLong nHeight) const;
     652                 :            : 
     653                 :            :     sal_uInt16      GetOriginalWidth( SCCOL nCol ) const;
     654                 :            :     sal_uInt16      GetOriginalHeight( SCROW nRow ) const;
     655                 :            : 
     656                 :            :     sal_uInt16      GetCommonWidth( SCCOL nEndCol ) const;
     657                 :            : 
     658                 :            :     SCROW       GetHiddenRowCount( SCROW nRow ) const;
     659                 :            : 
     660                 :            :     void        ShowCol(SCCOL nCol, bool bShow);
     661                 :            :     void        ShowRow(SCROW nRow, bool bShow);
     662                 :            :     void        DBShowRow(SCROW nRow, bool bShow);
     663                 :            : 
     664                 :            :     void        ShowRows(SCROW nRow1, SCROW nRow2, bool bShow);
     665                 :            :     void        DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow);
     666                 :            : 
     667                 :            :     void        SetRowFlags( SCROW nRow, sal_uInt8 nNewFlags );
     668                 :            :     void        SetRowFlags( SCROW nStartRow, SCROW nEndRow, sal_uInt8 nNewFlags );
     669                 :            : 
     670                 :            :                 /// @return  the index of the last row with any set flags (auto-pagebreak is ignored).
     671                 :            :     SCROW      GetLastFlaggedRow() const;
     672                 :            : 
     673                 :            :                 /// @return  the index of the last changed column (flags and column width, auto pagebreak is ignored).
     674                 :            :     SCCOL      GetLastChangedCol() const;
     675                 :            :                 /// @return  the index of the last changed row (flags and row height, auto pagebreak is ignored).
     676                 :            :     SCROW      GetLastChangedRow() const;
     677                 :            : 
     678                 :            :     bool       IsDataFiltered(SCCOL nColStart, SCROW nRowStart, SCCOL nColEnd, SCROW nRowEnd) const;
     679                 :            :     bool       IsDataFiltered(const ScRange& rRange) const;
     680                 :            :     sal_uInt8       GetColFlags( SCCOL nCol ) const;
     681                 :            :     sal_uInt8       GetRowFlags( SCROW nRow ) const;
     682                 :            : 
     683                 :          4 :     const ScBitMaskCompressedArray< SCROW, sal_uInt8> * GetRowFlagsArray() const
     684                 :          4 :                     { return pRowFlags; }
     685                 :            : 
     686                 :            :     bool        UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, bool bShow );
     687                 :            :     bool        UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, bool bShow );
     688                 :            : 
     689                 :            :     void        UpdatePageBreaks( const ScRange* pUserArea );
     690                 :            :     void        RemoveManualBreaks();
     691                 :            :     bool        HasManualBreaks() const;
     692                 :            :     void        SetRowManualBreaks( const ::std::set<SCROW>& rBreaks );
     693                 :            :     void        SetColManualBreaks( const ::std::set<SCCOL>& rBreaks );
     694                 :            : 
     695                 :            :     void        GetAllRowBreaks(::std::set<SCROW>& rBreaks, bool bPage, bool bManual) const;
     696                 :            :     void        GetAllColBreaks(::std::set<SCCOL>& rBreaks, bool bPage, bool bManual) const;
     697                 :            :     bool        HasRowPageBreak(SCROW nRow) const;
     698                 :            :     bool        HasColPageBreak(SCCOL nCol) const;
     699                 :            :     bool        HasRowManualBreak(SCROW nRow) const;
     700                 :            :     bool        HasColManualBreak(SCCOL nCol) const;
     701                 :            : 
     702                 :            :     /**
     703                 :            :      * Get the row position of the next manual break that occurs at or below
     704                 :            :      * specified row.  When no more manual breaks are present at or below
     705                 :            :      * the specified row, -1 is returned.
     706                 :            :      *
     707                 :            :      * @param nRow row at which the search begins.
     708                 :            :      *
     709                 :            :      * @return SCROW next row position with manual page break, or -1 if no
     710                 :            :      *         more manual breaks are present.
     711                 :            :      */
     712                 :            :     SCROW       GetNextManualBreak(SCROW nRow) const;
     713                 :            : 
     714                 :            :     void        RemoveRowPageBreaks(SCROW nStartRow, SCROW nEndRow);
     715                 :            :     void        RemoveRowBreak(SCROW nRow, bool bPage, bool bManual);
     716                 :            :     void        RemoveColBreak(SCCOL nCol, bool bPage, bool bManual);
     717                 :            :     void        SetRowBreak(SCROW nRow, bool bPage, bool bManual);
     718                 :            :     void        SetColBreak(SCCOL nCol, bool bPage, bool bManual);
     719                 :            :     ::com::sun::star::uno::Sequence<
     720                 :            :         ::com::sun::star::sheet::TablePageBreakData> GetRowBreakData() const;
     721                 :            : 
     722                 :            :     bool        RowHidden(SCROW nRow, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL) const;
     723                 :            :     bool        RowHiddenLeaf(SCROW nRow, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL) const;
     724                 :            :     bool        HasHiddenRows(SCROW nStartRow, SCROW nEndRow) const;
     725                 :            :     bool        ColHidden(SCCOL nCol, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL) const;
     726                 :            :     bool        SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden);
     727                 :            :     bool        SetColHidden(SCCOL nStartCol, SCCOL nEndCol, bool bHidden);
     728                 :            :     void        CopyColHidden(ScTable& rTable, SCCOL nStartCol, SCCOL nEndCol);
     729                 :            :     void        CopyRowHidden(ScTable& rTable, SCROW nStartRow, SCROW nEndRow);
     730                 :            :     void        CopyRowHeight(ScTable& rSrcTable, SCROW nStartRow, SCROW nEndRow, SCROW nSrcOffset);
     731                 :            :     SCROW       FirstVisibleRow(SCROW nStartRow, SCROW nEndRow) const;
     732                 :            :     SCROW       LastVisibleRow(SCROW nStartRow, SCROW nEndRow) const;
     733                 :            :     SCROW       CountVisibleRows(SCROW nStartRow, SCROW nEndRow) const;
     734                 :            :     sal_uInt32  GetTotalRowHeight(SCROW nStartRow, SCROW nEndRow) const;
     735                 :            : 
     736                 :            :     SCCOLROW    LastHiddenColRow(SCCOLROW nPos, bool bCol) const;
     737                 :            : 
     738                 :            :     bool        RowFiltered(SCROW nRow, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL) const;
     739                 :            :     bool        ColFiltered(SCCOL nCol, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL) const;
     740                 :            :     bool        HasFilteredRows(SCROW nStartRow, SCROW nEndRow) const;
     741                 :            :     void        CopyColFiltered(ScTable& rTable, SCCOL nStartCol, SCCOL nEndCol);
     742                 :            :     void        CopyRowFiltered(ScTable& rTable, SCROW nStartRow, SCROW nEndRow);
     743                 :            :     void        SetRowFiltered(SCROW nStartRow, SCROW nEndRow, bool bFiltered);
     744                 :            :     void        SetColFiltered(SCCOL nStartCol, SCCOL nEndCol, bool bFiltered);
     745                 :            :     SCROW       FirstNonFilteredRow(SCROW nStartRow, SCROW nEndRow) const;
     746                 :            :     SCROW       LastNonFilteredRow(SCROW nStartRow, SCROW nEndRow) const;
     747                 :            :     SCROW       CountNonFilteredRows(SCROW nStartRow, SCROW nEndRow) const;
     748                 :            : 
     749                 :            :     bool IsManualRowHeight(SCROW nRow) const;
     750                 :            : 
     751                 :            :     void        SyncColRowFlags();
     752                 :            : 
     753                 :            :     void        StripHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 );
     754                 :            :     void        ExtendHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 );
     755                 :            : 
     756                 :            :     void        Sort(const ScSortParam& rSortParam, bool bKeepQuery);
     757                 :            :     bool        ValidQuery(
     758                 :            :         SCROW nRow, const ScQueryParam& rQueryParam, ScBaseCell* pCell = NULL,
     759                 :            :         bool* pbTestEqualCondition = NULL);
     760                 :            :     void        TopTenQuery( ScQueryParam& );
     761                 :            :     SCSIZE      Query(ScQueryParam& rQueryParam, bool bKeepSub);
     762                 :            :     bool        CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam);
     763                 :            : 
     764                 :            :     void GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, std::vector<ScTypedStrData>& rStrings, bool& rHasDates);
     765                 :            :     void GetFilteredFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, std::vector<ScTypedStrData>& rStrings, bool& rHasDates );
     766                 :            :     bool GetDataEntries(SCCOL nCol, SCROW nRow, std::set<ScTypedStrData>& rStrings, bool bLimit);
     767                 :            : 
     768                 :            :     bool        HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const;
     769                 :            :     bool        HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const;
     770                 :            : 
     771                 :            :     void        DoColResize( SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd );
     772                 :            : 
     773                 :            : 
     774                 :            :     sal_Int32   GetMaxStringLen( SCCOL nCol,
     775                 :            :                                     SCROW nRowStart, SCROW nRowEnd, CharSet eCharSet ) const;
     776                 :            :     xub_StrLen  GetMaxNumberStringLen( sal_uInt16& nPrecision,
     777                 :            :                                        SCCOL nCol,
     778                 :            :                                        SCROW nRowStart, SCROW nRowEnd ) const;
     779                 :            : 
     780                 :            :     void        FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges ) const;
     781                 :            : 
     782                 :            :     void        IncRecalcLevel();
     783                 :            :     void        DecRecalcLevel( bool bUpdateNoteCaptionPos = true );
     784                 :            : 
     785                 :            :     bool        IsSortCollatorGlobal() const;
     786                 :            :     void        InitSortCollator( const ScSortParam& rPar );
     787                 :            :     void        DestroySortCollator();
     788                 :            :     void        SetDrawPageSize( bool bResetStreamValid = true, bool bUpdateNoteCaptionPos = true );
     789                 :            : 
     790                 :            :     void SetRangeName(ScRangeName* pNew);
     791                 :            :     ScRangeName* GetRangeName() const;
     792                 :            :     void        UpdateMoveTab(SCTAB nOldPos,SCTAB nNewPos);
     793                 :            : 
     794                 :            :     ScConditionalFormatList* GetCondFormList();
     795                 :            :     const ScConditionalFormatList* GetCondFormList() const;
     796                 :            :     void SetCondFormList( ScConditionalFormatList* pList );
     797                 :            : 
     798                 :            :     void DeleteConditionalFormat(sal_uLong nOldIndex);
     799                 :            : 
     800                 :            :     sal_uLong          AddCondFormat( ScConditionalFormat* pNew );
     801                 :            : 
     802                 :            : private:
     803                 :            :     void        FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
     804                 :            :                                 sal_uLong nFillCount, FillDir eFillDir, FillCmd eFillCmd,
     805                 :            :                                 FillDateCmd eFillDateCmd,
     806                 :            :                                 double nStepValue, double nMaxValue, sal_uInt16 nMinDigits,
     807                 :            :                                 bool bAttribs, ScProgress* pProgress );
     808                 :            :     void        FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
     809                 :            :                                 FillCmd& rCmd, FillDateCmd& rDateCmd,
     810                 :            :                                 double& rInc, sal_uInt16& rMinDigits,
     811                 :            :                                 ScUserListData*& rListData, sal_uInt16& rListIndex);
     812                 :            :     void        FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
     813                 :            :                         sal_uLong nFillCount, FillDir eFillDir, ScProgress* pProgress );
     814                 :            : 
     815                 :            :     bool        ValidNextPos( SCCOL nCol, SCROW nRow, const ScMarkData& rMark,
     816                 :            :                                 bool bMarked, bool bUnprotected ) const;
     817                 :            : 
     818                 :            :     void        AutoFormatArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
     819                 :            :                                 const ScPatternAttr& rAttr, sal_uInt16 nFormatNo);
     820                 :            :     void        GetAutoFormatAttr(SCCOL nCol, SCROW nRow, sal_uInt16 nIndex, ScAutoFormatData& rData);
     821                 :            :     void        GetAutoFormatFrame(SCCOL nCol, SCROW nRow, sal_uInt16 nFlags, sal_uInt16 nIndex, ScAutoFormatData& rData);
     822                 :            :     bool        SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRow,
     823                 :            :                            const ScMarkData& rMark, rtl::OUString& rUndoStr, ScDocument* pUndoDoc);
     824                 :            :     bool        Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow,
     825                 :            :                        const ScMarkData& rMark, rtl::OUString& rUndoStr, ScDocument* pUndoDoc);
     826                 :            :     bool        SearchAll(const SvxSearchItem& rSearchItem, const ScMarkData& rMark,
     827                 :            :                           ScRangeList& rMatchedRanges, rtl::OUString& rUndoStr, ScDocument* pUndoDoc);
     828                 :            :     bool        Replace(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow,
     829                 :            :                         const ScMarkData& rMark, rtl::OUString& rUndoStr, ScDocument* pUndoDoc);
     830                 :            :     bool        ReplaceAll(
     831                 :            :         const SvxSearchItem& rSearchItem, const ScMarkData& rMark, ScRangeList& rMatchedRanges,
     832                 :            :         rtl::OUString& rUndoStr, ScDocument* pUndoDoc);
     833                 :            : 
     834                 :            :     bool        SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow,
     835                 :            :                             const ScMarkData& rMark);
     836                 :            :     bool        ReplaceStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow,
     837                 :            :                              const ScMarkData& rMark, bool bIsUndo);
     838                 :            :     bool        SearchAllStyle(
     839                 :            :         const SvxSearchItem& rSearchItem, const ScMarkData& rMark, ScRangeList& rMatchedRanges);
     840                 :            :     bool        ReplaceAllStyle(
     841                 :            :         const SvxSearchItem& rSearchItem, const ScMarkData& rMark, ScRangeList& rMatchedRanges,
     842                 :            :         ScDocument* pUndoDoc);
     843                 :            :     bool        SearchAndReplaceEmptyCells(
     844                 :            :                     const SvxSearchItem& rSearchItem,
     845                 :            :                     SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark, ScRangeList& rMatchedRanges,
     846                 :            :                     rtl::OUString& rUndoStr, ScDocument* pUndoDoc);
     847                 :            :     bool        SearchRangeForEmptyCell(const ScRange& rRange,
     848                 :            :                     const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow,
     849                 :            :                     rtl::OUString& rUndoStr);
     850                 :            :     bool        SearchRangeForAllEmptyCells(
     851                 :            :         const ScRange& rRange, const SvxSearchItem& rSearchItem,
     852                 :            :         ScRangeList& rMatchedRanges, rtl::OUString& rUndoStr, ScDocument* pUndoDoc);
     853                 :            : 
     854                 :            :                                 // use the global sort parameter:
     855                 :            :     bool        IsSorted(SCCOLROW nStart, SCCOLROW nEnd) const;
     856                 :            :     void        DecoladeRow( ScSortInfoArray*, SCROW nRow1, SCROW nRow2 );
     857                 :            :     void        SwapCol(SCCOL nCol1, SCCOL nCol2);
     858                 :            :     void        SwapRow(SCROW nRow1, SCROW nRow2);
     859                 :            :     short       CompareCell( sal_uInt16 nSort,
     860                 :            :                     ScBaseCell* pCell1, SCCOL nCell1Col, SCROW nCell1Row,
     861                 :            :                     ScBaseCell* pCell2, SCCOL nCell2Col, SCROW nCell2Row ) const;
     862                 :            :     short       Compare(SCCOLROW nIndex1, SCCOLROW nIndex2) const;
     863                 :            :     short       Compare( ScSortInfoArray*, SCCOLROW nIndex1, SCCOLROW nIndex2) const;
     864                 :            :     ScSortInfoArray*    CreateSortInfoArray( SCCOLROW nInd1, SCCOLROW nInd2 );
     865                 :            :     void        QuickSort( ScSortInfoArray*, SCsCOLROW nLo, SCsCOLROW nHi);
     866                 :            :     void        SortReorder( ScSortInfoArray*, ScProgress& );
     867                 :            : 
     868                 :            :     bool        CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam);
     869                 :            :     bool        CreateStarQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam);
     870                 :            :     void        GetUpperCellString(SCCOL nCol, SCROW nRow, rtl::OUString& rStr);
     871                 :            : 
     872                 :            :     bool        RefVisible(ScFormulaCell* pCell);
     873                 :            : 
     874                 :            :     bool        IsEmptyLine(SCROW nRow, SCCOL nStartCol, SCCOL nEndCol) const;
     875                 :            : 
     876                 :            :     void        IncDate(double& rVal, sal_uInt16& nDayOfMonth, double nStep, FillDateCmd eCmd);
     877                 :            :     void        FillFormula(sal_uLong& nFormulaCounter, bool bFirst, ScFormulaCell* pSrcCell,
     878                 :            :                             SCCOL nDestCol, SCROW nDestRow, bool bLast );
     879                 :            :     void        UpdateInsertTabAbs(SCTAB nNewPos);
     880                 :            :     bool        GetNextSpellingCell(SCCOL& rCol, SCROW& rRow, bool bInSel,
     881                 :            :                                     const ScMarkData& rMark) const;
     882                 :            :     bool        GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark ) const;
     883                 :            :     bool        TestTabRefAbs(SCTAB nTable) const;
     884                 :            :     void        CompileDBFormula();
     885                 :            :     void        CompileDBFormula( bool bCreateFormulaString );
     886                 :            :     void        CompileNameFormula( bool bCreateFormulaString );
     887                 :            :     void        CompileColRowNameFormula();
     888                 :            : 
     889                 :            :     void        StartListening( const ScAddress& rAddress, SvtListener* pListener );
     890                 :            :     void        EndListening( const ScAddress& rAddress, SvtListener* pListener );
     891                 :            :     void        StartAllListeners();
     892                 :            :     void        StartNeededListeners(); // only for cells where NeedsListening()==TRUE
     893                 :            :     void        SetRelNameDirty();
     894                 :            : 
     895                 :            :     void        SetLoadingMedium(bool bLoading);
     896                 :            : 
     897                 :            :     SCSIZE      FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2,
     898                 :            :                             SCCOL nCol, SCROW nAttrRow1, SCROW nAttrRow2, SCSIZE nArrY,
     899                 :            :                             const ScPatternAttr* pPattern, const SfxItemSet* pCondSet );
     900                 :            : 
     901                 :            :     // idle calculation of OutputDevice text width for cell
     902                 :            :     // also invalidates script type, broadcasts for "calc as shown"
     903                 :            :     void        InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo,
     904                 :            :                                      bool bNumFormatChanged, bool bBroadcast );
     905                 :            : 
     906                 :            :     void        SkipFilteredRows(SCROW& rRow, SCROW& rLastNonFilteredRow, bool bForward);
     907                 :            : 
     908                 :            :     /**
     909                 :            :      * In case the cell text goes beyond the column width, move the max column
     910                 :            :      * position to the right.  This is called from ExtendPrintArea.
     911                 :            :      */
     912                 :            :     void        MaybeAddExtraColumn(SCCOL& rCol, SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY);
     913                 :            : 
     914                 :            :     void        CopyPrintRange(const ScTable& rTable);
     915                 :            : 
     916                 :            :     SCCOL       FindNextVisibleColWithContent(SCCOL nCol, bool bRight, SCROW nRow) const;
     917                 :            : 
     918                 :            :     SCCOL       FindNextVisibleCol(SCCOL nCol, bool bRight) const;
     919                 :            : 
     920                 :            :     /**
     921                 :            :      * Use this to iterate through non-empty visible cells in a single column.
     922                 :            :      */
     923                 :            :     class VisibleDataCellIterator
     924                 :            :     {
     925                 :            :     public:
     926                 :            :         static SCROW ROW_NOT_FOUND;
     927                 :            : 
     928                 :            :         explicit VisibleDataCellIterator(ScFlatBoolRowSegments& rRowSegs, ScColumn& rColumn);
     929                 :            :         ~VisibleDataCellIterator();
     930                 :            : 
     931                 :            :         /**
     932                 :            :          * Set the start row position.  In case there is not visible data cell
     933                 :            :          * at the specified row position, it will move to the position of the
     934                 :            :          * first visible data cell below that point.
     935                 :            :          *
     936                 :            :          * @return First visible data cell if found, or NULL otherwise.
     937                 :            :          */
     938                 :            :         ScBaseCell* reset(SCROW nRow);
     939                 :            : 
     940                 :            :         /**
     941                 :            :          * Find the next visible data cell position.
     942                 :            :          *
     943                 :            :          * @return Next visible data cell if found, or NULL otherwise.
     944                 :            :          */
     945                 :            :         ScBaseCell* next();
     946                 :            : 
     947                 :            :         /**
     948                 :            :          * Get the current row position.
     949                 :            :          *
     950                 :            :          * @return Current row position, or ROW_NOT_FOUND if the iterator
     951                 :            :          *         doesn't point to a valid data cell position.
     952                 :            :          */
     953                 :            :         SCROW getRow() const;
     954                 :            : 
     955                 :            :     private:
     956                 :            :         ScFlatBoolRowSegments& mrRowSegs;
     957                 :            :         ScColumn& mrColumn;
     958                 :            :         ScBaseCell* mpCell;
     959                 :            :         SCROW mnCurRow;
     960                 :            :         SCROW mnUBound;
     961                 :            :     };
     962                 :            : };
     963                 :            : 
     964                 :            : 
     965                 :            : #endif
     966                 :            : 
     967                 :            : 
     968                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10