[Libreoffice-commits] .: 2 commits - sc/inc sc/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Fri Aug 10 10:56:36 PDT 2012


 sc/inc/column.hxx               |    2 +-
 sc/inc/table.hxx                |   34 +++++++++++++++++-----------------
 sc/source/core/data/column2.cxx |    2 +-
 sc/source/core/data/table1.cxx  |    8 ++++----
 sc/source/core/data/table2.cxx  |   10 +++++-----
 sc/source/core/data/table3.cxx  |   14 +++++++-------
 sc/source/core/data/table4.cxx  |    2 +-
 7 files changed, 36 insertions(+), 36 deletions(-)

New commits:
commit 26a1aed24cc903ee858fb2d354f5dbb00f6d9969
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Aug 10 19:21:12 2012 +0200

    make more ScTable methods const
    
    Change-Id: I9965a5ee383c4380dc1e75abc6a8df17ed69f6fc

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index d9c18ec..34e05cb 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -366,7 +366,7 @@ public:
     bool GetDataEntries(SCROW nRow, std::set<ScTypedStrData>& rStrings, bool bLimit);
 
     void UpdateInsertTabAbs(SCTAB nNewPos);
-    bool    TestTabRefAbs(SCTAB nTable);
+    bool    TestTabRefAbs(SCTAB nTable) const;
     bool    GetNextSpellingCell(SCROW& nRow, bool bInSel, const ScMarkData& rData) const;
 
     void        RemoveAutoSpellObj();
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 10d25f8..223d38c 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -345,12 +345,12 @@ public:
         @param bForced  True = always create all captions, false = skip when Undo is disabled. */
     void        InitializeNoteCaptions( bool bForced = false );
 
-    bool        TestInsertRow( SCCOL nStartCol, SCCOL nEndCol, SCSIZE nSize );
+    bool        TestInsertRow( SCCOL nStartCol, SCCOL nEndCol, SCSIZE nSize ) const;
     void        InsertRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize );
     void        DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE nSize,
                             bool* pUndoOutline = NULL );
 
-    bool        TestInsertCol( SCROW nStartRow, SCROW nEndRow, SCSIZE nSize );
+    bool        TestInsertCol( SCROW nStartRow, SCROW nEndRow, SCSIZE nSize ) const;
     void        InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize );
     void        DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize,
                             bool* pUndoOutline = NULL );
@@ -422,13 +422,13 @@ public:
                                       SCCOL& rEndCol, SCROW& rEndRow, bool bColumnsOnly ) const;
 
     SCSIZE      GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow,
-                                        SCCOL nEndCol, SCROW nEndRow, ScDirection eDir );
+                                        SCCOL nEndCol, SCROW nEndRow, ScDirection eDir ) const;
 
     void        FindAreaPos( SCCOL& rCol, SCROW& rRow, ScMoveDirection eDirection ) const;
     void        GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY,
                                 bool bMarked, bool bUnprotected, const ScMarkData& rMark ) const;
 
-    void        LimitChartArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow );
+    void        LimitChartArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow ) const;
 
     bool        HasData( SCCOL nCol, SCROW nRow ) const;
     bool        HasStringData( SCCOL nCol, SCROW nRow ) const;
@@ -653,9 +653,9 @@ public:
     sal_uInt16      GetOriginalWidth( SCCOL nCol ) const;
     sal_uInt16      GetOriginalHeight( SCROW nRow ) const;
 
-    sal_uInt16      GetCommonWidth( SCCOL nEndCol );
+    sal_uInt16      GetCommonWidth( SCCOL nEndCol ) const;
 
-    SCROW       GetHiddenRowCount( SCROW nRow );
+    SCROW       GetHiddenRowCount( SCROW nRow ) const;
 
     void        ShowCol(SCCOL nCol, bool bShow);
     void        ShowRow(SCROW nRow, bool bShow);
@@ -765,8 +765,8 @@ public:
     void GetFilteredFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, std::vector<ScTypedStrData>& rStrings, bool& rHasDates );
     bool GetDataEntries(SCCOL nCol, SCROW nRow, std::set<ScTypedStrData>& rStrings, bool bLimit);
 
