From b8d977c0178f8ac4ee299722d50c1481a15b45c8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 13 Feb 2017 08:17:10 +0200 Subject: convert CharCompressType to scoped enum and move it to svl, where it belongs Change-Id: Ic4d846419dfe2dd85de5ade8ed1a041867bbf1dc --- include/editeng/editeng.hxx | 3 ++- include/editeng/outliner.hxx | 3 ++- include/svl/asiancfg.hxx | 14 ++++++++++++-- include/svx/svdmodel.hxx | 7 ++++--- 4 files changed, 20 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index 38dbad12c65c..4742a607b349 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -109,6 +109,7 @@ class Range; struct EPaM; class DeletedNodeInfo; class ParaPortionList; +enum class CharCompressType; /** values for: @@ -256,7 +257,7 @@ public: void TransliterateText( const ESelection& rSelection, sal_Int32 nTransliterationMode ); EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode ); - void SetAsianCompressionMode( sal_uInt16 nCompression ); + void SetAsianCompressionMode( CharCompressType nCompression ); void SetKernAsianPunctuation( bool bEnabled ); diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index ef1540e17a0d..2c1f7810e85e 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -83,6 +83,7 @@ class SvxForbiddenCharactersTable; class OverflowingText; class NonOverflowingText; class OutlinerViewShell; +enum class CharCompressType; namespace svl { @@ -694,7 +695,7 @@ public: LanguageType GetLanguage( sal_Int32 nPara, sal_Int32 nPos ) const; - void SetAsianCompressionMode( sal_uInt16 nCompressionMode ); + void SetAsianCompressionMode( CharCompressType nCompressionMode ); void SetKernAsianPunctuation( bool bEnabled ); diff --git a/include/svl/asiancfg.hxx b/include/svl/asiancfg.hxx index 71662c4a57f7..cef636155519 100644 --- a/include/svl/asiancfg.hxx +++ b/include/svl/asiancfg.hxx @@ -31,6 +31,16 @@ namespace com { namespace sun { namespace star { namespace lang { struct Locale; } } } } +/// These constants define character compression in Asian text. +/// Must match the values in com::sun::star::text::CharacterCompressionType. +/// For bonus points, also appears to be directly stored in the ww8 file format. +enum class CharCompressType { + NONE, /// No Compression + PunctuationOnly, /// Only punctuation is compressed + PunctuationAndKana, /// Punctuation and Japanese Kana are compressed. + Invalid = 0xff /// only used in SC +}; + class SVL_DLLPUBLIC SvxAsianConfig { public: SvxAsianConfig(); @@ -44,9 +54,9 @@ public: void SetKerningWesternTextOnly(bool value); - sal_Int16 GetCharDistanceCompression() const; + CharCompressType GetCharDistanceCompression() const; - void SetCharDistanceCompression(sal_Int16 value); + void SetCharDistanceCompression(CharCompressType value); css::uno::Sequence< css::lang::Locale > GetStartEndCharLocales() const; diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 4cad2a4cf17b..d2b4ef8a2f87 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -78,6 +78,7 @@ class SdrOutlinerCache; class SdrUndoFactory; class ImageMap; class TextChain; +enum class CharCompressType; namespace comphelper { class IEmbeddedHelper; @@ -203,7 +204,7 @@ public: //get a vector of all the SdrOutliner belonging to the model std::vector GetActiveOutliners() const; std::unique_ptr mpImpl; - sal_uInt16 mnCharCompressType; + CharCompressType mnCharCompressType; sal_uInt16 mnHandoutPageCount; bool mbModelLocked; bool mbKernAsianPunctuation; @@ -532,8 +533,8 @@ public: void SetForbiddenCharsTable( const rtl::Reference& xForbiddenChars ); const rtl::Reference& GetForbiddenCharsTable() const { return mpForbiddenCharactersTable;} - void SetCharCompressType( sal_uInt16 nType ); - sal_uInt16 GetCharCompressType() const { return mnCharCompressType; } + void SetCharCompressType( CharCompressType nType ); + CharCompressType GetCharCompressType() const { return mnCharCompressType; } void SetKernAsianPunctuation( bool bEnabled ); bool IsKernAsianPunctuation() const { return mbKernAsianPunctuation; } -- cgit