configmgr/source/access.cxx                |    3 +--
 configmgr/source/childaccess.cxx           |    8 ++++----
 configmgr/source/components.cxx            |    4 ++--
 configmgr/source/configurationprovider.cxx |    8 ++++----
 configmgr/source/rootaccess.cxx            |    5 +++--
 cppu/source/threadpool/jobqueue.cxx        |    4 ++--
 cppu/source/threadpool/threadpool.cxx      |    4 ++--
 desktop/source/lib/init.cxx                |    5 +++--
 8 files changed, 21 insertions(+), 20 deletions(-)

New commits:
commit aad80e0b9a9f481fb608f1681f6e8bc280872da8
Author: Noel Grandin <noelgran...@gmail.com>
Date:   Sun Nov 22 08:15:34 2015 +0200

    cppcheck:useInitializationList
    
    Change-Id: I744ff3e268fbffca9499121f3567640934aaae51
    Reviewed-on: https://gerrit.libreoffice.org/20110
    Reviewed-by: Noel Grandin <noelgran...@gmail.com>
    Tested-by: Noel Grandin <noelgran...@gmail.com>

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index ecfbe58..3f4f9ca 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1303,9 +1303,8 @@ css::uno::Reference< css::uno::XInterface > 
Access::createInstanceWithArguments(
 }
 
 Access::Access(Components & components):
-    components_(components), disposed_(false)
+    components_(components), disposed_(false), lock_( lock() )
 {
-    lock_ = lock();
 }
 
 Access::~Access() {}
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index a4e632f..576fbb3 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -76,18 +76,18 @@ ChildAccess::ChildAccess(
     rtl::Reference< Access > const & parent, OUString const & name,
     rtl::Reference< Node > const & node):
     Access(components), root_(root), parent_(parent), name_(name), node_(node),
-    inTransaction_(false)
+    inTransaction_(false),
+    lock_( lock() )
 {
-    lock_ = lock();
     assert(root.is() && parent.is() && node.is());
 }
 
 ChildAccess::ChildAccess(
     Components & components, rtl::Reference< RootAccess > const & root,
     rtl::Reference< Node > const & node):
-    Access(components), root_(root), node_(node), inTransaction_(false)
+    Access(components), root_(root), node_(node), inTransaction_(false),
+    lock_( lock() )
 {
-    lock_ = lock();
     assert(root.is() && node.is());
 }
 
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 17df486..b1b4b72 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -170,9 +170,9 @@ Components::WriteThread::WriteThread(
     rtl::Reference< WriteThread > * reference, Components & components,
     OUString const & url, Data const & data):
     Thread("configmgrWriter"), reference_(reference), components_(components),
-    url_(url), data_(data)
+    url_(url), data_(data),
+    lock_( lock() )
 {
-    lock_ = lock();
     assert(reference != nullptr);
 }
 
diff --git a/configmgr/source/configurationprovider.cxx 
b/configmgr/source/configurationprovider.cxx
index 364642d..65e33b7 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -93,9 +93,9 @@ class Service:
 public:
     explicit Service(
         css::uno::Reference< css::uno::XComponentContext > const context):
-        ServiceBase(m_aMutex), context_(context), default_(true)
+        ServiceBase(m_aMutex), context_(context), default_(true),
+        lock_( lock() )
     {
-        lock_ = lock();
         assert(context.is());
     }
 
@@ -103,9 +103,9 @@ public:
         css::uno::Reference< css::uno::XComponentContext > const context,
         OUString const & locale):
         ServiceBase(m_aMutex), context_(context), locale_(locale),
-        default_(false)
+        default_(false),
+        lock_( lock() )
     {
-        lock_ = lock();
         assert(context.is());
     }
 
diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx
index 08a33d8..c00defc 100644
--- a/configmgr/source/rootaccess.cxx
+++ b/configmgr/source/rootaccess.cxx
@@ -61,9 +61,10 @@ RootAccess::RootAccess(
     Components & components, OUString const & pathRepresentation,
     OUString const & locale, bool update):
     Access(components), pathRepresentation_(pathRepresentation),
-    locale_(locale), update_(update), finalized_(false), alive_(true)
+    locale_(locale),
+    lock_( lock() ),
+    update_(update), finalized_(false), alive_(true)
 {
-    lock_ = lock();
 }
 
 Path RootAccess::getAbsolutePath() {
diff --git a/cppu/source/threadpool/jobqueue.cxx 
b/cppu/source/threadpool/jobqueue.cxx
index 094a55e..447b0a2 100644
--- a/cppu/source/threadpool/jobqueue.cxx
+++ b/cppu/source/threadpool/jobqueue.cxx
@@ -28,9 +28,9 @@ namespace cppu_threadpool {
 
     JobQueue::JobQueue() :
         m_nToDo( 0 ),
-        m_bSuspended( false )
+        m_bSuspended( false ),
+        m_DisposedCallerAdmin( DisposedCallerAdmin::getInstance() )
     {
-        m_DisposedCallerAdmin = DisposedCallerAdmin::getInstance();
     }
 
     void JobQueue::add( void *pThreadSpecificData, RequestFun * doRequest )
diff --git a/cppu/source/threadpool/threadpool.cxx 
b/cppu/source/threadpool/threadpool.cxx
index 42a4ff0..92252cc 100644
--- a/cppu/source/threadpool/threadpool.cxx
+++ b/cppu/source/threadpool/threadpool.cxx
@@ -101,9 +101,9 @@ namespace cppu_threadpool
 
 
 
-    ThreadPool::ThreadPool()
+    ThreadPool::ThreadPool() :
+        m_DisposedCallerAdmin( DisposedCallerAdmin::getInstance() )
     {
-        m_DisposedCallerAdmin = DisposedCallerAdmin::getInstance();
     }
 
     ThreadPool::~ThreadPool()
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index fd0a10d..637e956 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -434,11 +434,12 @@ static void                    lo_registerCallback 
(LibreOfficeKit* pThis,
 static char* lo_getFilterTypes(LibreOfficeKit* pThis);
 
 LibLibreOffice_Impl::LibLibreOffice_Impl()
-    : maThread(nullptr)
+    : m_pOfficeClass( gOfficeClass.lock() )
+    , maThread(nullptr)
     , mpCallback(nullptr)
     , mpCallbackData(nullptr)
 {
-    if(!(m_pOfficeClass = gOfficeClass.lock())) {
+    if(!m_pOfficeClass) {
         m_pOfficeClass.reset(new LibreOfficeKitClass);
         m_pOfficeClass->nSize = sizeof(LibreOfficeKitClass);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to