summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/core/unocore/unocore.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/core/unocore/unocore.cxx b/sw/qa/core/unocore/unocore.cxx
index c9bca82ae2f8..19ad5d5fd48b 100644
--- a/sw/qa/core/unocore/unocore.cxx
+++ b/sw/qa/core/unocore/unocore.cxx
@@ -404,6 +404,18 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testContentControlTextPortionEnum)
uno::Reference<container::XEnumeration> xContentEnum = xContentEnumAccess->createEnumeration();
uno::Reference<text::XTextRange> xContent(xContentEnum->nextElement(), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("test"), xContent->getString());
+
+ // Also test the generated layout:
+ xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwFieldPortion", "expand", "");
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: PortionType::ContentControl
+ // - Actual : PortionType::Text
+ // i.e. SwContentControl generated a plain text portion, not a dedicated content control
+ // portion.
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion", "type",
+ "PortionType::ContentControl");
+ assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion", "portion", "test");
}
CPPUNIT_PLUGIN_IMPLEMENT();