summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2017-04-17 21:35:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-26 08:50:54 +0200
commitc70d49c7c888da8cfd73db8585e7be1f37fc398a (patch)
treec0e540401850018464ca76300536faf9aa7e27d2 /cui
parentcd4344d3bdef631b3e64ac12a9e64bc9670c1b7c (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 'cui')
-rw-r--r--cui/source/dialogs/SpellDialog.cxx12
-rw-r--r--cui/source/factory/dlgfact.cxx2
-rw-r--r--cui/source/factory/dlgfact.hxx2
-rw-r--r--cui/source/inc/optdict.hxx2
-rw-r--r--cui/source/options/optasian.cxx4
-rw-r--r--cui/source/options/optdict.cxx10
-rw-r--r--cui/source/options/optgenrl.cxx17
-rw-r--r--cui/source/options/optlingu.cxx57
-rw-r--r--cui/source/tabpages/autocdlg.cxx6
-rw-r--r--cui/source/tabpages/chardlg.cxx6
-rw-r--r--cui/source/tabpages/numfmt.cxx2
11 files changed, 56 insertions, 64 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 773aa61017e9..5fa6aeee1760 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -590,7 +590,7 @@ IMPL_LINK_NOARG(SpellDialog, ChangeAllHdl, Button*, void)
Reference<XDictionary> aXDictionary( LinguMgr::GetChangeAllList(), UNO_QUERY );
DictionaryError nAdded = AddEntryToDic( aXDictionary,
aOldWord, true,
- aString, eLang );
+ aString );
if(nAdded == DictionaryError::NONE)
{
@@ -638,7 +638,7 @@ IMPL_LINK( SpellDialog, IgnoreAllHdl, Button *, pButton, void )
OUString sErrorText(m_pSentenceED->GetErrorText());
DictionaryError nAdded = AddEntryToDic( aXDictionary,
sErrorText, false,
- OUString(), LANGUAGE_NONE );
+ OUString() );
if(nAdded == DictionaryError::NONE)
{
SpellUndoAction_Impl* pAction = new SpellUndoAction_Impl(
@@ -753,7 +753,7 @@ bool SpellDialog::Close()
LanguageType SpellDialog::GetSelectedLang_Impl() const
{
- sal_Int16 nLang = m_pLanguageLB->GetSelectLanguage();
+ LanguageType nLang = m_pLanguageLB->GetSelectLanguage();
return nLang;
}
@@ -771,7 +771,7 @@ IMPL_LINK(SpellDialog, LanguageSelectHdl, ListBox&, rBox, void)
if(!sError.isEmpty())
{
LanguageType eLanguage = static_cast<SvxLanguageBox*>(&rBox)->GetSelectLanguage();
- Reference <XSpellAlternatives> xAlt = xSpell->spell( sError, eLanguage,
+ Reference <XSpellAlternatives> xAlt = xSpell->spell( sError, (sal_uInt16)eLanguage,
Sequence< PropertyValue >() );
if( xAlt.is() )
m_pSentenceED->SetAlternatives( xAlt );
@@ -898,7 +898,7 @@ void SpellDialog::AddToDictionaryExecute( sal_uInt16 nItemId, PopupMenu *pMenu )
DictionaryError nAddRes = DictionaryError::UNKNOWN;
if (xDic.is())
{
- nAddRes = AddEntryToDic( xDic, aNewWord, false, OUString(), LANGUAGE_NONE );
+ nAddRes = AddEntryToDic( xDic, aNewWord, false, OUString() );
// save modified user-dictionary if it is persistent
uno::Reference< frame::XStorable > xSavDic( xDic, uno::UNO_QUERY );
if (xSavDic.is())
@@ -1605,7 +1605,7 @@ bool SentenceEditWindow_Impl::MarkNextError( bool bIgnoreCurrentError, const css
aCursor.GetIndex() += xEntry->getReplacementText().getLength();
// maybe the error found here is already added to the dictionary and has to be ignored
- } else if(pSpellErrorDescription && !bGrammarError && xSpell->isValid( GetErrorText(), LanguageTag::convertToLanguageType( pSpellErrorDescription->aLocale ), Sequence< PropertyValue >() )) {
+ } else if(pSpellErrorDescription && !bGrammarError && xSpell->isValid( GetErrorText(), (sal_uInt16)LanguageTag::convertToLanguageType( pSpellErrorDescription->aLocale ), Sequence< PropertyValue >() )) {
++aCursor.GetIndex();
}
else
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index f09b5b0fa318..1b956fb8855f 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -917,7 +917,7 @@ VclPtr<AbstractHangulHanjaConversionDialog> AbstractDialogFactory_Impl::CreateHa
VclPtr<AbstractThesaurusDialog> AbstractDialogFactory_Impl::CreateThesaurusDialog( vcl::Window* pParent,
css::uno::Reference< css::linguistic2::XThesaurus > xThesaurus,
- const OUString &rWord, sal_Int16 nLanguage )
+ const OUString &rWord, LanguageType nLanguage )
{
VclPtrInstance<SvxThesaurusDialog> pDlg( pParent, xThesaurus, rWord, nLanguage );
return VclPtr<AbstractThesaurusDialog_Impl>::Create( pDlg );
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 9c1b19725d90..69ec922558aa 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -495,7 +495,7 @@ public:
virtual VclPtr<AbstractHangulHanjaConversionDialog> CreateHangulHanjaConversionDialog( vcl::Window* _pParent,
editeng::HangulHanjaConversion::ConversionDirection _ePrimaryDirection ) override;
virtual VclPtr<AbstractThesaurusDialog> CreateThesaurusDialog( vcl::Window*, css::uno::Reference< css::linguistic2::XThesaurus > xThesaurus,
- const OUString &rWord, sal_Int16 nLanguage ) override;
+ const OUString &rWord, LanguageType nLanguage ) override;
virtual VclPtr<AbstractHyphenWordDialog> CreateHyphenWordDialog( vcl::Window*,
const OUString &rWord, LanguageType nLang,
diff --git a/cui/source/inc/optdict.hxx b/cui/source/inc/optdict.hxx
index 4cfa42b73913..d0858b52da4f 100644
--- a/cui/source/inc/optdict.hxx
+++ b/cui/source/inc/optdict.hxx
@@ -130,7 +130,7 @@ private:
void ShowWords_Impl( sal_uInt16 nId );
- void SetLanguage_Impl( css::util::Language nLanguage );
+ void SetLanguage_Impl( LanguageType nLanguage );
bool IsDicReadonly_Impl() const { return bDicIsReadonly; }
void SetDicReadonly_Impl( css::uno::Reference<
css::linguistic2::XDictionary > &xDic );
diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx
index 018c14169b5b..f814ad27e3b7 100644
--- a/cui/source/options/optasian.cxx
+++ b/cui/source/options/optasian.cxx
@@ -113,7 +113,7 @@ void SvxAsianLayoutPage_Impl::addForbiddenCharacters(
}
}
-static LanguageType eLastUsedLanguageTypeForForbiddenCharacters = USHRT_MAX;
+static LanguageType eLastUsedLanguageTypeForForbiddenCharacters(USHRT_MAX);
SvxAsianLayoutPage::SvxAsianLayoutPage( vcl::Window* pParent, const SfxItemSet& rSet ) :
SfxTabPage(pParent, "OptAsianPage", "cui/ui/optasianpage.ui", &rSet),
@@ -291,7 +291,7 @@ void SvxAsianLayoutPage::Reset( const SfxItemSet* )
m_pLanguageLB->SelectEntryPos(0);
//preselect the system language in the box - if available
- if(USHRT_MAX == eLastUsedLanguageTypeForForbiddenCharacters)
+ if(LanguageType(USHRT_MAX) == eLastUsedLanguageTypeForForbiddenCharacters)
{
eLastUsedLanguageTypeForForbiddenCharacters =
Application::GetSettings().GetLanguageTag().getLanguageType();
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index a8541b98f1d5..6ecbce35b8fe 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -158,7 +158,7 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl, Button*, void)
}
// create and add
- sal_uInt16 nLang = pLanguageLB->GetSelectLanguage();
+ LanguageType nLang = pLanguageLB->GetSelectLanguage();
try
{
// create new dictionary
@@ -375,7 +375,7 @@ void SvxEditDictionaryDialog::SetDicReadonly_Impl(
}
-void SvxEditDictionaryDialog::SetLanguage_Impl( util::Language nLanguage )
+void SvxEditDictionaryDialog::SetLanguage_Impl( LanguageType nLanguage )
{
// select language
pLangLB->SelectLanguage( nLanguage );
@@ -447,9 +447,9 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectBookHdl_Impl, ListBox&, void)
IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl, ListBox&, void)
{
sal_Int32 nDicPos = pAllDictsLB->GetSelectEntryPos();
- sal_Int32 nLang = pLangLB->GetSelectLanguage();
+ LanguageType nLang = pLangLB->GetSelectLanguage();
Reference< XDictionary > xDic( aDics.getConstArray()[ nDicPos ], UNO_QUERY );
- sal_Int16 nOldLang = LanguageTag( xDic->getLocale() ).getLanguageType();
+ LanguageType nOldLang = LanguageTag( xDic->getLocale() ).getLanguageType();
if ( nLang != nOldLang )
{
@@ -627,7 +627,7 @@ bool SvxEditDictionaryDialog::NewDelHdl(void* pBtn)
nAddRes = linguistic::AddEntryToDic( xDic,
aNewWord, bIsNegEntry,
- aRplcText, LanguageTag( xDic->getLocale() ).getLanguageType(), false );
+ aRplcText, false );
}
}
if (DictionaryError::NONE != nAddRes)
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 1b110fd30963..0dd5e7f0e05a 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -211,17 +211,14 @@ void SvxGeneralTabPage::InitControls ()
{
// which language bit do we use? (see Lang and vRowInfo[] above)
unsigned LangBit;
- switch (Application::GetSettings().GetUILanguageTag().getLanguageType())
+ LanguageType l = Application::GetSettings().GetUILanguageTag().getLanguageType();
+ if (l == LANGUAGE_ENGLISH_US)
+ LangBit = Lang::US;
+ else if (l == LANGUAGE_RUSSIAN)
+ LangBit = Lang::Russian;
+ else
{
- case LANGUAGE_ENGLISH_US:
- LangBit = Lang::US;
- break;
- case LANGUAGE_RUSSIAN:
- LangBit = Lang::Russian;
- break;
- default:
- LangBit = Lang::Others;
- break;
+ LangBit = Lang::Others;
}
// creating rows
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 0d5638979904..148cbc025b50 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -85,31 +85,26 @@ static const sal_Char cThes[] = SN_THESAURUS;
// static ----------------------------------------------------------------
-static Sequence< sal_Int16 > lcl_LocaleSeqToLangSeq( const Sequence< Locale > &rSeq )
+static std::vector< LanguageType > lcl_LocaleSeqToLangSeq( const Sequence< Locale > &rSeq )
{
sal_Int32 nLen = rSeq.getLength();
- Sequence< sal_Int16 > aRes( nLen );
- sal_Int16 *pRes = aRes.getArray();
+ std::vector<LanguageType> aRes;
+ aRes.reserve(nLen);
const Locale *pSeq = rSeq.getConstArray();
for (sal_Int32 i = 0; i < nLen; ++i)
{
- pRes[i] = LanguageTag::convertToLanguageType( pSeq[i] );
+ aRes.push_back( LanguageTag::convertToLanguageType( pSeq[i] ) );
}
return aRes;
}
-static bool lcl_SeqHasLang( const Sequence< sal_Int16 > &rSeq, sal_Int16 nLang )
+static bool lcl_SeqHasLang( const std::vector< LanguageType > &rSeq, LanguageType nLang )
{
- sal_Int32 nLen = rSeq.getLength();
- const sal_Int16 *pLang = rSeq.getConstArray();
- sal_Int32 nPos = -1;
- for (sal_Int32 i = 0; i < nLen && nPos < 0; ++i)
- {
- if (nLang == pLang[i])
- nPos = i;
- }
- return nPos >= 0;
+ for (auto const & i : rSeq)
+ if (i == nLang)
+ return true;
+ return false;
}
@@ -458,8 +453,8 @@ struct ServiceInfo_Impl
ServiceInfo_Impl() : bConfigured(false) {}
};
-typedef std::vector< ServiceInfo_Impl > ServiceInfoArr;
-typedef std::map< sal_Int16 /*LanguageType*/, Sequence< OUString > > LangImplNameTable;
+typedef std::vector< ServiceInfo_Impl > ServiceInfoArr;
+typedef std::map< LanguageType, Sequence< OUString > > LangImplNameTable;
// SvxLinguData_Impl ----------------------------------------------------
@@ -511,7 +506,7 @@ public:
// I.e. the ones available but not configured in arbitrary order).
// They available ones may contain names that do not(!) support that
// language.
- Sequence< OUString > GetSortedImplNames( sal_Int16 nLang, sal_uInt8 nType );
+ Sequence< OUString > GetSortedImplNames( LanguageType nLang, sal_uInt8 nType );
ServiceInfo_Impl * GetInfoByImplName( const OUString &rSvcImplName );
};
@@ -531,7 +526,7 @@ static sal_Int32 lcl_SeqGetIndex( const Sequence< OUString > &rSeq, const OUStri
}
-Sequence< OUString > SvxLinguData_Impl::GetSortedImplNames( sal_Int16 nLang, sal_uInt8 nType )
+Sequence< OUString > SvxLinguData_Impl::GetSortedImplNames( LanguageType nLang, sal_uInt8 nType )
{
LangImplNameTable *pTable = nullptr;
switch (nType)
@@ -792,7 +787,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
const Locale* pAllLocales = aAllServiceLocales.getConstArray();
for(sal_Int32 nLocale = 0; nLocale < aAllServiceLocales.getLength(); nLocale++)
{
- sal_Int16 nLang = LanguageTag::convertToLanguageType( pAllLocales[nLocale] );
+ LanguageType nLang = LanguageTag::convertToLanguageType( pAllLocales[nLocale] );
aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(cSpell, pAllLocales[nLocale]);
SetChecked( aCfgSvcs );
@@ -927,7 +922,7 @@ void SvxLinguData_Impl::Reconfigure( const OUString &rDisplayName, bool bEnable
nLocales = aLocales.getLength();
for (i = 0; i < nLocales; ++i)
{
- sal_Int16 nLang = LanguageTag::convertToLanguageType( pLocale[i] );
+ LanguageType nLang = LanguageTag::convertToLanguageType( pLocale[i] );
if (!aCfgSpellTable.count( nLang ) && bEnable)
aCfgSpellTable[ nLang ] = Sequence< OUString >();
if (aCfgSpellTable.count( nLang ))
@@ -943,7 +938,7 @@ void SvxLinguData_Impl::Reconfigure( const OUString &rDisplayName, bool bEnable
nLocales = aLocales.getLength();
for (i = 0; i < nLocales; ++i)
{
- sal_Int16 nLang = LanguageTag::convertToLanguageType( pLocale[i] );
+ LanguageType nLang = LanguageTag::convertToLanguageType( pLocale[i] );
if (!aCfgGrammarTable.count( nLang ) && bEnable)
aCfgGrammarTable[ nLang ] = Sequence< OUString >();
if (aCfgGrammarTable.count( nLang ))
@@ -959,7 +954,7 @@ void SvxLinguData_Impl::Reconfigure( const OUString &rDisplayName, bool bEnable
nLocales = aLocales.getLength();
for (i = 0; i < nLocales; ++i)
{
- sal_Int16 nLang = LanguageTag::convertToLanguageType( pLocale[i] );
+ LanguageType nLang = LanguageTag::convertToLanguageType( pLocale[i] );
if (!aCfgHyphTable.count( nLang ) && bEnable)
aCfgHyphTable[ nLang ] = Sequence< OUString >();
if (aCfgHyphTable.count( nLang ))
@@ -975,7 +970,7 @@ void SvxLinguData_Impl::Reconfigure( const OUString &rDisplayName, bool bEnable
nLocales = aLocales.getLength();
for (i = 0; i < nLocales; ++i)
{
- sal_Int16 nLang = LanguageTag::convertToLanguageType( pLocale[i] );
+ LanguageType nLang = LanguageTag::convertToLanguageType( pLocale[i] );
if (!aCfgThesTable.count( nLang ) && bEnable)
aCfgThesTable[ nLang ] = Sequence< OUString >();
if (aCfgThesTable.count( nLang ))
@@ -1120,7 +1115,7 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
const LangImplNameTable *pTable = &pLinguData->GetSpellTable();
for (aIt = pTable->begin(); aIt != pTable->end(); ++aIt)
{
- sal_Int16 nLang = aIt->first;
+ LanguageType nLang = aIt->first;
const Sequence< OUString > aImplNames( aIt->second );
uno::Reference< XLinguServiceManager2 > xMgr( pLinguData->GetManager() );
Locale aLocale( LanguageTag::convertToLocale(nLang) );
@@ -1132,7 +1127,7 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
pTable = &pLinguData->GetGrammarTable();
for (aIt = pTable->begin(); aIt != pTable->end(); ++aIt)
{
- sal_Int16 nLang = aIt->first;
+ LanguageType nLang = aIt->first;
const Sequence< OUString > aImplNames( aIt->second );
uno::Reference< XLinguServiceManager2 > xMgr( pLinguData->GetManager() );
Locale aLocale( LanguageTag::convertToLocale(nLang) );
@@ -1144,7 +1139,7 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
pTable = &pLinguData->GetHyphTable();
for (aIt = pTable->begin(); aIt != pTable->end(); ++aIt)
{
- sal_Int16 nLang = aIt->first;
+ LanguageType nLang = aIt->first;
const Sequence< OUString > aImplNames( aIt->second );
uno::Reference< XLinguServiceManager2 > xMgr( pLinguData->GetManager() );
Locale aLocale( LanguageTag::convertToLocale(nLang) );
@@ -1156,7 +1151,7 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
pTable = &pLinguData->GetThesTable();
for (aIt = pTable->begin(); aIt != pTable->end(); ++aIt)
{
- sal_Int16 nLang = aIt->first;
+ LanguageType nLang = aIt->first;
const Sequence< OUString > aImplNames( aIt->second );
uno::Reference< XLinguServiceManager2 > xMgr( pLinguData->GetManager() );
Locale aLocale( LanguageTag::convertToLocale(nLang) );
@@ -1529,7 +1524,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void )
sal_Int32 nLocales = pLinguData->GetAllSupportedLocales().getLength();
for (sal_Int32 k = 0; k < nLocales; ++k)
{
- sal_Int16 nLang = LanguageTag::convertToLanguageType( pAllLocales[k] );
+ LanguageType nLang = LanguageTag::convertToLanguageType( pAllLocales[k] );
if (pLinguData->GetSpellTable().count( nLang ))
pLinguData->SetChecked( pLinguData->GetSpellTable()[ nLang ] );
if (pLinguData->GetGrammarTable().count( nLang ))
@@ -1796,7 +1791,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rD
m_pMoreDictsLink->Hide();
//fill language box
- Sequence< sal_Int16 > aAvailLang;
+ std::vector< LanguageType > aAvailLang;
uno::Reference< XAvailableLocales > xAvail( rLinguData.GetManager(), UNO_QUERY );
if (xAvail.is())
{
@@ -1808,7 +1803,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rD
m_pLanguageLB->Clear();
for(long i = 0; i < rLoc.getLength(); i++)
{
- sal_Int16 nLang = LanguageTag::convertToLanguageType( pLocales[i] );
+ LanguageType nLang = LanguageTag::convertToLanguageType( pLocales[i] );
m_pLanguageLB->InsertLanguage( nLang, lcl_SeqHasLang( aAvailLang, nLang ) );
}
LanguageType eSysLang = MsLangId::getSystemLanguage();
@@ -1942,7 +1937,7 @@ void SvxEditModulesDlg::LangSelectHdl_Impl(ListBox* pBox)
// save old probably changed settings
// before switching to new language entries
- sal_Int16 nLang = LanguageTag::convertToLanguageType( aLastLocale );
+ LanguageType nLang = LanguageTag::convertToLanguageType( aLastLocale );
sal_Int32 nStart = 0, nLocalIndex = 0;
Sequence< OUString > aChange;
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 1c17f37ea850..23f4dfa77834 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -121,14 +121,14 @@ OfaAutoCorrDlg::OfaAutoCorrDlg(vcl::Window* pParent, const SfxItemSet* _pSet )
m_pLanguageLB->SelectLanguage( LANGUAGE_NONE );
sal_Int32 nPos = m_pLanguageLB->GetSelectEntryPos();
DBG_ASSERT( LISTBOX_ENTRY_NOTFOUND != nPos, "listbox entry missing" );
- m_pLanguageLB->SetEntryData( nPos, reinterpret_cast<void*>(LANGUAGE_UNDETERMINED) );
+ m_pLanguageLB->SetEntryData( nPos, reinterpret_cast<void*>((sal_uInt16)LANGUAGE_UNDETERMINED) );
// Initializing doesn't work for static on linux - therefore here
if( LANGUAGE_SYSTEM == eLastDialogLanguage )
eLastDialogLanguage = Application::GetSettings().GetLanguageTag().getLanguageType();
LanguageType nSelectLang = LANGUAGE_UNDETERMINED;
- nPos = m_pLanguageLB->GetEntryPos( reinterpret_cast<void*>(eLastDialogLanguage) );
+ nPos = m_pLanguageLB->GetEntryPos( reinterpret_cast<void*>((sal_uInt16)eLastDialogLanguage) );
if (LISTBOX_ENTRY_NOTFOUND != nPos)
nSelectLang = eLastDialogLanguage;
m_pLanguageLB->SelectLanguage( nSelectLang );
@@ -179,7 +179,7 @@ IMPL_LINK(OfaAutoCorrDlg, SelectLanguageHdl, ListBox&, rBox, void)
{
sal_Int32 nPos = rBox.GetSelectEntryPos();
void* pVoid = rBox.GetEntryData(nPos);
- LanguageType eNewLang = (LanguageType)reinterpret_cast<sal_IntPtr>(pVoid);
+ LanguageType eNewLang = LanguageType(reinterpret_cast<sal_IntPtr>(pVoid));
// save old settings and fill anew
if(eNewLang != eLastDialogLanguage)
{
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index b34670d2f681..10221e1de052 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -825,7 +825,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
case SfxItemState::SET:
{
const SvxLanguageItem& rItem = static_cast<const SvxLanguageItem&>(rSet.Get( nWhich ));
- LanguageType eLangType = (LanguageType)rItem.GetValue();
+ LanguageType eLangType = rItem.GetValue();
DBG_ASSERT( eLangType != LANGUAGE_SYSTEM, "LANGUAGE_SYSTEM not allowed" );
if ( eLangType != LANGUAGE_DONTKNOW )
pLangBox->SelectLanguage( eLangType );
@@ -1130,13 +1130,13 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
}
sal_Int32 nLangPos = pLangBox->GetSelectEntryPosLBB();
- LanguageType eLangType = (LanguageType)reinterpret_cast<sal_uLong>(pLangBox->GetEntryDataLBB( nLangPos ));
+ LanguageType eLangType = LanguageType(reinterpret_cast<sal_uLong>(pLangBox->GetEntryDataLBB( nLangPos )));
if ( pOld )
{
const SvxLanguageItem& rItem = *static_cast<const SvxLanguageItem*>(pOld);
- if ( nLangPos == LISTBOX_ENTRY_NOTFOUND || eLangType == (LanguageType)rItem.GetValue() )
+ if ( nLangPos == LISTBOX_ENTRY_NOTFOUND || eLangType == rItem.GetValue() )
bChanged = false;
}
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 73be739ebdfc..1e9bc43aa912 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -1813,7 +1813,7 @@ void SvxNumberFormatTabPage::AddAutomaticLanguage_Impl(LanguageType eAutoLang, b
{
m_pLbLanguage->RemoveLanguage(LANGUAGE_SYSTEM);
const sal_Int32 nPos = m_pLbLanguage->InsertEntry(sAutomaticEntry);
- m_pLbLanguage->SetEntryData(nPos, reinterpret_cast<void*>((sal_uLong)eAutoLang));
+ m_pLbLanguage->SetEntryData(nPos, reinterpret_cast<void*>((sal_uInt16)eAutoLang));
if(bSelect)
m_pLbLanguage->SelectEntryPos(nPos);
}