summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2013-12-03 12:30:45 +0100
committerJan Holesovsky <kendy@collabora.com>2013-12-03 12:31:39 +0100
commit5a23dee0648d5ca177e07e9da150d159fa40831f (patch)
treec440a7c4db5ed076367cc665c865e672e374634a /sw
parentfb51e1cc4090bdee6417537faa423de48bcb59d1 (diff)
sw unit tests: Introduce hasProperty(), make the redlining check more elegant.
Change-Id: I123bdfd7f21b78cbee6db2ceb9b98c2e473415d1
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx6
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx9
2 files changed, 7 insertions, 8 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index a5a4ed78eadf..57d40c6cb101 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -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()
{
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index bc04e9c38670..0bb2359d207d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -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")