diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-03-11 05:14:47 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-03-11 09:42:31 +0000 |
commit | aa204f1c09a760d6753c408376ab7307fb13ad91 (patch) | |
tree | 53053d03779b9fe0b74b75ead2b88bbef536cb49 /oox | |
parent | 588a85798ae7c44864be0b9d823618fc03e2028c (diff) |
tdf#106217: Wrong size and position of a shape inside chart
Same code which was added to the method
DrawingFragment::onEndElement() in
d178d7bef193565a7d6aacbc37a58dfc4bd7b316
A shape's size and position inside a chart object
are primarily defined by <cdr:from> and <cdr:to> tags in
drawing.xml, but in the same file we also have
an <a:xfrm> tag which is used for the same thing
(defining size and postion) in general. Testing with
MSO it seems it ignores what values are set to <a:xfrm> and
uses only the <cdr:from> and <cdr:to> values.
The test document showing this problem must be created
an earlier version of MSO, becuase <a:xfrm> is set to some
random values. Editing the chart and saving it with MSO
2013 the <a:xfrm> values are set consistently with
<cdr:from> and <cdr:to> pair.
Change-Id: Icbaff78e5a6fcea36678c3b3755c97f57976b626
Reviewed-on: https://gerrit.libreoffice.org/35069
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/chart/chartdrawingfragment.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx index de8d3f2303bf..37261bf3497a 100644 --- a/oox/source/drawingml/chart/chartdrawingfragment.cxx +++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx @@ -216,6 +216,11 @@ void ChartDrawingFragment::onEndElement() getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Y, 0, SAL_MAX_INT32 ), getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Width, 0, SAL_MAX_INT32 ), getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Height, 0, SAL_MAX_INT32 ) ); + + // Set the position and size before calling addShape(). + mxShape->setPosition(awt::Point(aShapeRectEmu.X, aShapeRectEmu.Y)); + mxShape->setSize(awt::Size(aShapeRectEmu.Width, aShapeRectEmu.Height)); + basegfx::B2DHomMatrix aMatrix; mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, aMatrix, mxShape->getFillProperties(), &aShapeRectEmu32 ); } |