summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2024-10-14 14:50:06 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-12-10 17:18:10 +0100
commit5fb8e29926a5c0dd1ae027f05d48826399cc31a1 (patch)
tree92b333f15f3a399c8312810c2c7d3009263caf16 /oox
parent9877694e27f7e52ab8ac69c3729677cd8090e41f (diff)
tdf#164065 load vml textbox in a group shape
Store (vml) textbox elements to determine whether to load shape text or Writer frame. Replay elements in second step and process depending on the outcome. - result flag not yet available while processing - The text shape in docx bugdoc of tdf#152878 can now be loaded as Writer frame but with wrong size/position. - should also be applied to drawing ml shapes currently always loaded as Writer frame Change-Id: I0778057f9985f5523d91a9d757e00f2968aba350 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174902 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/vml/vmlshape.cxx8
-rw-r--r--oox/source/vml/vmlshapecontext.cxx13
2 files changed, 20 insertions, 1 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 1f5a8f27c59e..7908dd7527c4 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -150,6 +150,7 @@ void ShapeTypeModel::assignUsed( const ShapeTypeModel& rSource )
ShapeType::ShapeType( Drawing& rDrawing ) :
mrDrawing( rDrawing )
+ , mbTextBox(false)
{
}
@@ -859,6 +860,13 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
PropertySet(xShape).setAnyProperty(PROP_TextLowerDistance, Any(sal_Int32(getTextBox()->borderDistanceBottom)));
xShape->setSize(aSize);
}
+
+ if (mbTextBox)
+ {
+ // similar to drawingml::Shape::createAndInsert(...)
+ PropertySet(xShape).setAnyProperty(PROP_TextBox, Any(true));
+ }
+
}
}
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index daedc527f465..85c70347e0e8 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -548,7 +548,14 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 nElement, const Attri
if (mrShapeModel.mbInGroup)
// FIXME: without this a text will be added into the group-shape instead of its
// parent shape
- dynamic_cast<SimpleShape&>(mrShape).setService(u"com.sun.star.drawing.TextShape"_ustr);
+ {
+ if (mrShape.isTextBox())
+ dynamic_cast<SimpleShape&>(mrShape).setService(
+ u"com.sun.star.drawing.CustomShape"_ustr);
+ else
+ dynamic_cast<SimpleShape&>(mrShape).setService(
+ u"com.sun.star.drawing.TextShape"_ustr);
+ }
else
// FIXME: without this we does not handle some properties like shadow
dynamic_cast<SimpleShape&>(mrShape).setService(u"com.sun.star.text.TextFrame"_ustr);
@@ -591,6 +598,10 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 nElement, const Attri
// handle remaining stuff in base class
return ShapeTypeContext::onCreateContext( nElement, rAttribs );
}
+void ShapeContext::setWriterShape()
+{
+ mrShape.setTextBox(true);
+}
void ShapeContext::setPoints(std::u16string_view rPoints)
{