dbaccess/CppunitTest_dbaccess_dialog_save.mk | 4 -- dbaccess/CppunitTest_dbaccess_macros_test.mk | 9 +++-- dbaccess/Module_dbaccess.mk | 6 --- dbaccess/qa/extras/dialog-save.cxx | 22 +------------ dbaccess/qa/extras/macros-test.cxx | 40 +++--------------------- include/test/calc_unoapi_test.hxx | 26 +++++++++++++++ include/test/unoapi_test.hxx | 1 reportdesign/source/core/api/Shape.cxx | 27 +++++++++++----- sc/CppunitTest_sc_chart_regression_test.mk | 4 +- sc/qa/extras/regression-test.cxx | 44 ++------------------------- test/Library_subsequenttest.mk | 1 test/source/calc_unoapi_test.cxx | 37 ++++++++++++++++++++++ test/source/unoapi_test.cxx | 8 +--- unotest/source/cpp/macros_test.cxx | 2 + 14 files changed, 108 insertions(+), 123 deletions(-)
New commits: commit f630c021edbe3783bd164cb78ea6364c26f23e4e Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sat Nov 9 06:34:04 2013 +0100 nitpicks Change-Id: I190a629a8c76f98b54295eebcf712b4c5b26ecff diff --git a/dbaccess/qa/extras/dialog-save.cxx b/dbaccess/qa/extras/dialog-save.cxx index e52fa98..aaa7593 100644 --- a/dbaccess/qa/extras/dialog-save.cxx +++ b/dbaccess/qa/extras/dialog-save.cxx @@ -62,7 +62,7 @@ DialogSaveTest::DialogSaveTest() void DialogSaveTest::test() { OUString aFileName; - aFileName = getURLFromWorkdir("/CppunitTest/testDialogSave.odb"); + aFileName = getURLFromWorkdir("CppunitTest/testDialogSave.odb"); { uno::Reference< lang::XComponent > xComponent = loadFromDesktop(aFileName); CPPUNIT_ASSERT(xComponent.is()); @@ -95,7 +95,7 @@ void DialogSaveTest::test() xDocMod->setModified(sal_True); // now save; the code path to exercise in this test is the "store to same location" - // do *not* change to store(As|To|URL! + // do *not* change to store(As|To|URL)! xDocStorable->store(); // close commit bf967a4f15c9f7c3461bf5717bb9938ddf476d17 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sat Nov 9 06:33:47 2013 +0100 deliver can use hardlink Change-Id: Ia04eedc6375748505c954e2315a0c5af7afae84f diff --git a/dbaccess/CppunitTest_dbaccess_dialog_save.mk b/dbaccess/CppunitTest_dbaccess_dialog_save.mk index 70689a7..8b5832e 100644 --- a/dbaccess/CppunitTest_dbaccess_dialog_save.mk +++ b/dbaccess/CppunitTest_dbaccess_dialog_save.mk @@ -111,7 +111,7 @@ $(eval $(call gb_CppunitTest_use_unittest_configuration,dbaccess_dialog_save)) $(call gb_CppunitTest_get_target,dbaccess_dialog_save) : $(WORKDIR)/CppunitTest/testDialogSave.odb $(WORKDIR)/CppunitTest/testDialogSave.odb : $(SRCDIR)/dbaccess/qa/extras/testdocuments/testDialogSave.odb mkdir -p $(dir $@) - $(call gb_Deliver_deliver,$<,$@) + cp -P -f "$<" "$@" .PHONY: $(WORKDIR)/CppunitTest/testDialogSave.odb # vim: set noet sw=4 ts=4: commit 6f40eec725923c91d2447363a3c14b07b2cc73ce Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sat Nov 9 06:06:48 2013 +0100 Calc UNO API test Change-Id: I6dcd9ac05ff7c4a6fbae7947b0ceda8797feea2f diff --git a/include/test/calc_unoapi_test.hxx b/include/test/calc_unoapi_test.hxx new file mode 100644 index 0000000..c31c35c --- /dev/null +++ b/include/test/calc_unoapi_test.hxx @@ -0,0 +1,26 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + */ + +#include <test/unoapi_test.hxx> + +// basic uno api test class for calc + +class OOO_DLLPUBLIC_TEST CalcUnoApiTest : public UnoApiTest +{ +public: + CalcUnoApiTest(const OUString& path); + + virtual void setUp(); + virtual void tearDown(); + +private: + css::uno::Reference<css::uno::XInterface> m_xCalcComponent; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk index 94e2558..80a855d 100644 --- a/test/Library_subsequenttest.mk +++ b/test/Library_subsequenttest.mk @@ -43,6 +43,7 @@ $(eval $(call gb_Library_use_externals,subsequenttest,\ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\ test/source/unoapi_test \ + test/source/calc_unoapi_test \ test/source/beans/xpropertyset \ test/source/container/xelementaccess \ test/source/container/xindexaccess \ diff --git a/test/source/calc_unoapi_test.cxx b/test/source/calc_unoapi_test.cxx new file mode 100644 index 0000000..8d7e218 --- /dev/null +++ b/test/source/calc_unoapi_test.cxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + */ + +#include <test/calc_unoapi_test.hxx> + +using namespace css; +using namespace css::uno; + +CalcUnoApiTest::CalcUnoApiTest(const OUString& path) + : UnoApiTest(path) +{ +} + +void CalcUnoApiTest::setUp() +{ + UnoApiTest::setUp(); + + // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure, + // which is a private symbol to us, gets called + m_xCalcComponent = + getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument"); + CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is()); +} + +void CalcUnoApiTest::tearDown() +{ + uno::Reference< lang::XComponent >( m_xCalcComponent, UNO_QUERY_THROW )->dispose(); + UnoApiTest::tearDown(); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 10d6b8ed56ba972c13d7128b12276ff3acfb1208 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sat Nov 9 06:05:57 2013 +0100 fixup sc chart regression test does not pass though; leave that to the domain experts Change-Id: Ic8b712ad4e1eca892d51d03d3a93b8c8087074dc diff --git a/sc/CppunitTest_sc_chart_regression_test.mk b/sc/CppunitTest_sc_chart_regression_test.mk index 65619e7..e413f8c 100644 --- a/sc/CppunitTest_sc_chart_regression_test.mk +++ b/sc/CppunitTest_sc_chart_regression_test.mk @@ -37,7 +37,8 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_chart_regression_test, \ svt \ svx \ svxcore \ - test \ + test \ + subsequenttest \ tl \ tk \ ucbhelper \ @@ -76,6 +77,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_chart_regression_test,\ forms/util/frm \ framework/util/fwk \ i18npool/util/i18npool \ + linguistic/source/lng \ oox/util/oox \ package/source/xstor/xstor \ package/util/package2 \ commit 4c64b8851b851cd88c762fd782d19bbbecdcbb50 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sat Nov 9 06:02:57 2013 +0100 fixup and enable dbaccess macros_test Change-Id: Ic5599df7a2ad7f2f3a9f2794b16ef0a4ab698b06 diff --git a/dbaccess/CppunitTest_dbaccess_macros_test.mk b/dbaccess/CppunitTest_dbaccess_macros_test.mk index 908600c..8699214 100644 --- a/dbaccess/CppunitTest_dbaccess_macros_test.mk +++ b/dbaccess/CppunitTest_dbaccess_macros_test.mk @@ -21,7 +21,6 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_macros_test, \ cppuhelper \ dba \ dbu \ - dbu \ sdbt \ drawinglayer \ editeng \ @@ -40,7 +39,8 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_macros_test, \ svt \ svx \ svxcore \ - test \ + test \ + subsequenttest \ tl \ tk \ ucbhelper \ @@ -94,10 +94,13 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_macros_test,\ unotools/util/utl \ unoxml/source/rdf/unordf \ unoxml/source/service/unoxml \ + xmloff/util/xo \ )) $(eval $(call gb_CppunitTest_use_configuration,dbaccess_macros_test)) +$(eval $(call gb_CppunitTest_use_filter_configuration,dbaccess_macros_test)) + $(eval $(call gb_CppunitTest_use_unittest_configuration,dbaccess_macros_test)) # vim: set noet sw=4 ts=4: diff --git a/dbaccess/Module_dbaccess.mk b/dbaccess/Module_dbaccess.mk index e9eb146..868cd81 100644 --- a/dbaccess/Module_dbaccess.mk +++ b/dbaccess/Module_dbaccess.mk @@ -39,6 +39,7 @@ endif $(eval $(call gb_Module_add_check_targets,dbaccess,\ CppunitTest_dbaccess_dialog_save \ + CppunitTest_dbaccess_macros_test \ )) ifeq ($(ENABLE_JAVA),TRUE) @@ -57,11 +58,6 @@ $(eval $(call gb_Module_add_check_targets,dbaccess,\ endif endif -# disable test because it still fails in some situations -# CppunitTest_dbaccess_macros_test \ -# - - $(eval $(call gb_Module_add_subsequentcheck_targets,dbaccess,\ JunitTest_dbaccess_complex \ JunitTest_dbaccess_unoapi \ commit a071a29d4f7e8065a36a313027a007edac102e20 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sat Nov 9 05:54:59 2013 +0100 UnoApiTest don't require Calc There is no reason for the generic UnoApiTest to require Calc specifically. Calc tests can/should instantiate a Calc instance. We can create a CalcUnoApiTest for that that inherits from UnoApiTest; however this does not seem necessary, "make sc.clean" succeeds. Anyway, the ScGlobals::ensure mentioned in the comment does not seem to exist. This allows us to eliminate some code duplication in tests that were reimplementing UnoApiTest minus the Calc instantiation. Change-Id: I37bea9df41e3960df0458fe689cf6c046a243617 diff --git a/dbaccess/CppunitTest_dbaccess_dialog_save.mk b/dbaccess/CppunitTest_dbaccess_dialog_save.mk index 5e571dc..70689a7 100644 --- a/dbaccess/CppunitTest_dbaccess_dialog_save.mk +++ b/dbaccess/CppunitTest_dbaccess_dialog_save.mk @@ -57,8 +57,6 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_dialog_save, \ )) $(eval $(call gb_CppunitTest_set_include,dbaccess_dialog_save,\ - -I$(SRCDIR)/sc/source/ui/inc \ - -I$(SRCDIR)/sc/inc \ $$(INCLUDE) \ )) diff --git a/dbaccess/CppunitTest_dbaccess_macros_test.mk b/dbaccess/CppunitTest_dbaccess_macros_test.mk index f84405c..908600c 100644 --- a/dbaccess/CppunitTest_dbaccess_macros_test.mk +++ b/dbaccess/CppunitTest_dbaccess_macros_test.mk @@ -53,8 +53,6 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_macros_test, \ )) $(eval $(call gb_CppunitTest_set_include,dbaccess_macros_test,\ - -I$(SRCDIR)/sc/source/ui/inc \ - -I$(SRCDIR)/sc/inc \ $$(INCLUDE) \ )) diff --git a/dbaccess/qa/extras/dialog-save.cxx b/dbaccess/qa/extras/dialog-save.cxx index 823ab1d..e52fa98 100644 --- a/dbaccess/qa/extras/dialog-save.cxx +++ b/dbaccess/qa/extras/dialog-save.cxx @@ -37,24 +37,25 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -class DialogSaveTest : public test::BootstrapFixture, public unotest::MacrosTest +class DialogSaveTest : public UnoApiTest { public: DialogSaveTest(); - virtual void setUp(); - virtual void tearDown(); - void test(); CPPUNIT_TEST_SUITE(DialogSaveTest); +// Should we disable this test on MOX and WNT? +// #if !defined(MACOSX) && !defined(WNT) CPPUNIT_TEST(test); +// #endif CPPUNIT_TEST_SUITE_END(); }; DialogSaveTest::DialogSaveTest() + : UnoApiTest("/dbaccess/qa/extras/testdocuments") { } @@ -117,21 +118,6 @@ void DialogSaveTest::test() } } -void DialogSaveTest::setUp() -{ - test::BootstrapFixture::setUp(); - - // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure, - // which is a private symbol to us, gets called - mxDesktop = com::sun::star::frame::Desktop::create( comphelper::getComponentContext(getMultiServiceFactory()) ); - CPPUNIT_ASSERT(mxDesktop.is()); -} - -void DialogSaveTest::tearDown() -{ - test::BootstrapFixture::tearDown(); -} - CPPUNIT_TEST_SUITE_REGISTRATION(DialogSaveTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/dbaccess/qa/extras/macros-test.cxx b/dbaccess/qa/extras/macros-test.cxx index bcff534..761f241 100644 --- a/dbaccess/qa/extras/macros-test.cxx +++ b/dbaccess/qa/extras/macros-test.cxx @@ -8,11 +8,9 @@ */ #include <sal/config.h> -#include <test/bootstrapfixture.hxx> -#include <unotest/macros_test.hxx> +#include <test/unoapi_test.hxx> #include <rtl/strbuf.hxx> #include <osl/file.hxx> -#include <com/sun/star/frame/Desktop.hpp> #include <sfx2/app.hxx> #include <sfx2/docfilt.hxx> @@ -26,16 +24,11 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -class DBAccessTest : public test::BootstrapFixture, public unotest::MacrosTest +class DBAccessTest : public UnoApiTest { public: DBAccessTest(); - void createFileURL(const OUString& aFileBase, const OUString& aFileExtension, OUString& rFilePath); - - virtual void setUp(); - virtual void tearDown(); - void test(); CPPUNIT_TEST_SUITE(DBAccessTest); @@ -44,46 +37,23 @@ public: #endif CPPUNIT_TEST_SUITE_END(); -private: - OUString m_aBaseString; }; -void DBAccessTest::createFileURL(const OUString& aFileBase, const OUString& aFileExtension, OUString& rFilePath) -{ - rFilePath = getSrcRootURL() + m_aBaseString + "/" + aFileBase + aFileExtension; -} - DBAccessTest::DBAccessTest() - : m_aBaseString(RTL_CONSTASCII_USTRINGPARAM("/dbaccess/qa/extras/testdocuments")) + : UnoApiTest("/dbaccess/qa/extras/testdocuments") { } void DBAccessTest::test() { - const OUString aFileNameBase("testdb."); - const OUString aFileExtension("odb"); + const OUString aFileNameBase("testdb.odb"); OUString aFileName; - createFileURL(aFileNameBase, aFileExtension, aFileName); + createFileURL(aFileNameBase, aFileName); uno::Reference< lang::XComponent > xComponent = loadFromDesktop(aFileName); CPPUNIT_ASSERT(xComponent.is()); } -void DBAccessTest::setUp() -{ - test::BootstrapFixture::setUp(); - - // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure, - // which is a private symbol to us, gets called - mxDesktop = com::sun::star::frame::Desktop::create( comphelper::getComponentContext(getMultiServiceFactory()) ); - CPPUNIT_ASSERT(mxDesktop.is()); -} - -void DBAccessTest::tearDown() -{ - test::BootstrapFixture::tearDown(); -} - CPPUNIT_TEST_SUITE_REGISTRATION(DBAccessTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx index ee83689..0555472 100644 --- a/include/test/unoapi_test.hxx +++ b/include/test/unoapi_test.hxx @@ -30,7 +30,6 @@ protected: private: - css::uno::Reference<css::uno::XInterface> m_xCalcComponent; OUString m_aBaseString; }; diff --git a/sc/qa/extras/regression-test.cxx b/sc/qa/extras/regression-test.cxx index f455259..b195e91 100644 --- a/sc/qa/extras/regression-test.cxx +++ b/sc/qa/extras/regression-test.cxx @@ -8,8 +8,7 @@ */ #include <sal/config.h> -#include <test/bootstrapfixture.hxx> -#include <unotest/macros_test.hxx> +#include <test/unoapi_test.hxx> #include <rtl/strbuf.hxx> #include <osl/file.hxx> @@ -58,41 +57,24 @@ bool checkDumpAgainstFile( const OUString& rDump, const OUString aFilePath, cons } -class ScChartRegressionTest : public test::BootstrapFixture, public unotest::MacrosTest +class ScChartRegressionTest : public UnoApiTest { public: ScChartRegressionTest(); - void createFileURL(const OUString& aFileBase, const OUString& aFileExtension, OUString& rFilePath); - - virtual void setUp(); - virtual void tearDown(); - void test(); CPPUNIT_TEST_SUITE(ScChartRegressionTest); CPPUNIT_TEST(test); CPPUNIT_TEST_SUITE_END(); -private: - uno::Reference<uno::XInterface> m_xCalcComponent; - OUString m_aBaseString; }; -void ScChartRegressionTest::createFileURL(const OUString& aFileBase, const OUString& aFileExtension, OUString& rFilePath) -{ - OUString aSep("/"); - OUStringBuffer aBuffer( getSrcRootURL() ); - aBuffer.append(m_aBaseString).append(aSep).append(aFileExtension); - aBuffer.append(aSep).append(aFileBase).append(aFileExtension); - rFilePath = aBuffer.makeStringAndClear(); -} - void ScChartRegressionTest::test() { OUString aFileName; - createFileURL( "testChart.", "ods", aFileName); + createFileURL( "testChart.ods", aFileName); uno::Reference< com::sun::star::lang::XComponent > xComponent = loadFromDesktop(aFileName, "com.sun.star.sheet.SpreadsheetDocument"); CPPUNIT_ASSERT(xComponent.is()); @@ -132,26 +114,8 @@ void ScChartRegressionTest::test() } ScChartRegressionTest::ScChartRegressionTest() - : m_aBaseString(RTL_CONSTASCII_USTRINGPARAM("/chart2/qa/unit/data")) -{ -} - -void ScChartRegressionTest::setUp() -{ - test::BootstrapFixture::setUp(); - - // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure, - // which is a private symbol to us, gets called - m_xCalcComponent = - getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument"); - CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is()); - mxDesktop = com::sun::star::frame::Desktop::create( comphelper::getComponentContext(getMultiServiceFactory()) ); -} - -void ScChartRegressionTest::tearDown() + : UnoApiTest("/chart2/qa/unit/data/ods") { - uno::Reference< lang::XComponent >( m_xCalcComponent, UNO_QUERY_THROW )->dispose(); - test::BootstrapFixture::tearDown(); } CPPUNIT_TEST_SUITE_REGISTRATION(ScChartRegressionTest); diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx index 214ed17..256e1f3 100644 --- a/test/source/unoapi_test.cxx +++ b/test/source/unoapi_test.cxx @@ -25,17 +25,13 @@ void UnoApiTest::setUp() { test::BootstrapFixture::setUp(); - // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure, - // which is a private symbol to us, gets called - m_xCalcComponent = - getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument"); - CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is()); mxDesktop = com::sun::star::frame::Desktop::create( comphelper::getComponentContext(getMultiServiceFactory()) ); + CPPUNIT_ASSERT_MESSAGE("no desktop!", mxDesktop.is()); } void UnoApiTest::tearDown() { - uno::Reference< lang::XComponent >( m_xCalcComponent, UNO_QUERY_THROW )->dispose(); + uno::Reference< lang::XComponent >( mxDesktop )->dispose(); test::BootstrapFixture::tearDown(); } commit e937995ca3718042efabaf04a5161c0c76107b9c Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sat Nov 9 04:55:34 2013 +0100 dbaccess DialogSaveTest not a UnoApiTest It overrides everything that UnoApiTest does anyway. Change-Id: I531b2245626cbfd8d13a48a710d409e30ba2d20a diff --git a/dbaccess/qa/extras/dialog-save.cxx b/dbaccess/qa/extras/dialog-save.cxx index a373452..823ab1d 100644 --- a/dbaccess/qa/extras/dialog-save.cxx +++ b/dbaccess/qa/extras/dialog-save.cxx @@ -37,7 +37,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -class DialogSaveTest : public UnoApiTest +class DialogSaveTest : public test::BootstrapFixture, public unotest::MacrosTest { public: DialogSaveTest(); @@ -48,17 +48,13 @@ public: void test(); CPPUNIT_TEST_SUITE(DialogSaveTest); -// Should we disable this test on MOX and WNT? -// #if !defined(MACOSX) && !defined(WNT) CPPUNIT_TEST(test); -// #endif CPPUNIT_TEST_SUITE_END(); }; DialogSaveTest::DialogSaveTest() - : UnoApiTest("/dbaccess/qa/extras/testdocuments") { } commit d00c4476da0cf5e2dd52c7609d8c595b3c10bce2 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sat Nov 9 04:29:04 2013 +0100 fail early and hard Change-Id: Ib550126d190e9436cf77e6c51eaf869ecd75a18b diff --git a/unotest/source/cpp/macros_test.cxx b/unotest/source/cpp/macros_test.cxx index 8a5c1ec..bcceddc 100644 --- a/unotest/source/cpp/macros_test.cxx +++ b/unotest/source/cpp/macros_test.cxx @@ -21,7 +21,9 @@ namespace unotest { uno::Reference< com::sun::star::lang::XComponent > MacrosTest::loadFromDesktop(const OUString& rURL, const char* pDocService) { + CPPUNIT_ASSERT_MESSAGE("no desktop", mxDesktop.is()); uno::Reference< com::sun::star::frame::XComponentLoader> xLoader = uno::Reference< com::sun::star::frame::XComponentLoader >( mxDesktop, uno::UNO_QUERY ); + CPPUNIT_ASSERT_MESSAGE("no loader", xLoader.is()); com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > args(1); args[0].Name = "MacroExecutionMode"; args[0].Handle = -1; commit 1812d606b7c9c16d4123fc8b911fe3f790a31b2b Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sat Nov 9 03:45:33 2013 +0100 rptui::OShape make getSupportedServiceNames and supportsService at the cost of inconsistency between getSupportedServiceNames and getSupportedServiceNames_Static Change-Id: I940b23c35a6c4080eb6575adff1de0b08cdb3698 diff --git a/reportdesign/source/core/api/Shape.cxx b/reportdesign/source/core/api/Shape.cxx index d22ed65..9b3a436 100644 --- a/reportdesign/source/core/api/Shape.cxx +++ b/reportdesign/source/core/api/Shape.cxx @@ -117,6 +117,12 @@ void SAL_CALL OShape::dispose() throw(uno::RuntimeException) ShapePropertySet::dispose(); cppu::WeakComponentImplHelperBase::dispose(); } +//------------------------------------------------------------------------------ +uno::Reference< uno::XInterface > OShape::create(uno::Reference< uno::XComponentContext > const & xContext) +{ + return *(new OShape(xContext)); +} + // ----------------------------------------------------------------------------- OUString OShape::getImplementationName_Static( ) throw(uno::RuntimeException) { @@ -136,22 +142,27 @@ uno::Sequence< OUString > OShape::getSupportedServiceNames_Static( ) throw(uno: return aServices; } -//------------------------------------------------------------------------------ -uno::Reference< uno::XInterface > OShape::create(uno::Reference< uno::XComponentContext > const & xContext) -{ - return *(new OShape(xContext)); -} - //-------------------------------------------------------------------------- uno::Sequence< OUString > SAL_CALL OShape::getSupportedServiceNames( ) throw(uno::RuntimeException) { - return getSupportedServiceNames_Static(); + if(m_sServiceName.isEmpty()) + { + return getSupportedServiceNames_Static(); + } + else + { + uno::Sequence< OUString > aServices(2); + aServices.getArray()[0] = SERVICE_SHAPE; + aServices.getArray()[1] = m_sServiceName; + + return aServices; + } } //------------------------------------------------------------------------------ sal_Bool SAL_CALL OShape::supportsService(const OUString& ServiceName) throw( uno::RuntimeException ) { - return m_sServiceName == ServiceName || cppu::supportsService(this, ServiceName); + return cppu::supportsService(this, ServiceName); } // ----------------------------------------------------------------------------- // XReportComponent _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits