[Libreoffice-commits] core.git: 2 commits - i18npool/source i18npool/util include/vcl vcl/source

Matúš Kukan matus.kukan at collabora.com
Tue Feb 11 13:36:08 PST 2014


 i18npool/source/inputchecker/inputsequencechecker.cxx |   12 +++++++++---
 i18npool/source/registerservices/registerservices.cxx |    5 -----
 i18npool/util/i18npool.component                      |    3 ++-
 include/vcl/edit.hxx                                  |    4 +++-
 include/vcl/texteng.hxx                               |    3 ++-
 vcl/source/control/edit.cxx                           |   14 +++++---------
 vcl/source/edit/texteng.cxx                           |   11 +++++------
 7 files changed, 26 insertions(+), 26 deletions(-)

New commits:
commit 76f5ce409fc9c3985d475f9e41d1b38cfd9f1ec2
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Mon Feb 10 18:44:48 2014 +0100

    more similar handling of InputSequenceChecker as in other places
    
    Change-Id: Ia6efc0eda03dac87c73e720d08f320ce3fc6ce4a

diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
index 471e5d3..4d6566a 100644
--- a/include/vcl/edit.hxx
+++ b/include/vcl/edit.hxx
@@ -86,6 +86,8 @@ private:
     Link                maUpdateDataHdl;
     Link                maAutocompleteHdl;
 
+    css::uno::Reference < css::i18n::XExtendedInputSequenceChecker > mxISC;
+
     DECL_DLLPRIVATE_LINK(      ImplUpdateDataHdl, void* );
 
     SAL_DLLPRIVATE bool        ImplTruncateToMaxLen( OUString&, sal_Int32 nSelectionLen ) const;
@@ -112,7 +114,7 @@ private:
     SAL_DLLPRIVATE void        ImplCopy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
     SAL_DLLPRIVATE void        ImplPaste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
     SAL_DLLPRIVATE long        ImplGetTextYPosition() const;
-    SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedInputSequenceChecker > ImplGetInputSequenceChecker() const;
+    SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedInputSequenceChecker > ImplGetInputSequenceChecker();
     SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > ImplGetBreakIterator() const;
 
 protected:
diff --git a/include/vcl/texteng.hxx b/include/vcl/texteng.hxx
index 163d62c..fd6afcf 100644
--- a/include/vcl/texteng.hxx
+++ b/include/vcl/texteng.hxx
@@ -104,6 +104,7 @@ private:
 
     ::com::sun::star::lang::Locale maLocale;
     ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > mxBreakIterator;
+    css::uno::Reference < css::i18n::XExtendedInputSequenceChecker > mxISC;
 
     Rectangle           maInvalidRect;
     Range               maInvalidRange;
@@ -159,7 +160,7 @@ protected:
     // gets not exported. First and seconf parameter swapped to have a different signatur.
     SAL_DLLPRIVATE TextPaM  ImpInsertText( sal_Unicode c, const TextSelection& rSel, sal_Bool bOverwrite = sal_False, sal_Bool bIsUserInput = sal_False );
     // some other new functions needed that must not be exported to remain compatible
-    SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedInputSequenceChecker > GetInputSequenceChecker() const;
+    SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedInputSequenceChecker > GetInputSequenceChecker();
     SAL_DLLPRIVATE sal_Bool IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const;
 
     // broadcast or adjust selections
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 1a0d04c..2e8b3f9 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -834,18 +834,14 @@ uno::Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
 }
 // -----------------------------------------------------------------------
 
-uno::Reference < i18n::XExtendedInputSequenceChecker > Edit::ImplGetInputSequenceChecker() const
+uno::Reference < i18n::XExtendedInputSequenceChecker > Edit::ImplGetInputSequenceChecker()
 {
-    //!! 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::XExtendedInputSequenceChecker > xISC;
-//    if ( !xISC.is() )
+    if ( !mxISC.is() )
     {
-        uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
-        xISC = i18n::InputSequenceChecker::create(xContext);
+        mxISC = i18n::InputSequenceChecker::create(
+                ::comphelper::getProcessComponentContext() );
     }
-    return xISC;
+    return mxISC;
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index a0e27e8..7e8037d 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -628,15 +628,14 @@ void TextEngine::ImpRemoveParagraph( sal_uLong nPara )
     ImpParagraphRemoved( nPara );
 }
 
