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

Noel Grandin noel.grandin at collabora.co.uk
Wed May 10 10:14:07 UTC 2017


 sc/inc/document.hxx                     |    2 +-
 sc/inc/dpcache.hxx                      |    1 -
 sc/inc/dpfilteredcache.hxx              |    1 -
 sc/inc/dpobject.hxx                     |    2 +-
 sc/inc/dpresfilter.hxx                  |    6 +-----
 sc/inc/dptabsrc.hxx                     |    2 +-
 sc/inc/table.hxx                        |    2 +-
 sc/source/core/data/documen2.cxx        |    4 ++--
 sc/source/core/data/dpcache.cxx         |    6 ------
 sc/source/core/data/dpfilteredcache.cxx |   11 ++---------
 sc/source/core/data/dpobject.cxx        |    4 ++--
 sc/source/core/data/dpresfilter.cxx     |    2 +-
 sc/source/core/data/dptabdat.cxx        |    6 ++----
 sc/source/core/data/dptabres.cxx        |    2 +-
 sc/source/core/data/dptabsrc.cxx        |    4 ++--
 sc/source/core/data/table1.cxx          |    2 +-
 sc/source/ui/view/printfun.cxx          |    2 +-
 17 files changed, 19 insertions(+), 40 deletions(-)

New commits:
commit 95ceaa5c5572690e220cfac80fbaff8eb68dd940
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed May 10 09:15:20 2017 +0200

    loplugin:checkunusedparams in sc(part2)
    
    Change-Id: I1d54d16dbe5648a21baa9bf96444e60fcd034c81
    Reviewed-on: https://gerrit.libreoffice.org/37457
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 27bb73d9ea29..26547d24ced4 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1293,7 +1293,7 @@ public:
     SC_DLLPUBLIC bool           GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow,
                                               bool bNotes = true ) const;
     SC_DLLPUBLIC bool           GetPrintAreaHor( SCTAB nTab, SCROW nStartRow, SCROW nEndRow,
-                                                 SCCOL& rEndCol, bool bNotes ) const;
+                                                 SCCOL& rEndCol ) const;
     SC_DLLPUBLIC bool           GetPrintAreaVer( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol,
                                                  SCROW& rEndRow, bool bNotes ) const;
     void                        InvalidateTableArea();
diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx
index bee579f59a10..60a23002b770 100644
--- a/sc/inc/dpcache.hxx
+++ b/sc/inc/dpcache.hxx
@@ -161,7 +161,6 @@ public:
     sal_uInt32 GetNumberFormat( long nDim ) const;
     bool  IsDateDimension( long nDim ) const ;
     long GetDimMemberCount(long nDim) const;
-    static SCROW GetOrder( long nDim, SCROW nIndex );
 
     const IndexArrayType* GetFieldIndexArray( size_t nDim ) const;
     const ScDPItemDataVec& GetDimMemberValues( SCCOL nDim ) const;
diff --git a/sc/inc/dpfilteredcache.hxx b/sc/inc/dpfilteredcache.hxx
index 9c4a94b0056e..33205ac2dd9a 100644
--- a/sc/inc/dpfilteredcache.hxx
+++ b/sc/inc/dpfilteredcache.hxx
@@ -136,7 +136,6 @@ public:
                      css::uno::Sequence< css::uno::Sequence< css::uno::Any > >& rTabData,
                      const std::unordered_set<sal_Int32>& rRepeatIfEmptyDims);
 
-    static SCROW getOrder(long nDim, SCROW nIndex);
     void clear();
     bool empty() const;
 
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 2baea36b7654..9e02cfd8f0df 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -139,7 +139,7 @@ public:
     void                SetHeaderLayout(bool bUseGrid);
     bool                GetHeaderLayout() const { return mbHeaderLayout;}
 
-    void                SetSheetDesc(const ScSheetSourceDesc& rDesc, bool bFromRefUpdate = false);
+    void                SetSheetDesc(const ScSheetSourceDesc& rDesc);
     void                SetImportDesc(const ScImportSourceDesc& rDesc);
     void                SetServiceData(const ScDPServiceDesc& rDesc);
 
diff --git a/sc/inc/dpresfilter.hxx b/sc/inc/dpresfilter.hxx
index 0ab75d433b88..669710985887 100644
--- a/sc/inc/dpresfilter.hxx
+++ b/sc/inc/dpresfilter.hxx
@@ -112,13 +112,9 @@ public:
      * by row dimension order then by column dimension order.
      *
      * @param rFilter set of filters.
-     * @param nCol column position relative to the top-left cell within the
-     *             data field range.
-     * @param nRow row position relative to the top-left cell within the data
-     *             field range.
      * @param fVal result value, as displayed in the table output.
      */
