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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "PageMasterExportPropMapper.hxx"
21 #include <xmloff/xmlprmap.hxx>
22 #include <xmloff/xmltoken.hxx>
23 #include <xmloff/xmlexp.hxx>
24 #include <comphelper/types.hxx>
25 #include <com/sun/star/beans/XPropertySet.hpp>
26 #include <com/sun/star/table/BorderLine2.hpp>
27 #include <com/sun/star/drawing/FillStyle.hpp>
28 #include <com/sun/star/drawing/BitmapMode.hpp>
29 #include <PageMasterStyleMap.hxx>
30 #include <rtl/ref.hxx>
31 #include <comphelper/extract.hxx>
33 using namespace ::com::sun::star
;
34 using namespace ::com::sun::star::uno
;
35 using namespace ::com::sun::star::beans
;
36 using namespace ::comphelper
;
37 using namespace ::xmloff::token
;
39 static bool lcl_HasSameLineWidth( const table::BorderLine2
& rLine1
, const table::BorderLine2
& rLine2
)
41 return (rLine1
.InnerLineWidth
== rLine2
.InnerLineWidth
) &&
42 (rLine1
.OuterLineWidth
== rLine2
.OuterLineWidth
) &&
43 (rLine1
.LineDistance
== rLine2
.LineDistance
) &&
44 (rLine1
.LineWidth
== rLine2
.LineWidth
);
47 static void lcl_RemoveState( XMLPropertyState
* pState
)
50 pState
->maValue
.clear();
53 static void lcl_RemoveStateIfZero16( XMLPropertyState
* pState
)
55 sal_Int16 nValue
= sal_Int16();
56 if( (pState
->maValue
>>= nValue
) && !nValue
)
57 lcl_RemoveState( pState
);
60 static void lcl_AddState(::std::vector
< XMLPropertyState
>& rPropState
, sal_Int32 nIndex
, const OUString
& rProperty
, const uno::Reference
< beans::XPropertySet
>& xProps
)
62 if(::cppu::any2bool(xProps
->getPropertyValue(rProperty
)))
63 rPropState
.emplace_back(nIndex
, css::uno::Any(true));
66 // helper struct to handle equal XMLPropertyState's for page, header and footer
70 struct XMLPropertyStateBuffer
72 XMLPropertyState
* pPMMarginAll
;
74 XMLPropertyState
* pPMBorderAll
;
75 XMLPropertyState
* pPMBorderTop
;
76 XMLPropertyState
* pPMBorderBottom
;
77 XMLPropertyState
* pPMBorderLeft
;
78 XMLPropertyState
* pPMBorderRight
;
80 XMLPropertyState
* pPMBorderWidthAll
;
81 XMLPropertyState
* pPMBorderWidthTop
;
82 XMLPropertyState
* pPMBorderWidthBottom
;
83 XMLPropertyState
* pPMBorderWidthLeft
;
84 XMLPropertyState
* pPMBorderWidthRight
;
86 XMLPropertyState
* pPMPaddingAll
;
87 XMLPropertyState
* pPMPaddingTop
;
88 XMLPropertyState
* pPMPaddingBottom
;
89 XMLPropertyState
* pPMPaddingLeft
;
90 XMLPropertyState
* pPMPaddingRight
;
92 XMLPropertyStateBuffer();
93 void ContextFilter( ::std::vector
< XMLPropertyState
>& rPropState
);
98 XMLPropertyStateBuffer::XMLPropertyStateBuffer()
99 : pPMMarginAll( nullptr )
101 pPMBorderAll( nullptr ),
102 pPMBorderTop( nullptr ),
103 pPMBorderBottom( nullptr ),
104 pPMBorderLeft( nullptr ),
105 pPMBorderRight( nullptr ),
107 pPMBorderWidthAll( nullptr ),
108 pPMBorderWidthTop( nullptr ),
109 pPMBorderWidthBottom( nullptr ),
110 pPMBorderWidthLeft( nullptr ),
111 pPMBorderWidthRight( nullptr ),
113 pPMPaddingAll( nullptr ),
114 pPMPaddingTop( nullptr ),
115 pPMPaddingBottom( nullptr ),
116 pPMPaddingLeft( nullptr ),
117 pPMPaddingRight( nullptr )
121 void XMLPropertyStateBuffer::ContextFilter( ::std::vector
< XMLPropertyState
>& )
125 lcl_RemoveState(pPMMarginAll
); // #i117696# do not write fo:margin
130 if( pPMBorderTop
&& pPMBorderBottom
&& pPMBorderLeft
&& pPMBorderRight
)
132 table::BorderLine2 aLineTop
, aLineBottom
, aLineLeft
, aLineRight
;
134 pPMBorderTop
->maValue
>>= aLineTop
;
135 pPMBorderBottom
->maValue
>>= aLineBottom
;
136 pPMBorderLeft
->maValue
>>= aLineLeft
;
137 pPMBorderRight
->maValue
>>= aLineRight
;
139 if( (aLineTop
== aLineBottom
) && (aLineBottom
== aLineLeft
) && (aLineLeft
== aLineRight
) )
141 lcl_RemoveState( pPMBorderTop
);
142 lcl_RemoveState( pPMBorderBottom
);
143 lcl_RemoveState( pPMBorderLeft
);
144 lcl_RemoveState( pPMBorderRight
);
147 lcl_RemoveState( pPMBorderAll
);
150 lcl_RemoveState( pPMBorderAll
);
153 if( pPMBorderWidthAll
)
155 if( pPMBorderWidthTop
&& pPMBorderWidthBottom
&& pPMBorderWidthLeft
&& pPMBorderWidthRight
)
157 table::BorderLine2 aLineTop
, aLineBottom
, aLineLeft
, aLineRight
;
159 pPMBorderWidthTop
->maValue
>>= aLineTop
;
160 pPMBorderWidthBottom
->maValue
>>= aLineBottom
;
161 pPMBorderWidthLeft
->maValue
>>= aLineLeft
;
162 pPMBorderWidthRight
->maValue
>>= aLineRight
;
164 if( lcl_HasSameLineWidth( aLineTop
, aLineBottom
) &&
165 lcl_HasSameLineWidth( aLineBottom
, aLineLeft
) &&
166 lcl_HasSameLineWidth( aLineLeft
, aLineRight
) )
168 lcl_RemoveState( pPMBorderWidthTop
);
169 lcl_RemoveState( pPMBorderWidthBottom
);
170 lcl_RemoveState( pPMBorderWidthLeft
);
171 lcl_RemoveState( pPMBorderWidthRight
);
174 lcl_RemoveState( pPMBorderWidthAll
);
177 lcl_RemoveState( pPMBorderWidthAll
);
183 if( pPMPaddingTop
&& pPMPaddingBottom
&& pPMPaddingLeft
&& pPMPaddingRight
)
185 sal_Int32 nTop
= 0, nBottom
= 0, nLeft
= 0, nRight
= 0;
187 pPMPaddingTop
->maValue
>>= nTop
;
188 pPMPaddingBottom
->maValue
>>= nBottom
;
189 pPMPaddingLeft
->maValue
>>= nLeft
;
190 pPMPaddingRight
->maValue
>>= nRight
;
192 if( (nTop
== nBottom
) && (nBottom
== nLeft
) && (nLeft
== nRight
) )
194 lcl_RemoveState( pPMPaddingTop
);
195 lcl_RemoveState( pPMPaddingBottom
);
196 lcl_RemoveState( pPMPaddingLeft
);
197 lcl_RemoveState( pPMPaddingRight
);
200 lcl_RemoveState( pPMPaddingAll
);
203 lcl_RemoveState( pPMPaddingAll
);
206 XMLPageMasterExportPropMapper::XMLPageMasterExportPropMapper(
207 const rtl::Reference
< XMLPropertySetMapper
>& rMapper
,
208 SvXMLExport
& rExport
) :
209 SvXMLExportPropertyMapper( rMapper
),
210 aBackgroundImageExport( rExport
),
211 aTextColumnsExport( rExport
),
212 aFootnoteSeparatorExport( rExport
)
216 XMLPageMasterExportPropMapper::~XMLPageMasterExportPropMapper()
220 void XMLPageMasterExportPropMapper::handleElementItem(
222 const XMLPropertyState
& rProperty
,
223 SvXmlExportFlags
/*nFlags*/,
224 const ::std::vector
< XMLPropertyState
>* pProperties
,
225 sal_uInt32 nIdx
) const
227 XMLPageMasterExportPropMapper
* pThis
= const_cast<XMLPageMasterExportPropMapper
*>(this);
229 sal_uInt32 nContextId
= getPropertySetMapper()->GetEntryContextId( rProperty
.mnIndex
);
232 case CTF_PM_GRAPHICURL
:
233 case CTF_PM_HEADERGRAPHICURL
:
234 case CTF_PM_FOOTERGRAPHICURL
:
237 assert(nIdx
>= 2 && "horrible array ordering borked again");
239 sal_Int32
nFilter(-1);
242 case CTF_PM_GRAPHICURL
:
243 nPos
= CTF_PM_GRAPHICPOSITION
;
244 nFilter
= CTF_PM_GRAPHICFILTER
;
246 case CTF_PM_HEADERGRAPHICURL
:
247 nPos
= CTF_PM_HEADERGRAPHICPOSITION
;
248 nFilter
= CTF_PM_HEADERGRAPHICFILTER
;
250 case CTF_PM_FOOTERGRAPHICURL
:
251 nPos
= CTF_PM_FOOTERGRAPHICPOSITION
;
252 nFilter
= CTF_PM_FOOTERGRAPHICFILTER
;
257 const Any
* pPos
= nullptr;
258 const Any
* pFilter
= nullptr;
259 sal_uInt32
nIndex(nIdx
- 1);
260 const XMLPropertyState
& rFilter
= (*pProperties
)[nIndex
];
261 if (getPropertySetMapper()->GetEntryContextId(rFilter
.mnIndex
) == nFilter
)
263 pFilter
= &rFilter
.maValue
;
266 const XMLPropertyState
& rPos
= (*pProperties
)[nIndex
];
267 if (getPropertySetMapper()->GetEntryContextId(rPos
.mnIndex
) == nPos
)
269 pPos
= &rPos
.maValue
;
272 sal_uInt32 nPropIndex
= rProperty
.mnIndex
;
273 pThis
->aBackgroundImageExport
.exportXML( rProperty
.maValue
, pPos
, pFilter
, nullptr,
274 getPropertySetMapper()->GetEntryNameSpace( nPropIndex
),
275 getPropertySetMapper()->GetEntryXMLName( nPropIndex
) );
278 case CTF_PM_TEXTCOLUMNS
:
279 pThis
->aTextColumnsExport
.exportXML( rProperty
.maValue
);
281 case CTF_PM_FTN_LINE_WEIGHT
:
282 pThis
->aFootnoteSeparatorExport
.exportXML( pProperties
, nIdx
,
283 getPropertySetMapper());
288 void XMLPageMasterExportPropMapper::handleSpecialItem(
290 const XMLPropertyState
&,
291 const SvXMLUnitConverter
&,
292 const SvXMLNamespaceMap
&,
293 const ::std::vector
< XMLPropertyState
>*,
294 sal_uInt32
/*nIdx*/) const
298 void XMLPageMasterExportPropMapper::ContextFilter(
299 bool bEnableFoFontFamily
,
300 ::std::vector
< XMLPropertyState
>& rPropState
,
301 const Reference
< XPropertySet
>& rPropSet
) const
303 XMLPropertyStateBuffer aPageBuffer
;
304 XMLPropertyStateBuffer aHeaderBuffer
;
305 XMLPropertyStateBuffer aFooterBuffer
;
307 XMLPropertyState
* pPMHeaderHeight
= nullptr;
308 XMLPropertyState
* pPMHeaderMinHeight
= nullptr;
309 XMLPropertyState
* pPMHeaderDynamic
= nullptr;
311 XMLPropertyState
* pPMFooterHeight
= nullptr;
312 XMLPropertyState
* pPMFooterMinHeight
= nullptr;
313 XMLPropertyState
* pPMFooterDynamic
= nullptr;
315 XMLPropertyState
* pPMScaleTo
= nullptr;
316 XMLPropertyState
* pPMScaleToPages
= nullptr;
317 XMLPropertyState
* pPMScaleToX
= nullptr;
318 XMLPropertyState
* pPMScaleToY
= nullptr;
319 XMLPropertyState
* pPMStandardMode
= nullptr;
320 XMLPropertyState
* pPMGridBaseWidth
= nullptr;
321 // same as pPMGridSnapTo but for backward compatibility only
322 XMLPropertyState
* pPMGridSnapToChars
= nullptr;
323 XMLPropertyState
* pPMGridSnapTo
= nullptr;
325 XMLPropertyState
* pPrint
= nullptr;
327 XMLPropertyState
* pRepeatOffsetX
= nullptr;
328 XMLPropertyState
* pRepeatOffsetY
= nullptr;
329 XMLPropertyState
* pHeaderRepeatOffsetX
= nullptr;
330 XMLPropertyState
* pHeaderRepeatOffsetY
= nullptr;
331 XMLPropertyState
* pFooterRepeatOffsetX
= nullptr;
332 XMLPropertyState
* pFooterRepeatOffsetY
= nullptr;
334 XMLPropertyState
* pFill
= nullptr;
335 XMLPropertyState
* pFillBitmapMode
= nullptr;
337 rtl::Reference
< XMLPropertySetMapper
> aPropMapper(getPropertySetMapper());
339 // distinguish 2 cases: drawing-page export has CTF_PM_FILL, page-layout-properties export does not
340 bool const isDrawingPageExport(aPropMapper
->FindEntryIndex(CTF_PM_FILL
) != -1);
342 for( auto& rProp
: rPropState
)
344 XMLPropertyState
*pProp
= &rProp
;
345 sal_Int16 nContextId
= aPropMapper
->GetEntryContextId( pProp
->mnIndex
);
346 sal_Int16 nFlag
= nContextId
& CTF_PM_FLAGMASK
;
347 sal_Int16 nSimpleId
= nContextId
& (~CTF_PM_FLAGMASK
| XML_PM_CTF_START
);
348 sal_Int16 nPrintId
= nContextId
& CTF_PM_PRINTMASK
;
351 // tdf#103602 don't export draw:fill attributes on page-layout-properties in strict ODF
352 if (!isDrawingPageExport
353 && [](OUString
const& rName
) -> bool {
354 return rName
.startsWith("Fill")
355 || rName
.startsWith("HeaderFill")
356 || rName
.startsWith("FooterFill");
357 } (aPropMapper
->GetEntryAPIName(rProp
.mnIndex
))
358 && ((aBackgroundImageExport
.GetExport().getSaneDefaultVersion()
359 & SvtSaveOptions::ODFSVER_EXTENDED
) == 0))
361 lcl_RemoveState(&rProp
);
365 XMLPropertyStateBuffer
* pBuffer
;
368 case CTF_PM_HEADERFLAG
: pBuffer
= &aHeaderBuffer
; break;
369 case CTF_PM_FOOTERFLAG
: pBuffer
= &aFooterBuffer
; break;
370 default: pBuffer
= &aPageBuffer
; break;
375 case CTF_PM_FILL
: // tdf#103602: add background-size attribute to ODT
376 if (nFlag
!= CTF_PM_HEADERFLAG
&& nFlag
!= CTF_PM_FOOTERFLAG
377 && rProp
.maValue
.hasValue())
382 case CTF_PM_FILLBITMAPMODE
:
383 if (nFlag
!= CTF_PM_HEADERFLAG
&& nFlag
!= CTF_PM_FOOTERFLAG
384 && rProp
.maValue
.hasValue())
386 pFillBitmapMode
= &rProp
;
389 case CTF_PM_MARGINALL
: pBuffer
->pPMMarginAll
= pProp
; break;
390 case CTF_PM_BORDERALL
: pBuffer
->pPMBorderAll
= pProp
; break;
391 case CTF_PM_BORDERTOP
: pBuffer
->pPMBorderTop
= pProp
; break;
392 case CTF_PM_BORDERBOTTOM
: pBuffer
->pPMBorderBottom
= pProp
; break;
393 case CTF_PM_BORDERLEFT
: pBuffer
->pPMBorderLeft
= pProp
; break;
394 case CTF_PM_BORDERRIGHT
: pBuffer
->pPMBorderRight
= pProp
; break;
395 case CTF_PM_BORDERWIDTHALL
: pBuffer
->pPMBorderWidthAll
= pProp
; break;
396 case CTF_PM_BORDERWIDTHTOP
: pBuffer
->pPMBorderWidthTop
= pProp
; break;
397 case CTF_PM_BORDERWIDTHBOTTOM
: pBuffer
->pPMBorderWidthBottom
= pProp
; break;
398 case CTF_PM_BORDERWIDTHLEFT
: pBuffer
->pPMBorderWidthLeft
= pProp
; break;
399 case CTF_PM_BORDERWIDTHRIGHT
: pBuffer
->pPMBorderWidthRight
= pProp
; break;
400 case CTF_PM_PADDINGALL
: pBuffer
->pPMPaddingAll
= pProp
; break;
401 case CTF_PM_PADDINGTOP
: pBuffer
->pPMPaddingTop
= pProp
; break;
402 case CTF_PM_PADDINGBOTTOM
: pBuffer
->pPMPaddingBottom
= pProp
; break;
403 case CTF_PM_PADDINGLEFT
: pBuffer
->pPMPaddingLeft
= pProp
; break;
404 case CTF_PM_PADDINGRIGHT
: pBuffer
->pPMPaddingRight
= pProp
; break;
409 case CTF_PM_HEADERHEIGHT
: pPMHeaderHeight
= pProp
; break;
410 case CTF_PM_HEADERMINHEIGHT
: pPMHeaderMinHeight
= pProp
; break;
411 case CTF_PM_HEADERDYNAMIC
: pPMHeaderDynamic
= pProp
; break;
412 case CTF_PM_FOOTERHEIGHT
: pPMFooterHeight
= pProp
; break;
413 case CTF_PM_FOOTERMINHEIGHT
: pPMFooterMinHeight
= pProp
; break;
414 case CTF_PM_FOOTERDYNAMIC
: pPMFooterDynamic
= pProp
; break;
415 case CTF_PM_SCALETO
: pPMScaleTo
= pProp
; break;
416 case CTF_PM_SCALETOPAGES
: pPMScaleToPages
= pProp
; break;
417 case CTF_PM_SCALETOX
: pPMScaleToX
= pProp
; break;
418 case CTF_PM_SCALETOY
: pPMScaleToY
= pProp
; break;
419 case CTF_PM_STANDARD_MODE
: pPMStandardMode
= pProp
; break;
420 case CTP_PM_GRID_BASE_WIDTH
: pPMGridBaseWidth
= pProp
; break;
421 case CTP_PM_GRID_SNAP_TO_CHARS
: pPMGridSnapToChars
= pProp
; break;
422 case CTP_PM_GRID_SNAP_TO
: pPMGridSnapTo
= pProp
; break;
424 case CTF_PM_REPEAT_OFFSET_X
:
425 pRepeatOffsetX
= pProp
;
428 case CTF_PM_REPEAT_OFFSET_Y
:
429 pRepeatOffsetY
= pProp
;
432 case CTF_PM_HEADERREPEAT_OFFSET_X
:
433 pHeaderRepeatOffsetX
= pProp
;
436 case CTF_PM_HEADERREPEAT_OFFSET_Y
:
437 pHeaderRepeatOffsetY
= pProp
;
440 case CTF_PM_FOOTERREPEAT_OFFSET_X
:
441 pFooterRepeatOffsetX
= pProp
;
444 case CTF_PM_FOOTERREPEAT_OFFSET_Y
:
445 pFooterRepeatOffsetY
= pProp
;
448 // Sort out empty entries
449 case CTF_PM_FILLGRADIENTNAME
:
450 case CTF_PM_FILLHATCHNAME
:
451 case CTF_PM_FILLBITMAPNAME
:
452 case CTF_PM_FILLTRANSNAME
:
454 case CTF_PM_HEADERFILLGRADIENTNAME
:
455 case CTF_PM_HEADERFILLHATCHNAME
:
456 case CTF_PM_HEADERFILLBITMAPNAME
:
457 case CTF_PM_HEADERFILLTRANSNAME
:
459 case CTF_PM_FOOTERFILLGRADIENTNAME
:
460 case CTF_PM_FOOTERFILLHATCHNAME
:
461 case CTF_PM_FOOTERFILLBITMAPNAME
:
462 case CTF_PM_FOOTERFILLTRANSNAME
:
466 if( (pProp
->maValue
>>= aStr
) && 0 == aStr
.getLength() )
475 if (nPrintId
== CTF_PM_PRINTMASK
)
478 lcl_RemoveState(pPrint
);
482 // These entries need to be reduced to a single one for XML export.
483 // Both would be exported as 'draw:tile-repeat-offset' following a percent
484 // value and a 'vertical' or 'horizontal' tag as mark. If both would be active
485 // and both would be exported this would create an XML error (same property twice)
486 if(pRepeatOffsetX
&& pRepeatOffsetY
)
488 sal_Int32
nOffset(0);
490 if((pRepeatOffsetX
->maValue
>>= nOffset
) && (!nOffset
))
492 pRepeatOffsetX
->mnIndex
= -1;
496 pRepeatOffsetY
->mnIndex
= -1;
500 // Same as above for Header
501 if(pHeaderRepeatOffsetX
&& pHeaderRepeatOffsetY
)
503 sal_Int32
nOffset(0);
505 if((pHeaderRepeatOffsetX
->maValue
>>= nOffset
) && (!nOffset
))
507 pHeaderRepeatOffsetX
->mnIndex
= -1;
511 pHeaderRepeatOffsetY
->mnIndex
= -1;
515 // Same as above for Footer
516 if(pFooterRepeatOffsetX
&& pFooterRepeatOffsetY
)
518 sal_Int32
nOffset(0);
520 if((pFooterRepeatOffsetX
->maValue
>>= nOffset
) && (!nOffset
))
522 pFooterRepeatOffsetX
->mnIndex
= -1;
526 pFooterRepeatOffsetY
->mnIndex
= -1;
530 if( pPMStandardMode
&& !getBOOL(pPMStandardMode
->maValue
) )
532 lcl_RemoveState(pPMStandardMode
);
533 if( pPMGridBaseWidth
)
534 lcl_RemoveState(pPMGridBaseWidth
);
535 if( pPMGridSnapToChars
)
536 lcl_RemoveState(pPMGridSnapToChars
);
539 lcl_RemoveState(pPMGridSnapTo
);
543 if( pPMGridBaseWidth
&& pPMStandardMode
)
544 lcl_RemoveState(pPMStandardMode
);
546 aPageBuffer
.ContextFilter( rPropState
);
547 aHeaderBuffer
.ContextFilter( rPropState
);
548 aFooterBuffer
.ContextFilter( rPropState
);
550 if( pPMHeaderHeight
&& (!pPMHeaderDynamic
|| getBOOL( pPMHeaderDynamic
->maValue
)) )
551 lcl_RemoveState( pPMHeaderHeight
);
552 if( pPMHeaderMinHeight
&& pPMHeaderDynamic
&& !getBOOL( pPMHeaderDynamic
->maValue
) )
553 lcl_RemoveState( pPMHeaderMinHeight
);
554 if( pPMHeaderDynamic
)
555 lcl_RemoveState( pPMHeaderDynamic
);
557 if( pPMFooterHeight
&& (!pPMFooterDynamic
|| getBOOL( pPMFooterDynamic
->maValue
)) )
558 lcl_RemoveState( pPMFooterHeight
);
559 if( pPMFooterMinHeight
&& pPMFooterDynamic
&& !getBOOL( pPMFooterDynamic
->maValue
) )
560 lcl_RemoveState( pPMFooterMinHeight
);
561 if( pPMFooterDynamic
)
562 lcl_RemoveState( pPMFooterDynamic
);
565 lcl_RemoveStateIfZero16( pPMScaleTo
);
566 if( pPMScaleToPages
)
567 lcl_RemoveStateIfZero16( pPMScaleToPages
);
569 lcl_RemoveStateIfZero16( pPMScaleToX
);
571 lcl_RemoveStateIfZero16( pPMScaleToY
);
575 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_ANNOTATIONS
), "PrintAnnotations", rPropSet
);
576 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_CHARTS
), "PrintCharts", rPropSet
);
577 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_DRAWING
), "PrintDrawing", rPropSet
);
578 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_FORMULAS
), "PrintFormulas", rPropSet
);
579 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_GRID
), "PrintGrid", rPropSet
);
580 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_HEADERS
), "PrintHeaders", rPropSet
);
581 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_OBJECTS
), "PrintObjects", rPropSet
);
582 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_ZEROVALUES
), "PrintZeroValues", rPropSet
);
586 { // note: only drawing-page export should write this, because CTF_PM_FILL
587 uno::Any backgroundSize
;
588 switch (pFill
->maValue
.get
<drawing::FillStyle
>())
590 case drawing::FillStyle_NONE
:
592 case drawing::FillStyle_SOLID
:
593 case drawing::FillStyle_GRADIENT
:
594 case drawing::FillStyle_HATCH
:
595 backgroundSize
<<= true;
597 case drawing::FillStyle_BITMAP
:
600 switch (pFillBitmapMode
->maValue
.get
<drawing::BitmapMode
>())
602 case drawing::BitmapMode_REPEAT
:
603 backgroundSize
<<= true;
605 case drawing::BitmapMode_STRETCH
:
606 case drawing::BitmapMode_NO_REPEAT
:
607 backgroundSize
<<= false;
613 // else: leave it ambiguous if not explicitly defined
619 if (backgroundSize
.hasValue())
621 auto const nIndex(aPropMapper
->FindEntryIndex(CTF_PM_BACKGROUNDSIZE
));
623 rPropState
.emplace_back(nIndex
, backgroundSize
);
627 SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily
, rPropState
, rPropSet
);
630 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */