[Libreoffice-commits] core.git: sfx2/source slideshow/source stoc/source store/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Sat Nov 23 22:39:13 UTC 2019


 sfx2/source/bastyp/fltlst.cxx                                  |    4 ++--
 sfx2/source/doc/exoticfileloadexception.cxx                    |    4 ++--
 sfx2/source/view/viewsh.cxx                                    |    3 +--
 slideshow/source/engine/transitions/slidetransitionfactory.cxx |    3 +--
 stoc/source/defaultregistry/defaultregistry.cxx                |    7 +------
 stoc/source/inspect/introspection.cxx                          |    6 ++----
 stoc/source/invocation_adapterfactory/iafactory.cxx            |    8 +++-----
 store/source/stordata.hxx                                      |    6 +++---
 8 files changed, 15 insertions(+), 26 deletions(-)

New commits:
commit e6ab01ce532d1db01579b70bd476b2f643522bf9
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sat Nov 23 18:54:42 2019 +0100
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sat Nov 23 23:38:07 2019 +0100

    cppcheck: performing init in init list (sfx2/slideshow/stoc/store)
    
    Change-Id: Iddbd3256aabe9552472b55d3d9b88a3769698de9
    Reviewed-on: https://gerrit.libreoffice.org/83576
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    Tested-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/sfx2/source/bastyp/fltlst.cxx b/sfx2/source/bastyp/fltlst.cxx
index ef9e333129b8..25b401e9feb7 100644
--- a/sfx2/source/bastyp/fltlst.cxx
+++ b/sfx2/source/bastyp/fltlst.cxx
@@ -82,9 +82,9 @@ class SfxRefreshListener : public ::cppu::WeakImplHelper<css::util::XRefreshList
     @threadsafe     yes
 *//*-*************************************************************************************************************/
 SfxFilterListener::SfxFilterListener()
+    : m_xFilterCache(document::FilterConfigRefresh::create( comphelper::getProcessComponentContext() ) ),
+      m_xFilterCacheListener(new SfxRefreshListener(this))
 {
-    m_xFilterCache = document::FilterConfigRefresh::create( comphelper::getProcessComponentContext() );
-    m_xFilterCacheListener = new SfxRefreshListener(this);
     m_xFilterCache->addRefreshListener( m_xFilterCacheListener );
 }
 
diff --git a/sfx2/source/doc/exoticfileloadexception.cxx b/sfx2/source/doc/exoticfileloadexception.cxx
index 56a697f43bf6..4993c0640a47 100644
--- a/sfx2/source/doc/exoticfileloadexception.cxx
+++ b/sfx2/source/doc/exoticfileloadexception.cxx
@@ -16,6 +16,8 @@ using namespace com::sun::star;
 
 ExoticFileLoadException::ExoticFileLoadException(const OUString& rURL,
                                                  const OUString& rFilterUIName)
