summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-09-26 12:21:59 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-09-26 12:43:32 +0200
commit8738ded7bb1bb6262fe1038e310b5110407f4cfa (patch)
tree3d87aa158d05b18450e6bd5fc057dc93bb71d4a2 /oox
parent634f1d11d2a027887807494b3ca67f33825d5d23 (diff)
fdo#69636 VML import: handle mso-layout-flow-alt shape prop for sw frames
Writer core doesn't support this, and this has been a problem for table cells as well. There the workaround we're using for quite a while is to do the rotation at a text portion level instead, which results in reasonable layout for simple cases. Do the same here. One additional complexity is that the API between oox and writerfilter is a single UNO shape, we get this property in oox, and we have to handle it in writerfilter, when the text frame is already attached to some text. Kill this problem by adding a FrameInteropGrabBag for sw text frames: it's useful anyway, and then we can pass around this property inside the grab bag. Change-Id: Idb5ec83b5cbdde8f29d15b2cebfad24226bb6507
Diffstat (limited to 'oox')
-rw-r--r--oox/source/vml/vmlshape.cxx22
-rw-r--r--oox/source/vml/vmltextboxcontext.cxx2
2 files changed, 24 insertions, 0 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 26cc704d37ef..b50551d78d84 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -554,6 +554,28 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
PropertySet( xShape ).setAnyProperty( PROP_RightBorderDistance, makeAny( sal_Int32( getTextBox()->borderDistanceRight )));
PropertySet( xShape ).setAnyProperty( PROP_BottomBorderDistance, makeAny( sal_Int32( getTextBox()->borderDistanceBottom )));
}
+ if (!maTypeModel.maLayoutFlowAlt.isEmpty())
+ {
+ // Can't handle this property here, as the frame is not attached yet: pass it to writerfilter.
+ uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aGrabBag;
+ xPropertySet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag;
+ beans::PropertyValue aPair;
+ aPair.Name = "mso-layout-flow-alt";
+ aPair.Value = uno::makeAny(maTypeModel.maLayoutFlowAlt);
+ if (aGrabBag.hasElements())
+ {
+ sal_Int32 nLength = aGrabBag.getLength();
+ aGrabBag.realloc(nLength + 1);
+ aGrabBag[nLength + 1] = aPair;
+ }
+ else
+ {
+ aGrabBag.realloc(1);
+ aGrabBag[0] = aPair;
+ }
+ xPropertySet->setPropertyValue("FrameInteropGrabBag", uno::makeAny(aGrabBag));
+ }
}
else
{
diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx
index 5c7e2f751ffb..15e8810e0ca9 100644
--- a/oox/source/vml/vmltextboxcontext.cxx
+++ b/oox/source/vml/vmltextboxcontext.cxx
@@ -215,6 +215,8 @@ TextBoxContext::TextBoxContext( ContextHandler2Helper& rParent, TextBox& rTextBo
if( aName == "layout-flow" ) rTextBox.maLayoutFlow = aValue;
else if (aName == "mso-fit-shape-to-text")
rTextBox.mrTypeModel.mbAutoHeight = true;
+ else if (aName == "mso-layout-flow-alt")
+ rTextBox.mrTypeModel.maLayoutFlowAlt = aValue;
else
SAL_WARN("oox", "unhandled style property: " << aName);
}