diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-15 09:36:39 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-04-17 07:21:08 +0000 |
commit | a7b7c64afc523cfd9ff4e724b3efbec6567fc1c8 (patch) | |
tree | 52fd05ef3292f3dab172864cbc3be96a8d44a9d0 /sc | |
parent | add7eeb7dbd0eefa0c5ae5430490864079add801 (diff) |
convert SCRIPTTYPE_ constants to scoped enum
Change-Id: I5be3980ac865162d8d7626556ca47eca4b0ee433
Reviewed-on: https://gerrit.libreoffice.org/15344
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sc')
42 files changed, 198 insertions, 220 deletions
diff --git a/sc/inc/celltextattr.hxx b/sc/inc/celltextattr.hxx index 9e4675d0e3c3..d10274c06f60 100644 --- a/sc/inc/celltextattr.hxx +++ b/sc/inc/celltextattr.hxx @@ -11,13 +11,14 @@ #define INCLUDED_SC_CELLTEXTATTR_HXX #include <sal/types.h> +#include <svl/languageoptions.hxx> namespace sc { struct CellTextAttr { - sal_uInt16 mnTextWidth; - sal_uInt8 mnScriptType; + sal_uInt16 mnTextWidth; + SvtScriptType mnScriptType; CellTextAttr(); CellTextAttr(const CellTextAttr& r); diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 8d0db5788669..d7bc4be8a5c7 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -120,7 +120,7 @@ class ScColumn // must have non-empty elements. For text width, the value should be // either the real text width, or TEXTWIDTH_DIRTY in case it hasn't been // calculated yet. For script type, it should be either the real script - // type value or SC_SCRIPTTYPE_UNKNOWN. + // type value or SvtScriptType::UNKNOWN. sc::CellTextAttrStoreType maCellTextAttrs; // Cell notes @@ -544,16 +544,16 @@ public: sal_uInt16 GetTextWidth(SCROW nRow) const; void SetTextWidth(SCROW nRow, sal_uInt16 nWidth); - sal_uInt8 GetScriptType( SCROW nRow ) const; + SvtScriptType GetScriptType( SCROW nRow ) const; /** * Get combined script types of the specified range. This method may * update script types on demand if they have not been determined. */ - sal_uInt8 GetRangeScriptType( sc::CellTextAttrStoreType::iterator& itPos, SCROW nRow1, SCROW nRow2, + SvtScriptType GetRangeScriptType( sc::CellTextAttrStoreType::iterator& itPos, SCROW nRow1, SCROW nRow2, const sc::CellStoreType::iterator& itr); - void SetScriptType( SCROW nRow, sal_uInt8 nType ); + void SetScriptType( SCROW nRow, SvtScriptType nType ); void UpdateScriptTypes( SCROW nRow1, SCROW nRow2 ); size_t GetFormulaHash( SCROW nRow ) const; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index b88ffecbc56c..bf9f078fbadd 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -50,6 +50,7 @@ #include "markdata.hxx" +enum class SvtScriptType; namespace editeng { class SvxBorderLine; } namespace formula { struct VectorRefArray; } namespace svl { @@ -1411,12 +1412,12 @@ public: SC_DLLPUBLIC const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >& GetBreakIterator(); bool HasStringWeakCharacters( const OUString& rString ); - SC_DLLPUBLIC sal_uInt8 GetStringScriptType( const OUString& rString ); - SC_DLLPUBLIC sal_uInt8 GetCellScriptType( const ScAddress& rPos, sal_uLong nNumberFormat ); - SC_DLLPUBLIC sal_uInt8 GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab ); - sal_uInt8 GetRangeScriptType( + SC_DLLPUBLIC SvtScriptType GetStringScriptType( const OUString& rString ); + SC_DLLPUBLIC SvtScriptType GetCellScriptType( const ScAddress& rPos, sal_uLong nNumberFormat ); + SC_DLLPUBLIC SvtScriptType GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab ); + SvtScriptType GetRangeScriptType( sc::ColumnBlockPosition& rBlockPos, const ScAddress& rPos, SCROW nLength ); - sal_uInt8 GetRangeScriptType( const ScRangeList& rRanges ); + SvtScriptType GetRangeScriptType( const ScRangeList& rRanges ); bool HasDetectiveOperations() const; void AddDetectiveOperation( const ScDetOpData& rData ); @@ -2108,8 +2109,8 @@ public: sal_uInt16 GetTextWidth( const ScAddress& rPos ) const; - sal_uInt8 GetScriptType( const ScAddress& rPos ) const; - void SetScriptType( const ScAddress& rPos, sal_uInt8 nType ); + SvtScriptType GetScriptType( const ScAddress& rPos ) const; + void SetScriptType( const ScAddress& rPos, SvtScriptType nType ); void UpdateScriptTypes( const ScAddress& rPos, SCCOL nColSize, SCROW nRowSize ); size_t GetFormulaHash( const ScAddress& rPos ) const; diff --git a/sc/inc/documentimport.hxx b/sc/inc/documentimport.hxx index e561fcdb9e34..aa694584216e 100644 --- a/sc/inc/documentimport.hxx +++ b/sc/inc/documentimport.hxx @@ -28,6 +28,7 @@ class ScStyleSheet; struct ScSetStringParam; struct ScTabOpParam; struct ScDocumentImportImpl; +enum class SvtScriptType; /** * Accessor class to ScDocument. Its purpose is to allow import filter to @@ -60,7 +61,7 @@ public: ScDocument& getDoc(); const ScDocument& getDoc() const; - void setDefaultNumericScript(sal_uInt16 nScript); + void setDefaultNumericScript(SvtScriptType nScript); /** * Apply specified cell style to an entire sheet. diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index f8555b4c0609..b95faf5cd305 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -34,6 +34,7 @@ class ImageList; class Bitmap; class SfxItemSet; class Color; +enum class SvtScriptType; #define SC_COLLATOR_IGNORES ( \ ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE ) @@ -689,11 +690,11 @@ SC_DLLPUBLIC static const sal_Unicode* FindUnquoted( const sal_Unicode* pStri static bool IsSystemRTL(); // depending on system language static LanguageType GetEditDefaultLanguage(); // for EditEngine::SetDefaultLanguage - SC_DLLPUBLIC static sal_uInt8 GetDefaultScriptType(); // for all WEAK characters + SC_DLLPUBLIC static SvtScriptType GetDefaultScriptType(); // for all WEAK characters /** Map ATTR_((CJK|CTL)_)?FONT_... to proper WhichIDs. - If more than one SCRIPTTYPE_... values are or'ed together, prefers + If more than one SvtScriptType::... values are or'ed together, prefers first COMPLEX, then ASIAN */ - SC_DLLPUBLIC static sal_uInt16 GetScriptedWhichID( sal_uInt8 nScriptType, sal_uInt16 nWhich ); + SC_DLLPUBLIC static sal_uInt16 GetScriptedWhichID( SvtScriptType nScriptType, sal_uInt16 nWhich ); /** Adds a language item to the item set, if the number format item contains a language that differs from its parent's language. */ diff --git a/sc/inc/globalnames.hxx b/sc/inc/globalnames.hxx index dd800aa9d80b..fb4c2dad4e2b 100644 --- a/sc/inc/globalnames.hxx +++ b/sc/inc/globalnames.hxx @@ -19,10 +19,6 @@ #define DATE_TIME_FACTOR 86400.0 -// in addition to SCRIPTTYPE_... flags from scripttypeitem.hxx: -// set (in nScriptType) if type has not been determined yet -#define SC_SCRIPTTYPE_UNKNOWN 0x08 - // Device name used to represent the software group interpreter for OpenCL // mode. This string gets stored in use configuration as the device name. #define OPENCL_SOFTWARE_DEVICE_CONFIG_NAME "Software" diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx index cbc37d1034fe..efb2a67c9ad8 100644 --- a/sc/inc/patattr.hxx +++ b/sc/inc/patattr.hxx @@ -22,6 +22,7 @@ #include <svl/poolitem.hxx> #include <svl/itemset.hxx> +#include <svl/languageoptions.hxx> #include <unotools/fontcvt.hxx> #include <editeng/svxenum.hxx> #include "scdllapi.h" @@ -86,16 +87,16 @@ public: OutputDevice* pOutDev = NULL, const Fraction* pScale = NULL, const SfxItemSet* pCondSet = NULL, - sal_uInt8 nScript = 0, const Color* pBackConfigColor = NULL, + SvtScriptType nScript = SvtScriptType::NONE, const Color* pBackConfigColor = NULL, const Color* pTextConfigColor = NULL ); - static ScDxfFont GetDxfFont(const SfxItemSet& rSet, sal_uInt8 nScript); + static ScDxfFont GetDxfFont(const SfxItemSet& rSet, SvtScriptType nScript); /** Fills a font object from the own item set. */ void GetFont( vcl::Font& rFont, ScAutoFontColorMode eAutoMode, OutputDevice* pOutDev = NULL, const Fraction* pScale = NULL, const SfxItemSet* pCondSet = NULL, - sal_uInt8 nScript = 0, const Color* pBackConfigColor = NULL, + SvtScriptType nScript = SvtScriptType::NONE, const Color* pBackConfigColor = NULL, const Color* pTextConfigColor = NULL ) const; /** Converts all Calc items contained in rSrcSet to edit engine items and puts them into rEditSet. */ diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index e6857f2d1fca..d50bd5bc5995 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -899,11 +899,11 @@ public: sal_uLong AddCondFormat( ScConditionalFormat* pNew ); - sal_uInt8 GetScriptType( SCCOL nCol, SCROW nRow ) const; - void SetScriptType( SCCOL nCol, SCROW nRow, sal_uInt8 nType ); + SvtScriptType GetScriptType( SCCOL nCol, SCROW nRow ) const; + void SetScriptType( SCCOL nCol, SCROW nRow, SvtScriptType nType ); void UpdateScriptTypes( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ); - sal_uInt8 GetRangeScriptType( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol, SCROW nRow1, SCROW nRow2 ); + SvtScriptType GetRangeScriptType( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol, SCROW nRow1, SCROW nRow2 ); size_t GetFormulaHash( SCCOL nCol, SCROW nRow ) const; diff --git a/sc/qa/unit/ucalc_column.cxx b/sc/qa/unit/ucalc_column.cxx index 394738d29dd5..6b9ca51c2746 100644 --- a/sc/qa/unit/ucalc_column.cxx +++ b/sc/qa/unit/ucalc_column.cxx @@ -73,9 +73,9 @@ void Test::testColumnFindEditCells() m_pDoc->SetString(ScAddress(1,12,0), "Some text"); m_pDoc->SetString(ScAddress(1,13,0), "Other text"); - m_pDoc->SetScriptType(ScAddress(1,11,0), (SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN)); - m_pDoc->SetScriptType(ScAddress(1,12,0), (SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN)); - m_pDoc->SetScriptType(ScAddress(1,13,0), (SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN)); + m_pDoc->SetScriptType(ScAddress(1,11,0), (SvtScriptType::LATIN | SvtScriptType::ASIAN)); + m_pDoc->SetScriptType(ScAddress(1,12,0), (SvtScriptType::LATIN | SvtScriptType::ASIAN)); + m_pDoc->SetScriptType(ScAddress(1,13,0), (SvtScriptType::LATIN | SvtScriptType::ASIAN)); nResRow = m_pDoc->GetFirstEditTextRow(ScAddress(1,11,0)); CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(11), nResRow); @@ -85,7 +85,7 @@ void Test::testColumnFindEditCells() for (SCROW i = 0; i <= 5; ++i) m_pDoc->SetString(ScAddress(2,i,0), "Text"); - m_pDoc->SetScriptType(ScAddress(2,5,0), (SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN)); + m_pDoc->SetScriptType(ScAddress(2,5,0), (SvtScriptType::LATIN | SvtScriptType::ASIAN)); nResRow = m_pDoc->GetFirstEditTextRow(ScAddress(2,1,0)); CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(-1), nResRow); diff --git a/sc/source/core/data/celltextattr.cxx b/sc/source/core/data/celltextattr.cxx index 5542813c7dca..5d792442b8af 100644 --- a/sc/source/core/data/celltextattr.cxx +++ b/sc/source/core/data/celltextattr.cxx @@ -14,7 +14,7 @@ namespace sc { CellTextAttr::CellTextAttr() : mnTextWidth(TEXTWIDTH_DIRTY), - mnScriptType(SC_SCRIPTTYPE_UNKNOWN) {} + mnScriptType(SvtScriptType::UNKNOWN) {} CellTextAttr::CellTextAttr(const CellTextAttr& r) : mnTextWidth(r.mnTextWidth), diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 3fcac83163d4..8b6ede97051f 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -64,13 +64,13 @@ using namespace formula; namespace { -inline bool IsAmbiguousScriptNonZero( sal_uInt8 nScript ) +inline bool IsAmbiguousScriptNonZero( SvtScriptType nScript ) { //TODO: move to a header file - return ( nScript != SCRIPTTYPE_LATIN && - nScript != SCRIPTTYPE_ASIAN && - nScript != SCRIPTTYPE_COMPLEX && - nScript != 0 ); + return ( nScript != SvtScriptType::LATIN && + nScript != SvtScriptType::ASIAN && + nScript != SvtScriptType::COMPLEX && + nScript != SvtScriptType::NONE ); } } @@ -2929,7 +2929,7 @@ public: { // With a formula cell, it's considered an edit text cell when either // the result is multi-line or it has more than one script types. - sal_uInt8 nScriptType = mrColumn.GetRangeScriptType(miAttrPos, nRow, nRow, miCellPos); + SvtScriptType nScriptType = mrColumn.GetRangeScriptType(miAttrPos, nRow, nRow, miCellPos); if (IsAmbiguousScriptNonZero(nScriptType)) return true; @@ -2952,7 +2952,7 @@ public: for (size_t i = 0; i < nDataSize; ++i) { SCROW nRow = node.position + i + nOffset; - sal_uInt8 nScriptType = mrColumn.GetRangeScriptType(miAttrPos, nRow, nRow, miCellPos); + SvtScriptType nScriptType = mrColumn.GetRangeScriptType(miAttrPos, nRow, nRow, miCellPos); if (IsAmbiguousScriptNonZero(nScriptType)) // Return the offset from the first row. return RetType(i+nOffset, true); diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index ef6c073f5ecd..930107889bfe 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -71,12 +71,12 @@ // factor from font size to optimal cell height (text width) #define SC_ROT_BREAK_FACTOR 6 -inline bool IsAmbiguousScript( sal_uInt8 nScript ) +inline bool IsAmbiguousScript( SvtScriptType nScript ) { //TODO: move to a header file - return ( nScript != SCRIPTTYPE_LATIN && - nScript != SCRIPTTYPE_ASIAN && - nScript != SCRIPTTYPE_COMPLEX ); + return ( nScript != SvtScriptType::LATIN && + nScript != SvtScriptType::ASIAN && + nScript != SvtScriptType::COMPLEX ); } // Data operations @@ -233,8 +233,8 @@ long ScColumn::GetNeededSize( nIndent = static_cast<const SfxUInt16Item&>(pPattern->GetItem(ATTR_INDENT)).GetValue(); } - sal_uInt8 nScript = pDocument->GetScriptType(nCol, nRow, nTab); - if (nScript == 0) nScript = ScGlobal::GetDefaultScriptType(); + SvtScriptType nScript = pDocument->GetScriptType(nCol, nRow, nTab); + if (nScript == SvtScriptType::NONE) nScript = ScGlobal::GetDefaultScriptType(); // also call SetFont for edit cells, because bGetFont may be set only once // bGetFont is set also if script type changes @@ -682,7 +682,7 @@ sal_uInt16 ScColumn::GetOptimalColWidth( ScNeededSizeOptions aOptions; aOptions.bFormula = bFormula; const ScPatternAttr* pOldPattern = NULL; - sal_uInt8 nOldScript = 0; + SvtScriptType nOldScript = SvtScriptType::NONE; // Go though all non-empty cells within selection. sc::CellStoreType::const_iterator itPos = maCells.begin(); @@ -704,8 +704,8 @@ sal_uInt16 ScColumn::GetOptimalColWidth( for (size_t nOffset = aPos.second; nOffset < itPos->size; ++nOffset, ++nRow) { - sal_uInt8 nScript = pDocument->GetScriptType(nCol, nRow, nTab); - if (nScript == 0) + SvtScriptType nScript = pDocument->GetScriptType(nCol, nRow, nTab); + if (nScript == SvtScriptType::NONE) nScript = ScGlobal::GetDefaultScriptType(); const ScPatternAttr* pPattern = GetPattern(nRow); @@ -850,10 +850,10 @@ void ScColumn::GetOptimalHeight( sal_uInt16 nCjkHeight = 0; sal_uInt16 nCtlHeight = 0; sal_uInt16 nDefHeight; - sal_uInt8 nDefScript = ScGlobal::GetDefaultScriptType(); - if ( nDefScript == SCRIPTTYPE_ASIAN ) + SvtScriptType nDefScript = ScGlobal::GetDefaultScriptType(); + if ( nDefScript == SvtScriptType::ASIAN ) nDefHeight = nCjkHeight = lcl_GetAttribHeight( *pPattern, ATTR_CJK_FONT_HEIGHT ); - else if ( nDefScript == SCRIPTTYPE_COMPLEX ) + else if ( nDefScript == SvtScriptType::COMPLEX ) nDefHeight = nCtlHeight = lcl_GetAttribHeight( *pPattern, ATTR_CTL_FONT_HEIGHT ); else nDefHeight = nLatHeight = lcl_GetAttribHeight( *pPattern, ATTR_FONT_HEIGHT ); @@ -879,18 +879,18 @@ void ScColumn::GetOptimalHeight( { for (SCROW nRow = it->mnRow1; nRow <= it->mnRow2; ++nRow) { - sal_uInt8 nScript = GetRangeScriptType(itAttr, nRow, nRow, itCells); + SvtScriptType nScript = GetRangeScriptType(itAttr, nRow, nRow, itCells); if (nScript == nDefScript) continue; - if ( nScript == SCRIPTTYPE_ASIAN ) + if ( nScript == SvtScriptType::ASIAN ) { if ( nCjkHeight == 0 ) nCjkHeight = lcl_GetAttribHeight( *pPattern, ATTR_CJK_FONT_HEIGHT ); if (nCjkHeight > rHeights[nRow-nStartRow]) rHeights[nRow-nStartRow] = nCjkHeight; } - else if ( nScript == SCRIPTTYPE_COMPLEX ) + else if ( nScript == SvtScriptType::COMPLEX ) { if ( nCtlHeight == 0 ) nCtlHeight = lcl_GetAttribHeight( *pPattern, ATTR_CTL_FONT_HEIGHT ); @@ -1865,19 +1865,19 @@ void ScColumn::SetTextWidth(SCROW nRow, sal_uInt16 nWidth) CellStorageModified(); } -sal_uInt8 ScColumn::GetScriptType( SCROW nRow ) const +SvtScriptType ScColumn::GetScriptType( SCROW nRow ) const { if (!ValidRow(nRow) || maCellTextAttrs.is_empty(nRow)) - return 0; + return SvtScriptType::NONE; return maCellTextAttrs.get<sc::CellTextAttr>(nRow).mnScriptType; } -sal_uInt8 ScColumn::GetRangeScriptType( +SvtScriptType ScColumn::GetRangeScriptType( sc::CellTextAttrStoreType::iterator& itPos, SCROW nRow1, SCROW nRow2, const sc::CellStoreType::iterator& itrCells ) { if (!ValidRow(nRow1) || !ValidRow(nRow2) || nRow1 > nRow2) - return 0; + return SvtScriptType::NONE; SCROW nRow = nRow1; std::pair<sc::CellTextAttrStoreType::iterator,size_t> aRet = @@ -1885,7 +1885,7 @@ sal_uInt8 ScColumn::GetRangeScriptType( itPos = aRet.first; // Track the position of cell text attribute array. - sal_uInt8 nScriptType = 0; + SvtScriptType nScriptType = SvtScriptType::NONE; bool bUpdated = false; if (itPos->type == sc::element_type_celltextattr) { @@ -1943,7 +1943,7 @@ sal_uInt8 ScColumn::GetRangeScriptType( return nScriptType; } -void ScColumn::SetScriptType( SCROW nRow, sal_uInt8 nType ) +void ScColumn::SetScriptType( SCROW nRow, SvtScriptType nType ) { if (!ValidRow(nRow)) return; diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 4c0bf2a51249..890a1dbc429a 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -492,7 +492,7 @@ void ScColumn::BroadcastNewCell( SCROW nRow ) bool ScColumn::UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow, const sc::CellStoreType::iterator& itr ) { - if (rAttr.mnScriptType != SC_SCRIPTTYPE_UNKNOWN) + if (rAttr.mnScriptType != SvtScriptType::UNKNOWN) // Already updated. Nothing to do. return false; diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index d8c10abcc49e..46b59c04b6a0 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -904,7 +904,7 @@ private: return; sc::CellTextAttr& rAttr = sc::celltextattr_block::at(*aAttrPos.first->data, aAttrPos.second); - if (rAttr.mnScriptType != SC_SCRIPTTYPE_UNKNOWN) + if (rAttr.mnScriptType != SvtScriptType::UNKNOWN) // Script type already deteremined. Skip it. return; diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx index 772b8b8e6068..8b6009df4b05 100644 --- a/sc/source/core/data/documen6.cxx +++ b/sc/source/core/data/documen6.cxx @@ -76,10 +76,9 @@ bool ScDocument::HasStringWeakCharacters( const OUString& rString ) return false; // none found } -sal_uInt8 ScDocument::GetStringScriptType( const OUString& rString ) +SvtScriptType ScDocument::GetStringScriptType( const OUString& rString ) { - - sal_uInt8 nRet = 0; + SvtScriptType nRet = SvtScriptType::NONE; if (!rString.isEmpty()) { uno::Reference<i18n::XBreakIterator> xBreakIter = GetBreakIterator(); @@ -94,13 +93,13 @@ sal_uInt8 ScDocument::GetStringScriptType( const OUString& rString ) switch ( nType ) { case i18n::ScriptType::LATIN: - nRet |= SCRIPTTYPE_LATIN; + nRet |= SvtScriptType::LATIN; break; case i18n::ScriptType::ASIAN: - nRet |= SCRIPTTYPE_ASIAN; + nRet |= SvtScriptType::ASIAN; break; case i18n::ScriptType::COMPLEX: - nRet |= SCRIPTTYPE_COMPLEX; + nRet |= SvtScriptType::COMPLEX; break; // WEAK is ignored } @@ -112,35 +111,35 @@ sal_uInt8 ScDocument::GetStringScriptType( const OUString& rString ) return nRet; } -sal_uInt8 ScDocument::GetCellScriptType( const ScAddress& rPos, sal_uLong nNumberFormat ) +SvtScriptType ScDocument::GetCellScriptType( const ScAddress& rPos, sal_uLong nNumberFormat ) { - sal_uInt8 nStored = GetScriptType(rPos); - if ( nStored != SC_SCRIPTTYPE_UNKNOWN ) // stored value valid? + SvtScriptType nStored = GetScriptType(rPos); + if ( nStored != SvtScriptType::UNKNOWN ) // stored value valid? return nStored; // use stored value Color* pColor; OUString aStr = ScCellFormat::GetString(*this, rPos, nNumberFormat, &pColor, *xPoolHelper->GetFormTable()); - sal_uInt8 nRet = GetStringScriptType( aStr ); + SvtScriptType nRet = GetStringScriptType( aStr ); SetScriptType(rPos, nRet); // store for later calls return nRet; } -sal_uInt8 ScDocument::GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab ) +SvtScriptType ScDocument::GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab ) { // if script type is set, don't have to get number formats ScAddress aPos(nCol, nRow, nTab); - sal_uInt8 nStored = GetScriptType(aPos); - if ( nStored != SC_SCRIPTTYPE_UNKNOWN ) // stored value valid? + SvtScriptType nStored = GetScriptType(aPos); + if ( nStored != SvtScriptType::UNKNOWN ) // stored value valid? return nStored; // use stored value // include number formats from conditional formatting const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab ); - if (!pPattern) return 0; + if (!pPattern) return SvtScriptType::NONE; const SfxItemSet* pCondSet = NULL; if ( !static_cast<const ScCondFormatItem&>(pPattern->GetItem(ATTR_CONDITIONAL)).GetCondFormatData().empty() ) pCondSet = GetCondResult( nCol, nRow, nTab ); @@ -156,10 +155,10 @@ class ScriptTypeAggregator : public sc::ColumnSpanSet::Action { ScDocument& mrDoc; sc::ColumnBlockPosition maBlockPos; - sal_uInt8 mnScriptType; + SvtScriptType mnScriptType; public: - ScriptTypeAggregator(ScDocument& rDoc) : mrDoc(rDoc), mnScriptType(0) {} + ScriptTypeAggregator(ScDocument& rDoc) : mrDoc(rDoc), mnScriptType(SvtScriptType::NONE) {} virtual void startColumn(SCTAB nTab, SCCOL nCol) SAL_OVERRIDE { @@ -174,21 +173,21 @@ public: mnScriptType |= mrDoc.GetRangeScriptType(maBlockPos, rPos, nLength); }; - sal_uInt8 getScriptType() const { return mnScriptType; } + SvtScriptType getScriptType() const { return mnScriptType; } }; } -sal_uInt8 ScDocument::GetRangeScriptType( +SvtScriptType ScDocument::GetRangeScriptType( sc::ColumnBlockPosition& rBlockPos, const ScAddress& rPos, SCROW nLength ) { if (!TableExists(rPos.Tab())) - return 0; + return SvtScriptType::NONE; return maTabs[rPos.Tab()]->GetRangeScriptType(rBlockPos, rPos.Col(), rPos.Row(), rPos.Row()+nLength-1); } -sal_uInt8 ScDocument::GetRangeScriptType( const ScRangeList& rRanges ) +SvtScriptType ScDocument::GetRangeScriptType( const ScRangeList& rRanges ) { sc::ColumnSpanSet aSet(false); for (size_t i = 0, n = rRanges.size(); i < n; ++i) diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index dc023bb7ad21..3c82d65eccd7 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -1294,9 +1294,9 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp if ( bConsiderLanguage ) { - sal_uInt8 nScript = GetStringScriptType( aOldStr ); //TODO: cell script type? - sal_uInt16 nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? ATTR_CJK_FONT_LANGUAGE : - ( ( nScript == SCRIPTTYPE_COMPLEX ) ? ATTR_CTL_FONT_LANGUAGE : + SvtScriptType nScript = GetStringScriptType( aOldStr ); //TODO: cell script type? + sal_uInt16 nWhich = ( nScript == SvtScriptType::ASIAN ) ? ATTR_CJK_FONT_LANGUAGE : + ( ( nScript == SvtScriptType::COMPLEX ) ? ATTR_CTL_FONT_LANGUAGE : ATTR_FONT_LANGUAGE ); nLanguage = static_cast<const SvxLanguageItem*>(GetAttr( nCol, nRow, nTab, nWhich ))->GetValue(); } diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 170d202bc265..9293b87a39e2 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -6030,16 +6030,16 @@ sal_uInt16 ScDocument::GetTextWidth( const ScAddress& rPos ) const return 0; } -sal_uInt8 ScDocument::GetScriptType( const ScAddress& rPos ) const +SvtScriptType ScDocument::GetScriptType( const ScAddress& rPos ) const { SCTAB nTab = rPos.Tab(); if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab]) return maTabs[nTab]->GetScriptType(rPos.Col(), rPos.Row()); - return 0; + return SvtScriptType::NONE; } -void ScDocument::SetScriptType( const ScAddress& rPos, sal_uInt8 nType ) +void ScDocument::SetScriptType( const ScAddress& rPos, SvtScriptType nType ) { SCTAB nTab = rPos.Tab(); if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab]) diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx index 4191642a44c4..18346fae2a52 100644 --- a/sc/source/core/data/documentimport.cxx +++ b/sc/source/core/data/documentimport.cxx @@ -51,7 +51,7 @@ struct ScDocumentImportImpl ScDocument& mrDoc; sc::StartListeningContext maListenCxt; sc::ColumnBlockPositionSet maBlockPosSet; - sal_uInt16 mnDefaultScriptNumeric; + SvtScriptType mnDefaultScriptNumeric; TabAttrsType maTabAttrs; @@ -59,7 +59,7 @@ struct ScDocumentImportImpl mrDoc(rDoc), maListenCxt(rDoc), maBlockPosSet(rDoc), - mnDefaultScriptNumeric(SC_SCRIPTTYPE_UNKNOWN) {} + mnDefaultScriptNumeric(SvtScriptType::UNKNOWN) {} ColAttr* getColAttr( size_t nTab, size_t nCol ) { @@ -95,7 +95,7 @@ const ScDocument& ScDocumentImport::getDoc() const return mpImpl->mrDoc; } -void ScDocumentImport::setDefaultNumericScript(sal_uInt16 nScript) +void ScDocumentImport::setDefaultNumericScript(SvtScriptType nScript) { mpImpl->mnDefaultScriptNumeric = nScript; } @@ -487,9 +487,9 @@ class CellStoreInitializer { sc::CellTextAttrStoreType maAttrs; sc::CellTextAttrStoreType::iterator miPos; - sal_uInt16 mnScriptNumeric; + SvtScriptType mnScriptNumeric; - Impl(const sal_uInt32 nMaxRowCount, const sal_uInt16 nScriptNumeric) + Impl(const sal_uInt32 nMaxRowCount, const SvtScriptType nScriptNumeric) : maAttrs(nMaxRowCount), miPos(maAttrs.begin()), mnScriptNumeric(nScriptNumeric) {} }; @@ -522,7 +522,7 @@ public: aDefault.mnScriptType = mpImpl->mnScriptNumeric; const ColAttr* p = mrDocImpl.getColAttr(mnTab, mnCol); if (p && p->mbLatinNumFmtOnly) - aDefault.mnScriptType = SCRIPTTYPE_LATIN; + aDefault.mnScriptType = SvtScriptType::LATIN; } break; case sc::element_type_formula: @@ -546,7 +546,7 @@ public: } if (bNumResOnly) - aDefault.mnScriptType = SCRIPTTYPE_LATIN; + aDefault.mnScriptType = SvtScriptType::LATIN; } } break; diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index d71154dbecd6..b7145d569445 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -928,13 +928,13 @@ bool ScGlobal::IsSystemRTL() return MsLangId::isRightToLeft( Application::GetSettings().GetLanguageTag().getLanguageType() ); } -sal_uInt8 ScGlobal::GetDefaultScriptType() +SvtScriptType ScGlobal::GetDefaultScriptType() { // Used when text contains only WEAK characters. // Script type of office language is used then (same as GetEditDefaultLanguage, // to get consistent behavior of text in simple cells and EditEngine, // also same as GetAppLanguage() in Writer) - return (sal_uInt8) SvtLanguageOptions::GetScriptTypeOfLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() ); + return SvtLanguageOptions::GetScriptTypeOfLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() ); } LanguageType ScGlobal::GetEditDefaultLanguage() @@ -943,23 +943,23 @@ LanguageType ScGlobal::GetEditDefaultLanguage() return Application::GetSettings().GetLanguageTag().getLanguageType(); } -sal_uInt16 ScGlobal::GetScriptedWhichID( sal_uInt8 nScriptType, sal_uInt16 nWhich ) +sal_uInt16 ScGlobal::GetScriptedWhichID( SvtScriptType nScriptType, sal_uInt16 nWhich ) { switch ( nScriptType ) { - case SCRIPTTYPE_LATIN: - case SCRIPTTYPE_ASIAN: - case SCRIPTTYPE_COMPLEX: + case SvtScriptType::LATIN: + case SvtScriptType::ASIAN: + case SvtScriptType::COMPLEX: break; // take exact matches default: // prefer one, first COMPLEX, then ASIAN - if ( nScriptType & SCRIPTTYPE_COMPLEX ) - nScriptType = SCRIPTTYPE_COMPLEX; - else if ( nScriptType & SCRIPTTYPE_ASIAN ) - nScriptType = SCRIPTTYPE_ASIAN; + if ( nScriptType & SvtScriptType::COMPLEX ) + nScriptType = SvtScriptType::COMPLEX; + else if ( nScriptType & SvtScriptType::ASIAN ) + nScriptType = SvtScriptType::ASIAN; } switch ( nScriptType ) { - case SCRIPTTYPE_COMPLEX: + case SvtScriptType::COMPLEX: { switch ( nWhich ) { @@ -982,7 +982,7 @@ sal_uInt16 ScGlobal::GetScriptedWhichID( sal_uInt8 nScriptType, sal_uInt16 nWhic } } break; - case SCRIPTTYPE_ASIAN: + case SvtScriptType::ASIAN: { switch ( nWhich ) { diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 878f8afd3af9..0dfc3690663c 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -217,10 +217,10 @@ SvxCellOrientation ScPatternAttr::GetCellOrientation( const SfxItemSet* pCondSet namespace { -void getFontIDsByScriptType(sal_uInt8 nScript, +void getFontIDsByScriptType(SvtScriptType nScript, sal_uInt16& nFontId, sal_uInt16& nHeightId, sal_uInt16& nWeightId, sal_uInt16& nPostureId, sal_uInt16& nLangId) { - if ( nScript == SCRIPTTYPE_ASIAN ) + if ( nScript == SvtScriptType::ASIAN ) { nFontId = ATTR_CJK_FONT; nHeightId = ATTR_CJK_FONT_HEIGHT; @@ -228,7 +228,7 @@ sal_uInt16& nFontId, sal_uInt16& nHeightId, sal_uInt16& nWeightId, sal_uInt16& n nPostureId = ATTR_CJK_FONT_POSTURE; nLangId = ATTR_CJK_FONT_LANGUAGE; } - else if ( nScript == SCRIPTTYPE_COMPLEX ) + else if ( nScript == SvtScriptType::COMPLEX ) { nFontId = ATTR_CTL_FONT; nHeightId = ATTR_CTL_FONT_HEIGHT; @@ -251,7 +251,7 @@ sal_uInt16& nFontId, sal_uInt16& nHeightId, sal_uInt16& nWeightId, sal_uInt16& n void ScPatternAttr::GetFont( vcl::Font& rFont, const SfxItemSet& rItemSet, ScAutoFontColorMode eAutoMode, OutputDevice* pOutDev, const Fraction* pScale, - const SfxItemSet* pCondSet, sal_uInt8 nScript, + const SfxItemSet* pCondSet, SvtScriptType nScript, const Color* pBackConfigColor, const Color* pTextConfigColor ) { // Read items @@ -493,13 +493,13 @@ void ScPatternAttr::GetFont( void ScPatternAttr::GetFont( vcl::Font& rFont, ScAutoFontColorMode eAutoMode, OutputDevice* pOutDev, const Fraction* pScale, - const SfxItemSet* pCondSet, sal_uInt8 nScript, + const SfxItemSet* pCondSet, SvtScriptType nScript, const Color* pBackConfigColor, const Color* pTextConfigColor ) const { GetFont( rFont, GetItemSet(), eAutoMode, pOutDev, pScale, pCondSet, nScript, pBackConfigColor, pTextConfigColor ); } -ScDxfFont ScPatternAttr::GetDxfFont(const SfxItemSet& rItemSet, sal_uInt8 nScript) +ScDxfFont ScPatternAttr::GetDxfFont(const SfxItemSet& rItemSet, SvtScriptType nScript) { sal_uInt16 nFontId, nHeightId, nWeightId, nPostureId, nLangId; getFontIDsByScriptType(nScript, nFontId, nHeightId, nWeightId, nPostureId, nLangId); diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 7ace7b5f8f77..2d45dab8f9de 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -2105,15 +2105,15 @@ sal_uLong ScTable::AddCondFormat( ScConditionalFormat* pNew ) return nMax + 1; } -sal_uInt8 ScTable::GetScriptType( SCCOL nCol, SCROW nRow ) const +SvtScriptType ScTable::GetScriptType( SCCOL nCol, SCROW nRow ) const { if (!ValidCol(nCol)) - return 0; + return SvtScriptType::NONE; return aCol[nCol].GetScriptType(nRow); } -void ScTable::SetScriptType( SCCOL nCol, SCROW nRow, sal_uInt8 nType ) +void ScTable::SetScriptType( SCCOL nCol, SCROW nRow, SvtScriptType nType ) { if (!ValidCol(nCol)) return; @@ -2121,11 +2121,11 @@ void ScTable::SetScriptType( SCCOL nCol, SCROW nRow, sal_uInt8 nType ) aCol[nCol].SetScriptType(nRow, nType); } -sal_uInt8 ScTable::GetRangeScriptType( +SvtScriptType ScTable::GetRangeScriptType( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol, SCROW nRow1, SCROW nRow2 ) { if (!ValidCol(nCol)) - return 0; + return SvtScriptType::NONE; sc::CellStoreType::iterator itr = aCol[nCol].maCells.begin(); return aCol[nCol].GetRangeScriptType(rBlockPos.miCellTextAttrPos, nRow1, nRow2, itr); diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index 2d45f1af51b2..5924d3ec4305 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -1181,7 +1181,7 @@ void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* p rCol.SetTextWidth(nRow, TEXTWIDTH_DIRTY); if ( bNumFormatChanged ) - rCol.SetScriptType(nRow, SC_SCRIPTTYPE_UNKNOWN); + rCol.SetScriptType(nRow, SvtScriptType::UNKNOWN); if ( bBroadcast ) { // Only with CalcAsShown @@ -1221,7 +1221,7 @@ void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* p continue; if ( bNumFormatChanged ) - aCol[nCol].SetScriptType(nRow, SC_SCRIPTTYPE_UNKNOWN); + aCol[nCol].SetScriptType(nRow, SvtScriptType::UNKNOWN); if ( bBroadcast ) { // Only with CalcAsShown diff --git a/sc/source/core/tool/numformat.cxx b/sc/source/core/tool/numformat.cxx index 8b1779b1a9fe..4d18dc4811a3 100644 --- a/sc/source/core/tool/numformat.cxx +++ b/sc/source/core/tool/numformat.cxx @@ -57,8 +57,8 @@ bool NumFmtUtil::isLatinScript( sal_uLong nFormat, ScDocument& rDoc ) aDecSep = aLocaleData.getNumDecimalSep(); } - sal_uInt8 nScript = rDoc.GetStringScriptType(aDecSep); - return (nScript == 0 || nScript == SCRIPTTYPE_LATIN); + SvtScriptType nScript = rDoc.GetStringScriptType(aDecSep); + return (nScript == SvtScriptType::NONE || nScript == SvtScriptType::LATIN); } } diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 078a0ef4ff26..2ecc39d0afd8 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -877,36 +877,14 @@ sal_Int16 XclExpFontHelper::GetFirstUsedScript( const XclExpRoot& rRoot, const S return nScript; } -namespace { - -sal_uInt8 getCoreScriptType(sal_Int16 nScript) -{ - namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; - - sal_uInt8 nScScript = SCRIPTTYPE_LATIN; - switch( nScript ) - { - case ApiScriptType::LATIN: nScScript = SCRIPTTYPE_LATIN; break; - case ApiScriptType::ASIAN: nScScript = SCRIPTTYPE_ASIAN; break; - case ApiScriptType::COMPLEX: nScScript = SCRIPTTYPE_COMPLEX; break; - default: OSL_FAIL( "XclExpFontHelper::GetFontFromItemSet - unknown script type" ); - } - - return nScScript; -} - -} - vcl::Font XclExpFontHelper::GetFontFromItemSet( const XclExpRoot& rRoot, const SfxItemSet& rItemSet, sal_Int16 nScript ) { - namespace ApiScriptType = ::com::sun::star::i18n::ScriptType; - // if WEAK is passed, guess script type from existing items in the item set - if( nScript == ApiScriptType::WEAK ) + if( nScript == css::i18n::ScriptType::WEAK ) nScript = GetFirstUsedScript( rRoot, rItemSet ); // convert to core script type constants - sal_uInt8 nScScript = getCoreScriptType(nScript); + SvtScriptType nScScript = SvtLanguageOptions::FromI18NToSvtScriptType(nScript); // fill the font object vcl::Font aFont; @@ -919,7 +897,7 @@ ScDxfFont XclExpFontHelper::GetDxfFontFromItemSet(const XclExpRoot& rRoot, const sal_Int16 nScript = GetFirstUsedScript(rRoot, rItemSet); // convert to core script type constants - sal_uInt8 nScScript = getCoreScriptType(nScript); + SvtScriptType nScScript = SvtLanguageOptions::FromI18NToSvtScriptType(nScript); return ScPatternAttr::GetDxfFont(rItemSet, nScScript); } diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index c3ea29bafff8..56f6053149a1 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -107,9 +107,9 @@ XclRootData::XclRootData( XclBiff eBiff, SfxMedium& rMedium, switch( ScGlobal::GetDefaultScriptType() ) { - case SCRIPTTYPE_LATIN: mnDefApiScript = ApiScriptType::LATIN; break; - case SCRIPTTYPE_ASIAN: mnDefApiScript = ApiScriptType::ASIAN; break; - case SCRIPTTYPE_COMPLEX: mnDefApiScript = ApiScriptType::COMPLEX; break; + case SvtScriptType::LATIN: mnDefApiScript = ApiScriptType::LATIN; break; + case SvtScriptType::ASIAN: mnDefApiScript = ApiScriptType::ASIAN; break; + case SvtScriptType::COMPLEX: mnDefApiScript = ApiScriptType::COMPLEX; break; default: SAL_WARN( "sc", "XclRootData::XclRootData - unknown script type" ); } diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index 75fab085842a..94c1cc069408 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -864,11 +864,11 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) sal_uLong nFormat = pAttr->GetNumberFormat( pFormatter ); bool bValueData = aCell.hasNumeric(); - sal_uInt8 nScriptType = 0; + SvtScriptType nScriptType = SvtScriptType::NONE; if (!aCell.isEmpty()) nScriptType = pDoc->GetScriptType(nCol, nRow, nTab); - if ( nScriptType == 0 ) + if ( nScriptType == SvtScriptType::NONE ) nScriptType = aHTMLStyle.nDefaultScriptType; OStringBuffer aStrTD(OOO_STRING_SVTOOLS_HTML_tabledata); diff --git a/sc/source/filter/inc/htmlexp.hxx b/sc/source/filter/inc/htmlexp.hxx index c895d036e2a0..3403d4c670a6 100644 --- a/sc/source/filter/inc/htmlexp.hxx +++ b/sc/source/filter/inc/htmlexp.hxx @@ -37,7 +37,7 @@ class SdrObject; class OutputDevice; class ScDrawLayer; class EditTextObject; - +enum class SvtScriptType; namespace editeng { class SvxBorderLine; } struct ScHTMLStyle @@ -46,7 +46,7 @@ struct ScHTMLStyle OUString aFontFamilyName; sal_uInt32 nFontHeight; // Item-Value sal_uInt16 nFontSizeNumber; // HTML value 1-7 - sal_uInt8 nDefaultScriptType; // Font values are valid for the default script type + SvtScriptType nDefaultScriptType; // Font values are valid for the default script type bool bInitialized; ScHTMLStyle() : diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 051b8787210e..973446dfc3af 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -259,9 +259,9 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu if ( pFont || pHeight || pWeight || pPosture ) { OUString aStr( mpEngine->GetText( pE->aSel ) ); - sal_uInt8 nScriptType = mpDoc->GetStringScriptType( aStr ); - const sal_uInt8 nScripts[3] = { SCRIPTTYPE_LATIN, - SCRIPTTYPE_ASIAN, SCRIPTTYPE_COMPLEX }; + SvtScriptType nScriptType = mpDoc->GetStringScriptType( aStr ); + const SvtScriptType nScripts[3] = { SvtScriptType::LATIN, + SvtScriptType::ASIAN, SvtScriptType::COMPLEX }; for ( sal_uInt8 j=0; j<3; ++j ) { if ( nScriptType & nScripts[j] ) diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index b8e58b6257fd..72fd4fbe84f0 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2447,7 +2447,7 @@ void ScXMLImport::ExamineDefaultStyle() const ScPatternAttr* pDefPattern = pDoc->GetDefPattern(); if (pDefPattern && sc::NumFmtUtil::isLatinScript(*pDefPattern, *pDoc)) - mpDocImport->setDefaultNumericScript(SCRIPTTYPE_LATIN); + mpDocImport->setDefaultNumericScript(SvtScriptType::LATIN); } } diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index a70b0697404c..bbc73c94126e 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1410,8 +1410,8 @@ void ScMultiTextWnd::InitEditEngine() if (pDocSh) { ScDocument& rDoc = pDocSh->GetDocument(); // any document - sal_uInt8 nScript = rDoc.GetStringScriptType( aString ); - if ( nScript & SCRIPTTYPE_COMPLEX ) + SvtScriptType nScript = rDoc.GetStringScriptType( aString ); + if ( nScript & SvtScriptType::COMPLEX ) Invalidate(); } } @@ -1783,8 +1783,8 @@ void ScTextWnd::StartEditEngine() if ( pObjSh && pObjSh->ISA(ScDocShell) ) { ScDocument& rDoc = static_cast<ScDocShell*>(pObjSh)->GetDocument(); // any document - sal_uInt8 nScript = rDoc.GetStringScriptType( aString ); - if ( nScript & SCRIPTTYPE_COMPLEX ) + SvtScriptType nScript = rDoc.GetStringScriptType( aString ); + if ( nScript & SvtScriptType::COMPLEX ) Invalidate(); } } @@ -1876,8 +1876,8 @@ void ScTextWnd::SetTextString( const OUString& rNewString ) else { // test if CTL script type is involved - sal_uInt8 nOldScript = 0; - sal_uInt8 nNewScript = 0; + SvtScriptType nOldScript = SvtScriptType::NONE; + SvtScriptType nNewScript = SvtScriptType::NONE; SfxObjectShell* pObjSh = SfxObjectShell::Current(); if ( pObjSh && pObjSh->ISA(ScDocShell) ) { @@ -1886,7 +1886,7 @@ void ScTextWnd::SetTextString( const OUString& rNewString ) nOldScript = rDoc.GetStringScriptType( aString ); nNewScript = rDoc.GetStringScriptType( rNewString ); } - bPaintAll = ( nOldScript & SCRIPTTYPE_COMPLEX ) || ( nNewScript & SCRIPTTYPE_COMPLEX ); + bPaintAll = ( nOldScript & SvtScriptType::COMPLEX ) || ( nNewScript & SvtScriptType::COMPLEX ); } if ( bPaintAll ) diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index aa17857dbdc5..ce261fb3aa8f 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -894,7 +894,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) // font items from toolbox controller have to be applied for the right script type // #i78017 establish the same behaviour as in Writer - sal_uInt16 nScript = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX; + SvtScriptType nScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX; if (nSlot == SID_ATTR_CHAR_FONT) nScript = pView->GetScriptType(); @@ -965,10 +965,10 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) // choose font info according to selection script type - sal_uInt16 nScript = pView->GetScriptType(); + SvtScriptType nScript = pView->GetScriptType(); // #i55929# input-language-dependent script type (depends on input language if nothing selected) - sal_uInt16 nInputScript = nScript; + SvtScriptType nInputScript = nScript; OutlinerView* pOutView = pView->GetTextEditOutlinerView(); if (pOutView && !pOutView->GetSelection().HasRange()) { diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 0221e601b8ae..a9d54d0e7426 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -161,7 +161,7 @@ class ScGridWindow : public vcl::Window, public DropTargetHelper, public DragSou ScRange aPagebreakSource; ScRange aPagebreakDrag; - sal_uInt8 nPageScript; + SvtScriptType nPageScript; long nLastClickX; long nLastClickY; diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index a032722ff9a5..1c90a1e7a4b3 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -75,7 +75,7 @@ public: void GetSelectionFrame ( SvxBoxItem& rLineOuter, SvxBoxInfoItem& rLineInner ); - sal_uInt8 GetSelectionScriptType(); + SvtScriptType GetSelectionScriptType(); bool GetAutoSumArea(ScRangeList& rRangeList); void EnterAutoSum(const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr); diff --git a/sc/source/ui/inc/viewutil.hxx b/sc/source/ui/inc/viewutil.hxx index 63e2ef03e5bc..bbccd75827d2 100644 --- a/sc/source/ui/inc/viewutil.hxx +++ b/sc/source/ui/inc/viewutil.hxx @@ -34,7 +34,7 @@ class ScDocument; class ScAddress; class ScRange; class ScMarkData; - +enum class SvtScriptType; enum ScUpdateMode { SC_UPDATE_ALL, SC_UPDATE_CHANGED, SC_UPDATE_MARKS }; class SC_DLLPUBLIC ScViewUtil @@ -50,7 +50,7 @@ public: ScDocument& rDocument ); static void PutItemScript( SfxItemSet& rShellSet, const SfxItemSet& rCoreSet, - sal_uInt16 nWhichId, sal_uInt16 nScript ); + sal_uInt16 nWhichId, SvtScriptType nScript ); static sal_uInt16 GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos ); diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index bceac51de6a2..21194f6c51ab 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -333,9 +333,9 @@ void ScEditShell::Execute( SfxRequest& rReq ) case SID_CHARMAP: { - sal_uInt16 nScript = pTableView->GetSelectedScriptType(); - sal_uInt16 nFontWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? EE_CHAR_FONTINFO_CJK : - ( ( nScript == SCRIPTTYPE_COMPLEX ) ? EE_CHAR_FONTINFO_CTL : + SvtScriptType nScript = pTableView->GetSelectedScriptType(); + sal_uInt16 nFontWhich = ( nScript == SvtScriptType::ASIAN ) ? EE_CHAR_FONTINFO_CJK : + ( ( nScript == SvtScriptType::COMPLEX ) ? EE_CHAR_FONTINFO_CTL : EE_CHAR_FONTINFO ); const SvxFontItem& rItem = static_cast<const SvxFontItem&>( pTableView->GetAttribs().Get(nFontWhich)); @@ -377,10 +377,10 @@ void ScEditShell::Execute( SfxRequest& rReq ) if ( !aString.isEmpty() ) { // if string contains WEAK characters, set all fonts - sal_uInt8 nSetScript; + SvtScriptType nSetScript; ScDocument* pDoc = pViewData->GetDocument(); if ( pDoc->HasStringWeakCharacters( aString ) ) - nSetScript = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX; + nSetScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX; else nSetScript = pDoc->GetStringScriptType( aString ); @@ -844,11 +844,11 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq) if (pArgs) { // #i78017 establish the same behaviour as in Writer - sal_uInt16 nScript = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX; + SvtScriptType nScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX; if (nSlot == SID_ATTR_CHAR_FONT) { nScript = pEditView->GetSelectedScriptType(); - if (nScript == 0) nScript = ScGlobal::GetDefaultScriptType(); + if (nScript == SvtScriptType::NONE) nScript = ScGlobal::GetDefaultScriptType(); } SfxItemPool& rPool = GetPool(); @@ -876,7 +876,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq) case SID_ATTR_CHAR_WEIGHT: { // #i78017 establish the same behaviour as in Writer - sal_uInt16 nScript = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX; + SvtScriptType nScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX; SfxItemPool& rPool = GetPool(); @@ -899,7 +899,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq) case SID_ATTR_CHAR_POSTURE: { // #i78017 establish the same behaviour as in Writer - sal_uInt16 nScript = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX; + SvtScriptType nScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX; SfxItemPool& rPool = GetPool(); @@ -1058,11 +1058,11 @@ void ScEditShell::GetAttrState(SfxItemSet &rSet) // choose font info according to selection script type - sal_uInt16 nScript = pEditView->GetSelectedScriptType(); - if (nScript == 0) nScript = ScGlobal::GetDefaultScriptType(); + SvtScriptType nScript = pEditView->GetSelectedScriptType(); + if (nScript == SvtScriptType::NONE) nScript = ScGlobal::GetDefaultScriptType(); // #i55929# input-language-dependent script type (depends on input language if nothing selected) - sal_uInt16 nInputScript = nScript; + SvtScriptType nInputScript = nScript; if ( !pEditView->GetSelection().HasRange() ) { LanguageType nInputLang = pViewData->GetActiveWin()->GetInputLanguage(); diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 706b0da2f28c..056d2ca5d3b5 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -1370,7 +1370,7 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq ) case SID_ATTR_CHAR_WEIGHT: { // #i78017 establish the same behaviour as in Writer - sal_uInt8 nScript = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX; + SvtScriptType nScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX; SfxItemPool& rPool = GetPool(); SvxScriptSetItem aSetItem( nSlot, rPool ); @@ -1397,7 +1397,7 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq ) case SID_ATTR_CHAR_POSTURE: { // #i78017 establish the same behaviour as in Writer - sal_uInt8 nScript = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX; + SvtScriptType nScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX; SfxItemPool& rPool = GetPool(); SvxScriptSetItem aSetItem( nSlot, rPool ); @@ -1654,7 +1654,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) sal_uInt16 nWhich = rPool.GetWhich( nSlot ); const SvxFontItem& rFont = static_cast<const SvxFontItem&>(pNewAttrs->Get( nWhich )); SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, rPool ); - sal_uInt8 nScript = pTabViewShell->GetSelectionScriptType(); + SvtScriptType nScript = pTabViewShell->GetSelectionScriptType(); aSetItem.PutItemForScriptType( nScript, rFont ); ScMarkData aFuncMark( pViewData->GetMarkData() ); @@ -1691,7 +1691,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) case SID_ATTR_CHAR_FONTHEIGHT: { // #i78017 establish the same behaviour as in Writer - sal_uInt8 nScript = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX; + SvtScriptType nScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX; if (nSlot == SID_ATTR_CHAR_FONT) nScript = pTabViewShell->GetSelectionScriptType(); @@ -1928,15 +1928,15 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet ) rSet.Put( rAttrSet, false ); // choose font info according to selection script type - sal_uInt8 nScript = 0; // GetSelectionScriptType never returns 0 + SvtScriptType nScript = SvtScriptType::NONE; // GetSelectionScriptType never returns 0 if ( rSet.GetItemState( ATTR_FONT ) != SfxItemState::UNKNOWN ) { - if (!nScript) nScript = pTabViewShell->GetSelectionScriptType(); + if (nScript == SvtScriptType::NONE) nScript = pTabViewShell->GetSelectionScriptType(); ScViewUtil::PutItemScript( rSet, rAttrSet, ATTR_FONT, nScript ); } if ( rSet.GetItemState( ATTR_FONT_HEIGHT ) != SfxItemState::UNKNOWN ) { - if (!nScript) nScript = pTabViewShell->GetSelectionScriptType(); + if (nScript == SvtScriptType::NONE) nScript = pTabViewShell->GetSelectionScriptType(); ScViewUtil::PutItemScript( rSet, rAttrSet, ATTR_FONT_HEIGHT, nScript ); } @@ -2139,15 +2139,15 @@ void ScFormatShell::GetTextAttrState( SfxItemSet& rSet ) rSet.Put( rAttrSet, false ); // ItemStates mitkopieren // choose font info according to selection script type - sal_uInt8 nScript = 0; // GetSelectionScriptType never returns 0 + SvtScriptType nScript = SvtScriptType::NONE; // GetSelectionScriptType never returns 0 if ( rSet.GetItemState( ATTR_FONT_WEIGHT ) != SfxItemState::UNKNOWN ) { - if (!nScript) nScript = pTabViewShell->GetSelectionScriptType(); + if (nScript == SvtScriptType::NONE) nScript = pTabViewShell->GetSelectionScriptType(); ScViewUtil::PutItemScript( rSet, rAttrSet, ATTR_FONT_WEIGHT, nScript ); } if ( rSet.GetItemState( ATTR_FONT_POSTURE ) != SfxItemState::UNKNOWN ) { - if (!nScript) nScript = pTabViewShell->GetSelectionScriptType(); + if (nScript == SvtScriptType::NONE) nScript = pTabViewShell->GetSelectionScriptType(); ScViewUtil::PutItemScript( rSet, rAttrSet, ATTR_FONT_POSTURE, nScript ); } diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 54d7d81e9de3..a39603115070 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -460,7 +460,7 @@ ScGridWindow::ScGridWindow( vcl::Window* pParent, ScViewData* pData, ScSplitPos nPagebreakMouse( SC_PD_NONE ), nPagebreakBreak( 0 ), nPagebreakPrev( 0 ), - nPageScript( 0 ), + nPageScript( SvtScriptType::NONE ), nLastClickX( 0 ), nLastClickY( 0 ), nDragStartX( -1 ), diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index e9d21852fc49..9a78d1067690 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1110,18 +1110,18 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, Color aAutomatic( rColorCfg.GetColorValue(svtools::CALCPAGEBREAK).nColor ); OUString aPageStr = ScGlobal::GetRscString( STR_PGNUM ); - if ( nPageScript == 0 ) + if ( nPageScript == SvtScriptType::NONE ) { // get script type of translated "Page" string only once nPageScript = pDoc->GetStringScriptType( aPageStr ); - if (nPageScript == 0) + if (nPageScript == SvtScriptType::NONE) nPageScript = ScGlobal::GetDefaultScriptType(); } vcl::Font aFont; std::unique_ptr<ScEditEngineDefaulter> pEditEng; const ScPatternAttr& rDefPattern = static_cast<const ScPatternAttr&>(pDoc->GetPool()->GetDefaultItem(ATTR_PATTERN)); - if ( nPageScript == SCRIPTTYPE_LATIN ) + if ( nPageScript == SvtScriptType::LATIN ) { // use single font and call DrawText directly rDefPattern.GetFont( aFont, SC_AUTOCOL_BLACK ); diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 6ffe033effdc..5f43c75e9101 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -132,7 +132,7 @@ public: void SetPattern( const ScPatternAttr* pNew, const SfxItemSet* pSet, const ScRefCellValue& rCell, - sal_uInt8 nScript ); + SvtScriptType nScript ); void SetPatternSimple( const ScPatternAttr* pNew, const SfxItemSet* pSet ); @@ -167,7 +167,7 @@ public: long GetAscent() const { return nAscentPixel; } bool IsRotated() const { return bRotated; } - void SetShrinkScale( long nScale, sal_uInt8 nScript ); + void SetShrinkScale( long nScale, SvtScriptType nScript ); bool HasCondHeight() const { return pCondSet && SfxItemState::SET == pCondSet->GetItemState( ATTR_FONT_HEIGHT, true ); } @@ -221,7 +221,7 @@ ScDrawStringsVars::~ScDrawStringsVars() { } -void ScDrawStringsVars::SetShrinkScale( long nScale, sal_uInt8 nScript ) +void ScDrawStringsVars::SetShrinkScale( long nScale, SvtScriptType nScript ) { // text remains valid, size is updated @@ -281,7 +281,7 @@ bool lcl_GetBoolValue(const ScPatternAttr& rPattern, sal_uInt16 nWhich, const Sf void ScDrawStringsVars::SetPattern( const ScPatternAttr* pNew, const SfxItemSet* pSet, const ScRefCellValue& rCell, - sal_uInt8 nScript ) + SvtScriptType nScript ) { nMaxDigitWidth = 0; nSignWidth = 0; @@ -1053,11 +1053,11 @@ static inline void lcl_CreateInterpretProgress( bool& bProgress, ScDocument* pDo } } -inline bool IsAmbiguousScript( sal_uInt8 nScript ) +inline bool IsAmbiguousScript( SvtScriptType nScript ) { - return ( nScript != SCRIPTTYPE_LATIN && - nScript != SCRIPTTYPE_ASIAN && - nScript != SCRIPTTYPE_COMPLEX ); + return ( nScript != SvtScriptType::LATIN && + nScript != SvtScriptType::ASIAN && + nScript != SvtScriptType::COMPLEX ); } bool ScOutputData::IsEmptyCellText( RowInfo* pThisRowInfo, SCCOL nX, SCROW nY ) @@ -1463,7 +1463,7 @@ Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, const ScA const SfxItemSet* pCondSet = NULL; const ScPatternAttr* pOldPattern = NULL; const SfxItemSet* pOldCondSet = NULL; - sal_uInt8 nOldScript = 0; + SvtScriptType nOldScript = SvtScriptType::NONE; // alternative pattern instances in case we need to modify the pattern // before processing the cell value. @@ -1642,11 +1642,11 @@ Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, const ScA pPattern = pAltPattern; } - sal_uInt8 nScript = mpDoc->GetCellScriptType( + SvtScriptType nScript = mpDoc->GetCellScriptType( ScAddress(nCellX, nCellY, nTab), pPattern->GetNumberFormat(mpDoc->GetFormatTable(), pCondSet)); - if (nScript == 0) + if (nScript == SvtScriptType::NONE) nScript = ScGlobal::GetDefaultScriptType(); if ( pPattern != pOldPattern || pCondSet != pOldCondSet || diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 4b21f410f989..1c647ab42fa7 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -2782,10 +2782,10 @@ void ScViewFunc::InsertSpecialChar( const OUString& rStr, const vcl::Font& rFont ATTR_FONT ); // if string contains WEAK characters, set all fonts - sal_uInt8 nScript; + SvtScriptType nScript; ScDocument* pDoc = GetViewData().GetDocument(); if ( pDoc->HasStringWeakCharacters( rStr ) ) - nScript = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX; + nScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX; else nScript = pDoc->GetStringScriptType( rStr ); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 9e1a7e143c4c..92ddab74a3b1 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -782,9 +782,9 @@ void ScViewFunc::EnterMatrix( const OUString& rString, ::formula::FormulaGrammar ErrorMessage(STR_NOMULTISELECT); } -sal_uInt8 ScViewFunc::GetSelectionScriptType() +SvtScriptType ScViewFunc::GetSelectionScriptType() { - sal_uInt8 nScript = 0; + SvtScriptType nScript = SvtScriptType::NONE; ScDocument* pDoc = GetViewData().GetDocument(); const ScMarkData& rMark = GetViewData().GetMarkData(); @@ -802,7 +802,7 @@ sal_uInt8 ScViewFunc::GetSelectionScriptType() nScript = pDoc->GetRangeScriptType(aRanges); } - if (nScript == 0) + if (nScript == SvtScriptType::NONE) nScript = ScGlobal::GetDefaultScriptType(); return nScript; diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index 8b245fb39bca..4c82a4f49c24 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -52,7 +52,7 @@ #include <boost/scoped_ptr.hpp> void ScViewUtil::PutItemScript( SfxItemSet& rShellSet, const SfxItemSet& rCoreSet, - sal_uInt16 nWhichId, sal_uInt16 nScript ) + sal_uInt16 nWhichId, SvtScriptType nScript ) { // take the effective item from rCoreSet according to nScript // and put in rShellSet under the (base) nWhichId @@ -73,9 +73,9 @@ sal_uInt16 ScViewUtil::GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos ) { // used for thesaurus - sal_uInt8 nScript = pDoc->GetScriptType(rPos.Col(), rPos.Row(), rPos.Tab()); - sal_uInt16 nWhich = ( nScript == SCRIPTTYPE_ASIAN ) ? ATTR_CJK_FONT_LANGUAGE : - ( ( nScript == SCRIPTTYPE_COMPLEX ) ? ATTR_CTL_FONT_LANGUAGE : ATTR_FONT_LANGUAGE ); + SvtScriptType nScript = pDoc->GetScriptType(rPos.Col(), rPos.Row(), rPos.Tab()); + sal_uInt16 nWhich = ( nScript == SvtScriptType::ASIAN ) ? ATTR_CJK_FONT_LANGUAGE : + ( ( nScript == SvtScriptType::COMPLEX ) ? ATTR_CTL_FONT_LANGUAGE : ATTR_FONT_LANGUAGE ); const SfxPoolItem* pItem = pDoc->GetAttr( rPos.Col(), rPos.Row(), rPos.Tab(), nWhich); const SvxLanguageItem* pLangIt = PTR_CAST( SvxLanguageItem, pItem ); LanguageType eLnge; @@ -86,8 +86,8 @@ sal_uInt16 ScViewUtil::GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos ) { LanguageType eLatin, eCjk, eCtl; pDoc->GetLanguage( eLatin, eCjk, eCtl ); - eLnge = ( nScript == SCRIPTTYPE_ASIAN ) ? eCjk : - ( ( nScript == SCRIPTTYPE_COMPLEX ) ? eCtl : eLatin ); + eLnge = ( nScript == SvtScriptType::ASIAN ) ? eCjk : + ( ( nScript == SvtScriptType::COMPLEX ) ? eCtl : eLatin ); } } else |