22#include <com/sun/star/frame/XModel.hpp>
23#include <com/sun/star/style/XStyle.hpp>
24#include <com/sun/star/lang/XMultiServiceFactory.hpp>
25#include <com/sun/star/beans/XMultiPropertyStates.hpp>
26#include <com/sun/star/beans/XPropertySet.hpp>
27#include <com/sun/star/container/XNameContainer.hpp>
30#include <osl/diagnose.h>
53 Reference < XStyle > xNewStyle;
59 Reference < XInterface > xIfc =
60 xFactory->createInstance(
"com.sun.star.style.PageStyle");
62 xNewStyle.set( xIfc, UNO_QUERY );
72 const Reference< XFastAttributeList > & xAttrList,
75, m_bInsertHeader( false )
76, m_bInsertFooter( false )
77, m_bInsertHeaderLeft( false )
78, m_bInsertFooterLeft( false )
79, m_bInsertHeaderFirst( false )
80, m_bInsertFooterFirst( false )
81, m_bHeaderInserted( false )
82, m_bFooterInserted( false )
87 const OUString aValue = aIter.toString();
88 switch (aIter.getToken())
123 Reference < XNameContainer > xPageStyles =
124 GetImport().GetTextImport()->GetPageStyles();
125 if( !xPageStyles.is() )
145 Reference < XPropertySet > xPropSet(
m_xStyle, UNO_QUERY );
146 Reference< XPropertySetInfo > xPropSetInfo =
147 xPropSet->getPropertySetInfo();
149 if( !bNew && xPropSetInfo->hasPropertyByName(
sIsPhysical ) )
152 bNew = !*o3tl::doAccess<bool>(aAny);
156 if( !(bOverwrite || bNew) )
159 Reference < XMultiPropertyStates > xMultiStates( xPropSet,
161 OSL_ENSURE( xMultiStates.is(),
162 "text page style does not support multi property set" );
163 if( xMultiStates.is() )
164 xMultiStates->setAllPropertiesToDefault();
166 if ( xPropSetInfo->hasPropertyByName(
"GridDisplay" ) )
167 xPropSet->setPropertyValue(
"GridDisplay",
Any(
false) );
169 if ( xPropSetInfo->hasPropertyByName(
"GridPrint" ) )
170 xPropSet->setPropertyValue(
"GridPrint",
Any(
false) );
183 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
187 bool bInsert =
false, bFooter =
false, bLeft =
false, bFirst =
false;
200 bInsert = bFooter =
true;
206 bInsert = bLeft =
true;
210 bInsert = bFooter = bLeft =
true;
215 bInsert = bFirst =
true;
220 bInsert = bFooter = bFirst =
true;
227 bFooter, bLeft, bFirst );
235 const css::uno::Reference< css::xml::sax::XFastAttributeList > & ,
240 Reference < XPropertySet > xPropSet(
m_xStyle, UNO_QUERY );
249 Reference < XPropertySet > xPropSet(
m_xStyle, UNO_QUERY );
264 else if (pDrawingPageStyle)
270 Reference < XNameContainer > xPageStyles =
271 GetImport().GetTextImport()->GetPageStyles();
272 if( !xPageStyles.is() )
275 Reference< XPropertySetInfo > xPropSetInfo =
276 xPropSet->getPropertySetInfo();
279 OUString sDisplayFollow(
282 if( sDisplayFollow.isEmpty() ||
283 !xPageStyles->hasByName( sDisplayFollow ) )
284 sDisplayFollow =
m_xStyle->getName();
287 OUString sCurrFollow;
288 aAny >>= sCurrFollow;
289 if( sCurrFollow != sDisplayFollow )
295 if ( xPropSetInfo->hasPropertyByName(
"Hidden" ) )
constexpr OUStringLiteral gsFollowStyle(u"FollowStyle")
void FillPropertySet_PageStyle(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, XMLPropStyleContext *pDrawingPageStyle)
This class deliberately does not support XWeak, to improve performance when loading large documents.
SvXMLImport & GetImport()
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
SAL_DLLPRIVATE css::uno::Reference< css::style::XStyle > Create()
css::uno::Reference< css::style::XStyle > m_xStyle
OUString m_sPageMasterName
OUString m_sDrawingPageStyle
virtual SvXMLImportContext * CreateHeaderFooterContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, const bool bFooter, const bool bLeft, const bool bFirst)
virtual void Finish(bool bOverwrite) override
bool m_bInsertHeaderFirst
XMLTextMasterPageContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, bool bOverwrite)
virtual ~XMLTextMasterPageContext() override
bool m_bInsertFooterFirst
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Reference< XSingleServiceFactory > xFactory
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Handling of tokens in XML:
#define XMLOFF_WARN_UNKNOWN(area, rIter)
#define XML_ELEMENT(prefix, name)
constexpr OUStringLiteral sIsPhysical(u"IsPhysical")