[Libreoffice-commits] core.git: test/source toolkit/source tools/source ucb/source unotest/source unotools/source xmloff/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Jul 29 06:53:13 UTC 2018


 test/source/diff/diff.cxx                                          |    7 -
 toolkit/source/helper/property.cxx                                 |   10 +-
 tools/source/reversemap/bestreversemap.cxx                         |    4 
 tools/source/stream/strmwnt.cxx                                    |    3 
 ucb/source/sorter/sortresult.cxx                                   |    6 -
 unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx |    3 
 unotools/source/config/searchopt.cxx                               |    5 -
 xmloff/source/chart/SchXMLExport.cxx                               |    9 --
 xmloff/source/core/xmlexp.cxx                                      |   17 +--
 xmloff/source/style/xmlnumfi.cxx                                   |   43 +++-------
 10 files changed, 45 insertions(+), 62 deletions(-)

New commits:
commit 01b4c5b27f38d606b05e7a9236ec151e8039972a
Author:     Jochen Nitschke <j.nitschke+logerrit at ok.de>
AuthorDate: Sat Jul 28 21:21:17 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jul 29 08:52:51 2018 +0200

    cppcheck: useInitializationList in test to xmloff
    
    Change-Id: I50545784c5412ab7767f401c6e40058a1d0bfab0
    Reviewed-on: https://gerrit.libreoffice.org/58262
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/test/source/diff/diff.cxx b/test/source/diff/diff.cxx
index d94f5e7a1f7f..995d11d87304 100644
--- a/test/source/diff/diff.cxx
+++ b/test/source/diff/diff.cxx
@@ -97,11 +97,10 @@ private:
 
 
 XMLDiff::XMLDiff( const char* pFileName, const char* pContent, int size, const char* pToleranceFile)
