[Libreoffice-commits] core.git: dbaccess/qa starmath/inc starmath/source writerperfect/inc writerperfect/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Aug 3 13:28:51 UTC 2017


 dbaccess/qa/unit/embeddeddb_performancetest.cxx    |   16 ++++++++--------
 starmath/inc/cursor.hxx                            |    2 +-
 starmath/inc/document.hxx                          |    2 +-
 starmath/inc/node.hxx                              |    4 ++--
 starmath/inc/view.hxx                              |    4 ++--
 starmath/inc/visitors.hxx                          |    2 +-
 starmath/source/accessibility.cxx                  |    6 +++---
 starmath/source/cursor.cxx                         |    2 +-
 starmath/source/document.cxx                       |    2 +-
 starmath/source/mathmlexport.cxx                   |    8 ++++----
 starmath/source/mathmlexport.hxx                   |   10 +++++-----
 starmath/source/mathmlimport.cxx                   |    8 ++++----
 starmath/source/mathmlimport.hxx                   |   10 +++++-----
 starmath/source/view.cxx                           |    4 ++--
 starmath/source/visitors.cxx                       |    2 +-
 writerperfect/inc/DocumentHandler.hxx              |    2 +-
 writerperfect/source/common/DocumentHandler.cxx    |    2 +-
 writerperfect/source/common/WPFTEncodingDialog.cxx |    2 +-
 18 files changed, 44 insertions(+), 44 deletions(-)

New commits:
commit 24817c26b3f8cc1a8156357316be442e5460a1a7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Aug 3 13:14:02 2017 +0200

    loplugin:constparams in starmath
    
    Change-Id: Iac470b572311241216622f22bc543c0bd10a28f6
    Reviewed-on: https://gerrit.libreoffice.org/40714
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/dbaccess/qa/unit/embeddeddb_performancetest.cxx b/dbaccess/qa/unit/embeddeddb_performancetest.cxx
index 23ab34723fff..26b77b555fe1 100644
--- a/dbaccess/qa/unit/embeddeddb_performancetest.cxx
+++ b/dbaccess/qa/unit/embeddeddb_performancetest.cxx
@@ -98,19 +98,19 @@ private:
                                 const OUString& rDBName,
                                 const bool bUsePreparedStatement);
 
-    void setupTestTable(uno::Reference< XConnection >& xConnection);
+    void setupTestTable(uno::Reference< XConnection > const & xConnection);
 
     SvFileStream *getWordListStream();
 
     // Individual Tests
     void performPreparedStatementInsertTest(
-        uno::Reference< XConnection >& xConnection,
+        uno::Reference< XConnection > const & xConnection,
         const OUString& rDBName);
     void performStatementInsertTest(
-        uno::Reference< XConnection >& xConnection,
+        uno::Reference< XConnection > const & xConnection,
         const OUString& rDBName);
     void performReadTest(
-        uno::Reference< XConnection >& xConnection,
+        uno::Reference< XConnection > const & xConnection,
         const OUString& rDBName);
 
     // Perform all tests on a given DB.
@@ -234,7 +234,7 @@ void EmbeddedDBPerformanceTest::doPerformanceTestOnODB(
 }
 
 void EmbeddedDBPerformanceTest::setupTestTable(
-    uno::Reference< XConnection >& xConnection)
+    uno::Reference< XConnection > const & xConnection)
 {
     uno::Reference< XStatement > xStatement = xConnection->createStatement();
 
@@ -249,7 +249,7 @@ void EmbeddedDBPerformanceTest::setupTestTable(
 }
 
 void EmbeddedDBPerformanceTest::performPreparedStatementInsertTest(
-    uno::Reference< XConnection >& xConnection,
+    uno::Reference< XConnection > const & xConnection,
     const OUString& rDBName)
 {
     uno::Reference< XPreparedStatement > xPreparedStatement =
@@ -291,7 +291,7 @@ void EmbeddedDBPerformanceTest::performPreparedStatementInsertTest(
 }
 
 void EmbeddedDBPerformanceTest::performStatementInsertTest(
-    uno::Reference< XConnection >& xConnection,
+    uno::Reference< XConnection > const & xConnection,
     const OUString& rDBName)
 {
     uno::Reference< XStatement > xStatement =
@@ -329,7 +329,7 @@ void EmbeddedDBPerformanceTest::performStatementInsertTest(
 }
 
 void EmbeddedDBPerformanceTest::performReadTest(
-    uno::Reference< XConnection >& xConnection,
+    uno::Reference< XConnection > const & xConnection,
     const OUString& rDBName)
 {
     uno::Reference< XStatement > xStatement = xConnection->createStatement();
diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx
index 72de1a1cbadb..476f021670e0 100644
--- a/starmath/inc/cursor.hxx
+++ b/starmath/inc/cursor.hxx
@@ -208,7 +208,7 @@ private:
      *
      * These are SmExpression, SmBinHorNode, SmUnHorNode etc.
      */
-    static bool IsLineCompositionNode(SmNode* pNode);
+    static bool IsLineCompositionNode(SmNode const * pNode);
 
     /** Count number of selected nodes, excluding line composition nodes
      *
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index e18c674f2a69..04cb436b9d0e 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -172,7 +172,7 @@ public:
     void        UpdateText();
     void        SetText(const OUString& rBuffer);
     const OUString&  GetText() { return maText; }
-    void        SetFormat(SmFormat& rFormat);
+    void        SetFormat(SmFormat const & rFormat);
     const SmFormat&  GetFormat() { return maFormat; }
 
     void            Parse();
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index b7a7efe371f4..0abc3736111a 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -202,7 +202,7 @@ public:
     }
 
     /** Set the token for this node */
-    void SetToken(SmToken& token){
+    void SetToken(SmToken const & token){
         maNodeToken = token;
     }
 
@@ -249,7 +249,7 @@ public:
      *
      * Returns -1, if pSubNode isn't a subnode of this.
      */
-    int IndexOfSubNode(SmNode* pSubNode)
+    int IndexOfSubNode(SmNode const * pSubNode)
     {
         sal_uInt16 nSize = GetNumSubNodes();
         for(sal_uInt16 i = 0; i < nSize; i++)
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index e06f85cde4c8..9667d09e30ef 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -236,9 +236,9 @@ class SmViewShell: public SfxViewShell
     bool mbInsertIntoEditWindow;
 protected:
 
-    static Size GetTextLineSize(OutputDevice& rDevice,
+    static Size GetTextLineSize(OutputDevice const & rDevice,
                          const OUString& rLine);
-    static Size GetTextSize(OutputDevice& rDevice,
+    static Size GetTextSize(OutputDevice const & rDevice,
                      const OUString& rText,
                      long          MaxWidth);
     static void DrawTextLine(OutputDevice& rDevice,
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index 63271613f10f..6f3b17e733c6 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -372,7 +372,7 @@ private:
     /** Clone children of pSource and give them to pTarget */
     void CloneKids( SmStructureNode* pSource, SmStructureNode* pTarget );
     /** Clone attributes on a pNode */
-    static void CloneNodeAttr( SmNode* pSource, SmNode* pTarget );
+    static void CloneNodeAttr( SmNode const * pSource, SmNode* pTarget );
 };
 
 
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index 5d7c08f60a00..60c7d0b916c4 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -65,7 +65,7 @@ using namespace com::sun::star::uno;
 using namespace com::sun::star::accessibility;
 
 
-static awt::Rectangle lcl_GetBounds( vcl::Window *pWin )
+static awt::Rectangle lcl_GetBounds( vcl::Window const *pWin )
 {
     // !! see VCLXAccessibleComponent::implGetBounds()
 
@@ -92,7 +92,7 @@ static awt::Rectangle lcl_GetBounds( vcl::Window *pWin )
     return aBounds;
 }
 
-static awt::Point lcl_GetLocationOnScreen( vcl::Window *pWin )
+static awt::Point lcl_GetLocationOnScreen( vcl::Window const *pWin )
 {
     // !! see VCLXAccessibleComponent::getLocationOnScreen()
 
@@ -1038,7 +1038,7 @@ void SmTextForwarder::FieldClicked(const SvxFieldItem&, sal_Int32, sal_Int32)
 {
 }
 
-static SfxItemState GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, sal_uInt16 nWhich )
+static SfxItemState GetSvxEditEngineItemState( EditEngine const & rEditEngine, const ESelection& rSel, sal_uInt16 nWhich )
 {
     std::vector<EECharAttrib> aAttribs;
 
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 56f43eccaddf..4ed4ffde1145 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -1173,7 +1173,7 @@ void SmCursor::CloneLineToClipboard(SmStructureNode* pLine, SmClipboard* pClipbo
     }
 }
 
-bool SmCursor::IsLineCompositionNode(SmNode* pNode){
+bool SmCursor::IsLineCompositionNode(SmNode const * pNode){
     switch(pNode->GetType()){
         case SmNodeType::Line:
         case SmNodeType::UnHor:
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index e6a04cde82bb..eeba3a2a47a0 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -176,7 +176,7 @@ void SmDocShell::SetText(const OUString& rBuffer)
     }
 }
 
-void SmDocShell::SetFormat(SmFormat& rFormat)
+void SmDocShell::SetFormat(SmFormat const & rFormat)
 {
     maFormat = rFormat;
     SetFormulaArranged( false );
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index f26b6d7d9725..003d583c03c5 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -241,8 +241,8 @@ bool SmXMLExportWrapper::Export(SfxMedium &rMedium)
 bool SmXMLExportWrapper::WriteThroughComponent(
     const Reference<io::XOutputStream>& xOutputStream,
     const Reference<XComponent>& xComponent,
-    Reference<uno::XComponentContext> & rxContext,
-    Reference<beans::XPropertySet> & rPropSet,
+    Reference<uno::XComponentContext> const & rxContext,
+    Reference<beans::XPropertySet> const & rPropSet,
     const sal_Char* pComponentName )
 {
     OSL_ENSURE(xOutputStream.is(), "I really need an output stream!");
@@ -293,8 +293,8 @@ bool SmXMLExportWrapper::WriteThroughComponent(
     const Reference < embed::XStorage >& xStorage,
     const Reference<XComponent>& xComponent,
     const sal_Char* pStreamName,
-    Reference<uno::XComponentContext> & rxContext,
-    Reference<beans::XPropertySet> & rPropSet,
+    Reference<uno::XComponentContext> const & rxContext,
+    Reference<beans::XPropertySet> const & rPropSet,
     const sal_Char* pComponentName
     )
 {
diff --git a/starmath/source/mathmlexport.hxx b/starmath/source/mathmlexport.hxx
index bb0a5e097fa0..62139209cce5 100644
--- a/starmath/source/mathmlexport.hxx
+++ b/starmath/source/mathmlexport.hxx
@@ -40,7 +40,7 @@ class SmXMLExportWrapper
     bool bFlat;     //set true for export to flat .mml, set false for
                         //export to a .sxm (or whatever) package
 public:
-    explicit SmXMLExportWrapper(css::uno::Reference<css::frame::XModel> &rRef)
+    explicit SmXMLExportWrapper(css::uno::Reference<css::frame::XModel> const &rRef)
         : xModel(rRef), bFlat(true) {}
 
     bool Export(SfxMedium &rMedium);
@@ -49,16 +49,16 @@ public:
     static bool WriteThroughComponent(
         const css::uno::Reference< css::io::XOutputStream >&   xOutputStream,
         const css::uno::Reference< css::lang::XComponent >&    xComponent,
-        css::uno::Reference< css::uno::XComponentContext > & rxContext,
-        css::uno::Reference< css::beans::XPropertySet > & rPropSet,
+        css::uno::Reference< css::uno::XComponentContext > const & rxContext,
+        css::uno::Reference< css::beans::XPropertySet > const & rPropSet,
         const sal_Char* pComponentName );
 
     static bool WriteThroughComponent(
         const css::uno::Reference< css::embed::XStorage >& xStor,
         const css::uno::Reference< css::lang::XComponent >& xComponent,
         const sal_Char* pStreamName,
-        css::uno::Reference< css::uno::XComponentContext > & rxContext,
-        css::uno::Reference< css::beans::XPropertySet > & rPropSet,
+        css::uno::Reference< css::uno::XComponentContext > const & rxContext,
+        css::uno::Reference< css::beans::XPropertySet > const & rPropSet,
         const sal_Char* pComponentName );
 };
 
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 930ff81b506f..5eac14f28977 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -246,8 +246,8 @@ ErrCode SmXMLImportWrapper::Import(SfxMedium &rMedium)
 ErrCode SmXMLImportWrapper::ReadThroughComponent(
     const Reference<io::XInputStream>& xInputStream,
     const Reference<XComponent>& xModelComponent,
-    Reference<uno::XComponentContext> & rxContext,
-    Reference<beans::XPropertySet> & rPropSet,
+    Reference<uno::XComponentContext> const & rxContext,
+    Reference<beans::XPropertySet> const & rPropSet,
     const sal_Char* pFilterName,
     bool bEncrypted )
 {
@@ -344,8 +344,8 @@ ErrCode SmXMLImportWrapper::ReadThroughComponent(
     const Reference<XComponent>& xModelComponent,
     const sal_Char* pStreamName,
     const sal_Char* pCompatibilityStreamName,
-    Reference<uno::XComponentContext> & rxContext,
-    Reference<beans::XPropertySet> & rPropSet,
+    Reference<uno::XComponentContext> const & rxContext,
+    Reference<beans::XPropertySet> const & rPropSet,
     const sal_Char* pFilterName )
 {
     OSL_ENSURE(xStorage.is(), "Need storage!");
diff --git a/starmath/source/mathmlimport.hxx b/starmath/source/mathmlimport.hxx
index c0e43d8cd83a..4db626df4d0a 100644
--- a/starmath/source/mathmlimport.hxx
+++ b/starmath/source/mathmlimport.hxx
@@ -40,7 +40,7 @@ class SmXMLImportWrapper
     css::uno::Reference<css::frame::XModel> xModel;
 
 public:
-    explicit SmXMLImportWrapper(css::uno::Reference<css::frame::XModel> &rRef)
+    explicit SmXMLImportWrapper(css::uno::Reference<css::frame::XModel> const &rRef)
         : xModel(rRef) {}
 
     ErrCode Import(SfxMedium &rMedium);
@@ -48,8 +48,8 @@ public:
     static ErrCode ReadThroughComponent(
         const css::uno::Reference< css::io::XInputStream >& xInputStream,
         const css::uno::Reference< css::lang::XComponent >& xModelComponent,
-        css::uno::Reference< css::uno::XComponentContext > & rxContext,
-        css::uno::Reference< css::beans::XPropertySet > & rPropSet,
+        css::uno::Reference< css::uno::XComponentContext > const & rxContext,
+        css::uno::Reference< css::beans::XPropertySet > const & rPropSet,
         const sal_Char* pFilterName,
         bool bEncrypted );
 
@@ -58,8 +58,8 @@ public:
         const css::uno::Reference< css::lang::XComponent >& xModelComponent,
         const sal_Char* pStreamName,
         const sal_Char* pCompatibilityStreamName,
-        css::uno::Reference< css::uno::XComponentContext > & rxContext,
-        css::uno::Reference< css::beans::XPropertySet > & rPropSet,
+        css::uno::Reference< css::uno::XComponentContext > const & rxContext,
+        css::uno::Reference< css::beans::XPropertySet > const & rPropSet,
         const sal_Char* pFilterName );
 };
 
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 81ad79e51f70..5da095811a68 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -920,7 +920,7 @@ void SmViewShell::SetZoomFactor( const Fraction &rX, const Fraction &rY )
     SfxViewShell::SetZoomFactor( rX, rY );
 }
 
-Size SmViewShell::GetTextLineSize(OutputDevice& rDevice, const OUString& rLine)
+Size SmViewShell::GetTextLineSize(OutputDevice const & rDevice, const OUString& rLine)
 {
     Size   aSize(rDevice.GetTextWidth(rLine), rDevice.GetTextHeight());
     const long nTabPos = rLine.isEmpty() ? 0 : rDevice.approximate_char_width() * 8;
@@ -943,7 +943,7 @@ Size SmViewShell::GetTextLineSize(OutputDevice& rDevice, const OUString& rLine)
     return aSize;
 }
 
-Size SmViewShell::GetTextSize(OutputDevice& rDevice, const OUString& rText, long MaxWidth)
+Size SmViewShell::GetTextSize(OutputDevice const & rDevice, const OUString& rText, long MaxWidth)
 {
     Size aSize;
     Size aTextSize;
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 11606f74005f..a2437be9edc4 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -1600,7 +1600,7 @@ SmNode* SmCloningVisitor::Clone( SmNode* pNode )
     return pClone;
 }
 
-void SmCloningVisitor::CloneNodeAttr( SmNode* pSource, SmNode* pTarget )
+void SmCloningVisitor::CloneNodeAttr( SmNode const * pSource, SmNode* pTarget )
 {
     pTarget->SetScaleMode( pSource->GetScaleMode( ) );
     //Other attributes are set when prepare or arrange is executed
diff --git a/writerperfect/inc/DocumentHandler.hxx b/writerperfect/inc/DocumentHandler.hxx
index af4e128bd411..dfa658adc592 100644
--- a/writerperfect/inc/DocumentHandler.hxx
+++ b/writerperfect/inc/DocumentHandler.hxx
@@ -51,7 +51,7 @@ namespace writerperfect
 class WRITERPERFECT_DLLPUBLIC DocumentHandler: public OdfDocumentHandler
 {
 public:
-    DocumentHandler(css::uno::Reference < css::xml::sax::XDocumentHandler > &xHandler);
+    DocumentHandler(css::uno::Reference < css::xml::sax::XDocumentHandler > const &xHandler);
     void startDocument() override;
     void endDocument() override;
     void startElement(const char *psName, const librevenge::RVNGPropertyList &xPropList) override;
diff --git a/writerperfect/source/common/DocumentHandler.cxx b/writerperfect/source/common/DocumentHandler.cxx
index a38f8fc0fcf8..414491bdecc0 100644
--- a/writerperfect/source/common/DocumentHandler.cxx
+++ b/writerperfect/source/common/DocumentHandler.cxx
@@ -110,7 +110,7 @@ using com::sun::star::uno::Reference;
 using com::sun::star::xml::sax::XAttributeList;
 using com::sun::star::xml::sax::XDocumentHandler;
 
-DocumentHandler::DocumentHandler(Reference < XDocumentHandler > &xHandler) :
+DocumentHandler::DocumentHandler(Reference < XDocumentHandler > const &xHandler) :
     mxHandler(xHandler)
 {
     if (SvXMLImport *pFastHandler = dynamic_cast<SvXMLImport *>(mxHandler.get()))
diff --git a/writerperfect/source/common/WPFTEncodingDialog.cxx b/writerperfect/source/common/WPFTEncodingDialog.cxx
index 448d7b82ccbe..69f9988e64ed 100644
--- a/writerperfect/source/common/WPFTEncodingDialog.cxx
+++ b/writerperfect/source/common/WPFTEncodingDialog.cxx
@@ -102,7 +102,7 @@ void selectEncoding(ListBox *box, const OUString &encoding)
     }
 }
 
-OUString getEncoding(ListBox *box)
+OUString getEncoding(ListBox const *box)
 {
     sal_uIntPtr pos = reinterpret_cast<sal_uIntPtr>(box->GetSelectEntryData());
     if (pos>=numEncodings)


More information about the Libreoffice-commits mailing list