summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/oox/drawingml/shape.hxx4
-rw-r--r--oox/source/drawingml/shape.cxx9
-rw-r--r--oox/source/shape/WpgContext.cxx5
-rw-r--r--sw/qa/extras/ooxmlexport/data/groupshape-textbox.docxbin0 -> 17394 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx11
5 files changed, 22 insertions, 7 deletions
diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 5fcb91c1d5a4..f39f75d03c82 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -72,7 +72,7 @@ class OOX_DLLPUBLIC Shape
{
public:
- explicit Shape( const sal_Char* pServiceType = 0 );
+ explicit Shape( const sal_Char* pServiceType = 0, bool bDefaultHeight = true );
explicit Shape( const ShapePtr& pSourceShape );
virtual ~Shape();
@@ -126,7 +126,7 @@ public:
const OptValue< sal_Int32 >& getSubTypeIndex() const { return moSubTypeIndex; }
// setDefaults has to be called if styles are imported (OfficeXML is not storing properties having the default value)
- void setDefaults();
+ void setDefaults(bool bHeight);
::oox::vml::OleObjectInfo& setOleObjectType();
ChartShapeInfo& setChartType( bool bEmbedShapes );
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index a6e61a7ddeae..46dedecf6682 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -82,7 +82,7 @@ namespace oox { namespace drawingml {
// ============================================================================
-Shape::Shape( const sal_Char* pServiceName )
+Shape::Shape( const sal_Char* pServiceName, bool bDefaultHeight )
: mbIsChild( false )
, mpLinePropertiesPtr( new LineProperties )
, mpFillPropertiesPtr( new FillProperties )
@@ -103,7 +103,7 @@ Shape::Shape( const sal_Char* pServiceName )
{
if ( pServiceName )
msServiceName = OUString::createFromAscii( pServiceName );
- setDefaults();
+ setDefaults(bDefaultHeight);
}
Shape::Shape( const ShapePtr& pSourceShape )
@@ -151,7 +151,7 @@ table::TablePropertiesPtr Shape::getTableProperties()
return mpTablePropertiesPtr;
}
-void Shape::setDefaults()
+void Shape::setDefaults(bool bHeight)
{
maDefaultShapeProperties[ PROP_TextAutoGrowHeight ] <<= false;
maDefaultShapeProperties[ PROP_TextWordWrap ] <<= true;
@@ -159,7 +159,8 @@ void Shape::setDefaults()
maDefaultShapeProperties[ PROP_TextUpperDistance ] <<= static_cast< sal_Int32 >( 125 );
maDefaultShapeProperties[ PROP_TextRightDistance ] <<= static_cast< sal_Int32 >( 250 );
maDefaultShapeProperties[ PROP_TextLowerDistance ] <<= static_cast< sal_Int32 >( 125 );
- maDefaultShapeProperties[ PROP_CharHeight ] <<= static_cast< float >( 18.0 );
+ if (bHeight)
+ maDefaultShapeProperties[ PROP_CharHeight ] <<= static_cast< float >( 18.0 );
maDefaultShapeProperties[ PROP_TextVerticalAdjust ] <<= TextVerticalAdjust_TOP;
maDefaultShapeProperties[ PROP_ParaAdjust ] <<= static_cast< sal_Int16 >( ParagraphAdjust_LEFT ); // check for RTL?
}
diff --git a/oox/source/shape/WpgContext.cxx b/oox/source/shape/WpgContext.cxx
index 39bb4709b6a6..d66b51864eb8 100644
--- a/oox/source/shape/WpgContext.cxx
+++ b/oox/source/shape/WpgContext.cxx
@@ -46,7 +46,10 @@ oox::core::ContextHandlerRef WpgContext::onCreateContext(sal_Int32 nElementToken
break;
case XML_wsp:
{
- oox::drawingml::ShapePtr pShape(new oox::drawingml::Shape("com.sun.star.drawing.CustomShape"));
+ // Don't set default character height, Writer has its own way to set
+ // the default, and if we don't set it here, editeng properly inherits
+ // it.
+ oox::drawingml::ShapePtr pShape(new oox::drawingml::Shape("com.sun.star.drawing.CustomShape", /*bDefaultHeight=*/false));
return new oox::drawingml::ShapeContext(*this, mpShape, pShape);
}
break;
diff --git a/sw/qa/extras/ooxmlexport/data/groupshape-textbox.docx b/sw/qa/extras/ooxmlexport/data/groupshape-textbox.docx
new file mode 100644
index 000000000000..fca71bfcf974
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/groupshape-textbox.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index fa9030485d16..23a8e6fe4784 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2198,6 +2198,17 @@ DECLARE_OOXMLEXPORT_TEST(testFdo73215, "fdo73215.docx")
"name", "adj1");
}
+DECLARE_OOXMLEXPORT_TEST(testGroupshapeTextbox, "groupshape-textbox.docx")
+{
+ uno::Reference<drawing::XShapes> xGroup(getShape(1), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xShape(xGroup->getByIndex(0), uno::UNO_QUERY);
+ // The VML export lost text on textboxes inside groupshapes.
+ // The DML export does not, make sure it stays that way.
+ CPPUNIT_ASSERT_EQUAL(OUString("first"), xShape->getString());
+ // This was 16, i.e. inheriting doc default char height didn't work.
+ CPPUNIT_ASSERT_EQUAL(11.f, getProperty<float>(xShape, "CharHeight"));
+}
+
DECLARE_OOXMLEXPORT_TEST(testTrackChangesDeletedParagraphMark, "testTrackChangesDeletedParagraphMark.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");