diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-04-25 03:44:58 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-04-25 04:13:37 +0200 |
commit | 7dc420b1099f05c90be436d88381f4040ef05532 (patch) | |
tree | 25fbe8d64079a268c76b19a55227138a6f74caa3 /oox | |
parent | 983396013539ab4643df43afa72a5d14472f9ea8 (diff) |
correct handling for manualLayout with differen anchor, tdf#90851
Change-Id: I6ec242b955e1f5623041cc8f8779b6c2be0f126c
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/chartexport.cxx | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 58a532932d8f..76d9ec892c42 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1288,20 +1288,60 @@ void ChartExport::exportManualLayout(const css::chart2::RelativePosition& rPos, XML_val, "edge", FSEND); + double x = rPos.Primary; + double y = rPos.Secondary; + double w = rSize.Primary; + double h = rSize.Secondary; + switch (rPos.Anchor) + { + case drawing::Alignment_LEFT: + y -= (h/2); + break; + case drawing::Alignment_TOP_LEFT: + break; + case drawing::Alignment_BOTTOM_LEFT: + y -= h; + break; + case drawing::Alignment_TOP: + x -= (w/2); + break; + case drawing::Alignment_CENTER: + x -= (w/2); + y -= (h/2); + break; + case drawing::Alignment_BOTTOM: + x -= (w/2); + y -= h; + break; + case drawing::Alignment_TOP_RIGHT: + x -= w; + break; + case drawing::Alignment_BOTTOM_RIGHT: + x -= w; + y -= h; + break; + case drawing::Alignment_RIGHT: + y -= (h/2); + x -= w; + break; + default: + SAL_WARN("oox.chart", "unhandled alignment case for manual layout export"); + } + pFS->singleElement(FSNS(XML_c, XML_x), - XML_val, IS(rPos.Primary), + XML_val, IS(x), FSEND); pFS->singleElement(FSNS(XML_c, XML_y), - XML_val, IS(rPos.Secondary), + XML_val, IS(y), FSEND); pFS->singleElement(FSNS(XML_c, XML_w), - XML_val, IS(rSize.Primary), + XML_val, IS(w), FSEND); pFS->singleElement(FSNS(XML_c, XML_h), - XML_val, IS(rSize.Secondary), + XML_val, IS(h), FSEND); pFS->endElement(FSNS(XML_c, XML_manualLayout)); |