diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-04-25 15:00:30 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-04-25 15:20:58 +0200 |
commit | 0afab16d9afb8ccd1f089447868b25a960ec595b (patch) | |
tree | 16c3b6dac418f48816f9637c768e8bd0d76bf861 /oox | |
parent | 8166244e7354e879d16e150738e3b3dff885cab5 (diff) |
support manualLayout for legends OOXML export, tdf#88848
Change-Id: If7ac2a2294e20617fd8b599597085658051f5515
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/chartexport.cxx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index e0f87458782d..263db8d7e122 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -996,6 +996,39 @@ void ChartExport::exportLegend( Reference< css::chart::XChartDocument > rChartDo pFS->singleElement( FSNS( XML_c, XML_legendPos ), XML_val, strPos, FSEND ); + } + + uno::Any aRelativePos = xProp->getPropertyValue("RelativePosition"); + if (aRelativePos.hasValue()) + { + chart2::RelativePosition aPos = aRelativePos.get<chart2::RelativePosition>(); + pFS->startElement(FSNS(XML_c, XML_layout), FSEND); + pFS->startElement(FSNS(XML_c, XML_manualLayout), FSEND); + + pFS->singleElement(FSNS(XML_c, XML_xMode), + XML_val, "edge", + FSEND); + pFS->singleElement(FSNS(XML_c, XML_yMode), + XML_val, "edge", + FSEND); + + double x = aPos.Primary; + double y = aPos.Secondary; + + pFS->singleElement(FSNS(XML_c, XML_x), + XML_val, IS(x), + FSEND); + pFS->singleElement(FSNS(XML_c, XML_y), + XML_val, IS(y), + FSEND); + SAL_WARN_IF(aPos.Anchor != 0, "oox.chart", "unsupported anchor position"); + + pFS->endElement(FSNS(XML_c, XML_manualLayout)); + pFS->endElement(FSNS(XML_c, XML_layout)); + } + + if (strPos != NULL) + { pFS->singleElement( FSNS( XML_c, XML_overlay ), XML_val, "0", FSEND ); |