// first insert one that should be moved
xSpreadsheets->insertNewByName(u"SheetToMove"_ustr, 0);
uno::Reference< container::XNameAccess > xNameAccess(xSpreadsheets, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("Sheet to move was not insert",
xNameAccess->hasByName(u"SheetToMove"_ustr));
// get sheet from the new position
uno::Reference< container::XIndexAccess > oIndexAccess(xSpreadsheets, UNO_QUERY_THROW);
uno::Any aAny = oIndexAccess->getByIndex(2);
uno::Reference< container::XNamed > xNamed;
CPPUNIT_ASSERT(aAny >>= xNamed);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Sheet was not moved",
u"SheetToMove"_ustr,
xNamed->getName());
}
// insert new sheet to copy
xSpreadsheets->insertNewByName(u"SheetToCopySrc"_ustr, 0);
uno::Reference< container::XNameAccess > xNameAccess(xSpreadsheets, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("Sheet to copy was not insert",
xNameAccess->hasByName(u"SheetToCopySrc"_ustr));
xSpreadsheets->copyByName(u"SheetToCopySrc"_ustr, u"SheetToCopyDst"_ustr, 0);
CPPUNIT_ASSERT_MESSAGE("Sheet was not copied",
xNameAccess->hasByName(u"SheetToCopyDst"_ustr));
}
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.