Kaydet (Commit) 916e1e61 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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: 's avatarStephan Bergmann <sbergman@redhat.com>
üst de573ba8
...@@ -229,6 +229,11 @@ public: ...@@ -229,6 +229,11 @@ public:
explicit ContextHandler2( ContextHandler2Helper const & rParent ); explicit ContextHandler2( ContextHandler2Helper const & rParent );
virtual ~ContextHandler2() override; virtual ~ContextHandler2() override;
ContextHandler2(ContextHandler2 const &) = default;
ContextHandler2(ContextHandler2 &&) = default;
ContextHandler2 & operator =(ContextHandler2 const &) = default;
ContextHandler2 & operator =(ContextHandler2 &&) = default;
// resolve ambiguity from base classes // resolve ambiguity from base classes
virtual void SAL_CALL acquire() throw() override { ContextHandler::acquire(); } virtual void SAL_CALL acquire() throw() override { ContextHandler::acquire(); }
virtual void SAL_CALL release() throw() override { ContextHandler::release(); } virtual void SAL_CALL release() throw() override { ContextHandler::release(); }
......
...@@ -93,6 +93,11 @@ public: ...@@ -93,6 +93,11 @@ public:
explicit FragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath ); explicit FragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath );
virtual ~FragmentHandler() override; 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. */ /** Returns the com.sun.star.xml.sax.XFastContextHandler interface of this context. */
css::uno::Reference< css::xml::sax::XFastContextHandler > css::uno::Reference< css::xml::sax::XFastContextHandler >
getFastContextHandler() { return static_cast< ContextHandler* >( this ); } getFastContextHandler() { return static_cast< ContextHandler* >( this ); }
......
...@@ -69,6 +69,11 @@ public: ...@@ -69,6 +69,11 @@ public:
bool bEnableTrimSpace = true ); bool bEnableTrimSpace = true );
virtual ~FragmentHandler2() override; virtual ~FragmentHandler2() override;
FragmentHandler2(FragmentHandler2 const &) = default;
FragmentHandler2(FragmentHandler2 &&) = default;
FragmentHandler2 & operator =(FragmentHandler2 const &) = default;
FragmentHandler2 & operator =(FragmentHandler2 &&) = default;
// resolve ambiguity from base classes // resolve ambiguity from base classes
virtual void SAL_CALL acquire() throw() override { FragmentHandler::acquire(); } virtual void SAL_CALL acquire() throw() override { FragmentHandler::acquire(); }
virtual void SAL_CALL release() throw() override { FragmentHandler::release(); } virtual void SAL_CALL release() throw() override { FragmentHandler::release(); }
......
...@@ -443,6 +443,11 @@ class Base ...@@ -443,6 +443,11 @@ class Base
public: public:
virtual ~Base(); virtual ~Base();
Base(Base const &) = default;
Base(Base &&) = default;
Base & operator =(Base const &) = default;
Base & operator =(Base &&) = default;
bool isValid() const { return implIsValid(); } bool isValid() const { return implIsValid(); }
static bool isValid( const std::shared_ptr< Base >& rxBase ) { return rxBase.get() && rxBase->isValid(); } 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 ...@@ -829,7 +834,6 @@ void SharedConfigData::readNameList( TextInputStream& rStrm, const OUString& rLi
class Config : public Base class Config : public Base
{ {
public: public:
explicit Config( const Config& rParent );
explicit Config( explicit Config(
const sal_Char* pcEnvVar, const sal_Char* pcEnvVar,
const ::oox::core::FilterBase& rFilter ); const ::oox::core::FilterBase& rFilter );
...@@ -841,6 +845,11 @@ public: ...@@ -841,6 +845,11 @@ public:
virtual ~Config() override; 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 css::uno::Reference< css::uno::XComponentContext >& getContext() const { return mxCfgData->getContext(); }
const StorageRef& getRootStorage() const { return mxCfgData->getRootStorage(); } const StorageRef& getRootStorage() const { return mxCfgData->getRootStorage(); }
const OUString& getSysFileName() const { return mxCfgData->getSysFileName(); } const OUString& getSysFileName() const { return mxCfgData->getSysFileName(); }
...@@ -1089,6 +1098,11 @@ class ObjectBase : public Base ...@@ -1089,6 +1098,11 @@ class ObjectBase : public Base
public: public:
virtual ~ObjectBase() override; 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 >& const css::uno::Reference< css::uno::XComponentContext >&
getContext() const { return mxConfig->getContext(); } getContext() const { return mxConfig->getContext(); }
...@@ -1189,6 +1203,10 @@ class OutputObjectBase : public ObjectBase ...@@ -1189,6 +1203,10 @@ class OutputObjectBase : public ObjectBase
public: public:
virtual ~OutputObjectBase() override; virtual ~OutputObjectBase() override;
OutputObjectBase(OutputObjectBase const &) = default;
OutputObjectBase(OutputObjectBase &&) = default;
OutputObjectBase & operator =(OutputObjectBase const &) = default;
OutputObjectBase & operator =(OutputObjectBase &&) = default;
protected: protected:
OutputObjectBase() {} OutputObjectBase() {}
...@@ -1353,6 +1371,10 @@ class InputObjectBase : public OutputObjectBase ...@@ -1353,6 +1371,10 @@ class InputObjectBase : public OutputObjectBase
public: public:
virtual ~InputObjectBase() override; virtual ~InputObjectBase() override;
InputObjectBase(InputObjectBase const &) = default;
InputObjectBase(InputObjectBase &&) = default;
InputObjectBase & operator =(InputObjectBase const &) = default;
InputObjectBase & operator =(InputObjectBase &&) = default;
protected: protected:
InputObjectBase() {} InputObjectBase() {}
......
...@@ -64,6 +64,11 @@ public: ...@@ -64,6 +64,11 @@ public:
const css::awt::Size& rChartSize ); const css::awt::Size& rChartSize );
virtual ~ConverterRoot(); 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. */ /** Creates an instance for the passed service name, using the process service factory. */
css::uno::Reference< css::uno::XInterface > css::uno::Reference< css::uno::XInterface >
createInstance( const OUString& rServiceName ) const; createInstance( const OUString& rServiceName ) const;
......
...@@ -36,7 +36,6 @@ class TableProperties ...@@ -36,7 +36,6 @@ class TableProperties
public: public:
TableProperties(); TableProperties();
~TableProperties();
std::vector< sal_Int32 >& getTableGrid() { return mvTableGrid; }; std::vector< sal_Int32 >& getTableGrid() { return mvTableGrid; };
std::vector< TableRow >& getTableRows() { return mvTableRows; }; std::vector< TableRow >& getTableRows() { return mvTableRows; };
......
...@@ -38,7 +38,6 @@ class TableStylePart ...@@ -38,7 +38,6 @@ class TableStylePart
public: public:
TableStylePart(); TableStylePart();
~TableStylePart();
::oox::drawingml::Color& getTextColor(){ return maTextColor; } ::oox::drawingml::Color& getTextColor(){ return maTextColor; }
::boost::optional< bool >& getTextBoldStyle(){ return maTextBoldStyle; } ::boost::optional< bool >& getTextBoldStyle(){ return maTextBoldStyle; }
......
...@@ -80,7 +80,6 @@ class TextParagraphProperties ...@@ -80,7 +80,6 @@ class TextParagraphProperties
public: public:
TextParagraphProperties(); TextParagraphProperties();
~TextParagraphProperties();
void setLevel( sal_Int16 nLevel ) { mnLevel = nLevel; } void setLevel( sal_Int16 nLevel ) { mnLevel = nLevel; }
sal_Int16 getLevel( ) const { return mnLevel; } sal_Int16 getLevel( ) const { return mnLevel; }
......
...@@ -48,9 +48,6 @@ TableProperties::TableProperties() ...@@ -48,9 +48,6 @@ TableProperties::TableProperties()
, mbBandCol( false ) , mbBandCol( false )
{ {
} }
TableProperties::~TableProperties()
{
}
void CreateTableRows( const uno::Reference< XTableRows >& xTableRows, const std::vector< TableRow >& rvTableRows ) void CreateTableRows( const uno::Reference< XTableRows >& xTableRows, const std::vector< TableRow >& rvTableRows )
{ {
......
...@@ -31,10 +31,6 @@ TableStylePart::TableStylePart() ...@@ -31,10 +31,6 @@ TableStylePart::TableStylePart()
{ {
} }
TableStylePart::~TableStylePart()
{
}
} } } } } }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -366,10 +366,6 @@ TextParagraphProperties::TextParagraphProperties() ...@@ -366,10 +366,6 @@ TextParagraphProperties::TextParagraphProperties()
{ {
} }
TextParagraphProperties::~TextParagraphProperties()
{
}
void TextParagraphProperties::apply( const TextParagraphProperties& rSourceProps ) void TextParagraphProperties::apply( const TextParagraphProperties& rSourceProps )
{ {
maTextParagraphPropertyMap.assignAll( rSourceProps.maTextParagraphPropertyMap ); maTextParagraphPropertyMap.assignAll( rSourceProps.maTextParagraphPropertyMap );
......
...@@ -1385,12 +1385,6 @@ void SharedConfigData::createUnitConverter( const OUString& rData ) ...@@ -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 ) Config::Config( const sal_Char* pcEnvVar, const FilterBase& rFilter )
{ {
construct( pcEnvVar, rFilter ); construct( pcEnvVar, rFilter );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment