[Libreoffice-commits] .: 3 commits - comphelper/source drawinglayer/source editeng/source filter/source i18npool/Library_i18nsearch.mk i18npool/source linguistic/source offapi/com sc/source sdext/source sd/source svx/source sw/source vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 23 06:28:28 PDT 2012


 comphelper/source/misc/accessibletexthelper.cxx              |    9 -
 comphelper/source/misc/string.cxx                            |    5 
 drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx |    8 -
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx   |   68 ++++----
 editeng/source/editeng/impedit3.cxx                          |    5 
 editeng/source/misc/hangulhanja.cxx                          |   56 +++----
 filter/source/flash/swfwriter1.cxx                           |    5 
 i18npool/Library_i18nsearch.mk                               |    1 
 i18npool/source/search/textsearch.cxx                        |    8 -
 linguistic/source/gciterator.cxx                             |   34 +---
 offapi/com/sun/star/xml/NamespaceContainer.idl               |    2 
 sc/source/core/data/documen6.cxx                             |   10 -
 sd/source/core/CustomAnimationEffect.cxx                     |   86 +++++------
 sd/source/filter/eppt/pptx-text.cxx                          |   12 -
 sdext/source/pdfimport/tree/drawtreevisiting.cxx             |    9 -
 sdext/source/presenter/PresenterTextView.cxx                 |    7 
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx      |   12 -
 svx/source/dialog/fntctrl.cxx                                |   74 ++++-----
 svx/source/svdraw/svdotextpathdecomposition.cxx              |   12 -
 sw/source/core/bastyp/breakit.cxx                            |    6 
 sw/source/ui/chrdlg/drpcps.cxx                               |   46 ++---
 sw/source/ui/table/tautofmt.cxx                              |    7 
 vcl/source/app/unohelp.cxx                                   |   16 --
 vcl/source/control/edit.cxx                                  |   16 --
 24 files changed, 218 insertions(+), 296 deletions(-)

New commits:
commit a33dbc169037d985f104c83d01d5efd9982413de
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 23 15:23:09 2012 +0200

    Related fdo#46808: Fix pre-existing bug identified in previous commit
    
    Assigning to dead xBreakIterator instead of m_xBreakIterator had been introduced
    with 9f2fde7ab5de20926bb25a6b298b4e5dffb66eb2 "#i103496#: split svtools; improve
    ConfitItems," and just fixing it does not cause any tests to start breaking for
    me.
    
    Change-Id: I9a26e8d3924bf15ae948c9c26b70f42f8f0d2f64

diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index f324e51..b2f4162 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -749,33 +749,27 @@ sal_Int32 GrammarCheckingIterator::GetSuggestedEndOfSentence(
 {
     // internal method; will always be called with locked mutex
 
-    // FIXME! this is a bug, the xBreakIterator var is hiding an issue!
-    // But if I fix it, the sw/complex tests start failing.
-    uno::Reference< i18n::XBreakIterator > xBreakIterator;
     if (!m_xBreakIterator.is())
     {
         uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
-        xBreakIterator = i18n::BreakIterator::create(xContext);
+        m_xBreakIterator = i18n::BreakIterator::create(xContext);
     }
     sal_Int32 nTextLen = rText.getLength();
-    sal_Int32 nEndPosition = nTextLen;
-    if (m_xBreakIterator.is())
+    sal_Int32 nEndPosition;
+    sal_Int32 nTmpStartPos = nSentenceStartPos;
+    do
     {
-        sal_Int32 nTmpStartPos = nSentenceStartPos;
-        do
-        {
+        nEndPosition = nTextLen;
+        if (nTmpStartPos < nTextLen)
+            nEndPosition = m_xBreakIterator->endOfSentence( rText, nTmpStartPos, rLocale );
+        if (nEndPosition < 0)
             nEndPosition = nTextLen;
-            if (nTmpStartPos < nTextLen)
-                nEndPosition = m_xBreakIterator->endOfSentence( rText, nTmpStartPos, rLocale );
-            if (nEndPosition < 0)
-                nEndPosition = nTextLen;
 
-            ++nTmpStartPos;
-        }
-        while (nEndPosition <= nSentenceStartPos && nEndPosition < nTextLen);
-        if (nEndPosition > nTextLen)
-            nEndPosition = nTextLen;
+        ++nTmpStartPos;
     }
+    while (nEndPosition <= nSentenceStartPos && nEndPosition < nTextLen);
+    if (nEndPosition > nTextLen)
+        nEndPosition = nTextLen;
     return nEndPosition;
 }
 
commit c0f865c9b5a34b272c9e0b22d18969554265914a
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Oct 15 15:20:48 2012 +0200

    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

diff --git a/comphelper/source/misc/accessibletexthelper.cxx b/comphelper/source/misc/accessibletexthelper.cxx
index ed85437..6098abc 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 d35a3fa..2fe8a3f 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
diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
index 1c6fca4..68ebc91 100644
--- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
@@ -36,7 +36,7 @@
 #include <com/sun/star/i18n/WordType.hpp>
 #include <drawinglayer/primitive2d/texteffectprimitive2d.hxx>
 #include <drawinglayer/primitive2d/shadowprimitive2d.hxx>
-#include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <drawinglayer/primitive2d/transformprimitive2d.hxx>
 #include <drawinglayer/primitive2d/textlineprimitive2d.hxx>
 #include <drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx>
@@ -206,11 +206,11 @@ namespace drawinglayer
 
             if(!xLocalBreakIterator.is())
             {
-                ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF(::comphelper::getProcessServiceFactory());
-                xLocalBreakIterator.set(xMSF->createInstance("com.sun.star.i18n.BreakIterator"), ::com::sun::star::uno::UNO_QUERY);
+                ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext(::comphelper::getProcessComponentContext());
+                xLocalBreakIterator = com::sun::star::i18n::BreakIterator::create(xContext);
             }
 
-            if(xLocalBreakIterator.is() && getTextLength())
+            if( getTextLength() )
             {
                 // init word iterator, get first word and truncate to possibilities
                 ::com::sun::star::i18n::Boundary aNextWordBoundary(xLocalBreakIterator->getWordBoundary(
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 5f7d8e7..1ccfc5f 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -56,6 +56,7 @@
 #include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx>
 #include <comphelper/processfactory.hxx>
 #include <rtl/ustring.hxx>
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <com/sun/star/i18n/CharacterIteratorMode.hpp>
 #include <com/sun/star/i18n/WordType.hpp>
 #include <drawinglayer/primitive2d/controlprimitive2d.hxx>
@@ -1097,46 +1098,43 @@ namespace drawinglayer
                         // support for TEXT_ MetaFile actions only for decorated texts
                         if(!mxBreakIterator.is())
                         {
-                            uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF(::comphelper::getProcessServiceFactory());
-                            mxBreakIterator.set(xMSF->createInstance("com.sun.star.i18n.BreakIterator"), uno::UNO_QUERY);
+                            uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+                            mxBreakIterator = i18n::BreakIterator::create(xContext);
                         }
 
-                        if(mxBreakIterator.is())
-                        {
-                            const rtl::OUString& rTxt = rTextCandidate.getText();
-                            const sal_Int32 nTextLength(rTextCandidate.getTextLength()); // rTxt.getLength());
+                        const rtl::OUString& rTxt = rTextCandidate.getText();
+                        const sal_Int32 nTextLength(rTextCandidate.getTextLength()); // rTxt.getLength());
 
-                            if(nTextLength)
+                        if(nTextLength)
+                        {
+                            const ::com::sun::star::lang::Locale& rLocale = rTextCandidate.getLocale();
+                            const sal_Int32 nTextPosition(rTextCandidate.getTextPosition());
+
+                            sal_Int32 nDone;
+                            sal_Int32 nNextCellBreak(mxBreakIterator->nextCharacters(rTxt, nTextPosition, rLocale, ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, 0, nDone));
+                            ::com::sun::star::i18n::Boundary nNextWordBoundary(mxBreakIterator->getWordBoundary(rTxt, nTextPosition, rLocale, ::com::sun::star::i18n::WordType::ANY_WORD, sal_True));
+                            sal_Int32 nNextSentenceBreak(mxBreakIterator->endOfSentence(rTxt, nTextPosition, rLocale));
+                            const rtl::OString aCommentStringA(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOC"));
+                            const rtl::OString aCommentStringB(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOW"));
+                            const rtl::OString aCommentStringC(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOS"));
+
+                            for(sal_Int32 i(nTextPosition); i < nTextPosition + nTextLength; i++)
                             {
-                                const ::com::sun::star::lang::Locale& rLocale = rTextCandidate.getLocale();
-                                const sal_Int32 nTextPosition(rTextCandidate.getTextPosition());
-
-                                sal_Int32 nDone;
-                                sal_Int32 nNextCellBreak(mxBreakIterator->nextCharacters(rTxt, nTextPosition, rLocale, ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, 0, nDone));
-                                ::com::sun::star::i18n::Boundary nNextWordBoundary(mxBreakIterator->getWordBoundary(rTxt, nTextPosition, rLocale, ::com::sun::star::i18n::WordType::ANY_WORD, sal_True));
-                                sal_Int32 nNextSentenceBreak(mxBreakIterator->endOfSentence(rTxt, nTextPosition, rLocale));
-                                const rtl::OString aCommentStringA(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOC"));
-                                const rtl::OString aCommentStringB(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOW"));
-                                const rtl::OString aCommentStringC(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOS"));
-
-                                for(sal_Int32 i(nTextPosition); i < nTextPosition + nTextLength; i++)
+                                // create the entries for the respective break positions
+                                if(i == nNextCellBreak)
+                                {
+                                    mpMetaFile->AddAction(new MetaCommentAction(aCommentStringA, i - nTextPosition));
+                                    nNextCellBreak = mxBreakIterator->nextCharacters(rTxt, i, rLocale, ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
+                                }
+                                if(i == nNextWordBoundary.endPos)
+                                {
+                                    mpMetaFile->AddAction(new MetaCommentAction(aCommentStringB, i - nTextPosition));
+                                    nNextWordBoundary = mxBreakIterator->getWordBoundary(rTxt, i + 1, rLocale, ::com::sun::star::i18n::WordType::ANY_WORD, sal_True);
+                                }
+                                if(i == nNextSentenceBreak)
                                 {
-                                    // create the entries for the respective break positions
-                                    if(i == nNextCellBreak)
-                                    {
-                                        mpMetaFile->AddAction(new MetaCommentAction(aCommentStringA, i - nTextPosition));
-                                        nNextCellBreak = mxBreakIterator->nextCharacters(rTxt, i, rLocale, ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
-                                    }
-                                    if(i == nNextWordBoundary.endPos)
-                                    {
-                                        mpMetaFile->AddAction(new MetaCommentAction(aCommentStringB, i - nTextPosition));
-                                        nNextWordBoundary = mxBreakIterator->getWordBoundary(rTxt, i + 1, rLocale, ::com::sun::star::i18n::WordType::ANY_WORD, sal_True);
-                                    }
-                                    if(i == nNextSentenceBreak)
-                                    {
-                                        mpMetaFile->AddAction(new MetaCommentAction(aCommentStringC, i - nTextPosition));
-                                        nNextSentenceBreak = mxBreakIterator->endOfSentence(rTxt, i + 1, rLocale);
-                                    }
+                                    mpMetaFile->AddAction(new MetaCommentAction(aCommentStringC, i - nTextPosition));
+                                    nNextSentenceBreak = mxBreakIterator->endOfSentence(rTxt, i + 1, rLocale);
                                 }
                             }
                         }
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 57ae2ea..854c4da 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -70,6 +70,7 @@
 #include <set>
 #include <math.h>
 #include <vcl/metric.hxx>
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/text/CharacterCompressionType.hpp>
 #include <vcl/pdfextoutdevdata.hxx>
@@ -4318,8 +4319,8 @@ Reference < i18n::XBreakIterator > ImpEditEngine::ImplGetBreakIterator() const
 {
     if ( !xBI.is() )
     {
-        Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
-        xBI.set( xMSF->createInstance( OUString( "com.sun.star.i18n.BreakIterator" ) ), UNO_QUERY );
+        Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+        xBI = i18n::BreakIterator::create( xContext );
     }
     return xBI;
 }
diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx
index 86bf60a..2c2d736 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -34,8 +34,9 @@
 
 #include <set>
 #include <map>
+#include <comphelper/processfactory.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/i18n/UnicodeScript.hpp>
 #include <com/sun/star/i18n/XTextConversion.hpp>
@@ -614,38 +615,29 @@ namespace editeng
             try
             {
                 // get the break iterator service
-                ::rtl::OUString sBreakIteratorService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.i18n.BreakIterator" ) );
-                Reference< XInterface > xBI( m_xORB->createInstance( ::rtl::OUString( sBreakIteratorService ) ) );
-                Reference< XBreakIterator > xBreakIter( xBI, UNO_QUERY );
-                if ( !xBreakIter.is() )
-                {
-                    ShowServiceNotAvailableError( m_pUIParent, sBreakIteratorService, sal_True );
-                }
-                else
-                {
-                    sal_Int32 nNextAsianScript = xBreakIter->beginOfScript( m_sCurrentPortion, m_nCurrentStartIndex, com::sun::star::i18n::ScriptType::ASIAN );
-                    if ( -1 == nNextAsianScript )
-                        nNextAsianScript = xBreakIter->nextScript( m_sCurrentPortion, m_nCurrentStartIndex, com::sun::star::i18n::ScriptType::ASIAN );
-                    if ( ( nNextAsianScript >= m_nCurrentStartIndex ) && ( nNextAsianScript < m_sCurrentPortion.getLength() ) )
-                    {   // found asian text
-
-                        // determine if it's Hangul
-                        CharClass aCharClassificaton( m_xORB, m_aSourceLocale );
-                        sal_Int16 nScript = aCharClassificaton.getScript( m_sCurrentPortion, sal::static_int_cast< sal_uInt16 >(nNextAsianScript) );
-                        if  (   ( UnicodeScript_kHangulJamo == nScript )
-                            ||  ( UnicodeScript_kHangulCompatibilityJamo == nScript )
-                            ||  ( UnicodeScript_kHangulSyllable == nScript )
-                            )
-                        {
-                            rDirection = HHC::eHangulToHanja;
-                        }
-                        else
-                        {
-                            rDirection = HHC::eHanjaToHangul;
-                        }
-
-                        bSuccess = true;
+                Reference< XBreakIterator > xBreakIter = BreakIterator::create( comphelper::getComponentContext(m_xORB) );
+                sal_Int32 nNextAsianScript = xBreakIter->beginOfScript( m_sCurrentPortion, m_nCurrentStartIndex, com::sun::star::i18n::ScriptType::ASIAN );
+                if ( -1 == nNextAsianScript )
+                    nNextAsianScript = xBreakIter->nextScript( m_sCurrentPortion, m_nCurrentStartIndex, com::sun::star::i18n::ScriptType::ASIAN );
+                if ( ( nNextAsianScript >= m_nCurrentStartIndex ) && ( nNextAsianScript < m_sCurrentPortion.getLength() ) )
+                {   // found asian text
+
+                    // determine if it's Hangul
+                    CharClass aCharClassificaton( m_xORB, m_aSourceLocale );
+                    sal_Int16 nScript = aCharClassificaton.getScript( m_sCurrentPortion, sal::static_int_cast< sal_uInt16 >(nNextAsianScript) );
+                    if  (   ( UnicodeScript_kHangulJamo == nScript )
+                        ||  ( UnicodeScript_kHangulCompatibilityJamo == nScript )
+                        ||  ( UnicodeScript_kHangulSyllable == nScript )
+                        )
+                    {
+                        rDirection = HHC::eHangulToHanja;
                     }
+                    else
+                    {
+                        rDirection = HHC::eHanjaToHangul;
+                    }
+
+                    bSuccess = true;
                 }
             }
             catch( const Exception& )
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index 1352508..c7e8695 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -27,6 +27,7 @@
  ************************************************************************/
 
 
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <comphelper/processfactory.hxx>
@@ -2065,8 +2066,8 @@ Reference < XBreakIterator > Writer::Impl_GetBreakIterator()
 {
     if ( !mxBreakIterator.is() )
     {
-        Reference< XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
-        mxBreakIterator.set( xMSF->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.i18n.BreakIterator" )) ), UNO_QUERY );
+        Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+        mxBreakIterator = BreakIterator::create(xContext);
     }
     return mxBreakIterator;
 }
diff --git a/i18npool/Library_i18nsearch.mk b/i18npool/Library_i18nsearch.mk
index d4499c8..b587e13 100644
--- a/i18npool/Library_i18nsearch.mk
+++ b/i18npool/Library_i18nsearch.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_Library_set_include,i18nsearch,\
 $(eval $(call gb_Library_use_sdk_api,i18nsearch))
 
 $(eval $(call gb_Library_use_libraries,i18nsearch,\
+	comphelper \
 	cppu \
 	cppuhelper \
 	i18nregexp \
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index 8c2d554..115e481 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -33,6 +33,7 @@
 #include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <comphelper/processfactory.hxx>
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <com/sun/star/i18n/UnicodeType.hpp>
 #include <com/sun/star/util/SearchFlags.hpp>
 #include <com/sun/star/i18n/WordType.hpp>
@@ -150,12 +151,7 @@ void TextSearch::setOptions( const SearchOptions& rOptions ) throw( RuntimeExcep
 
     if ( !xBreak.is() )
     {
-        Reference < XInterface > xI = xMSF->createInstance(
-                OUString("com.sun.star.i18n.BreakIterator"));
-        if( xI.is() )
-            xI->queryInterface( ::getCppuType(
-                        (const Reference< XBreakIterator >*)0))
-                >>= xBreak;
+        xBreak = BreakIterator::create(comphelper::getComponentContext(xMSF));
     }
 
     sSrchStr = aSrchPara.searchString;
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index 79f0f39..f324e51 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -23,7 +23,7 @@
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/container/XNameContainer.hpp>
 #include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -749,13 +749,13 @@ sal_Int32 GrammarCheckingIterator::GetSuggestedEndOfSentence(
 {
     // internal method; will always be called with locked mutex
 
+    // FIXME! this is a bug, the xBreakIterator var is hiding an issue!
+    // But if I fix it, the sw/complex tests start failing.
     uno::Reference< i18n::XBreakIterator > xBreakIterator;
     if (!m_xBreakIterator.is())
     {
-        uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
-        if ( xMSF.is() )
-            xBreakIterator = uno::Reference < i18n::XBreakIterator >( xMSF->createInstance(
-                "com.sun.star.i18n.BreakIterator" ), uno::UNO_QUERY );
+        uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+        xBreakIterator = i18n::BreakIterator::create(xContext);
     }
     sal_Int32 nTextLen = rText.getLength();
     sal_Int32 nEndPosition = nTextLen;
diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx
index 544950f..4b14697 100644
--- a/sc/source/core/data/documen6.cxx
+++ b/sc/source/core/data/documen6.cxx
@@ -29,9 +29,10 @@
 #include "scitems.hxx"
 #include <editeng/scripttypeitem.hxx>
 
-#include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <comphelper/processfactory.hxx>
 
 #include "document.hxx"
 #include "cell.hxx"
@@ -43,8 +44,6 @@
 
 using namespace com::sun::star;
 
-#define SC_BREAKITER_SERVICE    "com.sun.star.i18n.BreakIterator"
-
 //
 //  this file is compiled with exceptions enabled
 //  put functions here that need exceptions!
@@ -58,10 +57,7 @@ const uno::Reference< i18n::XBreakIterator >& ScDocument::GetBreakIterator()
         pScriptTypeData = new ScScriptTypeData;
     if ( !pScriptTypeData->xBreakIter.is() )
     {
-        uno::Reference< uno::XInterface > xInterface = xServiceManager->createInstance(
-                            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_BREAKITER_SERVICE )) );
-        pScriptTypeData->xBreakIter = uno::Reference< i18n::XBreakIterator >( xInterface, uno::UNO_QUERY );
-        OSL_ENSURE( pScriptTypeData->xBreakIter.is(), "can't get BreakIterator" );
+        pScriptTypeData->xBreakIter = i18n::BreakIterator::create( comphelper::getComponentContext(xServiceManager) );
     }
     return pScriptTypeData->xBreakIter;
 }
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx
index 65fbb4a..78fe9ad 100644
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -54,7 +54,7 @@
 #include <comphelper/processfactory.hxx>
 #include <comphelper/sequence.hxx>
 #include <com/sun/star/lang/Locale.hpp>
-#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 <com/sun/star/presentation/TextAnimationType.hpp>
@@ -317,65 +317,61 @@ sal_Int32 CustomAnimationEffect::getNumberOfSubitems( const Any& aTarget, sal_In
         if( xShape.is() )
         {
             // TODO/LATER: Optimize this, don't create a break iterator each time
-            Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
-            Reference < i18n::XBreakIterator > xBI( xMSF->createInstance( "com.sun.star.i18n.BreakIterator" ), UNO_QUERY );
-            DBG_ASSERT( xBI.is(), "sd::CustomAnimationEffect::getNumberOfSubitems(), could not create a 'com.sun.star.i18n.BreakIterator'!" );
+            Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+            Reference < i18n::XBreakIterator > xBI = i18n::BreakIterator::create(xContext);
 
-            if( xBI.is() )
+            Reference< XEnumerationAccess > xEA( xShape, UNO_QUERY_THROW );
+            Reference< XEnumeration > xEnumeration( xEA->createEnumeration(), UNO_QUERY_THROW );
+            Locale aLocale;
+            const OUString aStrLocaleName( "CharLocale" );
+            Reference< XTextRange > xParagraph;
+
+            sal_Int32 nPara = 0;
+            while( xEnumeration->hasMoreElements() )
             {
-                Reference< XEnumerationAccess > xEA( xShape, UNO_QUERY_THROW );
-                Reference< XEnumeration > xEnumeration( xEA->createEnumeration(), UNO_QUERY_THROW );
-                Locale aLocale;
-                const OUString aStrLocaleName( "CharLocale" );
-                Reference< XTextRange > xParagraph;
+                xEnumeration->nextElement() >>= xParagraph;
 
-                sal_Int32 nPara = 0;
-                while( xEnumeration->hasMoreElements() )
+                // skip this if its not the only paragraph we want to count
+                if( (nOnlyPara != -1) && (nOnlyPara != nPara ) )
+                    continue;
+
+                if( nIterateType == TextAnimationType::BY_PARAGRAPH )
                 {
-                    xEnumeration->nextElement() >>= xParagraph;
+                    nSubItems++;
+                }
+                else
+                {
+                    const OUString aText( xParagraph->getString() );
+                    Reference< XPropertySet > xSet( xParagraph, UNO_QUERY_THROW );
+                    xSet->getPropertyValue( aStrLocaleName ) >>= aLocale;
 
-                    // skip this if its not the only paragraph we want to count
-                    if( (nOnlyPara != -1) && (nOnlyPara != nPara ) )
-                        continue;
+                    sal_Int32 nPos;
+                    const sal_Int32 nEndPos = aText.getLength();
 
-                    if( nIterateType == TextAnimationType::BY_PARAGRAPH )
+                    if( nIterateType == TextAnimationType::BY_WORD )
                     {
-                        nSubItems++;
+                        for( nPos = 0; nPos < nEndPos; nPos++ )
+                        {
+                            nPos = xBI->getWordBoundary(aText, nPos, aLocale, i18n::WordType::ANY_WORD, sal_True).endPos;
+                            nSubItems++;
+                        }
+                        break;
                     }
                     else
                     {
-                        const OUString aText( xParagraph->getString() );
-                        Reference< XPropertySet > xSet( xParagraph, UNO_QUERY_THROW );
-                        xSet->getPropertyValue( aStrLocaleName ) >>= aLocale;
-
-                        sal_Int32 nPos;
-                        const sal_Int32 nEndPos = aText.getLength();
-
-                        if( nIterateType == TextAnimationType::BY_WORD )
+                        sal_Int32 nDone;
+                        for( nPos = 0; nPos < nEndPos; nPos++ )
                         {
-                            for( nPos = 0; nPos < nEndPos; nPos++ )
-                            {
-                                nPos = xBI->getWordBoundary(aText, nPos, aLocale, i18n::WordType::ANY_WORD, sal_True).endPos;
-                                nSubItems++;
-                            }
-                            break;
-                        }
-                        else
-                        {
-                            sal_Int32 nDone;
-                            for( nPos = 0; nPos < nEndPos; nPos++ )
-                            {
-                                nPos = xBI->nextCharacters(aText, nPos, aLocale, i18n::CharacterIteratorMode::SKIPCELL, 0, nDone);
-                                nSubItems++;
-                            }
+                            nPos = xBI->nextCharacters(aText, nPos, aLocale, i18n::CharacterIteratorMode::SKIPCELL, 0, nDone);
+                            nSubItems++;
                         }
                     }
+                }
 
-                    if( nPara == nOnlyPara )
-                        break;
+                if( nPara == nOnlyPara )
+                    break;
 
-                    nPara++;
-                }
+                nPara++;
             }
         }
     }
diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx
index f1bc0dd..bd8d8d4 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -34,7 +34,7 @@
 #include <com/sun/star/beans/XPropertyState.hpp>
 #include <com/sun/star/container/XEnumerationAccess.hpp>
 #include <com/sun/star/container/XIndexReplace.hpp>
-#include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <com/sun/star/i18n/ScriptDirection.hpp>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/text/FontRelief.hpp>
@@ -1298,13 +1298,9 @@ FontCollection::~FontCollection()
 FontCollection::FontCollection() :
     pVDev ( NULL )
 {
-    com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
-        xMSF = ::comphelper::getProcessServiceFactory();
-    com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
-        xInterface = xMSF->createInstance( "com.sun.star.i18n.BreakIterator" );
-    if ( xInterface.is() )
-        xPPTBreakIter = com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator >
-            ( xInterface, com::sun::star::uno::UNO_QUERY );
+    com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+        xContext = ::comphelper::getProcessComponentContext();
+    xPPTBreakIter = com::sun::star::i18n::BreakIterator::create( xContext );
 }
 
 short FontCollection::GetScriptDirection( const rtl::OUString& rString ) const
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
index 33d8db9..4333dab 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 4277b55..6599f4f 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.
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index da43944..f46c72e 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -56,6 +56,7 @@
 #include <numeric>
 #include <algorithm>
 #include <comphelper/processfactory.hxx>
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <basegfx/polygon/b2dpolypolygontools.hxx>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -833,19 +834,14 @@ SdrObject* CreateSdrObjectFromParagraphOutlines( const FWData& rFWData, const Sd
     return pRet;
 }
 
-::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > EnhancedCustomShapeFontWork::mxBreakIterator = 0;
+Reference < i18n::XBreakIterator > EnhancedCustomShapeFontWork::mxBreakIterator = 0;
 
 Reference < i18n::XBreakIterator > EnhancedCustomShapeFontWork::GetBreakIterator()
 {
     if ( !mxBreakIterator.is() )
     {
-        Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
-        Reference < XInterface > xI = xMSF->createInstance( rtl::OUString("com.sun.star.i18n.BreakIterator") );
-        if ( xI.is() )
-        {
-            Any x = xI->queryInterface( ::getCppuType((const Reference< i18n::XBreakIterator >*)0) );
-            x >>= mxBreakIterator;
-        }
+        Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+        mxBreakIterator = i18n::BreakIterator::create(xContext);
     }
     return mxBreakIterator;
 }
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index cc775a5..2c37904 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -33,7 +33,7 @@
 #include <vcl/svapp.hxx>
 #include <unicode/uchar.h>
 #include <com/sun/star/uno/Reference.h>
-#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>
 
@@ -87,6 +87,7 @@
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
 using ::com::sun::star::i18n::XBreakIterator;
+using ::com::sun::star::i18n::BreakIterator;
 
 // -----------------------------------------------------------------------
 // small helper functions to set fonts
@@ -251,55 +252,50 @@ void FontPrevWin_Impl::CheckScript()
 
     if( !xBreak.is() )
     {
-        Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
-        xBreak = Reference< XBreakIterator >(xMSF->createInstance(
-                ::rtl::OUString("com.sun.star.i18n.BreakIterator") ),UNO_QUERY);
+        Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+        xBreak = BreakIterator::create(xContext);
     }
-    assert(xBreak.is()); // no can do without breakiter
-    if( xBreak.is() )
+    sal_uInt16 nScript = xBreak->getScriptType( aText, 0 );
+    sal_uInt16 nChg = 0;
+    if( com::sun::star::i18n::ScriptType::WEAK == nScript )
     {
-        sal_uInt16 nScript = xBreak->getScriptType( aText, 0 );
-        sal_uInt16 nChg = 0;
-        if( com::sun::star::i18n::ScriptType::WEAK == nScript )
-        {
-            nChg = (xub_StrLen)xBreak->endOfScript( aText, nChg, nScript );
-            if( nChg < aText.Len() )
-                nScript = xBreak->getScriptType( aText, nChg );
-            else
-                nScript = com::sun::star::i18n::ScriptType::LATIN;
-        }
+        nChg = (xub_StrLen)xBreak->endOfScript( aText, nChg, nScript );
+        if( nChg < aText.Len() )
+            nScript = xBreak->getScriptType( aText, nChg );
+        else
+            nScript = com::sun::star::i18n::ScriptType::LATIN;
+    }
 
-        do
+    do
+    {
+        nChg = (xub_StrLen)xBreak->endOfScript( aText, nChg, nScript );
+        if (nChg < aText.Len() && nChg > 0 &&
+            (com::sun::star::i18n::ScriptType::WEAK ==
+             xBreak->getScriptType(aText, nChg - 1)))
         {
-            nChg = (xub_StrLen)xBreak->endOfScript( aText, nChg, nScript );
-            if (nChg < aText.Len() && nChg > 0 &&
-                (com::sun::star::i18n::ScriptType::WEAK ==
-                 xBreak->getScriptType(aText, nChg - 1)))
+            int8_t nType = u_charType(aText.GetChar(nChg) );
+            if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK ||
+                nType == U_COMBINING_SPACING_MARK )
             {
-                int8_t nType = u_charType(aText.GetChar(nChg) );
-                if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK ||
-                    nType == U_COMBINING_SPACING_MARK )
-                {
-                    aScriptChg.push_back( nChg - 1 );
-                }
-                else
-                {
-                    aScriptChg.push_back( nChg );
-                }
+                aScriptChg.push_back( nChg - 1 );
             }
             else
             {
                 aScriptChg.push_back( nChg );
             }
-            aScriptType.push_back( nScript );
-            aTextWidth.push_back( 0 );
+        }
+        else
+        {
+            aScriptChg.push_back( nChg );
+        }
+        aScriptType.push_back( nScript );
+        aTextWidth.push_back( 0 );
 
-            if( nChg < aText.Len() )
-                nScript = xBreak->getScriptType( aText, nChg );
-            else
-                break;
-        } while( sal_True );
-    }
+        if( nChg < aText.Len() )
+            nScript = xBreak->getScriptType( aText, nChg );
+        else
+            break;
+    } while( sal_True );
 }
 
 /*
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index f0935bb..8890528 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -41,7 +41,7 @@
 #include <vcl/virdev.hxx>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/i18n/ScriptType.hpp>
-#include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <comphelper/processfactory.hxx>
 #include <com/sun/star/i18n/CharacterIteratorMode.hpp>
 #include <editeng/unolingu.hxx>
@@ -270,14 +270,8 @@ namespace
             mrShadowDecomposition(rShadowDecomposition)
         {
             // prepare BreakIterator
-            Reference < XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
-            Reference < XInterface > xInterface = xMSF->createInstance(::rtl::OUString("com.sun.star.i18n.BreakIterator"));
-
-            if(xInterface.is())
-            {
-                Any x = xInterface->queryInterface(::getCppuType((const Reference< XBreakIterator >*)0));
-                x >>= mxBreak;
-            }
+            Reference < XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+            mxBreak = com::sun::star::i18n::BreakIterator::create(xContext);
         }
 
         void HandlePair(const basegfx::B2DPolygon rPolygonCandidate, const ::std::vector< const impPathTextPortion* >& rTextPortions)
diff --git a/sw/source/core/bastyp/breakit.cxx b/sw/source/core/bastyp/breakit.cxx
index 805b342..7ed2c57 100644
--- a/sw/source/core/bastyp/breakit.cxx
+++ b/sw/source/core/bastyp/breakit.cxx
@@ -31,11 +31,13 @@
 
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/i18n/CharacterIteratorMode.hpp>
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <editeng/unolingu.hxx>
 #include <editeng/scripttypeitem.hxx>
 #include <unicode/uchar.h>
 #include <unotools/localedatawrapper.hxx>
+#include <comphelper/processfactory.hxx>
 
 using namespace com::sun::star;
 
@@ -75,9 +77,7 @@ SwBreakIt::~SwBreakIt()
 void SwBreakIt::createBreakIterator() const
 {
     if ( m_xMSF.is() && !xBreak.is() )
-        xBreak.set(m_xMSF->createInstance(::rtl::OUString(
-                     RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator"))),
-                   uno::UNO_QUERY);
+        xBreak.set( i18n::BreakIterator::create(comphelper::getComponentContext(m_xMSF)) );
 }
 
 void SwBreakIt::_GetLocale( const LanguageType aLang )
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index f96a2e7..cd44c3c 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -44,7 +44,7 @@
 #include <sfx2/printer.hxx>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <editeng/scripttypeitem.hxx>
-#include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <comphelper/processfactory.hxx>
 
 #include "charatr.hxx"
@@ -411,34 +411,30 @@ void SwDropCapsPict::CheckScript( void )
     maScriptChanges.clear();
     if( !xBreak.is() )
     {
-        Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
-        xBreak = Reference< I18N::XBreakIterator >(xMSF->createInstance(
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) ),UNO_QUERY);
+        Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+        xBreak = I18N::BreakIterator::create(xContext);
     }
-    if( xBreak.is() )
+    sal_uInt16 nScript = xBreak->getScriptType( maText, 0 );
+    sal_uInt16 nChg = 0;
+    if( I18N_SCRIPTTYPE::WEAK == nScript )
     {
-        sal_uInt16 nScript = xBreak->getScriptType( maText, 0 );
-        sal_uInt16 nChg = 0;
-        if( I18N_SCRIPTTYPE::WEAK == nScript )
-        {
-            nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript );
-            if( nChg < maText.Len() )
-                nScript = xBreak->getScriptType( maText, nChg );
-            else
-                nScript = I18N_SCRIPTTYPE::LATIN;
-        }
+        nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript );
+        if( nChg < maText.Len() )
+            nScript = xBreak->getScriptType( maText, nChg );
+        else
+            nScript = I18N_SCRIPTTYPE::LATIN;
+    }
 
-        do
-        {
-            nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript );
-            maScriptChanges.push_back( _ScriptInfo(0, nScript, nChg) );
+    do
+    {
+        nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript );
+        maScriptChanges.push_back( _ScriptInfo(0, nScript, nChg) );
 
-            if( nChg < maText.Len() )
-                nScript = xBreak->getScriptType( maText, nChg );
-            else
-                break;
-        } while( sal_True );
-    }
+        if( nChg < maText.Len() )
+            nScript = xBreak->getScriptType( maText, nChg );
+        else
+            break;
+    } while( sal_True );
 }
 
 Size SwDropCapsPict::CalcTextSize( void )
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index 91df248..cfcde7e 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -32,7 +32,7 @@
 #include <vcl/svapp.hxx>
 #include <svl/zforlist.hxx>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <com/sun/star/i18n/BreakIterator.hpp>
 #include <comphelper/processfactory.hxx>
 #include <svtools/scriptedtext.hxx>
 #include <svtools/accessibilityoptions.hxx>
@@ -559,10 +559,7 @@ AutoFmtPreview::AutoFmtPreview(Window* pParent) :
     OSL_ENSURE( m_xMSF.is(), "AutoFmtPreview: no MultiServiceFactory");
     if ( m_xMSF.is() )
     {
-        m_xBreak = uno::Reference< i18n::XBreakIterator >(
-            m_xMSF->createInstance (
-            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) ),
-            uno::UNO_QUERY);
+        m_xBreak = i18n::BreakIterator::create(comphelper::getComponentContext(m_xMSF));
     }
     pNumFmt = new SvNumberFormatter( m_xMSF, LANGUAGE_SYSTEM );
 
diff --git a/vcl/source/app/unohelp.cxx b/vcl/source/app/unohelp.cxx
index 3291592..a7ba555 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 a8d018e..40d75bf 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);
 }
 // -----------------------------------------------------------------------
 
commit e41f21b4165e40e1564cc75928b4b085ce7072e1
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 23 14:42:47 2012 +0200

    com.sun.star.xml.NamespaceContainer appears to be unused
    
    Change-Id: I9d5de399e5adf37d42dac5421e5cd4c35bf96a6c

diff --git a/offapi/com/sun/star/xml/NamespaceContainer.idl b/offapi/com/sun/star/xml/NamespaceContainer.idl
index 73acb1c..6b9c2fa 100644
--- a/offapi/com/sun/star/xml/NamespaceContainer.idl
+++ b/offapi/com/sun/star/xml/NamespaceContainer.idl
@@ -27,6 +27,8 @@ module com { module sun { module star { module xml {
 /** This service describes a container for XML namespaces.
 
     <p>Each namespace is accessed with its prefix and the URL is stored as a string.
+
+    @deprecated This appears to be unused.
 */
 published service NamespaceContainer
 {


More information about the Libreoffice-commits mailing list