summaryrefslogtreecommitdiff
path: root/comphelper/source
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 /comphelper/source
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 'comphelper/source')
-rw-r--r--comphelper/source/misc/accessibletexthelper.cxx9
-rw-r--r--comphelper/source/misc/string.cxx5
2 files changed, 5 insertions, 9 deletions
diff --git a/comphelper/source/misc/accessibletexthelper.cxx b/comphelper/source/misc/accessibletexthelper.cxx
index ed85437a180e..6098abc2e3c8 100644
--- a/comphelper/source/misc/accessibletexthelper.cxx
+++ b/comphelper/source/misc/accessibletexthelper.cxx
@@ -19,6 +19,7 @@
#include <comphelper/accessibletexthelper.hxx>
#include <com/sun/star/accessibility/AccessibleTextType.hpp>
+#include <com/sun/star/i18n/BreakIterator.hpp>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/i18n/KCharacterType.hpp>
@@ -58,12 +59,8 @@ namespace comphelper
{
if ( !m_xBreakIter.is() )
{
- Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- if ( xMSF.is() )
- {
- m_xBreakIter = Reference< i18n::XBreakIterator >
- ( xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.i18n.BreakIterator" ) ) ), UNO_QUERY );
- }
+ Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ m_xBreakIter = i18n::BreakIterator::create(xContext);
}
return m_xBreakIter;
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx
index d35a3faff0ec..2fe8a3f508f8 100644
--- a/comphelper/source/misc/string.cxx
+++ b/comphelper/source/misc/string.cxx
@@ -34,6 +34,7 @@
#include <comphelper/stlunosequence.hxx>
#include <comphelper/stl_types.hxx>
+#include <com/sun/star/i18n/BreakIterator.hpp>
#include <com/sun/star/i18n/CharType.hpp>
@@ -349,9 +350,7 @@ NaturalStringSorter::NaturalStringSorter(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.Collator")), rContext),
uno::UNO_QUERY_THROW);
m_xCollator->loadDefaultCollator(m_aLocale, 0);
- m_xBI = uno::Reference< i18n::XBreakIterator >(xFactory->createInstanceWithContext(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")), rContext),
- uno::UNO_QUERY_THROW);
+ m_xBI = i18n::BreakIterator::create( rContext );
}
namespace