/* -*- 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/.
*/
propName = "Position";
awt::Point aPositionGet;
CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue Position",
xSheetCell->getPropertyValue(propName) >>= aPositionGet);
awt::Point aPositionSet(42, 42);
aNewValue <<= aPositionSet;
xSheetCell->setPropertyValue(propName, aNewValue);
CPPUNIT_ASSERT(xSheetCell->getPropertyValue(propName) >>= aPositionSet);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Able to set PropertyValue Position", aPositionGet, aPositionGet);
propName = "Size";
awt::Size aSizeGet;
CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue Size",
xSheetCell->getPropertyValue(propName) >>= aSizeGet);
awt::Size aSizeSet(42, 42);
aNewValue <<= aSizeGet;
xSheetCell->setPropertyValue(propName, aNewValue);
CPPUNIT_ASSERT(xSheetCell->getPropertyValue(propName) >>= aSizeSet);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Able to set PropertyValue Size", aSizeGet, aSizeSet);
propName = "FormulaLocal";
OUString aFormulaLocal = u""_ustr;
CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue FormulaLocal",
xSheetCell->getPropertyValue(propName) >>= aFormulaLocal);
aNewValue <<= u"FormulaLocal"_ustr;
xSheetCell->setPropertyValue(propName, aNewValue);
CPPUNIT_ASSERT(xSheetCell->getPropertyValue(propName) >>= aFormulaLocal);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue FormulaLocal", u"FormulaLocal"_ustr,
aFormulaLocal);
propName = "CellContentType";
table::CellContentType aCellContentTypeGet;
CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue CellContentType",
xSheetCell->getPropertyValue(propName) >>= aCellContentTypeGet);
table::CellContentType aCellContentTypeSet = table::CellContentType_TEXT;
aNewValue <<= aCellContentTypeSet;
xSheetCell->setPropertyValue(propName, aNewValue);
CPPUNIT_ASSERT(xSheetCell->getPropertyValue(propName) >>= aCellContentTypeSet);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Able to set PropertyValue CellContentType", aCellContentTypeGet,
aCellContentTypeSet);
// Special case, because the API returns the wrong type.
propName = "FormulaResultType";
table::CellContentType aFormulaResultTypeGet;
CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue FormulaResultType",
xSheetCell->getPropertyValue(propName) >>= aFormulaResultTypeGet);
table::CellContentType aFormulaResultTypeSet = table::CellContentType_TEXT;
aNewValue <<= aFormulaResultTypeSet;
xSheetCell->setPropertyValue(propName, aNewValue);
CPPUNIT_ASSERT(xSheetCell->getPropertyValue(propName) >>= aFormulaResultTypeSet);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Able to set PropertyValue FormulaResultType",
aFormulaResultTypeGet, aFormulaResultTypeSet);
propName = "FormulaResultType2";
sal_Int32 aFormulaResultType2Get = 42;
CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue FormulaResultType2",
xSheetCell->getPropertyValue(propName) >>= aFormulaResultType2Get);
sal_Int32 aFormulaResultType2Set = 42;
aNewValue <<= aFormulaResultType2Set;
xSheetCell->setPropertyValue(propName, aNewValue);
CPPUNIT_ASSERT(xSheetCell->getPropertyValue(propName) >>= aFormulaResultType2Set);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Able to set PropertyValue FormulaResultType2",
aFormulaResultType2Get, aFormulaResultType2Set);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.