From b910203239f29d886c698377fa40185998adbae3 Mon Sep 17 00:00:00 2001 From: Jens Carl Date: Thu, 22 Mar 2018 06:13:33 +0000 Subject: tdf#45904 Move _SpreadsheetDocumentSettings Java test to C++ Change-Id: Ic6bde95d0d4255e082a60e41a117365422b22aa8 Reviewed-on: https://gerrit.libreoffice.org/51724 Tested-by: Jenkins Reviewed-by: Jens Carl --- include/test/sheet/spreadsheetdocumentsettings.hxx | 34 ++++ qadevOOo/Jar_OOoRunner.mk | 1 - .../sc/com.sun.star.comp.office.ScModelObj.csv | 18 -- ...n.star.comp.office.ScSpreadsheetSettingsObj.csv | 18 -- .../ifc/sheet/_SpreadsheetDocumentSettings.java | 141 --------------- sc/CppunitTest_sc_spreadsheetsettingsobj.mk | 72 ++++++++ sc/Module_sc.mk | 1 + sc/qa/extras/scmodelobj.cxx | 10 +- sc/qa/extras/scspreadsheetsettingsobj.cxx | 78 +++++++++ test/Library_subsequenttest.mk | 1 + test/source/sheet/spreadsheetdocumentsettings.cxx | 190 +++++++++++++++++++++ 11 files changed, 384 insertions(+), 180 deletions(-) create mode 100644 include/test/sheet/spreadsheetdocumentsettings.hxx delete mode 100644 qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocumentSettings.java create mode 100644 sc/CppunitTest_sc_spreadsheetsettingsobj.mk create mode 100644 sc/qa/extras/scspreadsheetsettingsobj.cxx create mode 100644 test/source/sheet/spreadsheetdocumentsettings.cxx diff --git a/include/test/sheet/spreadsheetdocumentsettings.hxx b/include/test/sheet/spreadsheetdocumentsettings.hxx new file mode 100644 index 000000000000..1385541576c6 --- /dev/null +++ b/include/test/sheet/spreadsheetdocumentsettings.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#ifndef INCLUDED_TEST_SHEET_SPREADSHEETDOCUMENTSETTINGS_HXX +#define INCLUDED_TEST_SHEET_SPREADSHEETDOCUMENTSETTINGS_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST SpreadsheetDocumentSettings +{ +public: + virtual css::uno::Reference init() = 0; + + void testSpreadsheetDocumentSettingsProperties(); + +protected: + ~SpreadsheetDocumentSettings() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_SPREADSHEETDOCUMENTSETTINGS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk index 26231e68ee5a..a4c1b2d0105f 100644 --- a/qadevOOo/Jar_OOoRunner.mk +++ b/qadevOOo/Jar_OOoRunner.mk @@ -566,7 +566,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ qadevOOo/tests/java/ifc/sheet/_FunctionDescription \ qadevOOo/tests/java/ifc/sheet/_SheetSortDescriptor \ qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocument \ - qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocumentSettings \ qadevOOo/tests/java/ifc/sheet/_TableAutoFormatField \ qadevOOo/tests/java/ifc/sheet/_XActivationBroadcaster \ qadevOOo/tests/java/ifc/sheet/_XArrayFormulaRange \ diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv index 69b54496331b..a1f591442897 100644 --- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv +++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScModelObj.csv @@ -52,24 +52,6 @@ "ScModelObj";"com::sun::star::sheet::SpreadsheetDocument";"SheetLinks" "ScModelObj";"com::sun::star::sheet::SpreadsheetDocument";"AreaLinks" "ScModelObj";"com::sun::star::sheet::SpreadsheetDocument";"DDELinks" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"IsIterationEnabled" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"IterationCount" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"IterationEpsilon" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"StandardDecimals" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"NullDate" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"DefaultTabStop" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"IgnoreCase" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"CalcAsShown" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"MatchWholeCell" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"SpellOnline" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"LookUpLabels" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"RegularExpressions" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"ForbiddenCharacters#optional" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"HasDrawPages#optional" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"CharLocale#optional" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"CharLocaleAsian#optional" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"CharLocaleComplex#optional" -"ScModelObj";"com::sun::star::sheet::SpreadsheetDocumentSettings#optional";"Wildcards#optional" "ScModelObj";"com::sun::star::document::OfficeDocument";"AutomaticControlFocus#optional" "ScModelObj";"com::sun::star::document::OfficeDocument";"ApplyFormDesignMode#optional" "ScModelObj";"com::sun::star::document::OfficeDocument";"RuntimeUID#optional" diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSpreadsheetSettingsObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSpreadsheetSettingsObj.csv index 2d15f48c3a7b..7a473c2de4b9 100644 --- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSpreadsheetSettingsObj.csv +++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSpreadsheetSettingsObj.csv @@ -5,21 +5,3 @@ "ScSpreadsheetSettingsObj";"com::sun::star::beans::XPropertySet";"removePropertyChangeListener()" "ScSpreadsheetSettingsObj";"com::sun::star::beans::XPropertySet";"addVetoableChangeListener()" "ScSpreadsheetSettingsObj";"com::sun::star::beans::XPropertySet";"removeVetoableChangeListener()" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"IsIterationEnabled" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"IterationCount" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"IterationEpsilon" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"StandardDecimals" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"NullDate" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"DefaultTabStop" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"IgnoreCase" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"CalcAsShown" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"MatchWholeCell" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"SpellOnline" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"LookUpLabels" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"RegularExpressions" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"ForbiddenCharacters#optional" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"HasDrawPages#optional" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"CharLocale#optional" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"CharLocaleAsian#optional" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"CharLocaleComplex#optional" -"ScSpreadsheetSettingsObj";"com::sun::star::sheet::SpreadsheetDocumentSettings";"Wildcards#optional" diff --git a/qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocumentSettings.java b/qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocumentSettings.java deleted file mode 100644 index 8a00babb9c85..000000000000 --- a/qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocumentSettings.java +++ /dev/null @@ -1,141 +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.MultiPropertyTest; - -import com.sun.star.i18n.ForbiddenCharacters; -import com.sun.star.i18n.XForbiddenCharacters; -import com.sun.star.lang.Locale; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.util.Date; - - -/** -* Testing com.sun.star.sheet.SpreadsheetDocumentSettings -* service properties : -*
    -*
  • IsIterationEnabled
  • -*
  • IterationCount
  • -*
  • IterationEpsilon
  • -*
  • StandardDecimals
  • -*
  • NullDate
  • -*
  • DefaultTabStop
  • -*
  • IgnoreCase
  • -*
  • CalcAsShown
  • -*
  • MatchWholeCell
  • -*
  • SpellOnline
  • -*
  • LookUpLabels
  • -*
  • RegularExpressions
  • -*
  • ForbiddenCharacters
  • -*
  • HasDrawPages
  • -*
  • Wildcards
  • -*

-* Properties testing is automated by lib.MultiPropertyTest. -* @see com.sun.star.sheet.SpreadsheetDocumentSettings -*/ -public class _SpreadsheetDocumentSettings extends MultiPropertyTest { - /** - *This class is destined to custom test of property NullDate. - */ - protected PropertyTester DateTester = new PropertyTester() { - @Override - protected Object getNewValue(String propName, Object oldValue) { - Date date = (Date) oldValue; - Date newDate = new Date((short) (date.Day - 1), date.Month, - date.Year); - - return newDate; - } - }; - - /** - *This class is destined to custom test of property ForbiddenCharacters. - */ - protected PropertyTester ChrTester = new PropertyTester() { - @Override - protected Object getNewValue(String propName, Object oldValue) { - return new ForbiddenChrTest(); - } - - @Override - protected boolean compare(Object obj1, Object obj2) { - Locale loc = new Locale("ru", "RU", ""); - XForbiddenCharacters fc1 = UnoRuntime.queryInterface( - XForbiddenCharacters.class, - obj1); - XForbiddenCharacters fc2 = UnoRuntime.queryInterface( - XForbiddenCharacters.class, - obj2); - boolean has1 = fc1.hasForbiddenCharacters(loc); - boolean has2 = fc2.hasForbiddenCharacters(loc); - - return has1 == has2; - } - }; - - /** - * Test property NullDate using custom PropertyTest. - */ - public void _NullDate() { - testProperty("NullDate", DateTester); - } - - /** - * Test property ForbiddenCharacters using custom PropertyTest. - */ - public void _ForbiddenCharacters() { - testProperty("ForbiddenCharacters", ChrTester); - } - - /** - * Class implements interface XForbiddenCharacters. - * It's destined to custom test of property ForbiddenCharacters. - * Feature of the class that it supports forbidden characters - * for russian locale. - * @see com.sun.star.i18n.XForbiddenCharacters - */ - protected static class ForbiddenChrTest implements XForbiddenCharacters { - protected Locale locale = new Locale("ru", "RU", ""); - protected ForbiddenCharacters chrs = new ForbiddenCharacters("q", "w"); - - public ForbiddenCharacters getForbiddenCharacters(Locale rLocale) - throws com.sun.star.container.NoSuchElementException { - if (rLocale.Country.equals(locale.Country) && - rLocale.Language.equals(locale.Language) && - rLocale.Variant.equals(locale.Variant)) { - return chrs; - } - - throw new com.sun.star.container.NoSuchElementException(); - } - - public void setForbiddenCharacters(Locale rLocale, - ForbiddenCharacters rForbiddenCharacters) { - } - - public void removeForbiddenCharacters(Locale rLocale) { - } - - public boolean hasForbiddenCharacters(Locale rLocale) { - return rLocale.Country.equals(locale.Country) && - rLocale.Language.equals(locale.Language) && - rLocale.Variant.equals(locale.Variant); - } - } -} diff --git a/sc/CppunitTest_sc_spreadsheetsettingsobj.mk b/sc/CppunitTest_sc_spreadsheetsettingsobj.mk new file mode 100644 index 000000000000..f39201002bb3 --- /dev/null +++ b/sc/CppunitTest_sc_spreadsheetsettingsobj.mk @@ -0,0 +1,72 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# 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/. +# +#************************************************************************* + +$(eval $(call gb_CppunitTest_CppunitTest,sc_spreadsheetsettingsobj)) + +$(eval $(call gb_CppunitTest_use_external,sc_spreadsheetsettingsobj,boost_headers)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sc_spreadsheetsettingsobj, \ + sc/qa/extras/scspreadsheetsettingsobj \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sc_spreadsheetsettingsobj, \ + basegfx \ + comphelper \ + cppu \ + cppuhelper \ + drawinglayer \ + editeng \ + for \ + forui \ + i18nlangtag \ + msfilter \ + oox \ + sal \ + salhelper \ + sax \ + sb \ + sc \ + sfx \ + sot \ + subsequenttest \ + svl \ + svt \ + svx \ + svxcore \ + test \ + tk \ + tl \ + ucbhelper \ + unotest \ + utl \ + vbahelper \ + vcl \ + xo \ +)) + +$(eval $(call gb_CppunitTest_set_include,sc_spreadsheetsettingsobj,\ + -I$(SRCDIR)/sc/source/ui/inc \ + -I$(SRCDIR)/sc/inc \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_sdk_api,sc_spreadsheetsettingsobj)) + +$(eval $(call gb_CppunitTest_use_ure,sc_spreadsheetsettingsobj)) +$(eval $(call gb_CppunitTest_use_vcl,sc_spreadsheetsettingsobj)) + +$(eval $(call gb_CppunitTest_use_components,sc_spreadsheetsettingsobj,\ + $(sc_unoapi_common_components) \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sc_spreadsheetsettingsobj)) + +# vim: set noet sw=4 ts=4: diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index 6e3a5090d71b..68537c5d7d2e 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -156,6 +156,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\ CppunitTest_sc_spreadsheetsettings \ CppunitTest_sc_shapeobj \ CppunitTest_sc_sheetlinkobj \ + CppunitTest_sc_spreadsheetsettingsobj \ )) $(eval $(call gb_Module_add_perfcheck_targets,sc,\ diff --git a/sc/qa/extras/scmodelobj.cxx b/sc/qa/extras/scmodelobj.cxx index 0b1e9c8118b3..9e57c88b0add 100644 --- a/sc/qa/extras/scmodelobj.cxx +++ b/sc/qa/extras/scmodelobj.cxx @@ -8,6 +8,7 @@ */ #include +#include #include #include @@ -21,8 +22,10 @@ using namespace css::uno; namespace sc_apitest { -class ScModelObj : public UnoApiTest, public apitest::XConsolidatable, - public apitest::XGoalSeek +class ScModelObj : public UnoApiTest, + public apitest::SpreadsheetDocumentSettings, + public apitest::XConsolidatable, + public apitest::XGoalSeek { public: virtual void setUp() override; @@ -34,6 +37,9 @@ public: CPPUNIT_TEST_SUITE(ScModelObj); + // SpreadsheetDocumentSettings + CPPUNIT_TEST(testSpreadsheetDocumentSettingsProperties); + // XConsolidatable CPPUNIT_TEST(testCreateConsolidationDescriptor); CPPUNIT_TEST(testConsolidate); diff --git a/sc/qa/extras/scspreadsheetsettingsobj.cxx b/sc/qa/extras/scspreadsheetsettingsobj.cxx new file mode 100644 index 000000000000..f19e0b1d8297 --- /dev/null +++ b/sc/qa/extras/scspreadsheetsettingsobj.cxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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 +#include + +#include +#include +#include +#include + +#include + +using namespace css; +using namespace css::uno; +using namespace com::sun::star; + +namespace sc_apitest +{ +class ScSpreadsheetSettingsobj : public CalcUnoApiTest, public apitest::SpreadsheetDocumentSettings +{ +public: + ScSpreadsheetSettingsobj(); + + virtual uno::Reference init() override; + virtual void setUp() override; + virtual void tearDown() override; + + CPPUNIT_TEST_SUITE(ScSpreadsheetSettingsobj); + + // GlobalSheetSettingsobj + CPPUNIT_TEST(testSpreadsheetDocumentSettingsProperties); + + CPPUNIT_TEST_SUITE_END(); + +private: + uno::Reference mxComponent; +}; + +ScSpreadsheetSettingsobj::ScSpreadsheetSettingsobj() + : CalcUnoApiTest("/sc/qa/extras/testdocuments") +{ +} + +uno::Reference ScSpreadsheetSettingsobj::init() +{ + uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); + + return xDoc; +} + +void ScSpreadsheetSettingsobj::setUp() +{ + CalcUnoApiTest::setUp(); + // create a calc document + mxComponent = loadFromDesktop("private:factory/scalc"); +} + +void ScSpreadsheetSettingsobj::tearDown() +{ + closeDocument(mxComponent); + CalcUnoApiTest::tearDown(); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(ScSpreadsheetSettingsobj); + +} // end namespace + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk index ce88ef80a817..ff608b0d389b 100644 --- a/test/Library_subsequenttest.mk +++ b/test/Library_subsequenttest.mk @@ -56,6 +56,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\ test/source/sheet/documentsettings \ test/source/sheet/globalsheetsettings \ test/source/sheet/scenario \ + test/source/sheet/spreadsheetdocumentsettings \ test/source/sheet/spreadsheetviewsettings \ test/source/sheet/subtotaldescriptor \ test/source/sheet/shape \ diff --git a/test/source/sheet/spreadsheetdocumentsettings.cxx b/test/source/sheet/spreadsheetdocumentsettings.cxx new file mode 100644 index 000000000000..c57c5b911fe3 --- /dev/null +++ b/test/source/sheet/spreadsheetdocumentsettings.cxx @@ -0,0 +1,190 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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 +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace com::sun::star; +using namespace com::sun::star::uno; + +namespace apitest +{ +void SpreadsheetDocumentSettings::testSpreadsheetDocumentSettingsProperties() +{ + uno::Reference xSpreadsheetDocumentSettings(init(), UNO_QUERY_THROW); + OUString propName; + uno::Any aNewValue; + + propName = "IsIterationEnabled"; + testBooleanProperty(xSpreadsheetDocumentSettings, propName); + + propName = "IterationCount"; + testLongProperty(xSpreadsheetDocumentSettings, propName); + + propName = "IterationEpsilon"; + testDoubleProperty(xSpreadsheetDocumentSettings, propName); + + propName = "StandardDecimals"; + testShortProperty(xSpreadsheetDocumentSettings, propName); + + propName = "NullDate"; + util::Date aNullDateGet; + util::Date aNullDateSet; + CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue: NullDate", + xSpreadsheetDocumentSettings->getPropertyValue(propName) + >>= aNullDateGet); + + aNewValue <<= util::Date(1, 1, 2000); + xSpreadsheetDocumentSettings->setPropertyValue(propName, aNewValue); + CPPUNIT_ASSERT(xSpreadsheetDocumentSettings->getPropertyValue(propName) >>= aNullDateSet); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unabel to set PropertyValue: NullDate", sal_Int16(2000), + aNullDateSet.Year); + + propName = "DefaultTabStop"; + testShortProperty(xSpreadsheetDocumentSettings, propName); + + propName = "IgnoreCase"; + testBooleanProperty(xSpreadsheetDocumentSettings, propName); + + propName = "CalcAsShown"; + testBooleanProperty(xSpreadsheetDocumentSettings, propName); + + propName = "MatchWholeCell"; + testBooleanProperty(xSpreadsheetDocumentSettings, propName); + + propName = "SpellOnline"; + testBooleanProperty(xSpreadsheetDocumentSettings, propName); + + propName = "LookUpLabels"; + testBooleanProperty(xSpreadsheetDocumentSettings, propName); + + propName = "RegularExpressions"; + testBooleanProperty(xSpreadsheetDocumentSettings, propName); + + propName = "ForbiddenCharacters"; + uno::Reference xForbiddenCharactersGet; + uno::Reference xForbiddenCharactersSet; + CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue: ForbiddenCharacters", + xSpreadsheetDocumentSettings->getPropertyValue(propName) + >>= xForbiddenCharactersGet); + + lang::Locale aForbiddenCharactersLocale; + aForbiddenCharactersLocale.Language = "ru"; + aForbiddenCharactersLocale.Country = "RU"; + + uno::Reference xForbiddenCharactersNew; + aNewValue <<= xForbiddenCharactersNew; + xSpreadsheetDocumentSettings->setPropertyValue(propName, aNewValue); + CPPUNIT_ASSERT(xSpreadsheetDocumentSettings->getPropertyValue(propName) + >>= xForbiddenCharactersSet); + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Able to set PropertyValue: ForbiddenCharacters", + xForbiddenCharactersGet->hasForbiddenCharacters(aForbiddenCharactersLocale), + xForbiddenCharactersSet->hasForbiddenCharacters(aForbiddenCharactersLocale)); + + propName = "HasDrawPages"; + testBooleanReadonlyProperty(xSpreadsheetDocumentSettings, propName); + + propName = "CharLocale"; + lang::Locale aCharLocaleGet; + lang::Locale aCharLocaleSet; + CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue: CharLocale", + xSpreadsheetDocumentSettings->getPropertyValue(propName) + >>= aCharLocaleGet); + + lang::Locale aCharLocaleNew; + aCharLocaleNew.Language = "en"; + aCharLocaleNew.Country = "CA"; + aNewValue <<= aCharLocaleNew; + xSpreadsheetDocumentSettings->setPropertyValue(propName, aNewValue); + CPPUNIT_ASSERT(xSpreadsheetDocumentSettings->getPropertyValue(propName) >>= aCharLocaleSet); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue: CharLocale", aCharLocaleNew.Country, + aCharLocaleSet.Country); + + propName = "CharLocaleAsian"; + lang::Locale aCharLocaleAsianGet; + lang::Locale aCharLocaleAsianSet; + CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue: CharLocaleAsian", + xSpreadsheetDocumentSettings->getPropertyValue(propName) + >>= aCharLocaleAsianGet); + + lang::Locale aCharLocaleAsianNew; + aCharLocaleAsianNew.Language = "en"; + aCharLocaleAsianNew.Country = "CA"; + aNewValue <<= aCharLocaleAsianNew; + xSpreadsheetDocumentSettings->setPropertyValue(propName, aNewValue); + CPPUNIT_ASSERT(xSpreadsheetDocumentSettings->getPropertyValue(propName) + >>= aCharLocaleAsianSet); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue: CharLocaleAsian", + aCharLocaleAsianNew.Country, aCharLocaleAsianSet.Country); + + propName = "CharLocaleComplex"; + lang::Locale aCharLocaleComplexGet; + lang::Locale aCharLocaleComplexSet; + CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue: CharLocaleComplex", + xSpreadsheetDocumentSettings->getPropertyValue(propName) + >>= aCharLocaleComplexGet); + + lang::Locale aCharLocaleComplexNew; + aCharLocaleComplexNew.Language = "en"; + aCharLocaleComplexNew.Country = "CA"; + aNewValue <<= aCharLocaleComplexNew; + xSpreadsheetDocumentSettings->setPropertyValue(propName, aNewValue); + CPPUNIT_ASSERT(xSpreadsheetDocumentSettings->getPropertyValue(propName) + >>= aCharLocaleComplexSet); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue: CharLocaleComplex", + aCharLocaleComplexNew.Country, aCharLocaleComplexSet.Country); + + propName = "IsLoaded"; + testBooleanProperty(xSpreadsheetDocumentSettings, propName); + + propName = "IsUndoEnabled"; + testBooleanProperty(xSpreadsheetDocumentSettings, propName); + + propName = "IsAdjustHeightEnabled"; + testBooleanProperty(xSpreadsheetDocumentSettings, propName); + + propName = "IsExecuteLinkEnabled"; + testBooleanProperty(xSpreadsheetDocumentSettings, propName); + + propName = "ReferenceDevice"; + uno::Reference xDeviceGet; + uno::Reference xDeviceSet; + CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue: ReferenceDevice", + xSpreadsheetDocumentSettings->getPropertyValue(propName) >>= xDeviceGet); + + uno::Reference xDeviceNew; + aNewValue <<= xDeviceNew; + xSpreadsheetDocumentSettings->setPropertyValue(propName, aNewValue); + CPPUNIT_ASSERT(xSpreadsheetDocumentSettings->getPropertyValue(propName) >>= xDeviceSet); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Able to set PropertyValue: ReferenceDevice", + xDeviceSet->getInfo().Width, xDeviceGet->getInfo().Width); + + propName = "RecordChanges"; + testBooleanProperty(xSpreadsheetDocumentSettings, propName); + + propName = "IsRecordChangesProtected"; + testBooleanReadonlyProperty(xSpreadsheetDocumentSettings, propName); + + propName = "Wildcards"; + testBooleanProperty(xSpreadsheetDocumentSettings, propName); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ -- cgit