// Put UnoAny in the item value if(eState < SfxItemState::DEFAULT || pItem == nullptr)
{ if( pPool == nullptr )
{
OSL_FAIL( "No default item and no pool?" ); return;
}
/** converts the given any with a metric to 100th/mm if needed */ void SvxUnoConvertToMM( const MapUnit eSourceMapUnit, uno::Any & rMetric ) noexcept
{ // map the metric of the itempool to 100th mm switch(eSourceMapUnit)
{ case MapUnit::MapTwip :
{ switch( rMetric.getValueTypeClass() )
{ case uno::TypeClass_BYTE:
rMetric <<= static_cast<sal_Int8>(convertTwipToMm100(*o3tl::forceAccess<sal_Int8>(rMetric))); break; case uno::TypeClass_SHORT:
rMetric <<= static_cast<sal_Int16>(convertTwipToMm100(*o3tl::forceAccess<sal_Int16>(rMetric))); break; case uno::TypeClass_UNSIGNED_SHORT:
rMetric <<= static_cast<sal_uInt16>(convertTwipToMm100(*o3tl::forceAccess<sal_uInt16>(rMetric))); break; case uno::TypeClass_LONG:
rMetric <<= static_cast<sal_Int32>(convertTwipToMm100(*o3tl::forceAccess<sal_Int32>(rMetric))); break; case uno::TypeClass_UNSIGNED_LONG:
rMetric <<= static_cast<sal_uInt32>(convertTwipToMm100(*o3tl::forceAccess<sal_uInt32>(rMetric))); break; default:
SAL_WARN("editeng", "AW: Missing unit translation to 100th mm, " << OString::number(static_cast<sal_Int32>(rMetric.getValueTypeClass())));
assert(false);
} break;
} default:
{
OSL_FAIL("AW: Missing unit translation to 100th mm!");
}
}
}
/** converts the given any with a metric from 100th/mm to the given metric if needed */ void SvxUnoConvertFromMM( const MapUnit eDestinationMapUnit, uno::Any & rMetric ) noexcept
{ switch(eDestinationMapUnit)
{ case MapUnit::MapTwip :
{ switch( rMetric.getValueTypeClass() )
{ case uno::TypeClass_BYTE:
rMetric <<= static_cast<sal_Int8>(sanitiseMm100ToTwip(*o3tl::forceAccess<sal_Int8>(rMetric))); break; case uno::TypeClass_SHORT:
rMetric <<= static_cast<sal_Int16>(sanitiseMm100ToTwip(*o3tl::forceAccess<sal_Int16>(rMetric))); break; case uno::TypeClass_UNSIGNED_SHORT:
rMetric <<= static_cast<sal_uInt16>(sanitiseMm100ToTwip(*o3tl::forceAccess<sal_uInt16>(rMetric))); break; case uno::TypeClass_LONG:
rMetric <<= static_cast<sal_Int32>(sanitiseMm100ToTwip(*o3tl::forceAccess<sal_Int32>(rMetric))); break; case uno::TypeClass_UNSIGNED_LONG:
rMetric <<= static_cast<sal_uInt32>(sanitiseMm100ToTwip(*o3tl::forceAccess<sal_uInt32>(rMetric))); break; default:
OSL_FAIL("AW: Missing unit translation to 100th mm!");
} break;
} default:
{
OSL_FAIL("AW: Missing unit translation to PoolMetrics!");
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.