diff options
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index db5fc9edc979..1ccc56cea869 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -1434,7 +1434,9 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& OUStringBuffer aAspectRatioString; ::sax::Converter::convertDouble( aAspectRatioString, - double(aSize.Width)/double(aSize.Height)); + (aSize.Height == 0 + ? 1.0 + : double(aSize.Width)/double(aSize.Height))); mrExport.AddAttribute( XML_NAMESPACE_STYLE, XML_LEGEND_EXPANSION_ASPECT_RATIO, aAspectRatioString.makeStringAndClear() ); } } |