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

Noel Grandin noel at peralex.com
Tue Apr 12 08:16:58 UTC 2016


 sc/inc/conditio.hxx                               |    2 
 sc/inc/dbdata.hxx                                 |    2 
 sc/inc/document.hxx                               |    4 -
 sc/inc/olinetab.hxx                               |    2 
 sc/inc/userlist.hxx                               |    2 
 sc/source/core/data/colorscale.cxx                |    2 
 sc/source/core/data/documen8.cxx                  |    4 -
 sc/source/core/data/olinetab.cxx                  |    2 
 sc/source/core/inc/addinlis.hxx                   |    4 -
 sc/source/core/opencl/opbase.cxx                  |    2 
 sc/source/core/opencl/opbase.hxx                  |    2 
 sc/source/core/tool/addinlis.cxx                  |    4 -
 sc/source/core/tool/dbdata.cxx                    |    2 
 sc/source/core/tool/interpr5.cxx                  |   58 +++++++++++-----------
 sc/source/core/tool/interpr8.cxx                  |   24 ++++-----
 sc/source/core/tool/scmatrix.cxx                  |   12 ++--
 sc/source/core/tool/userlist.cxx                  |    2 
 sc/source/filter/excel/xecontent.cxx              |    4 -
 sc/source/filter/excel/xeextlst.cxx               |    4 -
 sc/source/filter/excel/xename.cxx                 |   22 ++++----
 sc/source/filter/excel/xilink.cxx                 |    4 -
 sc/source/filter/inc/xecontent.hxx                |    4 -
 sc/source/filter/inc/xeextlst.hxx                 |    4 -
 sc/source/filter/inc/xename.hxx                   |    2 
 sc/source/filter/xml/XMLConverter.cxx             |    2 
 sc/source/filter/xml/XMLConverter.hxx             |    2 
 sc/source/filter/xml/XMLTableMasterPageExport.cxx |    2 
 27 files changed, 90 insertions(+), 90 deletions(-)

New commits:
commit 9760db660a3b9db267a9fc635e2cb1e4136cf5f3
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Apr 12 08:38:35 2016 +0200

    clang-tidy performance-unnecessary-value-param in sc
    
    Change-Id: Ia2255e1e3f7a8834a4b5d2a6bbab2c6dd498d356

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 2d0536b..f4ed5e9 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -107,7 +107,7 @@ public:
     void resetTokenArray(ScTokenArray* pTokens, const ScRange& rRange);
     void addTokenArray(ScTokenArray* pTokens, const ScRange& rRange);
     void stopListening();
-    void setCallback(std::function<void()> aCallbackFunction);
+    void setCallback(const std::function<void()>& aCallbackFunction);
 };
 
 class ScConditionalFormat;
diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index 6778a94..2314663 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -259,7 +259,7 @@ public:
         iterator findByUpperName2(const OUString& rName);
         // Takes ownership of p iff it returns true:
         SAL_WARN_UNUSED_RESULT bool insert(ScDBData* p);
-        void erase(iterator itr);
+        void erase(const iterator& itr);
         bool empty() const;
         size_t size() const;
         bool operator== (const NamedDBs& r) const;
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index bbb525b..ac4f6c5 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -805,12 +805,12 @@ public:
     /** Tries to find a DDE link or creates a new, if not extant.
         @param pResults  If not 0, sets the matrix as DDE link result matrix (also for existing links).
         @return  true = DDE link found; false = Unpredictable error occurred, no DDE link created. */
-    SC_DLLPUBLIC bool            CreateDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem, sal_uInt8 nMode, ScMatrixRef pResults );
+    SC_DLLPUBLIC bool            CreateDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem, sal_uInt8 nMode, const ScMatrixRef& pResults );
     /** Sets a result matrix for the specified DDE link.
         @param nDdePos  Index of the DDE link (does not include other links from link manager).
         @param pResults  The array containing all results of the DDE link (intrusive-ref-counted, do not delete).
         @return  true = DDE link found and matrix set. */
-    bool            SetDdeLinkResultMatrix( size_t nDdePos, ScMatrixRef pResults );
+    bool            SetDdeLinkResultMatrix( size_t nDdePos, const ScMatrixRef& pResults );
 
     SfxBindings*    GetViewBindings();
     SfxObjectShell* GetDocumentShell() const    { return pShell; }
diff --git a/sc/inc/olinetab.hxx b/sc/inc/olinetab.hxx
index 6b48244..02f4d70 100644
--- a/sc/inc/olinetab.hxx
+++ b/sc/inc/olinetab.hxx
@@ -79,7 +79,7 @@ public:
     iterator end();
     const_iterator begin() const;
     const_iterator end() const;
-    void erase(iterator pos);
+    void erase(const iterator& pos);
     bool empty() const;
 
     iterator FindStart(SCCOLROW nMinStart);
diff --git a/sc/inc/userlist.hxx b/sc/inc/userlist.hxx
index b103aee..3c0752a 100644
--- a/sc/inc/userlist.hxx
+++ b/sc/inc/userlist.hxx
@@ -87,7 +87,7 @@ public:
     void clear();
     size_t size() const;
     void push_back(ScUserListData* p);
-    void erase(iterator itr);
+    void erase(const iterator& itr);
 };
 
 #endif
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index bdf306f..71ffe74 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -102,7 +102,7 @@ void ScFormulaListener::addTokenArray(ScTokenArray* pArray, const ScRange& rRang
     startListening(pArray, rRange);
 }
 
-void ScFormulaListener::setCallback(std::function<void()> aCallback)
+void ScFormulaListener::setCallback(const std::function<void()>& aCallback)
 {
     maCallbackFunction = aCallback;
 }
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index dd1a6c7..6e049c1 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -992,7 +992,7 @@ const ScMatrix* ScDocument::GetDdeLinkResultMatrix( size_t nDdePos ) const
     return pDdeLink ? pDdeLink->GetResult() : nullptr;
 }
 
