diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-18 17:36:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-01-18 21:22:53 +0100 |
commit | fa68bed11c180ebb0d45fb7779d538098b2921ff (patch) | |
tree | 03514f0647a746badcac197cded01951ba6f7d12 | |
parent | 252ce90e39648c47bcfdb39547d0ac82bacdbae6 (diff) |
crashtesting: multiple export failures
since...
commit 84392651d2731cce91c3b2e144bed4ac07e4ddf1
Date: Wed Jan 3 23:27:16 2018 +0100
tdf#114173 Preserve size of chart legend during xlsx export
Change-Id: Iebc936a0f490d6b707dfee0343732753f56728e7
Reviewed-on: https://gerrit.libreoffice.org/48147
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | oox/source/export/chartexport.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 3e9376f05662..72cfae098c67 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -863,7 +863,9 @@ void ChartExport::exportLegend( const Reference< css::chart::XChartDocument >& x FSEND); chart2::RelativePosition aPos = aRelativePos.get<chart2::RelativePosition>(); uno::Any aRelativeSize = xProp->getPropertyValue("RelativeSize"); - chart2::RelativeSize aSize = aRelativeSize.get<chart2::RelativeSize>(); + chart2::RelativeSize aSize; + if (aRelativeSize.hasValue()) + aSize = aRelativeSize.get<chart2::RelativeSize>(); const double x = aPos.Primary; const double y = aPos.Secondary; @@ -877,13 +879,17 @@ void ChartExport::exportLegend( const Reference< css::chart::XChartDocument >& x XML_val, IS(y), FSEND); - pFS->singleElement(FSNS(XML_c, XML_w), - XML_val, IS(w), - FSEND); + if (aRelativeSize.hasValue()) + { + pFS->singleElement(FSNS(XML_c, XML_w), + XML_val, IS(w), + FSEND); + + pFS->singleElement(FSNS(XML_c, XML_h), + XML_val, IS(h), + FSEND); + } - pFS->singleElement(FSNS(XML_c, XML_h), - XML_val, IS(h), - FSEND); SAL_WARN_IF(aPos.Anchor != css::drawing::Alignment_TOP_LEFT, "oox", "unsupported anchor position"); pFS->endElement(FSNS(XML_c, XML_manualLayout)); |