summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-13 08:17:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-13 08:17:42 +0200
commitb8d977c0178f8ac4ee299722d50c1481a15b45c8 (patch)
tree6cd8560661bb8b713e4373379052e85ab30598dd /sc
parent80d2fa87fdaf67615d7b8128f3c05b239a1f1c05 (diff)
convert CharCompressType to scoped enum
and move it to svl, where it belongs Change-Id: Ic4d846419dfe2dd85de5ade8ed1a041867bbf1dc
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/document.hxx14
-rw-r--r--sc/qa/unit/ucalc.cxx3
-rw-r--r--sc/source/core/data/documen2.cxx3
-rw-r--r--sc/source/core/data/documen9.cxx11
-rw-r--r--sc/source/ui/docshell/docsh2.cxx2
-rw-r--r--sc/source/ui/unoobj/confuno.cxx2
6 files changed, 19 insertions, 16 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index da2a982d2822..e93e88249e7a 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -50,6 +50,7 @@
enum class SvtScriptType;
enum class ScMF;
enum class FormulaError : sal_uInt16;
+enum class CharCompressType;
namespace editeng { class SvxBorderLine; }
namespace formula { struct VectorRefArray; }
namespace svl {
@@ -228,7 +229,6 @@ namespace com { namespace sun { namespace star {
#define SC_MACROCALL_ALLOWED 0
-#define SC_ASIANCOMPRESSION_INVALID 0xff
#define SC_ASIANKERNING_INVALID 0xff
enum ScDocumentMode
@@ -452,12 +452,12 @@ private:
bool bHasMacroFunc; // valid only after loading
- sal_uInt8 nAsianCompression;
- sal_uInt8 nAsianKerning;
+ CharCompressType nAsianCompression;
+ sal_uInt8 nAsianKerning;
bool bPastingDrawFromOtherDoc;
- sal_uInt8 nInDdeLinkUpdate; // originating DDE links (stacked bool)
+ sal_uInt8 nInDdeLinkUpdate; // originating DDE links (stacked bool)
bool bInUnoBroadcast;
bool bInUnoListenerCall;
@@ -1964,16 +1964,16 @@ public:
const rtl::Reference<SvxForbiddenCharactersTable>& GetForbiddenCharacters();
void SetForbiddenCharacters(const rtl::Reference<SvxForbiddenCharactersTable>& rNew);
- sal_uInt8 GetAsianCompression() const; // CharacterCompressionType values
+ CharCompressType GetAsianCompression() const;
bool IsValidAsianCompression() const;
- void SetAsianCompression(sal_uInt8 nNew);
+ void SetAsianCompression(CharCompressType nNew);
bool GetAsianKerning() const;
bool IsValidAsianKerning() const;
void SetAsianKerning(bool bNew);
void ApplyAsianEditSettings(ScEditEngineDefaulter& rEngine);
- sal_uInt8 GetEditTextDirection(SCTAB nTab) const; // EEHorizontalTextDirection values
+ sal_uInt8 GetEditTextDirection(SCTAB nTab) const; // EEHorizontalTextDirection values
SC_DLLPUBLIC ScLkUpdMode GetLinkMode() const { return eLinkMode ;}
void SetLinkMode( ScLkUpdMode nSet ) { eLinkMode = nSet;}
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 884ae3f2793d..cc7a9c3d8532 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -14,6 +14,7 @@
#include <rtl/strbuf.hxx>
#include <osl/file.hxx>
#include <osl/time.h>
+#include <svl/asiancfg.hxx>
#include "scdll.hxx"
#include "formulacell.hxx"
@@ -6364,7 +6365,7 @@ void Test::testEmptyCalcDocDefaults()
CPPUNIT_ASSERT_EQUAL( (sal_uLong) 0, m_pDoc->GetCellCount() );
CPPUNIT_ASSERT_EQUAL( (sal_uLong) 0, m_pDoc->GetFormulaGroupCount() );
CPPUNIT_ASSERT_EQUAL( (sal_uLong) 0, m_pDoc->GetCodeCount() );
- CPPUNIT_ASSERT_EQUAL( (sal_uInt8) 0, m_pDoc->GetAsianCompression() );
+ CPPUNIT_ASSERT_EQUAL( (int)CharCompressType::NONE, (int)m_pDoc->GetAsianCompression() );
CPPUNIT_ASSERT_EQUAL( false, m_pDoc->HasPrintRange() );
CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsInVBAMode() );
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 92d2c4abed54..9554306f2b16 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -31,6 +31,7 @@
#include <sfx2/objsh.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/printer.hxx>
+#include <svl/asiancfg.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
#include <vcl/virdev.hxx>
@@ -201,7 +202,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
bExpandRefs( false ),
bDetectiveDirty( false ),
bHasMacroFunc( false ),
- nAsianCompression(SC_ASIANCOMPRESSION_INVALID),
+ nAsianCompression(CharCompressType::Invalid),
nAsianKerning(SC_ASIANKERNING_INVALID),
bPastingDrawFromOtherDoc( false ),
nInDdeLinkUpdate( 0 ),
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 96fd241c3610..339c75b24a3d 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -26,6 +26,7 @@
#include <editeng/forbiddencharacterstable.hxx>
#include <editeng/langitem.hxx>
#include <osl/thread.h>
+#include <svl/asiancfg.hxx>
#include <svx/svdetc.hxx>
#include <svx/svditer.hxx>
#include <svx/svdocapt.hxx>
@@ -641,18 +642,18 @@ void ScDocument::SetForbiddenCharacters(const rtl::Reference<SvxForbiddenCharact
bool ScDocument::IsValidAsianCompression() const
{
- return ( nAsianCompression != SC_ASIANCOMPRESSION_INVALID );
+ return nAsianCompression != CharCompressType::Invalid;
}
-sal_uInt8 ScDocument::GetAsianCompression() const
+CharCompressType ScDocument::GetAsianCompression() const
{
- if ( nAsianCompression == SC_ASIANCOMPRESSION_INVALID )
- return 0;
+ if ( nAsianCompression == CharCompressType::Invalid )
+ return CharCompressType::NONE;
else
return nAsianCompression;
}
-void ScDocument::SetAsianCompression(sal_uInt8 nNew)
+void ScDocument::SetAsianCompression(CharCompressType nNew)
{
nAsianCompression = nNew;
if ( pEditEngine )
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index f9b006c184c6..4aaa39a29403 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -144,7 +144,7 @@ void ScDocShell::InitItems()
if ( !aDocument.IsValidAsianCompression() )
{
// set compression mode from configuration if not already set (e.g. XML import)
- aDocument.SetAsianCompression( sal::static_int_cast<sal_uInt8>( aAsian.GetCharDistanceCompression() ) );
+ aDocument.SetAsianCompression( aAsian.GetCharDistanceCompression() );
}
if ( !aDocument.IsValidAsianKerning() )
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 796494ecd2dc..2918c8601d83 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -256,7 +256,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
{
// Int16 contains CharacterCompressionType values
sal_Int16 nUno = ScUnoHelpFunctions::GetInt16FromAny( aValue );
- rDoc.SetAsianCompression( (sal_uInt8) nUno );
+ rDoc.SetAsianCompression( (CharCompressType) nUno );
bUpdateHeights = true;
}
else if ( aPropertyName == SC_UNO_ASIANKERN )