diff options
author | Noel Grandin <noel@peralex.com> | 2012-12-14 12:58:00 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2012-12-21 10:57:09 +0200 |
commit | bb121c864cc3c101ef733a4088c7ba3e36eced14 (patch) | |
tree | 2d528ca830aace6e563b7cdc93eb8f8d6c4f70cf /reportdesign | |
parent | 6d818ed651aaafcfb12ebc21449d35947d2e85a9 (diff) |
fdo#46808, Convert frame::Desktop to new style service.
I had to drop XEventBroadcaster from the merged interface
because it introduced method name conflicts (addEventListener).
Shouldn't be an issue since it was scheduled to be dropped anyhow,
and the service implementation still implements it, so existing clients
will be fine.
I dropped the interface XPropertySet from the combined IDL because nobody
seems to be using it, and it's primary purpose appears to be to set weird
flags.
I dropped the optional interfaces
XStatusIndicatorFactory
XDispatchInformationProvider
from the combined IDL because the service does not implement them, and
nobody seems to be using them. I suspect they were mistakenly copied
from XFrame.
I also did not convert the Title, UserDefinedAttributes and LayoutManager
properties to attributes, again because no-one is using them.
Change-Id: I678a00006ed2cca2d6c37c4e39465811442c33af
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 18 | ||||
-rw-r--r-- | reportdesign/source/core/api/ReportEngineJFree.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/inc/DesignView.hxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/inc/ReportController.hxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/report/DesignView.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportController.cxx | 9 |
6 files changed, 19 insertions, 22 deletions
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 92267c311fd5..fdfe2c715cf3 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -52,6 +52,7 @@ #include <com/sun/star/embed/XEmbedPersist.hpp> #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/embed/StorageFactory.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> @@ -501,14 +502,12 @@ namespace { try { - uno::Reference<frame::XComponentLoader> xFrameLoad( m_xContext->getServiceManager()->createInstanceWithContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) - ,m_xContext) - ,uno::UNO_QUERY); + uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create(m_xContext); + uno::Reference<frame::XComponentLoader> xFrameLoad(xDesktop,uno::UNO_QUERY); ::rtl::OUString sTarget(RTL_CONSTASCII_USTRINGPARAM("_blank")); sal_Int32 nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE; - uno::Reference< frame::XFrame> xFrame = uno::Reference< frame::XFrame>(xFrameLoad,uno::UNO_QUERY)->findFrame(sTarget,nFrameSearchFlag); - xFrameLoad.set( xFrame,uno::UNO_QUERY); + uno::Reference< frame::XFrame> xFrame = xDesktop->findFrame(sTarget,nFrameSearchFlag); + xFrameLoad.set(xFrame,uno::UNO_QUERY); if ( xFrameLoad.is() ) { @@ -2673,14 +2672,13 @@ uno::Reference< frame::XTitle > OReportDefinition::impl_getTitleHelper_throw() if ( ! m_pImpl->m_xTitleHelper.is ()) { - uno::Reference< frame::XUntitledNumbers > xDesktop(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop")) ,m_aProps->m_xContext),uno::UNO_QUERY_THROW); - uno::Reference< frame::XModel > xThis (static_cast< frame::XModel* >(this), uno::UNO_QUERY_THROW); + uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(m_aProps->m_xContext); + uno::Reference< frame::XModel > xThis(static_cast< frame::XModel* >(this), uno::UNO_QUERY_THROW); ::framework::TitleHelper* pHelper = new ::framework::TitleHelper( m_aProps->m_xContext ); m_pImpl->m_xTitleHelper = uno::Reference< frame::XTitle >(static_cast< ::cppu::OWeakObject* >(pHelper), uno::UNO_QUERY_THROW); pHelper->setOwner (xThis ); - pHelper->connectWithUntitledNumbers (xDesktop); + pHelper->connectWithUntitledNumbers (uno::Reference<frame::XUntitledNumbers>(xDesktop, uno::UNO_QUERY_THROW)); } return m_pImpl->m_xTitleHelper; diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx index 4af87c18e2e9..cc005a39ccfa 100644 --- a/reportdesign/source/core/api/ReportEngineJFree.cxx +++ b/reportdesign/source/core/api/ReportEngineJFree.cxx @@ -28,6 +28,7 @@ #include <comphelper/string.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/NamedValue.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/embed/XTransactedObject.hpp> @@ -293,10 +294,7 @@ uno::Reference< frame::XModel > SAL_CALL OReportEngineJFree::createDocumentAlive if ( !xFrameLoad.is() ) { // if there is no frame given, find the right - xFrameLoad.set( m_xContext->getServiceManager()->createInstanceWithContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) - ,m_xContext) - ,uno::UNO_QUERY); + xFrameLoad.set( frame::Desktop::create(m_xContext), uno::UNO_QUERY); ::rtl::OUString sTarget(RTL_CONSTASCII_USTRINGPARAM("_blank")); sal_Int32 nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE; uno::Reference< frame::XFrame> xFrame = uno::Reference< frame::XFrame>(xFrameLoad,uno::UNO_QUERY)->findFrame(sTarget,nFrameSearchFlag); diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx index 37edf05fe71f..efaae2c8bafd 100644 --- a/reportdesign/source/ui/inc/DesignView.hxx +++ b/reportdesign/source/ui/inc/DesignView.hxx @@ -97,7 +97,7 @@ namespace rptui public: ODesignView(Window* pParent, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&, OReportController& _rController); virtual ~ODesignView(); diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx index 004cbe73b105..7e42e54a30f6 100644 --- a/reportdesign/source/ui/inc/ReportController.hxx +++ b/reportdesign/source/ui/inc/ReportController.hxx @@ -28,7 +28,7 @@ #include <com/sun/star/beans/XPropertyChangeListener.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/embed/XVisualObject.hpp> -#include <com/sun/star/frame/XComponentLoader.hpp> +#include <com/sun/star/frame/XDesktop2.hpp> #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/io/XObjectInputStream.hpp> #include <com/sun/star/io/XObjectOutputStream.hpp> @@ -102,7 +102,7 @@ namespace rptui ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xReportDefinition; ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportEngine > m_xReportEngine; - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XComponentLoader > m_xFrameLoader; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDesktop2 > m_xFrameLoader; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > m_xRowSet; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > m_xRowSetMediator; diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index d9a4f7f0b83f..8014a820dd96 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -87,7 +87,7 @@ public: DBG_NAME( rpt_ODesignView ) //------------------------------------------------------------------------------ ODesignView::ODesignView( Window* pParent, - const Reference< XMultiServiceFactory >& _rxOrb, + const Reference< XComponentContext >& _rxOrb, OReportController& _rController) : ODataView( pParent, _rController, _rxOrb, WB_DIALOGCONTROL ) ,m_aSplitWin(this) diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 8a46d0a29cd2..da66390983a8 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -87,6 +87,7 @@ #include <com/sun/star/awt/FontUnderline.hpp> #include <com/sun/star/awt/TextAlign.hpp> #include <com/sun/star/awt/FontSlant.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/status/FontHeight.hpp> #include <com/sun/star/report/XFormattedField.hpp> #include <com/sun/star/sdb/SQLContext.hpp> @@ -1692,7 +1693,7 @@ void OReportController::impl_initialize( ) listen(true); setEditable( !m_aReportModel->IsReadOnly() ); - m_xFormatter.set(util::NumberFormatter::create(comphelper::getComponentContext(getORB())), UNO_QUERY_THROW); + m_xFormatter.set(util::NumberFormatter::create(m_xContext), UNO_QUERY_THROW); m_xFormatter->attachNumberFormatsSupplier(Reference< XNumberFormatsSupplier>(m_xReportDefinition,uno::UNO_QUERY)); ::comphelper::MediaDescriptor aDescriptor( m_xReportDefinition->getArgs() ); @@ -1801,7 +1802,7 @@ void OReportController::doOpenHelpAgent() // ----------------------------------------------------------------------------- sal_Bool OReportController::Construct(Window* pParent) { - ODesignView* pMyOwnView = new ODesignView( pParent, getORB(), *this ); + ODesignView* pMyOwnView = new ODesignView( pParent, m_xContext, *this ); StartListening( *pMyOwnView ); setView( *pMyOwnView ); @@ -2844,11 +2845,11 @@ Reference<XFrame> OReportController::getXFrame() { if ( !m_xFrameLoader.is() ) { - m_xFrameLoader.set(getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))),uno::UNO_QUERY_THROW); + m_xFrameLoader.set( frame::Desktop::create(m_xContext) ); } const sal_Int32 nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE; const ::rtl::OUString sTarget(RTL_CONSTASCII_USTRINGPARAM("_blank")); - Reference<XFrame> xFrame = Reference<XFrame>(m_xFrameLoader,uno::UNO_QUERY_THROW)->findFrame(sTarget,nFrameSearchFlag); + Reference<XFrame> xFrame = m_xFrameLoader->findFrame(sTarget,nFrameSearchFlag); return xFrame; } |