summaryrefslogtreecommitdiff
path: root/sw/source/core
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 /sw/source/core
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 'sw/source/core')
-rw-r--r--sw/source/core/bastyp/calc.cxx2
-rw-r--r--sw/source/core/bastyp/init.cxx4
-rw-r--r--sw/source/core/crsr/findtxt.cxx2
-rw-r--r--sw/source/core/doc/DocumentFieldsManager.cxx4
-rw-r--r--sw/source/core/doc/DocumentSettingManager.cxx6
-rw-r--r--sw/source/core/doc/DocumentStylePoolManager.cxx10
-rw-r--r--sw/source/core/doc/docsort.cxx9
-rw-r--r--sw/source/core/doc/poolfmt.cxx7
-rw-r--r--sw/source/core/doc/tblafmt.cxx6
-rw-r--r--sw/source/core/edit/edattr.cxx4
-rw-r--r--sw/source/core/edit/edlingu.cxx6
-rw-r--r--sw/source/core/fields/docufld.cxx9
-rw-r--r--sw/source/core/fields/expfld.cxx2
-rw-r--r--sw/source/core/fields/fldbas.cxx26
-rw-r--r--sw/source/core/fields/flddat.cxx2
-rw-r--r--sw/source/core/fields/usrfld.cxx4
-rw-r--r--sw/source/core/inc/DocumentSettingManager.hxx4
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx4
-rw-r--r--sw/source/core/text/porlay.cxx2
-rw-r--r--sw/source/core/txtnode/thints.cxx8
-rw-r--r--sw/source/core/txtnode/txtedt.cxx12
21 files changed, 64 insertions, 69 deletions
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 0ea4b140f250..35882054a097 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -536,7 +536,7 @@ SwCalcExp* SwCalc::VarLook( const OUString& rStr, bool bIns )
OUString sResult;
double nNumber = DBL_MAX;
- long nLang = m_pLocaleDataWrapper->getLanguageTag().getLanguageType();
+ LanguageType nLang = m_pLocaleDataWrapper->getLanguageTag().getLanguageType();
if(pMgr->GetColumnCnt( sSourceName, sTableName, sColumnName,
nTmpRec, nLang, sResult, &nNumber ))
{
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 862e46aade0c..6e58c7e423be 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -847,7 +847,7 @@ CharClass& GetAppCharClass()
return *pAppCharClass;
}
-void SwCalendarWrapper::LoadDefaultCalendar( sal_uInt16 eLang )
+void SwCalendarWrapper::LoadDefaultCalendar( LanguageType eLang )
{
sUniqueId.clear();
if( eLang != nLang )
@@ -906,7 +906,7 @@ namespace
TransliterationFlags::IGNORE_KANA |
TransliterationFlags::IGNORE_WIDTH ));
- xTransWrp->loadModuleIfNeeded( static_cast<sal_uInt16>(GetAppLanguage()) );
+ xTransWrp->loadModuleIfNeeded( GetAppLanguage() );
}
const ::utl::TransliterationWrapper& getTransliterationWrapper() const
{
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 2522d36d9f21..01fb86ba1253 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -479,7 +479,7 @@ bool SwPaM::DoSearch( const i18nutil::SearchOptions2& rSearchOpt, utl::TextSearc
const SwNode* pSttNd = &rNdIdx.GetNode();
OUString sCleanStr;
std::vector<sal_Int32> aFltArr;
- LanguageType eLastLang = 0;
+ LanguageType eLastLang = LANGUAGE_SYSTEM;
// if the search string contains a soft hyphen,
// we don't strip them from the text:
bool bRemoveSoftHyphens = true;
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx
index a050745d31ad..7fa153a04e4d 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -871,7 +871,7 @@ void DocumentFieldsManager::UpdateExpFields( SwTextField* pUpdateField, bool bUp
// Entry present?
sal_uInt16 nPos;
const OUString& rNm = pFieldType->GetName();
- OUString sExpand(const_cast<SwUserFieldType*>(static_cast<const SwUserFieldType*>(pFieldType))->Expand(nsSwGetSetExpType::GSE_STRING, 0, 0));
+ OUString sExpand(const_cast<SwUserFieldType*>(static_cast<const SwUserFieldType*>(pFieldType))->Expand(nsSwGetSetExpType::GSE_STRING, 0, LANGUAGE_SYSTEM));
SwHash* pFnd = Find( rNm, pHashStrTable, nStrFormatCnt, &nPos );
if( pFnd )
// modify entry in the hash table
@@ -901,7 +901,7 @@ void DocumentFieldsManager::UpdateExpFields( SwTextField* pUpdateField, bool bUp
SvtSysLocale aSysLocale;
const LocaleDataWrapper* pLclData = aSysLocale.GetLocaleDataPtr();
- const long nLang = pLclData->getLanguageTag().getLanguageType();
+ const LanguageType nLang = pLclData->getLanguageTag().getLanguageType();
bool bCanFill = pMgr->FillCalcWithMergeData( m_rDoc.GetNumberFormatter(), nLang, aCalc );
#endif
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx
index 1103cf441bd3..dd41cb6e7b47 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -418,17 +418,17 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo
}
const css::i18n::ForbiddenCharacters*
- sw::DocumentSettingManager::getForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ bool bLocaleData ) const
+ sw::DocumentSettingManager::getForbiddenCharacters(/*[in]*/ LanguageType nLang, /*[in]*/ bool bLocaleData ) const
{
const css::i18n::ForbiddenCharacters* pRet = nullptr;
if( mxForbiddenCharsTable.is() )
pRet = mxForbiddenCharsTable->GetForbiddenCharacters( nLang, false );
if( bLocaleData && !pRet && g_pBreakIt )
- pRet = &g_pBreakIt->GetForbidden( (LanguageType)nLang );
+ pRet = &g_pBreakIt->GetForbidden( nLang );
return pRet;
}
-void sw::DocumentSettingManager::setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang,
+void sw::DocumentSettingManager::setForbiddenCharacters(/*[in]*/ LanguageType nLang,
/*[in]*/ const css::i18n::ForbiddenCharacters& rFChars )
{
if( !mxForbiddenCharsTable.is() )
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 5dab3be1472d..cb7f4dd0848f 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -121,7 +121,7 @@ namespace
};
for(const auto & n : aArr)
{
- sal_uInt16 nLng = static_cast<const SvxLanguageItem&>(rSet.GetPool()->GetDefaultItem(
+ LanguageType nLng = static_cast<const SvxLanguageItem&>(rSet.GetPool()->GetDefaultItem(
n.nResLngId )).GetLanguage();
vcl::Font aFnt( OutputDevice::GetDefaultFont( nFntType,
nLng, GetDefaultFontFlags::OnlyOne ) );
@@ -150,7 +150,7 @@ namespace
for(const auto & n : aArr)
{
- sal_uInt16 nLng = static_cast<const SvxLanguageItem&>(rSet.GetPool()->GetDefaultItem(
+ LanguageType nLng = static_cast<const SvxLanguageItem&>(rSet.GetPool()->GetDefaultItem(
n.nResLngId )).GetLanguage();
vcl::Font aFnt( OutputDevice::GetDefaultFont( n.nFntType,
nLng, GetDefaultFontFlags::OnlyOne ) );
@@ -354,7 +354,7 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
/* koreans do not like SvxScriptItem(TRUE) */
if (bRegardLanguage)
{
- sal_uLong nAppLanguage = GetAppLanguage();
+ LanguageType nAppLanguage = GetAppLanguage();
if (GetDefaultFrameDirection(nAppLanguage) ==
SvxFrameDirection::Horizontal_RL_TB)
{
@@ -440,7 +440,7 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
RES_CHRATR_CJK_LANGUAGE,
RES_CHRATR_CTL_LANGUAGE
};
- static const sal_uInt16 aLangs[] =
+ static const LanguageType aLangs[] =
{
LANGUAGE_ENGLISH_US,
LANGUAGE_ENGLISH_US,
@@ -455,7 +455,7 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
for( int i = 0; i < 3; ++i )
{
- sal_uInt16 nLng = static_cast<const SvxLanguageItem&>(m_rDoc.GetDefault( aLangTypes[i] )).GetLanguage();
+ LanguageType nLng = static_cast<const SvxLanguageItem&>(m_rDoc.GetDefault( aLangTypes[i] )).GetLanguage();
if( LANGUAGE_DONTKNOW == nLng )
nLng = aLangs[i];
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index f3e1095f8333..e08b6987a8d5 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -74,13 +74,10 @@ void SwSortElement::Init( SwDoc* pD, const SwSortOptions& rOpt,
pBox = pFltBx;
LanguageType nLang = rOpt.nLanguage;
- switch ( nLang )
- {
- case LANGUAGE_NONE:
- case LANGUAGE_DONTKNOW:
+ if ( nLang.anyOf(
+ LANGUAGE_NONE,
+ LANGUAGE_DONTKNOW))
nLang = GetAppLanguage();
- break;
- }
pLocale = new lang::Locale( LanguageTag::convertToLocale( nLang ) );
pSortCollator = new CollatorWrapper( ::comphelper::getProcessComponentContext() );
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index ecb1d13efa98..2a4485934f6c 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -118,11 +118,10 @@ void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem )
/// exist yet, create it.
/// If the String pointer is defined, then only query for
/// the Attribute descriptions. It doesn't create a style!
-SvxFrameDirection GetDefaultFrameDirection(sal_uLong nLanguage)
+SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage)
{
- SvxFrameDirection eResult = (MsLangId::isRightToLeft( static_cast<LanguageType>(nLanguage)) ?
- SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB);
- return eResult;
+ return MsLangId::isRightToLeft(nLanguage) ?
+ SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB;
}
// See if the Paragraph/Character/Frame/Page style is in use
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 13c0e7383834..1864b6e1d6ba 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -487,8 +487,8 @@ bool SwBoxAutoFormat::Load( SvStream& rStream, const SwAfVersions& rVersions, sa
rtl_TextEncoding eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
m_sNumFormatString = rStream.ReadUniOrByteString( eCharSet );
rStream.ReadUInt16( eSys ).ReadUInt16( eLge );
- m_eSysLanguage = (LanguageType) eSys;
- m_eNumFormatLanguage = (LanguageType) eLge;
+ m_eSysLanguage = LanguageType(eSys);
+ m_eNumFormatLanguage = LanguageType(eLge);
if ( m_eSysLanguage == LANGUAGE_SYSTEM ) // from old versions (Calc)
m_eSysLanguage = ::GetAppLanguage();
}
@@ -547,7 +547,7 @@ bool SwBoxAutoFormat::Save( SvStream& rStream, sal_uInt16 fileVersion ) const
// --- from 680/dr25 on: store strings as UTF-8
write_uInt16_lenPrefixed_uInt8s_FromOUString(rStream, m_sNumFormatString,
RTL_TEXTENCODING_UTF8);
- rStream.WriteUInt16( m_eSysLanguage ).WriteUInt16( m_eNumFormatLanguage );
+ rStream.WriteUInt16( (sal_uInt16)m_eSysLanguage ).WriteUInt16( (sal_uInt16)m_eNumFormatLanguage );
return 0 == rStream.GetError();
}
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index fc6a4df0be70..5e01ee4008a7 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -747,12 +747,12 @@ SvtScriptType SwEditShell::GetScriptType() const
return nRet;
}
-sal_uInt16 SwEditShell::GetCurLang() const
+LanguageType SwEditShell::GetCurLang() const
{
const SwPaM* pCursor = GetCursor();
const SwPosition& rPos = *pCursor->GetPoint();
const SwTextNode* pTNd = rPos.nNode.GetNode().GetTextNode();
- sal_uInt16 nLang;
+ LanguageType nLang;
if( pTNd )
{
//JP 24.9.2001: if exist no selection, then get the language before
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 28619ca5c059..46967a4eb069 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -863,8 +863,8 @@ uno::Reference< XSpellAlternatives >
uno::Reference< XSpellChecker1 > xSpell( ::GetSpellChecker() );
if( xSpell.is() )
{
- LanguageType eActLang = (LanguageType)pNode->GetLang( nBegin, nLen );
- if( xSpell->hasLanguage( eActLang ))
+ LanguageType eActLang = pNode->GetLang( nBegin, nLen );
+ if( xSpell->hasLanguage( (sal_uInt16)eActLang ))
{
// restrict the maximal number of suggestions displayed
// in the context menu.
@@ -881,7 +881,7 @@ uno::Reference< XSpellAlternatives >
rVal.Name = UPN_MAX_NUMBER_OF_SUGGESTIONS;
rVal.Value <<= (sal_Int16) 7;
- xSpellAlt = xSpell->spell( aWord, eActLang, aPropVals );
+ xSpellAlt = xSpell->spell( aWord, (sal_uInt16)eActLang, aPropVals );
}
}
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 5067407b2359..38cc39218c16 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -846,7 +846,7 @@ SwFieldType* SwDocInfoFieldType::Copy() const
return pTyp;
}
-static void lcl_GetLocalDataWrapper( sal_uLong nLang,
+static void lcl_GetLocalDataWrapper( LanguageType nLang,
const LocaleDataWrapper **ppAppLocalData,
const LocaleDataWrapper **ppLocalData )
{
@@ -854,12 +854,11 @@ static void lcl_GetLocalDataWrapper( sal_uLong nLang,
*ppAppLocalData = &aLocale.GetLocaleData();
*ppLocalData = *ppAppLocalData;
if( nLang != (*ppLocalData)->getLanguageTag().getLanguageType() )
- *ppLocalData = new LocaleDataWrapper(
- LanguageTag( static_cast<LanguageType>(nLang) ));
+ *ppLocalData = new LocaleDataWrapper(LanguageTag( nLang ));
}
OUString SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat,
- sal_uInt16 nLang, const OUString& rName ) const
+ LanguageType nLang, const OUString& rName ) const
{
const LocaleDataWrapper *pAppLocalData = nullptr, *pLocalData = nullptr;
SwDocShell *pDocShell(GetDoc()->GetDocShell());
@@ -1153,7 +1152,7 @@ void SwDocInfoField::SetSubType(sal_uInt16 nSub)
nSubType = nSub;
}
-void SwDocInfoField::SetLanguage(sal_uInt16 nLng)
+void SwDocInfoField::SetLanguage(LanguageType nLng)
{
if (!GetFormat())
SwField::SetLanguage(nLng);
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 6899b5c99177..3bd8d906f10e 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -398,7 +398,7 @@ void SwGetExpField::SetSubType(sal_uInt16 nType)
nSubType = nType;
}
-void SwGetExpField::SetLanguage(sal_uInt16 nLng)
+void SwGetExpField::SetLanguage(LanguageType nLng)
{
if (nSubType & nsSwExtendedSubType::SUB_CMD)
SwField::SetLanguage(nLng);
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index b24f6c1057de..4dcb10a43843 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -52,7 +52,7 @@
using namespace ::com::sun::star;
using namespace nsSwDocInfoSubType;
-static sal_uInt16 lcl_GetLanguageOfFormat( sal_uInt16 nLng, sal_uLong nFormat,
+static LanguageType lcl_GetLanguageOfFormat( LanguageType nLng, sal_uLong nFormat,
const SvNumberFormatter& rFormatter )
{
if( nLng == LANGUAGE_NONE ) // Bug #60010
@@ -174,7 +174,7 @@ void SwFieldTypes::dumpAsXml(xmlTextWriterPtr pWriter) const
SwField::SwField(
SwFieldType* pType,
sal_uInt32 nFormat,
- sal_uInt16 nLang,
+ LanguageType nLang,
bool bUseFieldValueCache)
: m_Cache()
, m_bUseFieldValueCache( bUseFieldValueCache )
@@ -361,7 +361,7 @@ bool SwField::HasClickHdl() const
return bRet;
}
-void SwField::SetLanguage(sal_uInt16 const nLang)
+void SwField::SetLanguage(LanguageType const nLang)
{
m_nLang = nLang;
}
@@ -462,7 +462,7 @@ SwValueFieldType::SwValueFieldType( const SwValueFieldType& rTyp )
/// return value formatted as string
OUString SwValueFieldType::ExpandValue( const double& rVal,
- sal_uInt32 nFormat, sal_uInt16 nLng) const
+ sal_uInt32 nFormat, LanguageType nLng) const
{
if (rVal >= DBL_MAX) // error string for calculator
return SwViewShell::GetShellRes()->aCalc_Error;
@@ -472,7 +472,7 @@ OUString SwValueFieldType::ExpandValue( const double& rVal,
Color* pCol = nullptr;
// Bug #60010
- sal_uInt16 nFormatLng = ::lcl_GetLanguageOfFormat( nLng, nFormat, *pFormatter );
+ LanguageType nFormatLng = ::lcl_GetLanguageOfFormat( nLng, nFormat, *pFormatter );
if( nFormat < SV_COUNTRY_LANGUAGE_OFFSET && LANGUAGE_SYSTEM != nFormatLng )
{
@@ -484,7 +484,7 @@ OUString SwValueFieldType::ExpandValue( const double& rVal,
if (pEntry && nLng != pEntry->GetLanguage())
{
sal_uInt32 nNewFormat = pFormatter->GetFormatForLanguageIfBuiltIn(nFormat,
- (LanguageType)nFormatLng);
+ nFormatLng);
if (nNewFormat == nFormat)
{
@@ -525,7 +525,7 @@ OUString SwValueFieldType::DoubleToString(const double &rVal,
}
OUString SwValueFieldType::DoubleToString( const double &rVal,
- sal_uInt16 nLng ) const
+ LanguageType nLng ) const
{
SvNumberFormatter* pFormatter = m_pDoc->GetNumberFormatter();
@@ -539,7 +539,7 @@ OUString SwValueFieldType::DoubleToString( const double &rVal,
}
SwValueField::SwValueField( SwValueFieldType* pFieldType, sal_uInt32 nFormat,
- sal_uInt16 nLng, const double fVal )
+ LanguageType nLng, const double fVal )
: SwField(pFieldType, nFormat, nLng)
, m_fValue(fVal)
{
@@ -583,12 +583,12 @@ SwFieldType* SwValueField::ChgTyp( SwFieldType* pNewType )
sal_uInt32 SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt32 nFormat)
{
const SvNumberformat* pEntry = pFormatter->GetEntry(nFormat);
- sal_uInt16 nLng = SvtSysLocale().GetLanguageTag().getLanguageType();
+ LanguageType nLng = SvtSysLocale().GetLanguageTag().getLanguageType();
if (pEntry && nLng != pEntry->GetLanguage())
{
sal_uInt32 nNewFormat = pFormatter->GetFormatForLanguageIfBuiltIn(nFormat,
- (LanguageType)nLng);
+ nLng);
if (nNewFormat == nFormat)
{
@@ -611,7 +611,7 @@ sal_uInt32 SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt
}
/// set language of the format
-void SwValueField::SetLanguage( sal_uInt16 nLng )
+void SwValueField::SetLanguage( LanguageType nLng )
{
if( IsAutomaticLanguage() &&
static_cast<SwValueFieldType *>(GetTyp())->UseFormat() &&
@@ -619,7 +619,7 @@ void SwValueField::SetLanguage( sal_uInt16 nLng )
{
// Bug #60010
SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter();
- sal_uInt16 nFormatLng = ::lcl_GetLanguageOfFormat( nLng, GetFormat(),
+ LanguageType nFormatLng = ::lcl_GetLanguageOfFormat( nLng, GetFormat(),
*pFormatter );
if( (GetFormat() >= SV_COUNTRY_LANGUAGE_OFFSET ||
@@ -631,7 +631,7 @@ void SwValueField::SetLanguage( sal_uInt16 nLng )
if( pEntry && nFormatLng != pEntry->GetLanguage() )
{
sal_uInt32 nNewFormat = pFormatter->GetFormatForLanguageIfBuiltIn(
- GetFormat(), (LanguageType)nFormatLng );
+ GetFormat(), nFormatLng );
if( nNewFormat == GetFormat() )
{
diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx
index 549c9771ba3c..56c532c66b8c 100644
--- a/sw/source/core/fields/flddat.cxx
+++ b/sw/source/core/fields/flddat.cxx
@@ -40,7 +40,7 @@ SwFieldType* SwDateTimeFieldType::Copy() const
return pTmp;
}
-SwDateTimeField::SwDateTimeField(SwDateTimeFieldType* pInitType, sal_uInt16 nSub, sal_uLong nFormat, sal_uInt16 nLng)
+SwDateTimeField::SwDateTimeField(SwDateTimeFieldType* pInitType, sal_uInt16 nSub, sal_uLong nFormat, LanguageType nLng)
: SwValueField(pInitType, nFormat, nLng, 0.0),
nSubType(nSub),
nOffset(0)
diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx
index 245ef8f35afc..080dcfc77bd1 100644
--- a/sw/source/core/fields/usrfld.cxx
+++ b/sw/source/core/fields/usrfld.cxx
@@ -167,7 +167,7 @@ SwUserFieldType::SwUserFieldType( SwDoc* pDocPtr, const OUString& aNam )
EnableFormat(false); // Do not use a Numberformatter
}
-OUString SwUserFieldType::Expand(sal_uInt32 nFormat, sal_uInt16 nSubType, sal_uInt16 nLng)
+OUString SwUserFieldType::Expand(sal_uInt32 nFormat, sal_uInt16 nSubType, LanguageType nLng)
{
if((nType & nsSwGetSetExpType::GSE_EXPR) && !(nSubType & nsSwExtendedSubType::SUB_CMD))
{
@@ -309,7 +309,7 @@ bool SwUserFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
// The following line is in fact wrong, since the language is unknown (is part of the
// field) and, thus, aContent should also belong to the field. Each field can have a
// different language, but the same content with just different formatting.
- aContent = DoubleToString(nValue, static_cast<sal_uInt32>(LANGUAGE_SYSTEM));
+ aContent = DoubleToString(nValue, static_cast<sal_uInt16>(LANGUAGE_SYSTEM));
}
break;
case FIELD_PROP_PAR2:
diff --git a/sw/source/core/inc/DocumentSettingManager.hxx b/sw/source/core/inc/DocumentSettingManager.hxx
index a71966d4c3a0..9c0094910be2 100644
--- a/sw/source/core/inc/DocumentSettingManager.hxx
+++ b/sw/source/core/inc/DocumentSettingManager.hxx
@@ -163,8 +163,8 @@ public:
// IDocumentSettingAccess
virtual bool get(/*[in]*/ DocumentSettingId id) const override;
virtual void set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) override;
- virtual const css::i18n::ForbiddenCharacters* getForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ bool bLocaleData ) const override;
- virtual void setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ const css::i18n::ForbiddenCharacters& rForbiddenCharacters ) override;
+ virtual const css::i18n::ForbiddenCharacters* getForbiddenCharacters(/*[in]*/ LanguageType nLang, /*[in]*/ bool bLocaleData ) const override;
+ virtual void setForbiddenCharacters(/*[in]*/ LanguageType nLang, /*[in]*/ const css::i18n::ForbiddenCharacters& rForbiddenCharacters ) override;
virtual rtl::Reference<SvxForbiddenCharactersTable>& getForbiddenCharacterTable() override;
virtual const rtl::Reference<SvxForbiddenCharactersTable>& getForbiddenCharacterTable() const override;
virtual sal_uInt16 getLinkUpdateMode( /*[in]*/bool bGlobalSettings ) const override;
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index e4639c609222..6598abff9463 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -87,7 +87,7 @@ NumListIdMap SwEnhancedPDFExportHelper::aNumListIdMap;
NumListBodyIdMap SwEnhancedPDFExportHelper::aNumListBodyIdMap;
FrameTagIdMap SwEnhancedPDFExportHelper::aFrameTagIdMap;
-LanguageType SwEnhancedPDFExportHelper::eLanguageDefault = 0;
+LanguageType SwEnhancedPDFExportHelper::eLanguageDefault = LANGUAGE_SYSTEM;
#if OSL_DEBUG_LEVEL > 1
@@ -802,7 +802,7 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType )
const LanguageType nDefaultLang = SwEnhancedPDFExportHelper::GetDefaultLanguage();
if ( nDefaultLang != nCurrentLanguage )
- mpPDFExtOutDevData->SetStructureAttributeNumerical( vcl::PDFWriter::Language, nCurrentLanguage );
+ mpPDFExtOutDevData->SetStructureAttributeNumerical( vcl::PDFWriter::Language, (sal_uInt16)nCurrentLanguage );
}
if ( bLinkAttribute )
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 53ef42eb8992..2b3fcecc436d 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1325,7 +1325,7 @@ sal_Int16 SwScriptInfo::ScriptType(const sal_Int32 nPos) const
}
// the default is the application language script
- return SvtLanguageOptions::GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
+ return SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() );
}
sal_Int32 SwScriptInfo::NextDirChg( const sal_Int32 nPos,
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 904cef00612d..e5cb1022e812 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -3344,10 +3344,10 @@ void SwTextNode::ClearSwpHintsArr( bool bDelFields )
}
}
-sal_uInt16 SwTextNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen,
+LanguageType SwTextNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen,
sal_uInt16 nScript ) const
{
- sal_uInt16 nRet = LANGUAGE_DONTKNOW;
+ LanguageType nRet = LANGUAGE_DONTKNOW;
if ( ! nScript )
{
@@ -3390,7 +3390,7 @@ sal_uInt16 SwTextNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen,
continue;
}
const SfxPoolItem* pItem = CharFormat::GetItem( *pHt, nWhichId );
- const sal_uInt16 nLng = static_cast<const SvxLanguageItem*>(pItem)->GetLanguage();
+ const LanguageType nLng = static_cast<const SvxLanguageItem*>(pItem)->GetLanguage();
// does the attribute completely cover the range?
if( nAttrStart <= nBegin && nEnd <= *pEndIdx )
@@ -3404,7 +3404,7 @@ sal_uInt16 SwTextNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen,
{
nRet = static_cast<const SvxLanguageItem&>(GetSwAttrSet().Get( nWhichId )).GetLanguage();
if( LANGUAGE_DONTKNOW == nRet )
- nRet = static_cast<sal_uInt16>(GetAppLanguage());
+ nRet = GetAppLanguage();
}
return nRet;
}
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index f509ffea7c54..55a0664b30d5 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1037,7 +1037,7 @@ bool SwTextNode::Spell(SwSpellArgs* pArgs)
if (pArgs->xSpeller.is())
{
SvxSpellWrapper::CheckSpellLang( pArgs->xSpeller, eActLang );
- pArgs->xSpellAlt = pArgs->xSpeller->spell( rWord, eActLang,
+ pArgs->xSpellAlt = pArgs->xSpeller->spell( rWord, (sal_uInt16)eActLang,
Sequence< PropertyValue >() );
}
if( (pArgs->xSpellAlt).is() )
@@ -1348,13 +1348,13 @@ SwRect SwTextFrame::AutoSpell_( const SwContentNode* pActNode, sal_Int32 nActPos
// within the word
LanguageType eActLang = aScanner.GetCurrentLanguage();
- bool bSpell = xSpell.is() && xSpell->hasLanguage( eActLang );
+ bool bSpell = xSpell.is() && xSpell->hasLanguage( (sal_uInt16)eActLang );
if( bSpell && !rWord.isEmpty() )
{
// check for: bAlter => xHyphWord.is()
OSL_ENSURE(!bSpell || xSpell.is(), "NULL pointer");
- if( !xSpell->isValid( rWord, eActLang, Sequence< PropertyValue >() ) )
+ if( !xSpell->isValid( rWord, (sal_uInt16)eActLang, Sequence< PropertyValue >() ) )
{
sal_Int32 nSmartTagStt = nBegin;
sal_Int32 nDummy = 1;
@@ -1615,8 +1615,8 @@ void SwTextFrame::CollectAutoCmplWrds( SwContentNode* pActNode, sal_Int32 nActPo
bool SwTextNode::Hyphenate( SwInterHyphInfo &rHyphInf )
{
// shortcut: paragraph doesn't have a language set:
- if ( LANGUAGE_NONE == sal_uInt16( GetSwAttrSet().GetLanguage().GetLanguage() )
- && USHRT_MAX == GetLang(0, m_Text.getLength()))
+ if ( LANGUAGE_NONE == GetSwAttrSet().GetLanguage().GetLanguage()
+ && LanguageType(USHRT_MAX) == GetLang(0, m_Text.getLength()))
{
if( !rHyphInf.IsCheck() )
rHyphInf.SetNoLang( true );
@@ -1858,7 +1858,7 @@ void SwTextNode::TransliterateText(
pIter = nullptr;
sal_Int32 nEndPos = 0;
- sal_uInt16 nLang = LANGUAGE_NONE;
+ LanguageType nLang = LANGUAGE_NONE;
do {
if( pIter )
{