diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-11-22 14:05:28 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-11-22 16:55:00 +0100 |
commit | c80cbceeed44132320811d9e5f265417447bab5c (patch) | |
tree | 5dff14a9e7bc0ef92776a7deac230f8ce50da512 /xmloff/source | |
parent | f3a302043b2392cf7dcdd5dfe6e418c8e12a6eda (diff) |
PVS: V547 Expression '!aPropertyStates.empty()' is always true.
Identified by M. Kaganski
Change-Id: I02c3ab0ec29367ebc2e73586044d729eab24231d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177029
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 63 |
1 files changed, 30 insertions, 33 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index e2780ee0b684..4e3fa02b7651 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -3152,47 +3152,44 @@ void SchXMLExportHelper_Impl::exportRegressionCurve( } } - if( !aPropertyStates.empty() || bExportEquation ) + // write element + if( bExportContent ) { - // write element - if( bExportContent ) + // add style name attribute + AddAutoStyleAttribute( aPropertyStates ); + + SvXMLElementExport aRegressionExport( mrExport, XML_NAMESPACE_CHART, XML_REGRESSION_CURVE, true, true ); + if( bExportEquation ) { - // add style name attribute - AddAutoStyleAttribute( aPropertyStates ); + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DISPLAY_EQUATION, (bShowEquation ? XML_TRUE : XML_FALSE) ); + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DISPLAY_R_SQUARE, (bShowRSquared ? XML_TRUE : XML_FALSE) ); - SvXMLElementExport aRegressionExport( mrExport, XML_NAMESPACE_CHART, XML_REGRESSION_CURVE, true, true ); - if( bExportEquation ) + // export position + chart2::RelativePosition aRelativePosition; + if( xEquationProperties->getPropertyValue( u"RelativePosition"_ustr ) >>= aRelativePosition ) { - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DISPLAY_EQUATION, (bShowEquation ? XML_TRUE : XML_FALSE) ); - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DISPLAY_R_SQUARE, (bShowRSquared ? XML_TRUE : XML_FALSE) ); - - // export position - chart2::RelativePosition aRelativePosition; - if( xEquationProperties->getPropertyValue( u"RelativePosition"_ustr ) >>= aRelativePosition ) - { - double fX = aRelativePosition.Primary * rPageSize.Width; - double fY = aRelativePosition.Secondary * rPageSize.Height; - awt::Point aPos; - aPos.X = static_cast< sal_Int32 >( ::rtl::math::round( fX )); - aPos.Y = static_cast< sal_Int32 >( ::rtl::math::round( fY )); - addPosition( aPos ); - } - - if( !aEquationPropertyStates.empty()) - { - AddAutoStyleAttribute( aEquationPropertyStates ); - } + double fX = aRelativePosition.Primary * rPageSize.Width; + double fY = aRelativePosition.Secondary * rPageSize.Height; + awt::Point aPos; + aPos.X = static_cast< sal_Int32 >( ::rtl::math::round( fX )); + aPos.Y = static_cast< sal_Int32 >( ::rtl::math::round( fY )); + addPosition( aPos ); + } - SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_EQUATION, true, true ); + if( !aEquationPropertyStates.empty()) + { + AddAutoStyleAttribute( aEquationPropertyStates ); } + + SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_EQUATION, true, true ); } - else // autostyles + } + else // autostyles + { + CollectAutoStyle( std::move(aPropertyStates) ); + if( bExportEquation && !aEquationPropertyStates.empty()) { - CollectAutoStyle( std::move(aPropertyStates) ); - if( bExportEquation && !aEquationPropertyStates.empty()) - { - CollectAutoStyle( std::move(aEquationPropertyStates) ); - } + CollectAutoStyle( std::move(aEquationPropertyStates) ); } } } |