convert CharCompressType to scoped enum

and move it to svl, where it belongs

Change-Id: Ic4d846419dfe2dd85de5ade8ed1a041867bbf1dc
This commit is contained in:
Noel Grandin 2017-02-13 08:17:10 +02:00
parent 80d2fa87fd
commit b8d977c017
31 changed files with 100 additions and 105 deletions

View File

@ -187,13 +187,14 @@ bool SvxAsianLayoutPage::FillItemSet( SfxItemSet* )
if(m_pNoCompressionRB->IsValueChangedFromSaved() ||
m_pPunctCompressionRB->IsValueChangedFromSaved())
{
sal_Int16 nSet = m_pNoCompressionRB->IsChecked() ? 0 :
m_pPunctCompressionRB->IsChecked() ? 1 : 2;
CharCompressType nSet = m_pNoCompressionRB->IsChecked() ? CharCompressType::NONE :
m_pPunctCompressionRB->IsChecked() ? CharCompressType::PunctuationOnly :
CharCompressType::PunctuationAndKana;
pImpl->aConfig.SetCharDistanceCompression(nSet);
OUString sCompress(cCharacterCompressionType);
if(pImpl->xPrSetInfo.is() && pImpl->xPrSetInfo->hasPropertyByName(sCompress))
{
pImpl->xPrSet->setPropertyValue(sCompress, Any(nSet));
pImpl->xPrSet->setPropertyValue(sCompress, Any((sal_uInt16)nSet));
}
}
pImpl->aConfig.Commit();
@ -238,7 +239,7 @@ void SvxAsianLayoutPage::Reset( const SfxItemSet* )
pImpl->xPrSetInfo = pImpl->xPrSet->getPropertySetInfo();
OUString sForbidden("ForbiddenCharacters");
bool bKernWesternText = pImpl->aConfig.IsKerningWesternTextOnly();
sal_Int16 nCompress = pImpl->aConfig.GetCharDistanceCompression();
CharCompressType nCompress = pImpl->aConfig.GetCharDistanceCompression();
if(pImpl->xPrSetInfo.is())
{
if(pImpl->xPrSetInfo->hasPropertyByName(sForbidden))
@ -250,7 +251,9 @@ void SvxAsianLayoutPage::Reset( const SfxItemSet* )
if(pImpl->xPrSetInfo->hasPropertyByName(sCompress))
{
Any aVal = pImpl->xPrSet->getPropertyValue(sCompress);
aVal >>= nCompress;
sal_uInt16 nTmp;
if (aVal >>= nTmp)
nCompress = (CharCompressType)nTmp;
}
OUString sPunct(cIsKernAsianPunctuation);
if(pImpl->xPrSetInfo->hasPropertyByName(sPunct))
@ -276,8 +279,8 @@ void SvxAsianLayoutPage::Reset( const SfxItemSet* )
m_pCharPunctKerningRB->Check();
switch(nCompress)
{
case 0 : m_pNoCompressionRB->Check(); break;
case 1 : m_pPunctCompressionRB->Check(); break;
case CharCompressType::NONE : m_pNoCompressionRB->Check(); break;
case CharCompressType::PunctuationOnly : m_pPunctCompressionRB->Check(); break;
default: m_pPunctKanaCompressionRB->Check();
}
m_pCharKerningRB->SaveValue();

View File

@ -482,7 +482,7 @@ EditSelection EditEngine::TransliterateText(const EditSelection& rSelection, sal
return pImpEditEngine->TransliterateText(rSelection, nTransliterationMode);
}
void EditEngine::SetAsianCompressionMode( sal_uInt16 n )
void EditEngine::SetAsianCompressionMode( CharCompressType n )
{
pImpEditEngine->SetAsianCompressionMode( n );
}

View File

@ -444,7 +444,7 @@ private:
sal_uInt16 nStretchX;
sal_uInt16 nStretchY;
sal_uInt16 nAsianCompressionMode;
CharCompressType nAsianCompressionMode;
EEHorizontalTextDirection eDefaultHorizontalTextDirection;
@ -998,8 +998,8 @@ public:
EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode );
short ReplaceTextOnly( ContentNode* pNode, sal_Int32 nCurrentStart, sal_Int32 nLen, const OUString& rText, const css::uno::Sequence< sal_Int32 >& rOffsets );
void SetAsianCompressionMode( sal_uInt16 n );
sal_uInt16 GetAsianCompressionMode() const { return nAsianCompressionMode; }
void SetAsianCompressionMode( CharCompressType n );
CharCompressType GetAsianCompressionMode() const { return nAsianCompressionMode; }
void SetKernAsianPunctuation( bool b );
bool IsKernAsianPunctuation() const { return bKernAsianPunctuation; }

View File

@ -61,6 +61,7 @@
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
#include <svl/asiancfg.hxx>
#include <o3tl/make_unique.hxx>
#include <comphelper/lok.hxx>
@ -131,7 +132,7 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) :
eDefLanguage = LANGUAGE_DONTKNOW;
maBackgroundColor = COL_AUTO;
nAsianCompressionMode = text::CharacterCompressionType::NONE;
nAsianCompressionMode = CharCompressType::NONE;
eDefaultHorizontalTextDirection = EE_HTEXTDIR_DEFAULT;

View File

@ -52,6 +52,7 @@
#include <svtools/colorcfg.hxx>
#include <svl/ctloptions.hxx>
#include <svl/asiancfg.hxx>
#include <editeng/forbiddencharacterstable.hxx>
@ -1140,7 +1141,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
}
// And now check for Compression:
if ( !bContinueLastPortion && nPortionLen && GetAsianCompressionMode() )
if ( !bContinueLastPortion && nPortionLen && GetAsianCompressionMode() != CharCompressType::NONE )
{
EditLine::CharPosArrayType& rArray = pLine->GetCharPosArray();
long* pDXArray = rArray.data() + nTmpPos - pLine->GetStart();
@ -4315,7 +4316,7 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode,
long* pDXArray, sal_uInt16 n100thPercentFromMax,
bool bManipulateDXArray)
{
DBG_ASSERT( GetAsianCompressionMode(), "ImplCalcAsianCompression - Why?" );
DBG_ASSERT( GetAsianCompressionMode() != CharCompressType::NONE, "ImplCalcAsianCompression - Why?" );
DBG_ASSERT( pTextPortion->GetLen(), "ImplCalcAsianCompression - Empty Portion?" );
// Percent is 1/100 Percent...
@ -4333,7 +4334,7 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode,
AsianCompressionFlags nType = GetCharTypeForCompression( pNode->GetChar( n+nStartPos ) );
bool bCompressPunctuation = ( nType == AsianCompressionFlags::PunctuationLeft ) || ( nType == AsianCompressionFlags::PunctuationRight );
bool bCompressKana = ( nType == AsianCompressionFlags::Kana ) && ( GetAsianCompressionMode() == text::CharacterCompressionType::PUNCTUATION_AND_KANA );
bool bCompressKana = ( nType == AsianCompressionFlags::Kana ) && ( GetAsianCompressionMode() == CharCompressType::PunctuationAndKana );
// create Extra infos only if needed...
if ( bCompressPunctuation || bCompressKana )

View File

@ -3064,7 +3064,7 @@ short ImpEditEngine::ReplaceTextOnly(
}
void ImpEditEngine::SetAsianCompressionMode( sal_uInt16 n )
void ImpEditEngine::SetAsianCompressionMode( CharCompressType n )
{
if ( n != nAsianCompressionMode )
{

View File

@ -283,7 +283,7 @@ EEControlBits Outliner::GetControlWord() const
return pEditEngine->GetControlWord();
}
void Outliner::SetAsianCompressionMode( sal_uInt16 n )
void Outliner::SetAsianCompressionMode( CharCompressType n )
{
pEditEngine->SetAsianCompressionMode( n );
}

View File

@ -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 );

View File

@ -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 );

View File

@ -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;

View File

@ -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<SdrOutliner*> GetActiveOutliners() const;
std::unique_ptr<SdrModelImpl> mpImpl;
sal_uInt16 mnCharCompressType;
CharCompressType mnCharCompressType;
sal_uInt16 mnHandoutPageCount;
bool mbModelLocked;
bool mbKernAsianPunctuation;
@ -532,8 +533,8 @@ public:
void SetForbiddenCharsTable( const rtl::Reference<SvxForbiddenCharactersTable>& xForbiddenChars );
const rtl::Reference<SvxForbiddenCharactersTable>& 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; }

View File

@ -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;}

View File

@ -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() );

View File

@ -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 ),

View File

@ -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 )

View File

@ -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() )

View File

@ -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 )

View File

@ -812,19 +812,19 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries,
{
bOk = true;
pDoc->SetCharCompressType( (sal_uInt16)nCharCompressType );
pDoc->SetCharCompressType( (CharCompressType)nCharCompressType );
SdDrawDocument* pDocument = pDocSh->GetDoc();
SdrOutliner& rOutl = pDocument->GetDrawOutliner();
rOutl.SetAsianCompressionMode( (sal_uInt16)nCharCompressType );
rOutl.SetAsianCompressionMode( (CharCompressType)nCharCompressType );
SdOutliner* pOutl = pDocument->GetOutliner( false );
if( pOutl )
{
pOutl->SetAsianCompressionMode( (sal_uInt16)nCharCompressType );
pOutl->SetAsianCompressionMode( (CharCompressType)nCharCompressType );
}
pOutl = pDocument->GetInternalOutliner( false );
if( pOutl )
{
pOutl->SetAsianCompressionMode( (sal_uInt16)nCharCompressType );
pOutl->SetAsianCompressionMode( (CharCompressType)nCharCompressType );
}
}
break;

View File

@ -87,15 +87,15 @@ void SvxAsianConfig::SetKerningWesternTextOnly(bool value) {
value, impl_->batch);
}
sal_Int16 SvxAsianConfig::GetCharDistanceCompression() const {
return
CharCompressType SvxAsianConfig::GetCharDistanceCompression() const {
return (CharCompressType)
officecfg::Office::Common::AsianLayout::CompressCharacterDistance::get(
impl_->context);
}
void SvxAsianConfig::SetCharDistanceCompression(sal_Int16 value) {
void SvxAsianConfig::SetCharDistanceCompression(CharCompressType value) {
officecfg::Office::Common::AsianLayout::CompressCharacterDistance::set(
value, impl_->batch);
(sal_uInt16)value, impl_->batch);
}
css::uno::Sequence< css::lang::Locale > SvxAsianConfig::GetStartEndCharLocales()

View File

@ -35,6 +35,7 @@
#include <unotools/configmgr.hxx>
#include <svl/whiter.hxx>
#include <svl/asiancfg.hxx>
#include <svx/xit.hxx>
#include <svx/xbtmpit.hxx>
#include <svx/xlndsit.hxx>
@ -165,11 +166,11 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
mbDisableTextEditUsesCommonUndoManager = false;
if (!utl::ConfigManager::IsAvoidConfig())
mnCharCompressType =
mnCharCompressType = (CharCompressType)
officecfg::Office::Common::AsianLayout::CompressCharacterDistance::
get();
else
mnCharCompressType = 0;
mnCharCompressType = CharCompressType::NONE;
#ifdef OSL_LITENDIAN
nStreamNumberFormat=SvStreamEndian::LITTLE;
@ -1865,7 +1866,7 @@ void SdrModel::SetForbiddenCharsTable( const rtl::Reference<SvxForbiddenCharacte
}
void SdrModel::SetCharCompressType( sal_uInt16 nType )
void SdrModel::SetCharCompressType( CharCompressType nType )
{
if( nType != mnCharCompressType )
{

View File

@ -22,11 +22,11 @@
#include <tools/solar.h>
#include <rtl/ref.hxx>
#include <chcmprse.hxx>
#include <fldupde.hxx>
class SvxForbiddenCharactersTable;
namespace com { namespace sun { namespace star { namespace i18n { struct ForbiddenCharacters; } } } }
enum class CharCompressType;
enum class DocumentSettingId
{
@ -204,14 +204,14 @@ enum class DocumentSettingId
@returns
the current character compression mode.
*/
virtual SwCharCompressType getCharacterCompressionType() const = 0;
virtual CharCompressType getCharacterCompressionType() const = 0;
/** Set the character compression type for Asian characters.
@param nMode
[in] the new character compression type.
*/
virtual void setCharacterCompressionType( /*[in]*/SwCharCompressType nType ) = 0;
virtual void setCharacterCompressionType( /*[in]*/CharCompressType nType ) = 0;
/** Get the n32DummyCompatabilityOptions1
*/

View File

@ -1,28 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SW_INC_CHCMPRSE_HXX
#define INCLUDED_SW_INC_CHCMPRSE_HXX
enum SwCharCompressType{ CHARCOMPRESS_NONE,
CHARCOMPRESS_PUNCTUATION,
CHARCOMPRESS_PUNCTUATION_KANA };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -35,7 +35,6 @@
#include <flypos.hxx>
#include <itabenum.hxx>
#include <swdbdata.hxx>
#include <chcmprse.hxx>
#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
#include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
#include <sfx2/objsh.hxx>

View File

@ -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();
}

View File

@ -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

View File

@ -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.

View File

@ -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) );

View File

@ -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

View File

@ -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);
}
/**

View File

@ -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));
}

View File

@ -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: