summaryrefslogtreecommitdiff
path: root/sw/source
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 /sw/source
parent80d2fa87fdaf67615d7b8128f3c05b239a1f1c05 (diff)
convert CharCompressType to scoped enum
and move it to svl, where it belongs Change-Id: Ic4d846419dfe2dd85de5ade8ed1a041867bbf1dc
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/doc/DocumentSettingManager.cxx9
-rw-r--r--sw/source/core/draw/drawdoc.cxx3
-rw-r--r--sw/source/core/inc/DocumentSettingManager.hxx6
-rw-r--r--sw/source/core/text/porlay.cxx11
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par.cxx2
-rw-r--r--sw/source/uibase/app/docshini.cxx2
-rw-r--r--sw/source/uibase/uno/SwXDocumentSettings.cxx11
8 files changed, 24 insertions, 22 deletions
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx
index ec0eb827e701..1103cf441bd3 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -25,6 +25,7 @@
#include <comphelper/processfactory.hxx>
#include <editeng/forbiddencharacterstable.hxx>
#include <svx/svdmodel.hxx>
+#include <svl/asiancfg.hxx>
#include <unotools/compatibility.hxx>
#include <unotools/configmgr.hxx>
#include <drawdoc.hxx>
@@ -41,7 +42,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
:m_rDoc(rDoc),
mnLinkUpdMode( GLOBALSETTING ),
meFieldUpdMode( AUTOUPD_GLOBALSETTING ),
- meChrCmprType( CHARCOMPRESS_NONE ),
+ meChrCmprType( CharCompressType::NONE ),
mn32DummyCompatibilityOptions1(0),
mn32DummyCompatibilityOptions2(0),
mbHTMLMode(false),
@@ -495,12 +496,12 @@ void sw::DocumentSettingManager::setFieldUpdateFlags(/*[in]*/SwFieldUpdateFlags
meFieldUpdMode = eMode;
}
-SwCharCompressType sw::DocumentSettingManager::getCharacterCompressionType() const
+CharCompressType sw::DocumentSettingManager::getCharacterCompressionType() const
{
return meChrCmprType;
}
-void sw::DocumentSettingManager::setCharacterCompressionType( /*[in]*/SwCharCompressType n )
+void sw::DocumentSettingManager::setCharacterCompressionType( /*[in]*/CharCompressType n )
{
if( meChrCmprType != n )
{
@@ -509,7 +510,7 @@ void sw::DocumentSettingManager::setCharacterCompressionType( /*[in]*/SwCharComp
SdrModel *pDrawModel = m_rDoc.getIDocumentDrawModelAccess().GetDrawModel();
if( pDrawModel )
{
- pDrawModel->SetCharCompressType( static_cast<sal_uInt16>(n) );
+ pDrawModel->SetCharCompressType( n );
if( !m_rDoc.IsInReading() )
pDrawModel->ReformatAllTextObjects();
}
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
index 53ea2abe3ea3..b1dd50b45bc5 100644
--- a/sw/source/core/draw/drawdoc.cxx
+++ b/sw/source/core/draw/drawdoc.cxx
@@ -96,8 +96,7 @@ SwDrawModel::SwDrawModel(SwDoc *const pDoc)
SetForbiddenCharsTable(m_pDoc->GetDocumentSettingManager().getForbiddenCharacterTable());
// Implementation for asian compression
- SetCharCompressType( static_cast<sal_uInt16>(
- m_pDoc->GetDocumentSettingManager().getCharacterCompressionType()));
+ SetCharCompressType( m_pDoc->GetDocumentSettingManager().getCharacterCompressionType() );
}
// Destructor
diff --git a/sw/source/core/inc/DocumentSettingManager.hxx b/sw/source/core/inc/DocumentSettingManager.hxx
index ae835d7d64e6..a71966d4c3a0 100644
--- a/sw/source/core/inc/DocumentSettingManager.hxx
+++ b/sw/source/core/inc/DocumentSettingManager.hxx
@@ -32,7 +32,7 @@ class DocumentSettingManager :
sal_uInt16 mnLinkUpdMode; //< UpdateMode for links.
SwFieldUpdateFlags meFieldUpdMode;//< Automatically Update Mode for fields/charts.
- SwCharCompressType meChrCmprType;//< for ASIAN: compress punctuation/kana
+ CharCompressType meChrCmprType;//< for ASIAN: compress punctuation/kana
sal_uInt32 mn32DummyCompatibilityOptions1;
sal_uInt32 mn32DummyCompatibilityOptions2;
@@ -171,8 +171,8 @@ public:
virtual void setLinkUpdateMode( /*[in]*/ sal_uInt16 nMode ) override;
virtual SwFieldUpdateFlags getFieldUpdateFlags( /*[in]*/bool bGlobalSettings ) const override;
virtual void setFieldUpdateFlags( /*[in]*/ SwFieldUpdateFlags eMode ) override;
- virtual SwCharCompressType getCharacterCompressionType() const override;
- virtual void setCharacterCompressionType( /*[in]*/SwCharCompressType nType ) override;
+ virtual CharCompressType getCharacterCompressionType() const override;
+ virtual void setCharacterCompressionType( /*[in]*/CharCompressType nType ) override;
// Replace all compatibility options with those from rSource.
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index f2a3247e0745..c37319d06b62 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -38,6 +38,7 @@
#include <editeng/scripttypeitem.hxx>
#include <editeng/charhiddenitem.hxx>
#include <vcl/outdev.hxx>
+#include <svl/asiancfg.hxx>
#include <editeng/blinkitem.hxx>
#include <tools/multisel.hxx>
#include <unotools/charclass.hxx>
@@ -739,7 +740,7 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL )
sal_Int16 nScript = i18n::ScriptType::LATIN;
// compression type
- const SwCharCompressType aCompEnum = rNode.getIDocumentSettingAccess()->getCharacterCompressionType();
+ const CharCompressType aCompEnum = rNode.getIDocumentSettingAccess()->getCharacterCompressionType();
// justification type
const bool bAdjustBlock = SVX_ADJUST_BLOCK ==
@@ -763,7 +764,7 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL )
break;
}
}
- if( CHARCOMPRESS_NONE != aCompEnum )
+ if( CharCompressType::NONE != aCompEnum )
{
while( nCntComp < CountCompChg() )
{
@@ -926,7 +927,7 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL )
// if current script is asian, we search for compressable characters
// in this range
- if ( CHARCOMPRESS_NONE != aCompEnum &&
+ if ( CharCompressType::NONE != aCompEnum &&
i18n::ScriptType::ASIAN == nScript )
{
CompType ePrevState = NONE;
@@ -966,7 +967,7 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL )
if ( ePrevState != NONE )
{
// insert start and type
- if ( CHARCOMPRESS_PUNCTUATION_KANA == aCompEnum ||
+ if ( CharCompressType::PunctuationAndKana == aCompEnum ||
ePrevState != KANA )
{
aCompressionChanges.push_back( CompressionChangeInfo(nPrevChg, nLastCompression - nPrevChg, ePrevState) );
@@ -984,7 +985,7 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL )
if ( ePrevState != NONE )
{
// insert start and type
- if ( CHARCOMPRESS_PUNCTUATION_KANA == aCompEnum ||
+ if ( CharCompressType::PunctuationAndKana == aCompEnum ||
ePrevState != KANA )
{
aCompressionChanges.push_back( CompressionChangeInfo(nPrevChg, nLastCompression - nPrevChg, ePrevState) );
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 7994b3d9b73e..11115fab62ba 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -763,7 +763,7 @@ void WW8Export::ExportDopTypography(WW8DopTypography &rTypo)
const IDocumentSettingAccess& rIDocumentSettingAccess = GetWriter().getIDocumentSettingAccess();
rTypo.fKerningPunct = sal_uInt16(rIDocumentSettingAccess.get(DocumentSettingId::KERN_ASIAN_PUNCTUATION));
- rTypo.iJustification = m_pDoc->getIDocumentSettingAccess().getCharacterCompressionType();
+ rTypo.iJustification = sal_uInt16(m_pDoc->getIDocumentSettingAccess().getCharacterCompressionType());
}
// It can only be found something with this method, if it is used within
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 6bec800c8bce..29c0a35a7580 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2030,7 +2030,7 @@ void SwWW8ImplReader::ImportDopTypography(const WW8DopTypography &rTypo)
}
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::KERN_ASIAN_PUNCTUATION, rTypo.fKerningPunct);
- m_rDoc.getIDocumentSettingAccess().setCharacterCompressionType(static_cast<SwCharCompressType>(rTypo.iJustification));
+ m_rDoc.getIDocumentSettingAccess().setCharacterCompressionType((CharCompressType)rTypo.iJustification);
}
/**
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index 23361fcff200..a547c945bb92 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -138,7 +138,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
}
m_pDoc->getIDocumentSettingAccess().set(DocumentSettingId::KERN_ASIAN_PUNCTUATION,
!aAsian.IsKerningWesternTextOnly());
- m_pDoc->getIDocumentSettingAccess().setCharacterCompressionType(static_cast<SwCharCompressType>(aAsian.GetCharDistanceCompression()));
+ m_pDoc->getIDocumentSettingAccess().setCharacterCompressionType(aAsian.GetCharDistanceCompression());
m_pDoc->getIDocumentDeviceAccess().setPrintData(*SW_MOD()->GetPrtOptions(bWeb));
}
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index f207b3a205b8..660046dc3288 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -44,6 +44,7 @@
#include <sfx2/zoomitem.hxx>
#include <unomod.hxx>
#include <vcl/svapp.hxx>
+#include <svl/asiancfg.hxx>
#include <comphelper/servicehelper.hxx>
#include "swmodule.hxx"
@@ -449,16 +450,16 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
{
sal_Int16 nMode = 0;
rValue >>= nMode;
- switch (nMode)
+ switch ((CharCompressType)nMode)
{
- case CHARCOMPRESS_NONE:
- case CHARCOMPRESS_PUNCTUATION:
- case CHARCOMPRESS_PUNCTUATION_KANA:
+ case CharCompressType::NONE:
+ case CharCompressType::PunctuationOnly:
+ case CharCompressType::PunctuationAndKana:
break;
default:
throw IllegalArgumentException();
}
- mpDoc->getIDocumentSettingAccess().setCharacterCompressionType(static_cast < SwCharCompressType > (nMode) );
+ mpDoc->getIDocumentSettingAccess().setCharacterCompressionType((CharCompressType)nMode);
}
break;
case HANDLE_APPLY_USER_DATA: