diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-07-26 12:28:19 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-07-26 20:45:22 +0200 |
commit | 916e1e61a1b2d7f1b822b4b90d63f4e34719a090 (patch) | |
tree | f9a79424083f4a18ff8cdf271e6f6d955d09b467 | |
parent | de573ba8e67f165693e58e05d80756e5b55852e7 (diff) |
oox: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)
...by explicitly defaulting the copy/move functions (and, where needed in turn,
also a default ctor) for classes that have a user-declared dtor that does
nothing other than an implicitly-defined one would do, but needs to be user-
declared because it is virtual and potentially serves as a key function to
emit the vtable, or is non-public, etc.; and by removing explicitly user-
provided functions that do the same as their implicitly-defined counterparts,
but may prevent implicitly declared copy functions from being defined as non-
deleted in the future. (Even if such a user-provided function was declared
non-inline in an include file, the apparently-used implicitly-defined copy
functions are already include, so why bother with non-inline functions.)
Change-Id: Id05e85ac8ac4155e6345b6f96ddf9449f640dc98
Reviewed-on: https://gerrit.libreoffice.org/58083
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | include/oox/core/contexthandler2.hxx | 5 | ||||
-rw-r--r-- | include/oox/core/fragmenthandler.hxx | 5 | ||||
-rw-r--r-- | include/oox/core/fragmenthandler2.hxx | 5 | ||||
-rw-r--r-- | include/oox/dump/dumperbase.hxx | 24 | ||||
-rw-r--r-- | oox/inc/drawingml/chart/converterbase.hxx | 5 | ||||
-rw-r--r-- | oox/inc/drawingml/table/tableproperties.hxx | 1 | ||||
-rw-r--r-- | oox/inc/drawingml/table/tablestylepart.hxx | 1 | ||||
-rw-r--r-- | oox/inc/drawingml/textparagraphproperties.hxx | 1 | ||||
-rw-r--r-- | oox/source/drawingml/table/tableproperties.cxx | 3 | ||||
-rw-r--r-- | oox/source/drawingml/table/tablestylepart.cxx | 4 | ||||
-rw-r--r-- | oox/source/drawingml/textparagraphproperties.cxx | 4 | ||||
-rw-r--r-- | oox/source/dump/dumperbase.cxx | 6 |
12 files changed, 43 insertions, 21 deletions
diff --git a/include/oox/core/contexthandler2.hxx b/include/oox/core/contexthandler2.hxx index c14ddcd62ada..5df9a6b3bd05 100644 --- a/include/oox/core/contexthandler2.hxx +++ b/include/oox/core/contexthandler2.hxx @@ -229,6 +229,11 @@ public: explicit ContextHandler2( ContextHandler2Helper const & rParent ); virtual ~ContextHandler2() override; + ContextHandler2(ContextHandler2 const &) = default; + ContextHandler2(ContextHandler2 &&) = default; + ContextHandler2 & operator =(ContextHandler2 const &) = default; + ContextHandler2 & operator =(ContextHandler2 &&) = default; + // resolve ambiguity from base classes virtual void SAL_CALL acquire() throw() override { ContextHandler::acquire(); } virtual void SAL_CALL release() throw() override { ContextHandler::release(); } diff --git a/include/oox/core/fragmenthandler.hxx b/include/oox/core/fragmenthandler.hxx index 93666aa344e8..c92cb411a6f9 100644 --- a/include/oox/core/fragmenthandler.hxx +++ b/include/oox/core/fragmenthandler.hxx @@ -93,6 +93,11 @@ public: explicit FragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath ); virtual ~FragmentHandler() override; + FragmentHandler(FragmentHandler const &) = default; + FragmentHandler(FragmentHandler &&) = default; + FragmentHandler & operator =(FragmentHandler const &) = default; + FragmentHandler & operator =(FragmentHandler &&) = default; + /** Returns the com.sun.star.xml.sax.XFastContextHandler interface of this context. */ css::uno::Reference< css::xml::sax::XFastContextHandler > getFastContextHandler() { return static_cast< ContextHandler* >( this ); } diff --git a/include/oox/core/fragmenthandler2.hxx b/include/oox/core/fragmenthandler2.hxx index f32ee1064ab5..2a262c470646 100644 --- a/include/oox/core/fragmenthandler2.hxx +++ b/include/oox/core/fragmenthandler2.hxx @@ -69,6 +69,11 @@ public: bool bEnableTrimSpace = true ); virtual ~FragmentHandler2() override; + FragmentHandler2(FragmentHandler2 const &) = default; + FragmentHandler2(FragmentHandler2 &&) = default; + FragmentHandler2 & operator =(FragmentHandler2 const &) = default; + FragmentHandler2 & operator =(FragmentHandler2 &&) = default; + // resolve ambiguity from base classes virtual void SAL_CALL acquire() throw() override { FragmentHandler::acquire(); } virtual void SAL_CALL release() throw() override { FragmentHandler::release(); } diff --git a/include/oox/dump/dumperbase.hxx b/include/oox/dump/dumperbase.hxx index 9a1f3586b3e9..03369e2d8d03 100644 --- a/include/oox/dump/dumperbase.hxx +++ b/include/oox/dump/dumperbase.hxx @@ -443,6 +443,11 @@ class Base public: virtual ~Base(); + Base(Base const &) = default; + Base(Base &&) = default; + Base & operator =(Base const &) = default; + Base & operator =(Base &&) = default; + bool isValid() const { return implIsValid(); } static bool isValid( const std::shared_ptr< Base >& rxBase ) { return rxBase.get() && rxBase->isValid(); } @@ -829,7 +834,6 @@ void SharedConfigData::readNameList( TextInputStream& rStrm, const OUString& rLi class Config : public Base { public: - explicit Config( const Config& rParent ); explicit Config( const sal_Char* pcEnvVar, const ::oox::core::FilterBase& rFilter ); @@ -841,6 +845,11 @@ public: virtual ~Config() override; + Config(Config const &) = default; + Config(Config &&) = default; + Config & operator =(Config const &) = default; + Config & operator =(Config &&) = default; + const css::uno::Reference< css::uno::XComponentContext >& getContext() const { return mxCfgData->getContext(); } const StorageRef& getRootStorage() const { return mxCfgData->getRootStorage(); } const OUString& getSysFileName() const { return mxCfgData->getSysFileName(); } @@ -1089,6 +1098,11 @@ class ObjectBase : public Base public: virtual ~ObjectBase() override; + ObjectBase(ObjectBase const &) = default; + ObjectBase(ObjectBase &&) = default; + ObjectBase & operator =(ObjectBase const &) = default; + ObjectBase & operator =(ObjectBase &&) = default; + const css::uno::Reference< css::uno::XComponentContext >& getContext() const { return mxConfig->getContext(); } @@ -1189,6 +1203,10 @@ class OutputObjectBase : public ObjectBase public: virtual ~OutputObjectBase() override; + OutputObjectBase(OutputObjectBase const &) = default; + OutputObjectBase(OutputObjectBase &&) = default; + OutputObjectBase & operator =(OutputObjectBase const &) = default; + OutputObjectBase & operator =(OutputObjectBase &&) = default; protected: OutputObjectBase() {} @@ -1353,6 +1371,10 @@ class InputObjectBase : public OutputObjectBase public: virtual ~InputObjectBase() override; + InputObjectBase(InputObjectBase const &) = default; + InputObjectBase(InputObjectBase &&) = default; + InputObjectBase & operator =(InputObjectBase const &) = default; + InputObjectBase & operator =(InputObjectBase &&) = default; protected: InputObjectBase() {} diff --git a/oox/inc/drawingml/chart/converterbase.hxx b/oox/inc/drawingml/chart/converterbase.hxx index 11e14ebaf596..afd0f097f63c 100644 --- a/oox/inc/drawingml/chart/converterbase.hxx +++ b/oox/inc/drawingml/chart/converterbase.hxx @@ -64,6 +64,11 @@ public: const css::awt::Size& rChartSize ); virtual ~ConverterRoot(); + ConverterRoot(ConverterRoot const &) = default; + ConverterRoot(ConverterRoot &&) = default; + ConverterRoot & operator =(ConverterRoot const &) = default; + ConverterRoot & operator =(ConverterRoot &&) = default; + /** Creates an instance for the passed service name, using the process service factory. */ css::uno::Reference< css::uno::XInterface > createInstance( const OUString& rServiceName ) const; diff --git a/oox/inc/drawingml/table/tableproperties.hxx b/oox/inc/drawingml/table/tableproperties.hxx index 578230daa876..0cd500279974 100644 --- a/oox/inc/drawingml/table/tableproperties.hxx +++ b/oox/inc/drawingml/table/tableproperties.hxx @@ -36,7 +36,6 @@ class TableProperties public: TableProperties(); - ~TableProperties(); std::vector< sal_Int32 >& getTableGrid() { return mvTableGrid; }; std::vector< TableRow >& getTableRows() { return mvTableRows; }; diff --git a/oox/inc/drawingml/table/tablestylepart.hxx b/oox/inc/drawingml/table/tablestylepart.hxx index 43759ae96672..2a03339962ca 100644 --- a/oox/inc/drawingml/table/tablestylepart.hxx +++ b/oox/inc/drawingml/table/tablestylepart.hxx @@ -38,7 +38,6 @@ class TableStylePart public: TableStylePart(); - ~TableStylePart(); ::oox::drawingml::Color& getTextColor(){ return maTextColor; } ::boost::optional< bool >& getTextBoldStyle(){ return maTextBoldStyle; } diff --git a/oox/inc/drawingml/textparagraphproperties.hxx b/oox/inc/drawingml/textparagraphproperties.hxx index 2710dcb484b2..5b8093bab391 100644 --- a/oox/inc/drawingml/textparagraphproperties.hxx +++ b/oox/inc/drawingml/textparagraphproperties.hxx @@ -80,7 +80,6 @@ class TextParagraphProperties public: TextParagraphProperties(); - ~TextParagraphProperties(); void setLevel( sal_Int16 nLevel ) { mnLevel = nLevel; } sal_Int16 getLevel( ) const { return mnLevel; } diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx index 2c92390772e8..3be685a954d3 100644 --- a/oox/source/drawingml/table/tableproperties.cxx +++ b/oox/source/drawingml/table/tableproperties.cxx @@ -48,9 +48,6 @@ TableProperties::TableProperties() , mbBandCol( false ) { } -TableProperties::~TableProperties() -{ -} void CreateTableRows( const uno::Reference< XTableRows >& xTableRows, const std::vector< TableRow >& rvTableRows ) { diff --git a/oox/source/drawingml/table/tablestylepart.cxx b/oox/source/drawingml/table/tablestylepart.cxx index 7e3e9eb0702c..322021e1e6ef 100644 --- a/oox/source/drawingml/table/tablestylepart.cxx +++ b/oox/source/drawingml/table/tablestylepart.cxx @@ -31,10 +31,6 @@ TableStylePart::TableStylePart() { } -TableStylePart::~TableStylePart() -{ -} - } } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx index 8731047cd4b6..c4ad9e7493c5 100644 --- a/oox/source/drawingml/textparagraphproperties.cxx +++ b/oox/source/drawingml/textparagraphproperties.cxx @@ -366,10 +366,6 @@ TextParagraphProperties::TextParagraphProperties() { } -TextParagraphProperties::~TextParagraphProperties() -{ -} - void TextParagraphProperties::apply( const TextParagraphProperties& rSourceProps ) { maTextParagraphPropertyMap.assignAll( rSourceProps.maTextParagraphPropertyMap ); diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index e68db52a2015..b38e5f54fbe9 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -1385,12 +1385,6 @@ void SharedConfigData::createUnitConverter( const OUString& rData ) } } -Config::Config( const Config& rParent ) : - Base() // c'tor needs to be called explicitly to avoid compiler warning -{ - *this = rParent; -} - Config::Config( const sal_Char* pcEnvVar, const FilterBase& rFilter ) { construct( pcEnvVar, rFilter ); |