25#include <com/sun/star/beans/XPropertySet.hpp>
26#include <com/sun/star/table/BorderLine2.hpp>
39 return (rLine1.InnerLineWidth == rLine2.InnerLineWidth) &&
40 (rLine1.OuterLineWidth == rLine2.OuterLineWidth) &&
41 (rLine1.LineDistance == rLine2.LineDistance) &&
42 (rLine1.LineWidth == rLine2.LineWidth);
53 sal_Int16
nValue = sal_Int16();
58static void lcl_AddState(::std::vector< XMLPropertyState >& rPropState, sal_Int32 nIndex,
const OUString& rProperty,
const uno::Reference< beans::XPropertySet >& xProps)
60 if(::cppu::any2bool(xProps->getPropertyValue(rProperty)))
61 rPropState.emplace_back(
nIndex, css::uno::Any(
true));
68struct XMLPropertyStateBuffer
97 XMLPropertyStateBuffer();
98 void ContextFilter( ::std::vector< XMLPropertyState >& rPropState );
103XMLPropertyStateBuffer::XMLPropertyStateBuffer()
104 : pPMMarginAll( nullptr )
106 pPMBorderAll( nullptr ),
107 pPMBorderTop( nullptr ),
108 pPMBorderBottom( nullptr ),
109 pPMBorderLeft( nullptr ),
110 pPMBorderRight( nullptr ),
112 pPMBorderWidthAll( nullptr ),
113 pPMBorderWidthTop( nullptr ),
114 pPMBorderWidthBottom( nullptr ),
115 pPMBorderWidthLeft( nullptr ),
116 pPMBorderWidthRight( nullptr ),
118 pPMPaddingAll( nullptr ),
119 pPMPaddingTop( nullptr ),
120 pPMPaddingBottom( nullptr ),
121 pPMPaddingLeft( nullptr ),
122 pPMPaddingRight( nullptr ),
124 pPMMarginGutter( nullptr ),
125 pPMMarginLeft( nullptr ),
126 pPMRtlGutter( nullptr ),
127 pPMMarginRight( nullptr ),
128 m_bGutterAtTop( false ),
129 pPMMarginTop( nullptr )
133void XMLPropertyStateBuffer::ContextFilter( ::std::vector< XMLPropertyState >& )
137 sal_Int32 nGutterMargin{};
138 pPMMarginGutter->maValue >>= nGutterMargin;
141 if (nGutterMargin && pPMMarginTop)
153 if (nGutterMargin && pPMRtlGutter)
155 pPMRtlGutter->maValue >>= bRtlGutter;
159 if (nGutterMargin && pPMMarginRight)
170 if (nGutterMargin && pPMMarginLeft)
189 if( pPMBorderTop && pPMBorderBottom && pPMBorderLeft && pPMBorderRight )
191 table::BorderLine2 aLineTop, aLineBottom, aLineLeft, aLineRight;
193 pPMBorderTop->maValue >>= aLineTop;
194 pPMBorderBottom->maValue >>= aLineBottom;
195 pPMBorderLeft->maValue >>= aLineLeft;
196 pPMBorderRight->maValue >>= aLineRight;
198 if( (aLineTop == aLineBottom) && (aLineBottom == aLineLeft) && (aLineLeft == aLineRight) )
212 if( pPMBorderWidthAll )
214 if( pPMBorderWidthTop && pPMBorderWidthBottom && pPMBorderWidthLeft && pPMBorderWidthRight )
216 table::BorderLine2 aLineTop, aLineBottom, aLineLeft, aLineRight;
218 pPMBorderWidthTop->maValue >>= aLineTop;
219 pPMBorderWidthBottom->maValue >>= aLineBottom;
220 pPMBorderWidthLeft->maValue >>= aLineLeft;
221 pPMBorderWidthRight->maValue >>= aLineRight;
242 if( pPMPaddingTop && pPMPaddingBottom && pPMPaddingLeft && pPMPaddingRight )
244 sal_Int32 nTop = 0, nBottom = 0, nLeft = 0, nRight = 0;
246 pPMPaddingTop->maValue >>= nTop;
247 pPMPaddingBottom->maValue >>= nBottom;
248 pPMPaddingLeft->maValue >>= nLeft;
249 pPMPaddingRight->maValue >>= nRight;
251 if( (nTop == nBottom) && (nBottom == nLeft) && (nLeft == nRight) )
269 aBackgroundImageExport( rExport ),
270 aTextColumnsExport( rExport ),
271 aFootnoteSeparatorExport( rExport )
283 const ::std::vector< XMLPropertyState >* pProperties,
284 sal_uInt32 nIdx )
const
296 assert(nIdx >= 2 &&
"horrible array ordering borked again");
298 sal_Int32 nFilter(-1);
316 const Any* pPos =
nullptr;
317 const Any* pFilter =
nullptr;
318 sal_uInt32
nIndex(nIdx - 1);
331 sal_uInt32 nPropIndex = rProperty.
mnIndex;
352 const ::std::vector< XMLPropertyState >*,
358 bool bEnableFoFontFamily,
359 ::std::vector< XMLPropertyState >& rPropState,
360 const Reference< XPropertySet >& rPropSet )
const
362 XMLPropertyStateBuffer aPageBuffer;
365 aPageBuffer.m_bGutterAtTop =
true;
368 XMLPropertyStateBuffer aHeaderBuffer;
369 XMLPropertyStateBuffer aFooterBuffer;
401 bool const isDrawingPageExport(aPropMapper->FindEntryIndex(
CTF_PM_FILL) != -1);
403 for(
auto& rProp : rPropState )
406 sal_Int16 nContextId = aPropMapper->GetEntryContextId( pProp->
mnIndex );
413 if (!isDrawingPageExport
414 && [](OUString
const& rName) ->
bool {
415 return rName.startsWith(
"Fill")
416 || rName.startsWith(
"HeaderFill")
417 || rName.startsWith(
"FooterFill");
418 } (aPropMapper->GetEntryAPIName(rProp.mnIndex))
426 XMLPropertyStateBuffer* pBuffer;
431 default: pBuffer = &aPageBuffer;
break;
453 pBuffer->pPMMarginGutter = pProp;
456 pBuffer->pPMMarginLeft = pProp;
459 pBuffer->pPMRtlGutter = pProp;
462 pBuffer->pPMMarginRight = pProp;
465 pBuffer->pPMMarginTop = pProp;
487 pRepeatOffsetX = pProp;
491 pRepeatOffsetY = pProp;
495 pHeaderRepeatOffsetX = pProp;
499 pHeaderRepeatOffsetY = pProp;
503 pFooterRepeatOffsetX = pProp;
507 pFooterRepeatOffsetY = pProp;
548 if(pRepeatOffsetX && pRepeatOffsetY)
550 sal_Int32 nOffset(0);
552 if((pRepeatOffsetX->
maValue >>= nOffset) && (!nOffset))
563 if(pHeaderRepeatOffsetX && pHeaderRepeatOffsetY)
565 sal_Int32 nOffset(0);
567 if((pHeaderRepeatOffsetX->
maValue >>= nOffset) && (!nOffset))
569 pHeaderRepeatOffsetX->
mnIndex = -1;
573 pHeaderRepeatOffsetY->
mnIndex = -1;
578 if(pFooterRepeatOffsetX && pFooterRepeatOffsetY)
580 sal_Int32 nOffset(0);
582 if((pFooterRepeatOffsetX->
maValue >>= nOffset) && (!nOffset))
584 pFooterRepeatOffsetX->
mnIndex = -1;
588 pFooterRepeatOffsetY->
mnIndex = -1;
595 if( pPMGridBaseWidth )
597 if( pPMGridSnapToChars )
605 if( pPMGridBaseWidth && pPMStandardMode )
608 aPageBuffer.ContextFilter( rPropState );
609 aHeaderBuffer.ContextFilter( rPropState );
610 aFooterBuffer.ContextFilter( rPropState );
612 if( pPMHeaderHeight && (!pPMHeaderDynamic ||
getBOOL( pPMHeaderDynamic->
maValue )) )
614 if( pPMHeaderMinHeight && pPMHeaderDynamic && !
getBOOL( pPMHeaderDynamic->
maValue ) )
616 if( pPMHeaderDynamic )
619 if( pPMFooterHeight && (!pPMFooterDynamic ||
getBOOL( pPMFooterDynamic->
maValue )) )
621 if( pPMFooterMinHeight && pPMFooterDynamic && !
getBOOL( pPMFooterDynamic->
maValue ) )
623 if( pPMFooterDynamic )
628 if( pPMScaleToPages )
static void lcl_AddState(::std::vector< XMLPropertyState > &rPropState, sal_Int32 nIndex, const OUString &rProperty, const uno::Reference< beans::XPropertySet > &xProps)
static void lcl_RemoveState(XMLPropertyState *pState)
static bool lcl_HasSameLineWidth(const table::BorderLine2 &rLine1, const table::BorderLine2 &rLine2)
static void lcl_RemoveStateIfZero16(XMLPropertyState *pState)
#define CTF_PM_BORDERLEFT
#define CTF_PM_BORDERWIDTHTOP
#define CTF_PM_TEXTCOLUMNS
#define CTF_PM_PRINT_HEADERS
#define CTF_PM_HEADERREPEAT_OFFSET_X
#define CTF_PM_FILLTRANSNAME
#define CTF_PM_FOOTERMINHEIGHT
#define CTF_PM_FOOTERHEIGHT
#define CTF_PM_BORDERWIDTHRIGHT
#define CTF_PM_HEADERGRAPHICURL
#define CTF_PM_PADDINGLEFT
#define CTF_PM_PRINT_OBJECTS
#define CTF_PM_PRINT_DRAWING
#define CTF_PM_FTN_LINE_WEIGHT
#define CTF_PM_PRINT_FORMULAS
#define CTP_PM_GRID_SNAP_TO
#define CTF_PM_PRINT_CHARTS
#define CTF_PM_HEADERFILLHATCHNAME
#define CTF_PM_HEADERGRAPHICPOSITION
#define CTF_PM_FILLHATCHNAME
#define CTF_PM_BORDERWIDTHLEFT
#define CTF_PM_PADDINGTOP
#define CTF_PM_STANDARD_MODE
#define CTF_PM_FOOTERGRAPHICFILTER
#define CTF_PM_SCALETOPAGES
#define CTF_PM_HEADERHEIGHT
#define CTF_PM_HEADERFLAG
#define CTF_PM_BORDERBOTTOM
#define CTF_PM_FOOTERREPEAT_OFFSET_Y
#define CTF_PM_PRINT_ANNOTATIONS
#define CTF_PM_GRAPHICPOSITION
#define CTF_PM_FOOTERFILLHATCHNAME
#define CTF_PM_PADDINGRIGHT
#define CTF_PM_HEADERFILLGRADIENTNAME
#define CTF_PM_FILLBITMAPNAME
#define CTF_PM_PADDINGALL
#define CTF_PM_PADDINGBOTTOM
#define CTF_PM_REPEAT_OFFSET_X
#define CTF_PM_BORDERWIDTHBOTTOM
#define CTF_PM_FOOTERDYNAMIC
#define CTF_PM_GRAPHICFILTER
#define CTF_PM_HEADERFILLTRANSNAME
#define CTF_PM_FOOTERFILLTRANSNAME
#define CTP_PM_GRID_BASE_WIDTH
#define CTF_PM_MARGINLEFT
#define CTF_PM_HEADERREPEAT_OFFSET_Y
#define CTF_PM_PRINT_ZEROVALUES
#define CTF_PM_BORDERWIDTHALL
#define CTF_PM_PRINT_GRID
#define CTF_PM_HEADERGRAPHICFILTER
#define CTF_PM_HEADERDYNAMIC
#define CTF_PM_FOOTERFILLBITMAPNAME
#define CTF_PM_REPEAT_OFFSET_Y
#define CTF_PM_HEADERFILLBITMAPNAME
#define CTF_PM_MARGINRIGHT
#define CTF_PM_GRAPHICURL
#define CTF_PM_BORDERRIGHT
#define CTF_PM_FOOTERGRAPHICURL
#define CTF_PM_FOOTERREPEAT_OFFSET_X
#define CTF_PM_MARGINGUTTER
#define CTF_PM_FOOTERGRAPHICPOSITION
#define CTF_PM_FOOTERFILLGRADIENTNAME
#define CTF_PM_HEADERMINHEIGHT
#define CTF_PM_FILLGRADIENTNAME
#define CTF_PM_FOOTERFLAG
#define CTP_PM_GRID_SNAP_TO_CHARS
virtual void ContextFilter(bool bEnableFoFontFamily, ::std::vector< XMLPropertyState > &rProperties, const css::uno::Reference< css::beans::XPropertySet > &rPropSet) const
Application-specific filter.
const rtl::Reference< XMLPropertySetMapper > & getPropertySetMapper() const
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
returns the deterministic version for odf export
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
void exportXML(const css::uno::Any &rURL, const css::uno::Any *pPos, const css::uno::Any *pFilter, const css::uno::Any *pTransparency, sal_uInt16 nPrefix, const OUString &rLocalName)
SvXMLExport & GetExport() const
virtual ~XMLPageMasterExportPropMapper() override
virtual void ContextFilter(bool bEnableFoFontFamily, ::std::vector< XMLPropertyState > &rProperties, const css::uno::Reference< css::beans::XPropertySet > &rPropSet) const override
Application-specific filter.
XMLTextColumnsExport aTextColumnsExport
virtual void handleElementItem(SvXMLExport &rExport, const XMLPropertyState &rProperty, SvXmlExportFlags nFlags, const ::std::vector< XMLPropertyState > *pProperties, sal_uInt32 nIdx) const override
this method is called for every item that has the MID_FLAG_ELEMENT_EXPORT flag set
virtual void handleSpecialItem(comphelper::AttributeList &rAttrList, const XMLPropertyState &rProperty, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap, const ::std::vector< XMLPropertyState > *pProperties, sal_uInt32 nIdx) const override
this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set
XMLFootnoteSeparatorExport aFootnoteSeparatorExport
XMLPageMasterExportPropMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper, SvXMLExport &rExport)
XMLBackgroundImageExport aBackgroundImageExport
void exportXML(const css::uno::Any &rAny)
tools::Long const nRightMargin
tools::Long const nTopMargin
tools::Long const nLeftMargin
bool getBOOL(const Any &_rAny)
Handling of tokens in XML:
Smart struct to transport an Any with an index to the appropriate property-name.