summaryrefslogtreecommitdiff
path: root/sw
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
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')
-rw-r--r--sw/inc/IDocumentSettingAccess.hxx5
-rw-r--r--sw/inc/dbmgr.hxx11
-rw-r--r--sw/inc/docufld.hxx4
-rw-r--r--sw/inc/editsh.hxx2
-rw-r--r--sw/inc/expfld.hxx2
-rw-r--r--sw/inc/fldbas.hxx18
-rw-r--r--sw/inc/flddat.hxx2
-rw-r--r--sw/inc/ndtxt.hxx2
-rw-r--r--sw/inc/poolfmt.hxx3
-rw-r--r--sw/inc/shellio.hxx8
-rw-r--r--sw/inc/sortopt.hxx2
-rw-r--r--sw/inc/swcalwrp.hxx4
-rw-r--r--sw/inc/txatritr.hxx2
-rw-r--r--sw/inc/usrfld.hxx2
-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
-rw-r--r--sw/source/filter/ascii/parasc.cxx3
-rw-r--r--sw/source/filter/inc/msfilter.hxx2
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx6
-rw-r--r--sw/source/filter/ww8/writerwordglue.cxx214
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx8
-rw-r--r--sw/source/filter/ww8/ww8par.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par.hxx6
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx12
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx6
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx22
-rw-r--r--sw/source/filter/ww8/ww8scan.hxx8
-rw-r--r--sw/source/filter/ww8/ww8struc.hxx2
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx2
-rw-r--r--sw/source/ui/dialog/ascfldlg.cxx4
-rw-r--r--sw/source/ui/misc/srtdlg.cxx4
-rw-r--r--sw/source/ui/vba/vbarange.cxx4
-rw-r--r--sw/source/ui/vba/vbastyle.cxx10
-rw-r--r--sw/source/ui/vba/vbastyle.hxx6
-rw-r--r--sw/source/uibase/app/docshini.cxx6
-rw-r--r--sw/source/uibase/config/fontcfg.cxx32
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx18
-rw-r--r--sw/source/uibase/fldui/fldmgr.cxx4
-rw-r--r--sw/source/uibase/inc/fldmgr.hxx2
-rw-r--r--sw/source/uibase/lingu/olmenu.cxx4
-rw-r--r--sw/source/uibase/shells/annotsh.cxx6
-rw-r--r--sw/source/uibase/shells/drwtxtsh.cxx6
-rw-r--r--sw/source/uibase/uiview/viewling.cxx6
62 files changed, 300 insertions, 309 deletions
diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx
index cc0466b85da4..7822215057d7 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -23,6 +23,7 @@
#include <tools/solar.h>
#include <rtl/ref.hxx>
#include <fldupde.hxx>
+#include <i18nlangtag/lang.h>
class SvxForbiddenCharactersTable;
namespace com { namespace sun { namespace star { namespace i18n { struct ForbiddenCharacters; } } } }
@@ -136,7 +137,7 @@ enum class DocumentSettingId
a list of forbidden characters.
*/
virtual const css::i18n::ForbiddenCharacters*
- getForbiddenCharacters(/*[in]*/ sal_uInt16 nLang, /*[in]*/ bool bLocaleData ) const = 0;
+ getForbiddenCharacters(/*[in]*/ LanguageType nLang, /*[in]*/ bool bLocaleData ) const = 0;
/** Set the forbidden characters.
@@ -146,7 +147,7 @@ enum class DocumentSettingId
@param rForbiddenCharacters
[in] the new list of forbidden characters for language lang.
*/
- virtual void setForbiddenCharacters(/*[in]*/ sal_uInt16 nLang,
+ virtual void setForbiddenCharacters(/*[in]*/ LanguageType nLang,
/*[in]*/ const css::i18n::ForbiddenCharacters& rForbiddenCharacters ) = 0;
/** Get the forbidden character table and creates one if necessary.
diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx
index 3cf00ef249a9..6d3357333864 100644
--- a/sw/inc/dbmgr.hxx
+++ b/sw/inc/dbmgr.hxx
@@ -21,6 +21,7 @@
#include <rtl/ustring.hxx>
#include <tools/link.hxx>
+#include <i18nlangtag/lang.h>
#include <com/sun/star/util/Date.hpp>
#include "swdllapi.h"
#include <swdbdata.hxx>
@@ -329,13 +330,13 @@ public:
css::uno::Reference< css::sdbc::XConnection> const & xConnection,
css::uno::Reference< css::beans::XPropertySet> const & xColumn,
SvNumberFormatter* pNFormatr,
- long nLanguage );
+ LanguageType nLanguage );
sal_uLong GetColumnFormat( const OUString& rDBName,
const OUString& rTableName,
const OUString& rColNm,
SvNumberFormatter* pNFormatr,
- long nLanguage );
+ LanguageType nLanguage );
sal_Int32 GetColumnType( const OUString& rDBName,
const OUString& rTableName,
const OUString& rColNm );
@@ -356,7 +357,7 @@ public:
bool OpenDataSource(const OUString& rDataSource, const OUString& rTableOrQuery);
sal_uInt32 GetSelectedRecordId(const OUString& rDataSource, const OUString& rTableOrQuery, sal_Int32 nCommandType = -1);
bool GetColumnCnt(const OUString& rSourceName, const OUString& rTableName,
- const OUString& rColumnName, sal_uInt32 nAbsRecordId, long nLanguage,
+ const OUString& rColumnName, sal_uInt32 nAbsRecordId, LanguageType nLanguage,
OUString& rResult, double* pNumber);
/** create and store or find an already stored connection to a data source for use
in SwFieldMgr and SwDBTreeList */
@@ -370,10 +371,10 @@ public:
/// close all data sources - after fields were updated
void CloseAll(bool bIncludingMerge = true);
- bool GetMergeColumnCnt(const OUString& rColumnName, sal_uInt16 nLanguage,
+ bool GetMergeColumnCnt(const OUString& rColumnName, LanguageType nLanguage,
OUString &rResult, double *pNumber);
bool FillCalcWithMergeData(SvNumberFormatter *pDocFormatter,
- sal_uInt16 nLanguage, SwCalc &aCalc);
+ LanguageType nLanguage, SwCalc &aCalc);
bool ToNextRecord(const OUString& rDataSource, const OUString& rTableOrQuery);
sal_uInt32 GetSelectedRecordId();
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index d1ad7ecbf232..5cdeb3ff9030 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -496,7 +496,7 @@ class SwDocInfoFieldType : public SwValueFieldType
public:
SwDocInfoFieldType(SwDoc* pDc);
- OUString Expand(sal_uInt16 nSubType, sal_uInt32 nFormat, sal_uInt16 nLang, const OUString& rName) const;
+ OUString Expand(sal_uInt16 nSubType, sal_uInt32 nFormat, LanguageType nLang, const OUString& rName) const;
virtual SwFieldType* Copy() const override;
};
@@ -515,7 +515,7 @@ public:
virtual void SetSubType(sal_uInt16) override;
virtual sal_uInt16 GetSubType() const override;
- virtual void SetLanguage(sal_uInt16 nLng) override;
+ virtual void SetLanguage(LanguageType nLng) override;
virtual OUString GetFieldName() const override;
const OUString& GetName() const { return aName; }
void SetName( const OUString& rName ) { aName = rName; }
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index d706e823c607..7ffcf379365a 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -288,7 +288,7 @@ public:
SvtScriptType GetScriptType() const;
/// @return the language at current cursor position.
- sal_uInt16 GetCurLang() const;
+ LanguageType GetCurLang() const;
/// TABLE
size_t GetTableFrameFormatCount( bool bUsed = false ) const;
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index 9c5e00dc3f25..a74734191cb5 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -99,7 +99,7 @@ public:
sal_uInt16 nSubType, sal_uLong nFormat = 0);
virtual void SetValue( const double& rVal ) override;
- virtual void SetLanguage(sal_uInt16 nLng) override;
+ virtual void SetLanguage(LanguageType nLng) override;
inline void ChgExpStr(const OUString& rExpand);
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 59bd4b00b05b..91aa97657955 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -275,7 +275,7 @@ class SW_DLLPUBLIC SwField
private:
mutable OUString m_Cache; ///< Cached expansion (for clipboard).
bool m_bUseFieldValueCache; /// control the usage of the cached field value
- sal_uInt16 m_nLang; ///< Always change via SetLanguage!
+ LanguageType m_nLang; ///< Always change via SetLanguage!
bool m_bIsAutomaticLanguage;
sal_uInt32 m_nFormat; /// this can be either SvxNumType or SwChapterFormat depending on the subtype
SwFieldType* m_pType;
@@ -290,7 +290,7 @@ protected:
SwField( SwFieldType* pTyp,
sal_uInt32 nFormat = 0,
- sal_uInt16 nLang = LANGUAGE_SYSTEM,
+ LanguageType nLang = LANGUAGE_SYSTEM,
bool m_bUseFieldValueCache = true );
public:
@@ -332,8 +332,8 @@ public:
virtual void SetSubType(sal_uInt16);
/// Language at field position.
- inline sal_uInt16 GetLanguage() const;
- virtual void SetLanguage(sal_uInt16 nLng);
+ inline LanguageType GetLanguage() const;
+ virtual void SetLanguage(LanguageType nLng);
/// Query parameters for dialog and for BASIC.
inline sal_uInt32 GetFormat() const;
@@ -376,7 +376,7 @@ inline sal_uInt32 SwField::GetFormat() const
return m_nFormat;
}
-inline sal_uInt16 SwField::GetLanguage() const
+inline LanguageType SwField::GetLanguage() const
{
return m_nLang;
}
@@ -407,7 +407,7 @@ public:
m_bUseFormat = bFormat;
}
- OUString ExpandValue(const double& rVal, sal_uInt32 nFormat, sal_uInt16 nLng) const;
+ OUString ExpandValue(const double& rVal, sal_uInt32 nFormat, LanguageType nLng) const;
OUString DoubleToString(const double &rVal, LanguageType eLng) const;
OUString DoubleToString(const double &rVal, sal_uInt32 nFormat) const;
};
@@ -418,14 +418,14 @@ private:
double m_fValue;
protected:
- SwValueField( SwValueFieldType* pFieldType, sal_uInt32 nFormat, sal_uInt16 nLang = LANGUAGE_SYSTEM, const double fVal = 0.0 );
+ SwValueField( SwValueFieldType* pFieldType, sal_uInt32 nFormat, LanguageType nLang = LANGUAGE_SYSTEM, const double fVal = 0.0 );
SwValueField( const SwValueField& rField );
public:
virtual ~SwValueField() override;
virtual SwFieldType* ChgTyp( SwFieldType* ) override;
- virtual void SetLanguage(sal_uInt16 nLng) override;
+ virtual void SetLanguage(LanguageType nLng) override;
SwDoc* GetDoc() const {
return static_cast<const SwValueFieldType*>(GetTyp())->GetDoc();
@@ -434,7 +434,7 @@ public:
virtual double GetValue() const;
virtual void SetValue( const double& rVal );
- OUString ExpandValue(const double& rVal, sal_uInt32 nFormat, sal_uInt16 nLng) const {
+ OUString ExpandValue(const double& rVal, sal_uInt32 nFormat, LanguageType nLng) const {
return static_cast<SwValueFieldType*>(GetTyp())->ExpandValue(rVal, nFormat, nLng);
}
diff --git a/sw/inc/flddat.hxx b/sw/inc/flddat.hxx
index 825f08b7ab89..dc5d2d6ee0db 100644
--- a/sw/inc/flddat.hxx
+++ b/sw/inc/flddat.hxx
@@ -50,7 +50,7 @@ class SW_DLLPUBLIC SwDateTimeField : public SwValueField
public:
SwDateTimeField(SwDateTimeFieldType* pType, sal_uInt16 nSubType = DATEFLD,
- sal_uLong nFormat = 0, sal_uInt16 nLng = 0);
+ sal_uLong nFormat = 0, LanguageType nLng = LANGUAGE_SYSTEM);
virtual sal_uInt16 GetSubType() const override;
virtual void SetSubType(sal_uInt16 nSub) override;
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 0f1dc5225a6a..6a4b563a519c 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -658,7 +658,7 @@ public:
void fillSoftPageBreakList( SwSoftPageBreakList& rBreak ) const;
- sal_uInt16 GetLang( const sal_Int32 nBegin, const sal_Int32 nLen = 0,
+ LanguageType GetLang( const sal_Int32 nBegin, const sal_Int32 nLen = 0,
sal_uInt16 nScript = 0 ) const;
/// in ndcopy.cxx
diff --git a/sw/inc/poolfmt.hxx b/sw/inc/poolfmt.hxx
index 4c8958aac9a9..6830faeee1ac 100644
--- a/sw/inc/poolfmt.hxx
+++ b/sw/inc/poolfmt.hxx
@@ -22,6 +22,7 @@
#include <limits.h>
#include <tools/solar.h>
#include <editeng/frmdir.hxx>
+#include <i18nlangtag/lang.h>
/** POOLCOLL-IDs:
// +----+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
@@ -431,7 +432,7 @@ RES_POOLCOLL_HTML_END
the parent in all other cases. */
sal_uInt16 GetPoolParent( sal_uInt16 nId );
-SvxFrameDirection GetDefaultFrameDirection(sal_uLong nLanguage);
+SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage);
bool IsConditionalByPoolId(sal_uInt16 nId);
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 92b47eb19e93..7410fe5307ed 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -63,7 +63,7 @@ class SW_DLLPUBLIC SwAsciiOptions
{
OUString sFont;
rtl_TextEncoding eCharSet;
- sal_uInt16 nLanguage;
+ LanguageType nLanguage;
LineEnd eCRLF_Flag;
public:
@@ -74,8 +74,8 @@ public:
rtl_TextEncoding GetCharSet() const { return eCharSet; }
void SetCharSet( rtl_TextEncoding nVal ) { eCharSet = nVal; }
- sal_uInt16 GetLanguage() const { return nLanguage; }
- void SetLanguage( sal_uInt16 nVal ) { nLanguage = nVal; }
+ LanguageType GetLanguage() const { return nLanguage; }
+ void SetLanguage( LanguageType nVal ) { nLanguage = nVal; }
LineEnd GetParaFlags() const { return eCRLF_Flag; }
void SetParaFlags( LineEnd eVal ) { eCRLF_Flag = eVal; }
@@ -85,7 +85,7 @@ public:
sFont.clear();
eCRLF_Flag = GetSystemLineEnd();
eCharSet = ::osl_getThreadTextEncoding();
- nLanguage = 0;
+ nLanguage = LANGUAGE_SYSTEM;
}
// for the automatic conversion (mail/news/...)
void ReadUserData( const OUString& );
diff --git a/sw/inc/sortopt.hxx b/sw/inc/sortopt.hxx
index 3871b6b09fa1..964f55c3dd5b 100644
--- a/sw/inc/sortopt.hxx
+++ b/sw/inc/sortopt.hxx
@@ -47,7 +47,7 @@ struct SW_DLLPUBLIC SwSortOptions
std::vector<SwSortKey*> aKeys;
SwSortDirection eDirection;
sal_Unicode cDeli;
- sal_uInt16 nLanguage;
+ LanguageType nLanguage;
bool bTable;
bool bIgnoreCase;
};
diff --git a/sw/inc/swcalwrp.hxx b/sw/inc/swcalwrp.hxx
index e8ed1cb4e5bc..24bfeec16b63 100644
--- a/sw/inc/swcalwrp.hxx
+++ b/sw/inc/swcalwrp.hxx
@@ -28,14 +28,14 @@
class SwCalendarWrapper : public CalendarWrapper
{
OUString sUniqueId;
- sal_uInt16 nLang;
+ LanguageType nLang;
public:
SwCalendarWrapper( const css::uno::Reference< css::uno::XComponentContext > & rxContext = ::comphelper::getProcessComponentContext() )
: CalendarWrapper( rxContext ), nLang( LANGUAGE_SYSTEM )
{}
- void LoadDefaultCalendar( sal_uInt16 nLang );
+ void LoadDefaultCalendar( LanguageType nLang );
};
salhelper::SingletonRef<SwCalendarWrapper>* s_getCalendarWrapper();
diff --git a/sw/inc/txatritr.hxx b/sw/inc/txatritr.hxx
index 178bf94cf4f6..4e82794a4c8d 100644
--- a/sw/inc/txatritr.hxx
+++ b/sw/inc/txatritr.hxx
@@ -67,7 +67,7 @@ public:
bool Next();
sal_Int32 GetChgPos() const { return nChgPos; }
- sal_uInt16 GetLanguage() const
+ LanguageType GetLanguage() const
{ return static_cast<const SvxLanguageItem&>(*pCurItem).GetValue(); }
};
diff --git a/sw/inc/usrfld.hxx b/sw/inc/usrfld.hxx
index e2490f9990cd..9d241df8a118 100644
--- a/sw/inc/usrfld.hxx
+++ b/sw/inc/usrfld.hxx
@@ -41,7 +41,7 @@ public:
virtual OUString GetName() const override;
virtual SwFieldType* Copy() const override;
- OUString Expand(sal_uInt32 nFormat, sal_uInt16 nSubType, sal_uInt16 nLng);
+ OUString Expand(sal_uInt32 nFormat, sal_uInt16 nSubType, LanguageType nLng);
OUString GetContent( sal_uInt32 nFormat = 0 );
void SetContent( const OUString& rStr, sal_uInt32 nFormat = 0 );
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 )
{
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index e3045b0edee8..39d36874efc9 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -108,8 +108,7 @@ SwASCIIParser::SwASCIIParser(SwDoc* pD, const SwPaM& rCursor, SvStream& rIn,
// set defaults from the options
if( rOpt.GetLanguage() )
{
- SvxLanguageItem aLang( (LanguageType)rOpt.GetLanguage(),
- RES_CHRATR_LANGUAGE );
+ SvxLanguageItem aLang( rOpt.GetLanguage(), RES_CHRATR_LANGUAGE );
pItemSet->Put( aLang );
aLang.SetWhich(RES_CHRATR_CJK_LANGUAGE);
pItemSet->Put( aLang );
diff --git a/sw/source/filter/inc/msfilter.hxx b/sw/source/filter/inc/msfilter.hxx
index 559e63d7c57e..3a432681343b 100644
--- a/sw/source/filter/inc/msfilter.hxx
+++ b/sw/source/filter/inc/msfilter.hxx
@@ -109,7 +109,7 @@ namespace sw
@author
<a href="mailto:mmaher@openoffice.org">Martin Maher</a
*/
- sal_uLong MSDateTimeFormatToSwFormat(OUString& rParams, SvNumberFormatter *pFormatter, sal_uInt16 &rLang, bool bHijri, sal_uInt16 nDocLang);
+ sal_uLong MSDateTimeFormatToSwFormat(OUString& rParams, SvNumberFormatter *pFormatter, LanguageType &rLang, bool bHijri, LanguageType nDocLang);
/*Used to identify if the previous token is AM time field*/
bool IsPreviousAM(OUString& rParams, sal_Int32 nPos);
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 2f78e3977b26..597316b2002c 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2325,15 +2325,15 @@ void RtfAttributeOutput::CharLanguage(const SvxLanguageItem& rLanguage)
{
case RES_CHRATR_LANGUAGE:
m_aStylesEnd.append(OOO_STRING_SVTOOLS_RTF_LANG);
- m_aStylesEnd.append((sal_Int32)rLanguage.GetLanguage());
+ m_aStylesEnd.append((sal_Int32)static_cast<sal_uInt16>(rLanguage.GetLanguage()));
break;
case RES_CHRATR_CJK_LANGUAGE:
m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LANGFE);
- m_aStyles.append((sal_Int32)rLanguage.GetLanguage());
+ m_aStyles.append((sal_Int32)static_cast<sal_uInt16>(rLanguage.GetLanguage()));
break;
case RES_CHRATR_CTL_LANGUAGE:
m_aStyles.append(OOO_STRING_SVTOOLS_RTF_ALANG);
- m_aStyles.append((sal_Int32)rLanguage.GetLanguage());
+ m_aStyles.append((sal_Int32)static_cast<sal_uInt16>(rLanguage.GetLanguage()));
break;
}
}
diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx
index a2a6aa29c454..ed06ad119548 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -834,8 +834,8 @@ namespace sw
}
sal_uLong MSDateTimeFormatToSwFormat(OUString& rParams,
- SvNumberFormatter *pFormatter, sal_uInt16 &rLang, bool bHijri,
- sal_uInt16 nDocLang)
+ SvNumberFormatter *pFormatter, LanguageType &rLang, bool bHijri,
+ LanguageType nDocLang)
{
// tell the Formatter about the new entry
sal_Int32 nCheckPos = 0;
@@ -906,14 +906,10 @@ namespace sw
sal_Unicode nChar = rParams[nI];
// Change the localized word string to english
- switch ( nDocLang )
+ if ( nDocLang == LANGUAGE_FRENCH )
{
- case LANGUAGE_FRENCH:
- if ( ( nChar == 'a' || nChar == 'A' ) && IsNotAM(rParams, nI) )
- rParams = rParams.replaceAt(nI, 1, "Y");
- break;
- default:
- ;
+ if ( ( nChar == 'a' || nChar == 'A' ) && IsNotAM(rParams, nI) )
+ rParams = rParams.replaceAt(nI, 1, "Y");
}
if (nChar == '/')
{
@@ -934,111 +930,103 @@ namespace sw
if ( !bForceJapanese && !bForceNatNum )
{
// Convert to the localized equivalent for OOo
- switch ( rLang )
+ if ( rLang == LANGUAGE_FINNISH )
{
- case LANGUAGE_FINNISH:
- {
- if (nChar == 'y' || nChar == 'Y')
- rParams = rParams.replaceAt(nI, 1, "V");
- else if (nChar == 'm' || nChar == 'M')
- rParams = rParams.replaceAt(nI, 1, "K");
- else if (nChar == 'd' || nChar == 'D')
- rParams = rParams.replaceAt(nI, 1, "P");
- else if (nChar == 'h' || nChar == 'H')
- rParams = rParams.replaceAt(nI, 1, "T");
- }
- break;
- case LANGUAGE_DANISH:
- case LANGUAGE_NORWEGIAN:
- case LANGUAGE_NORWEGIAN_BOKMAL:
- case LANGUAGE_NORWEGIAN_NYNORSK:
- case LANGUAGE_SWEDISH:
- case LANGUAGE_SWEDISH_FINLAND:
- {
- if (nChar == 'h' || nChar == 'H')
- rParams = rParams.replaceAt(nI, 1, "T");
- }
- break;
- case LANGUAGE_PORTUGUESE:
- case LANGUAGE_PORTUGUESE_BRAZILIAN:
- case LANGUAGE_SPANISH_MODERN:
- case LANGUAGE_SPANISH_DATED:
- case LANGUAGE_SPANISH_MEXICAN:
- case LANGUAGE_SPANISH_GUATEMALA:
- case LANGUAGE_SPANISH_COSTARICA:
- case LANGUAGE_SPANISH_PANAMA:
- case LANGUAGE_SPANISH_DOMINICAN_REPUBLIC:
- case LANGUAGE_SPANISH_VENEZUELA:
- case LANGUAGE_SPANISH_COLOMBIA:
- case LANGUAGE_SPANISH_PERU:
- case LANGUAGE_SPANISH_ARGENTINA:
- case LANGUAGE_SPANISH_ECUADOR:
- case LANGUAGE_SPANISH_CHILE:
- case LANGUAGE_SPANISH_URUGUAY:
- case LANGUAGE_SPANISH_PARAGUAY:
- case LANGUAGE_SPANISH_BOLIVIA:
- case LANGUAGE_SPANISH_EL_SALVADOR:
- case LANGUAGE_SPANISH_HONDURAS:
- case LANGUAGE_SPANISH_NICARAGUA:
- case LANGUAGE_SPANISH_PUERTO_RICO:
- {
- if (nChar == 'a' || nChar == 'A')
- rParams = rParams.replaceAt(nI, 1, "O");
- else if (nChar == 'y' || nChar == 'Y')
- rParams = rParams.replaceAt(nI, 1, "A");
- }
- break;
- case LANGUAGE_DUTCH:
- case LANGUAGE_DUTCH_BELGIAN:
- {
- if (nChar == 'y' || nChar == 'Y')
- rParams = rParams.replaceAt(nI, 1, "J");
- else if (nChar == 'u' || nChar == 'U')
- rParams = rParams.replaceAt(nI, 1, "H");
- }
- break;
- case LANGUAGE_ITALIAN:
- case LANGUAGE_ITALIAN_SWISS:
- {
- if (nChar == 'a' || nChar == 'A')
- rParams = rParams.replaceAt(nI, 1, "O");
- else if (nChar == 'g' || nChar == 'G')
- rParams = rParams.replaceAt(nI, 1, "X");
- else if (nChar == 'y' || nChar == 'Y')
- rParams = rParams.replaceAt(nI, 1, "A");
- else if (nChar == 'd' || nChar == 'D')
- rParams = rParams.replaceAt(nI, 1, "G");
- }
- break;
- case LANGUAGE_GERMAN:
- case LANGUAGE_GERMAN_SWISS:
- case LANGUAGE_GERMAN_AUSTRIAN:
- case LANGUAGE_GERMAN_LUXEMBOURG:
- case LANGUAGE_GERMAN_LIECHTENSTEIN:
- {
- if (nChar == 'y' || nChar == 'Y')
- rParams = rParams.replaceAt(nI, 1, "J");
- else if (nChar == 'd' || nChar == 'D')
- rParams = rParams.replaceAt(nI, 1, "T");
- }
- break;
- case LANGUAGE_FRENCH:
- case LANGUAGE_FRENCH_BELGIAN:
- case LANGUAGE_FRENCH_CANADIAN:
- case LANGUAGE_FRENCH_SWISS:
- case LANGUAGE_FRENCH_LUXEMBOURG:
- case LANGUAGE_FRENCH_MONACO:
- {
- if (nChar == 'y' || nChar == 'Y' || nChar == 'a')
- rParams = rParams.replaceAt(nI, 1, "A");
- else if (nChar == 'd' || nChar == 'D' || nChar == 'j')
- rParams = rParams.replaceAt(nI, 1, "J");
- }
- break;
- default:
- {
- ; // Nothing
- }
+ if (nChar == 'y' || nChar == 'Y')
+ rParams = rParams.replaceAt(nI, 1, "V");
+ else if (nChar == 'm' || nChar == 'M')
+ rParams = rParams.replaceAt(nI, 1, "K");
+ else if (nChar == 'd' || nChar == 'D')
+ rParams = rParams.replaceAt(nI, 1, "P");
+ else if (nChar == 'h' || nChar == 'H')
+ rParams = rParams.replaceAt(nI, 1, "T");
+ }
+ else if ( rLang.anyOf(
+ LANGUAGE_DANISH,
+ LANGUAGE_NORWEGIAN,
+ LANGUAGE_NORWEGIAN_BOKMAL,
+ LANGUAGE_NORWEGIAN_NYNORSK,
+ LANGUAGE_SWEDISH,
+ LANGUAGE_SWEDISH_FINLAND))
+ {
+ if (nChar == 'h' || nChar == 'H')
+ rParams = rParams.replaceAt(nI, 1, "T");
+ }
+ else if ( rLang.anyOf(
+ LANGUAGE_PORTUGUESE,
+ LANGUAGE_PORTUGUESE_BRAZILIAN,
+ LANGUAGE_SPANISH_MODERN,
+ LANGUAGE_SPANISH_DATED,
+ LANGUAGE_SPANISH_MEXICAN,
+ LANGUAGE_SPANISH_GUATEMALA,
+ LANGUAGE_SPANISH_COSTARICA,
+ LANGUAGE_SPANISH_PANAMA,
+ LANGUAGE_SPANISH_DOMINICAN_REPUBLIC,
+ LANGUAGE_SPANISH_VENEZUELA,
+ LANGUAGE_SPANISH_COLOMBIA,
+ LANGUAGE_SPANISH_PERU,
+ LANGUAGE_SPANISH_ARGENTINA,
+ LANGUAGE_SPANISH_ECUADOR,
+ LANGUAGE_SPANISH_CHILE,
+ LANGUAGE_SPANISH_URUGUAY,
+ LANGUAGE_SPANISH_PARAGUAY,
+ LANGUAGE_SPANISH_BOLIVIA,
+ LANGUAGE_SPANISH_EL_SALVADOR,
+ LANGUAGE_SPANISH_HONDURAS,
+ LANGUAGE_SPANISH_NICARAGUA,
+ LANGUAGE_SPANISH_PUERTO_RICO))
+ {
+ if (nChar == 'a' || nChar == 'A')
+ rParams = rParams.replaceAt(nI, 1, "O");
+ else if (nChar == 'y' || nChar == 'Y')
+ rParams = rParams.replaceAt(nI, 1, "A");
+ }
+ else if ( rLang.anyOf(
+ LANGUAGE_DUTCH,
+ LANGUAGE_DUTCH_BELGIAN))
+ {
+ if (nChar == 'y' || nChar == 'Y')
+ rParams = rParams.replaceAt(nI, 1, "J");
+ else if (nChar == 'u' || nChar == 'U')
+ rParams = rParams.replaceAt(nI, 1, "H");
+ }
+ else if ( rLang.anyOf(
+ LANGUAGE_ITALIAN,
+ LANGUAGE_ITALIAN_SWISS))
+ {
+ if (nChar == 'a' || nChar == 'A')
+ rParams = rParams.replaceAt(nI, 1, "O");
+ else if (nChar == 'g' || nChar == 'G')
+ rParams = rParams.replaceAt(nI, 1, "X");
+ else if (nChar == 'y' || nChar == 'Y')
+ rParams = rParams.replaceAt(nI, 1, "A");
+ else if (nChar == 'd' || nChar == 'D')
+ rParams = rParams.replaceAt(nI, 1, "G");
+ }
+ else if ( rLang.anyOf(
+ LANGUAGE_GERMAN,
+ LANGUAGE_GERMAN_SWISS,
+ LANGUAGE_GERMAN_AUSTRIAN,
+ LANGUAGE_GERMAN_LUXEMBOURG,
+ LANGUAGE_GERMAN_LIECHTENSTEIN))
+ {
+ if (nChar == 'y' || nChar == 'Y')
+ rParams = rParams.replaceAt(nI, 1, "J");
+ else if (nChar == 'd' || nChar == 'D')
+ rParams = rParams.replaceAt(nI, 1, "T");
+ }
+ else if ( rLang.anyOf(
+ LANGUAGE_FRENCH,
+ LANGUAGE_FRENCH_BELGIAN,
+ LANGUAGE_FRENCH_CANADIAN,
+ LANGUAGE_FRENCH_SWISS,
+ LANGUAGE_FRENCH_LUXEMBOURG,
+ LANGUAGE_FRENCH_MONACO))
+ {
+ if (nChar == 'y' || nChar == 'Y' || nChar == 'a')
+ rParams = rParams.replaceAt(nI, 1, "A");
+ else if (nChar == 'd' || nChar == 'D' || nChar == 'j')
+ rParams = rParams.replaceAt(nI, 1, "J");
}
}
}
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 7da2c6f353cc..5047e4f0d0bd 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1290,19 +1290,19 @@ void WW8AttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage )
{
// use sprmCRgLid0_80 rather than sprmCLid
m_rWW8Export.InsUInt16( nId );
- m_rWW8Export.InsUInt16( rLanguage.GetLanguage() );
+ m_rWW8Export.InsUInt16( (sal_uInt16)rLanguage.GetLanguage() );
// Word 2000 and above apparently require both old and new versions of
// these sprms to be set, without it spellchecking doesn't work
if ( nId == NS_sprm::sprmCRgLid0_80 )
{
m_rWW8Export.InsUInt16( NS_sprm::sprmCRgLid0 );
- m_rWW8Export.InsUInt16( rLanguage.GetLanguage() );
+ m_rWW8Export.InsUInt16( (sal_uInt16)rLanguage.GetLanguage() );
}
else if ( nId == NS_sprm::sprmCRgLid1_80 )
{
m_rWW8Export.InsUInt16( NS_sprm::sprmCRgLid1 );
- m_rWW8Export.InsUInt16( rLanguage.GetLanguage() );
+ m_rWW8Export.InsUInt16( (sal_uInt16)rLanguage.GetLanguage() );
}
}
}
@@ -2293,7 +2293,7 @@ bool MSWordExportBase::GetNumberFormat(const SwField& rField, OUString& rStr)
const SvNumberformat* pNumFormat = pNFormatr->GetEntry( nFormatIdx );
if( pNumFormat )
{
- sal_uInt16 nLng = rField.GetLanguage();
+ LanguageType nLng = rField.GetLanguage();
LocaleDataWrapper aLocDat(pNFormatr->GetComponentContext(),
LanguageTag(nLng));
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 1cb9d41845ad..702232035341 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2858,11 +2858,11 @@ std::size_t Custom8BitToUnicode(rtl_TextToUnicodeConverter hConverter,
return nDestChars;
}
-bool SwWW8ImplReader::LangUsesHindiNumbers(sal_uInt16 nLang)
+bool SwWW8ImplReader::LangUsesHindiNumbers(LanguageType nLang)
{
bool bResult = false;
- switch (nLang)
+ switch ((sal_uInt16)nLang)
{
case 0x1401: // Arabic(Algeria)
case 0x3c01: // Arabic(Bahrain)
@@ -3014,7 +3014,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCp
sal_uInt8 nBCode = 0;
sal_uInt16 nUCode;
- sal_uInt16 nCTLLang = 0;
+ LanguageType nCTLLang = LANGUAGE_SYSTEM;
const SfxPoolItem * pItem = GetFormatAttr(RES_CHRATR_CTL_LANGUAGE);
if (pItem != nullptr)
nCTLLang = static_cast<const SvxLanguageItem *>(pItem)->GetLanguage();
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 9c3d471f645b..d3658d3e6bfd 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1391,7 +1391,7 @@ private:
bool ReadChar(long nPosCp, long nCpOfs);
bool ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCpOfs);
bool ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, long nTextEnd, long nCpOfs);
- static bool LangUsesHindiNumbers(sal_uInt16 nLang);
+ static bool LangUsesHindiNumbers(LanguageType nLang);
static sal_Unicode TranslateToHindiNumbers(sal_Unicode);
void SetDocumentGrid(SwFrameFormat &rFormat, const wwSection &rSection);
@@ -1805,9 +1805,9 @@ public: // really private, but can only be done public
eF_ResT Read_F_DocInfo( WW8FieldDesc* pF, OUString& rStr );
eF_ResT Read_F_Author( WW8FieldDesc*, OUString& );
eF_ResT Read_F_TemplName( WW8FieldDesc*, OUString& );
- short GetTimeDatePara(OUString& rStr, sal_uInt32& rFormat, sal_uInt16 &rLang,
+ short GetTimeDatePara(OUString& rStr, sal_uInt32& rFormat, LanguageType &rLang,
int nWhichDefault, bool bHijri = false);
- bool ForceFieldLanguage(SwField &rField, sal_uInt16 nLang);
+ bool ForceFieldLanguage(SwField &rField, LanguageType nLang);
eF_ResT Read_F_DateTime( WW8FieldDesc*, OUString& rStr );
eF_ResT Read_F_FileName( WW8FieldDesc*, OUString& rStr);
eF_ResT Read_F_Num( WW8FieldDesc* pF, OUString& );
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 51d46b9bbc49..a2be43e0e82a 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -389,14 +389,14 @@ static SvxNumType GetNumberPara(const OUString& rStr, bool bAllowPageDesc = fals
return aType;
}
-bool SwWW8ImplReader::ForceFieldLanguage(SwField &rField, sal_uInt16 nLang)
+bool SwWW8ImplReader::ForceFieldLanguage(SwField &rField, LanguageType nLang)
{
bool bRet(false);
const SvxLanguageItem *pLang =
static_cast<const SvxLanguageItem*>(GetFormatAttr(RES_CHRATR_LANGUAGE));
OSL_ENSURE(pLang, "impossible");
- sal_uInt16 nDefault = pLang ? pLang->GetValue() : LANGUAGE_ENGLISH_US;
+ LanguageType nDefault = pLang ? pLang->GetValue() : LANGUAGE_ENGLISH_US;
if (nLang != nDefault)
{
@@ -408,7 +408,7 @@ bool SwWW8ImplReader::ForceFieldLanguage(SwField &rField, sal_uInt16 nLang)
return bRet;
}
-OUString GetWordDefaultDateStringAsUS(SvNumberFormatter* pFormatter, sal_uInt16 nLang)
+OUString GetWordDefaultDateStringAsUS(SvNumberFormatter* pFormatter, LanguageType nLang)
{
//Get the system date in the correct final language layout, convert to
//a known language and modify the 2 digit year part to be 4 digit, and
@@ -432,7 +432,7 @@ OUString GetWordDefaultDateStringAsUS(SvNumberFormatter* pFormatter, sal_uInt16
}
short SwWW8ImplReader::GetTimeDatePara(OUString& rStr, sal_uInt32& rFormat,
- sal_uInt16 &rLang, int nWhichDefault, bool bHijri)
+ LanguageType &rLang, int nWhichDefault, bool bHijri)
{
bool bRTL = false;
if (m_pPlcxMan && !m_bVer67)
@@ -1655,7 +1655,7 @@ eF_ResT SwWW8ImplReader::Read_F_DocInfo( WW8FieldDesc* pF, OUString& rStr )
sal_uInt32 nFormat = 0;
- sal_uInt16 nLang(0);
+ LanguageType nLang(LANGUAGE_SYSTEM);
if (bDateTime)
{
short nDT = GetTimeDatePara(rStr, nFormat, nLang, pF->nId);
@@ -1758,7 +1758,7 @@ eF_ResT SwWW8ImplReader::Read_F_DateTime( WW8FieldDesc*pF, OUString& rStr )
sal_uInt32 nFormat = 0;
- sal_uInt16 nLang(0);
+ LanguageType nLang(LANGUAGE_SYSTEM);
short nDT = GetTimeDatePara(rStr, nFormat, nLang, ww::eDATE, bHijri);
if( css::util::NumberFormat::UNDEFINED == nDT ) // no D/T-Formatstring
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index f430a140ccab..8c80b6f2c332 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -842,7 +842,7 @@ void wwSectionManager::CreateSep(const long nTextPos, bool /*bMustHaveBreak*/)
aLastSection = maSegments.back();
//Here
- sal_uInt16 nLIdx = ( ( mrReader.m_pWwFib->m_lid & 0xff ) == 0x9 ) ? 1 : 0;
+ sal_uInt16 nLIdx = ( ( (sal_uInt16)mrReader.m_pWwFib->m_lid & 0xff ) == 0x9 ) ? 1 : 0;
//BEGIN read section values
wwSection aNewSection(*mrReader.m_pPaM->GetPoint());
@@ -3867,7 +3867,7 @@ void SwWW8ImplReader::Read_Language( sal_uInt16 nId, const sal_uInt8* pData, sho
else
{
sal_uInt16 nLang = SVBT16ToShort( pData ); // Language-Id
- NewAttr(SvxLanguageItem((const LanguageType)nLang, nId));
+ NewAttr(SvxLanguageItem(LanguageType(nLang), nId));
}
}
@@ -4513,7 +4513,7 @@ void SwWW8ImplReader::Read_Emphasis( sal_uInt16, const sal_uInt8* pData, short n
aLang = m_pPlcxMan->GetChpPLCF()->HasSprm(0x486E);
if (aLang.pSprm && aLang.nRemainingData >= 2)
- nLang = SVBT16ToShort(aLang.pSprm);
+ nLang = LanguageType(SVBT16ToShort(aLang.pSprm));
else
{
nLang = static_cast<const SvxLanguageItem *>(
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 8f51cc10d9db..1410d42dab34 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -5531,7 +5531,9 @@ WW8Fib::WW8Fib(SvStream& rSt, sal_uInt8 nWantedVersion, sal_uInt32 nOffset)
sal_Int16 cpnBtePap_Ver67=0;
// read FIB
- rSt.ReadInt16( m_lid );
+ sal_Int16 nTmpLid = 0;
+ rSt.ReadInt16( nTmpLid );
+ m_lid = LanguageType(nTmpLid);
rSt.ReadInt16( m_pnNext );
rSt.ReadUChar( aBits1 );
rSt.ReadUChar( aBits2 );
@@ -5577,7 +5579,9 @@ WW8Fib::WW8Fib(SvStream& rSt, sal_uInt8 nWantedVersion, sal_uInt32 nOffset)
&& (bVer67 || WW8ReadINT16( rSt, pnLvcFirst_W6 )) // 8
&& (bVer67 || WW8ReadINT16( rSt, cpnBteLvc_W6 )) // 9
*/
- rSt.ReadInt16( m_lidFE );
+ sal_Int16 nTmpFE = 0;
+ rSt.ReadInt16( nTmpFE );
+ m_lidFE = LanguageType(nTmpFE);
rSt.ReadUInt16( m_clw );
}
@@ -5926,7 +5930,7 @@ WW8Fib::WW8Fib(sal_uInt8 nVer, bool bDot)
m_cQuickSaves = m_nFib >= 0x00D9 ? 0xF : 0;
// --> #i90932#
- m_lid = 0x409; // LANGUAGE_ENGLISH_US
+ m_lid = LanguageType(0x409); // LANGUAGE_ENGLISH_US
LanguageType nLang = Application::GetSettings().GetLanguageTag().getLanguageType();
m_fFarEast = MsLangId::isCJK(nLang);
@@ -5957,7 +5961,7 @@ void WW8Fib::WriteHeader(SvStream& rStrm)
Set_UInt16( pData, m_wIdent );
Set_UInt16( pData, m_nFib );
Set_UInt16( pData, m_nProduct );
- Set_UInt16( pData, m_lid );
+ Set_UInt16( pData, (sal_uInt16)m_lid );
Set_UInt16( pData, m_pnNext );
sal_uInt16 nBits16 = 0;
@@ -6013,7 +6017,7 @@ void WW8Fib::WriteHeader(SvStream& rStrm)
Set_UInt16( pData, m_wMagicCreatedPrivate );
Set_UInt16( pData, m_wMagicRevisedPrivate );
pData += 9 * sizeof( sal_Int16 );
- Set_UInt16( pData, m_lidFE );
+ Set_UInt16( pData, (sal_uInt16)m_lidFE );
Set_UInt16( pData, m_clw );
}
@@ -6268,12 +6272,12 @@ void WW8Fib::Write(SvStream& rStrm)
rStrm.WriteBytes(pDataPtr.get(), m_fcMin - nUnencryptedHdr);
}
-rtl_TextEncoding WW8Fib::GetFIBCharset(sal_uInt16 chs, sal_uInt16 nLidLocale)
+rtl_TextEncoding WW8Fib::GetFIBCharset(sal_uInt16 chs, LanguageType nLidLocale)
{
OSL_ENSURE(chs <= 0x100, "overflowed winword charset set");
if (chs == 0x0100)
return RTL_TEXTENCODING_APPLE_ROMAN;
- if (chs == 0 && nLidLocale >= 999)
+ if (chs == 0 && (sal_uInt16)nLidLocale >= 999)
{
/*
nLidLocale:
@@ -7859,9 +7863,9 @@ void WW8DopTypography::WriteToMem(sal_uInt8 *&pData) const
Set_UInt16(pData,rgxchLPunct[i]);
}
-sal_uInt16 WW8DopTypography::GetConvertedLang() const
+LanguageType WW8DopTypography::GetConvertedLang() const
{
- sal_uInt16 nLang;
+ LanguageType nLang;
//I have assumed peoples republic/taiwan == simplified/traditional
//This isn't a documented issue, so we might have it all wrong,
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index c3b9cd284e0b..9a1b277c8480 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -1135,7 +1135,7 @@ public:
*/
sal_uInt16 m_nFib; // 0x2 FIB version written
sal_uInt16 m_nProduct; // 0x4 product version written by
- sal_Int16 m_lid; // 0x6 language stamp---localized version;
+ LanguageType m_lid; // 0x6 language stamp---localized version;
WW8_PN m_pnNext; // 0x8
bool m_fDot :1; // 0xa 0001
@@ -1190,8 +1190,8 @@ public:
sal_uInt16 m_wMagicCreatedPrivate; // private data
sal_uInt16 m_wMagicRevisedPrivate; // private data
- sal_Int16 m_lidFE; // Language id if document was written by Far East version
- // of Word (i.e. FIB.fFarEast is on)
+ LanguageType m_lidFE; // Language id if document was written by Far East version
+ // of Word (i.e. FIB.fFarEast is on)
sal_uInt16 m_clw; // Number of fields in the array of longs
// end of WW8 section
@@ -1529,7 +1529,7 @@ public:
void WriteHeader(SvStream& rStrm);
void Write(SvStream& rStrm);
- static rtl_TextEncoding GetFIBCharset(sal_uInt16 chs, sal_uInt16 nLidLocale);
+ static rtl_TextEncoding GetFIBCharset(sal_uInt16 chs, LanguageType nLidLocale);
ww::WordVersion GetFIBVersion() const;
bool GetBaseCp(ManTypes nType, WW8_CP * cp) const;
sal_Unicode getNumDecimalSep() const { return m_nNumDecimalSep;}
diff --git a/sw/source/filter/ww8/ww8struc.hxx b/sw/source/filter/ww8/ww8struc.hxx
index ba7768caac0b..9eb87651695b 100644
--- a/sw/source/filter/ww8/ww8struc.hxx
+++ b/sw/source/filter/ww8/ww8struc.hxx
@@ -375,7 +375,7 @@ public:
void WriteToMem(sal_uInt8 *&pData) const;
//Maps what I think is the language this is to affect to the OOo language
- sal_uInt16 GetConvertedLang() const;
+ LanguageType GetConvertedLang() const;
sal_uInt16 fKerningPunct : 1; // true if we're kerning punctuation
sal_uInt16 iJustification : 2; // Kinsoku method of justification:
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 91d0ba84fb7a..a939175d7b3d 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1610,7 +1610,7 @@ void SwInsertDBColAutoPilot::ImplCommit()
sNewNode += "/ColumnSet";
- LanguageType ePrevLang = (LanguageType)-1;
+ LanguageType ePrevLang(0xffff);
SvNumberFormatter& rNFormatr = *pView->GetWrtShell().GetNumberFormatter();
for(size_t nCol = 0; nCol < aDBColumns.size(); nCol++)
diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx
index b1afb05cbd6c..75e518af1657 100644
--- a/sw/source/ui/dialog/ascfldlg.cxx
+++ b/sw/source/ui/dialog/ascfldlg.cxx
@@ -263,7 +263,7 @@ void SwAsciiFilterDlg::FillOptions( SwAsciiOptions& rOptions )
{
sal_uLong nCCode = m_pCharSetLB->GetSelectTextEncoding();
OUString sFont;
- LanguageType nLng = 0;
+ LanguageType nLng = LANGUAGE_SYSTEM;
if( m_pFontLB->IsVisible() )
{
sFont = m_pFontLB->GetSelectEntry();
@@ -272,7 +272,7 @@ void SwAsciiFilterDlg::FillOptions( SwAsciiOptions& rOptions )
rOptions.SetFontName( sFont );
rOptions.SetCharSet( rtl_TextEncoding( nCCode ) );
- rOptions.SetLanguage( sal_uInt16( nLng ) );
+ rOptions.SetLanguage( nLng );
rOptions.SetParaFlags( GetCRLF() );
// save the user settings
diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx
index caa6b906eb12..ab338be9ce13 100644
--- a/sw/source/ui/misc/srtdlg.cxx
+++ b/sw/source/ui/misc/srtdlg.cxx
@@ -56,7 +56,7 @@ static sal_uInt16 nType1 = 0;
static sal_uInt16 nType2 = 0;
static sal_uInt16 nType3 = 0;
-static sal_uInt16 nLang = LANGUAGE_NONE;
+static LanguageType nLang = LANGUAGE_NONE;
static bool bAsc1 = true;
static bool bAsc2 = true;
@@ -196,7 +196,7 @@ SwSortDlg::SwSortDlg(vcl::Window* pParent, SwWrtShell &rShell)
// first initialise the language, then select the
if( LANGUAGE_NONE == nLang || LANGUAGE_DONTKNOW == nLang )
- nLang = (sal_uInt16)GetAppLanguage();
+ nLang = GetAppLanguage();
m_pLangLB->SetLanguageList( SvxLanguageListFlags::ALL | SvxLanguageListFlags::ONLY_KNOWN, true );
m_pLangLB->SelectLanguage( nLang );
diff --git a/sw/source/ui/vba/vbarange.cxx b/sw/source/ui/vba/vbarange.cxx
index a76cd1cdce51..65bf25b63ed5 100644
--- a/sw/source/ui/vba/vbarange.cxx
+++ b/sw/source/ui/vba/vbarange.cxx
@@ -310,13 +310,13 @@ SwVbaRange::getListFormat()
::sal_Int32 SAL_CALL SwVbaRange::getLanguageID()
{
uno::Reference< beans::XPropertySet > xParaProps( mxTextCursor, uno::UNO_QUERY_THROW );
- return SwVbaStyle::getLanguageID( xParaProps );
+ return (sal_uInt16)SwVbaStyle::getLanguageID( xParaProps );
}
void SAL_CALL SwVbaRange::setLanguageID( ::sal_Int32 _languageid )
{
uno::Reference< beans::XPropertySet > xParaProps( mxTextCursor, uno::UNO_QUERY_THROW );
- SwVbaStyle::setLanguageID( xParaProps, _languageid );
+ SwVbaStyle::setLanguageID( xParaProps, LanguageType(_languageid) );
}
uno::Any SAL_CALL
diff --git a/sw/source/ui/vba/vbastyle.cxx b/sw/source/ui/vba/vbastyle.cxx
index 663f0be39a43..7fc026d2f3c3 100644
--- a/sw/source/ui/vba/vbastyle.cxx
+++ b/sw/source/ui/vba/vbastyle.cxx
@@ -48,27 +48,27 @@ SwVbaStyle::getName()
return mxStyle->getName();
}
-sal_Int32 SwVbaStyle::getLanguageID( const uno::Reference< beans::XPropertySet >& xTCProps )
+LanguageType SwVbaStyle::getLanguageID( const uno::Reference< beans::XPropertySet >& xTCProps )
{
lang::Locale aLocale;
xTCProps->getPropertyValue("CharLocale") >>= aLocale;
return LanguageTag::convertToLanguageType( aLocale, false);
}
-void SwVbaStyle::setLanguageID( const uno::Reference< beans::XPropertySet >& xTCProps, sal_Int32 _languageid )
+void SwVbaStyle::setLanguageID( const uno::Reference< beans::XPropertySet >& xTCProps, LanguageType _languageid )
{
- lang::Locale aLocale = LanguageTag( static_cast<LanguageType>(_languageid) ).getLocale();
+ lang::Locale aLocale = LanguageTag( _languageid ).getLocale();
xTCProps->setPropertyValue("CharLocale", uno::makeAny( aLocale ) ) ;
}
::sal_Int32 SAL_CALL SwVbaStyle::getLanguageID()
{
- return getLanguageID( mxStyleProps );
+ return (sal_uInt16)getLanguageID( mxStyleProps );
}
void SAL_CALL SwVbaStyle::setLanguageID( ::sal_Int32 _languageid )
{
- setLanguageID( mxStyleProps, _languageid );
+ setLanguageID( mxStyleProps, LanguageType(_languageid) );
}
::sal_Int32 SAL_CALL SwVbaStyle::getType()
diff --git a/sw/source/ui/vba/vbastyle.hxx b/sw/source/ui/vba/vbastyle.hxx
index 334fd7525fc8..21d94d3ed3d8 100644
--- a/sw/source/ui/vba/vbastyle.hxx
+++ b/sw/source/ui/vba/vbastyle.hxx
@@ -18,8 +18,10 @@
*/
#ifndef INCLUDED_SW_SOURCE_UI_VBA_VBASTYLE_HXX
#define INCLUDED_SW_SOURCE_UI_VBA_VBASTYLE_HXX
+
#include <ooo/vba/word/XStyle.hpp>
#include <vbahelper/vbahelperinterface.hxx>
+#include <i18nlangtag/lang.h>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
@@ -43,9 +45,9 @@ public:
/// @throws css::uno::RuntimeException
static void setStyle( const css::uno::Reference< css::beans::XPropertySet >& xParaProps, const css::uno::Any& xStyle );
/// @throws css::uno::RuntimeException
- static sal_Int32 getLanguageID( const css::uno::Reference< css::beans::XPropertySet >& xTCProps );
+ static LanguageType getLanguageID( const css::uno::Reference< css::beans::XPropertySet >& xTCProps );
/// @throws css::uno::RuntimeException
- static void setLanguageID( const css::uno::Reference< css::beans::XPropertySet >& xTCProps, sal_Int32 _languageid );
+ static void setLanguageID( const css::uno::Reference< css::beans::XPropertySet >& xTCProps, LanguageType _languageid );
// Attributes
virtual OUString SAL_CALL getName() override;
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index 958985974a94..a670ff8eb7a0 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -672,9 +672,9 @@ void SwDocShell::SubInitNew()
if (!utl::ConfigManager::IsAvoidConfig())
SvtLinguConfig().GetOptions(aLinguOpt);
- sal_Int16 nVal = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, css::i18n::ScriptType::LATIN),
- eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, css::i18n::ScriptType::ASIAN),
- eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, css::i18n::ScriptType::COMPLEX);
+ LanguageType nVal = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, css::i18n::ScriptType::LATIN),
+ eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, css::i18n::ScriptType::ASIAN),
+ eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, css::i18n::ScriptType::COMPLEX);
aDfltSet.Put( SvxLanguageItem( nVal, RES_CHRATR_LANGUAGE ) );
aDfltSet.Put( SvxLanguageItem( eCJK, RES_CHRATR_CJK_LANGUAGE ) );
aDfltSet.Put( SvxLanguageItem( eCTL, RES_CHRATR_CTL_LANGUAGE ) );
diff --git a/sw/source/uibase/config/fontcfg.cxx b/sw/source/uibase/config/fontcfg.cxx
index d6607b496eb9..31a02531bf3c 100644
--- a/sw/source/uibase/config/fontcfg.cxx
+++ b/sw/source/uibase/config/fontcfg.cxx
@@ -31,11 +31,11 @@
using namespace utl;
using namespace com::sun::star::uno;
-static inline LanguageType lcl_LanguageOfType(sal_Int16 nType, sal_Int16 eWestern, sal_Int16 eCJK, sal_Int16 eCTL)
+static inline LanguageType lcl_LanguageOfType(sal_Int16 nType, LanguageType eWestern, LanguageType eCJK, LanguageType eCTL)
{
- return LanguageType(
- nType < FONT_STANDARD_CJK ? eWestern :
- nType >= FONT_STANDARD_CTL ? eCTL : eCJK);
+ return nType < FONT_STANDARD_CJK
+ ? eWestern
+ : nType >= FONT_STANDARD_CTL ? eCTL : eCJK;
}
Sequence<OUString> SwStdFontConfig::GetPropertyNames()
@@ -95,9 +95,9 @@ SwStdFontConfig::SwStdFontConfig() :
if (!utl::ConfigManager::IsAvoidConfig())
SvtLinguConfig().GetOptions( aLinguOpt );
- sal_Int16 eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, css::i18n::ScriptType::LATIN),
- eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, css::i18n::ScriptType::ASIAN),
- eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, css::i18n::ScriptType::COMPLEX);
+ LanguageType eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, css::i18n::ScriptType::LATIN),
+ eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, css::i18n::ScriptType::ASIAN),
+ eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, css::i18n::ScriptType::COMPLEX);
for(sal_Int16 i = 0; i < DEF_FONT_COUNT; i++)
{
@@ -141,9 +141,9 @@ void SwStdFontConfig::ImplCommit()
SvtLinguConfig().GetOptions( aLinguOpt );
- sal_Int16 eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, css::i18n::ScriptType::LATIN),
- eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, css::i18n::ScriptType::ASIAN),
- eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, css::i18n::ScriptType::COMPLEX);
+ LanguageType eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, css::i18n::ScriptType::LATIN),
+ eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, css::i18n::ScriptType::ASIAN),
+ eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, css::i18n::ScriptType::COMPLEX);
for(sal_uInt16 nProp = 0;
nProp < sal::static_int_cast< sal_uInt16, sal_Int32 >( aNames.getLength() );
@@ -175,9 +175,9 @@ bool SwStdFontConfig::IsFontDefault(sal_uInt16 nFontType) const
if (!utl::ConfigManager::IsAvoidConfig())
SvtLinguConfig().GetOptions(aLinguOpt);
- sal_Int16 eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, css::i18n::ScriptType::LATIN),
- eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, css::i18n::ScriptType::ASIAN),
- eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, css::i18n::ScriptType::COMPLEX);
+ LanguageType eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, css::i18n::ScriptType::LATIN),
+ eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, css::i18n::ScriptType::ASIAN),
+ eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, css::i18n::ScriptType::COMPLEX);
OUString sDefFont(GetDefaultFor(FONT_STANDARD, eWestern));
OUString sDefFontCJK(GetDefaultFor(FONT_STANDARD_CJK, eCJK));
@@ -289,9 +289,9 @@ void SwStdFontConfig::ChangeInt( sal_uInt16 nFontType, sal_Int32 nHeight )
if (!utl::ConfigManager::IsAvoidConfig())
SvtLinguConfig().GetOptions( aLinguOpt );
- sal_Int16 eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, css::i18n::ScriptType::LATIN),
- eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, css::i18n::ScriptType::ASIAN),
- eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, css::i18n::ScriptType::COMPLEX);
+ LanguageType eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, css::i18n::ScriptType::LATIN),
+ eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, css::i18n::ScriptType::ASIAN),
+ eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, css::i18n::ScriptType::COMPLEX);
// #i92090# default height value sets back to -1
const sal_Int32 nDefaultHeight = GetDefaultHeightFor(nFontType, lcl_LanguageOfType(nFontType, eWestern, eCJK, eCTL));
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 1012e1896598..02edbcaeb0a5 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -384,7 +384,7 @@ static bool lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos)
static void lcl_GetColumnCnt(SwDSParam *pParam,
const uno::Reference< beans::XPropertySet > &rColumnProps,
- long nLanguage, OUString &rResult, double* pNumber)
+ LanguageType nLanguage, OUString &rResult, double* pNumber)
{
SwDBFormatData aFormatData;
if(!pParam->xFormatter.is())
@@ -396,13 +396,13 @@ static void lcl_GetColumnCnt(SwDSParam *pParam,
aFormatData.aNullDate = pParam->aNullDate;
aFormatData.xFormatter = pParam->xFormatter;
- aFormatData.aLocale = LanguageTag( (LanguageType)nLanguage ).getLocale();
+ aFormatData.aLocale = LanguageTag( nLanguage ).getLocale();
rResult = SwDBManager::GetDBField( rColumnProps, aFormatData, pNumber);
}
static bool lcl_GetColumnCnt(SwDSParam* pParam, const OUString& rColumnName,
- long nLanguage, OUString& rResult, double* pNumber)
+ LanguageType nLanguage, OUString& rResult, double* pNumber)
{
uno::Reference< sdbcx::XColumnsSupplier > xColsSupp( pParam->xResultSet, uno::UNO_QUERY );
uno::Reference<container::XNameAccess> xCols;
@@ -1689,7 +1689,7 @@ sal_uLong SwDBManager::GetColumnFormat( const OUString& rDBName,
const OUString& rTableName,
const OUString& rColNm,
SvNumberFormatter* pNFormatr,
- long nLanguage )
+ LanguageType nLanguage )
{
sal_uLong nRet = 0;
if(pNFormatr)
@@ -1768,7 +1768,7 @@ sal_uLong SwDBManager::GetColumnFormat( uno::Reference< sdbc::XDataSource> const
uno::Reference< sdbc::XConnection> const & xConnection,
uno::Reference< beans::XPropertySet> const & xColumn,
SvNumberFormatter* pNFormatr,
- long nLanguage )
+ LanguageType nLanguage )
{
auto xSource = xSource_in;
@@ -1788,7 +1788,7 @@ sal_uLong SwDBManager::GetColumnFormat( uno::Reference< sdbc::XDataSource> const
uno::Reference< util::XNumberFormats > xDocNumberFormats = xDocNumFormatsSupplier->getNumberFormats();
uno::Reference< util::XNumberFormatTypes > xDocNumberFormatTypes(xDocNumberFormats, uno::UNO_QUERY);
- css::lang::Locale aLocale( LanguageTag( (LanguageType)nLanguage ).getLocale());
+ css::lang::Locale aLocale( LanguageTag( nLanguage ).getLocale());
//get the number formatter of the data source
uno::Reference<beans::XPropertySet> xSourceProps(xSource, uno::UNO_QUERY);
@@ -2061,7 +2061,7 @@ bool SwDBManager::IsDataSourceOpen(const OUString& rDataSource,
// read column data at a specified position
bool SwDBManager::GetColumnCnt(const OUString& rSourceName, const OUString& rTableName,
const OUString& rColumnName, sal_uInt32 nAbsRecordId,
- long nLanguage,
+ LanguageType nLanguage,
OUString& rResult, double* pNumber)
{
bool bRet = false;
@@ -2123,7 +2123,7 @@ bool SwDBManager::GetColumnCnt(const OUString& rSourceName, const OUString& rTab
}
// reads the column data at the current position
-bool SwDBManager::GetMergeColumnCnt(const OUString& rColumnName, sal_uInt16 nLanguage,
+bool SwDBManager::GetMergeColumnCnt(const OUString& rColumnName, LanguageType nLanguage,
OUString &rResult, double *pNumber)
{
if( !IsValidMergeRecord() )
@@ -2143,7 +2143,7 @@ bool SwDBManager::ToNextMergeRecord()
}
bool SwDBManager::FillCalcWithMergeData( SvNumberFormatter *pDocFormatter,
- sal_uInt16 nLanguage, SwCalc &rCalc )
+ LanguageType nLanguage, SwCalc &rCalc )
{
if( !IsValidMergeRecord() )
return false;
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx
index 253872f847d9..e16e3ac21b36 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -1318,7 +1318,7 @@ bool SwFieldMgr::InsertField(
//the auto language flag has to be set prior to the language!
pField->SetAutomaticLanguage(rData.m_bIsAutomaticLanguage);
- sal_uInt16 nLang = GetCurrLanguage();
+ LanguageType nLang = GetCurrLanguage();
pField->SetLanguage(nLang);
// insert
@@ -1544,7 +1544,7 @@ void SwFieldMgr::EvalExpFields(SwWrtShell* pSh)
pSh->EndAllAction();
}
}
-sal_uInt16 SwFieldMgr::GetCurrLanguage() const
+LanguageType SwFieldMgr::GetCurrLanguage() const
{
SwWrtShell* pSh = pWrtShell ? pWrtShell : ::lcl_GetShell();
if( pSh )
diff --git a/sw/source/uibase/inc/fldmgr.hxx b/sw/source/uibase/inc/fldmgr.hxx
index 25193aafa835..6302a84355c2 100644
--- a/sw/source/uibase/inc/fldmgr.hxx
+++ b/sw/source/uibase/inc/fldmgr.hxx
@@ -108,7 +108,7 @@ private:
sal_uLong nCurFormat;
bool bEvalExp;
- SAL_DLLPRIVATE sal_uInt16 GetCurrLanguage() const;
+ SAL_DLLPRIVATE LanguageType GetCurrLanguage() const;
css::uno::Reference<css::text::XNumberingTypeInfo> xNumberingInfo;
SAL_DLLPRIVATE css::uno::Reference<css::text::XNumberingTypeInfo> const & GetNumberingInfo()const;
diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx
index ef30e272192a..c375865d9365 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -743,7 +743,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
} else {
OUString sWord(m_xSpellAlt->getWord());
linguistic::DictionaryError nAddRes = linguistic::AddEntryToDic( xDictionary,
- sWord, false, OUString(), LANGUAGE_NONE );
+ sWord, false, OUString() );
if (linguistic::DictionaryError::NONE != nAddRes && !xDictionary->getEntry(sWord).is())
{
SvxDicError(&m_pSh->GetView().GetViewFrame()->GetWindow(), nAddRes);
@@ -770,7 +770,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
if (xDic.is())
{
- linguistic::DictionaryError nAddRes = linguistic::AddEntryToDic(xDic, sWord, false, OUString(), LANGUAGE_NONE);
+ linguistic::DictionaryError nAddRes = linguistic::AddEntryToDic(xDic, sWord, false, OUString());
// save modified user-dictionary if it is persistent
uno::Reference< frame::XStorable > xSavDic( xDic, uno::UNO_QUERY );
if (xSavDic.is())
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index a4a3c8f78204..1de04845a67c 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -1324,9 +1324,9 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq)
}
//execute translation
- sal_Int16 nSourceLang = bToSimplified ? LANGUAGE_CHINESE_TRADITIONAL : LANGUAGE_CHINESE_SIMPLIFIED;
- sal_Int16 nTargetLang = bToSimplified ? LANGUAGE_CHINESE_SIMPLIFIED : LANGUAGE_CHINESE_TRADITIONAL;
- sal_Int32 nOptions = bUseVariants ? i18n::TextConversionOption::USE_CHARACTER_VARIANTS : 0;
+ LanguageType nSourceLang = bToSimplified ? LANGUAGE_CHINESE_TRADITIONAL : LANGUAGE_CHINESE_SIMPLIFIED;
+ LanguageType nTargetLang = bToSimplified ? LANGUAGE_CHINESE_SIMPLIFIED : LANGUAGE_CHINESE_TRADITIONAL;
+ sal_Int32 nOptions = bUseVariants ? i18n::TextConversionOption::USE_CHARACTER_VARIANTS : 0;
if( !bCommonTerms )
nOptions = nOptions | i18n::TextConversionOption::CHARACTER_BY_CHARACTER;
diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx
index af9becb17a1b..da1cf8147b5e 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -337,9 +337,9 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq)
}
//execute translation
- sal_Int16 nSourceLang = bToSimplified ? LANGUAGE_CHINESE_TRADITIONAL : LANGUAGE_CHINESE_SIMPLIFIED;
- sal_Int16 nTargetLang = bToSimplified ? LANGUAGE_CHINESE_SIMPLIFIED : LANGUAGE_CHINESE_TRADITIONAL;
- sal_Int32 nOptions = bUseVariants ? i18n::TextConversionOption::USE_CHARACTER_VARIANTS : 0;
+ LanguageType nSourceLang = bToSimplified ? LANGUAGE_CHINESE_TRADITIONAL : LANGUAGE_CHINESE_SIMPLIFIED;
+ LanguageType nTargetLang = bToSimplified ? LANGUAGE_CHINESE_SIMPLIFIED : LANGUAGE_CHINESE_TRADITIONAL;
+ sal_Int32 nOptions = bUseVariants ? i18n::TextConversionOption::USE_CHARACTER_VARIANTS : 0;
if(!bCommonTerms)
nOptions = nOptions | i18n::TextConversionOption::CHARACTER_BY_CHARACTER;
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index a55d4ee19017..3accf548d0da 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -159,9 +159,9 @@ void SwView::ExecLingu(SfxRequest &rReq)
}
//execute translation
- sal_Int16 nSourceLang = bToSimplified ? LANGUAGE_CHINESE_TRADITIONAL : LANGUAGE_CHINESE_SIMPLIFIED;
- sal_Int16 nTargetLang = bToSimplified ? LANGUAGE_CHINESE_SIMPLIFIED : LANGUAGE_CHINESE_TRADITIONAL;
- sal_Int32 nOptions = bUseVariants ? i18n::TextConversionOption::USE_CHARACTER_VARIANTS : 0;
+ LanguageType nSourceLang = bToSimplified ? LANGUAGE_CHINESE_TRADITIONAL : LANGUAGE_CHINESE_SIMPLIFIED;
+ LanguageType nTargetLang = bToSimplified ? LANGUAGE_CHINESE_SIMPLIFIED : LANGUAGE_CHINESE_TRADITIONAL;
+ sal_Int32 nOptions = bUseVariants ? i18n::TextConversionOption::USE_CHARACTER_VARIANTS : 0;
if( !bCommonTerms )
nOptions = nOptions | i18n::TextConversionOption::CHARACTER_BY_CHARACTER;