[Libreoffice-commits] core.git: 2 commits - include/linguistic linguistic/source

Eike Rathke erack at redhat.com
Tue Aug 30 21:09:41 UTC 2016


 include/linguistic/hyphdta.hxx |    8 ++++----
 include/linguistic/misc.hxx    |    2 +-
 linguistic/source/hyphdsp.cxx  |   14 +++++++-------
 linguistic/source/hyphdsp.hxx  |    4 ++--
 linguistic/source/hyphdta.cxx  |    4 ++--
 linguistic/source/misc.cxx     |    2 +-
 6 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit e3df93d03c19bc75d1aeb340f056f57db3f4f46c
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Aug 30 22:47:36 2016 +0200

    return const&
    
    Change-Id: Ia36a6c13dab4c6dbdcff45bfa432835296eec868

diff --git a/include/linguistic/misc.hxx b/include/linguistic/misc.hxx
index 52f7a69..7ba3d2f 100644
--- a/include/linguistic/misc.hxx
+++ b/include/linguistic/misc.hxx
@@ -80,7 +80,7 @@ enum class CapType
 
 LNG_DLLPUBLIC ::osl::Mutex& GetLinguMutex();
 
-LocaleDataWrapper & GetLocaleDataWrapper( LanguageType nLang );
+const LocaleDataWrapper & GetLocaleDataWrapper( LanguageType nLang );
 
 sal_Int32 LevDistance( const OUString &rTxt1, const OUString &rTxt2 );
 
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index 29a057f..37f20fb 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -68,7 +68,7 @@ osl::Mutex &    GetLinguMutex()
     return LinguMutex::get();
 }
 
