summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/qa/extras/scviewpaneobj.cxx30
1 files changed, 8 insertions, 22 deletions
diff --git a/sc/qa/extras/scviewpaneobj.cxx b/sc/qa/extras/scviewpaneobj.cxx
index 02ceb63824e0..6e74fa8a4434 100644
--- a/sc/qa/extras/scviewpaneobj.cxx
+++ b/sc/qa/extras/scviewpaneobj.cxx
@@ -23,8 +23,6 @@ using namespace css::uno;
namespace sc_apitest {
-#define NUMBER_OF_TESTS 3
-
class ScViewPaneObj : public CalcUnoApiTest, public apitest::XViewPane
{
public:
@@ -35,32 +33,25 @@ public:
virtual void tearDown() override;
CPPUNIT_TEST_SUITE(ScViewPaneObj);
+
+ // XViewPane
CPPUNIT_TEST(testFirstVisibleColumn);
CPPUNIT_TEST(testFirstVisibleRow);
CPPUNIT_TEST(testVisibleRange);
+
CPPUNIT_TEST_SUITE_END();
private:
-
- static sal_Int32 nTest;
- static uno::Reference<lang::XComponent> mxComponent;
-
+ uno::Reference<lang::XComponent> mxComponent;
};
-sal_Int32 ScViewPaneObj::nTest = 0;
-uno::Reference< lang::XComponent > ScViewPaneObj::mxComponent;
-
ScViewPaneObj::ScViewPaneObj()
- : CalcUnoApiTest("/sc/qa/extras/testdocuments")
+ : CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
}
uno::Reference< uno::XInterface > ScViewPaneObj::init()
{
- // create a calc document
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
-
uno::Reference< sheet::XSpreadsheetDocument > xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document!", xSheetDoc.is());
@@ -73,19 +64,14 @@ uno::Reference< uno::XInterface > ScViewPaneObj::init()
void ScViewPaneObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScViewPaneObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}