summaryrefslogtreecommitdiff
path: root/editeng/source/uno
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-31 09:11:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-01 12:34:37 +0100
commitae5f89fdcccb2cf74256b04771249fc8afca8794 (patch)
tree7b9235188fbfc8fb74edf7be3e4c2c351638c8a3 /editeng/source/uno
parente02efb621fe672aa52e56caa916cf5c3fd0a9cb8 (diff)
split out SFX_METRIC_ITEM into separate field
instead of overloading the nMemberId field and thus fix various places that were effectively setting the METRIC flag and causing a warning in SvxUnoConvertToMM And fix bug in sw/source/core/unocore/unomap.cxx where the PropertyAttribute::READONLY was in the wrong place, ever since commit 84a3db80b4fd66c6854b3135b5f69b61fd828e62 Date: Mon Sep 18 23:08:29 2000 +0000 initial import Change-Id: Ifc2bf56709f19aea75300b2fda62ce551efc26af Reviewed-on: https://gerrit.libreoffice.org/48950 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source/uno')
-rw-r--r--editeng/source/uno/unoipset.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx
index 862a4f5caed5..01e014a47530 100644
--- a/editeng/source/uno/unoipset.cxx
+++ b/editeng/source/uno/unoipset.cxx
@@ -103,14 +103,14 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
pItem = &(pPool->GetDefaultItem( pMap->nWID ));
const MapUnit eMapUnit = pPool ? pPool->GetMetric(static_cast<sal_uInt16>(pMap->nWID)) : MapUnit::Map100thMM;
- sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
+ sal_uInt8 nMemberId = pMap->nMemberId;
if( eMapUnit == MapUnit::Map100thMM )
nMemberId &= (~CONVERT_TWIPS);
if(pItem)
{
pItem->QueryValue( aVal, nMemberId );
- if( pMap->nMemberId & SFX_METRIC_ITEM )
+ if( pMap->nMoreFlags & PropertyMoreFlags::METRIC_ITEM )
{
if( eMapUnit != MapUnit::Map100thMM )
{
@@ -166,7 +166,7 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa
const MapUnit eMapUnit = pPool ? pPool->GetMetric(static_cast<sal_uInt16>(pMap->nWID)) : MapUnit::Map100thMM;
// check for needed metric translation
- if( (pMap->nMemberId & SFX_METRIC_ITEM) && eMapUnit != MapUnit::Map100thMM )
+ if( (pMap->nMoreFlags & PropertyMoreFlags::METRIC_ITEM) && eMapUnit != MapUnit::Map100thMM )
{
if ( !bDontConvertNegativeValues || SvxUnoCheckForPositiveValue( aValue ) )
SvxUnoConvertFromMM( eMapUnit, aValue );
@@ -174,7 +174,7 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa
SfxPoolItem *pNewItem = pItem->Clone();
- sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
+ sal_uInt8 nMemberId = pMap->nMemberId;
if( eMapUnit == MapUnit::Map100thMM )
nMemberId &= (~CONVERT_TWIPS);
@@ -198,7 +198,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
// No UsrAny detected yet, generate Default entry and return this
const MapUnit eMapUnit = mrItemPool.GetMetric(static_cast<sal_uInt16>(pMap->nWID));
- sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
+ sal_uInt8 nMemberId = pMap->nMemberId;
if( eMapUnit == MapUnit::Map100thMM )
nMemberId &= (~CONVERT_TWIPS);
uno::Any aVal;
@@ -222,10 +222,10 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
}
}
- if( pMap->nMemberId & SFX_METRIC_ITEM )
+ if( pMap->nMoreFlags & PropertyMoreFlags::METRIC_ITEM )
{
// check for needed metric translation
- if(pMap->nMemberId & SFX_METRIC_ITEM && eMapUnit != MapUnit::Map100thMM)
+ if(pMap->nMoreFlags & PropertyMoreFlags::METRIC_ITEM && eMapUnit != MapUnit::Map100thMM)
{
SvxUnoConvertToMM( eMapUnit, aVal );
}
@@ -299,6 +299,7 @@ void SvxUnoConvertToMM( const MapUnit eSourceMapUnit, uno::Any & rMetric ) throw
break;
default:
SAL_WARN("editeng", "AW: Missing unit translation to 100th mm, " << OString::number(static_cast<sal_Int32>(rMetric.getValueTypeClass())));
+ assert(false);
}
break;
}