20#include <ooo/vba/word/WdHeaderFooterIndex.hpp>
21#include <com/sun/star/beans/XPropertySet.hpp>
22#include <com/sun/star/text/XText.hpp>
23#include <com/sun/star/text/XTextDocument.hpp>
24#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
32SwVbaHeaderFooter::SwVbaHeaderFooter(
const uno::Reference< ooo::vba::XHelperInterface >& rParent,
const uno::Reference< uno::XComponentContext >& rContext, uno::Reference< frame::XModel > xModel, uno::Reference< beans::XPropertySet > xProps,
bool isHeader, sal_Int32 index ) :
SwVbaHeaderFooter_BASE( rParent, rContext ),
mxModel(
std::move(
xModel )), mxPageStyleProps(
std::move( xProps )), mbHeader( isHeader ),
mnIndex(
index )
54 OUString sPropsNameText;
57 sPropsNameText =
"HeaderText";
61 sPropsNameText =
"FooterText";
63 if(
mnIndex == word::WdHeaderFooterIndex::wdHeaderFooterEvenPages )
65 sPropsNameText +=
"Left";
68 uno::Reference< text::XText > xText(
mxPageStyleProps->getPropertyValue( sPropsNameText ), uno::UNO_QUERY_THROW );
69 uno::Reference< text::XTextDocument > xDocument(
mxModel, uno::UNO_QUERY_THROW );
70 return uno::Reference< word::XRange >(
new SwVbaRange(
this,
mxContext, xDocument, xText->getStart(), xText->getEnd(), xText ) );
77 uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier(
mxModel, uno::UNO_QUERY_THROW );
79 uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
81 if (
index.hasValue() )
89 return "SwVbaHeaderFooter";
92uno::Sequence< OUString >
css::uno::Reference< css::frame::XModel2 > mxModel
css::uno::Reference< css::uno::XComponentContext > mxContext
Sequence< OUString > aServiceNames
Reference< XModel > xModel