12#include <com/sun/star/sheet/XSpreadsheet.hpp>
13#include <com/sun/star/sheet/XSpreadsheetView.hpp>
14#include <com/sun/star/uno/Reference.hxx>
16#include <cppunit/TestAssert.h>
25 uno::Reference<sheet::XSpreadsheetView> xView(
init(), UNO_QUERY_THROW);
27 uno::Reference<sheet::XSpreadsheet> xActiveSheet = xView->getActiveSheet();
28 CPPUNIT_ASSERT_MESSAGE(
"Unable to get default active sheet", xActiveSheet.is());
30 uno::Reference<sheet::XSpreadsheet> xNewSheet = xActiveSheet;
31 CPPUNIT_ASSERT_MESSAGE(
"no sheet", xNewSheet.is());
32 xView->setActiveSheet(xNewSheet);
34 uno::Reference<sheet::XSpreadsheet> xNewActiveSheet = xView->getActiveSheet();
35 CPPUNIT_ASSERT_MESSAGE(
"Unable to get new active sheet", xNewActiveSheet.is());
36 CPPUNIT_ASSERT_MESSAGE(
"Default and new active sheet are not different",
37 xActiveSheet.get() != xNewActiveSheet.get());
virtual css::uno::Reference< css::uno::XInterface > init()=0
void testGetSetActiveSheet()