-    void add(const std::vector<ScDPResultFilter>& rFilter, long nCol, long nRow, double fVal);
+    void add(const std::vector<ScDPResultFilter>& rFilter, double fVal);
 
     void swap(ScDPResultTree& rOther);
 
diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx
index 10277c888a41..c46a164ea89d 100644
--- a/sc/inc/dptabsrc.hxx
+++ b/sc/inc/dptabsrc.hxx
@@ -170,7 +170,7 @@ public:
 
     bool                        SubTotalAllowed(long nColumn);      //! move to ScDPResultData
 
-    ScDPDimension* AddDuplicated(long nSource, const OUString& rNewName);
+    ScDPDimension* AddDuplicated(const OUString& rNewName);
     long                    GetDupCount() const { return nDupCount; }
 
     long                    GetSourceDim(long nDim);
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index dda88eacdd81..ecbdb580f37a 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -524,7 +524,7 @@ public:
     bool        GetTableArea( SCCOL& rEndCol, SCROW& rEndRow ) const;
     bool        GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, bool bNotes ) const;
     bool        GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow,
-                                SCCOL& rEndCol, bool bNotes ) const;
+                                SCCOL& rEndCol ) const;
     bool        GetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol,
                                 SCROW& rEndRow, bool bNotes ) const;
 
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index d9149ff1788f..5cd5bdbb6aa7 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -649,11 +649,11 @@ bool ScDocument::GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow,
 }
 
 bool ScDocument::GetPrintAreaHor( SCTAB nTab, SCROW nStartRow, SCROW nEndRow,
-                                        SCCOL& rEndCol, bool bNotes ) const
+                                        SCCOL& rEndCol ) const
 {
     if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
     {
-        bool bAny = maTabs[nTab]->GetPrintAreaHor( nStartRow, nEndRow, rEndCol, bNotes );
+        bool bAny = maTabs[nTab]->GetPrintAreaHor( nStartRow, nEndRow, rEndCol );
         if (pDrawLayer)
         {
             ScRange aDrawRange(0,nStartRow,nTab, MAXCOL,nEndRow,nTab);
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index e73bee5e80d5..0afeedfe3580 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -1206,12 +1206,6 @@ sal_Int32 ScDPCache::GetGroupType(long nDim) const
     return 0;
 }
 
-SCROW ScDPCache::GetOrder(long /*nDim*/, SCROW nIndex)
-{
-    return nIndex;
-}
-
-
 #if DUMP_PIVOT_TABLE
 
 namespace {
diff --git a/sc/source/core/data/dpfilteredcache.cxx b/sc/source/core/data/dpfilteredcache.cxx
index e43132cf38ee..d4b85c4369e0 100644
--- a/sc/source/core/data/dpfilteredcache.cxx
+++ b/sc/source/core/data/dpfilteredcache.cxx
@@ -170,8 +170,7 @@ void ScDPFilteredCache::fillTable(
             }
 
             SCROW nIndex = getCache().GetItemDataId(nCol, nRow, bRepeatIfEmpty);
-            SCROW nOrder = getOrder(nCol, nIndex);
-            aAdded[nOrder] = nIndex;
+            aAdded[nIndex] = nIndex;
 
             // tdf#96588 - large numbers of trailing identical empty
             // rows generate the same nIndex & nOrder.
@@ -217,8 +216,7 @@ void ScDPFilteredCache::fillTable()
         for (SCROW nRow = 0; nRow < nRowCount; ++nRow)
         {
             SCROW nIndex = getCache().GetItemDataId(nCol, nRow, false);
-            SCROW nOrder = getOrder(nCol, nIndex);
-            aAdded[nOrder] = nIndex;
+            aAdded[nIndex] = nIndex;
         }
         for (SCROW nRow = 0; nRow < nMemCount; ++nRow)
         {
@@ -368,11 +366,6 @@ void ScDPFilteredCache::filterTable(const vector<Criterion>& rCriteria, Sequence
         rTabData[i] = tableData[i];
 }
 
-SCROW ScDPFilteredCache::getOrder(long nDim, SCROW nIndex)
-{
-    return ScDPCache::GetOrder(nDim, nIndex);
-}
-
 void ScDPFilteredCache::clear()
 {
     maFieldEntries.clear();
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 8fee2dd71f45..e012d727a33d 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -419,7 +419,7 @@ const ScRange& ScDPObject::GetOutRange() const
     return aOutRange;
 }
 
-void ScDPObject::SetSheetDesc(const ScSheetSourceDesc& rDesc, bool /*bFromRefUpdate*/)
+void ScDPObject::SetSheetDesc(const ScSheetSourceDesc& rDesc)
 {
     if ( pSheetDesc && rDesc == *pSheetDesc )
         return;             // nothing to do
@@ -1144,7 +1144,7 @@ void ScDPObject::WriteRefsTo( ScDPObject& r ) const
 {
     r.SetOutRange( aOutRange );
     if ( pSheetDesc )
-        r.SetSheetDesc( *pSheetDesc, true );
+        r.SetSheetDesc( *pSheetDesc );
 }
 
 void ScDPObject::GetPositionData(const ScAddress& rPos, DataPilotTablePositionData& rPosData)
diff --git a/sc/source/core/data/dpresfilter.cxx b/sc/source/core/data/dpresfilter.cxx
index 163782a94157..5ba161d7dc82 100644
--- a/sc/source/core/data/dpresfilter.cxx
+++ b/sc/source/core/data/dpresfilter.cxx
@@ -88,7 +88,7 @@ ScDPResultTree::~ScDPResultTree()
 }
 
 void ScDPResultTree::add(
-    const std::vector<ScDPResultFilter>& rFilters, long /*nCol*/, long /*nRow*/, double fVal)
+    const std::vector<ScDPResultFilter>& rFilters, double fVal)
 {
     // TODO: I'll work on the col / row to value node mapping later.
 
diff --git a/sc/source/core/data/dptabdat.cxx b/sc/source/core/data/dptabdat.cxx
index 4b996827ad5a..5e44937bc04f 100644
--- a/sc/source/core/data/dptabdat.cxx
+++ b/sc/source/core/data/dptabdat.cxx
@@ -282,11 +282,9 @@ long ScDPTableData::Compare( long nDim, long nDataId1, long nDataId2)
     if ( getIsDataLayoutDimension(nDim) )
         return 0;
 
-    long n1 = ScDPFilteredCache::getOrder(nDim, nDataId1);
-    long n2 = ScDPFilteredCache::getOrder(nDim, nDataId2);
-    if ( n1 > n2 )
+    if ( nDataId1 > nDataId2 )
         return 1;
-    else if ( n1 == n2 )
+    else if ( nDataId1 == nDataId2 )
         return 0;
     else
         return -1;
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index fb9e71031219..d9d4f35a8cd1 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -2152,7 +2152,7 @@ void ScDPDataMember::FillDataRow(
                 if ( bHasChild || bIsSubTotalRow )
                     rRes.Flags |= sheet::DataResultFlags::SUBTOTAL;
 
-                rFilterCxt.maFilterSet.add(rFilterCxt.maFilters, rFilterCxt.mnCol, rFilterCxt.mnRow, rRes.Value);
+                rFilterCxt.maFilterSet.add(rFilterCxt.maFilters, rRes.Value);
                 rFilterCxt.mnCol += 1;
             }
         }
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index e289ec995822..3537b46863ea 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -312,7 +312,7 @@ void ScDPSource::SetDupCount( long nNew )
     nDupCount = nNew;
 }
 
-ScDPDimension* ScDPSource::AddDuplicated(long /* nSource */, const OUString& rNewName)
+ScDPDimension* ScDPSource::AddDuplicated(const OUString& rNewName)
 {
     OSL_ENSURE( pDimensions.is(), "AddDuplicated without dimensions?" );
 
@@ -1382,7 +1382,7 @@ ScDPDimension* ScDPDimension::CreateCloneObject()
     //TODO: set new name here, or temporary name ???
     OUString aNewName = aName;
 
-    ScDPDimension* pNew = pSource->AddDuplicated( nDim, aNewName );
+    ScDPDimension* pNew = pSource->AddDuplicated( aNewName );
 
     pNew->aName = aNewName;             //TODO: here or in source?
     pNew->nSourceDim = nDim;            //TODO: recursive?
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 577a7859febd..73133b0c1933 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -675,7 +675,7 @@ bool ScTable::GetPrintArea( SCCOL& rEndCol, SCROW& rEndRow, bool bNotes ) const
 }
 
 bool ScTable::GetPrintAreaHor( SCROW nStartRow, SCROW nEndRow,
-                                SCCOL& rEndCol, bool /* bNotes */ ) const
+                                SCCOL& rEndCol ) const
 {
     bool bFound = false;
     SCCOL nMaxX = 0;
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 6c99a32a6605..a4edfae9770d 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -691,7 +691,7 @@ bool ScPrintFunc::AdjustPrintArea( bool bNew )
         if ( bChangeCol && bChangeRow )
             bFound = pDoc->GetPrintArea( nPrintTab, nEndCol, nEndRow, bNotes );
         else if ( bChangeCol )
-            bFound = pDoc->GetPrintAreaHor( nPrintTab, nStartRow, nEndRow, nEndCol, bNotes );
+            bFound = pDoc->GetPrintAreaHor( nPrintTab, nStartRow, nEndRow, nEndCol );
         else if ( bChangeRow )
             bFound = pDoc->GetPrintAreaVer( nPrintTab, nStartCol, nEndCol, nEndRow, bNotes );
 


More information about the Libreoffice-commits mailing list