[Libreoffice-commits] core.git: sc/qa
Jens Carl
j.carl43 at gmx.de
Tue Jan 30 17:27:46 UTC 2018
sc/qa/extras/sceditfieldobj-cell.cxx | 25 +++++--------------------
1 file changed, 5 insertions(+), 20 deletions(-)
New commits:
commit 4a29f125c103da9a32b601dc107f72f769358e88
Author: Jens Carl <j.carl43 at gmx.de>
Date: Tue Jan 30 07:38:10 2018 +0000
Remove shared mxComponent in sceditfieldobj-cell
Change-Id: I13065c1d73813359e21bdbc708d4c0fdb9720ba3
Reviewed-on: https://gerrit.libreoffice.org/48879
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
Tested-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/sceditfieldobj-cell.cxx b/sc/qa/extras/sceditfieldobj-cell.cxx
index 0d469969cb7f..7f39e88f1752 100644
--- a/sc/qa/extras/sceditfieldobj-cell.cxx
+++ b/sc/qa/extras/sceditfieldobj-cell.cxx
@@ -20,8 +20,6 @@
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
-#define NUMBER_OF_TESTS 7
-
using namespace css;
using namespace css::uno;
@@ -61,13 +59,10 @@ public:
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;
};
-sal_Int32 ScEditFieldObj_Cell::nTest = 0;
-uno::Reference<lang::XComponent> ScEditFieldObj_Cell::mxComponent;
uno::Reference<text::XTextField> ScEditFieldObj_Cell::mxField;
ScEditFieldObj_Cell::ScEditFieldObj_Cell()
@@ -77,20 +72,15 @@ ScEditFieldObj_Cell::ScEditFieldObj_Cell()
void ScEditFieldObj_Cell::setUp()
{
- ++nTest;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // Load an empty document.
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScEditFieldObj_Cell::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- mxField.clear();
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ mxField.clear();
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
@@ -113,10 +103,6 @@ uno::Reference<uno::XInterface> ScEditFieldObj_Cell::init()
// Return a field that's already in the cell.
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.
@@ -161,7 +147,6 @@ uno::Reference<text::XTextRange> ScEditFieldObj_Cell::getTextRange()
void ScEditFieldObj_Cell::testEditFieldProperties()
{
- CPPUNIT_ASSERT_MESSAGE("component doesn't exist.", mxComponent.is());
uno::Reference<lang::XMultiServiceFactory> xSM(mxComponent, UNO_QUERY_THROW);
{
More information about the Libreoffice-commits
mailing list