[Libreoffice-commits] core.git: oox/source
Caolán McNamara
caolanm at redhat.com
Thu Jan 18 20:23:16 UTC 2018
oox/source/export/chartexport.cxx | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
New commits:
commit fa68bed11c180ebb0d45fb7779d538098b2921ff
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jan 18 17:36:31 2018 +0000
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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));
More information about the Libreoffice-commits
mailing list