Kaydet (Commit) b9102032 authored tarafından Jens Carl's avatar Jens Carl

tdf#45904 Move _SpreadsheetDocumentSettings Java test to C++

Change-Id: Ic6bde95d0d4255e082a60e41a117365422b22aa8
Reviewed-on: https://gerrit.libreoffice.org/51724Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJens Carl <j.carl43@gmx.de>
üst 32282516
/* -*- 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 <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <test/testdllapi.hxx>
namespace apitest
{
class OOO_DLLPUBLIC_TEST SpreadsheetDocumentSettings
{
public:
virtual css::uno::Reference<css::uno::XInterface> 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: */
......@@ -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 \
......
......@@ -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"
......
......@@ -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"
/*
* 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 <code>com.sun.star.sheet.SpreadsheetDocumentSettings</code>
* service properties :
* <ul>
* <li><code> IsIterationEnabled</code></li>
* <li><code> IterationCount</code></li>
* <li><code> IterationEpsilon</code></li>
* <li><code> StandardDecimals</code></li>
* <li><code> NullDate</code></li>
* <li><code> DefaultTabStop</code></li>
* <li><code> IgnoreCase</code></li>
* <li><code> CalcAsShown</code></li>
* <li><code> MatchWholeCell</code></li>
* <li><code> SpellOnline</code></li>
* <li><code> LookUpLabels</code></li>
* <li><code> RegularExpressions</code></li>
* <li><code> ForbiddenCharacters</code></li>
* <li><code> HasDrawPages</code></li>
* <li><code> Wildcards</code></li>
* </ul> <p>
* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
* @see com.sun.star.sheet.SpreadsheetDocumentSettings
*/
public class _SpreadsheetDocumentSettings extends MultiPropertyTest {
/**
*This class is destined to custom test of property <code>NullDate</code>.
*/
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 <code>ForbiddenCharacters</code>.
*/
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 <code>NullDate</code> using custom <code>PropertyTest</code>.
*/
public void _NullDate() {
testProperty("NullDate", DateTester);
}
/**
* Test property <code>ForbiddenCharacters</code> using custom <code>PropertyTest</code>.
*/
public void _ForbiddenCharacters() {
testProperty("ForbiddenCharacters", ChrTester);
}
/**
* Class implements interface <code>XForbiddenCharacters</code>.
* It's destined to custom test of property <code>ForbiddenCharacters</code>.
* 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);
}
}
}
# -*- 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:
......@@ -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,\
......
......@@ -8,6 +8,7 @@
*/
#include <test/unoapi_test.hxx>
#include <test/sheet/spreadsheetdocumentsettings.hxx>
#include <test/sheet/xconsolidatable.hxx>
#include <test/sheet/xgoalseek.hxx>
......@@ -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);
......
/* -*- 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 <test/calc_unoapi_test.hxx>
#include <test/sheet/spreadsheetdocumentsettings.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Reference.hxx>
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<uno::XInterface> 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<lang::XComponent> mxComponent;
};
ScSpreadsheetSettingsobj::ScSpreadsheetSettingsobj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
}
uno::Reference<uno::XInterface> ScSpreadsheetSettingsobj::init()
{
uno::Reference<sheet::XSpreadsheetDocument> 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: */
......@@ -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 \
......
/* -*- 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 <unoapi_property_testers.hxx>
#include <test/sheet/spreadsheetdocumentsettings.hxx>
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/i18n/XForbiddenCharacters.hpp>
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <cppunit/extensions/HelperMacros.h>
using namespace com::sun::star;
using namespace com::sun::star::uno;
namespace apitest
{
void SpreadsheetDocumentSettings::testSpreadsheetDocumentSettingsProperties()
{
uno::Reference<beans::XPropertySet> 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<i18n::XForbiddenCharacters> xForbiddenCharactersGet;
uno::Reference<i18n::XForbiddenCharacters> xForbiddenCharactersSet;
CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue: ForbiddenCharacters",
xSpreadsheetDocumentSettings->getPropertyValue(propName)
>>= xForbiddenCharactersGet);
lang::Locale aForbiddenCharactersLocale;
aForbiddenCharactersLocale.Language = "ru";
aForbiddenCharactersLocale.Country = "RU";
uno::Reference<i18n::XForbiddenCharacters> 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<awt::XDevice> xDeviceGet;
uno::Reference<awt::XDevice> xDeviceSet;
CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue: ReferenceDevice",
xSpreadsheetDocumentSettings->getPropertyValue(propName) >>= xDeviceGet);
uno::Reference<awt::XDevice> 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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment