summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-15 09:36:39 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-04-17 07:21:08 +0000
commita7b7c64afc523cfd9ff4e724b3efbec6567fc1c8 (patch)
tree52fd05ef3292f3dab172864cbc3be96a8d44a9d0 /sc/inc
parentadd7eeb7dbd0eefa0c5ae5430490864079add801 (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/inc')
-rw-r--r--sc/inc/celltextattr.hxx5
-rw-r--r--sc/inc/column.hxx8
-rw-r--r--sc/inc/document.hxx15
-rw-r--r--sc/inc/documentimport.hxx3
-rw-r--r--sc/inc/global.hxx7
-rw-r--r--sc/inc/globalnames.hxx4
-rw-r--r--sc/inc/patattr.hxx7
-rw-r--r--sc/inc/table.hxx6
8 files changed, 28 insertions, 27 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;