summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-05-25 09:28:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-05-26 09:57:21 +0100
commitbb77090deb4843627de51ba90c8fa4935ebe20f6 (patch)
tree570ad5c1b5c110e71c045e7c4d7b1b6cfbf98faa
parent6c9dfa8ab7cc25d6cc3ce988803118b5d56ea30b (diff)
FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
this part anyway, the sc/qa/unoapi parts are still broken Change-Id: I759c4f82b3bbd4da4dc7d0c9e16aacee02972f51
-rw-r--r--sc/CppunitTest_sc_annotationshapeobj.mk4
-rw-r--r--sc/Module_sc.mk3
-rw-r--r--sc/qa/extras/scannotationshapeobj.cxx40
3 files changed, 28 insertions, 19 deletions
diff --git a/sc/CppunitTest_sc_annotationshapeobj.mk b/sc/CppunitTest_sc_annotationshapeobj.mk
index 1d95beff9fd3..501d52d7a4ba 100644
--- a/sc/CppunitTest_sc_annotationshapeobj.mk
+++ b/sc/CppunitTest_sc_annotationshapeobj.mk
@@ -65,6 +65,7 @@ $(eval $(call gb_CppunitTest_use_api,sc_annotationshapeobj,\
))
$(eval $(call gb_CppunitTest_use_ure,sc_annotationshapeobj))
+$(eval $(call gb_CppunitTest_use_vcl,sc_annotationshapeobj))
$(eval $(call gb_CppunitTest_use_components,sc_annotationshapeobj,\
basic/util/sb \
@@ -75,6 +76,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_annotationshapeobj,\
forms/util/frm \
framework/util/fwk \
i18npool/util/i18npool \
+ linguistic/source/lng \
oox/util/oox \
package/source/xstor/xstor \
package/util/package2 \
@@ -96,6 +98,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_annotationshapeobj,\
unotools/util/utl \
unoxml/source/rdf/unordf \
unoxml/source/service/unoxml \
+ xmloff/util/xo \
+ svtools/util/svt \
))
$(eval $(call gb_CppunitTest_use_configuration,sc_annotationshapeobj))
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index fc4930313eb5..65a278e91226 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -64,12 +64,11 @@ $(eval $(call gb_Module_add_slowcheck_targets,sc, \
# Disabled to allow the check tinderbox execute the sd tests
# CppunitTest_sc_chart_regression_test \
-# FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
-# CppunitTest_sc_annotationshapeobj \
$(eval $(call gb_Module_add_subsequentcheck_targets,sc,\
JunitTest_sc_complex \
JunitTest_sc_unoapi \
+ CppunitTest_sc_annotationshapeobj \
CppunitTest_sc_outlineobj \
CppunitTest_sc_styleloaderobj \
CppunitTest_sc_recordchanges \
diff --git a/sc/qa/extras/scannotationshapeobj.cxx b/sc/qa/extras/scannotationshapeobj.cxx
index 7e3c241a21f6..07d3d80e368f 100644
--- a/sc/qa/extras/scannotationshapeobj.cxx
+++ b/sc/qa/extras/scannotationshapeobj.cxx
@@ -7,13 +7,15 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <test/unoapi_test.hxx>
+#include <test/calc_unoapi_test.hxx>
#include <test/text/xtext.hxx>
#include <com/sun/star/sheet/XSheetAnnotationAnchor.hpp>
+#include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp>
#include <com/sun/star/sheet/XSheetAnnotationShapeSupplier.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
+#include <com/sun/star/table/CellAddress.hpp>
#define NUMBER_OF_TESTS 1
@@ -22,15 +24,15 @@ using namespace css::uno;
namespace sc_apitest {
-class ScAnnotationShapeObj : public UnoApiTest, apitest::XText
+class ScAnnotationShapeObj : public CalcUnoApiTest, apitest::XText
{
public:
ScAnnotationShapeObj();
- virtual void setUp();
- virtual void tearDown();
- virtual uno::Reference<uno::XInterface> init();
- virtual uno::Reference<text::XTextContent> getTextContent();
+ virtual void setUp() SAL_OVERRIDE;
+ virtual void tearDown() SAL_OVERRIDE;
+ virtual uno::Reference<uno::XInterface> init() SAL_OVERRIDE;
+ virtual uno::Reference<text::XTextContent> getTextContent() SAL_OVERRIDE;
CPPUNIT_TEST_SUITE(ScAnnotationShapeObj);
@@ -49,12 +51,15 @@ sal_Int32 ScAnnotationShapeObj::nTest = 0;
uno::Reference<lang::XComponent> ScAnnotationShapeObj::mxComponent;
uno::Reference<text::XTextContent> ScAnnotationShapeObj::mxField;
-ScAnnotationShapeObj::ScAnnotationShapeObj() {}
+ScAnnotationShapeObj::ScAnnotationShapeObj()
+ : CalcUnoApiTest("sc/qa/extras/testdocuments")
+{
+}
void ScAnnotationShapeObj::setUp()
{
++nTest;
- UnoApiTest::setUp();
+ CalcUnoApiTest::setUp();
}
void ScAnnotationShapeObj::tearDown()
@@ -66,12 +71,11 @@ void ScAnnotationShapeObj::tearDown()
mxComponent.clear();
}
- UnoApiTest::tearDown();
+ CalcUnoApiTest::tearDown();
}
uno::Reference<uno::XInterface> ScAnnotationShapeObj::init()
{
-#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
if (!mxComponent.is())
// Load an empty document.
mxComponent = loadFromDesktop("private:factory/scalc");
@@ -81,30 +85,32 @@ uno::Reference<uno::XInterface> ScAnnotationShapeObj::init()
uno::Reference<sheet::XSpreadsheet> xSheet(xIA->getByIndex(0), UNO_QUERY_THROW);
// Use cell A1 for this.
+
+ table::CellAddress aNotePos(0, 0, 0);
+ Reference<sheet::XSheetAnnotationsSupplier> xAnnosSupp(xSheet, UNO_QUERY_THROW);
+ Reference<sheet::XSheetAnnotations> xAnnos(xAnnosSupp->getAnnotations(), UNO_SET_THROW);
+ // non-empty string required by note implementation (real text will be added below)
+ xAnnos->insertNew(aNotePos, OUString(' '));
+
uno::Reference<table::XCell> xCell = xSheet->getCellByPosition(0, 0);
uno::Reference<sheet::XSheetAnnotationAnchor> xAnchor(xCell, UNO_QUERY_THROW);
- uno::Reference<sheet::XSheetAnnotation> xAnnotation = xAnchor->getAnnotation();
+ uno::Reference<sheet::XSheetAnnotation> xAnnotation(xAnchor->getAnnotation(), UNO_SET_THROW);
uno::Reference<text::XSimpleText> xAnnoText(xAnnotation, UNO_QUERY_THROW);
xAnnoText->setString("ScAnnotationShapeObj");
uno::Reference<sheet::XSheetAnnotationShapeSupplier> xShapeSupp(xAnnotation, UNO_QUERY_THROW);
- uno::Reference<drawing::XShape> xShape = xShapeSupp->getAnnotationShape();
+ uno::Reference<drawing::XShape> xShape(xShapeSupp->getAnnotationShape(), UNO_SET_THROW);
return xShape;
-#else
- return uno::Reference<drawing::XShape>();
-#endif
}
uno::Reference<text::XTextContent> ScAnnotationShapeObj::getTextContent()
{
-#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
if (!mxField.is())
{
uno::Reference<lang::XMultiServiceFactory> xSM(mxComponent, UNO_QUERY_THROW);
mxField.set(xSM->createInstance("com.sun.star.text.TextField.DateTime"), UNO_QUERY_THROW);
}
-#endif
return mxField;
}