summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-15 15:20:48 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-23 15:27:49 +0200
commitc0f865c9b5a34b272c9e0b22d18969554265914a (patch)
treeee4bc2c0579245e92f51c82d91136e32cce7c9ca /vcl
parente41f21b4165e40e1564cc75928b4b085ce7072e1 (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')
-rw-r--r--vcl/source/app/unohelp.cxx16
-rw-r--r--vcl/source/control/edit.cxx16
2 files changed, 6 insertions, 26 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()
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index a8d018e8a7be..40d75bf7b43f 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -46,7 +46,7 @@
#include <osl/mutex.hxx>
-#include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <com/sun/star/i18n/BreakIterator.hpp>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
#include <com/sun/star/i18n/WordType.hpp>
#include <cppuhelper/weak.hxx>
@@ -857,18 +857,8 @@ uno::Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
//!! since we don't want to become incompatible in the next minor update
//!! where this code will get integrated into, xISC will be a local
//!! variable instead of a class member!
- uno::Reference < i18n::XBreakIterator > xBI;
-// if ( !xBI.is() )
- {
- uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- uno::Reference < XInterface > xI = xMSF->createInstance( OUString("com.sun.star.i18n.BreakIterator") );
- if ( xI.is() )
- {
- Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XBreakIterator >*)0) );
- x >>= xBI;
- }
- }
- return xBI;
+ uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ return i18n::BreakIterator::create(xContext);
}
// -----------------------------------------------------------------------