XUnoTunnel->dynamic_cast in OContentHelper
Change-Id: I3788af96cc8664d8afda2bd5eeaf85e9cd0cf374 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145618 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -105,12 +105,6 @@ css::uno::Sequence< OUString > SAL_CALL OContentHelper::getSupportedServiceNames
|
||||
}
|
||||
|
||||
|
||||
const css::uno::Sequence<sal_Int8> & OContentHelper::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit aId;
|
||||
return aId.getSeq();
|
||||
}
|
||||
|
||||
css::uno::Sequence<sal_Int8> OContentHelper::getImplementationId()
|
||||
{
|
||||
return css::uno::Sequence<sal_Int8>();
|
||||
@@ -552,12 +546,6 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent
|
||||
}
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
sal_Int64 OContentHelper::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this);
|
||||
}
|
||||
|
||||
Reference< XInterface > SAL_CALL OContentHelper::getParent( )
|
||||
{
|
||||
::osl::MutexGuard aGuard(m_aMutex);
|
||||
|
@@ -533,7 +533,7 @@ void ODefinitionContainer::implAppend(const OUString& _rName, const Reference< X
|
||||
// #i44786#
|
||||
lcl_ensureName( _rxNewObject, _rName );
|
||||
|
||||
::rtl::Reference< OContentHelper > pContent = comphelper::getFromUnoTunnel<OContentHelper>( _rxNewObject );
|
||||
::rtl::Reference< OContentHelper > pContent = dynamic_cast<OContentHelper*>( _rxNewObject.get() );
|
||||
if ( pContent.is() )
|
||||
{
|
||||
TContentPtr pImpl = pContent->getImpl();
|
||||
@@ -592,7 +592,7 @@ void ODefinitionContainer::approveNewObject(const OUString& _sName,const Referen
|
||||
DBA_RES( RID_STR_NAME_ALREADY_USED ),
|
||||
*this );
|
||||
|
||||
::rtl::Reference< OContentHelper > pContent( comphelper::getFromUnoTunnel<OContentHelper>( _rxObject ) );
|
||||
::rtl::Reference< OContentHelper > pContent( dynamic_cast<OContentHelper*>( _rxObject.get() ) );
|
||||
if ( !pContent.is() )
|
||||
throw IllegalArgumentException(
|
||||
DBA_RES( RID_STR_OBJECT_CONTAINER_MISMATCH ),
|
||||
|
@@ -668,7 +668,7 @@ OUString SAL_CALL ODocumentContainer::composeHierarchicalName( const OUString& i
|
||||
::rtl::Reference<OContentHelper> pContent;
|
||||
try
|
||||
{
|
||||
pContent = comphelper::getFromUnoTunnel<OContentHelper>(const_cast<ODocumentContainer*>(this)->implGetByName( _sName, true ));
|
||||
pContent = dynamic_cast<OContentHelper*>(const_cast<ODocumentContainer*>(this)->implGetByName( _sName, true ).get());
|
||||
}
|
||||
catch(const Exception&)
|
||||
{
|
||||
|
@@ -25,7 +25,6 @@
|
||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||
#include <com/sun/star/lang/XInitialization.hpp>
|
||||
#include <com/sun/star/sdbc/XRow.hpp>
|
||||
#include <com/sun/star/lang/XUnoTunnel.hpp>
|
||||
#include <com/sun/star/uno/XComponentContext.hpp>
|
||||
#include <cppuhelper/compbase.hxx>
|
||||
#include <cppuhelper/basemutex.hxx>
|
||||
@@ -80,7 +79,6 @@ namespace dbaccess
|
||||
, css::beans::XPropertiesChangeNotifier
|
||||
, css::beans::XPropertyContainer
|
||||
, css::lang::XInitialization
|
||||
, css::lang::XUnoTunnel
|
||||
, css::container::XChild
|
||||
, css::sdbcx::XRename
|
||||
> OContentHelper_COMPBASE;
|
||||
@@ -155,10 +153,6 @@ namespace dbaccess
|
||||
// XInitialization
|
||||
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
|
||||
|
||||
// css::container::XChild
|
||||
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
|
||||
virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
|
||||
|
Reference in New Issue
Block a user