-LocaleDataWrapper & GetLocaleDataWrapper( LanguageType nLang )
+const LocaleDataWrapper & GetLocaleDataWrapper( LanguageType nLang )
 {
     static LocaleDataWrapper aLclDtaWrp( SvtSysLocale().GetLanguageTag() );
 
commit d3351ca3c73263fb0151970e7924dff5fa105504
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Aug 30 22:39:44 2016 +0200

    LanguageType is unsigned int16
    
    Change-Id: I5745fe2a54936e7a2585fe311522d71f08b97bfc

diff --git a/include/linguistic/hyphdta.hxx b/include/linguistic/hyphdta.hxx
index 32d1875..2e08f90 100644
--- a/include/linguistic/hyphdta.hxx
+++ b/include/linguistic/hyphdta.hxx
@@ -35,14 +35,14 @@ class HyphenatedWord :
     OUString     aHyphenatedWord;
     sal_Int16    nHyphPos;
     sal_Int16    nHyphenationPos;
-    sal_Int16    nLanguage;
+    sal_uInt16   nLanguage;
     bool         bIsAltSpelling;
 
     HyphenatedWord(const HyphenatedWord &) = delete;
     HyphenatedWord & operator = (const HyphenatedWord &) = delete;
 
 public:
-    HyphenatedWord(const OUString &rWord, sal_Int16 nLang, sal_Int16 nHyphenationPos,
+    HyphenatedWord(const OUString &rWord, sal_uInt16 nLang, sal_Int16 nHyphenationPos,
                    const OUString &rHyphenatedWord, sal_Int16 nHyphenPos );
     virtual ~HyphenatedWord();
 
@@ -81,13 +81,13 @@ class PossibleHyphens :
     OUString             aWord;
     OUString             aWordWithHyphens;
     css::uno::Sequence< sal_Int16 > aOrigHyphenPos;
-    sal_Int16                       nLanguage;
+    sal_uInt16           nLanguage;
 
     PossibleHyphens(const PossibleHyphens &) = delete;
     PossibleHyphens & operator = (const PossibleHyphens &) = delete;
 
 public:
-    PossibleHyphens(const OUString &rWord, sal_Int16 nLang,
+    PossibleHyphens(const OUString &rWord, sal_uInt16 nLang,
             const OUString &rHyphWord,
             const css::uno::Sequence< sal_Int16 > &rPositions);
     virtual ~PossibleHyphens();
diff --git a/include/linguistic/misc.hxx b/include/linguistic/misc.hxx
index 99dfd05..52f7a69 100644
--- a/include/linguistic/misc.hxx
+++ b/include/linguistic/misc.hxx
@@ -80,7 +80,7 @@ enum class CapType
 
 LNG_DLLPUBLIC ::osl::Mutex& GetLinguMutex();
 
-LocaleDataWrapper & GetLocaleDataWrapper( sal_Int16 nLang );
+LocaleDataWrapper & GetLocaleDataWrapper( LanguageType nLang );
 
 sal_Int32 LevDistance( const OUString &rTxt1, const OUString &rTxt2 );
 
diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx
index 6018af0..1a6db5e 100644
--- a/linguistic/source/hyphdsp.cxx
+++ b/linguistic/source/hyphdsp.cxx
@@ -70,7 +70,7 @@ void HyphenatorDispatcher::ClearSvcList()
 Reference<XHyphenatedWord>  HyphenatorDispatcher::buildHyphWord(
             const OUString& rOrigWord,
             const Reference<XDictionaryEntry> &xEntry,
-            sal_Int16 nLang, sal_Int16 nMaxLeading )
+            LanguageType nLang, sal_Int16 nMaxLeading )
 {
     MutexGuard  aGuard( GetLinguMutex() );
 
@@ -182,7 +182,7 @@ Reference<XHyphenatedWord>  HyphenatorDispatcher::buildHyphWord(
 
 
 Reference< XPossibleHyphens > HyphenatorDispatcher::buildPossHyphens(
-            const Reference< XDictionaryEntry > &xEntry, sal_Int16 nLanguage )
+            const Reference< XDictionaryEntry > &xEntry, LanguageType nLanguage )
 {
     MutexGuard  aGuard( GetLinguMutex() );
 
@@ -281,7 +281,7 @@ Reference< XHyphenatedWord > SAL_CALL
     Reference< XHyphenatedWord >    xRes;
 
     sal_Int32 nWordLen = rWord.getLength();
-    sal_Int16 nLanguage = LinguLocaleToLanguage( rLocale );
+    LanguageType nLanguage = LinguLocaleToLanguage( rLocale );
     if (LinguIsUnspecified(nLanguage) || !nWordLen ||
         nMaxLeading == 0 || nMaxLeading == nWordLen)
         return xRes;
@@ -418,7 +418,7 @@ Reference< XHyphenatedWord > SAL_CALL
     Reference< XHyphenatedWord >    xRes;
 
     sal_Int32 nWordLen = rWord.getLength();
-    sal_Int16 nLanguage = LinguLocaleToLanguage( rLocale );
+    LanguageType nLanguage = LinguLocaleToLanguage( rLocale );
     if (LinguIsUnspecified(nLanguage) || !nWordLen)
         return xRes;
 
@@ -549,7 +549,7 @@ Reference< XPossibleHyphens > SAL_CALL
 
     Reference< XPossibleHyphens >   xRes;
 
-    sal_Int16 nLanguage = LinguLocaleToLanguage( rLocale );
+    LanguageType nLanguage = LinguLocaleToLanguage( rLocale );
     if (LinguIsUnspecified(nLanguage) || rWord.isEmpty())
         return xRes;
 
@@ -663,7 +663,7 @@ void HyphenatorDispatcher::SetServiceList( const Locale &rLocale,
 {
     MutexGuard  aGuard( GetLinguMutex() );
 
-    sal_Int16 nLanguage = LinguLocaleToLanguage( rLocale );
+    LanguageType nLanguage = LinguLocaleToLanguage( rLocale );
 
     sal_Int32 nLen = rSvcImplNames.getLength();
     if (0 == nLen)
@@ -698,7 +698,7 @@ Sequence< OUString >
     Sequence< OUString > aRes;
 
     // search for entry with that language and use data from that
-    sal_Int16 nLanguage = LinguLocaleToLanguage( rLocale );
+    LanguageType nLanguage = LinguLocaleToLanguage( rLocale );
     const HyphSvcByLangMap_t::const_iterator  aIt( aSvcMap.find( nLanguage ) );
     const LangSvcEntries_Hyph       *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : nullptr;
     if (pEntry)
diff --git a/linguistic/source/hyphdsp.hxx b/linguistic/source/hyphdsp.hxx
index 39b7030..7872c7e 100644
--- a/linguistic/source/hyphdsp.hxx
+++ b/linguistic/source/hyphdsp.hxx
@@ -71,11 +71,11 @@ class HyphenatorDispatcher :
     static css::uno::Reference< css::linguistic2::XHyphenatedWord>
             buildHyphWord( const OUString& rOrigWord,
                 const css::uno::Reference< css::linguistic2::XDictionaryEntry> &xEntry,
-                sal_Int16 nLang, sal_Int16 nMaxLeading );
+                LanguageType nLang, sal_Int16 nMaxLeading );
 
     static css::uno::Reference< css::linguistic2::XPossibleHyphens >
             buildPossHyphens( const css::uno::Reference< css::linguistic2::XDictionaryEntry > &xEntry,
-                    sal_Int16 nLanguage );
+                    LanguageType nLanguage );
 
 public:
     explicit HyphenatorDispatcher( LngSvcMgr &rLngSvcMgr );
diff --git a/linguistic/source/hyphdta.cxx b/linguistic/source/hyphdta.cxx
index 0eb88f1..69e6a5f 100644
--- a/linguistic/source/hyphdta.cxx
+++ b/linguistic/source/hyphdta.cxx
@@ -40,7 +40,7 @@ namespace linguistic
 {
 
 
-HyphenatedWord::HyphenatedWord(const OUString &rWord, sal_Int16 nLang, sal_Int16 nHPos,
+HyphenatedWord::HyphenatedWord(const OUString &rWord, sal_uInt16 nLang, sal_Int16 nHPos,
                                const OUString &rHyphWord, sal_Int16 nPos ) :
     aWord           (rWord),
     aHyphenatedWord (rHyphWord),
@@ -119,7 +119,7 @@ sal_Bool SAL_CALL HyphenatedWord::isAlternativeSpelling()
 }
 
 
-PossibleHyphens::PossibleHyphens(const OUString &rWord, sal_Int16 nLang,
+PossibleHyphens::PossibleHyphens(const OUString &rWord, sal_uInt16 nLang,
             const OUString &rHyphWord,
             const Sequence< sal_Int16 > &rPositions) :
     aWord           (rWord),
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index 353d2de..29a057f 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -68,7 +68,7 @@ osl::Mutex &    GetLinguMutex()
     return LinguMutex::get();
 }
 
-LocaleDataWrapper & GetLocaleDataWrapper( sal_Int16 nLang )
+LocaleDataWrapper & GetLocaleDataWrapper( LanguageType nLang )
 {
     static LocaleDataWrapper aLclDtaWrp( SvtSysLocale().GetLanguageTag() );
 


More information about the Libreoffice-commits mailing list