Kaydet (Commit) 55abb2c6 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

correctly terminate tableautoformatfield

üst d4273a37
......@@ -34,10 +34,15 @@
namespace ScAutoFormatFieldObj {
#define NUMBER_OF_TESTS 2
class ScTableAutoFormatField : public UnoApiTest
{
public:
virtual void setUp();
virtual void tearDown();
uno::Reference< beans::XPropertySet > init(); void testRotateReference();
void testVertJustify();
......@@ -46,8 +51,13 @@ public:
CPPUNIT_TEST(testVertJustify);
CPPUNIT_TEST_SUITE_END();
private:
static int nTest;
};
int ScTableAutoFormatField::nTest = 0;
uno::Reference< beans::XPropertySet > ScTableAutoFormatField::init()
{
uno::Reference< container::XIndexAccess > xAutoFormatFields( m_xSFactory->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.TableAutoFormats"))), UNO_QUERY_THROW );
......@@ -95,6 +105,23 @@ void ScTableAutoFormatField::testVertJustify()
CPPUNIT_ASSERT_MESSAGE("value has not been changed", aValue == 3);
}
void ScTableAutoFormatField::setUp()
{
nTest += 1;
UnoApiTest::setUp();
}
void ScTableAutoFormatField::tearDown()
{
UnoApiTest::tearDown();
if (nTest == NUMBER_OF_TESTS)
{
mxDesktop->terminate();
uno::Reference< lang::XComponent>(m_xContext, UNO_QUERY_THROW)->dispose();
}
}
CPPUNIT_TEST_SUITE_REGISTRATION(ScTableAutoFormatField);
CPPUNIT_PLUGIN_IMPLEMENT();
......
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