summaryrefslogtreecommitdiff
path: root/sdext
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 /sdext
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 'sdext')
-rw-r--r--sdext/source/pdfimport/tree/drawtreevisiting.cxx9
-rw-r--r--sdext/source/presenter/PresenterTextView.cxx7
2 files changed, 5 insertions, 11 deletions
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
index 33d8db9d2a23..4333dabab350 100644
--- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
@@ -29,7 +29,7 @@
#include "basegfx/polygon/b2dpolypolygontools.hxx"
#include "basegfx/range/b2drange.hxx"
-#include "com/sun/star/i18n/XBreakIterator.hpp"
+#include "com/sun/star/i18n/BreakIterator.hpp"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "comphelper/processfactory.hxx"
#include "com/sun/star/i18n/ScriptType.hpp"
@@ -46,15 +46,12 @@ using namespace ::com::sun::star::uno;
namespace pdfi
{
-const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >& DrawXmlOptimizer::GetBreakIterator()
+const Reference< XBreakIterator >& DrawXmlOptimizer::GetBreakIterator()
{
if ( !mxBreakIter.is() )
{
Reference< XComponentContext > xContext( this->m_rProcessor.m_xContext, uno::UNO_SET_THROW );
- Reference< XMultiComponentFactory > xMSF( xContext->getServiceManager(), uno::UNO_SET_THROW );
- Reference < XInterface > xInterface = xMSF->createInstanceWithContext(::rtl::OUString("com.sun.star.i18n.BreakIterator"), xContext);
-
- mxBreakIter = uno::Reference< i18n::XBreakIterator >( xInterface, uno::UNO_QUERY );
+ mxBreakIter = BreakIterator::create(xContext);
}
return mxBreakIter;
}
diff --git a/sdext/source/presenter/PresenterTextView.cxx b/sdext/source/presenter/PresenterTextView.cxx
index 4277b554b301..6599f4fbfa81 100644
--- a/sdext/source/presenter/PresenterTextView.cxx
+++ b/sdext/source/presenter/PresenterTextView.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/accessibility/AccessibleTextType.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/i18n/BreakIterator.hpp>
#include <com/sun/star/i18n/CharType.hpp>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
#include <com/sun/star/i18n/CTLScriptType.hpp>
@@ -90,11 +91,7 @@ PresenterTextView::PresenterTextView (
return;
// Create the break iterator that we use to break text into lines.
- mxBreakIterator = Reference<i18n::XBreakIterator>(
- xFactory->createInstanceWithContext(
- A2S("com.sun.star.i18n.BreakIterator"),
- rxContext),
- UNO_QUERY_THROW);
+ mxBreakIterator = i18n::BreakIterator::create(rxContext);
// Create the script type detector that is used to split paragraphs into
// portions of the same text direction.