Kaydet (Commit) 5a23dee0 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

sw unit tests: Introduce hasProperty(), make the redlining check more elegant.

Change-Id: I123bdfd7f21b78cbee6db2ceb9b98c2e473415d1
üst fb51e1cc
......@@ -300,6 +300,12 @@ protected:
return data;
}
bool hasProperty(const uno::Reference<uno::XInterface>& obj, const OUString& name) const
{
uno::Reference<beans::XPropertySet> properties(obj, uno::UNO_QUERY_THROW);
return properties->getPropertySetInfo()->hasPropertyByName(name);
}
/// Get number of paragraphs of the document.
int getParagraphs()
{
......
......@@ -1175,14 +1175,7 @@ DECLARE_OOXMLEXPORT_TEST(testBnc837302, "bnc837302.docx")
// make sure we don't introduce a redlined delete in the 2nd paragraph
xParagraph = getParagraph(2);
OUString aProperty;
try
{
// throws when not present
aProperty = getProperty<OUString>(getRun(xParagraph, 1), "RedlineType");
}
catch (const beans::UnknownPropertyException&) {}
CPPUNIT_ASSERT_EQUAL(OUString(), aProperty);
CPPUNIT_ASSERT_EQUAL(false, hasProperty(getRun(xParagraph, 1), "RedlineType"));
}
DECLARE_OOXMLEXPORT_TEST(testFdo68418, "fdo68418.docx")
......
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