-    bool        HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
-    bool        HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
+    bool        HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const;
+    bool        HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const;
 
     void        DoColResize( SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd );
 
@@ -777,7 +777,7 @@ public:
                                        SCCOL nCol,
                                        SCROW nRowStart, SCROW nRowEnd ) const;
 
-    void        FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges );
+    void        FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges ) const;
 
     void        IncRecalcLevel();
     void        DecRecalcLevel( bool bUpdateNoteCaptionPos = true );
@@ -871,7 +871,7 @@ private:
 
     bool        RefVisible(ScFormulaCell* pCell);
 
-    bool        IsEmptyLine(SCROW nRow, SCCOL nStartCol, SCCOL nEndCol);
+    bool        IsEmptyLine(SCROW nRow, SCCOL nStartCol, SCCOL nEndCol) const;
 
     void        IncDate(double& rVal, sal_uInt16& nDayOfMonth, double nStep, FillDateCmd eCmd);
     void        FillFormula(sal_uLong& nFormulaCounter, bool bFirst, ScFormulaCell* pSrcCell,
@@ -879,8 +879,8 @@ private:
     void        UpdateInsertTabAbs(SCTAB nNewPos);
     bool        GetNextSpellingCell(SCCOL& rCol, SCROW& rRow, bool bInSel,
                                     const ScMarkData& rMark) const;
-    bool        GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark );
-    bool        TestTabRefAbs(SCTAB nTable);
+    bool        GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark ) const;
+    bool        TestTabRefAbs(SCTAB nTable) const;
     void        CompileDBFormula();
     void        CompileDBFormula( bool bCreateFormulaString );
     void        CompileNameFormula( bool bCreateFormulaString );
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index d381db3..435e8b8 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1006,7 +1006,7 @@ void ScColumn::RemoveEditAttribs( SCROW nStartRow, SCROW nEndRow )
 
 // =========================================================================================
 
-bool ScColumn::TestTabRefAbs(SCTAB nTable)
+bool ScColumn::TestTabRefAbs(SCTAB nTable) const
 {
     bool bRet = false;
     if ( !maItems.empty() )
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 1ca2760..2e1dfbd 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -997,7 +997,7 @@ bool ScTable::ShrinkToUsedDataArea( bool& o_bShrunk, SCCOL& rStartCol, SCROW& rS
 
 
 SCSIZE ScTable::GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow,
-                                        SCCOL nEndCol, SCROW nEndRow, ScDirection eDir )
+                                        SCCOL nEndCol, SCROW nEndRow, ScDirection eDir ) const
 {
     SCSIZE nCount = 0;
     SCCOL nCol;
@@ -1029,7 +1029,7 @@ SCSIZE ScTable::GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow,
     return nCount;
 }
 
-bool ScTable::IsEmptyLine( SCROW nRow, SCCOL nStartCol, SCCOL nEndCol )
+bool ScTable::IsEmptyLine( SCROW nRow, SCCOL nStartCol, SCCOL nEndCol ) const
 {
     bool bFound = false;
     for (SCCOL i=nStartCol; i<=nEndCol && !bFound; i++)
@@ -1038,7 +1038,7 @@ bool ScTable::IsEmptyLine( SCROW nRow, SCCOL nStartCol, SCCOL nEndCol )
     return !bFound;
 }
 
-void ScTable::LimitChartArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow )
+void ScTable::LimitChartArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow ) const
 {
     while ( rStartCol<rEndCol && aCol[rStartCol].IsEmptyBlock(rStartRow,rEndRow) )
         ++rStartCol;
@@ -1379,7 +1379,7 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY,
     }
 }
 
-bool ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark )
+bool ScTable::GetNextMarkedCell( SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark ) const
 {
     const ScMarkArray* pMarkArray = rMark.GetArray();
     OSL_ENSURE(pMarkArray,"GetNextMarkedCell ohne MarkArray");
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index bcc9e38..a2be5f5 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -118,7 +118,7 @@ void ScTable::SetCalcNotification( bool bSet )
 }
 
 
