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

Stephan Bergmann sbergmann at kemper.freedesktop.org
Fri Mar 9 09:22:28 PST 2012


 sc/inc/dpgroup.hxx                   |    2 +-
 sc/inc/dptablecache.hxx              |    2 +-
 sc/source/core/data/dpgroup.cxx      |    7 ++-----
 sc/source/core/data/dptablecache.cxx |   10 ++++++----
 4 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 59e4ac4c3e55562856cdab04435489f9dc67d318
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Mar 9 18:22:00 2012 +0100

    -Werror={deprecated-declarations,sign-compare,unused-parameter}

diff --git a/sc/inc/dpgroup.hxx b/sc/inc/dpgroup.hxx
index 5340b70..be7d39c 100644
--- a/sc/inc/dpgroup.hxx
+++ b/sc/inc/dpgroup.hxx
@@ -107,7 +107,7 @@ public:
     long        GetGroupDim() const     { return nGroupDim; }
     const      String& GetName() const       { return aGroupName; }
 
-    const std::vector< SCROW >&  GetColumnEntries( const ScDPCacheTable&  rCacheTable, const std::vector< SCROW >& rOriginal ) const;
+    const std::vector< SCROW >&  GetColumnEntries( const ScDPCacheTable&  rCacheTable ) const;
     const ScDPGroupItem* GetGroupForData( const ScDPItemData& rData ) const;  // rData = entry in original dim.
     const ScDPGroupItem* GetGroupForName( const ScDPItemData& rName ) const;  // rName = entry in group dim.
     const ScDPGroupItem* GetGroupByIndex( size_t nIndex ) const;
diff --git a/sc/inc/dptablecache.hxx b/sc/inc/dptablecache.hxx
index 62af398..661c5cd 100644
--- a/sc/inc/dptablecache.hxx
+++ b/sc/inc/dptablecache.hxx
@@ -149,7 +149,7 @@ public:
 
     SCROW  GetRowCount() const;
     SCROW  GetItemDataId( sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty ) const;
-    rtl::OUString GetDimensionName(long nDim) const;
+    rtl::OUString GetDimensionName(LabelsType::size_type nDim) const;
     bool IsRowEmpty( SCROW nRow ) const;
     bool IsValid() const;
     bool ValidQuery(SCROW nRow, const ScQueryParam& rQueryParam) const;
diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index a2eb282..98816b0 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -450,7 +450,7 @@ void ScDPGroupDimension::SetGroupDim( long nDim )
 }
 
 const std::vector<SCROW>& ScDPGroupDimension::GetColumnEntries(
-    const ScDPCacheTable& rCacheTable, const std::vector<SCROW>& rOriginal) const
+    const ScDPCacheTable& rCacheTable) const
 {
     if (!maMemberEntries.empty())
         return maMemberEntries;
@@ -635,10 +635,7 @@ const std::vector< SCROW >& ScDPGroupTableData::GetColumnEntries( long  nColumn
         else
         {
             const ScDPGroupDimension& rGroupDim = aGroups[nColumn - nSourceCount];
-            long nSourceDim = rGroupDim.GetSourceDim();
-            // collection is cached at pSourceData, GetColumnEntries can be called every time
-            const  std::vector< SCROW >& rOriginal = pSourceData->GetColumnEntries( nSourceDim );
-            return rGroupDim.GetColumnEntries( GetCacheTable(), rOriginal );
+            return rGroupDim.GetColumnEntries( GetCacheTable() );
         }
     }
 
diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx
index ff12648..c01e132 100644
--- a/sc/source/core/data/dptablecache.cxx
+++ b/sc/source/core/data/dptablecache.cxx
@@ -626,7 +626,9 @@ bool ScDPCache::AddData(long nDim, ScDPItemData* pData, sal_uLong nNumFormat)
     OSL_ENSURE( nDim < mnColumnCount && nDim >=0 , "dimension out of bound" );
 
     // Wrap this instance with scoped pointer to ensure proper deletion.
+    SAL_WNODEPRECATED_DECLARATIONS_PUSH
     auto_ptr<ScDPItemData> p(pData);
+    SAL_WNODEPRECATED_DECLARATIONS_POP
 
     SCROW nIndex = 0;
     Field& rField = maFields[nDim];
@@ -636,7 +638,7 @@ bool ScDPCache::AddData(long nDim, ScDPItemData* pData, sal_uLong nNumFormat)
         rField.maItems.push_back(p);
         rField.maGlobalOrder.insert(
             rField.maGlobalOrder.begin()+nIndex, rField.maItems.size()-1);
-        OSL_ENSURE(rField.maGlobalOrder[nIndex] == rField.maItems.size()-1, "ScDPTableDataCache::AddData ");
+        OSL_ENSURE(rField.maGlobalOrder[nIndex] == sal::static_int_cast<SCROW>(rField.maItems.size())-1, "ScDPTableDataCache::AddData ");
         rField.maData.push_back(rField.maItems.size()-1);
         rField.maNumFormats.push_back(nNumFormat);
     }
@@ -671,12 +673,12 @@ const ScDPCache::GroupItems* ScDPCache::GetGroupItems(long nDim) const
     return NULL;
 }
 
-rtl::OUString ScDPCache::GetDimensionName(long nDim) const
+rtl::OUString ScDPCache::GetDimensionName(LabelsType::size_type nDim) const
 {
     OSL_ENSURE(nDim < maLabelNames.size()-1 , "ScDPTableDataCache::GetDimensionName");
     OSL_ENSURE(maLabelNames.size() == static_cast <sal_uInt16> (mnColumnCount+1), "ScDPTableDataCache::GetDimensionName");
 
-    if ( static_cast<size_t>(nDim+1) < maLabelNames.size() )
+    if ( nDim+1 < maLabelNames.size() )
     {
         return maLabelNames[nDim+1];
     }
@@ -1099,7 +1101,7 @@ SCROW ScDPCache::GetOrder(long nDim, SCROW nIndex) const
         }
     }
 
-    OSL_ENSURE(nIndex >= 0 && nIndex < rField.maIndexOrder.size() , "ScDPTableDataCache::GetOrder");
+    OSL_ENSURE(nIndex >= 0 && sal::static_int_cast<sal_uInt32>(nIndex) < rField.maIndexOrder.size() , "ScDPTableDataCache::GetOrder");
     return rField.maIndexOrder[nIndex];
 }
 


More information about the Libreoffice-commits mailing list