summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/fwi/uielement/rootitemcontainer.cxx11
-rw-r--r--framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx7
-rw-r--r--framework/source/uiconfiguration/uiconfigurationmanager.cxx7
3 files changed, 10 insertions, 15 deletions
diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx
index 4571b3b61603..f7e7eb28dbb7 100644
--- a/framework/source/fwi/uielement/rootitemcontainer.cxx
+++ b/framework/source/fwi/uielement/rootitemcontainer.cxx
@@ -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()
{
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index b629dbaefca3..36631222539e 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -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;
}
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index 01dcf13246c1..9f309f7d7656 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -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;
}