summaryrefslogtreecommitdiff
path: root/oox/source/vml/vmlshape.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-12-14 18:16:56 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-12-17 11:25:31 +0100
commitd5c934d150cb6cea5f96cbbee4fb5e8312bf027e (patch)
treeabc28f93d2a11ed40976ae36032b9c1b296e0e6d /oox/source/vml/vmlshape.cxx
parent2bbb4b9c5bf9c61c5b0b7fdfcce5b97e04a63a8a (diff)
n#792778 DOCX import: parse group shapes in oox only
Previously textframes inside groupshapes were tried to be imported as TextFrames, but then their addition to a GroupShape failed, so the text simply ended up as a normal paragraph. Fix this by importing members of groupshapes as drawinglayer objects, just like how the WW8 import does. Also fix two testcases, which implicitely tested that the groupshape VML element is ignored on import. Change-Id: I1a9fba8a5fd532203a825e55b1d5996277ea12fa
Diffstat (limited to 'oox/source/vml/vmlshape.cxx')
-rw-r--r--oox/source/vml/vmlshape.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index df6d3b5b02ca..6b280b4d1842 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -233,9 +233,9 @@ ShapeModel::~ShapeModel()
{
}
-TextBox& ShapeModel::createTextBox()
+TextBox& ShapeModel::createTextBox(ShapeTypeModel& rModel)
{
- mxTextBox.reset( new TextBox );
+ mxTextBox.reset( new TextBox(rModel) );
return *mxTextBox;
}
@@ -486,6 +486,9 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
PropertySet( xShape ).setAnyProperty(PROP_RelativeHeight, makeAny( nHeight ) );
}
}
+
+ if (getTextBox())
+ getTextBox()->convert(xShape);
}
// Import Legacy Fragments (if any)
@@ -522,8 +525,9 @@ Reference< XShape > SimpleShape::createPictureObject( const Reference< XShapes >
{
aPropSet.setProperty( PROP_GraphicURL, aGraphicUrl );
}
- // If the shape has an absolute position, set the properties accordingly.
- if ( maTypeModel.maPosition == "absolute" )
+ uno::Reference< lang::XServiceInfo > xServiceInfo(rxShapes, uno::UNO_QUERY);
+ // If the shape has an absolute position, set the properties accordingly, unless we're inside a group shape.
+ if ( maTypeModel.maPosition == "absolute" && !xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"))
{
aPropSet.setProperty(PROP_HoriOrientPosition, rShapeRect.X);
aPropSet.setProperty(PROP_VertOrientPosition, rShapeRect.Y);
@@ -866,6 +870,9 @@ Reference< XShape > GroupShape::implConvertAndInsert( const Reference< XShapes >
catch( Exception& )
{
}
+ // Make sure group shapes are inline as well, unless there is an explicit different style.
+ PropertySet aPropertySet(xGroupShape);
+ lcl_SetAnchorType(aPropertySet, maTypeModel);
return xGroupShape;
}