/* -*- 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/.
*/
sheet::DataPilotFieldSortInfo aNewSortInfoValue;
aValue = xPropSet->getPropertyValue(aSortInfo);
CPPUNIT_ASSERT( aValue >>= aNewSortInfoValue );
CPPUNIT_ASSERT_EQUAL_MESSAGE("set value should be the same as got value", aSortInfoValue.Field, aNewSortInfoValue.Field);
CPPUNIT_ASSERT_EQUAL_MESSAGE("set value should be the same as got value", aSortInfoValue.Mode, aNewSortInfoValue.Mode);
CPPUNIT_ASSERT_EQUAL_MESSAGE("set value should be the same as got value", aSortInfoValue.IsAscending, aNewSortInfoValue.IsAscending);
//setting HasSortInfo only makes sense for false, for true the uno implementation does nothing bool bHasSortInfo(false);
OUString aHasSortInfo(u"HasSortInfo"_ustr);
aValue = xPropSet->getPropertyValue(aHasSortInfo);
CPPUNIT_ASSERT( aValue >>= bHasSortInfo );
CPPUNIT_ASSERT_MESSAGE("should have sort info", bHasSortInfo);
sheet::DataPilotFieldLayoutInfo aNewLayoutInfoValue;
aValue = xPropSet->getPropertyValue(aLayoutInfo);
CPPUNIT_ASSERT( aValue >>= aNewLayoutInfoValue );
CPPUNIT_ASSERT_EQUAL_MESSAGE("set value should be the same as the got value", aLayoutInfoValue.LayoutMode, aNewLayoutInfoValue.LayoutMode);
CPPUNIT_ASSERT_EQUAL_MESSAGE("set value should be the same as the got value", aLayoutInfoValue.AddEmptyLines, aNewLayoutInfoValue.AddEmptyLines);
//setting HasLayoutInfo only makes sense for false, tor true the uno implementation does nothing bool bHasLayoutInfo(false);
OUString aHasLayoutInfo(u"HasLayoutInfo"_ustr);
aValue = xPropSet->getPropertyValue(aHasLayoutInfo);
CPPUNIT_ASSERT( aValue >>= bHasLayoutInfo );
CPPUNIT_ASSERT_MESSAGE("should have layout information", bHasLayoutInfo);
sheet::DataPilotFieldAutoShowInfo aNewAutoShowInfoValue;
aValue = xPropSet->getPropertyValue(aAutoShowInfo);
CPPUNIT_ASSERT( aValue >>= aNewAutoShowInfoValue );
CPPUNIT_ASSERT_EQUAL_MESSAGE("set value should be the same as the got value", aAutoShowInfoValue.DataField, aNewAutoShowInfoValue.DataField);
CPPUNIT_ASSERT_EQUAL_MESSAGE("set value should be the same as the got value", aAutoShowInfoValue.IsEnabled, aNewAutoShowInfoValue.IsEnabled);
//setting HasLayoutInfo only makes sense for false, tor true the uno implementation does nothing bool bHasAutoShowInfo(false);
OUString aHasAutoShowInfo(u"HasAutoShowInfo"_ustr);
aValue = xPropSet->getPropertyValue(aHasAutoShowInfo);
CPPUNIT_ASSERT( aValue >>= bHasAutoShowInfo );
CPPUNIT_ASSERT_MESSAGE("should have AutoShow information", bHasAutoShowInfo);
sheet::DataPilotFieldReference aNewReferenceValue;
aValue = xPropSet->getPropertyValue(aReference);
CPPUNIT_ASSERT( aValue >>= aNewReferenceValue );
CPPUNIT_ASSERT_EQUAL_MESSAGE("set value should be the same as the got value", aReferenceValue.ReferenceField, aNewReferenceValue.ReferenceField);
CPPUNIT_ASSERT_EQUAL_MESSAGE("set value should be the same as the got value", aReferenceValue.ReferenceItemType, aNewReferenceValue.ReferenceItemType);
//setting HasReference only makes sense for false, tor true the uno implementation does nothing bool bHasReference(false);
OUString aHasReference(u"HasReference"_ustr);
aValue = xPropSet->getPropertyValue(aHasReference);
CPPUNIT_ASSERT( aValue >>= bHasReference );
CPPUNIT_ASSERT_MESSAGE("should have Reference information", bHasReference);
aValue = xPropSet->getPropertyValue(aIsGroupField);
CPPUNIT_ASSERT( aValue >>= bIsGroupField); //only setting to false is supported if (bIsGroupField)
{
bIsGroupField = false;
aValue <<= bIsGroupField;
xPropSet->setPropertyValue(aIsGroupField, aValue);
aValue = xPropSet->getPropertyValue(aIsGroupField);
CPPUNIT_ASSERT(aValue >>= bIsGroupField);
CPPUNIT_ASSERT_MESSAGE("setting IsGroupField is supported and should have happened", !bIsGroupField);
} else
std::cout << "Could not test IsGroupField" << std::endl;
}
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.