-    : fileName(pFileName)
+    : xmlFile1(xmlParseFile(pFileName))
+    , xmlFile2(xmlParseMemory(pContent, size))
+    , fileName(pFileName)
 {
-    xmlFile1 = xmlParseFile(pFileName);
-    xmlFile2 = xmlParseMemory(pContent, size);
-
     if(pToleranceFile)
     {
         xmlDocPtr xmlToleranceFile = xmlParseFile(pToleranceFile);
diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx
index 09552b6fe4e5..1a5c0a6b1ed9 100644
--- a/toolkit/source/helper/property.cxx
+++ b/toolkit/source/helper/property.cxx
@@ -66,12 +66,12 @@ struct ImplPropertyInfo
 
     ImplPropertyInfo( OUString const & theName, sal_uInt16 nId, const css::uno::Type& rType,
                         sal_Int16 nAttrs, bool bDepends = false )
-     : aName( theName )
+         : aName(theName)
+         , nPropId(nId)
+         , aType(rType)
+         , nAttribs(nAttrs)
+         , bDependsOnOthers(bDepends)
      {
-         nPropId = nId;
-        aType = rType;
-        nAttribs = nAttrs;
-           bDependsOnOthers = bDepends;
      }
 
 };
diff --git a/tools/source/reversemap/bestreversemap.cxx b/tools/source/reversemap/bestreversemap.cxx
index 4650d21781c6..63fbd2b1cb90 100644
--- a/tools/source/reversemap/bestreversemap.cxx
+++ b/tools/source/reversemap/bestreversemap.cxx
@@ -19,10 +19,10 @@ struct Encoder
     bool m_bCapable;
     const char *m_pEncoding;
     Encoder(rtl_TextEncoding nEncoding, const char *pEncoding)
-        : m_bCapable(true)
+        : m_aConverter(rtl_createUnicodeToTextConverter(nEncoding))
+        , m_bCapable(true)
         , m_pEncoding(pEncoding)
     {
-        m_aConverter = rtl_createUnicodeToTextConverter(nEncoding);
     }
     ~Encoder()
     {
diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx
index 0dd1d2f1bd4b..74e570367ab7 100644
--- a/tools/source/stream/strmwnt.cxx
+++ b/tools/source/stream/strmwnt.cxx
@@ -42,9 +42,8 @@ class StreamData
 public:
     HANDLE      hFile;
 
-                StreamData()
+                StreamData() : hFile(nullptr)
                 {
-                    hFile = nullptr;
                 }
 };
 
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx
index 906e368a0523..9aa77f91c608 100644
--- a/ucb/source/sorter/sortresult.cxx
+++ b/ucb/source/sorter/sortresult.cxx
@@ -1680,10 +1680,10 @@ void SortedResultSet::ResortNew( EventList* pList )
 
 
 SortListData::SortListData( sal_IntPtr nPos )
+    : mbModified(false)
+    , mnCurPos(nPos)
+    , mnOldPos(nPos)
 {
-    mbModified = false;
-    mnCurPos = nPos;
-    mnOldPos = nPos;
 };
 
 SortedEntryList::SortedEntryList()
diff --git a/unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx b/unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx
index 2603f1607791..0d4d79321a99 100644
--- a/unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx
+++ b/unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx
@@ -74,9 +74,8 @@ private:
 
 
 Prot::Prot()
+    : m_xContext(cppu::defaultBootstrap_InitialComponentContext())
 {
-    m_xContext = cppu::defaultBootstrap_InitialComponentContext();
-
     uno::Reference<lang::XMultiComponentFactory> xFactory = m_xContext->getServiceManager();
     uno::Reference<lang::XMultiServiceFactory> xSFactory(xFactory, uno::UNO_QUERY_THROW);
 
diff --git a/unotools/source/config/searchopt.cxx b/unotools/source/config/searchopt.cxx
index 878f46d1a1db..0fc7c168a569 100644
--- a/unotools/source/config/searchopt.cxx
+++ b/unotools/source/config/searchopt.cxx
@@ -65,9 +65,10 @@ public:
 };
 
 SvtSearchOptions_Impl::SvtSearchOptions_Impl() :
-    ConfigItem( "Office.Common/SearchOptions" )
+    ConfigItem( "Office.Common/SearchOptions" ),
+    nFlags(0x0003FFFF) // set all options values to 'true'
+
 {
-    nFlags = 0x0003FFFF;    // set all options values to 'true'
     Load();
     SetModified( false );
 }
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 20a6847f1d5e..94e1fea31043 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -1017,16 +1017,13 @@ SchXMLExportHelper_Impl::SchXMLExportHelper_Impl(
     SvXMLAutoStylePoolP& rASPool ) :
         mrExport( rExport ),
         mrAutoStylePool( rASPool ),
+        mxPropertySetMapper( new XMLChartPropertySetMapper( true ) ),
+        mxExpPropMapper( new XMLChartExportPropertyMapper( mxPropertySetMapper, rExport ) ),
+        msTableName("local-table"),
         mbHasCategoryLabels( false ),
         mbRowSourceColumns( true ),
         msCLSID( SvGlobalName( SO3_SCH_CLASSID ).GetHexName() )
 {
-    msTableName = "local-table";
-
-    // create property set mapper
-    mxPropertySetMapper = new XMLChartPropertySetMapper( true);
-    mxExpPropMapper = new XMLChartExportPropertyMapper( mxPropertySetMapper, rExport );
-
     // register chart auto-style family
     mrAutoStylePool.AddFamily(
         XML_STYLE_FAMILY_SCH_CHART_ID,
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 28074c4724a1..6c3abe7d60ba 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -283,17 +283,14 @@ public:
 };
 
 SvXMLExport_Impl::SvXMLExport_Impl()
+:    mxUriReferenceFactory( uri::UriReferenceFactory::create(comphelper::getProcessComponentContext()) ),
     // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
-    : mbOutlineStyleAsNormalListStyle( false )
-        ,mbSaveBackwardCompatibleODF( true )
-        ,mStreamName()
-        ,mNamespaceMaps()
-        ,mDepth(0)
-        ,mpRDFaHelper() // lazy
-        ,mbExportTextNumberElement( false )
-        ,mbNullDateInitialized( false )
-{
-    mxUriReferenceFactory = uri::UriReferenceFactory::create( comphelper::getProcessComponentContext() );
+    mbOutlineStyleAsNormalListStyle( false ),
+    mbSaveBackwardCompatibleODF( true ),
+    mDepth( 0 ),
+    mbExportTextNumberElement( false ),
+    mbNullDateInitialized( false )
+{
 }
 
 void SvXMLExport::SetDocHandler( const uno::Reference< xml::sax::XDocumentHandler > &rHandler )
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index d93d2f9ffbcf..59b48edf7c70 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -92,34 +92,25 @@ public:
 
 struct SvXMLNumberInfo
 {
-    sal_Int32   nDecimals;
-    sal_Int32   nInteger;
-    sal_Int32   nExpDigits;
-    sal_Int32   nExpInterval;
-    sal_Int32   nMinNumerDigits;
-    sal_Int32   nMinDenomDigits;
-    sal_Int32   nMaxNumerDigits;
-    sal_Int32   nMaxDenomDigits;
-    sal_Int32   nFracDenominator;
-    sal_Int32   nMinDecimalDigits;
-    sal_Int32   nZerosNumerDigits;
-    sal_Int32   nZerosDenomDigits;
-    bool        bGrouping;
-    bool        bDecReplace;
-    bool        bExpSign;
-    bool        bDecAlign;
-    double      fDisplayFactor;
+    sal_Int32   nDecimals           = -1;
+    sal_Int32   nInteger            = -1;
+    sal_Int32   nExpDigits          = -1;
+    sal_Int32   nExpInterval        = -1;
+    sal_Int32   nMinNumerDigits     = -1;
+    sal_Int32   nMinDenomDigits     = -1;
+    sal_Int32   nMaxNumerDigits     = -1;
+    sal_Int32   nMaxDenomDigits     = -1;
+    sal_Int32   nFracDenominator    = -1;
+    sal_Int32   nMinDecimalDigits   = -1;
+    sal_Int32   nZerosNumerDigits   = -1;
+    sal_Int32   nZerosDenomDigits   = -1;
+    bool        bGrouping           = false;
+    bool        bDecReplace         = false;
+    bool        bExpSign            = true;
+    bool        bDecAlign           = false;
+    double      fDisplayFactor      = 1.0;
     OUString    aIntegerFractionDelimiter;
     std::map<sal_Int32, OUString> m_EmbeddedElements;
-
-    SvXMLNumberInfo()
-    {
-        nDecimals = nInteger = nExpDigits = nExpInterval = nMinNumerDigits = nMinDenomDigits = nMaxNumerDigits = nMaxDenomDigits =
-            nFracDenominator = nMinDecimalDigits = nZerosNumerDigits = nZerosDenomDigits = -1;
-        bGrouping = bDecReplace = bDecAlign = false;
-        bExpSign = true;
-        fDisplayFactor = 1.0;
-    }
 };
 
 class SvXMLNumFmtElementContext : public SvXMLImportContext


More information about the Libreoffice-commits mailing list