diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-15 15:20:48 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-23 15:27:49 +0200 |
commit | c0f865c9b5a34b272c9e0b22d18969554265914a (patch) | |
tree | ee4bc2c0579245e92f51c82d91136e32cce7c9ca /vcl/source/app | |
parent | e41f21b4165e40e1564cc75928b4b085ce7072e1 (diff) |
fdo#46808, use service constructor for i18n::BreakIterator
Note that I found a pre-existing bug in linguistic/source/gciterator.cxx
but I was not able to fix it, because doing so appears to expose
bugs elsewhere!
Change-Id: I17fb9108d98a98d0ae13fe5a8e043d2db5b27a6a
Diffstat (limited to 'vcl/source/app')
-rw-r--r-- | vcl/source/app/unohelp.cxx | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/vcl/source/app/unohelp.cxx b/vcl/source/app/unohelp.cxx index 329159250b95..a7ba55577b07 100644 --- a/vcl/source/app/unohelp.cxx +++ b/vcl/source/app/unohelp.cxx @@ -42,7 +42,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> -#include <com/sun/star/i18n/XBreakIterator.hpp> +#include <com/sun/star/i18n/BreakIterator.hpp> #include <com/sun/star/i18n/XCharacterClassification.hpp> #include <com/sun/star/awt/XExtendedToolkit.hpp> #include <com/sun/star/accessibility/AccessibleEventObject.hpp> @@ -136,18 +136,8 @@ uno::Reference< lang::XMultiServiceFactory > vcl::unohelper::GetMultiServiceFact uno::Reference < i18n::XBreakIterator > vcl::unohelper::CreateBreakIterator() { - uno::Reference < i18n::XBreakIterator > xB; - uno::Reference< lang::XMultiServiceFactory > xMSF = GetMultiServiceFactory(); - if ( xMSF.is() ) - { - uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString("com.sun.star.i18n.BreakIterator") ); - if ( xI.is() ) - { - uno::Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XBreakIterator >*)0) ); - x >>= xB; - } - } - return xB; + uno::Reference< uno::XComponentContext > xContext = comphelper::getComponentContext(GetMultiServiceFactory()); + return i18n::BreakIterator::create(xContext); } uno::Reference < i18n::XCharacterClassification > vcl::unohelper::CreateCharacterClassification() |