summaryrefslogtreecommitdiffstats
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-14 12:58:00 +0200
committerNoel Grandin <noel@peralex.com>2012-12-21 10:57:09 +0200
commitbb121c864cc3c101ef733a4088c7ba3e36eced14 (patch)
tree2d528ca830aace6e563b7cdc93eb8f8d6c4f70cf /editeng
parentUpdated core (diff)
downloadcore-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 'editeng')
-rw-r--r--editeng/source/misc/unolingu.cxx28
1 files changed, 9 insertions, 19 deletions
diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx
index 7fa98c15481c..733e66b3d2cc 100644
--- a/editeng/source/misc/unolingu.cxx
+++ b/editeng/source/misc/unolingu.cxx
@@ -25,6 +25,7 @@
#include <editeng/unolingu.hxx>
#include <rtl/logfile.hxx>
#include <unotools/pathoptions.hxx>
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
@@ -441,7 +442,7 @@ typedef cppu::WeakImplHelper1 < XEventListener > LinguMgrAppExitLstnrBaseClass;
class LinguMgrAppExitLstnr : public LinguMgrAppExitLstnrBaseClass
{
- uno::Reference< XComponent > xDesktop;
+ uno::Reference< XDesktop2 > xDesktop;
public:
LinguMgrAppExitLstnr();
@@ -460,14 +461,9 @@ LinguMgrAppExitLstnr::LinguMgrAppExitLstnr()
// add object to frame::Desktop EventListeners in order to properly call
// the AtExit function at appliction exit.
- uno::Reference< XMultiServiceFactory > xMgr = getProcessServiceFactory();
- if ( xMgr.is() )
- {
- xDesktop = uno::Reference< XComponent > ( xMgr->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.frame.Desktop" ) ) ), UNO_QUERY ) ;
- if (xDesktop.is())
- xDesktop->addEventListener( this );
- }
+ uno::Reference< XComponentContext > xContext = getProcessComponentContext();
+ xDesktop = Desktop::create( xContext );
+ xDesktop->addEventListener( this );
}
LinguMgrAppExitLstnr::~LinguMgrAppExitLstnr()
@@ -637,11 +633,8 @@ uno::Reference< XDictionaryList > LinguMgr::GetDicList()
pExitLstnr = new LinguMgrExitLstnr;
uno::Reference< XMultiServiceFactory > xMgr( getProcessServiceFactory() );
- if (xMgr.is())
- {
- xDicList = uno::Reference< XDictionaryList > ( xMgr->createInstance(
- A2OU("com.sun.star.linguistic2.DictionaryList") ), UNO_QUERY );
- }
+ xDicList = uno::Reference< XDictionaryList > ( xMgr->createInstance(
+ A2OU("com.sun.star.linguistic2.DictionaryList") ), UNO_QUERY );
return xDicList;
}
@@ -654,11 +647,8 @@ uno::Reference< XPropertySet > LinguMgr::GetProp()
pExitLstnr = new LinguMgrExitLstnr;
uno::Reference< XMultiServiceFactory > xMgr( getProcessServiceFactory() );
- if (xMgr.is())
- {
- xProp = uno::Reference< XPropertySet > ( xMgr->createInstance(
- A2OU("com.sun.star.linguistic2.LinguProperties") ), UNO_QUERY );
- }
+ xProp = uno::Reference< XPropertySet > ( xMgr->createInstance(
+ A2OU("com.sun.star.linguistic2.LinguProperties") ), UNO_QUERY );
return xProp;
}