diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/style/GradientStyle.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/style/TransGradientStyle.cxx | 9 |
2 files changed, 8 insertions, 9 deletions
diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx index 0ef830b3616c..0ad8c74c9044 100644 --- a/xmloff/source/style/GradientStyle.cxx +++ b/xmloff/source/style/GradientStyle.cxx @@ -178,9 +178,9 @@ bool XMLGradientStyleImport::importXML( break; case XML_TOK_GRADIENT_ANGLE: { - sal_Int32 nValue; - ::sax::Converter::convertNumber( nValue, rStrValue, 0, 3600 ); - aGradient.Angle = sal_Int16( nValue ); + bool const bSuccess = + ::sax::Converter::convertAngle(aGradient.Angle, rStrValue); + SAL_INFO_IF(!bSuccess, "xmloff.style", "failed to import draw:angle"); } break; case XML_TOK_GRADIENT_BORDER: @@ -288,7 +288,7 @@ bool XMLGradientStyleExport::exportXML( // Angle if( aGradient.Style != awt::GradientStyle_RADIAL ) { - ::sax::Converter::convertNumber(aOut, sal_Int32(aGradient.Angle)); + ::sax::Converter::convertAngle(aOut, aGradient.Angle); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, aStrValue ); } diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx index 85c66ec3eafb..7b1ca1515193 100644 --- a/xmloff/source/style/TransGradientStyle.cxx +++ b/xmloff/source/style/TransGradientStyle.cxx @@ -178,9 +178,9 @@ bool XMLTransGradientStyleImport::importXML( break; case XML_TOK_GRADIENT_ANGLE: { - sal_Int32 nValue; - ::sax::Converter::convertNumber( nValue, rStrValue, 0, 3600 ); - aGradient.Angle = sal_Int16( nValue ); + bool const bSuccess = + ::sax::Converter::convertAngle(aGradient.Angle, rStrValue); + SAL_INFO_IF(!bSuccess, "xmloff.style", "failed to import draw:angle"); } break; case XML_TOK_GRADIENT_BORDER: @@ -285,8 +285,7 @@ bool XMLTransGradientStyleExport::exportXML( // Angle if( aGradient.Style != awt::GradientStyle_RADIAL ) { - ::sax::Converter::convertNumber( - aOut, sal_Int32(aGradient.Angle)); + ::sax::Converter::convertAngle(aOut, aGradient.Angle); aStrValue = aOut.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_GRADIENT_ANGLE, aStrValue ); } |