summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorYogeshBharate <yogesh.bharate@synerzip.com>2014-01-10 19:15:10 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-13 18:03:41 +0100
commitb23867abd8427da361dfa5edb9b41fbbd064ae10 (patch)
tree79987a894b82f3b311b66bf45958675986e4e763 /oox/source
parentc4ff46485f0461de6a2804ae859dbbc81b6af105 (diff)
fdo#73247: Code fixed for Shape rotation not preserved in RT
Problem Description: - When we create the shape with text, rotated it with some angle, the rotation angle is not preserved after roundtrip. Implementation: - Use the FrameInteroGrabBag to preserve the rotation angle. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/7367 Change-Id: I8a44e82d21f08ecb221cdbfef73f02a652f2bad3
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/drawingml/shape.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index b191762efe29..9437f0252499 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -657,7 +657,28 @@ Reference< XShape > Shape::createAndInsert(
}
aShapeProps.erase(PROP_LineColor);
}
-
+ if(mnRotation)
+ {
+ uno::Reference<beans::XPropertySet> xPropertySet(mxShape, uno::UNO_QUERY);
+ const OUString aGrabBagPropName = "FrameInteropGrabBag";
+ uno::Sequence<beans::PropertyValue> aGrabBag;
+ xPropertySet->getPropertyValue(aGrabBagPropName) >>= aGrabBag;
+ beans::PropertyValue aPair;
+ aPair.Name = "mso-rotation-angle";
+ aPair.Value = uno::makeAny(mnRotation);
+ if (aGrabBag.hasElements())
+ {
+ sal_Int32 nLength = aGrabBag.getLength();
+ aGrabBag.realloc(nLength + 1);
+ aGrabBag[nLength] = aPair;
+ }
+ else
+ {
+ aGrabBag.realloc(1);
+ aGrabBag[0] = aPair;
+ }
+ xPropertySet->setPropertyValue(aGrabBagPropName, uno::makeAny(aGrabBag));
+ }
// TextFrames have ShadowFormat, not individual shadow properties.
boost::optional<sal_Int32> oShadowDistance;
if (aShapeProps.hasProperty(PROP_ShadowXDistance))