summaryrefslogtreecommitdiff
path: root/odk/examples/DevelopersGuide/Components/CppComponent
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-07-22 13:41:12 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-07-22 15:13:24 +0200
commitddcc98fa50dd9d86a60dada4daa00f4d95ffe005 (patch)
treed9a03e447ac75e7ddad07f4eb81d294310a3dc91 /odk/examples/DevelopersGuide/Components/CppComponent
parent7adb6398dcb081999003c61985ae8a203c65ce0d (diff)
Remove obsolete dynamic exception specifications from SDK example C++ code
GCC 11 trunk g++ defaults to C++17 now, so that CustomTarget_odk/build-examples and CustomTarget_odk/build-examples_java would now fail with "error: ISO C++17 does not allow dynamic exception specifications". 550e0e42d9ccef1244299b2d6cbda18549f8af19 "Remove dynamic exception specifications from cppumaker-generated code" had long since removed the exception specifications from the underlying (C++ classes representing) UNO interface types, so just remove them from the SDK example code, too. An alternative would have been to make sure those CustomTarget use an old C++ compiler standard. However, testing that the examples work against a new standard has probably similar merit to testing that they keep working against some obsolete standard. Change-Id: I8ec9ac2f9ced7bd1b746fb00d9bce94bf6aedda5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99218 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'odk/examples/DevelopersGuide/Components/CppComponent')
-rw-r--r--odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx32
-rw-r--r--odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx24
2 files changed, 14 insertions, 42 deletions
diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx
index b9cf6f17b49b..d68b96876eb5 100644
--- a/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx
+++ b/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx
@@ -82,34 +82,25 @@ public:
virtual ~MyService1Impl() {}
// XInterface
- virtual Any SAL_CALL queryInterface( Type const & type )
- throw (RuntimeException);
+ virtual Any SAL_CALL queryInterface( Type const & type );
virtual void SAL_CALL acquire()
throw ();
virtual void SAL_CALL release()
throw ();
// XTypeProvider
- virtual Sequence< Type > SAL_CALL getTypes()
- throw (RuntimeException);
- virtual Sequence< sal_Int8 > SAL_CALL getImplementationId()
- throw (RuntimeException);
+ virtual Sequence< Type > SAL_CALL getTypes();
+ virtual Sequence< sal_Int8 > SAL_CALL getImplementationId();
// XSomething
- virtual OUString SAL_CALL methodOne( OUString const & str )
- throw (RuntimeException);
- virtual OUString SAL_CALL methodTwo( )
- throw (RuntimeException);
+ virtual OUString SAL_CALL methodOne( OUString const & str );
+ virtual OUString SAL_CALL methodTwo( );
// XServiceInfo
- virtual OUString SAL_CALL getImplementationName()
- throw (RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( OUString const & serviceName )
- throw (RuntimeException);
- virtual Sequence< OUString > SAL_CALL getSupportedServiceNames()
- throw (RuntimeException);
+ virtual OUString SAL_CALL getImplementationName();
+ virtual sal_Bool SAL_CALL supportsService( OUString const & serviceName );
+ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames();
};
// XInterface implementation
Any MyService1Impl::queryInterface( Type const & type )
- throw (RuntimeException)
{
if (type.equals(::cppu::UnoType<XInterface>::get()))
{
@@ -163,7 +154,6 @@ void MyService1Impl::release()
// XTypeProvider implementation
Sequence< Type > MyService1Impl::getTypes()
- throw (RuntimeException)
{
Sequence< Type > seq( 3 );
seq[ 0 ] = ::cppu::UnoType<lang::XTypeProvider>::get();
@@ -173,39 +163,33 @@ Sequence< Type > MyService1Impl::getTypes()
}
Sequence< sal_Int8 > MyService1Impl::getImplementationId()
- throw (RuntimeException)
{
return css::uno::Sequence<sal_Int8>();
}
// XSomething implementation
OUString MyService1Impl::methodOne( OUString const & str )
- throw (RuntimeException)
{
m_sData = str;
return OUString( "called methodOne() of MyService1 implementation: " ) + m_sData;
}
OUString MyService1Impl::methodTwo( )
- throw (RuntimeException)
{
return OUString( "called methodTwo() of MyService1 implementation: " ) + m_sData;
}
// XServiceInfo implementation
OUString MyService1Impl::getImplementationName()
- throw (RuntimeException)
{
// unique implementation name
return OUString("my_module.my_sc_implementation.MyService1");
}
sal_Bool MyService1Impl::supportsService( OUString const & serviceName )
- throw (RuntimeException)
{
return cppu::supportsService(this, serviceName);
}
Sequence< OUString > MyService1Impl::getSupportedServiceNames()
- throw (RuntimeException)
{
// this object only supports one service
OUString serviceName("my_module.MyService1");
diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx
index b032b670e137..840252f691fe 100644
--- a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx
+++ b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx
@@ -89,25 +89,18 @@ public:
// XInitialization will be called upon
// createInstanceWithArguments[AndContext]()
- virtual void SAL_CALL initialize( Sequence< Any > const & args )
- throw (Exception);
+ virtual void SAL_CALL initialize( Sequence< Any > const & args );
// XSomething
- virtual OUString SAL_CALL methodOne( OUString const & str )
- throw (RuntimeException);
- virtual OUString SAL_CALL methodTwo( )
- throw (RuntimeException);
+ virtual OUString SAL_CALL methodOne( OUString const & str );
+ virtual OUString SAL_CALL methodTwo( );
// XServiceInfo
- virtual OUString SAL_CALL getImplementationName()
- throw (RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( OUString const & serviceName )
- throw (RuntimeException);
- virtual Sequence< OUString > SAL_CALL getSupportedServiceNames()
- throw (RuntimeException);
+ virtual OUString SAL_CALL getImplementationName();
+ virtual sal_Bool SAL_CALL supportsService( OUString const & serviceName );
+ virtual Sequence< OUString > SAL_CALL getSupportedServiceNames();
};
// XInitialization implementation
void MyService2Impl::initialize( Sequence< Any > const & args )
- throw (Exception)
{
if (args.getLength() != 1)
{
@@ -131,34 +124,29 @@ void MyService2Impl::initialize( Sequence< Any > const & args )
// XSomething implementation
OUString MyService2Impl::methodOne( OUString const & str )
- throw (RuntimeException)
{
m_sData = str;
return OUString( "called methodOne() of MyService2 implementation: " ) + m_sData;
}
OUString MyService2Impl::methodTwo( )
- throw (RuntimeException)
{
return OUString( "called methodTwo() of MyService2 implementation: " ) + m_sData;
}
// XServiceInfo implementation
OUString MyService2Impl::getImplementationName()
- throw (RuntimeException)
{
// unique implementation name
return OUString("my_module.my_sc_implementation.MyService2");
}
sal_Bool MyService2Impl::supportsService( OUString const & serviceName )
- throw (RuntimeException)
{
return cppu::supportsService(this, serviceName);
}
Sequence< OUString > MyService2Impl::getSupportedServiceNames()
- throw (RuntimeException)
{
return getSupportedServiceNames_MyService2Impl();
}