+    : m_xAbort(new comphelper::OInteractionAbort)
+    , m_xApprove(new comphelper::OInteractionApprove)
 {
     document::ExoticFileLoadException aReq;
     aReq.URL = rURL;
@@ -23,8 +25,6 @@ ExoticFileLoadException::ExoticFileLoadException(const OUString& rURL,
 
     m_aRequest <<= aReq;
 
-    m_xAbort = new comphelper::OInteractionAbort;
-    m_xApprove = new comphelper::OInteractionApprove;
     m_lContinuations.realloc(2);
     m_lContinuations[0] = m_xApprove;
     m_lContinuations[1] = m_xAbort;
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 1c7638349b79..d648b1159b04 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -152,9 +152,8 @@ private:
 };
 
 SfxClipboardChangeListener::SfxClipboardChangeListener( SfxViewShell* pView, const uno::Reference< datatransfer::clipboard::XClipboardNotifier >& xClpbrdNtfr )
-  : m_pViewShell( nullptr ), m_xClpbrdNtfr( xClpbrdNtfr )
+  : m_pViewShell( nullptr ), m_xClpbrdNtfr( xClpbrdNtfr ), m_xCtrl(pView->GetController())
 {
-    m_xCtrl = pView->GetController();
     if ( m_xCtrl.is() )
     {
         m_xCtrl->addEventListener( uno::Reference < lang::XEventListener > ( static_cast < lang::XEventListener* >( this ) ) );
diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx
index 7cc5045bcc59..49d440aa2ed7 100644
--- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx
+++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx
@@ -95,9 +95,8 @@ class PluginSlideChange: public SlideChangeBase
     UnoViewSharedPtr mpView;
 
     TransitionViewPair( uno::Reference<presentation::XTransition> const & xTransition, const UnoViewSharedPtr& rView )
+         : mxTransition(xTransition), mpView(rView)
     {
-        mxTransition = xTransition;
-        mpView = rView;
     }
 
     ~TransitionViewPair()
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx
index f0a4d0ff18a3..aff6a5f1113c 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -137,11 +137,8 @@ protected:
 NestedKeyImpl::NestedKeyImpl( NestedRegistryImpl* pDefaultRegistry,
                               Reference<XRegistryKey>& localKey,
                               Reference<XRegistryKey>& defaultKey )
-    : m_xRegistry(pDefaultRegistry)
+    : m_state(m_xRegistry->m_state), m_xRegistry(pDefaultRegistry), m_localKey(localKey), m_defaultKey(defaultKey)
 {
-    m_localKey = localKey;
-    m_defaultKey = defaultKey;
-
     if (m_localKey.is())
     {
         m_name = m_localKey->getKeyName();
@@ -150,8 +147,6 @@ NestedKeyImpl::NestedKeyImpl( NestedRegistryImpl* pDefaultRegistry,
     {
         m_name = m_defaultKey->getKeyName();
     }
-
-    m_state = m_xRegistry->m_state;
 }
 
 
diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index 58434b2f51ea..14ecf79af050 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -773,13 +773,11 @@ public:
 
 ImplIntrospectionAccess::ImplIntrospectionAccess
     ( const Any& obj, rtl::Reference< IntrospectionAccessStatic_Impl > const & pStaticImpl_ )
-        : maInspectedObject( obj ), mpStaticImpl( pStaticImpl_ ) //, maAdapter()
+        : maInspectedObject( obj ), mpStaticImpl( pStaticImpl_ ) ,
+          mnLastPropertyConcept(-1), mnLastMethodConcept(-1) //, maAdapter()
 {
     // Save object as an interface if possible
     maInspectedObject >>= mxIface;
-
-    mnLastPropertyConcept = -1;
-    mnLastMethodConcept = -1;
 }
 
 Reference<XElementAccess> ImplIntrospectionAccess::getXElementAccess()
diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx
index 4aecc1899c69..b1c654760b73 100644
--- a/stoc/source/invocation_adapterfactory/iafactory.cxx
+++ b/stoc/source/invocation_adapterfactory/iafactory.cxx
@@ -678,7 +678,9 @@ AdapterImpl::AdapterImpl(
 
 
 FactoryImpl::FactoryImpl( Reference< XComponentContext > const & xContext )
-    : m_pInvokMethodTD( nullptr ),
+    : m_aUno2Cpp(Mapping( UNO_LB_UNO, CPPU_CURRENT_LANGUAGE_BINDING_NAME )),
+      m_aCpp2Uno(Mapping( CPPU_CURRENT_LANGUAGE_BINDING_NAME, UNO_LB_UNO)),
+      m_pInvokMethodTD( nullptr ),
       m_pSetValueTD( nullptr ),
       m_pGetValueTD( nullptr ),
       m_pAnySeqTD( nullptr ),
@@ -686,10 +688,6 @@ FactoryImpl::FactoryImpl( Reference< XComponentContext > const & xContext )
       m_pConvertToTD( nullptr )
 {
     // C++/UNO bridge
-    OUString aCppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-    OUString aUnoEnvTypeName = UNO_LB_UNO;
-    m_aUno2Cpp = Mapping( aUnoEnvTypeName, aCppEnvTypeName );
-    m_aCpp2Uno = Mapping( aCppEnvTypeName, aUnoEnvTypeName );
     OSL_ENSURE(
         m_aUno2Cpp.is() && m_aCpp2Uno.is(), "### no uno / C++ mappings!" );
 
diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx
index 6255fc1adccd..08251cf6e62b 100644
--- a/store/source/stordata.hxx
+++ b/store/source/stordata.hxx
@@ -551,10 +551,10 @@ struct OStoreDirectoryPageData : public store::PageData
         /** Construction.
         */
         ChunkDescriptor (sal_uInt32 nPosition, sal_uInt16 nCapacity)
+             : m_nPage(nPosition / nCapacity),
+               m_nOffset(static_cast<sal_uInt16>((nPosition % nCapacity) & 0xffff)),
+               m_nLength(nCapacity - m_nOffset)
         {
-            m_nPage   = nPosition / nCapacity;
-            m_nOffset = static_cast<sal_uInt16>((nPosition % nCapacity) & 0xffff);
-            m_nLength = nCapacity - m_nOffset;
         }
     };
 


More information about the Libreoffice-commits mailing list