Kaydet (Commit) 71aa91ab authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst db7042cd
...@@ -1717,6 +1717,11 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b ...@@ -1717,6 +1717,11 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b
sWritingMode = "vert"; sWritingMode = "vert";
bVertical = true; bVertical = true;
} }
else if ( nTextRotateAngle == -270 )
{
sWritingMode = "vert270";
bVertical = true;
}
break; break;
} }
} }
......
...@@ -56,8 +56,12 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken ...@@ -56,8 +56,12 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken
case XML_bodyPr: case XML_bodyPr:
if (mxShape.is()) 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); OptValue<OUString> oVert = rAttribs.getString(XML_vert);
if (oVert.has() && oVert.get() == "vert270") if (oVert.has() && oVert.get() == "vert270")
{
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. // 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::XText> xText(mxShape, uno::UNO_QUERY);
...@@ -68,13 +72,18 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken ...@@ -68,13 +72,18 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken
beans::PropertyState aState = xPropertyState->getPropertyState("CharRotation"); beans::PropertyState aState = xPropertyState->getPropertyState("CharRotation");
if (aState == beans::PropertyState_DEFAULT_VALUE) if (aState == beans::PropertyState_DEFAULT_VALUE)
{ {
uno::Reference<beans::XPropertySet> xPropertySet(xTextCursor, uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xTextCursorPropertySet(xTextCursor, uno::UNO_QUERY);
xPropertySet->setPropertyValue("CharRotation", uno::makeAny(sal_Int16(900))); xTextCursorPropertySet->setPropertyValue("CharRotation", uno::makeAny(sal_Int16(900)));
}
}
else
{
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()) if (xServiceInfo.is())
{ {
bool bTextFrame = xServiceInfo->supportsService("com.sun.star.text.TextFrame"); bool bTextFrame = xServiceInfo->supportsService("com.sun.star.text.TextFrame");
......
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