diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-26 18:34:15 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-26 19:06:50 +0200 |
commit | 7f9b242331327c5c1b137b91861a6bb57bfb0ecc (patch) | |
tree | 14a2f24b8cc08a5d22054a84cd6c1b655aa9de5c /writerfilter | |
parent | ef58e10844dff60cd218306b059ec81d8421f961 (diff) |
DOCX drawingML import: fix remaining rotation / flip combinations
With this, each rotation = 0 / 90 / 180 / 270 and flip = none /
horizontal / vertical / horizontal+vertical combination (16 cases) are
imported perfectly.
Also adjust a few testcases -- now that in many cases we only set the
position in oox, some rounding errors went away.
Change-Id: I5567a7d6964775f2caf10a0e539f3eb84d10461e
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 0c914afea90b..ce2b764785ea 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -363,17 +363,19 @@ public: uno::makeAny(nVertOrient)); } - void applyRelativePosition(uno::Reference< beans::XPropertySet > xGraphicObjectProperties) const + void applyRelativePosition(uno::Reference< beans::XPropertySet > xGraphicObjectProperties, bool bRelativeOnly = false) const { PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier(); - xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_HORI_ORIENT_POSITION), - uno::makeAny(nLeftPosition)); + if (!bRelativeOnly) + xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_HORI_ORIENT_POSITION), + uno::makeAny(nLeftPosition)); xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_HORI_ORIENT_RELATION ), uno::makeAny(nHoriRelation)); xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_PAGE_TOGGLE ), uno::makeAny(bPageToggle)); - xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_ORIENT_POSITION), - uno::makeAny(nTopPosition)); + if (!bRelativeOnly) + xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_ORIENT_POSITION), + uno::makeAny(nTopPosition)); xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_ORIENT_RELATION ), uno::makeAny(nVertRelation)); } @@ -805,7 +807,7 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) if (nRotation) xShapeProps->setPropertyValue("RotateAngle", uno::makeAny(nRotation)); } - m_pImpl->applyRelativePosition(xShapeProps); + m_pImpl->applyRelativePosition(xShapeProps, /*bRelativeOnly=*/true); xShapeProps->setPropertyValue("SurroundContour", uno::makeAny(m_pImpl->bContour)); m_pImpl->applyMargins(xShapeProps); |