diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-04-17 21:35:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-26 08:50:54 +0200 |
commit | c70d49c7c888da8cfd73db8585e7be1f37fc398a (patch) | |
tree | c0e540401850018464ca76300536faf9aa7e27d2 /include/linguistic | |
parent | cd4344d3bdef631b3e64ac12a9e64bc9670c1b7c (diff) |
use strong_int for LanguageType
Change-Id: If99a944f7032180355da291ad283b4cfcea4f448
Reviewed-on: https://gerrit.libreoffice.org/36629
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/linguistic')
-rw-r--r-- | include/linguistic/hyphdta.hxx | 13 | ||||
-rw-r--r-- | include/linguistic/misc.hxx | 14 | ||||
-rw-r--r-- | include/linguistic/spelldta.hxx | 13 |
3 files changed, 22 insertions, 18 deletions
diff --git a/include/linguistic/hyphdta.hxx b/include/linguistic/hyphdta.hxx index 3fe0c76d4b69..b86d8cf8d78a 100644 --- a/include/linguistic/hyphdta.hxx +++ b/include/linguistic/hyphdta.hxx @@ -24,6 +24,7 @@ #include <com/sun/star/linguistic2/XPossibleHyphens.hpp> #include <cppuhelper/implbase.hxx> #include <linguistic/lngdllapi.h> +#include <i18nlangtag/lang.h> namespace linguistic { @@ -35,14 +36,14 @@ class HyphenatedWord : OUString aHyphenatedWord; sal_Int16 nHyphPos; sal_Int16 nHyphenationPos; - sal_uInt16 nLanguage; + LanguageType nLanguage; bool bIsAltSpelling; HyphenatedWord(const HyphenatedWord &) = delete; HyphenatedWord & operator = (const HyphenatedWord &) = delete; public: - HyphenatedWord(const OUString &rWord, sal_uInt16 nLang, sal_Int16 nHyphenationPos, + HyphenatedWord(const OUString &rWord, LanguageType nLang, sal_Int16 nHyphenationPos, const OUString &rHyphenatedWord, sal_Int16 nHyphenPos ); virtual ~HyphenatedWord() override; @@ -61,7 +62,7 @@ public: isAlternativeSpelling() override; static css::uno::Reference <css::linguistic2::XHyphenatedWord> LNG_DLLPUBLIC CreateHyphenatedWord( - const OUString &rWord, sal_Int16 nLang, sal_Int16 nHyphenationPos, + const OUString &rWord, LanguageType nLang, sal_Int16 nHyphenationPos, const OUString &rHyphenatedWord, sal_Int16 nHyphenPos ); }; @@ -75,13 +76,13 @@ class PossibleHyphens : OUString aWord; OUString aWordWithHyphens; css::uno::Sequence< sal_Int16 > aOrigHyphenPos; - sal_uInt16 nLanguage; + LanguageType nLanguage; PossibleHyphens(const PossibleHyphens &) = delete; PossibleHyphens & operator = (const PossibleHyphens &) = delete; public: - PossibleHyphens(const OUString &rWord, sal_uInt16 nLang, + PossibleHyphens(const OUString &rWord, LanguageType nLang, const OUString &rHyphWord, const css::uno::Sequence< sal_Int16 > &rPositions); virtual ~PossibleHyphens() override; @@ -97,7 +98,7 @@ public: getHyphenationPositions() override; static css::uno::Reference < css::linguistic2::XPossibleHyphens > LNG_DLLPUBLIC CreatePossibleHyphens - (const OUString &rWord, sal_Int16 nLang, + (const OUString &rWord, LanguageType nLang, const OUString &rHyphWord, const css::uno::Sequence< sal_Int16 > &rPositions); }; diff --git a/include/linguistic/misc.hxx b/include/linguistic/misc.hxx index b2a53bd3eadf..b65cd9bc9a92 100644 --- a/include/linguistic/misc.hxx +++ b/include/linguistic/misc.hxx @@ -106,7 +106,9 @@ LNG_DLLPUBLIC bool LinguIsUnspecified( LanguageType nLanguage ); tag string instead. */ LNG_DLLPUBLIC bool LinguIsUnspecified( const OUString & rBcp47 ); -css::uno::Sequence< sal_Int16 > +std::vector< LanguageType > + LocaleSeqToLangVec( css::uno::Sequence< css::lang::Locale > &rLocaleSeq ); +css::uno::Sequence<sal_Int16> LocaleSeqToLangSeq( css::uno::Sequence< css::lang::Locale > &rLocaleSeq ); // checks if file pointed to by rURL is readonly @@ -132,12 +134,12 @@ css::uno::Reference< css::linguistic2::XHyphenatedWord > css::uno::Reference< css::linguistic2::XHyphenatedWord > &rxHyphWord ); -LNG_DLLPUBLIC bool IsUpper( const OUString &rText, sal_Int32 nPos, sal_Int32 nLen, sal_Int16 nLanguage ); +LNG_DLLPUBLIC bool IsUpper( const OUString &rText, sal_Int32 nPos, sal_Int32 nLen, LanguageType nLanguage ); -inline bool IsUpper( const OUString &rText, sal_Int16 nLanguage ) { return IsUpper( rText, 0, rText.getLength(), nLanguage ); } +inline bool IsUpper( const OUString &rText, LanguageType nLanguage ) { return IsUpper( rText, 0, rText.getLength(), nLanguage ); } LNG_DLLPUBLIC CapType SAL_CALL capitalType(const OUString&, CharClass *); -OUString ToLower( const OUString &rText, sal_Int16 nLanguage ); +OUString ToLower( const OUString &rText, LanguageType nLanguage ); LNG_DLLPUBLIC bool HasDigits( const OUString &rText ); LNG_DLLPUBLIC bool IsNumeric( const OUString &rText ); @@ -157,13 +159,13 @@ css::uno::Reference< css::linguistic2::XDictionaryEntry > SearchDicList( const css::uno::Reference< css::linguistic2::XSearchableDictionaryList >& rDicList, - const OUString& rWord, sal_Int16 nLanguage, + const OUString& rWord, LanguageType nLanguage, bool bSearchPosDics, bool bSearchSpellEntry ); LNG_DLLPUBLIC DictionaryError AddEntryToDic( css::uno::Reference< css::linguistic2::XDictionary > &rxDic, const OUString &rWord, bool bIsNeg, - const OUString &rRplcTxt, sal_Int16 nRplcLang, + const OUString &rRplcTxt, bool bStripDot = true ); LNG_DLLPUBLIC bool SaveDictionaries( const css::uno::Reference< css::linguistic2::XSearchableDictionaryList > &xDicList ); diff --git a/include/linguistic/spelldta.hxx b/include/linguistic/spelldta.hxx index f38e836371ae..7c23c2cca1bf 100644 --- a/include/linguistic/spelldta.hxx +++ b/include/linguistic/spelldta.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp> #include <cppuhelper/implbase.hxx> #include <linguistic/lngdllapi.h> +#include <i18nlangtag/lang.h> namespace com { namespace sun { namespace star { namespace linguistic2 { @@ -46,9 +47,9 @@ std::vector< OUString > void SeqRemoveNegEntries( std::vector< OUString > &rSeq, css::uno::Reference< css::linguistic2::XSearchableDictionaryList > &rxDicList, - sal_Int16 nLanguage ); + LanguageType nLanguage ); -void SearchSimilarText( const OUString &rText, sal_Int16 nLanguage, +void SearchSimilarText( const OUString &rText, LanguageType nLanguage, css::uno::Reference< css::linguistic2::XSearchableDictionaryList > &xDicList, std::vector< OUString > & rDicListProps ); @@ -63,11 +64,11 @@ class SpellAlternatives css::uno::Sequence< OUString > aAlt; // list of alternatives, may be empty. OUString aWord; sal_Int16 nType; // type of failure - sal_Int16 nLanguage; + LanguageType nLanguage; public: LNG_DLLPUBLIC SpellAlternatives(); - SpellAlternatives(const OUString &rWord, sal_Int16 nLang, + SpellAlternatives(const OUString &rWord, LanguageType nLang, const css::uno::Sequence< OUString > &rAlternatives ); virtual ~SpellAlternatives() override; SpellAlternatives(const SpellAlternatives&) = delete; @@ -85,11 +86,11 @@ public: virtual void SAL_CALL setFailureType( ::sal_Int16 nFailureType ) override; // non-interface specific functions - void LNG_DLLPUBLIC SetWordLanguage(const OUString &rWord, sal_Int16 nLang); + void LNG_DLLPUBLIC SetWordLanguage(const OUString &rWord, LanguageType nLang); void LNG_DLLPUBLIC SetFailureType(sal_Int16 nTypeP); void LNG_DLLPUBLIC SetAlternatives( const css::uno::Sequence< OUString > &rAlt ); static css::uno::Reference < css::linguistic2::XSpellAlternatives > LNG_DLLPUBLIC CreateSpellAlternatives( - const OUString &rWord, sal_Int16 nLang, sal_Int16 nTypeP, const css::uno::Sequence< OUString > &rAlt ); + const OUString &rWord, LanguageType nLang, sal_Int16 nTypeP, const css::uno::Sequence< OUString > &rAlt ); }; } // namespace linguistic |