summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-16 18:39:08 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-17 00:25:13 +0200
commit71aa91ab7e16be70ed9abd0959f8f18d35439acc (patch)
tree2440901911f56d03586f9306c26320f5d57c30ae
parentdb7042cdbaf94250cd76b6aafd75c10c4a5a6900 (diff)
oox: drawingML import/export of <wps:bodyPr vert="vert270"> for textboxes
As in, for shapes which have textboxes. CppunitTest_sw_ooxmlsdrexport's testFdo69636 is a reproducer for this problem. Change-Id: I6575d21b0802ada7f334ca9fbbea796605708ddd
-rw-r--r--oox/source/export/drawingml.cxx5
-rw-r--r--oox/source/shape/WpsContext.cxx33
2 files changed, 26 insertions, 12 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index f7fcf4365b2f..6073fbd1f88a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1717,6 +1717,11 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b
sWritingMode = "vert";
bVertical = true;
}
+ else if ( nTextRotateAngle == -270 )
+ {
+ sWritingMode = "vert270";
+ bVertical = true;
+ }
break;
}
}
diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index c17405ee7048..2d2b022856ea 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -56,25 +56,34 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken
case XML_bodyPr:
if (mxShape.is())
{
+ uno::Reference<lang::XServiceInfo> xServiceInfo(mxShape, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(mxShape, uno::UNO_QUERY);
OptValue<OUString> oVert = rAttribs.getString(XML_vert);
if (oVert.has() && oVert.get() == "vert270")
{
- // No support for this in core, work around by char rotation, as we do so for table cells already.
- uno::Reference<text::XText> xText(mxShape, uno::UNO_QUERY);
- uno::Reference<text::XTextCursor> xTextCursor = xText->createTextCursor();
- xTextCursor->gotoStart(false);
- xTextCursor->gotoEnd(true);
- uno::Reference<beans::XPropertyState> xPropertyState(xTextCursor, uno::UNO_QUERY);
- beans::PropertyState aState = xPropertyState->getPropertyState("CharRotation");
- if (aState == beans::PropertyState_DEFAULT_VALUE)
+ if (xServiceInfo->supportsService("com.sun.star.text.TextFrame"))
+ {
+ // No support for this in core, work around by char rotation, as we do so for table cells already.
+ uno::Reference<text::XText> xText(mxShape, uno::UNO_QUERY);
+ uno::Reference<text::XTextCursor> xTextCursor = xText->createTextCursor();
+ xTextCursor->gotoStart(false);
+ xTextCursor->gotoEnd(true);
+ uno::Reference<beans::XPropertyState> xPropertyState(xTextCursor, uno::UNO_QUERY);
+ beans::PropertyState aState = xPropertyState->getPropertyState("CharRotation");
+ if (aState == beans::PropertyState_DEFAULT_VALUE)
+ {
+ uno::Reference<beans::XPropertySet> xTextCursorPropertySet(xTextCursor, uno::UNO_QUERY);
+ xTextCursorPropertySet->setPropertyValue("CharRotation", uno::makeAny(sal_Int16(900)));
+ }
+ }
+ else
{
- uno::Reference<beans::XPropertySet> xPropertySet(xTextCursor, uno::UNO_QUERY);
- xPropertySet->setPropertyValue("CharRotation", uno::makeAny(sal_Int16(900)));
+ comphelper::SequenceAsHashMap aCustomShapeGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry"));
+ aCustomShapeGeometry["TextPreRotateAngle"] = uno::makeAny(sal_Int32(-270));
+ xPropertySet->setPropertyValue("CustomShapeGeometry", uno::makeAny(aCustomShapeGeometry.getAsConstPropertyValueList()));
}
}
- uno::Reference<lang::XServiceInfo> xServiceInfo(mxShape, uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xPropertySet(mxShape, uno::UNO_QUERY);
if (xServiceInfo.is())
{
bool bTextFrame = xServiceInfo->supportsService("com.sun.star.text.TextFrame");