diff options
-rw-r--r-- | sc/source/core/data/dptabsrc.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/unoobj/dapiuno.cxx | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index bf1bad34664c..e289ec995822 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -1560,7 +1560,10 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const OUString& aPropertyName ScGeneralFunction nVal = getFunction(); if (nVal == ScGeneralFunction::MEDIAN) nVal = ScGeneralFunction::NONE; - aRet <<= (sheet::GeneralFunction)nVal; + const int nValAsInt = static_cast<int>(nVal); + assert(nValAsInt >= (int)css::sheet::GeneralFunction_NONE && + nValAsInt <= (int)css::sheet::GeneralFunction_VARP); + aRet <<= (sheet::GeneralFunction)nValAsInt; } else if ( aPropertyName == SC_UNO_DP_FUNCTION2 ) { diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 9ab239548c38..99d8add7102b 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -1832,7 +1832,8 @@ void SAL_CALL ScDataPilotFieldObj::setPropertyValue( const OUString& aPropertyNa std::vector< ScGeneralFunction > aSubTotals(aSeq.getLength()); for (sal_Int32 nIndex = 0; nIndex < aSeq.getLength(); nIndex++) { - aSubTotals[nIndex] = static_cast<ScGeneralFunction>(aSeq[nIndex]); + const int nValAsInt = static_cast<int>(aSeq[nIndex]); + aSubTotals[nIndex] = static_cast<ScGeneralFunction>(nValAsInt); } setSubtotals( aSubTotals ); } |