[Libreoffice-commits] core.git: sc/qa
Jens Carl
j.carl43 at gmx.de
Tue Jan 30 17:28:29 UTC 2018
sc/qa/extras/sceditfieldobj-header.cxx | 28 ++++++++--------------------
1 file changed, 8 insertions(+), 20 deletions(-)
New commits:
commit b6bf9327d32f0ce1b61331646cddafcc04c9b8f7
Author: Jens Carl <j.carl43 at gmx.de>
Date: Tue Jan 30 07:41:09 2018 +0000
Remove shared mxComponent in sceditfieldobj-header
Change-Id: I32c881c263698c04cf39b7ce6389207b30fefdcf
Reviewed-on: https://gerrit.libreoffice.org/48880
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/sceditfieldobj-header.cxx b/sc/qa/extras/sceditfieldobj-header.cxx
index a1ae16e86eb8..8d415d6736c8 100644
--- a/sc/qa/extras/sceditfieldobj-header.cxx
+++ b/sc/qa/extras/sceditfieldobj-header.cxx
@@ -23,8 +23,6 @@
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XHeaderFooterContent.hpp>
-#define NUMBER_OF_TESTS 5
-
using namespace css;
using namespace css::uno;
@@ -52,17 +50,15 @@ public:
// XTextContent
CPPUNIT_TEST(testGetAnchor);
CPPUNIT_TEST(testAttach);
+
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference<lang::XComponent> mxComponent;
+ uno::Reference<lang::XComponent> mxComponent;
static uno::Reference<text::XTextField> mxField;
static uno::Reference<text::XText> mxRightText;
};
-sal_Int32 ScEditFieldObj_Header::nTest = 0;
-uno::Reference<lang::XComponent> ScEditFieldObj_Header::mxComponent;
uno::Reference<text::XTextField> ScEditFieldObj_Header::mxField;
uno::Reference<text::XText> ScEditFieldObj_Header::mxRightText;
@@ -73,21 +69,17 @@ ScEditFieldObj_Header::ScEditFieldObj_Header()
void ScEditFieldObj_Header::setUp()
{
- ++nTest;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // Load an empty document.
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScEditFieldObj_Header::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- // Clear these before the component is destroyed. This is important!
- mxField.clear();
- mxRightText.clear();
- closeDocument(mxComponent);
- mxComponent.clear();
- }
+ // Clear these before the component is destroyed. This is important!
+ mxField.clear();
+ mxRightText.clear();
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
@@ -97,10 +89,6 @@ uno::Reference<uno::XInterface> ScEditFieldObj_Header::init()
// Return a field that's already in the header.
if (!mxField.is())
{
- if (!mxComponent.is())
- // Load an empty document.
- mxComponent = loadFromDesktop("private:factory/scalc");
-
uno::Reference<lang::XMultiServiceFactory> xSM(mxComponent, UNO_QUERY_THROW);
// Create a new URL field object, and populate it with name and URL.
More information about the Libreoffice-commits
mailing list