22#include <ooo/vba/excel/XlPageBreak.hpp>
23#include <com/sun/star/beans/XPropertySet.hpp>
24#include <com/sun/star/table/XCellRange.hpp>
30template<
typename... Ifc >
32 const uno::Reference< uno::XComponentContext >& xContext,
33 uno::Reference< beans::XPropertySet > xProps,
34 sheet::TablePageBreakData aTablePageBreakData):
36 mxRowColPropertySet(
std::move( xProps )),
37 maTablePageBreakData( aTablePageBreakData )
41template<
typename... Ifc >
44 uno::Any aValue = mxRowColPropertySet->getPropertyValue(
"IsStartOfNewPage");
45 bool hasPageBreak =
false;
46 aValue >>= hasPageBreak;
49 return excel::XlPageBreak::xlPageBreakNone;
51 if( maTablePageBreakData.ManualBreak )
52 return excel::XlPageBreak::xlPageBreakManual;
54 return excel::XlPageBreak::xlPageBreakAutomatic;
57template<
typename... Ifc >
60 if( (
type != excel::XlPageBreak::xlPageBreakNone) &&
61 (
type != excel::XlPageBreak::xlPageBreakManual) &&
62 (
type != excel::XlPageBreak::xlPageBreakAutomatic) )
67 if(
type == excel::XlPageBreak::xlPageBreakNone )
69 mxRowColPropertySet->setPropertyValue(
"IsStartOfNewPage",
uno::Any(
false));
73 mxRowColPropertySet->setPropertyValue(
"IsStartOfNewPage",
uno::Any(
true));
74 if(
type == excel::XlPageBreak::xlPageBreakManual )
75 maTablePageBreakData.ManualBreak =
true;
77 maTablePageBreakData.ManualBreak =
false;
80template<
typename... Ifc >
83 mxRowColPropertySet->setPropertyValue(
"IsStartOfNewPage",
uno::Any(
false));
86template<
typename... Ifc >
89 uno::Reference< table::XCellRange > xRange( mxRowColPropertySet, uno::UNO_QUERY_THROW );
90 return new ScVbaRange( ScVbaPageBreak_BASE::getParent(), ScVbaPageBreak_BASE::mxContext, xRange);
99 return "ScVbaHPageBreak";
102uno::Sequence< OUString >
107 "ooo.vba.excel.HPageBreak"
116 const css::uno::Reference< css::uno::XComponentContext >& xContext,
117 const css::uno::Reference< css::beans::XPropertySet >& xProps,
118 css::sheet::TablePageBreakData aTablePageBreakData )
130 return "ScVbaVPageBreak";
133uno::Sequence< OUString >
138 "ooo.vba.excel.VPageBreak"
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual OUString getServiceImplName() override
ScVbaPageBreak(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, css::uno::Reference< css::beans::XPropertySet > xProps, css::sheet::TablePageBreakData aTablePageBreakData)
virtual sal_Int32 SAL_CALL getType() override
virtual void SAL_CALL Delete() override
virtual void SAL_CALL setType(sal_Int32 type) override
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Location() override
virtual css::uno::Sequence< OUString > getServiceNames() override
ScVbaVPageBreak(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::beans::XPropertySet > &xProps, css::sheet::TablePageBreakData aTablePageBreakData)
virtual ~ScVbaVPageBreak() override
virtual OUString getServiceImplName() override
Sequence< OUString > aServiceNames
#define ERRCODE_BASIC_BAD_PARAMETER