summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/layout/data/tdf117188.docxbin0 -> 1857 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx23
-rw-r--r--xmloff/source/draw/ximpshap.cxx14
3 files changed, 32 insertions, 5 deletions
diff --git a/sw/qa/extras/layout/data/tdf117188.docx b/sw/qa/extras/layout/data/tdf117188.docx
new file mode 100644
index 000000000000..418f665ae7dc
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf117188.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 8d5a76201563..facc0fea1f6b 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -35,6 +35,7 @@ public:
void testTdf109137();
void testForcepoint72();
void testTdf118058();
+ void testTdf117188();
CPPUNIT_TEST_SUITE(SwLayoutWriter);
CPPUNIT_TEST(testTdf116830);
@@ -52,6 +53,7 @@ public:
CPPUNIT_TEST(testTdf109137);
CPPUNIT_TEST(testForcepoint72);
CPPUNIT_TEST(testTdf118058);
+ CPPUNIT_TEST(testTdf117188);
CPPUNIT_TEST_SUITE_END();
private:
@@ -307,6 +309,27 @@ void SwLayoutWriter::testTdf118058()
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
}
+void SwLayoutWriter::testTdf117188()
+{
+ createDoc("tdf117188.docx");
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ utl::TempFile aTempFile;
+ aTempFile.EnableKillingFile();
+ uno::Sequence<beans::PropertyValue> aDescriptor(comphelper::InitPropertySequence({
+ { "FilterName", uno::Any(OUString("writer8")) },
+ }));
+ xStorable->storeToURL(aTempFile.GetURL(), aDescriptor);
+ loadURL(aTempFile.GetURL(), "tdf117188.odt");
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+ OUString sWidth = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "width");
+ OUString sHeight = getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", "height");
+ // The text box must have zero border distances
+ assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds", "left", "0");
+ assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds", "top", "0");
+ assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds", "width", sWidth);
+ assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/prtBounds", "height", sHeight);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index c68be43fc9c9..21339eb6bbcf 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -696,6 +696,15 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */)
}
}
+ // Writer shapes: if this one has a TextBox, set it here. We need to do it before
+ // pDocStyle->FillPropertySet, because setting some properties depend on the format
+ // having RES_CNTNT attribute (e.g., UNO_NAME_TEXT_(LEFT|RIGHT|UPPER|LOWER)DIST; see
+ // SwTextBoxHelper::syncProperty, which indirectly calls SwTextBoxHelper::isTextBox)
+ uno::Reference<beans::XPropertySetInfo> xPropertySetInfo
+ = xPropSet->getPropertySetInfo();
+ if (xPropertySetInfo->hasPropertyByName("TextBox"))
+ xPropSet->setPropertyValue("TextBox", uno::makeAny(mbTextBox));
+
// if this is an auto style, set its properties
if(bAutoStyle && pDocStyle)
{
@@ -703,11 +712,6 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */)
pDocStyle->FillPropertySet(xPropSet);
}
- // Writer shapes: if this one has a TextBox, set it here.
- uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropSet->getPropertySetInfo();
- if (xPropertySetInfo->hasPropertyByName("TextBox"))
- xPropSet->setPropertyValue("TextBox", uno::makeAny(mbTextBox));
-
} while(false);
// try to set text auto style