From a7339737f4bab4daf0c5843e36e2988919e6691f Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 30 Oct 2012 18:05:46 +0100 Subject: sw: work around random crashes in ww8export Change-Id: If11bff5804770976f069a49a1c508744d6e1987b --- sw/qa/extras/ww8export/ww8export.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sw/qa/extras') diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index de2c80db6e80..7a205f123dcc 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -98,12 +98,17 @@ void Test::testN325936() void Test::testFdo45724() { + // The text and background color of the control shape was not correct. uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); uno::Reference xControlShape(xDraws->getByIndex(0), uno::UNO_QUERY); - uno::Reference xComponent(xControlShape->getControl(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(COL_WHITE, getProperty(xComponent, "BackgroundColor")); - CPPUNIT_ASSERT_EQUAL(OUString("xxx"), xComponent->getCurrentValue().get()); + // This should not happen (the shape was there before the fix as well), but let's avoid a segfault in some random cases... + if (xControlShape.is()) + { + uno::Reference xComponent(xControlShape->getControl(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, getProperty(xComponent, "BackgroundColor")); + CPPUNIT_ASSERT_EQUAL(OUString("xxx"), xComponent->getCurrentValue().get()); + } } void Test::testFdo46020() -- cgit v1.2.3