1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <test/sheet/xsheetpagebreak.hxx>
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>
20 using namespace css::uno
;
24 void XSheetPageBreak::testGetColumnPageBreaks()
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());
32 void XSheetPageBreak::testGetRowPageBreaks()
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());
40 void XSheetPageBreak::testRemoveAllManualPageBreaks()
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
);
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */