diff options
author | Noel Grandin <noel@peralex.com> | 2013-03-07 13:13:10 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-03-20 07:32:48 +0200 |
commit | 524cedbd307e73badd3c6e64ae290922c75fd2dd (patch) | |
tree | 1d9af50ec71f5a92f17106471f62c041a58087d8 /sw | |
parent | 70e7bd63adda4c17a47fd7caeacdf5b91ace6157 (diff) |
fdo#46808, Convert linguistic2::ProofreadingIterator to new style
Change-Id: I1551f67ce503d58ea9b0e701219b26baadb25b78
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 21 | ||||
-rw-r--r-- | sw/source/ui/uno/dlelstnr.cxx | 6 |
2 files changed, 10 insertions, 17 deletions
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 1ccc474a7385..7ffacc346c34 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -23,7 +23,7 @@ #include <com/sun/star/document/PrinterIndependentLayout.hpp> #include <com/sun/star/document/UpdateDocMode.hpp> #include <com/sun/star/text/XTextDocument.hpp> -#include <com/sun/star/linguistic2/XProofreadingIterator.hpp> +#include <com/sun/star/linguistic2/ProofreadingIterator.hpp> #include <com/sun/star/text/XFlatParagraphIteratorProvider.hpp> #include <comphelper/processfactory.hxx> @@ -119,19 +119,14 @@ const sal_Char sGrfCollStr[] = "Graphikformatvorlage"; { if (!m_xGCIterator.is() && SvtLinguConfig().HasGrammarChecker()) { - uno::Reference< lang::XMultiServiceFactory > xMgr( comphelper::getProcessServiceFactory() ); - if (xMgr.is()) + uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); + try { - try - { - OUString aServiceName("com.sun.star.linguistic2.ProofreadingIterator"); - m_xGCIterator = uno::Reference< linguistic2::XProofreadingIterator > - ( xMgr->createInstance( aServiceName ), uno::UNO_QUERY_THROW ); - } - catch (uno::Exception &) - { - OSL_FAIL( "No GCIterator" ); - } + m_xGCIterator = linguistic2::ProofreadingIterator::create( xContext ); + } + catch (const uno::Exception &) + { + OSL_FAIL( "No GCIterator" ); } } diff --git a/sw/source/ui/uno/dlelstnr.cxx b/sw/source/ui/uno/dlelstnr.cxx index 31572d9e8c24..93345da0889f 100644 --- a/sw/source/ui/uno/dlelstnr.cxx +++ b/sw/source/ui/uno/dlelstnr.cxx @@ -23,7 +23,7 @@ #include <com/sun/star/linguistic2/XDictionaryList.hpp> #include <com/sun/star/linguistic2/LinguServiceManager.hpp> #include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp> -#include <com/sun/star/linguistic2/XProofreadingIterator.hpp> +#include <com/sun/star/linguistic2/ProofreadingIterator.hpp> #include <com/sun/star/linguistic2/LinguServiceEventFlags.hpp> #include <unotools/lingucfg.hxx> @@ -48,7 +48,6 @@ using namespace ::com::sun::star::linguistic2::LinguServiceEventFlags; SwLinguServiceEventListener::SwLinguServiceEventListener() { - Reference< XMultiServiceFactory > xMgr( comphelper::getProcessServiceFactory() ); Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); try { @@ -60,8 +59,7 @@ SwLinguServiceEventListener::SwLinguServiceEventListener() if (SvtLinguConfig().HasGrammarChecker()) { - OUString aSvcName( "com.sun.star.linguistic2.ProofreadingIterator" ); - xGCIterator = Reference< XProofreadingIterator >( xMgr->createInstance( aSvcName ), UNO_QUERY ); + xGCIterator = ProofreadingIterator::create(xContext); Reference< XLinguServiceEventBroadcaster > xBC( xGCIterator, UNO_QUERY ); if (xBC.is()) xBC->addLinguServiceEventListener( (XLinguServiceEventListener *) this ); |