diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-27 12:58:50 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-28 08:10:23 +0200 |
commit | 95ec16b513c979fd78d2f11d23157a4b8819d848 (patch) | |
tree | c050b5865b76b7c0611dbfd0745375e8190a62c4 /framework/source | |
parent | 1d1825db869d3c633ec222fdaa7e4a813ac0627a (diff) |
fdo#46808, Convert frame::LayoutManager service to new sty;e
Change-Id: I46c3950aee336548d6e0acc6a7d1da655c158175
Diffstat (limited to 'framework/source')
-rw-r--r-- | framework/source/dispatch/popupmenudispatcher.cxx | 2 | ||||
-rw-r--r-- | framework/source/helper/statusindicatorfactory.cxx | 10 | ||||
-rw-r--r-- | framework/source/layoutmanager/layoutmanager.cxx | 3 | ||||
-rw-r--r-- | framework/source/services/frame.cxx | 52 |
4 files changed, 34 insertions, 33 deletions
diff --git a/framework/source/dispatch/popupmenudispatcher.cxx b/framework/source/dispatch/popupmenudispatcher.cxx index 2b5351b236f9..6c4fdfce0d4d 100644 --- a/framework/source/dispatch/popupmenudispatcher.cxx +++ b/framework/source/dispatch/popupmenudispatcher.cxx @@ -381,7 +381,7 @@ void PopupMenuDispatcher::impl_RetrievePopupControllerQuery() { if ( !m_xPopupCtrlQuery.is() ) { - css::uno::Reference< css::frame::XLayoutManager > xLayoutManager; + css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager; css::uno::Reference< css::frame::XFrame > xFrame( m_xWeakFrame ); if ( xFrame.is() ) diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx index a87f441ffefb..091da148d0d3 100644 --- a/framework/source/helper/statusindicatorfactory.cxx +++ b/framework/source/helper/statusindicatorfactory.cxx @@ -36,7 +36,7 @@ #include <com/sun/star/awt/XTopWindow.hpp> #include <com/sun/star/awt/XWindow2.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/frame/XLayoutManager.hpp> +#include <com/sun/star/frame/XLayoutManager2.hpp> #include <toolkit/unohlp.hxx> @@ -382,7 +382,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed() css::uno::Reference< css::beans::XPropertySet > xPropSet(xFrame, css::uno::UNO_QUERY); if (xPropSet.is()) { - css::uno::Reference< css::frame::XLayoutManager > xLayoutManager; + css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager; xPropSet->getPropertyValue(FRAME_PROPNAME_LAYOUTMANAGER) >>= xLayoutManager; if (xLayoutManager.is()) { @@ -468,7 +468,7 @@ void StatusIndicatorFactory::impl_createProgress() css::uno::Reference< css::beans::XPropertySet > xPropSet(xFrame, css::uno::UNO_QUERY); if (xPropSet.is()) { - css::uno::Reference< css::frame::XLayoutManager > xLayoutManager; + css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager; xPropSet->getPropertyValue(FRAME_PROPNAME_LAYOUTMANAGER) >>= xLayoutManager; if (xLayoutManager.is()) { @@ -513,7 +513,7 @@ void StatusIndicatorFactory::impl_showProgress() css::uno::Reference< css::beans::XPropertySet > xPropSet(xFrame, css::uno::UNO_QUERY); if (xPropSet.is()) { - css::uno::Reference< css::frame::XLayoutManager > xLayoutManager; + css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager; xPropSet->getPropertyValue(FRAME_PROPNAME_LAYOUTMANAGER) >>= xLayoutManager; if (xLayoutManager.is()) { @@ -557,7 +557,7 @@ void StatusIndicatorFactory::impl_hideProgress() css::uno::Reference< css::beans::XPropertySet > xPropSet(xFrame, css::uno::UNO_QUERY); if (xPropSet.is()) { - css::uno::Reference< css::frame::XLayoutManager > xLayoutManager; + css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager; xPropSet->getPropertyValue(FRAME_PROPNAME_LAYOUTMANAGER) >>= xLayoutManager; if (xLayoutManager.is()) xLayoutManager->hideElement( OUString(PROGRESS_RESOURCE) ); diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 65cf4b7b83a6..7bc5a1476893 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -101,6 +101,9 @@ static const sal_Int32 DOCKWIN_ID_BASE = 9800; static const char STATUS_BAR_ALIAS[] = "private:resource/statusbar/statusbar"; static const char PROGRESS_BAR_ALIAS[] = "private:resource/progressbar/progressbar"; +#define SERVICENAME_LAYOUTMANAGER DECLARE_ASCII("com.sun.star.frame.LayoutManager" ) +#define IMPLEMENTATIONNAME_LAYOUTMANAGER DECLARE_ASCII("com.sun.star.comp.framework.LayoutManager" ) + namespace framework { diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 6dbdc2aad84e..6ece139dfc7d 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -38,34 +38,34 @@ #include <services.h> #include <properties.h> -#include <com/sun/star/lang/XInitialization.hpp> -#include <com/sun/star/lang/DisposedException.hpp> -#include <com/sun/star/task/StatusIndicatorFactory.hpp> -#include <com/sun/star/task/JobExecutor.hpp> -#include <com/sun/star/task/XJobExecutor.hpp> -#include <com/sun/star/util/URLTransformer.hpp> -#include <com/sun/star/util/XURLTransformer.hpp> -#include <com/sun/star/util/XCloseable.hpp> #include <com/sun/star/awt/Toolkit.hpp> #include <com/sun/star/awt/XDevice.hpp> #include <com/sun/star/awt/XTopWindow.hpp> -#include <com/sun/star/frame/XDesktop.hpp> #include <com/sun/star/awt/PosSize.hpp> -#include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/awt/XWindowPeer.hpp> #include <com/sun/star/awt/XVclWindowPeer.hpp> -#include <com/sun/star/task/XStatusIndicatorSupplier.hpp> +#include <com/sun/star/awt/XDataTransferProviderAccess.hpp> +#include <com/sun/star/awt/WindowAttribute.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/frame/XModel.hpp> -#include <com/sun/star/awt/XDataTransferProviderAccess.hpp> -#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp> -#include <com/sun/star/awt/WindowAttribute.hpp> -#include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/beans/XMaterialHolder.hpp> - +#include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XTitleChangeBroadcaster.hpp> +#include <com/sun/star/frame/LayoutManager.hpp> +#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/frame/FrameSearchFlag.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/DisposedException.hpp> +#include <com/sun/star/task/XStatusIndicatorSupplier.hpp> +#include <com/sun/star/task/StatusIndicatorFactory.hpp> +#include <com/sun/star/task/JobExecutor.hpp> +#include <com/sun/star/task/XJobExecutor.hpp> +#include <com/sun/star/util/URLTransformer.hpp> +#include <com/sun/star/util/XURLTransformer.hpp> +#include <com/sun/star/util/XCloseable.hpp> #include <comphelper/sequenceashashmap.hxx> #include <cppuhelper/queryinterface.hxx> @@ -208,7 +208,7 @@ DEFINE_INIT_SERVICE ( Frame, //------------------------------------------------------------------------------------------------------------- // Create an initial layout manager // Create layout manager and connect it to the newly created frame - m_xLayoutManager.set(m_xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_LAYOUTMANAGER, m_xContext), css::uno::UNO_QUERY); + m_xLayoutManager = css::frame::LayoutManager::create(m_xContext); //------------------------------------------------------------------------------------------------------------- // set information about all supported properties at the base class helper PropertySetHelper @@ -479,14 +479,13 @@ void SAL_CALL Frame::setActiveFrame( const css::uno::Reference< css::frame::XFra /*-****************************************************************************************************//** initialize new created layout manager **/ -void lcl_enableLayoutManager(const css::uno::Reference< css::frame::XLayoutManager >& xLayoutManager, +void lcl_enableLayoutManager(const css::uno::Reference< css::frame::XLayoutManager2 >& xLayoutManager, const css::uno::Reference< css::frame::XFrame >& xFrame ) { // Provide container window to our layout manager implementation xLayoutManager->attachFrame(xFrame); - css::uno::Reference< css::frame::XFrameActionListener > xListen(xLayoutManager, css::uno::UNO_QUERY_THROW); - xFrame->addFrameActionListener(xListen); + xFrame->addFrameActionListener(xLayoutManager); DockingAreaDefaultAcceptor* pAcceptor = new DockingAreaDefaultAcceptor(xFrame); css::uno::Reference< css::ui::XDockingAreaAcceptor > xDockingAreaAcceptor( static_cast< ::cppu::OWeakObject* >(pAcceptor), css::uno::UNO_QUERY_THROW); @@ -496,11 +495,10 @@ void lcl_enableLayoutManager(const css::uno::Reference< css::frame::XLayoutManag /*-****************************************************************************************************//** deinitialize layout manager **/ -void lcl_disableLayoutManager(const css::uno::Reference< css::frame::XLayoutManager >& xLayoutManager, +void lcl_disableLayoutManager(const css::uno::Reference< css::frame::XLayoutManager2 >& xLayoutManager, const css::uno::Reference< css::frame::XFrame >& xFrame ) { - css::uno::Reference< css::frame::XFrameActionListener > xListen(xLayoutManager, css::uno::UNO_QUERY_THROW); - xFrame->removeFrameActionListener(xListen); + xFrame->removeFrameActionListener(xLayoutManager); xLayoutManager->setDockingAreaAcceptor(css::uno::Reference< css::ui::XDockingAreaAcceptor >()); xLayoutManager->attachFrame(css::uno::Reference< css::frame::XFrame >()); } @@ -554,7 +552,7 @@ void SAL_CALL Frame::initialize( const css::uno::Reference< css::awt::XWindow >& m_bIsHidden = sal_False; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; - css::uno::Reference< css::frame::XLayoutManager > xLayoutManager = m_xLayoutManager; + css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager = m_xLayoutManager; // Release lock ... because we call some impl methods, which are threadsafe by himself. // If we hold this lock - we will produce our own deadlock! @@ -2621,8 +2619,8 @@ void SAL_CALL Frame::impl_setPropertyValue(const OUString& /*sProperty*/, case FRAME_PROPHANDLE_LAYOUTMANAGER : { - css::uno::Reference< css::frame::XLayoutManager > xOldLayoutManager = m_xLayoutManager; - css::uno::Reference< css::frame::XLayoutManager > xNewLayoutManager; + css::uno::Reference< css::frame::XLayoutManager2 > xOldLayoutManager = m_xLayoutManager; + css::uno::Reference< css::frame::XLayoutManager2 > xNewLayoutManager; aValue >>= xNewLayoutManager; if (xOldLayoutManager != xNewLayoutManager) |