summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-01-06 15:15:15 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-06 16:37:26 +0100
commit52263eb4ee841ff101fa54e7fb95d76d2070f91b (patch)
treee963763da564d9f492aa6a3e5fddba1e8e283df4 /sw
parente7e6a5f9850a36d72339799b3981369790113d12 (diff)
DOCX export: implement drawingML export of TextFrame AutoSize
Change-Id: I180158bfa0bd36ed1360d10788e7921c2fa945a7
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/extras/ooxmlexport/data/autofit.docxbin0 -> 13763 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx6
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx6
3 files changed, 11 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/autofit.docx b/sw/qa/extras/ooxmlexport/data/autofit.docx
new file mode 100755
index 000000000000..8932edfc7ba9
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/autofit.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index dc8726c1f9cd..fc7079a709ab 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2225,6 +2225,12 @@ DECLARE_OOXMLEXPORT_TEST(testGroupshapePicture, "groupshape-picture.docx")
CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GraphicObjectShape"), xShapeDescriptor->getShapeType());
}
+DECLARE_OOXMLEXPORT_TEST(testAutofit, "autofit.docx")
+{
+ CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<sal_Bool>(getShape(1), "FrameIsAutomaticHeight")));
+ CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<sal_Bool>(getShape(2), "FrameIsAutomaticHeight")));
+}
+
DECLARE_OOXMLEXPORT_TEST(testTrackChangesDeletedParagraphMark, "testTrackChangesDeletedParagraphMark.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 0aa7e3601155..38a05c8c2c35 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -488,7 +488,11 @@ void DocxAttributeOutput::WriteDMLTextFrame(sw::Frame* pParentFrame)
m_pSerializer->endElementNS( XML_wps, XML_txbx );
XFastAttributeListRef xBodyPrAttrList(m_pBodyPrAttrList);
m_pBodyPrAttrList = NULL;
- m_pSerializer->singleElementNS( XML_wps, XML_bodyPr, xBodyPrAttrList );
+ m_pSerializer->startElementNS( XML_wps, XML_bodyPr, xBodyPrAttrList );
+ // AutoSize of the Text Frame.
+ const SwFmtFrmSize& rSize = rFrmFmt.GetFrmSize();
+ m_pSerializer->singleElementNS(XML_a, (rSize.GetHeightSizeType() == ATT_VAR_SIZE ? XML_spAutoFit : XML_noAutofit), FSEND);
+ m_pSerializer->endElementNS( XML_wps, XML_bodyPr );
m_pSerializer->endElementNS(XML_wps, XML_wsp);
m_pSerializer->endElementNS(XML_a, XML_graphicData);