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/extensions/HelperMacros.h>
18 #include <rtl/ustring.hxx>
21 using namespace css::uno
;
25 void XSheetPageBreak::testGetColumnPageBreaks()
27 uno::Reference
< sheet::XSheetPageBreak
> xSheetPageBreak(init(), UNO_QUERY_THROW
);
29 uno::Sequence
< sheet::TablePageBreakData
> xColPageBreak
= xSheetPageBreak
->getColumnPageBreaks();
30 CPPUNIT_ASSERT_MESSAGE("Unable to get column page breaks", xColPageBreak
.hasElements());
33 void XSheetPageBreak::testGetRowPageBreaks()
35 uno::Reference
< sheet::XSheetPageBreak
> xSheetPageBreak(init(), UNO_QUERY_THROW
);
37 uno::Sequence
< sheet::TablePageBreakData
> xRowPageBreak
= xSheetPageBreak
->getRowPageBreaks();
38 CPPUNIT_ASSERT_MESSAGE("Unable to get row page breaks", xRowPageBreak
.hasElements());
41 void XSheetPageBreak::testRemoveAllManualPageBreaks()
43 uno::Reference
< sheet::XSheetPageBreak
> xSheetPageBreak(init(), UNO_QUERY_THROW
);
45 xSheetPageBreak
->removeAllManualPageBreaks();
47 uno::Sequence
< sheet::TablePageBreakData
> xColPageBreak
= xSheetPageBreak
->getColumnPageBreaks();
48 sal_Int32 manualColPageBreaks
= 0;
49 for ( const auto & data
: xColPageBreak
)
52 manualColPageBreaks
++;
54 CPPUNIT_ASSERT_EQUAL_MESSAGE("Found manual column page break",
55 sal_Int32(0), manualColPageBreaks
);
57 uno::Sequence
< sheet::TablePageBreakData
> xRowPageBreak
= xSheetPageBreak
->getRowPageBreaks();
58 sal_Int32 manualRowPageBreaks
= 0;
59 for ( const auto & data
: xRowPageBreak
)
62 manualRowPageBreaks
++;
64 CPPUNIT_ASSERT_EQUAL_MESSAGE("Found manual row page break",
65 sal_Int32(0), manualRowPageBreaks
);
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */