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 --- cui/source/options/optasian.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'cui') diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index 71e50780a5ff..5509f0c526f1 100644 --- a/cui/source/options/optasian.cxx +++ b/cui/source/options/optasian.cxx @@ -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(); -- cgit