[Libreoffice-commits] core.git: oox/qa package/source sal/qa sax/source sax/test

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Sun Nov 24 21:47:28 UTC 2019


 oox/qa/unit/vba_compression.cxx             |    3 +--
 package/source/zippackage/ZipPackage.cxx    |    3 +--
 sal/qa/osl/process/osl_Thread.cxx           |    3 +--
 sal/qa/osl/process/osl_process.cxx          |    3 +--
 sal/qa/rtl/doublelock/rtl_doublelocking.cxx |    4 ++--
 sax/source/fastparser/legacyfastparser.cxx  |    5 ++---
 sax/test/sax/testsax.cxx                    |    3 +--
 sax/test/saxdemo.cxx                        |    6 +++---
 8 files changed, 12 insertions(+), 18 deletions(-)

New commits:
commit b9448acf3ce4c1c850a691fc33686fd5165b94d9
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sun Nov 24 21:23:59 2019 +0100
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sun Nov 24 22:46:19 2019 +0100

    cppcheck: performing init in init list (oox, package, sal, sax)
    
    Change-Id: I77e28f02516ab25ff6680970dc13d52cfa90eac1
    Reviewed-on: https://gerrit.libreoffice.org/83620
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/oox/qa/unit/vba_compression.cxx b/oox/qa/unit/vba_compression.cxx
index 9299a3de9eaa..0ade756e363f 100644
--- a/oox/qa/unit/vba_compression.cxx
+++ b/oox/qa/unit/vba_compression.cxx
@@ -54,8 +54,7 @@ public:
 private:
     static OUString const & getDebugDirUrl() {
         struct DebugDirUrl {
-            DebugDirUrl() {
-                url = "$UserInstallation/debug/";
+            DebugDirUrl() : url("$UserInstallation/debug/") {
                 rtl::Bootstrap::expandMacros(url);
                     //TODO: provide an OUString -> OUString expansion function, and which throws on
                     // failure
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index a7e632472c67..7a0b8c1934ec 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1157,9 +1157,8 @@ namespace
     private:
         rtlRandomPool m_aRandomPool;
     public:
-        RandomPool()
+        RandomPool() : m_aRandomPool(rtl_random_createPool ())
         {
-            m_aRandomPool = rtl_random_createPool ();
         }
         rtlRandomPool get()
         {
diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx
index 3c9891b76e54..d551f471d989 100644
--- a/sal/qa/osl/process/osl_Thread.cxx
+++ b/sal/qa/osl/process/osl_Thread.cxx
@@ -263,9 +263,8 @@ class OCountThread : public Thread
 {
     ThreadSafeValue<sal_Int32> m_aFlag;
 public:
-    OCountThread()
+    OCountThread() : m_nWaitSec(0)
         {
-            m_nWaitSec = 0;
             t_print("new OCountThread thread %u!\n", static_cast<unsigned>(getIdentifier()));
         }
     sal_Int32 getValue() { return m_aFlag.getValue(); }
diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx
index 104f9238eea6..4555a0d83394 100644
--- a/sal/qa/osl/process/osl_process.cxx
+++ b/sal/qa/osl/process/osl_process.cxx
@@ -161,10 +161,9 @@ public:
 
     // ctor
     Test_osl_executeProcess() :
-        env_param_(OUString("-env"))
+        env_param_(OUString("-env")), suCWD(getExecutablePath())
     {
         parameters_[0] = env_param_.pData;
-        suCWD = getExecutablePath();
 
 #if defined(_WIN32)
         suExecutableFileURL = suCWD + "/" "osl_process_child.exe";
diff --git a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx
index 6f59e55e62cd..ef639423d774 100644
--- a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx
+++ b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx
@@ -64,9 +64,9 @@ class OGetThread : public osl::Thread
 public:
     OGetThread()
             :m_nOK(0),
-             m_nFails(0)
+             m_nFails(0),
+             m_sConstStr(CONST_TEST_STRING)
         {
-            m_sConstStr = CONST_TEST_STRING;
         }
 
     sal_Int32 getOK() { osl::MutexGuard g(m_mutex); return m_nOK; }
diff --git a/sax/source/fastparser/legacyfastparser.cxx b/sax/source/fastparser/legacyfastparser.cxx
index 2f355c956b4c..6399e5069a44 100644
--- a/sax/source/fastparser/legacyfastparser.cxx
+++ b/sax/source/fastparser/legacyfastparser.cxx
@@ -283,10 +283,9 @@ void SAL_CALL CallbackDocumentHandler::characters( const OUString& aChars )
         m_xDocumentHandler->characters( aChars );
 }
 
-SaxLegacyFastParser::SaxLegacyFastParser( ) : m_aNamespaceHandler( new NamespaceHandler )
+SaxLegacyFastParser::SaxLegacyFastParser( ) : m_aNamespaceHandler( new NamespaceHandler ),
+  m_xParser(FastParser::create(::comphelper::getProcessComponentContext() ))
 {
-    m_xParser = FastParser::create(
-        ::comphelper::getProcessComponentContext() );
     m_xParser->setNamespaceHandler( m_aNamespaceHandler.get() );
 }
 
diff --git a/sax/test/sax/testsax.cxx b/sax/test/sax/testsax.cxx
index 2ef67e9aae1f..06b0421c248b 100644
--- a/sax/test/sax/testsax.cxx
+++ b/sax/test/sax/testsax.cxx
@@ -236,9 +236,8 @@ class TestDocumentHandler :
 {
 public:
     TestDocumentHandler( const Reference < XMultiServiceFactory >  &r , sal_Bool bPrint )
+      : m_bPrint(bPrint), m_xSMgr(r)
     {
-        m_xSMgr = r;
-        m_bPrint = bPrint;
     }
 
     // Error handler
diff --git a/sax/test/saxdemo.cxx b/sax/test/saxdemo.cxx
index a501294529e1..7139d60ef608 100644
--- a/sax/test/saxdemo.cxx
+++ b/sax/test/saxdemo.cxx
@@ -281,10 +281,10 @@ struct TagAttribute
     TagAttribute( const OUString &s_Name,
                   const OUString &s_Type ,
                   const OUString &s_Value )
+      : sName(s_Name),
+        sType(s_Type),
+        sValue(s_Value)
     {
-        sName     = s_Name;
-        sType     = s_Type;
-        sValue    = s_Value;
     }
 
     OUString sName;


More information about the Libreoffice-commits mailing list