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 /sc/source/ui | |
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 'sc/source/ui')
-rw-r--r-- | sc/source/ui/app/scmod.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/dbgui/asciiopt.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/scuiasciiopt.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh3.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/inc/viewutil.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/filtuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/spelleng.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewutil.cxx | 4 |
10 files changed, 16 insertions, 15 deletions
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index c25910d55dc0..2c65b5c69944 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -912,7 +912,7 @@ SvtUserOptions& ScModule::GetUserOptions() return *pUserOptions; } -sal_uInt16 ScModule::GetOptDigitLanguage() +LanguageType ScModule::GetOptDigitLanguage() { SvtCTLOptions::TextNumerals eNumerals = GetCTLOptions().GetCTLTextNumerals(); return ( eNumerals == SvtCTLOptions::NUMERALS_ARABIC ) ? LANGUAGE_ENGLISH_US : @@ -927,7 +927,7 @@ sal_uInt16 ScModule::GetOptDigitLanguage() */ void ScModule::ModifyOptions( const SfxItemSet& rOptSet ) { - sal_uInt16 nOldSpellLang, nOldCjkLang, nOldCtlLang; + LanguageType nOldSpellLang, nOldCjkLang, nOldCtlLang; bool bOldAutoSpell; GetSpellSettings( nOldSpellLang, nOldCjkLang, nOldCtlLang, bOldAutoSpell ); @@ -2230,7 +2230,7 @@ using namespace com::sun::star; #define LINGUPROP_AUTOSPELL "IsSpellAuto" -void ScModule::GetSpellSettings( sal_uInt16& rDefLang, sal_uInt16& rCjkLang, sal_uInt16& rCtlLang, +void ScModule::GetSpellSettings( LanguageType& rDefLang, LanguageType& rCjkLang, LanguageType& rCtlLang, bool& rAutoSpell ) { // use SvtLinguConfig instead of service LinguProperties to avoid @@ -2255,7 +2255,7 @@ void ScModule::SetAutoSpellProperty( bool bSet ) aConfig.SetProperty( OUString( LINGUPROP_AUTOSPELL ), uno::Any(bSet) ); } -bool ScModule::HasThesaurusLanguage( sal_uInt16 nLang ) +bool ScModule::HasThesaurusLanguage( LanguageType nLang ) { if ( nLang == LANGUAGE_NONE ) return false; diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx index 1d91334c877c..acccdfb55bb3 100644 --- a/sc/source/ui/dbgui/asciiopt.cxx +++ b/sc/source/ui/dbgui/asciiopt.cxx @@ -304,7 +304,7 @@ OUString ScAsciiOptions::WriteToString() const aOutStr += "," + // Language - OUString::number(eLang) + "," + + OUString::number((sal_uInt16)eLang) + "," + // Import quoted field as text. OUString::boolean( bQuotedFieldAsText ) + "," + // Detect special numbers. diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index ebf8ac90867f..feeed32efb77 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -596,7 +596,7 @@ void ScImportAsciiDlg::SaveParameters() pRbFixed->IsChecked(), static_cast<sal_Int32>(pNfRow->GetValue()), pLbCharSet->GetSelectEntryPos(), - static_cast<sal_Int32>(pLbCustomLang->GetSelectLanguage()), meCall ); + static_cast<sal_uInt16>(pLbCustomLang->GetSelectLanguage()), meCall ); } void ScImportAsciiDlg::SetSeparators() diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 3efd9f1c530d..8a75619c2157 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -404,7 +404,7 @@ void ScDocShell::InitOptions(bool bForLoading) // called from InitNew and L { // Settings from the SpellCheckCfg get into Doc- and ViewOptions - sal_uInt16 nDefLang, nCjkLang, nCtlLang; + LanguageType nDefLang, nCjkLang, nCtlLang; bool bAutoSpell; ScModule::GetSpellSettings( nDefLang, nCjkLang, nCtlLang, bAutoSpell ); ScModule* pScMod = SC_MOD(); @@ -437,7 +437,7 @@ void ScDocShell::InitOptions(bool bForLoading) // called from InitNew and L // print options are now set directly before the printing - aDocument.SetLanguage( (LanguageType) nDefLang, (LanguageType) nCjkLang, (LanguageType) nCtlLang ); + aDocument.SetLanguage( nDefLang, nCjkLang, nCtlLang ); } Printer* ScDocShell::GetDocumentPrinter() // for OLE diff --git a/sc/source/ui/inc/viewutil.hxx b/sc/source/ui/inc/viewutil.hxx index af37b9620edb..dc84c2880b1d 100644 --- a/sc/source/ui/inc/viewutil.hxx +++ b/sc/source/ui/inc/viewutil.hxx @@ -21,6 +21,7 @@ #include "address.hxx" #include <sal/types.h> +#include <i18nlangtag/lang.h> class SfxItemSet; class SfxBindings; @@ -54,7 +55,7 @@ public: static void PutItemScript( SfxItemSet& rShellSet, const SfxItemSet& rCoreSet, sal_uInt16 nWhichId, SvtScriptType nScript ); - static sal_uInt16 GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos ); + static LanguageType GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos ); static TransliterationFlags GetTransliterationType( sal_uInt16 nSlotID ); diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx index b24219ae6017..451f3974189d 100644 --- a/sc/source/ui/unoobj/filtuno.cxx +++ b/sc/source/ui/unoobj/filtuno.cxx @@ -200,7 +200,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() LanguageType eLang = pDlg->GetLanguageType(); OUStringBuffer aBuf; - aBuf.append(OUString::number(static_cast<sal_Int32>(eLang))); + aBuf.append(OUString::number(static_cast<sal_uInt16>(eLang))); aBuf.append(' '); aBuf.append(pDlg->IsDateConversionSet() ? sal_Unicode('1') : sal_Unicode('0')); aFilterOptions = aBuf.makeStringAndClear(); diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 40e9c650f0a7..4e286e323a4a 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -328,7 +328,7 @@ void ScCellShell::GetCellState( SfxItemSet& rSet ) if (!bDisable) { // test for available languages - sal_uInt16 nLang = ScViewUtil::GetEffLanguage( &rDoc, aCursor ); + LanguageType nLang = ScViewUtil::GetEffLanguage( &rDoc, aCursor ); bDisable = !ScModule::HasThesaurusLanguage( nLang ); } } diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 169ff3808d18..7225b78eac40 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5396,7 +5396,7 @@ bool ScGridWindow::ContinueOnlineSpelling() } const ScPatternAttr* pPattern = pDoc->GetPattern(nCol, nRow, nTab); - sal_uInt16 nCellLang = + LanguageType nCellLang = static_cast<const SvxLanguageItem&>(pPattern->GetItem(ATTR_FONT_LANGUAGE)).GetValue(); if (nCellLang == LANGUAGE_SYSTEM) nCellLang = Application::GetSettings().GetLanguageTag().getLanguageType(); // never use SYSTEM for spelling diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx index 4a64409ec8e0..8ad1f59c1c74 100644 --- a/sc/source/ui/view/spelleng.cxx +++ b/sc/source/ui/view/spelleng.cxx @@ -192,7 +192,7 @@ bool ScConversionEngineBase::FindNextConversionCell() const SfxPoolItem* pItem = mrDoc.GetAttr( nNewCol, nNewRow, mnStartTab, ATTR_FONT_LANGUAGE ); if( const SvxLanguageItem* pLangItem = dynamic_cast<const SvxLanguageItem*>( pItem ) ) { - LanguageType eLang = static_cast< LanguageType >( pLangItem->GetValue() ); + LanguageType eLang = pLangItem->GetValue(); if( eLang == LANGUAGE_SYSTEM ) eLang = Application::GetSettings().GetLanguageTag().getLanguageType(); // never use SYSTEM for spelling if( eLang != meCurrLang ) diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index 8c00d51c6028..30376f3529ac 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -69,7 +69,7 @@ void ScViewUtil::PutItemScript( SfxItemSet& rShellSet, const SfxItemSet& rCoreSe rShellSet.InvalidateItem( nWhichId ); } -sal_uInt16 ScViewUtil::GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos ) +LanguageType ScViewUtil::GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos ) { // used for thesaurus @@ -81,7 +81,7 @@ sal_uInt16 ScViewUtil::GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos ) LanguageType eLnge; if (pLangIt) { - eLnge = (LanguageType) pLangIt->GetValue(); + eLnge = pLangIt->GetValue(); if (eLnge == LANGUAGE_DONTKNOW) //! can this happen? { LanguageType eLatin, eCjk, eCtl; |