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@collabora.co.uk>
This commit is contained in:
Jochen Nitschke
2018-07-28 21:21:17 +02:00
committed by Noel Grandin
parent c97df0d704
commit 01b4c5b27f
10 changed files with 44 additions and 61 deletions

View File

@@ -97,11 +97,10 @@ private:
XMLDiff::XMLDiff( const char* pFileName, const char* pContent, int size, const char* pToleranceFile) 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) if(pToleranceFile)
{ {
xmlDocPtr xmlToleranceFile = xmlParseFile(pToleranceFile); xmlDocPtr xmlToleranceFile = xmlParseFile(pToleranceFile);

View File

@@ -66,12 +66,12 @@ struct ImplPropertyInfo
ImplPropertyInfo( OUString const & theName, sal_uInt16 nId, const css::uno::Type& rType, ImplPropertyInfo( OUString const & theName, sal_uInt16 nId, const css::uno::Type& rType,
sal_Int16 nAttrs, bool bDepends = false ) 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;
} }
}; };

View File

@@ -19,10 +19,10 @@ struct Encoder
bool m_bCapable; bool m_bCapable;
const char *m_pEncoding; const char *m_pEncoding;
Encoder(rtl_TextEncoding nEncoding, const char *pEncoding) Encoder(rtl_TextEncoding nEncoding, const char *pEncoding)
: m_bCapable(true) : m_aConverter(rtl_createUnicodeToTextConverter(nEncoding))
, m_bCapable(true)
, m_pEncoding(pEncoding) , m_pEncoding(pEncoding)
{ {
m_aConverter = rtl_createUnicodeToTextConverter(nEncoding);
} }
~Encoder() ~Encoder()
{ {

View File

@@ -42,9 +42,8 @@ class StreamData
public: public:
HANDLE hFile; HANDLE hFile;
StreamData() StreamData() : hFile(nullptr)
{ {
hFile = nullptr;
} }
}; };

View File

@@ -1680,10 +1680,10 @@ void SortedResultSet::ResortNew( EventList* pList )
SortListData::SortListData( sal_IntPtr nPos ) SortListData::SortListData( sal_IntPtr nPos )
: mbModified(false)
, mnCurPos(nPos)
, mnOldPos(nPos)
{ {
mbModified = false;
mnCurPos = nPos;
mnOldPos = nPos;
}; };
SortedEntryList::SortedEntryList() SortedEntryList::SortedEntryList()

View File

@@ -74,9 +74,8 @@ private:
Prot::Prot() Prot::Prot()
: m_xContext(cppu::defaultBootstrap_InitialComponentContext())
{ {
m_xContext = cppu::defaultBootstrap_InitialComponentContext();
uno::Reference<lang::XMultiComponentFactory> xFactory = m_xContext->getServiceManager(); uno::Reference<lang::XMultiComponentFactory> xFactory = m_xContext->getServiceManager();
uno::Reference<lang::XMultiServiceFactory> xSFactory(xFactory, uno::UNO_QUERY_THROW); uno::Reference<lang::XMultiServiceFactory> xSFactory(xFactory, uno::UNO_QUERY_THROW);

View File

@@ -65,9 +65,10 @@ public:
}; };
SvtSearchOptions_Impl::SvtSearchOptions_Impl() : 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(); Load();
SetModified( false ); SetModified( false );
} }

View File

@@ -1017,16 +1017,13 @@ SchXMLExportHelper_Impl::SchXMLExportHelper_Impl(
SvXMLAutoStylePoolP& rASPool ) : SvXMLAutoStylePoolP& rASPool ) :
mrExport( rExport ), mrExport( rExport ),
mrAutoStylePool( rASPool ), mrAutoStylePool( rASPool ),
mxPropertySetMapper( new XMLChartPropertySetMapper( true ) ),
mxExpPropMapper( new XMLChartExportPropertyMapper( mxPropertySetMapper, rExport ) ),
msTableName("local-table"),
mbHasCategoryLabels( false ), mbHasCategoryLabels( false ),
mbRowSourceColumns( true ), mbRowSourceColumns( true ),
msCLSID( SvGlobalName( SO3_SCH_CLASSID ).GetHexName() ) 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 // register chart auto-style family
mrAutoStylePool.AddFamily( mrAutoStylePool.AddFamily(
XML_STYLE_FAMILY_SCH_CHART_ID, XML_STYLE_FAMILY_SCH_CHART_ID,

View File

@@ -283,17 +283,14 @@ public:
}; };
SvXMLExport_Impl::SvXMLExport_Impl() SvXMLExport_Impl::SvXMLExport_Impl()
: mxUriReferenceFactory( uri::UriReferenceFactory::create(comphelper::getProcessComponentContext()) ),
// Written OpenDocument file format doesn't fit to the created text document (#i69627#) // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
: mbOutlineStyleAsNormalListStyle( false ) mbOutlineStyleAsNormalListStyle( false ),
,mbSaveBackwardCompatibleODF( true ) mbSaveBackwardCompatibleODF( true ),
,mStreamName() mDepth( 0 ),
,mNamespaceMaps() mbExportTextNumberElement( false ),
,mDepth(0) mbNullDateInitialized( false )
,mpRDFaHelper() // lazy
,mbExportTextNumberElement( false )
,mbNullDateInitialized( false )
{ {
mxUriReferenceFactory = uri::UriReferenceFactory::create( comphelper::getProcessComponentContext() );
} }
void SvXMLExport::SetDocHandler( const uno::Reference< xml::sax::XDocumentHandler > &rHandler ) void SvXMLExport::SetDocHandler( const uno::Reference< xml::sax::XDocumentHandler > &rHandler )

View File

@@ -92,34 +92,25 @@ public:
struct SvXMLNumberInfo struct SvXMLNumberInfo
{ {
sal_Int32 nDecimals; sal_Int32 nDecimals = -1;
sal_Int32 nInteger; sal_Int32 nInteger = -1;
sal_Int32 nExpDigits; sal_Int32 nExpDigits = -1;
sal_Int32 nExpInterval; sal_Int32 nExpInterval = -1;
sal_Int32 nMinNumerDigits; sal_Int32 nMinNumerDigits = -1;
sal_Int32 nMinDenomDigits; sal_Int32 nMinDenomDigits = -1;
sal_Int32 nMaxNumerDigits; sal_Int32 nMaxNumerDigits = -1;
sal_Int32 nMaxDenomDigits; sal_Int32 nMaxDenomDigits = -1;
sal_Int32 nFracDenominator; sal_Int32 nFracDenominator = -1;
sal_Int32 nMinDecimalDigits; sal_Int32 nMinDecimalDigits = -1;
sal_Int32 nZerosNumerDigits; sal_Int32 nZerosNumerDigits = -1;
sal_Int32 nZerosDenomDigits; sal_Int32 nZerosDenomDigits = -1;
bool bGrouping; bool bGrouping = false;
bool bDecReplace; bool bDecReplace = false;
bool bExpSign; bool bExpSign = true;
bool bDecAlign; bool bDecAlign = false;
double fDisplayFactor; double fDisplayFactor = 1.0;
OUString aIntegerFractionDelimiter; OUString aIntegerFractionDelimiter;
std::map<sal_Int32, OUString> m_EmbeddedElements; 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 class SvXMLNumFmtElementContext : public SvXMLImportContext