tdf#39593 Drop RootItemContainer::GetImplementation
Replace with comphelper::getUnoTunnelImplementation. Also use isUnoTunnelId(). Change-Id: I014d27fd985836e9232b7f4772696b946eec907e Reviewed-on: https://gerrit.libreoffice.org/78745 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
committed by
Stephan Bergmann
parent
157420e496
commit
8f35bb1fcc
@@ -69,8 +69,7 @@ class RootItemContainer final : private cppu::BaseMutex,
|
||||
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
|
||||
|
||||
// XUnoTunnel
|
||||
static FWI_DLLPUBLIC const css::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
|
||||
static FWI_DLLPUBLIC RootItemContainer* GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) throw();
|
||||
static FWI_DLLPUBLIC const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() throw();
|
||||
sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) override;
|
||||
|
||||
// XIndexContainer
|
||||
|
||||
@@ -142,7 +142,7 @@ Reference< XIndexAccess > RootItemContainer::deepCopyContainer( const Reference<
|
||||
// XUnoTunnel
|
||||
sal_Int64 RootItemContainer::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier )
|
||||
{
|
||||
if( ( rIdentifier.getLength() == 16 ) && ( 0 == memcmp( RootItemContainer::GetUnoTunnelId().getConstArray(), rIdentifier.getConstArray(), 16 ) ) )
|
||||
if( isUnoTunnelId<RootItemContainer>(rIdentifier) )
|
||||
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
|
||||
return 0;
|
||||
}
|
||||
@@ -152,18 +152,11 @@ namespace
|
||||
class theRootItemContainerUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theRootItemContainerUnoTunnelId > {};
|
||||
}
|
||||
|
||||
const Sequence< sal_Int8 >& RootItemContainer::GetUnoTunnelId() throw()
|
||||
const Sequence< sal_Int8 >& RootItemContainer::getUnoTunnelId() throw()
|
||||
{
|
||||
return theRootItemContainerUnoTunnelId::get().getSeq();
|
||||
}
|
||||
|
||||
RootItemContainer* RootItemContainer::GetImplementation( const css::uno::Reference< css::uno::XInterface >& rxIFace ) throw()
|
||||
{
|
||||
css::uno::Reference< css::lang::XUnoTunnel > xUT( rxIFace, css::uno::UNO_QUERY );
|
||||
return xUT.is() ? reinterpret_cast< RootItemContainer* >(sal::static_int_cast< sal_IntPtr >(
|
||||
xUT->getSomething( RootItemContainer::GetUnoTunnelId() ))) : nullptr;
|
||||
}
|
||||
|
||||
// XElementAccess
|
||||
sal_Bool SAL_CALL RootItemContainer::hasElements()
|
||||
{
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
#include <rtl/ustrbuf.hxx>
|
||||
#include <sal/log.hxx>
|
||||
#include <comphelper/sequenceashashmap.hxx>
|
||||
#include <comphelper/servicehelper.hxx>
|
||||
#include <memory>
|
||||
|
||||
using namespace css;
|
||||
@@ -427,7 +428,7 @@ void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement
|
||||
{
|
||||
MenuConfiguration aMenuCfg( m_xContext );
|
||||
Reference< XIndexAccess > xContainer( aMenuCfg.CreateMenuBarConfigurationFromXML( xInputStream ));
|
||||
RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xContainer );
|
||||
auto pRootItemContainer = comphelper::getUnoTunnelImplementation<RootItemContainer>( xContainer );
|
||||
if ( pRootItemContainer )
|
||||
aUIElementData.xSettings.set( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, true ) ), UNO_QUERY );
|
||||
else
|
||||
@@ -446,7 +447,7 @@ void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement
|
||||
{
|
||||
Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY );
|
||||
ToolBoxConfiguration::LoadToolBox( m_xContext, xInputStream, xIndexContainer );
|
||||
RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer );
|
||||
auto pRootItemContainer = comphelper::getUnoTunnelImplementation<RootItemContainer>( xIndexContainer );
|
||||
aUIElementData.xSettings.set( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, true ) ), UNO_QUERY );
|
||||
return;
|
||||
}
|
||||
@@ -463,7 +464,7 @@ void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement
|
||||
{
|
||||
Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY );
|
||||
StatusBarConfiguration::LoadStatusBar( m_xContext, xInputStream, xIndexContainer );
|
||||
RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer );
|
||||
auto pRootItemContainer = comphelper::getUnoTunnelImplementation<RootItemContainer>( xIndexContainer );
|
||||
aUIElementData.xSettings.set( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, true ) ), UNO_QUERY );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <cppuhelper/supportsservice.hxx>
|
||||
#include <comphelper/propertysequence.hxx>
|
||||
#include <comphelper/sequence.hxx>
|
||||
#include <comphelper/servicehelper.hxx>
|
||||
#include <vcl/svapp.hxx>
|
||||
#include <rtl/ref.hxx>
|
||||
#include <rtl/ustrbuf.hxx>
|
||||
@@ -347,7 +348,7 @@ void UIConfigurationManager::impl_requestUIElementData( sal_Int16 nElementType,
|
||||
{
|
||||
MenuConfiguration aMenuCfg( m_xContext );
|
||||
Reference< XIndexAccess > xContainer( aMenuCfg.CreateMenuBarConfigurationFromXML( xInputStream ));
|
||||
RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xContainer );
|
||||
auto pRootItemContainer = comphelper::getUnoTunnelImplementation<RootItemContainer>( xContainer );
|
||||
if ( pRootItemContainer )
|
||||
aUIElementData.xSettings.set( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, true ) ), UNO_QUERY );
|
||||
else
|
||||
@@ -366,7 +367,7 @@ void UIConfigurationManager::impl_requestUIElementData( sal_Int16 nElementType,
|
||||
{
|
||||
Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY );
|
||||
ToolBoxConfiguration::LoadToolBox( m_xContext, xInputStream, xIndexContainer );
|
||||
RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer );
|
||||
auto pRootItemContainer = comphelper::getUnoTunnelImplementation<RootItemContainer>( xIndexContainer );
|
||||
aUIElementData.xSettings.set( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, true ) ), UNO_QUERY );
|
||||
return;
|
||||
}
|
||||
@@ -383,7 +384,7 @@ void UIConfigurationManager::impl_requestUIElementData( sal_Int16 nElementType,
|
||||
{
|
||||
Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY );
|
||||
StatusBarConfiguration::LoadStatusBar( m_xContext, xInputStream, xIndexContainer );
|
||||
RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer );
|
||||
auto pRootItemContainer = comphelper::getUnoTunnelImplementation<RootItemContainer>( xIndexContainer );
|
||||
aUIElementData.xSettings.set( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, true ) ), UNO_QUERY );
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user