12#include <com/sun/star/sheet/TablePageBreakData.hpp>
13#include <com/sun/star/sheet/XSheetPageBreak.hpp>
14#include <com/sun/star/uno/Reference.hxx>
15#include <com/sun/star/uno/Sequence.hxx>
17#include <cppunit/TestAssert.h>
20using namespace css::uno;
26 uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak(
init(), UNO_QUERY_THROW);
28 uno::Sequence< sheet::TablePageBreakData > xColPageBreak = xSheetPageBreak->getColumnPageBreaks();
29 CPPUNIT_ASSERT_MESSAGE(
"Unable to get column page breaks", xColPageBreak.hasElements());
34 uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak(
init(), UNO_QUERY_THROW);
36 uno::Sequence< sheet::TablePageBreakData > xRowPageBreak = xSheetPageBreak->getRowPageBreaks();
37 CPPUNIT_ASSERT_MESSAGE(
"Unable to get row page breaks", xRowPageBreak.hasElements());
42 uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak(
init(), UNO_QUERY_THROW);
44 xSheetPageBreak->removeAllManualPageBreaks();
46 const uno::Sequence< sheet::TablePageBreakData > xColPageBreak = xSheetPageBreak->getColumnPageBreaks();
47 sal_Int32 manualColPageBreaks = 0;
48 for (
const auto & data : xColPageBreak )
51 manualColPageBreaks++;
53 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Found manual column page break",
54 sal_Int32(0), manualColPageBreaks);
56 const uno::Sequence< sheet::TablePageBreakData > xRowPageBreak = xSheetPageBreak->getRowPageBreaks();
57 sal_Int32 manualRowPageBreaks = 0;
58 for (
const auto & data : xRowPageBreak )
61 manualRowPageBreaks++;
63 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Found manual row page break",
64 sal_Int32(0), manualRowPageBreaks);
void testRemoveAllManualPageBreaks()
void testGetRowPageBreaks()
void testGetColumnPageBreaks()
virtual css::uno::Reference< css::uno::XInterface > init()=0