diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-17 14:19:26 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-24 17:59:30 +0200 |
commit | b8abd0368854329efb5ce91606e99fe448944ff9 (patch) | |
tree | 983039646a880dbbc5ae5c16ab877d5ef289326d /framework/source/layoutmanager | |
parent | 900dc2b70dc020fc077c300963a0746118820f06 (diff) |
fdo#46808, use service constructor for frame::DispatchHelper
Diffstat (limited to 'framework/source/layoutmanager')
-rw-r--r-- | framework/source/layoutmanager/helpers.cxx | 12 | ||||
-rw-r--r-- | framework/source/layoutmanager/helpers.hxx | 2 | ||||
-rw-r--r-- | framework/source/layoutmanager/layoutmanager.cxx | 11 |
3 files changed, 9 insertions, 16 deletions
diff --git a/framework/source/layoutmanager/helpers.cxx b/framework/source/layoutmanager/helpers.cxx index ef48be24888e..a954551c6db5 100644 --- a/framework/source/layoutmanager/helpers.cxx +++ b/framework/source/layoutmanager/helpers.cxx @@ -33,7 +33,7 @@ #include <com/sun/star/ui/DockingArea.hpp> #include <com/sun/star/awt/Toolkit.hpp> #include <com/sun/star/awt/XTopWindow.hpp> -#include <com/sun/star/frame/XDispatchHelper.hpp> +#include <com/sun/star/frame/DispatchHelper.hpp> #include <com/sun/star/awt/XDockableWindow.hpp> #include <com/sun/star/awt/XDockableWindowListener.hpp> #include <com/sun/star/awt/XWindowListener.hpp> @@ -308,10 +308,9 @@ sal_Bool implts_isFrameOrWindowTop( const uno::Reference< frame::XFrame >& xFram return sal_False; } -void impl_setDockingWindowVisibility( const css::uno::Reference< css::lang::XMultiServiceFactory>& rSMGR, const css::uno::Reference< css::frame::XFrame >& rFrame, const ::rtl::OUString& rDockingWindowName, bool bVisible ) +void impl_setDockingWindowVisibility( const css::uno::Reference< css::uno::XComponentContext>& rxContext, const css::uno::Reference< css::frame::XFrame >& rFrame, const ::rtl::OUString& rDockingWindowName, bool bVisible ) { const ::rtl::OUString aDockWinPrefixCommand( RTL_CONSTASCII_USTRINGPARAM( "DockingWindow" )); - css::uno::WeakReference< css::frame::XDispatchHelper > xDispatchHelper; sal_Int32 nID = rDockingWindowName.toInt32(); sal_Int32 nIndex = nID - DOCKWIN_ID_BASE; @@ -328,12 +327,7 @@ void impl_setDockingWindowVisibility( const css::uno::Reference< css::lang::XMul aArgs[0].Name = aDockWinArgName; aArgs[0].Value = css::uno::makeAny( bVisible ); - css::uno::Reference< css::frame::XDispatchHelper > xDispatcher( xDispatchHelper ); - if ( !xDispatcher.is()) - { - xDispatcher = css::uno::Reference< css::frame::XDispatchHelper >( - rSMGR->createInstance(SERVICENAME_DISPATCHHELPER), css::uno::UNO_QUERY_THROW); - } + css::uno::Reference< css::frame::XDispatchHelper > xDispatcher = css::frame::DispatchHelper::create( rxContext ); aDockWinCommand = aDockWinCommand + aDockWinArgName; xDispatcher->executeDispatch( diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx index dbe1cd0b5a0e..e2e667c073f9 100644 --- a/framework/source/layoutmanager/helpers.hxx +++ b/framework/source/layoutmanager/helpers.hxx @@ -77,7 +77,7 @@ void parseResourceURL( const rtl::OUString& aResourceURL, rtl::OUString& aElemen ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > impl_getModelFromFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ); sal_Bool implts_isPreviewModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel ); sal_Bool implts_isFrameOrWindowTop( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame ); -void impl_setDockingWindowVisibility( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& rSMGR, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rDockingWindowName, bool bVisible ); +void impl_setDockingWindowVisibility( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rDockingWindowName, bool bVisible ); void impl_addWindowListeners( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xThis, const ::com::sun::star::uno::Reference< css::ui::XUIElement >& xUIElement ); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > implts_createToolkitWindow( const css::uno::Reference< ::com::sun::star::awt::XToolkit2 >& rToolkit, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent ); diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 9bb969292b62..37e08e6f5e79 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -63,7 +63,7 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/frame/LayoutManagerEvents.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> -#include <com/sun/star/frame/XDispatchHelper.hpp> +#include <com/sun/star/frame/DispatchHelper.hpp> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/util/URLTransformer.hpp> @@ -1639,7 +1639,7 @@ throw (RuntimeException) uno::Reference< lang::XMultiServiceFactory > xSMGR( m_xSMGR ); aWriteLock.unlock(); - impl_setDockingWindowVisibility( xSMGR, xFrame, aElementName, false ); + impl_setDockingWindowVisibility( comphelper::getComponentContext(xSMGR), xFrame, aElementName, false ); bMustBeLayouted = false; bNotify = false; } @@ -1860,7 +1860,7 @@ throw (RuntimeException) uno::Reference< lang::XMultiServiceFactory > xSMGR( m_xSMGR ); aReadGuard.unlock(); - impl_setDockingWindowVisibility( xSMGR, xFrame, aElementName, true ); + impl_setDockingWindowVisibility( comphelper::getComponentContext(xSMGR), xFrame, aElementName, true ); } else if ( aElementType.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("toolpanel"))) { @@ -1950,7 +1950,7 @@ throw (RuntimeException) uno::Reference< lang::XMultiServiceFactory > xSMGR( m_xSMGR ); aReadGuard.unlock(); - impl_setDockingWindowVisibility( xSMGR, xFrame, aElementName, false ); + impl_setDockingWindowVisibility( comphelper::getComponentContext(xSMGR), xFrame, aElementName, false ); } if ( bMustLayout ) @@ -2670,8 +2670,7 @@ IMPL_LINK_NOARG(LayoutManager, MenuBarClose) if ( !xProvider.is()) return 0; - uno::Reference< frame::XDispatchHelper > xDispatcher( - xSMGR->createInstance(SERVICENAME_DISPATCHHELPER), uno::UNO_QUERY_THROW); + uno::Reference< frame::XDispatchHelper > xDispatcher = frame::DispatchHelper::create( comphelper::getComponentContext( xSMGR ) ); xDispatcher->executeDispatch( xProvider, |