[Libreoffice-commits] core.git: include/test qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests sc/qa test/source

Jens Carl j.carl43 at gmx.de
Wed Jun 13 15:53:52 UTC 2018


 include/test/sheet/xcellrangereferrer.hxx                          |   10 -
 qadevOOo/Jar_OOoRunner.mk                                          |    1 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDatabaseRangeObj.csv |    1 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangeObj.csv    |    1 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTabViewObj.csv       |    1 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv      |    1 
 qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java             |   93 ----------
 sc/qa/extras/scdatabaserangeobj.cxx                                |   41 +++-
 sc/qa/extras/scnamedrangeobj.cxx                                   |   25 +-
 sc/qa/extras/sctabviewobj.cxx                                      |    8 
 sc/qa/extras/scviewpaneobj.cxx                                     |   11 +
 test/source/sheet/xcellrangereferrer.cxx                           |   10 -
 12 files changed, 75 insertions(+), 128 deletions(-)

New commits:
commit 600987b415e537362125b4445ab7132535e6e1e1
Author: Jens Carl <j.carl43 at gmx.de>
Date:   Wed Jun 13 05:51:11 2018 +0000

    tdf#45904 Move remaining _XCellRangeReferrer Java tests to C++
    
    Move remaining _XCellRangeReferrer tests to C++ and partly fix #i84656.
    
    Change-Id: I77cc8550888f460a6ae265816907a19a81cbe871
    Reviewed-on: https://gerrit.libreoffice.org/55732
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jens Carl <j.carl43 at gmx.de>

diff --git a/include/test/sheet/xcellrangereferrer.hxx b/include/test/sheet/xcellrangereferrer.hxx
index 70c3cb6241d8..4fcdd5d003aa 100644
--- a/include/test/sheet/xcellrangereferrer.hxx
+++ b/include/test/sheet/xcellrangereferrer.hxx
@@ -11,6 +11,9 @@
 #define INCLUDED_TEST_SHEET_XCELLRANGEREFERRER_HXX
 
 #include <com/sun/star/table/CellRangeAddress.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
 #include <test/testdllapi.hxx>
 
 namespace apitest {
@@ -18,18 +21,17 @@ namespace apitest {
 class OOO_DLLPUBLIC_TEST XCellRangeReferrer
 {
 public:
-    XCellRangeReferrer( css::table::CellRangeAddress aCellRange ):
-                maCellRange( aCellRange ) {}
-
     virtual css::uno::Reference< css::uno::XInterface > init() = 0;
 
+    void setCellRange(css::table::CellRangeAddress aCellRange) { m_aCellRange = aCellRange; }
+    const css::table::CellRangeAddress getCellRange() { return m_aCellRange; }
     void testGetReferredCells();
 
 protected:
     ~XCellRangeReferrer() {}
 
 private:
-    css::table::CellRangeAddress maCellRange;
+    css::table::CellRangeAddress m_aCellRange;
 };
 
 }
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index 409785f35ef8..7718aa632156 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -565,7 +565,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
     qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocument \
     qadevOOo/tests/java/ifc/sheet/_TableAutoFormatField \
     qadevOOo/tests/java/ifc/sheet/_XCellRangeData \
-    qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer \
     qadevOOo/tests/java/ifc/sheet/_XCellRangesQuery \
     qadevOOo/tests/java/ifc/sheet/_XDocumentAuditing \
     qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster \
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDatabaseRangeObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDatabaseRangeObj.csv
index a57801a581af..34f6a5e984dc 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDatabaseRangeObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDatabaseRangeObj.csv
@@ -1,7 +1,6 @@
 "ScDatabaseRangeObj";"com::sun::star::util::XRefreshable#optional";"refresh()"
 "ScDatabaseRangeObj";"com::sun::star::util::XRefreshable#optional";"addRefreshListener()"
 "ScDatabaseRangeObj";"com::sun::star::util::XRefreshable#optional";"removeRefreshListener()"
-"ScDatabaseRangeObj";"com::sun::star::sheet::XCellRangeReferrer";"getReferredCells()"
 "ScDatabaseRangeObj";"com::sun::star::container::XNamed";"getName()"
 "ScDatabaseRangeObj";"com::sun::star::container::XNamed";"setName()"
 "ScDatabaseRangeObj";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangeObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangeObj.csv
index a022a86eb032..fbed879b91b9 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangeObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangeObj.csv
@@ -1,3 +1,2 @@
-"ScNamedRangeObj";"com::sun::star::sheet::XCellRangeReferrer";"getReferredCells()"
 "ScNamedRangeObj";"com::sun::star::container::XNamed";"getName()"
 "ScNamedRangeObj";"com::sun::star::container::XNamed";"setName()"
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTabViewObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTabViewObj.csv
index 35e1186c0e10..e3774a311576 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTabViewObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTabViewObj.csv
@@ -12,7 +12,6 @@
 "ScTabViewObj";"com::sun::star::sheet::XEnhancedMouseClickBroadcaster#optional";"removeEnhancedMouseClickHandler()"
 "ScTabViewObj";"com::sun::star::ui::XContextMenuInterception#optional";"registerContextMenuInterceptor()"
 "ScTabViewObj";"com::sun::star::ui::XContextMenuInterception#optional";"releaseContextMenuInterceptor()"
-"ScTabViewObj";"com::sun::star::sheet::XCellRangeReferrer";"getReferredCells()"
 "ScTabViewObj";"com::sun::star::container::XElementAccess";"getElementType()"
 "ScTabViewObj";"com::sun::star::container::XElementAccess";"hasElements()"
 "ScTabViewObj";"com::sun::star::sheet::XRangeSelection";"startRangeSelection()"
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv
index 1e7c4d6bb130..fb9eba91fcf4 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv
@@ -1,4 +1,3 @@
-"ScViewPaneObj";"com::sun::star::sheet::XCellRangeReferrer";"getReferredCells()"
 "ScViewPaneObj";"com::sun::star::view::XControlAccess#optional";"getControl()"
 "ScViewPaneObj";"com::sun::star::view::XFormLayerAccess#optional";"getFromController()"
 "ScViewPaneObj";"com::sun::star::view::XFormLayerAccess#optional";"isFormDesignMode()"
diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java
deleted file mode 100644
index c5ca5ea5f8d2..000000000000
--- a/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-package ifc.sheet;
-
-import lib.MultiMethodTest;
-import lib.Status;
-import lib.StatusException;
-
-import com.sun.star.sheet.XCellRangeAddressable;
-import com.sun.star.sheet.XCellRangeReferrer;
-import com.sun.star.table.CellRangeAddress;
-import com.sun.star.table.XCellRange;
-import com.sun.star.uno.UnoRuntime;
-
-/**
-* Testing <code>com.sun.star.sheet.XCellRangeReferrer</code>
-* interface methods :
-* <ul>
-*  <li><code> getReferredCells() </code></li>
-* </ul> <p>
-* This test needs the following object relations :
-* <ul>
-*  <li> <code>'DATAAREA'</code> (of type <code>CellRangeAddress</code>):
-*   to have cell range address </li>
-* <ul> <p>
-* @see com.sun.star.sheet.XCellRangeReferrer
-* @see com.sun.star.table.CellRangeAddress
-*/
-public class _XCellRangeReferrer extends MultiMethodTest {
-
-    public XCellRangeReferrer oObj = null;
-
-    /**
-    * Test calls the method and compares cell range address of returned cell range
-    * with cell range address gotten by relation <code>'DATAAREA'</code>. <p>
-    * Has <b> OK </b> status if all fields of cell range addresses are equal. <p>
-    */
-    public void _getReferredCells() {
-        boolean bResult = true;
-
-        CellRangeAddress oldCRA = (CellRangeAddress)
-                                    tEnv.getObjRelation("DATAAREA");
-        if (oldCRA == null) throw new StatusException(Status.failed
-            ("Relation 'DATAAREA' not found"));
-
-        XCellRange cr = oObj.getReferredCells();
-
-        if (cr == null) {
-            log.println("getReferredCells returned NULL.");
-            tRes.tested("getReferredCells()", false);
-            return;
-        }
-        log.println(cr.toString());
-
-        XCellRangeAddressable xCRA = UnoRuntime.queryInterface(XCellRangeAddressable.class, cr);
-
-        CellRangeAddress objCRA = xCRA.getRangeAddress();
-
-        log.println("The named range was 'ANamedRange A1:B2'");
-        log.println("Expected CellRangeAddress: (" + oldCRA.Sheet +
-            "," + oldCRA.StartColumn + "," + oldCRA.StartRow + "," +
-            oldCRA.EndColumn + "," + objCRA.EndRow + ")");
-        log.println("CellRangeAddress gotten: (" + objCRA.Sheet + ","
-            + objCRA.StartColumn + "," + objCRA.StartRow + "," +
-            objCRA.EndColumn + "," + objCRA.EndRow + ")");
-
-        bResult &= objCRA.EndColumn   == oldCRA.EndColumn;
-        bResult &= objCRA.EndRow       == oldCRA.EndRow;
-        bResult &= objCRA.Sheet       == oldCRA.Sheet;
-        bResult &= objCRA.StartColumn == oldCRA.StartColumn;
-        bResult &= objCRA.StartRow       == oldCRA.StartRow;
-
-        tRes.tested("getReferredCells()", bResult);
-    }
-}
-
-
diff --git a/sc/qa/extras/scdatabaserangeobj.cxx b/sc/qa/extras/scdatabaserangeobj.cxx
index fed4a8dd7d5e..d7ffdf80c3bf 100644
--- a/sc/qa/extras/scdatabaserangeobj.cxx
+++ b/sc/qa/extras/scdatabaserangeobj.cxx
@@ -9,38 +9,37 @@
 
 #include <test/calc_unoapi_test.hxx>
 #include <test/sheet/databaserange.hxx>
+#include <test/sheet/xcellrangereferrer.hxx>
 #include <test/sheet/xdatabaserange.hxx>
 
 #include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
+#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
 #include <com/sun/star/sheet/XDatabaseRange.hpp>
+#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
 
 using namespace css;
 using namespace css::uno;
 
 namespace sc_apitest {
 
-class ScDatabaseRangeObj : public CalcUnoApiTest, public apitest::DatabaseRange, public apitest::XDatabaseRange
+class ScDatabaseRangeObj : public CalcUnoApiTest,
+                           public apitest::DatabaseRange,
+                           public apitest::XCellRangeReferrer,
+                           public apitest::XDatabaseRange
 {
 public:
     virtual void setUp() override;
     virtual void tearDown() override;
 
+    virtual uno::Reference< uno::XInterface > init() override;
     virtual uno::Reference< uno::XInterface > init( const OUString& rDBName ) override;
 
     ScDatabaseRangeObj();
 
     CPPUNIT_TEST_SUITE(ScDatabaseRangeObj);
 
-    // XDatabaseRange
-    CPPUNIT_TEST(testDataArea);
-    CPPUNIT_TEST(testGetSortDescriptor);
-    CPPUNIT_TEST(testGetSubtotalDescriptor);
-    CPPUNIT_TEST(testGetImportDescriptor);
-    CPPUNIT_TEST(testGetFilterDescriptor);
-    CPPUNIT_TEST(testRefresh);
-
     // DatabaseRange
     CPPUNIT_TEST(testMoveCells);
     CPPUNIT_TEST(testKeepFormats);
@@ -54,6 +53,17 @@ public:
     CPPUNIT_TEST(testTotalsRow);
     CPPUNIT_TEST(testContainsHeader);
 
+    // XCellRangeReferrer
+    CPPUNIT_TEST(testGetReferredCells);
+
+    // XDatabaseRange
+    CPPUNIT_TEST(testDataArea);
+    CPPUNIT_TEST(testGetSortDescriptor);
+    CPPUNIT_TEST(testGetSubtotalDescriptor);
+    CPPUNIT_TEST(testGetImportDescriptor);
+    CPPUNIT_TEST(testGetFilterDescriptor);
+    CPPUNIT_TEST(testRefresh);
+
     CPPUNIT_TEST_SUITE_END();
 private:
     uno::Reference< lang::XComponent > mxComponent;
@@ -64,14 +74,25 @@ ScDatabaseRangeObj::ScDatabaseRangeObj()
 {
 }
 
+uno::Reference<uno::XInterface> ScDatabaseRangeObj::init()
+{
+    return init("DataArea");
+}
+
 uno::Reference< uno::XInterface > ScDatabaseRangeObj::init( const OUString& rDBName )
 {
     uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW);
 
     uno::Reference< beans::XPropertySet > xPropSet(xDoc, UNO_QUERY_THROW);
     uno::Reference< container::XNameAccess > xNameAccess( xPropSet->getPropertyValue("DatabaseRanges"), UNO_QUERY_THROW);
+
+    uno::Reference<sheet::XCellRangeReferrer> xCRR(xNameAccess->getByName(rDBName), UNO_QUERY_THROW);
+    uno::Reference<sheet::XCellRangeAddressable> xCRA(xCRR->getReferredCells(), UNO_QUERY_THROW);
+    setCellRange(xCRA->getRangeAddress());
+
     uno::Reference< sheet::XDatabaseRange > xDBRange( xNameAccess->getByName(rDBName), UNO_QUERY_THROW);
     CPPUNIT_ASSERT(xDBRange.is());
+
     return xDBRange;
 }
 
diff --git a/sc/qa/extras/scnamedrangeobj.cxx b/sc/qa/extras/scnamedrangeobj.cxx
index f0021cca3c9f..85e32cacb0b5 100644
--- a/sc/qa/extras/scnamedrangeobj.cxx
+++ b/sc/qa/extras/scnamedrangeobj.cxx
@@ -8,21 +8,24 @@
  */
 
 #include <test/calc_unoapi_test.hxx>
-#include <test/sheet/xnamedrange.hxx>
 #include <test/container/xnamed.hxx>
+#include <test/sheet/xnamedrange.hxx>
 #include <test/sheet/xcellrangereferrer.hxx>
 
 #include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/sheet/XNamedRanges.hpp>
 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
 #include <com/sun/star/sheet/XSpreadsheet.hpp>
-#include <com/sun/star/sheet/XNamedRanges.hpp>
 
 using namespace css;
 using namespace css::uno;
 
 namespace sc_apitest {
 
-class ScNamedRangeObj : public CalcUnoApiTest, public apitest::XNamedRange, public apitest::XNamed, public apitest::XCellRangeReferrer
+class ScNamedRangeObj : public CalcUnoApiTest,
+                        public apitest::XCellRangeReferrer,
+                        public apitest::XNamed,
+                        public apitest::XNamedRange
 {
 public:
     ScNamedRangeObj();
@@ -35,15 +38,20 @@ public:
 
     CPPUNIT_TEST_SUITE(ScNamedRangeObj);
 
+    // XCellRangeReferrer
+    CPPUNIT_TEST(testGetReferredCells);
+
+    // XNamed
+    CPPUNIT_TEST(testSetName);
+    CPPUNIT_TEST(testGetName);
+
+    // XNamedRange
     CPPUNIT_TEST(testGetContent);
     CPPUNIT_TEST(testSetContent);
     CPPUNIT_TEST(testGetType);
     CPPUNIT_TEST(testSetType);
     CPPUNIT_TEST(testGetReferencePosition);
     CPPUNIT_TEST(testSetReferencePosition);
-    CPPUNIT_TEST(testSetName);
-    CPPUNIT_TEST(testGetName);
-    CPPUNIT_TEST(testGetReferredCells);
 
     CPPUNIT_TEST_SUITE_END();
 private:
@@ -53,8 +61,7 @@ private:
 
 ScNamedRangeObj::ScNamedRangeObj():
         CalcUnoApiTest("/sc/qa/extras/testdocuments"),
-        apitest::XNamed("NamedRange"),
-        apitest::XCellRangeReferrer(table::CellRangeAddress(0,1,7,1,7))
+        apitest::XNamed("NamedRange")
 {
 }
 
@@ -66,6 +73,8 @@ uno::Reference< sheet::XNamedRanges > ScNamedRangeObj::init_impl()
     uno::Reference< sheet::XNamedRanges > xNamedRanges(xPropSet->getPropertyValue("NamedRanges"), UNO_QUERY_THROW);
     CPPUNIT_ASSERT(xNamedRanges.is());
 
+    setCellRange(table::CellRangeAddress(0, 1, 7, 1, 7));
+
     return xNamedRanges;
 }
 
diff --git a/sc/qa/extras/sctabviewobj.cxx b/sc/qa/extras/sctabviewobj.cxx
index 106e13617c29..e8d9a8c8afd1 100644
--- a/sc/qa/extras/sctabviewobj.cxx
+++ b/sc/qa/extras/sctabviewobj.cxx
@@ -10,6 +10,7 @@
 #include <test/calc_unoapi_test.hxx>
 #include <test/sheet/spreadsheetviewsettings.hxx>
 #include <test/sheet/xactivationbroadcaster.hxx>
+#include <test/sheet/xcellrangereferrer.hxx>
 #include <test/sheet/xspreadsheetview.hxx>
 #include <test/sheet/xviewfreezable.hxx>
 #include <test/sheet/xviewsplitable.hxx>
@@ -31,6 +32,7 @@ namespace sc_apitest
 class ScTabViewObj : public CalcUnoApiTest,
                      public apitest::SpreadsheetViewSettings,
                      public apitest::XActivationBroadcaster,
+                     public apitest::XCellRangeReferrer,
                      public apitest::XSpreadsheetView,
                      public apitest::XViewFreezable,
                      public apitest::XViewSplitable
@@ -52,6 +54,9 @@ public:
     // XActivationBroadcaster
     CPPUNIT_TEST(testAddRemoveActivationEventListener);
 
+    // XCellRangeReferrer
+    CPPUNIT_TEST(testGetReferredCells);
+
     // XSpreadsheetView
     CPPUNIT_TEST(testGetSetActiveSheet);
 
@@ -75,9 +80,10 @@ ScTabViewObj::ScTabViewObj()
 uno::Reference< uno::XInterface > ScTabViewObj::init()
 {
     uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, uno::UNO_QUERY_THROW);
-
     uno::Reference<frame::XModel> xModel(xDoc, uno::UNO_QUERY_THROW);
 
+    setCellRange(table::CellRangeAddress(0, 0, 0, 6, 23));
+
     return xModel->getCurrentController();
 }
 
diff --git a/sc/qa/extras/scviewpaneobj.cxx b/sc/qa/extras/scviewpaneobj.cxx
index f999edd7b35d..9aee4a553cd6 100644
--- a/sc/qa/extras/scviewpaneobj.cxx
+++ b/sc/qa/extras/scviewpaneobj.cxx
@@ -8,6 +8,7 @@
  */
 
 #include <test/calc_unoapi_test.hxx>
+#include <test/sheet/xcellrangereferrer.hxx>
 #include <test/sheet/xviewpane.hxx>
 
 #include <com/sun/star/container/XIndexAccess.hpp>
@@ -23,7 +24,9 @@ using namespace css::uno;
 
 namespace sc_apitest {
 
-class ScViewPaneObj : public CalcUnoApiTest, public apitest::XViewPane
+class ScViewPaneObj : public CalcUnoApiTest,
+                      public apitest::XCellRangeReferrer,
+                      public apitest::XViewPane
 {
 public:
     ScViewPaneObj();
@@ -34,6 +37,9 @@ public:
 
     CPPUNIT_TEST_SUITE(ScViewPaneObj);
 
+    // XCellRangeReferrer
+    CPPUNIT_TEST(testGetReferredCells);
+
     // XViewPane
     CPPUNIT_TEST(testFirstVisibleColumn);
     CPPUNIT_TEST(testFirstVisibleRow);
@@ -58,6 +64,9 @@ uno::Reference< uno::XInterface > ScViewPaneObj::init()
     uno::Reference< frame::XController > xController = xModel->getCurrentController();
     uno::Reference< container::XIndexAccess > xIndexAccess(xController, uno::UNO_QUERY_THROW);
     uno::Reference< sheet::XViewPane > xViewPane (xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW);
+
+    setCellRange(xViewPane->getVisibleRange());
+
     return xViewPane;
 }
 
diff --git a/test/source/sheet/xcellrangereferrer.cxx b/test/source/sheet/xcellrangereferrer.cxx
index 60a3976216cd..7ce7dd384a95 100644
--- a/test/source/sheet/xcellrangereferrer.cxx
+++ b/test/source/sheet/xcellrangereferrer.cxx
@@ -7,10 +7,13 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <test/cppunitasserthelper.hxx>
 #include <test/sheet/xcellrangereferrer.hxx>
+
 #include <com/sun/star/table/XCellRange.hpp>
 #include <com/sun/star/sheet/XCellRangeAddressable.hpp>
 #include <com/sun/star/sheet/XCellRangeReferrer.hpp>
+
 #include <cppunit/extensions/HelperMacros.h>
 
 using namespace css;
@@ -26,13 +29,8 @@ void XCellRangeReferrer::testGetReferredCells()
     uno::Reference< sheet::XCellRangeAddressable > xAdressable( xReferredRange, UNO_QUERY_THROW );
     table::CellRangeAddress aCellRange = xAdressable->getRangeAddress();
 
-    CPPUNIT_ASSERT_EQUAL( aCellRange.Sheet, maCellRange.Sheet );
-    CPPUNIT_ASSERT_EQUAL( aCellRange.StartRow, maCellRange.StartRow );
-    CPPUNIT_ASSERT_EQUAL( aCellRange.EndRow, maCellRange.EndRow );
-    CPPUNIT_ASSERT_EQUAL( aCellRange.StartColumn, maCellRange.StartColumn );
-    CPPUNIT_ASSERT_EQUAL( aCellRange.EndColumn, maCellRange.EndColumn );
+    CPPUNIT_ASSERT_EQUAL(aCellRange, getCellRange());
 }
-
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list