From 76936e787bd13fb1a747b7c716df3fba2d0d3fa9 Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Sat, 3 Dec 2016 13:39:44 +0100 Subject: cppcheck style fix for noExplicitConstructor in writerfilter make ctors with one parameter explicit Change-Id: I08e753cea9f5ea17d654c889bad37ab7d0f4611e Reviewed-on: https://gerrit.libreoffice.org/31588 Tested-by: Jenkins Reviewed-by: Jochen Nitschke --- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 6 +++--- writerfilter/source/dmapper/DomainMapper_Impl.hxx | 8 ++++---- writerfilter/source/dmapper/OLEHandler.hxx | 2 +- writerfilter/source/dmapper/SdtHelper.hxx | 2 +- writerfilter/source/dmapper/TableData.hxx | 2 +- writerfilter/source/dmapper/TextEffectsHandler.hxx | 2 +- writerfilter/source/rtftok/rtfdocumentimpl.hxx | 4 ++-- writerfilter/source/rtftok/rtffly.hxx | 4 ++-- writerfilter/source/rtftok/rtfreferenceproperties.hxx | 2 +- writerfilter/source/rtftok/rtfreferencetable.hxx | 2 +- writerfilter/source/rtftok/rtfskipdestination.hxx | 2 +- writerfilter/source/rtftok/rtfvalue.hxx | 12 ++++++------ 12 files changed, 24 insertions(+), 24 deletions(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 983b27c8cb55..87d93bec313f 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1859,14 +1859,14 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape // shapes for OLE objects. m_aTextAppendStack.push(TextAppendContext(uno::Reference(xShape, uno::UNO_QUERY), uno::Reference())); uno::Reference xTxtContent(xShape, uno::UNO_QUERY); - m_aAnchoredStack.push(xTxtContent); + m_aAnchoredStack.push(AnchoredContext(xTxtContent)); } else if (xSInfo->supportsService("com.sun.star.drawing.OLE2Shape")) { // OLE2Shape from oox should be converted to a TextEmbeddedObject for sw. m_aTextAppendStack.push(TextAppendContext(uno::Reference(xShape, uno::UNO_QUERY), uno::Reference())); uno::Reference xTextContent(xShape, uno::UNO_QUERY); - m_aAnchoredStack.push(xTextContent); + m_aAnchoredStack.push(AnchoredContext(xTextContent)); uno::Reference xShapePropertySet(xShape, uno::UNO_QUERY); m_xEmbedded.set(m_xTextFactory->createInstance("com.sun.star.text.TextEmbeddedObject"), uno::UNO_QUERY_THROW); @@ -1887,7 +1887,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape // Add the shape to the anchored objects stack uno::Reference< text::XTextContent > xTxtContent( xShape, uno::UNO_QUERY_THROW ); - m_aAnchoredStack.push( xTxtContent ); + m_aAnchoredStack.push( AnchoredContext(xTxtContent) ); uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY_THROW ); #ifdef DEBUG_WRITERFILTER diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index c69e114a69ff..ae503660dae7 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -128,7 +128,7 @@ class HeaderFooterContext { bool m_bTextInserted; public: - HeaderFooterContext(bool bTextInserted); + explicit HeaderFooterContext(bool bTextInserted); bool getTextInserted(); }; @@ -156,7 +156,7 @@ class FieldContext PropertyMapPtr m_pProperties; public: - FieldContext(css::uno::Reference const& xStart); + explicit FieldContext(css::uno::Reference const& xStart); ~FieldContext(); const css::uno::Reference& GetStartRange() const { return m_xStartRange; } @@ -219,7 +219,7 @@ struct AnchoredContext css::uno::Reference xTextContent; bool bToRemove; - AnchoredContext(const css::uno::Reference& xContent) + explicit AnchoredContext(const css::uno::Reference& xContent) : xTextContent(xContent), bToRemove(false) { } @@ -233,7 +233,7 @@ typedef std::shared_ptr FieldContextPtr; struct DeletableTabStop : public css::style::TabStop { bool bDeleted; - DeletableTabStop() + explicit DeletableTabStop() : bDeleted(false) { // same defaults as SvxXMLTabStopContext_Impl diff --git a/writerfilter/source/dmapper/OLEHandler.hxx b/writerfilter/source/dmapper/OLEHandler.hxx index 2f99de501e5f..268138dcbbcd 100644 --- a/writerfilter/source/dmapper/OLEHandler.hxx +++ b/writerfilter/source/dmapper/OLEHandler.hxx @@ -77,7 +77,7 @@ class OLEHandler : public LoggedProperties virtual void lcl_sprm(Sprm & sprm) override; public: - OLEHandler(DomainMapper& rDomainMapper); + explicit OLEHandler(DomainMapper& rDomainMapper); virtual ~OLEHandler() override; const css::uno::Reference& getShape() { return m_xShape; }; diff --git a/writerfilter/source/dmapper/SdtHelper.hxx b/writerfilter/source/dmapper/SdtHelper.hxx index a619d508f2de..a1fc08d50b55 100644 --- a/writerfilter/source/dmapper/SdtHelper.hxx +++ b/writerfilter/source/dmapper/SdtHelper.hxx @@ -69,7 +69,7 @@ class SdtHelper final /// Create and append the drawing::XControlShape, containing the various models. void createControlShape(css::awt::Size aSize, css::uno::Reference const&, const css::uno::Sequence& rGrabBag); public: - SdtHelper(DomainMapper_Impl& rDM_Impl); + explicit SdtHelper(DomainMapper_Impl& rDM_Impl); ~SdtHelper(); std::vector& getDropDownItems() diff --git a/writerfilter/source/dmapper/TableData.hxx b/writerfilter/source/dmapper/TableData.hxx index 03ad4995119e..8fd385feedfe 100644 --- a/writerfilter/source/dmapper/TableData.hxx +++ b/writerfilter/source/dmapper/TableData.hxx @@ -263,7 +263,7 @@ class TableData public: typedef std::shared_ptr Pointer_t; - TableData(unsigned int nDepth) : mnDepth(nDepth) { newRow(); } + explicit TableData(unsigned int nDepth) : mnDepth(nDepth) { newRow(); } ~TableData() {} /** diff --git a/writerfilter/source/dmapper/TextEffectsHandler.hxx b/writerfilter/source/dmapper/TextEffectsHandler.hxx index fd89b2adf5d8..31984efabed2 100644 --- a/writerfilter/source/dmapper/TextEffectsHandler.hxx +++ b/writerfilter/source/dmapper/TextEffectsHandler.hxx @@ -43,7 +43,7 @@ private: virtual void lcl_sprm(Sprm& sprm) override; public: - TextEffectsHandler(sal_uInt32 aElementId); + explicit TextEffectsHandler(sal_uInt32 aElementId); virtual ~TextEffectsHandler() override; const boost::optional& getGrabBagPropertyId() { return maPropertyId;} diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 0a21bbf25808..559605a321fa 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -195,7 +195,7 @@ private: Id m_nHRule; boost::optional m_oWrap; public: - RTFFrame(RTFParserState* pParserState); + explicit RTFFrame(RTFParserState* pParserState); sal_Int16 m_nAnchorType; /// Convert the stored properties to Sprms @@ -213,7 +213,7 @@ class RTFDocumentImpl; class RTFParserState { public: - RTFParserState(RTFDocumentImpl* pDocumentImpl); + explicit RTFParserState(RTFDocumentImpl* pDocumentImpl); RTFDocumentImpl* m_pDocumentImpl; RTFInternalState nInternalState; diff --git a/writerfilter/source/rtftok/rtffly.hxx b/writerfilter/source/rtftok/rtffly.hxx index 14a84b54c5bb..8da0ffd9d9a1 100644 --- a/writerfilter/source/rtftok/rtffly.hxx +++ b/writerfilter/source/rtftok/rtffly.hxx @@ -22,7 +22,7 @@ namespace rtftok class RTFVertOrient { public: - RTFVertOrient(sal_uInt16 nValue) + explicit RTFVertOrient(sal_uInt16 nValue) : m_nVal(nValue) { } @@ -83,7 +83,7 @@ private: class RTFHoriOrient { public: - RTFHoriOrient(sal_uInt16 nValue) + explicit RTFHoriOrient(sal_uInt16 nValue) : m_nVal(nValue) { } diff --git a/writerfilter/source/rtftok/rtfreferenceproperties.hxx b/writerfilter/source/rtftok/rtfreferenceproperties.hxx index a10572fd7e83..caffc32e5244 100644 --- a/writerfilter/source/rtftok/rtfreferenceproperties.hxx +++ b/writerfilter/source/rtftok/rtfreferenceproperties.hxx @@ -22,7 +22,7 @@ class RTFReferenceProperties { public: RTFReferenceProperties(RTFSprms rAttributes, RTFSprms rSprms); - RTFReferenceProperties(RTFSprms rAttributes); + explicit RTFReferenceProperties(RTFSprms rAttributes); virtual ~RTFReferenceProperties(); virtual void resolve(Properties& rHandler) override; RTFSprms& getAttributes() diff --git a/writerfilter/source/rtftok/rtfreferencetable.hxx b/writerfilter/source/rtftok/rtfreferencetable.hxx index 5fe3318a1e35..b633a99853c3 100644 --- a/writerfilter/source/rtftok/rtfreferencetable.hxx +++ b/writerfilter/source/rtftok/rtfreferencetable.hxx @@ -24,7 +24,7 @@ class RTFReferenceTable public: typedef std::map::Pointer_t> Entries_t; typedef std::pair::Pointer_t> Entry_t; - RTFReferenceTable(Entries_t const& rEntries); + explicit RTFReferenceTable(Entries_t const& rEntries); virtual ~RTFReferenceTable(); virtual void resolve(Table& rHandler) override; private: diff --git a/writerfilter/source/rtftok/rtfskipdestination.hxx b/writerfilter/source/rtftok/rtfskipdestination.hxx index 50be7549c51c..d153459dfcbf 100644 --- a/writerfilter/source/rtftok/rtfskipdestination.hxx +++ b/writerfilter/source/rtftok/rtfskipdestination.hxx @@ -20,7 +20,7 @@ namespace rtftok class RTFSkipDestination final { public: - RTFSkipDestination(RTFListener& rImport); + explicit RTFSkipDestination(RTFListener& rImport); ~RTFSkipDestination(); void setParsed(bool bParsed); void setReset(bool bReset); diff --git a/writerfilter/source/rtftok/rtfvalue.hxx b/writerfilter/source/rtftok/rtfvalue.hxx index eeb973094021..d113fbf85e3b 100644 --- a/writerfilter/source/rtftok/rtfvalue.hxx +++ b/writerfilter/source/rtftok/rtfvalue.hxx @@ -32,14 +32,14 @@ public: css::uno::Reference const& xObject, bool bForceString, const RTFShape& aShape); RTFValue(); - RTFValue(int nValue); + explicit RTFValue(int nValue); RTFValue(const OUString& sValue, bool bForce = false); - RTFValue(RTFSprms rAttributes); + explicit RTFValue(RTFSprms rAttributes); RTFValue(RTFSprms rAttributes, RTFSprms rSprms); - RTFValue(css::uno::Reference const& xShape); - RTFValue(css::uno::Reference const& xStream); - RTFValue(css::uno::Reference const& xObject); - RTFValue(const RTFShape& aShape); + explicit RTFValue(css::uno::Reference const& xShape); + explicit RTFValue(css::uno::Reference const& xStream); + explicit RTFValue(css::uno::Reference const& xObject); + explicit RTFValue(const RTFShape& aShape); virtual ~RTFValue() override; void setString(const OUString& sValue); virtual int getInt() const override; -- cgit