[Libreoffice-commits] .: sc/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Nov 25 02:16:04 PST 2010


 sc/source/filter/xml/XMLStylesExportHelper.cxx |   10 ++++++----
 sc/source/filter/xml/XMLStylesExportHelper.hxx |    8 ++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 203c29b50f09f67666d19b84d26453a5e658e154
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 25 10:15:50 2010 +0000

    cppcheck: methods can be const

diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index 5e20443..4bcdbd5 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -746,18 +746,20 @@ sal_Bool ScRowFormatRanges::GetNext(ScMyRowFormatRange& aFormatRange)
     return sal_False;
 }
 
-sal_Int32 ScRowFormatRanges::GetMaxRows()
+sal_Int32 ScRowFormatRanges::GetMaxRows() const
 {
-    ScMyRowFormatRangesList::iterator aItr(aRowFormatRanges.begin());
-    ScMyRowFormatRangesList::iterator aEndItr(aRowFormatRanges.end());
+    ScMyRowFormatRangesList::const_iterator aItr(aRowFormatRanges.begin());
+    ScMyRowFormatRangesList::const_iterator aEndItr(aRowFormatRanges.end());
     sal_Int32 nMaxRows = MAXROW + 1;
     if (aItr != aEndItr)
+    {
         while (aItr != aEndItr)
         {
             if ((*aItr).nRepeatRows < nMaxRows)
                 nMaxRows = (*aItr).nRepeatRows;
             ++aItr;
         }
+    }
     else
     {
         DBG_ERROR("no ranges found");
@@ -765,7 +767,7 @@ sal_Int32 ScRowFormatRanges::GetMaxRows()
     return nMaxRows;
 }
 
-sal_Int32 ScRowFormatRanges::GetSize()
+sal_Int32 ScRowFormatRanges::GetSize() const
 {
     return nSize;
 }
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.hxx b/sc/source/filter/xml/XMLStylesExportHelper.hxx
index 69ad340..767d6bf 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.hxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.hxx
@@ -139,8 +139,8 @@ public:
         const sal_Int32 nLastRow, const sal_Int32 nLastCol,
         const ScFormatRangeStyles* pCellStyles, ScDocument* pDoc);
 
-    const ScMyDefaultStyleList* GetRowDefaults() { return pRowDefaults; }
-    const ScMyDefaultStyleList* GetColDefaults() { return pColDefaults; }
+    const ScMyDefaultStyleList* GetRowDefaults() const { return pRowDefaults; }
+    const ScMyDefaultStyleList* GetColDefaults() const { return pColDefaults; }
 };
 
 struct ScMyRowFormatRange
@@ -177,8 +177,8 @@ public:
     void Clear();
     void AddRange(ScMyRowFormatRange& rFormatRange, const sal_Int32 nStartRow);
     sal_Bool GetNext(ScMyRowFormatRange& rFormatRange);
-    sal_Int32 GetMaxRows();
-    sal_Int32 GetSize();
+    sal_Int32 GetMaxRows() const;
+    sal_Int32 GetSize() const;
     void Sort();
 };
 


More information about the Libreoffice-commits mailing list