-bool ScDocument::CreateDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem, sal_uInt8 nMode, ScMatrixRef pResults )
+bool ScDocument::CreateDdeLink( const OUString& rAppl, const OUString& rTopic, const OUString& rItem, sal_uInt8 nMode, const ScMatrixRef& pResults )
 {
     /*  Create a DDE link without updating it (i.e. for Excel import), to prevent
         unwanted connections. First try to find existing link. Set result array
@@ -1023,7 +1023,7 @@ bool ScDocument::CreateDdeLink( const OUString& rAppl, const OUString& rTopic, c
     return false;
 }
 
-bool ScDocument::SetDdeLinkResultMatrix( size_t nDdePos, ScMatrixRef pResults )
+bool ScDocument::SetDdeLinkResultMatrix( size_t nDdePos, const ScMatrixRef& pResults )
 {
     if( ScDdeLink* pDdeLink = lclGetDdeLink( GetLinkManager(), nDdePos ) )
     {
diff --git a/sc/source/core/data/olinetab.cxx b/sc/source/core/data/olinetab.cxx
index 5cd71f8..3a4cdc8 100644
--- a/sc/source/core/data/olinetab.cxx
+++ b/sc/source/core/data/olinetab.cxx
@@ -125,7 +125,7 @@ ScOutlineCollection::const_iterator ScOutlineCollection::end() const
     return m_Entries.end();
 }
 
-void ScOutlineCollection::erase(iterator pos)
+void ScOutlineCollection::erase(const iterator& pos)
 {
     m_Entries.erase(pos);
 }
diff --git a/sc/source/core/inc/addinlis.hxx b/sc/source/core/inc/addinlis.hxx
index 6ab8ed6..ef9f7ba 100644
--- a/sc/source/core/inc/addinlis.hxx
+++ b/sc/source/core/inc/addinlis.hxx
@@ -50,10 +50,10 @@ public:
 
     // create Listener and put it into global list
     static ScAddInListener* CreateListener(
-                                css::uno::Reference<css::sheet::XVolatileResult> xVR,
+                                const css::uno::Reference<css::sheet::XVolatileResult>& xVR,
                                 ScDocument* pDoc );
 
-    static ScAddInListener* Get( css::uno::Reference<css::sheet::XVolatileResult> xVR );
+    static ScAddInListener* Get( const css::uno::Reference<css::sheet::XVolatileResult>& xVR );
 
     static void RemoveDocument( ScDocument* pDocument );
 
diff --git a/sc/source/core/opencl/opbase.cxx b/sc/source/core/opencl/opbase.cxx
index 479254b..3fdd3bc 100644
--- a/sc/source/core/opencl/opbase.cxx
+++ b/sc/source/core/opencl/opbase.cxx
@@ -282,7 +282,7 @@ void CheckVariables::CheckSubArgumentIsNan( std::stringstream& ss,
 }
 
 void CheckVariables::CheckSubArgumentIsNan2( std::stringstream& ss,
-    SubArguments& vSubArguments,  int argumentNum, std::string p )
+    SubArguments& vSubArguments,  int argumentNum, const std::string& p )
 {
     int i = argumentNum;
     if (vSubArguments[i]->GetFormulaToken()->GetType() == formula::svDouble)
diff --git a/sc/source/core/opencl/opbase.hxx b/sc/source/core/opencl/opbase.hxx
index f214241..94c1574 100644
--- a/sc/source/core/opencl/opbase.hxx
+++ b/sc/source/core/opencl/opbase.hxx
@@ -219,7 +219,7 @@ public:
         SubArguments& vSubArguments );
     // only check isNan
     static void CheckSubArgumentIsNan2( std::stringstream& ss,
-        SubArguments& vSubArguments, int argumentNum, std::string p );
+        SubArguments& vSubArguments, int argumentNum, const std::string& p );
     static void UnrollDoubleVector( std::stringstream& ss,
         std::stringstream& unrollstr, const formula::DoubleVectorRefToken* pCurDVR,
         int nCurWindowSize );
diff --git a/sc/source/core/tool/addinlis.cxx b/sc/source/core/tool/addinlis.cxx
index 8acd0a3..75b0d5a 100644
--- a/sc/source/core/tool/addinlis.cxx
+++ b/sc/source/core/tool/addinlis.cxx
@@ -33,7 +33,7 @@ SC_SIMPLE_SERVICE_INFO( ScAddInListener, "ScAddInListener", "stardiv.one.sheet.A
 ::std::list<ScAddInListener*> ScAddInListener::aAllListeners;
 
 ScAddInListener* ScAddInListener::CreateListener(
-                        uno::Reference<sheet::XVolatileResult> xVR, ScDocument* pDoc )
+                        const uno::Reference<sheet::XVolatileResult>& xVR, ScDocument* pDoc )
 {
     ScAddInListener* pNew = new ScAddInListener( xVR, pDoc );
 
@@ -58,7 +58,7 @@ ScAddInListener::~ScAddInListener()
     delete pDocs;
 }
 
-ScAddInListener* ScAddInListener::Get( uno::Reference<sheet::XVolatileResult> xVR )
+ScAddInListener* ScAddInListener::Get( const uno::Reference<sheet::XVolatileResult>& xVR )
 {
     ScAddInListener* pLst = nullptr;
     sheet::XVolatileResult* pComp = xVR.get();
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index d368657..fcf56ea 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -1173,7 +1173,7 @@ bool ScDBCollection::NamedDBs::insert(ScDBData* p)
     return r.second;
 }
 
-void ScDBCollection::NamedDBs::erase(iterator itr)
+void ScDBCollection::NamedDBs::erase(const iterator& itr)
 {
     m_DBs.erase(itr);
 }
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index f7da2e7..ae3b4db 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -87,7 +87,7 @@ struct MatrixPow : public ::std::binary_function<double,double,double>
 };
 
 // Multiply n x m Mat A with m x l Mat B to n x l Mat R
-void lcl_MFastMult(ScMatrixRef pA, ScMatrixRef pB, ScMatrixRef pR,
+void lcl_MFastMult(const ScMatrixRef& pA, const ScMatrixRef& pB, const ScMatrixRef& pR,
                    SCSIZE n, SCSIZE m, SCSIZE l)
 {
     double sum;
@@ -1869,7 +1869,7 @@ namespace {
 // Remember, ScMatrix matrices are zero based, index access (column,row).
 
 // <A;B> over all elements; uses the matrices as vectors of length M
-double lcl_GetSumProduct(ScMatrixRef pMatA, ScMatrixRef pMatB, SCSIZE nM)
+double lcl_GetSumProduct(const ScMatrixRef& pMatA, const ScMatrixRef& pMatB, SCSIZE nM)
 {
     double fSum = 0.0;
     for (SCSIZE i=0; i<nM; i++)
@@ -1880,7 +1880,7 @@ double lcl_GetSumProduct(ScMatrixRef pMatA, ScMatrixRef pMatB, SCSIZE nM)
 // Special version for use within QR decomposition.
 // Euclidean norm of column index C starting in row index R;
 // matrix A has count N rows.
-double lcl_GetColumnEuclideanNorm(ScMatrixRef pMatA, SCSIZE nC, SCSIZE nR, SCSIZE nN)
+double lcl_GetColumnEuclideanNorm(const ScMatrixRef& pMatA, SCSIZE nC, SCSIZE nR, SCSIZE nN)
 {
     double fNorm = 0.0;
     for (SCSIZE row=nR; row<nN; row++)
@@ -1890,7 +1890,7 @@ double lcl_GetColumnEuclideanNorm(ScMatrixRef pMatA, SCSIZE nC, SCSIZE nR, SCSIZ
 
 // Euclidean norm of row index R starting in column index C;
 // matrix A has count N columns.
-double lcl_TGetColumnEuclideanNorm(ScMatrixRef pMatA, SCSIZE nR, SCSIZE nC, SCSIZE nN)
+double lcl_TGetColumnEuclideanNorm(const ScMatrixRef& pMatA, SCSIZE nR, SCSIZE nC, SCSIZE nN)
 {
     double fNorm = 0.0;
     for (SCSIZE col=nC; col<nN; col++)
@@ -1901,7 +1901,7 @@ double lcl_TGetColumnEuclideanNorm(ScMatrixRef pMatA, SCSIZE nR, SCSIZE nC, SCSI
 // Special version for use within QR decomposition.
 // Maximum norm of column index C starting in row index R;
 // matrix A has count N rows.
-double lcl_GetColumnMaximumNorm(ScMatrixRef pMatA, SCSIZE nC, SCSIZE nR, SCSIZE nN)
+double lcl_GetColumnMaximumNorm(const ScMatrixRef& pMatA, SCSIZE nC, SCSIZE nR, SCSIZE nN)
 {
     double fNorm = 0.0;
     for (SCSIZE row=nR; row<nN; row++)
@@ -1912,7 +1912,7 @@ double lcl_GetColumnMaximumNorm(ScMatrixRef pMatA, SCSIZE nC, SCSIZE nR, SCSIZE
 
 // Maximum norm of row index R starting in col index C;
 // matrix A has count N columns.
-double lcl_TGetColumnMaximumNorm(ScMatrixRef pMatA, SCSIZE nR, SCSIZE nC, SCSIZE nN)
+double lcl_TGetColumnMaximumNorm(const ScMatrixRef& pMatA, SCSIZE nR, SCSIZE nC, SCSIZE nN)
 {
     double fNorm = 0.0;
     for (SCSIZE col=nC; col<nN; col++)
@@ -1924,8 +1924,8 @@ double lcl_TGetColumnMaximumNorm(ScMatrixRef pMatA, SCSIZE nR, SCSIZE nC, SCSIZE
 // Special version for use within QR decomposition.
 // <A(Ca);B(Cb)> starting in row index R;
 // Ca and Cb are indices of columns, matrices A and B have count N rows.
-double lcl_GetColumnSumProduct(ScMatrixRef pMatA, SCSIZE nCa,
-                               ScMatrixRef pMatB, SCSIZE nCb, SCSIZE nR, SCSIZE nN)
+double lcl_GetColumnSumProduct(const ScMatrixRef& pMatA, SCSIZE nCa,
+                               const ScMatrixRef& pMatB, SCSIZE nCb, SCSIZE nR, SCSIZE nN)
 {
     double fResult = 0.0;
     for (SCSIZE row=nR; row<nN; row++)
@@ -1935,8 +1935,8 @@ double lcl_GetColumnSumProduct(ScMatrixRef pMatA, SCSIZE nCa,
 
 // <A(Ra);B(Rb)> starting in column index C;
 // Ra and Rb are indices of rows, matrices A and B have count N columns.
-double lcl_TGetColumnSumProduct(ScMatrixRef pMatA, SCSIZE nRa,
-                                ScMatrixRef pMatB, SCSIZE nRb, SCSIZE nC, SCSIZE nN)
+double lcl_TGetColumnSumProduct(const ScMatrixRef& pMatA, SCSIZE nRa,
+                                const ScMatrixRef& pMatB, SCSIZE nRb, SCSIZE nC, SCSIZE nN)
 {
     double fResult = 0.0;
     for (SCSIZE col=nC; col<nN; col++)
@@ -1963,7 +1963,7 @@ double lcl_GetSign(double fValue)
  * The function returns false, if calculation breaks. But because of round-off
  * errors singularity is often not detected.
  */
-bool lcl_CalculateQRdecomposition(ScMatrixRef pMatA,
+bool lcl_CalculateQRdecomposition(const ScMatrixRef& pMatA,
                                   ::std::vector< double>& pVecR, SCSIZE nK, SCSIZE nN)
 {
     // ScMatrix matrices are zero based, index access (column,row)
@@ -1997,7 +1997,7 @@ bool lcl_CalculateQRdecomposition(ScMatrixRef pMatA,
 }
 
 // same with transposed matrix A, N is count of columns, K count of rows
-bool lcl_TCalculateQRdecomposition(ScMatrixRef pMatA,
+bool lcl_TCalculateQRdecomposition(const ScMatrixRef& pMatA,
                                    ::std::vector< double>& pVecR, SCSIZE nK, SCSIZE nN)
 {
     double fSum ;
@@ -2038,8 +2038,8 @@ bool lcl_TCalculateQRdecomposition(ScMatrixRef pMatA,
  * index C. A is the result of the QR decomposition as obtained from
  * lcl_CaluclateQRdecomposition.
  */
-void lcl_ApplyHouseholderTransformation(ScMatrixRef pMatA, SCSIZE nC,
-                                        ScMatrixRef pMatY, SCSIZE nN)
+void lcl_ApplyHouseholderTransformation(const ScMatrixRef& pMatA, SCSIZE nC,
+                                        const ScMatrixRef& pMatY, SCSIZE nN)
 {
     // ScMatrix matrices are zero based, index access (column,row)
     double fDenominator = lcl_GetColumnSumProduct(pMatA, nC, pMatA, nC, nC, nN);
@@ -2051,8 +2051,8 @@ void lcl_ApplyHouseholderTransformation(ScMatrixRef pMatA, SCSIZE nC,
 }
 
 // Same with transposed matrices A and Y.
-void lcl_TApplyHouseholderTransformation(ScMatrixRef pMatA, SCSIZE nR,
-                                          ScMatrixRef pMatY, SCSIZE nN)
+void lcl_TApplyHouseholderTransformation(const ScMatrixRef& pMatA, SCSIZE nR,
+                                          const ScMatrixRef& pMatY, SCSIZE nN)
 {
     // ScMatrix matrices are zero based, index access (column,row)
     double fDenominator = lcl_TGetColumnSumProduct(pMatA, nR, pMatA, nR, nR, nN);
@@ -2069,8 +2069,8 @@ void lcl_TApplyHouseholderTransformation(ScMatrixRef pMatA, SCSIZE nR,
  * 0 to K-1; elements on index>=K are ignored. Vector R must not have zero
  * elements, no check is done.
  */
-void lcl_SolveWithUpperRightTriangle(ScMatrixRef pMatA,
-                        ::std::vector< double>& pVecR, ScMatrixRef pMatS,
+void lcl_SolveWithUpperRightTriangle(const ScMatrixRef& pMatA,
+                        ::std::vector< double>& pVecR, const ScMatrixRef& pMatS,
                         SCSIZE nK, bool bIsTransposed)
 {
     // ScMatrix matrices are zero based, index access (column,row)
@@ -2095,8 +2095,8 @@ void lcl_SolveWithUpperRightTriangle(ScMatrixRef pMatA,
  * index 0 to K-1; elements on index>=K are ignored. Vector R must not have
  * zero elements, no check is done.
  */
-void lcl_SolveWithLowerLeftTriangle(ScMatrixRef pMatA,
-                                    ::std::vector< double>& pVecR, ScMatrixRef pMatT,
+void lcl_SolveWithLowerLeftTriangle(const ScMatrixRef& pMatA,
+                                    ::std::vector< double>& pVecR, const ScMatrixRef& pMatT,
                                     SCSIZE nK, bool bIsTransposed)
 {
     // ScMatrix matrices are zero based, index access (column,row)
@@ -2120,9 +2120,9 @@ void lcl_SolveWithLowerLeftTriangle(ScMatrixRef pMatA,
  * given as matrix with at least index 0 to K-1; elements on index>=K are
  * not used.
  */
-void lcl_ApplyUpperRightTriangle(ScMatrixRef pMatA,
-                                 ::std::vector< double>& pVecR, ScMatrixRef pMatB,
-                                 ScMatrixRef pMatZ, SCSIZE nK, bool bIsTransposed)
+void lcl_ApplyUpperRightTriangle(const ScMatrixRef& pMatA,
+                                 ::std::vector< double>& pVecR, const ScMatrixRef& pMatB,
+                                 const ScMatrixRef& pMatZ, SCSIZE nK, bool bIsTransposed)
 {
     // ScMatrix matrices are zero based, index access (column,row)
     for (SCSIZE row = 0; row < nK; row++)
@@ -2137,7 +2137,7 @@ void lcl_ApplyUpperRightTriangle(ScMatrixRef pMatA,
     }
 }
 
-double lcl_GetMeanOverAll(ScMatrixRef pMat, SCSIZE nN)
+double lcl_GetMeanOverAll(const ScMatrixRef& pMat, SCSIZE nN)
 {
     double fSum = 0.0;
     for (SCSIZE i=0 ; i<nN; i++)
@@ -2147,7 +2147,7 @@ double lcl_GetMeanOverAll(ScMatrixRef pMat, SCSIZE nN)
 
 // Calculates means of the columns of matrix X. X is a RxC matrix;
 // ResMat is a 1xC matrix (=row).
-void lcl_CalculateColumnMeans(ScMatrixRef pX, ScMatrixRef pResMat,
+void lcl_CalculateColumnMeans(const ScMatrixRef& pX, const ScMatrixRef& pResMat,
                               SCSIZE nC, SCSIZE nR)
 {
     for (SCSIZE i=0; i < nC; i++)
@@ -2161,7 +2161,7 @@ void lcl_CalculateColumnMeans(ScMatrixRef pX, ScMatrixRef pResMat,
 
 // Calculates means of the rows of matrix X. X is a RxC matrix;
 // ResMat is a Rx1 matrix (=column).
-void lcl_CalculateRowMeans(ScMatrixRef pX, ScMatrixRef pResMat,
+void lcl_CalculateRowMeans(const ScMatrixRef& pX, const ScMatrixRef& pResMat,
                            SCSIZE nC, SCSIZE nR)
 {
     for (SCSIZE k=0; k < nR; k++)
@@ -2173,7 +2173,7 @@ void lcl_CalculateRowMeans(ScMatrixRef pX, ScMatrixRef pResMat,
     }
 }
 
-void lcl_CalculateColumnsDelta(ScMatrixRef pMat, ScMatrixRef pColumnMeans,
+void lcl_CalculateColumnsDelta(const ScMatrixRef& pMat, const ScMatrixRef& pColumnMeans,
                                SCSIZE nC, SCSIZE nR)
 {
     for (SCSIZE i = 0; i < nC; i++)
@@ -2182,7 +2182,7 @@ void lcl_CalculateColumnsDelta(ScMatrixRef pMat, ScMatrixRef pColumnMeans,
                              (pMat->GetDouble(i,k) , pColumnMeans->GetDouble(i) ) , i, k);
 }
 
-void lcl_CalculateRowsDelta(ScMatrixRef pMat, ScMatrixRef pRowMeans,
+void lcl_CalculateRowsDelta(const ScMatrixRef& pMat, const ScMatrixRef& pRowMeans,
                             SCSIZE nC, SCSIZE nR)
 {
     for (SCSIZE k = 0; k < nR; k++)
@@ -2194,7 +2194,7 @@ void lcl_CalculateRowsDelta(ScMatrixRef pMat, ScMatrixRef pRowMeans,
 // Case1 = simple regression
 // MatX = X - MeanX, MatY = Y - MeanY, y - haty = (y - MeanY) - (haty - MeanY)
 // = (y-MeanY)-((slope*x+a)-(slope*MeanX+a)) = (y-MeanY)-slope*(x-MeanX)
-double lcl_GetSSresid(ScMatrixRef pMatX, ScMatrixRef pMatY, double fSlope,
+double lcl_GetSSresid(const ScMatrixRef& pMatX, const ScMatrixRef& pMatY, double fSlope,
                       SCSIZE nN)
 {
     double fSum = 0.0;
diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index 51e7f74..aa3f7e5 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -114,15 +114,15 @@ public:
     ScETSForecastCalculation( SCSIZE nSize, SvNumberFormatter* pFormatter );
     ~ScETSForecastCalculation();
 
-    bool PreprocessDataRange( ScMatrixRef rMatX, ScMatrixRef rMatY, int& rSmplInPrd,
-                              bool bDataCompletion, int nAggregation, ScMatrixRef rTMat,
+    bool PreprocessDataRange( const ScMatrixRef& rMatX, const ScMatrixRef& rMatY, int& rSmplInPrd,
+                              bool bDataCompletion, int nAggregation, const ScMatrixRef& rTMat,
                               ScETSType eETSType );
     sal_uInt16 GetError() { return mnErrorValue; };
-    bool GetForecastRange( ScMatrixRef rTMat, ScMatrixRef rFcMat );
-    bool GetStatisticValue( ScMatrixRef rTypeMat, ScMatrixRef rStatMat );
+    bool GetForecastRange( const ScMatrixRef& rTMat, const ScMatrixRef& rFcMat );
+    bool GetStatisticValue( const ScMatrixRef& rTypeMat, const ScMatrixRef& rStatMat );
     bool GetSamplesInPeriod( double& rVal );
-    bool GetEDSPredictionIntervals( ScMatrixRef rTMat, ScMatrixRef rPIMat, double fPILevel );
-    bool GetETSPredictionIntervals( ScMatrixRef rTMat, ScMatrixRef rPIMat, double fPILevel );
+    bool GetEDSPredictionIntervals( const ScMatrixRef& rTMat, const ScMatrixRef& rPIMat, double fPILevel );
+    bool GetETSPredictionIntervals( const ScMatrixRef& rTMat, const ScMatrixRef& rPIMat, double fPILevel );
 };
 
 ScETSForecastCalculation::ScETSForecastCalculation( SCSIZE nSize, SvNumberFormatter* pFormatter )
@@ -159,8 +159,8 @@ ScETSForecastCalculation::~ScETSForecastCalculation()
     delete[] mpForecast;
 }
 
-bool ScETSForecastCalculation::PreprocessDataRange( ScMatrixRef rMatX, ScMatrixRef rMatY, int& rSmplInPrd,
-                                                    bool bDataCompletion, int nAggregation, ScMatrixRef rTMat,
+bool ScETSForecastCalculation::PreprocessDataRange( const ScMatrixRef& rMatX, const ScMatrixRef& rMatY, int& rSmplInPrd,
+                                                    bool bDataCompletion, int nAggregation, const ScMatrixRef& rTMat,
                                                     ScETSType eETSType )
 {
     bEDS = ( rSmplInPrd == 0 );
@@ -898,7 +898,7 @@ bool ScETSForecastCalculation::GetForecast( double fTarget, double& rForecast )
     return true;
 }
 
-bool ScETSForecastCalculation::GetForecastRange( ScMatrixRef rTMat, ScMatrixRef rFcMat )
+bool ScETSForecastCalculation::GetForecastRange( const ScMatrixRef& rTMat, const ScMatrixRef& rFcMat )
 {
     SCSIZE nC, nR;
     rTMat->GetDimensions( nC, nR );
@@ -922,7 +922,7 @@ bool ScETSForecastCalculation::GetForecastRange( ScMatrixRef rTMat, ScMatrixRef
     return true;
 }
 
-bool ScETSForecastCalculation::GetStatisticValue( ScMatrixRef rTypeMat, ScMatrixRef rStatMat )
+bool ScETSForecastCalculation::GetStatisticValue( const ScMatrixRef& rTypeMat, const ScMatrixRef& rStatMat )
 {
     if ( !initCalc() )
         return false;
@@ -984,7 +984,7 @@ double ScETSForecastCalculation::RandDev()
              ::comphelper::rng::uniform_real_distribution( 0.5, 1.0 ) ) );
 }
 
-bool ScETSForecastCalculation::GetETSPredictionIntervals( ScMatrixRef rTMat, ScMatrixRef rPIMat, double fPILevel )
+bool ScETSForecastCalculation::GetETSPredictionIntervals( const ScMatrixRef& rTMat, const ScMatrixRef& rPIMat, double fPILevel )
 {
     if ( !initCalc() )
         return false;
@@ -1115,7 +1115,7 @@ bool ScETSForecastCalculation::GetETSPredictionIntervals( ScMatrixRef rTMat, ScM
 }
 
 
-bool ScETSForecastCalculation::GetEDSPredictionIntervals( ScMatrixRef rTMat, ScMatrixRef rPIMat, double fPILevel )
+bool ScETSForecastCalculation::GetEDSPredictionIntervals( const ScMatrixRef& rTMat, const ScMatrixRef& rPIMat, double fPILevel )
 {
     if ( !initCalc() )
         return false;
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 52189cd..849043c 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -302,8 +302,8 @@ public:
     void ApplyOperation(T aOp, ScMatrixImpl& rMat);
 
     void ExecuteOperation(const std::pair<size_t, size_t>& rStartPos,
-            const std::pair<size_t, size_t>& rEndPos, ScFullMatrix::DoubleOpFunction aDoubleFunc,
-            ScFullMatrix::BoolOpFunction aBoolFunc, ScFullMatrix::StringOpFunction aStringFunc) const;
+            const std::pair<size_t, size_t>& rEndPos, const ScFullMatrix::DoubleOpFunction& aDoubleFunc,
+            const ScFullMatrix::BoolOpFunction& aBoolFunc, const ScFullMatrix::StringOpFunction& aStringFunc) const;
 
     template<typename T>
     std::vector<ScMatrix::IterateResult> ApplyCollectOperation(bool bTextAsZero, const std::vector<std::unique_ptr<T>>& aOp);
@@ -1360,7 +1360,7 @@ struct MaxOp
 
     static double boolValue(
         MatrixImplType::boolean_block_type::const_iterator it,
-        MatrixImplType::boolean_block_type::const_iterator itEnd)
+        const MatrixImplType::boolean_block_type::const_iterator& itEnd)
     {
         // If the array has at least one true value, the maximum value is 1.
         it = std::find(it, itEnd, true);
@@ -1378,7 +1378,7 @@ struct MinOp
 
     static double boolValue(
         MatrixImplType::boolean_block_type::const_iterator it,
-        MatrixImplType::boolean_block_type::const_iterator itEnd)
+        const MatrixImplType::boolean_block_type::const_iterator& itEnd)
     {
         // If the array has at least one false value, the minimum value is 0.
         it = std::find(it, itEnd, false);
@@ -2322,8 +2322,8 @@ private:
 }
 
 void ScMatrixImpl::ExecuteOperation(const std::pair<size_t, size_t>& rStartPos,
-        const std::pair<size_t, size_t>& rEndPos, ScMatrix::DoubleOpFunction aDoubleFunc,
-        ScMatrix::BoolOpFunction aBoolFunc, ScMatrix::StringOpFunction aStringFunc) const
+        const std::pair<size_t, size_t>& rEndPos, const ScMatrix::DoubleOpFunction& aDoubleFunc,
+        const ScMatrix::BoolOpFunction& aBoolFunc, const ScMatrix::StringOpFunction& aStringFunc) const
 {
     WalkElementBlockOperation aFunc(maMat.size().row, maMat.size().column,
             aDoubleFunc, aBoolFunc, aStringFunc);
diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx
index b9206f4..e84a2db 100644
--- a/sc/source/core/tool/userlist.cxx
+++ b/sc/source/core/tool/userlist.cxx
@@ -362,7 +362,7 @@ void ScUserList::push_back(ScUserListData* p)
     maData.push_back(std::unique_ptr<ScUserListData>(p));
 }
 
-void ScUserList::erase(iterator itr)
+void ScUserList::erase(const iterator& itr)
 {
     maData.erase(itr);
 }
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index f8162b4..914c657 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -234,7 +234,7 @@ XclExpSst::~XclExpSst()
 {
 }
 
-sal_uInt32 XclExpSst::Insert( XclExpStringRef xString )
+sal_uInt32 XclExpSst::Insert( const XclExpStringRef& xString )
 {
     return mxImpl->Insert( xString );
 }
@@ -545,7 +545,7 @@ XclExpLabelranges::XclExpLabelranges( const XclExpRoot& rRoot ) :
 }
 
 void XclExpLabelranges::FillRangeList( ScRangeList& rScRanges,
-        ScRangePairListRef xLabelRangesRef, SCTAB nScTab )
+        const ScRangePairListRef& xLabelRangesRef, SCTAB nScTab )
 {
     for ( size_t i = 0, nPairs = xLabelRangesRef->size(); i < nPairs; ++i )
     {
diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx
index c8f9d8b..c9a3214 100644
--- a/sc/source/filter/excel/xeextlst.cxx
+++ b/sc/source/filter/excel/xeextlst.cxx
@@ -429,7 +429,7 @@ void XclExpExtCondFormat::SaveXml( XclExpXmlStream& rStrm )
     rWorksheet->endElement( XML_ext );
 }
 
-void XclExpExtCondFormat::AddRecord( XclExpExtConditionalFormattingRef aEntry )
+void XclExpExtCondFormat::AddRecord( const XclExpExtConditionalFormattingRef& aEntry )
 {
     maCF.AppendRecord( aEntry );
 }
@@ -448,7 +448,7 @@ void XclExtLst::SaveXml( XclExpXmlStream& rStrm )
     rWorksheet->endElement( XML_extLst );
 }
 
-void XclExtLst::AddRecord( XclExpExtRef aEntry )
+void XclExtLst::AddRecord( const XclExpExtRef& aEntry )
 {
     maExtEntries.AppendRecord( aEntry );
 }
diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index 56da620..8c03f9e 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -46,7 +46,7 @@ public:
     explicit            XclExpName( const XclExpRoot& rRoot, sal_Unicode cBuiltIn );
 
     /** Sets a token array containing the definition of this name. */
-    void                SetTokenArray( XclTokenArrayRef xTokArr );
+    void                SetTokenArray( const XclTokenArrayRef& xTokArr );
     /** Changes this defined name to be local on the specified Calc sheet. */
     void                SetLocalTab( SCTAB nScTab );
     /** Hides or unhides the defined name. */
@@ -117,10 +117,10 @@ public:
     sal_uInt16          InsertName( SCTAB nTab, sal_uInt16 nScNameIdx );
 
     /** Inserts a new built-in defined name. */
-    sal_uInt16          InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, SCTAB nScTab, const ScRangeList& aRangeList );
-    sal_uInt16          InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, const ScRange& aRange );
+    sal_uInt16          InsertBuiltInName( sal_Unicode cBuiltIn, const XclTokenArrayRef& xTokArr, SCTAB nScTab, const ScRangeList& aRangeList );
+    sal_uInt16          InsertBuiltInName( sal_Unicode cBuiltIn, const XclTokenArrayRef& xTokArr, const ScRange& aRange );
     /** Inserts a new defined name. Sets another unused name, if rName already exists. */
-    sal_uInt16          InsertUniqueName( const OUString& rName, XclTokenArrayRef xTokArr, SCTAB nScTab );
+    sal_uInt16          InsertUniqueName( const OUString& rName, const XclTokenArrayRef& xTokArr, SCTAB nScTab );
     /** Returns index of an existing name, or creates a name without definition. */
     sal_uInt16          InsertRawName( const OUString& rName );
     /** Searches or inserts a defined name describing a macro name.
@@ -162,7 +162,7 @@ private:
 
     /** Appends a new NAME record to the record list.
         @return  The 1-based NAME record index used elsewhere in the Excel file. */
-    sal_uInt16          Append( XclExpNameRef xName );
+    sal_uInt16          Append( const XclExpNameRef& xName );
     /** Creates a new NAME record for the passed user-defined name.
         @return  The 1-based NAME record index used elsewhere in the Excel file. */
     sal_uInt16          CreateName( SCTAB nTab, const ScRangeData& rRangeData );
@@ -226,7 +226,7 @@ XclExpName::XclExpName( const XclExpRoot& rRoot, sal_Unicode cBuiltIn ) :
     }
 }
 
-void XclExpName::SetTokenArray( XclTokenArrayRef xTokArr )
+void XclExpName::SetTokenArray( const XclTokenArrayRef& xTokArr )
 {
     mxTokArr = xTokArr;
 }
@@ -364,7 +364,7 @@ sal_uInt16 XclExpNameManagerImpl::InsertName( SCTAB nTab, sal_uInt16 nScNameIdx
     return nNameIdx;
 }
 
-sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, const ScRange& aRange )
+sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, const XclTokenArrayRef& xTokArr, const ScRange& aRange )
 {
     XclExpNameRef xName( new XclExpName( GetRoot(), cBuiltIn ) );
     xName->SetTokenArray( xTokArr );
@@ -374,7 +374,7 @@ sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, XclTo
     return Append( xName );
 }
 
-sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, XclTokenArrayRef xTokArr, SCTAB nScTab, const ScRangeList& rRangeList )
+sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, const XclTokenArrayRef& xTokArr, SCTAB nScTab, const ScRangeList& rRangeList )
 {
     XclExpNameRef xName( new XclExpName( GetRoot(), cBuiltIn ) );
     xName->SetTokenArray( xTokArr );
@@ -386,7 +386,7 @@ sal_uInt16 XclExpNameManagerImpl::InsertBuiltInName( sal_Unicode cBuiltIn, XclTo
 }
 
 sal_uInt16 XclExpNameManagerImpl::InsertUniqueName(
-        const OUString& rName, XclTokenArrayRef xTokArr, SCTAB nScTab )
+        const OUString& rName, const XclTokenArrayRef& xTokArr, SCTAB nScTab )
 {
     OSL_ENSURE( !rName.isEmpty(), "XclExpNameManagerImpl::InsertUniqueName - empty name" );
     XclExpNameRef xName( new XclExpName( GetRoot(), GetUnusedName( rName ) ) );
@@ -515,7 +515,7 @@ OUString XclExpNameManagerImpl::GetUnusedName( const OUString& rName ) const
     return aNewName;
 }
 
-sal_uInt16 XclExpNameManagerImpl::Append( XclExpNameRef xName )
+sal_uInt16 XclExpNameManagerImpl::Append( const XclExpNameRef& xName )
 {
     if( maNameList.GetSize() == 0xFFFF )
         return 0;
@@ -700,7 +700,7 @@ sal_uInt16 XclExpNameManager::InsertBuiltInName( sal_Unicode cBuiltIn, const ScR
 }
 
 sal_uInt16 XclExpNameManager::InsertUniqueName(
-        const OUString& rName, XclTokenArrayRef xTokArr, SCTAB nScTab )
+        const OUString& rName, const XclTokenArrayRef& xTokArr, SCTAB nScTab )
 {
     return mxImpl->InsertUniqueName( rName, xTokArr, nScTab );
 }
diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx
index 0ffbef6..467cc99 100644
--- a/sc/source/filter/excel/xilink.cxx
+++ b/sc/source/filter/excel/xilink.cxx
@@ -71,7 +71,7 @@ public:
     /** Reads a CRN record (external referenced cell) at the specified address. */
     void                ReadCrn( XclImpStream& rStrm, const XclAddress& rXclPos );
 
-    void                LoadCachedValues(ScExternalRefCache::TableTypeRef pCacheTable);
+    void                LoadCachedValues(const ScExternalRefCache::TableTypeRef& pCacheTable);
 
 private:
     typedef std::shared_ptr< XclImpCrn > XclImpCrnRef;
@@ -574,7 +574,7 @@ void XclImpSupbookTab::ReadCrn( XclImpStream& rStrm, const XclAddress& rXclPos )
     maCrnList.push_back( crnRef );
 }
 
-void XclImpSupbookTab::LoadCachedValues(ScExternalRefCache::TableTypeRef pCacheTable)
+void XclImpSupbookTab::LoadCachedValues(const ScExternalRefCache::TableTypeRef& pCacheTable)
 {
     if (maCrnList.empty())
         return;
diff --git a/sc/source/filter/inc/xecontent.hxx b/sc/source/filter/inc/xecontent.hxx
index ba1ff95..111aefd 100644
--- a/sc/source/filter/inc/xecontent.hxx
+++ b/sc/source/filter/inc/xecontent.hxx
@@ -57,7 +57,7 @@ public:
 
     /** Inserts a new string into the table.
         @return  The index of the string in the SST, used in other records. */
-    sal_uInt32          Insert( XclExpStringRef xString );
+    sal_uInt32          Insert( const XclExpStringRef& xString );
 
     /** Writes the complete SST and EXTSST records. */
     virtual void        Save( XclExpStream& rStrm ) override;
@@ -154,7 +154,7 @@ private:
         @param xLabelRangesRef  The core range list with all ranges.
         @param nScTab  The current Calc sheet index. */
     static void         FillRangeList( ScRangeList& rScRanges,
-                            ScRangePairListRef xLabelRangesRef, SCTAB nScTab );
+                            const ScRangePairListRef& xLabelRangesRef, SCTAB nScTab );
 
 private:
     ScRangeList         maRowRanges;    /// Cell range list for row labels.
diff --git a/sc/source/filter/inc/xeextlst.hxx b/sc/source/filter/inc/xeextlst.hxx
index 2df19fc..8b33c51 100644
--- a/sc/source/filter/inc/xeextlst.hxx
+++ b/sc/source/filter/inc/xeextlst.hxx
@@ -159,7 +159,7 @@ public:
 
     virtual XclExpExtType GetType() override { return XclExpExtDataBarType; }
 
-    void AddRecord( XclExpExtConditionalFormattingRef aFormat );
+    void AddRecord( const XclExpExtConditionalFormattingRef& aFormat );
 
 private:
     XclExpRecordList< XclExpExtConditionalFormatting > maCF;
@@ -184,7 +184,7 @@ public:
     explicit XclExtLst( const XclExpRoot& rRoot);
     virtual void SaveXml( XclExpXmlStream& rStrm ) override;
 
-    void AddRecord( XclExpExtRef aEntry );
+    void AddRecord( const XclExpExtRef& aEntry );
 
     XclExpExtRef GetItem( XclExpExtType eType );
 
diff --git a/sc/source/filter/inc/xename.hxx b/sc/source/filter/inc/xename.hxx
index f779aff..71e845b 100644
--- a/sc/source/filter/inc/xename.hxx
+++ b/sc/source/filter/inc/xename.hxx
@@ -48,7 +48,7 @@ public:
     sal_uInt16          InsertBuiltInName( sal_Unicode cBuiltIn, const ScRangeList& rRangeList );
 
     /** Inserts a new defined name. Sets another unused name, if rName already exists. */
-    sal_uInt16          InsertUniqueName( const OUString& rName, XclTokenArrayRef xTokArr, SCTAB nScTab );
+    sal_uInt16          InsertUniqueName( const OUString& rName, const XclTokenArrayRef& xTokArr, SCTAB nScTab );
     /** Returns index of an existing name, or creates a name without definition. */
     sal_uInt16          InsertRawName( const OUString& rName );
     /** Searches or inserts a defined name describing a macro name.
diff --git a/sc/source/filter/xml/XMLConverter.cxx b/sc/source/filter/xml/XMLConverter.cxx
index 7b3625d..4b88f37 100644
--- a/sc/source/filter/xml/XMLConverter.cxx
+++ b/sc/source/filter/xml/XMLConverter.cxx
@@ -32,7 +32,7 @@
 using namespace ::com::sun::star;
 using namespace xmloff::token;
 
-ScDocument* ScXMLConverter::GetScDocument( uno::Reference< frame::XModel > xModel )
+ScDocument* ScXMLConverter::GetScDocument( const uno::Reference< frame::XModel >& xModel )
 {
     if (xModel.is())
     {
diff --git a/sc/source/filter/xml/XMLConverter.hxx b/sc/source/filter/xml/XMLConverter.hxx
index 51a2f52..81b5519 100644
--- a/sc/source/filter/xml/XMLConverter.hxx
+++ b/sc/source/filter/xml/XMLConverter.hxx
@@ -42,7 +42,7 @@ public:
 
 // helper methods
     static ScDocument*  GetScDocument(
-                            css::uno::Reference< css::frame::XModel > xModel );
+                            const css::uno::Reference< css::frame::XModel >& xModel );
 
 // IMPORT: GeneralFunction / ScSubTotalFunc
     static css::sheet::GeneralFunction
diff --git a/sc/source/filter/xml/XMLTableMasterPageExport.cxx b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
index f9e42ad..821bcf5 100644
--- a/sc/source/filter/xml/XMLTableMasterPageExport.cxx
+++ b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
@@ -107,7 +107,7 @@ void XMLTableMasterPageExport::exportHeaderFooter(const css::uno::Reference < cs
     }
 }
 
-void lcl_DisposeXHeaderFooterContent( Reference < sheet::XHeaderFooterContent > xHFContent )
+void lcl_DisposeXHeaderFooterContent( const Reference < sheet::XHeaderFooterContent >& xHFContent )
 {
     if( !xHFContent.is() )
         return;


More information about the Libreoffice-commits mailing list