-uno::Reference < i18n::XExtendedInputSequenceChecker > TextEngine::GetInputSequenceChecker() const
+uno::Reference < i18n::XExtendedInputSequenceChecker > TextEngine::GetInputSequenceChecker()
 {
-    uno::Reference < i18n::XExtendedInputSequenceChecker > xISC;
-//    if ( !xISC.is() )
+    if ( !mxISC.is() )
     {
-        uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
-        xISC = i18n::InputSequenceChecker::create(xContext);
+        mxISC = i18n::InputSequenceChecker::create(
+                ::comphelper::getProcessComponentContext() );
     }
-    return xISC;
+    return mxISC;
 }
 
 sal_Bool TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const
commit 5d0638afdf59950a64bc1b8a0794b60de87addc4
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Mon Feb 10 17:51:28 2014 +0100

    i18npool: Ctor feature for com.sun.star.i18n.InputSequenceChecker
    
    Change-Id: I7937b5ba09c00448678e71c1786f775998f0f6fa

diff --git a/i18npool/source/inputchecker/inputsequencechecker.cxx b/i18npool/source/inputchecker/inputsequencechecker.cxx
index 4dea3d6..496c06c 100644
--- a/i18npool/source/inputchecker/inputsequencechecker.cxx
+++ b/i18npool/source/inputchecker/inputsequencechecker.cxx
@@ -22,17 +22,15 @@
 #include <com/sun/star/i18n/UnicodeType.hpp>
 #include <cppuhelper/supportsservice.hxx>
 #include <i18nutil/unicode.hxx>
-#include <rtl/ustrbuf.hxx>
 
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
-using namespace ::rtl;
 
 namespace com { namespace sun { namespace star { namespace i18n {
 
 InputSequenceCheckerImpl::InputSequenceCheckerImpl( const Reference < XComponentContext >& rxContext ) : m_xContext( rxContext )
 {
-    serviceName = "com.sun.star.i18n.InputSequenceCheckerImpl";
+    serviceName = "com.sun.star.i18n.InputSequenceChecker";
     cachedItem = NULL;
 }
 
@@ -157,4 +155,12 @@ InputSequenceCheckerImpl::getSupportedServiceNames(void) throw( RuntimeException
 
 } } } }
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_i18n_InputSequenceChecker_get_implementation(
+    css::uno::XComponentContext *context,
+    css::uno::Sequence<css::uno::Any> const &)
+{
+    return cppu::acquire(new css::i18n::InputSequenceCheckerImpl(context));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx
index 601184d0..d0e576f 100644
--- a/i18npool/source/registerservices/registerservices.cxx
+++ b/i18npool/source/registerservices/registerservices.cxx
@@ -55,7 +55,6 @@
 #include <chaptercollator.hxx>
 #include <collator_unicode.hxx>
 
-#include <inputsequencechecker.hxx>
 #include <inputsequencechecker_th.hxx>
 #include <inputsequencechecker_hi.hxx>
 
@@ -122,7 +121,6 @@ IMPL_CREATEINSTANCE( BreakIterator_th )
 IMPL_CREATEINSTANCE_CTX( ChapterCollator )
 IMPL_CREATEINSTANCE( Collator_Unicode )
 
-IMPL_CREATEINSTANCE_CTX( InputSequenceCheckerImpl )
 IMPL_CREATEINSTANCE( InputSequenceChecker_th )
 IMPL_CREATEINSTANCE( InputSequenceChecker_hi )
 
@@ -323,9 +321,6 @@ static const struct InstancesArray {
     {   "com.sun.star.i18n.Collator_Unicode",
         "com.sun.star.i18n.Collator_Unicode",
         &Collator_Unicode_CreateInstance },
-    {   "com.sun.star.i18n.InputSequenceChecker",
-        "com.sun.star.i18n.InputSequenceChecker",
-        &InputSequenceCheckerImpl_CreateInstance },
     {   "com.sun.star.i18n.InputSequenceChecker_th",
         "com.sun.star.i18n.InputSequenceChecker_th",
         &InputSequenceChecker_th_CreateInstance },
diff --git a/i18npool/util/i18npool.component b/i18npool/util/i18npool.component
index 88f72ea..9873934 100644
--- a/i18npool/util/i18npool.component
+++ b/i18npool/util/i18npool.component
@@ -114,7 +114,8 @@
   <implementation name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by syllable)">
     <service name="com.sun.star.i18n.IndexEntrySupplier_ja_phonetic (alphanumeric last) (grouped by syllable)"/>
   </implementation>
-  <implementation name="com.sun.star.i18n.InputSequenceChecker">
+  <implementation name="com.sun.star.i18n.InputSequenceChecker"
+      constructor="com_sun_star_i18n_InputSequenceChecker_get_implementation">
     <service name="com.sun.star.i18n.InputSequenceChecker"/>
   </implementation>
   <implementation name="com.sun.star.i18n.InputSequenceChecker_hi">


More information about the Libreoffice-commits mailing list