diff options
Diffstat (limited to 'comphelper/source')
-rw-r--r-- | comphelper/source/misc/accessibletexthelper.cxx | 9 | ||||
-rw-r--r-- | comphelper/source/misc/string.cxx | 5 |
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 |