-bool ScTable::TestInsertRow( SCCOL nStartCol, SCCOL nEndCol, SCSIZE nSize )
+bool ScTable::TestInsertRow( SCCOL nStartCol, SCCOL nEndCol, SCSIZE nSize ) const
 {
     bool bTest = true;
 
@@ -297,7 +297,7 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE
 }
 
 
-bool ScTable::TestInsertCol( SCROW nStartRow, SCROW nEndRow, SCSIZE nSize )
+bool ScTable::TestInsertCol( SCROW nStartRow, SCROW nEndRow, SCSIZE nSize ) const
 {
     bool bTest = true;
 
@@ -2549,7 +2549,7 @@ sal_uInt16 ScTable::GetOriginalWidth( SCCOL nCol ) const        // immer die ein
 }
 
 
-sal_uInt16 ScTable::GetCommonWidth( SCCOL nEndCol )
+sal_uInt16 ScTable::GetCommonWidth( SCCOL nEndCol ) const
 {
     //  get the width that is used in the largest continuous column range (up to nEndCol)
 
@@ -2706,7 +2706,7 @@ sal_uInt16 ScTable::GetOriginalHeight( SCROW nRow ) const       // non-0 even if
 //  Spalten-/Zeilen-Flags
 
 
-SCROW ScTable::GetHiddenRowCount( SCROW nRow )
+SCROW ScTable::GetHiddenRowCount( SCROW nRow ) const
 {
     if (!ValidRow(nRow))
         return 0;
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 831756d..ef7b3b6 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2155,7 +2155,7 @@ bool ScTable::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow
     return bValid;
 }
 
-bool ScTable::HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW /* nEndRow */ )
+bool ScTable::HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW /* nEndRow */ ) const
 {
     for (SCCOL nCol=nStartCol; nCol<=nEndCol; nCol++)
     {
@@ -2166,7 +2166,7 @@ bool ScTable::HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCR
     return true;
 }
 
-bool ScTable::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL /* nEndCol */, SCROW nEndRow )
+bool ScTable::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL /* nEndCol */, SCROW nEndRow ) const
 {
     for (SCROW nRow=nStartRow; nRow<=nEndRow; nRow++)
     {
@@ -2290,7 +2290,7 @@ void ScTable::UpdateSelectionFunction( ScFunctionData& rData,
                 aCol[nCol].UpdateAreaFunction( rData, *mpHiddenRows, nStartRow, nEndRow );
 }
 
-void ScTable::FindConditionalFormat( sal_uLong nKey, ScRangeList& rList )
+void ScTable::FindConditionalFormat( sal_uLong nKey, ScRangeList& rList ) const
 {
     SCROW nStartRow = 0, nEndRow = 0;
     for (SCCOL nCol=0; nCol<=MAXCOL; nCol++)
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index fcafa58..525970d 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -2026,7 +2026,7 @@ void ScTable::RemoveAutoSpellObj()
         aCol[i].RemoveAutoSpellObj();
 }
 
-bool ScTable::TestTabRefAbs(SCTAB nTable)
+bool ScTable::TestTabRefAbs(SCTAB nTable) const
 {
     for (SCCOL i=0; i <= MAXCOL; i++)
         if (aCol[i].TestTabRefAbs(nTable))
commit 07616ec2bd3dba7b858d801dbcd94e1089e3532a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Aug 10 03:01:33 2012 +0200

    make more methods const in ScTable
    
    Change-Id: Ib61ab9ea33ea94d6175a2110105849279d1ad440

diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index f4709bf..10d25f8 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -311,7 +311,7 @@ public:
     void        SetValue( SCCOL nCol, SCROW nRow, const double& rVal );
     void        SetError( SCCOL nCol, SCROW nRow, sal_uInt16 nError);
 
-    void        GetString( SCCOL nCol, SCROW nRow, rtl::OUString& rString );
+    void        GetString( SCCOL nCol, SCROW nRow, rtl::OUString& rString ) const;
     void        GetInputString( SCCOL nCol, SCROW nRow, rtl::OUString& rString ) const;
     double      GetValue( const ScAddress& rPos ) const
                     {
@@ -852,15 +852,15 @@ private:
         ScRangeList& rMatchedRanges, rtl::OUString& rUndoStr, ScDocument* pUndoDoc);
 
                                 // use the global sort parameter:
-    bool        IsSorted(SCCOLROW nStart, SCCOLROW nEnd);
+    bool        IsSorted(SCCOLROW nStart, SCCOLROW nEnd) const;
     void        DecoladeRow( ScSortInfoArray*, SCROW nRow1, SCROW nRow2 );
     void        SwapCol(SCCOL nCol1, SCCOL nCol2);
     void        SwapRow(SCROW nRow1, SCROW nRow2);
     short       CompareCell( sal_uInt16 nSort,
                     ScBaseCell* pCell1, SCCOL nCell1Col, SCROW nCell1Row,
-                    ScBaseCell* pCell2, SCCOL nCell2Col, SCROW nCell2Row );
-    short       Compare(SCCOLROW nIndex1, SCCOLROW nIndex2);
-    short       Compare( ScSortInfoArray*, SCCOLROW nIndex1, SCCOLROW nIndex2);
+                    ScBaseCell* pCell2, SCCOL nCell2Col, SCROW nCell2Row ) const;
+    short       Compare(SCCOLROW nIndex1, SCCOLROW nIndex2) const;
+    short       Compare( ScSortInfoArray*, SCCOLROW nIndex1, SCCOLROW nIndex2) const;
     ScSortInfoArray*    CreateSortInfoArray( SCCOLROW nInd1, SCCOLROW nInd2 );
     void        QuickSort( ScSortInfoArray*, SCsCOLROW nLo, SCsCOLROW nHi);
     void        SortReorder( ScSortInfoArray*, ScProgress& );
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index a78e7de..bcc9e38 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1294,7 +1294,7 @@ void ScTable::SetValue( SCCOL nCol, SCROW nRow, const double& rVal )
 }
 
 
-void ScTable::GetString( SCCOL nCol, SCROW nRow, rtl::OUString& rString )
+void ScTable::GetString( SCCOL nCol, SCROW nRow, rtl::OUString& rString ) const
 {
     if (ValidColRow(nCol,nRow))
         aCol[nCol].GetString( nRow, rString );
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index ea49b05..831756d 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -378,7 +378,7 @@ void ScTable::SortReorder( ScSortInfoArray* pArray, ScProgress& rProgress )
 
 short ScTable::CompareCell( sal_uInt16 nSort,
             ScBaseCell* pCell1, SCCOL nCell1Col, SCROW nCell1Row,
-            ScBaseCell* pCell2, SCCOL nCell2Col, SCROW nCell2Row )
+            ScBaseCell* pCell2, SCCOL nCell2Col, SCROW nCell2Row ) const
 {
     short nRes = 0;
 
@@ -490,7 +490,7 @@ short ScTable::CompareCell( sal_uInt16 nSort,
     return nRes;
 }
 
-short ScTable::Compare( ScSortInfoArray* pArray, SCCOLROW nIndex1, SCCOLROW nIndex2 )
+short ScTable::Compare( ScSortInfoArray* pArray, SCCOLROW nIndex1, SCCOLROW nIndex2 ) const
 {
     short nRes;
     sal_uInt16 nSort = 0;
@@ -681,7 +681,7 @@ void ScTable::SwapRow(SCROW nRow1, SCROW nRow2)
     }
 }
 
-short ScTable::Compare(SCCOLROW nIndex1, SCCOLROW nIndex2)
+short ScTable::Compare(SCCOLROW nIndex1, SCCOLROW nIndex2) const
 {
     short nRes;
     sal_uInt16 nSort = 0;
@@ -710,7 +710,7 @@ short ScTable::Compare(SCCOLROW nIndex1, SCCOLROW nIndex2)
     return nRes;
 }
 
-bool ScTable::IsSorted( SCCOLROW nStart, SCCOLROW nEnd )    // ueber aSortParam
+bool ScTable::IsSorted( SCCOLROW nStart, SCCOLROW nEnd ) const   // ueber aSortParam
 {
     for (SCCOLROW i=nStart; i<nEnd; i++)
     {


More information about the Libreoffice-commits mailing list