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 /desktop/test | |
parent | Updated core (diff) | |
download | core-bb121c864cc3c101ef733a4088c7ba3e36eced14.tar.gz core-bb121c864cc3c101ef733a4088c7ba3e36eced14.zip |
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 'desktop/test')
-rw-r--r-- | desktop/test/deployment/active/active_native.cxx | 24 | ||||
-rw-r--r-- | desktop/test/deployment/passive/passive_native.cxx | 24 |
2 files changed, 22 insertions, 26 deletions
diff --git a/desktop/test/deployment/active/active_native.cxx b/desktop/test/deployment/active/active_native.cxx index 3e5e0c5581c8..ce88274c63c7 100644 --- a/desktop/test/deployment/active/active_native.cxx +++ b/desktop/test/deployment/active/active_native.cxx @@ -29,7 +29,7 @@ #include "com/sun/star/awt/XWindowPeer.hpp" #include "com/sun/star/beans/PropertyValue.hpp" #include "com/sun/star/frame/DispatchDescriptor.hpp" -#include "com/sun/star/frame/XDesktop.hpp" +#include "com/sun/star/frame/Desktop.hpp" #include "com/sun/star/frame/XDispatch.hpp" #include "com/sun/star/frame/XDispatchProvider.hpp" #include "com/sun/star/frame/XFrame.hpp" @@ -216,23 +216,21 @@ void Dispatch::dispatch( css::uno::Sequence< css::beans::PropertyValue > const &) throw (css::uno::RuntimeException) { + css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create(context_); + css::uno::Reference< css::frame::XFrame > xFrame = xDesktop->getCurrentFrame(); + css::uno::Reference< css::awt::XWindowPeer > xWindowPeer( xFrame->getComponentWindow(), css::uno::UNO_QUERY_THROW ); + css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create(context_); css::uno::Reference< css::awt::XMessageBox > box( - css::awt::Toolkit::create(context_)->createMessageBox( - css::uno::Reference< css::awt::XWindowPeer >( - css::uno::Reference< css::frame::XFrame >( - css::uno::Reference< css::frame::XDesktop >( - (context_->getServiceManager()-> - createInstanceWithContext( - "com.sun.star.frame.Desktop", context_)), - css::uno::UNO_QUERY_THROW)->getCurrentFrame(), - css::uno::UNO_SET_THROW)->getComponentWindow(), - css::uno::UNO_QUERY_THROW), + xToolkit->createMessageBox( + xWindowPeer, css::awt::Rectangle(), "infobox", css::awt::MessageBoxButtons::BUTTONS_OK, "active", "native"), css::uno::UNO_SET_THROW); + box->execute(); - css::uno::Reference< css::lang::XComponent >( - box, css::uno::UNO_QUERY_THROW)->dispose(); + + css::uno::Reference< css::lang::XComponent > xComponent(box, css::uno::UNO_QUERY_THROW); + xComponent->dispose(); } static cppu::ImplementationEntry const services[] = { diff --git a/desktop/test/deployment/passive/passive_native.cxx b/desktop/test/deployment/passive/passive_native.cxx index c3fb5a3b0e72..819f6ab0ef59 100644 --- a/desktop/test/deployment/passive/passive_native.cxx +++ b/desktop/test/deployment/passive/passive_native.cxx @@ -29,7 +29,7 @@ #include "com/sun/star/awt/XWindowPeer.hpp" #include "com/sun/star/beans/PropertyValue.hpp" #include "com/sun/star/frame/DispatchDescriptor.hpp" -#include "com/sun/star/frame/XDesktop.hpp" +#include "com/sun/star/frame/Desktop.hpp" #include "com/sun/star/frame/XDispatch.hpp" #include "com/sun/star/frame/XDispatchProvider.hpp" #include "com/sun/star/frame/XFrame.hpp" @@ -213,23 +213,21 @@ void Dispatch::dispatch( css::uno::Sequence< css::beans::PropertyValue > const &) throw (css::uno::RuntimeException) { + css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create(context_); + css::uno::Reference< css::frame::XFrame > xFrame = xDesktop->getCurrentFrame(); + css::uno::Reference< css::awt::XWindowPeer > xWindowPeer( xFrame->getComponentWindow(), css::uno::UNO_QUERY_THROW ); + css::uno::Reference< css::awt::XToolkit2 > xToolkit = css::awt::Toolkit::create(context_); css::uno::Reference< css::awt::XMessageBox > box( - css::awt::Toolkit::create(context_)->createMessageBox( - css::uno::Reference< css::awt::XWindowPeer >( - css::uno::Reference< css::frame::XFrame >( - css::uno::Reference< css::frame::XDesktop >( - (context_->getServiceManager()-> - createInstanceWithContext( - "com.sun.star.frame.Desktop", context_)), - css::uno::UNO_QUERY_THROW)->getCurrentFrame(), - css::uno::UNO_SET_THROW)->getComponentWindow(), - css::uno::UNO_QUERY_THROW), + xToolkit->createMessageBox( + xWindowPeer, css::awt::Rectangle(), "infobox", css::awt::MessageBoxButtons::BUTTONS_OK, "passive", "native"), css::uno::UNO_SET_THROW); + box->execute(); - css::uno::Reference< css::lang::XComponent >( - box, css::uno::UNO_QUERY_THROW)->dispose(); + + css::uno::Reference< css::lang::XComponent > xComponent(box, css::uno::UNO_QUERY_THROW); + xComponent->dispose(); } static cppu::ImplementationEntry const services[] = { |