Kaydet (Commit) 8c73b16f authored tarafından Miklos Vajna's avatar Miklos Vajna

DOCX import: declare wpg as a supported feature

This is the same as wps, just for group shapes.

Change-Id: I321b19ed538a6cb8f9068c7de6fbe9a8eb0bd82f
üst 92b1348a
...@@ -351,9 +351,11 @@ protected: ...@@ -351,9 +351,11 @@ protected:
return xParagraph; return xParagraph;
} }
uno::Reference<text::XTextRange> getParagraphOfText(int number, uno::Reference<text::XText> xText) const uno::Reference<text::XTextRange> getParagraphOfText(int number, uno::Reference<text::XText> xText, OUString content = OUString()) const
{ {
uno::Reference<text::XTextRange> const xParagraph(getParagraphOrTable(number, xText), uno::UNO_QUERY_THROW); uno::Reference<text::XTextRange> const xParagraph(getParagraphOrTable(number, xText), uno::UNO_QUERY_THROW);
if (!content.isEmpty())
CPPUNIT_ASSERT_EQUAL(content, xParagraph->getString());
return xParagraph; return xParagraph;
} }
......
...@@ -1574,6 +1574,15 @@ DECLARE_OOXMLIMPORT_TEST(textboxWpgOnly, "textbox-wpg-only.docx") ...@@ -1574,6 +1574,15 @@ DECLARE_OOXMLIMPORT_TEST(textboxWpgOnly, "textbox-wpg-only.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xText), 1), "CharEscapementHeight")); CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xText), 1), "CharEscapementHeight"));
} }
DECLARE_OOXMLIMPORT_TEST(testMceWpg, "mce-wpg.docx")
{
// Make sure that we read the primary branch, if wpg is requested as a feature.
uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(0), uno::UNO_QUERY)->getText();
// This was VML1.
getParagraphOfText(1, xText, "DML1");
}
DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx") DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx")
{ {
// The document contains a rotated bitmap // The document contains a rotated bitmap
......
...@@ -198,6 +198,7 @@ bool OOXMLFastContextHandler::prepareMceContext(Token_t nElement, const uno::Ref ...@@ -198,6 +198,7 @@ bool OOXMLFastContextHandler::prepareMceContext(Token_t nElement, const uno::Ref
OUString aRequires = rAttribs->getOptionalValue(OOXML_Requires); OUString aRequires = rAttribs->getOptionalValue(OOXML_Requires);
static const char* aFeatures[] = { static const char* aFeatures[] = {
"wps", "wps",
"wpg",
}; };
for (size_t i = 0; i < SAL_N_ELEMENTS(aFeatures); ++i) for (size_t i = 0; i < SAL_N_ELEMENTS(aFeatures); ++i)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment