diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-18 17:36:31 +0000 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-01-26 22:44:05 +0100 |
commit | 0d55bd08f77c01fa6e34becc1505268dda7851b8 (patch) | |
tree | 4029d4fea1bcc893b6a3a103f32ff264750907ed /oox | |
parent | 8c01c25ac4f85266719dc04e9809da2f3eb5b10e (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>
(cherry picked from commit fa68bed11c180ebb0d45fb7779d538098b2921ff)
Reviewed-on: https://gerrit.libreoffice.org/48153
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/chartexport.cxx | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index cf00594d23c1..128a166c6c4a 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -862,13 +862,9 @@ void ChartExport::exportLegend( const Reference< css::chart::XChartDocument >& x XML_val, "edge", FSEND); chart2::RelativePosition aPos = aRelativePos.get<chart2::RelativePosition>(); - uno::Any aRelativeSize = xProp->getPropertyValue("RelativeSize"); - chart2::RelativeSize aSize = aRelativeSize.get<chart2::RelativeSize>(); const double x = aPos.Primary; const double y = aPos.Secondary; - const double w = aSize.Primary; - const double h = aSize.Secondary; pFS->singleElement(FSNS(XML_c, XML_x), XML_val, IS(x), @@ -877,13 +873,23 @@ 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); + uno::Any aRelativeSize = xProp->getPropertyValue("RelativeSize"); + if (aRelativeSize.hasValue()) + { + chart2::RelativeSize aSize = aRelativeSize.get<chart2::RelativeSize>(); + + const double w = aSize.Primary; + const double h = aSize.Secondary; + + 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)); |