summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-25 00:51:37 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-25 02:17:46 +0200
commitbee3934bb68f38e89bb33f75f405099ca08d59a9 (patch)
tree93d0cf359869dec35cfb14550427cf1a1a1008e5
parentaa0d8ccbe55bd93e819fe53e781d0c8b0a3f3a77 (diff)
first part for axis title manual position export, tdf#75015
Change-Id: Ib49ea2e76805e68ff71a52d9308258969454aaca
-rw-r--r--oox/source/export/chartexport.cxx49
1 files changed, 46 insertions, 3 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 5a5106697d0b..e53540e3acdc 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -83,6 +83,8 @@
#include <com/sun/star/text/WritingMode.hpp>
#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/embed/XVisualObject.hpp>
+#include <com/sun/star/embed/Aspects.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/random.hxx>
@@ -1066,9 +1068,50 @@ void ChartExport::exportTitle( Reference< XShape > xShape )
pFS->endElement( FSNS( XML_c, XML_rich ) );
pFS->endElement( FSNS( XML_c, XML_tx ) );
- // TODO:customize layout
- pFS->singleElement( FSNS( XML_c, XML_layout ),
- FSEND );
+ uno::Any aManualLayout = xPropSet->getPropertyValue("RelativePosition");
+ if (aManualLayout.hasValue())
+ {
+ 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);
+
+ Reference<embed::XVisualObject> xVisObject(mxChartModel, uno::UNO_QUERY);
+ awt::Size aPageSize = xVisObject->getVisualAreaSize(embed::Aspects::MSOLE_CONTENT);
+
+ // awt::Size aSize = xShape->getSize();
+ awt::Point aPos2 = xShape->getPosition();
+ double x = (double)aPos2.X / (double) aPageSize.Width;
+ double y = (double)aPos2.Y / (double) aPageSize.Height;
+ /*
+ pFS->singleElement(FSNS(XML_c, XML_wMode),
+ XML_val, "edge",
+ FSEND);
+ pFS->singleElement(FSNS(XML_c, XML_hMode),
+ XML_val, "edge",
+ FSEND);
+ */
+ pFS->singleElement(FSNS(XML_c, XML_x),
+ XML_val, IS(x),
+ FSEND);
+ pFS->singleElement(FSNS(XML_c, XML_y),
+ XML_val, IS(y),
+ FSEND);
+ /*
+ pFS->singleElement(FSNS(XML_c, XML_w),
+ XML_val, "",
+ FSEND);
+ pFS->singleElement(FSNS(XML_c, XML_h),
+ XML_val, "",
+ FSEND);
+ */
+ pFS->endElement(FSNS(XML_c, XML_manualLayout));
+ pFS->endElement(FSNS(XML_c, XML_layout));
+ }
pFS->singleElement( FSNS(XML_c, XML_overlay),
XML_val, "0",