Kaydet (Commit) 98339601 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

first part for manualLayout plot area support, tdf#90851

still some positioning problems. Most likely we need to handle
chart2::RelativePosition::Anchor for correct positioning.

Change-Id: Iecd0ced684203d2c11aab3c55e04f8c7f699779a
üst daa28969
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
#include <sax/fshelper.hxx> #include <sax/fshelper.hxx>
#include <vcl/mapmod.hxx> #include <vcl/mapmod.hxx>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
namespace com { namespace sun { namespace star { namespace com { namespace sun { namespace star {
namespace chart { namespace chart {
class XDiagram; class XDiagram;
...@@ -164,6 +167,8 @@ private: ...@@ -164,6 +167,8 @@ private:
void exportErrorBar(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xErrorBarProps, void exportErrorBar(com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xErrorBarProps,
bool bYError); bool bYError);
void exportManualLayout(const css::chart2::RelativePosition& rPos, const css::chart2::RelativeSize& rSize);
void exportAxes( ); void exportAxes( );
void exportAxis(const AxisIdPair& rAxisIdPair); void exportAxis(const AxisIdPair& rAxisIdPair);
void _exportAxis( void _exportAxis(
......
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
#include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDiagram.hpp> #include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp> #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp> #include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp> #include <com/sun/star/chart2/XChartTypeContainer.hpp>
...@@ -1155,9 +1154,19 @@ void ChartExport::exportPlotArea( ) ...@@ -1155,9 +1154,19 @@ void ChartExport::exportPlotArea( )
FSHelperPtr pFS = GetFS(); FSHelperPtr pFS = GetFS();
pFS->startElement( FSNS( XML_c, XML_plotArea ), pFS->startElement( FSNS( XML_c, XML_plotArea ),
FSEND ); FSEND );
// layout
pFS->singleElement( FSNS( XML_c, XML_layout ), Reference<beans::XPropertySet> xWall(mxNewDiagram, uno::UNO_QUERY);
FSEND ); if( xWall.is() )
{
uno::Any aAny = xWall->getPropertyValue("RelativePosition");
if (aAny.hasValue())
{
chart2::RelativePosition aPos = aAny.get<chart2::RelativePosition>();
aAny = xWall->getPropertyValue("RelativeSize");
chart2::RelativeSize aSize = aAny.get<chart2::RelativeSize>();
exportManualLayout(aPos, aSize);
}
}
// chart type // chart type
Sequence< Reference< chart2::XCoordinateSystem > > Sequence< Reference< chart2::XCoordinateSystem > >
...@@ -1267,6 +1276,38 @@ void ChartExport::exportPlotArea( ) ...@@ -1267,6 +1276,38 @@ void ChartExport::exportPlotArea( )
} }
void ChartExport::exportManualLayout(const css::chart2::RelativePosition& rPos, const css::chart2::RelativeSize& rSize)
{
FSHelperPtr pFS = GetFS();
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);
pFS->singleElement(FSNS(XML_c, XML_x),
XML_val, IS(rPos.Primary),
FSEND);
pFS->singleElement(FSNS(XML_c, XML_y),
XML_val, IS(rPos.Secondary),
FSEND);
pFS->singleElement(FSNS(XML_c, XML_w),
XML_val, IS(rSize.Primary),
FSEND);
pFS->singleElement(FSNS(XML_c, XML_h),
XML_val, IS(rSize.Secondary),
FSEND);
pFS->endElement(FSNS(XML_c, XML_manualLayout));
pFS->endElement(FSNS(XML_c, XML_layout));
}
void ChartExport::exportPlotAreaShapeProps( Reference< XPropertySet > xPropSet ) void ChartExport::exportPlotAreaShapeProps( Reference< XPropertySet > xPropSet )
{ {
FSHelperPtr pFS = GetFS(); FSHelperPtr pFS = GetFS();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment