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 <PageMasterStyleMap.hxx>
28 #include <rtl/ref.hxx>
29 #include <comphelper/extract.hxx>
31 using namespace ::com::sun::star
;
32 using namespace ::com::sun::star::uno
;
33 using namespace ::com::sun::star::beans
;
34 using namespace ::comphelper
;
35 using namespace ::xmloff::token
;
37 static bool lcl_HasSameLineWidth( const table::BorderLine2
& rLine1
, const table::BorderLine2
& rLine2
)
39 return (rLine1
.InnerLineWidth
== rLine2
.InnerLineWidth
) &&
40 (rLine1
.OuterLineWidth
== rLine2
.OuterLineWidth
) &&
41 (rLine1
.LineDistance
== rLine2
.LineDistance
) &&
42 (rLine1
.LineWidth
== rLine2
.LineWidth
);
45 static void lcl_RemoveState( XMLPropertyState
* pState
)
48 pState
->maValue
.clear();
51 static void lcl_RemoveStateIfZero16( XMLPropertyState
* pState
)
53 sal_Int16 nValue
= sal_Int16();
54 if( (pState
->maValue
>>= nValue
) && !nValue
)
55 lcl_RemoveState( pState
);
58 static 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));
64 // helper struct to handle equal XMLPropertyState's for page, header and footer
68 struct XMLPropertyStateBuffer
70 XMLPropertyState
* pPMMarginAll
;
72 XMLPropertyState
* pPMBorderAll
;
73 XMLPropertyState
* pPMBorderTop
;
74 XMLPropertyState
* pPMBorderBottom
;
75 XMLPropertyState
* pPMBorderLeft
;
76 XMLPropertyState
* pPMBorderRight
;
78 XMLPropertyState
* pPMBorderWidthAll
;
79 XMLPropertyState
* pPMBorderWidthTop
;
80 XMLPropertyState
* pPMBorderWidthBottom
;
81 XMLPropertyState
* pPMBorderWidthLeft
;
82 XMLPropertyState
* pPMBorderWidthRight
;
84 XMLPropertyState
* pPMPaddingAll
;
85 XMLPropertyState
* pPMPaddingTop
;
86 XMLPropertyState
* pPMPaddingBottom
;
87 XMLPropertyState
* pPMPaddingLeft
;
88 XMLPropertyState
* pPMPaddingRight
;
90 XMLPropertyState
* pPMMarginGutter
;
91 XMLPropertyState
* pPMMarginLeft
;
92 XMLPropertyState
* pPMRtlGutter
;
93 XMLPropertyState
* pPMMarginRight
;
95 XMLPropertyState
* pPMMarginTop
;
97 XMLPropertyStateBuffer();
98 void ContextFilter( ::std::vector
< XMLPropertyState
>& rPropState
);
103 XMLPropertyStateBuffer::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 )
133 void XMLPropertyStateBuffer::ContextFilter( ::std::vector
< XMLPropertyState
>& )
137 sal_Int32 nGutterMargin
{};
138 pPMMarginGutter
->maValue
>>= nGutterMargin
;
141 if (nGutterMargin
&& pPMMarginTop
)
143 // Increase top margin to include gutter.
144 sal_Int32 nTopMargin
{};
145 pPMMarginTop
->maValue
>>= nTopMargin
;
146 nTopMargin
+= nGutterMargin
;
147 pPMMarginTop
->maValue
<<= nTopMargin
;
153 if (nGutterMargin
&& pPMRtlGutter
)
155 pPMRtlGutter
->maValue
>>= bRtlGutter
;
159 if (nGutterMargin
&& pPMMarginRight
)
161 // Increase right margin to include gutter.
162 sal_Int32 nRightMargin
{};
163 pPMMarginRight
->maValue
>>= nRightMargin
;
164 nRightMargin
+= nGutterMargin
;
165 pPMMarginRight
->maValue
<<= nRightMargin
;
170 if (nGutterMargin
&& pPMMarginLeft
)
172 // Increase left margin to include gutter.
173 sal_Int32 nLeftMargin
{};
174 pPMMarginLeft
->maValue
>>= nLeftMargin
;
175 nLeftMargin
+= nGutterMargin
;
176 pPMMarginLeft
->maValue
<<= nLeftMargin
;
184 lcl_RemoveState(pPMMarginAll
); // #i117696# do not write fo:margin
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
) )
200 lcl_RemoveState( pPMBorderTop
);
201 lcl_RemoveState( pPMBorderBottom
);
202 lcl_RemoveState( pPMBorderLeft
);
203 lcl_RemoveState( pPMBorderRight
);
206 lcl_RemoveState( pPMBorderAll
);
209 lcl_RemoveState( pPMBorderAll
);
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
;
223 if( lcl_HasSameLineWidth( aLineTop
, aLineBottom
) &&
224 lcl_HasSameLineWidth( aLineBottom
, aLineLeft
) &&
225 lcl_HasSameLineWidth( aLineLeft
, aLineRight
) )
227 lcl_RemoveState( pPMBorderWidthTop
);
228 lcl_RemoveState( pPMBorderWidthBottom
);
229 lcl_RemoveState( pPMBorderWidthLeft
);
230 lcl_RemoveState( pPMBorderWidthRight
);
233 lcl_RemoveState( pPMBorderWidthAll
);
236 lcl_RemoveState( pPMBorderWidthAll
);
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
) )
253 lcl_RemoveState( pPMPaddingTop
);
254 lcl_RemoveState( pPMPaddingBottom
);
255 lcl_RemoveState( pPMPaddingLeft
);
256 lcl_RemoveState( pPMPaddingRight
);
259 lcl_RemoveState( pPMPaddingAll
);
262 lcl_RemoveState( pPMPaddingAll
);
265 XMLPageMasterExportPropMapper::XMLPageMasterExportPropMapper(
266 const rtl::Reference
< XMLPropertySetMapper
>& rMapper
,
267 SvXMLExport
& rExport
) :
268 SvXMLExportPropertyMapper( rMapper
),
269 aBackgroundImageExport( rExport
),
270 aTextColumnsExport( rExport
),
271 aFootnoteSeparatorExport( rExport
)
275 XMLPageMasterExportPropMapper::~XMLPageMasterExportPropMapper()
279 void XMLPageMasterExportPropMapper::handleElementItem(
281 const XMLPropertyState
& rProperty
,
282 SvXmlExportFlags
/*nFlags*/,
283 const ::std::vector
< XMLPropertyState
>* pProperties
,
284 sal_uInt32 nIdx
) const
286 XMLPageMasterExportPropMapper
* pThis
= const_cast<XMLPageMasterExportPropMapper
*>(this);
288 sal_uInt32 nContextId
= getPropertySetMapper()->GetEntryContextId( rProperty
.mnIndex
);
291 case CTF_PM_GRAPHICURL
:
292 case CTF_PM_HEADERGRAPHICURL
:
293 case CTF_PM_FOOTERGRAPHICURL
:
296 assert(nIdx
>= 2 && "horrible array ordering borked again");
298 sal_Int32
nFilter(-1);
301 case CTF_PM_GRAPHICURL
:
302 nPos
= CTF_PM_GRAPHICPOSITION
;
303 nFilter
= CTF_PM_GRAPHICFILTER
;
305 case CTF_PM_HEADERGRAPHICURL
:
306 nPos
= CTF_PM_HEADERGRAPHICPOSITION
;
307 nFilter
= CTF_PM_HEADERGRAPHICFILTER
;
309 case CTF_PM_FOOTERGRAPHICURL
:
310 nPos
= CTF_PM_FOOTERGRAPHICPOSITION
;
311 nFilter
= CTF_PM_FOOTERGRAPHICFILTER
;
316 const Any
* pPos
= nullptr;
317 const Any
* pFilter
= nullptr;
318 sal_uInt32
nIndex(nIdx
- 1);
319 const XMLPropertyState
& rFilter
= (*pProperties
)[nIndex
];
320 if (getPropertySetMapper()->GetEntryContextId(rFilter
.mnIndex
) == nFilter
)
322 pFilter
= &rFilter
.maValue
;
325 const XMLPropertyState
& rPos
= (*pProperties
)[nIndex
];
326 if (getPropertySetMapper()->GetEntryContextId(rPos
.mnIndex
) == nPos
)
328 pPos
= &rPos
.maValue
;
331 sal_uInt32 nPropIndex
= rProperty
.mnIndex
;
332 pThis
->aBackgroundImageExport
.exportXML( rProperty
.maValue
, pPos
, pFilter
, nullptr,
333 getPropertySetMapper()->GetEntryNameSpace( nPropIndex
),
334 getPropertySetMapper()->GetEntryXMLName( nPropIndex
) );
337 case CTF_PM_TEXTCOLUMNS
:
338 pThis
->aTextColumnsExport
.exportXML( rProperty
.maValue
);
340 case CTF_PM_FTN_LINE_WEIGHT
:
341 pThis
->aFootnoteSeparatorExport
.exportXML( pProperties
, nIdx
,
342 getPropertySetMapper());
347 void XMLPageMasterExportPropMapper::handleSpecialItem(
348 comphelper::AttributeList
&,
349 const XMLPropertyState
&,
350 const SvXMLUnitConverter
&,
351 const SvXMLNamespaceMap
&,
352 const ::std::vector
< XMLPropertyState
>*,
353 sal_uInt32
/*nIdx*/) const
357 void XMLPageMasterExportPropMapper::ContextFilter(
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
;
371 XMLPropertyState
* pPMHeaderHeight
= nullptr;
372 XMLPropertyState
* pPMHeaderMinHeight
= nullptr;
373 XMLPropertyState
* pPMHeaderDynamic
= nullptr;
375 XMLPropertyState
* pPMFooterHeight
= nullptr;
376 XMLPropertyState
* pPMFooterMinHeight
= nullptr;
377 XMLPropertyState
* pPMFooterDynamic
= nullptr;
379 XMLPropertyState
* pPMScaleTo
= nullptr;
380 XMLPropertyState
* pPMScaleToPages
= nullptr;
381 XMLPropertyState
* pPMScaleToX
= nullptr;
382 XMLPropertyState
* pPMScaleToY
= nullptr;
383 XMLPropertyState
* pPMStandardMode
= nullptr;
384 XMLPropertyState
* pPMGridBaseWidth
= nullptr;
385 // same as pPMGridSnapTo but for backward compatibility only
386 XMLPropertyState
* pPMGridSnapToChars
= nullptr;
387 XMLPropertyState
* pPMGridSnapTo
= nullptr;
389 XMLPropertyState
* pPrint
= nullptr;
391 XMLPropertyState
* pRepeatOffsetX
= nullptr;
392 XMLPropertyState
* pRepeatOffsetY
= nullptr;
393 XMLPropertyState
* pHeaderRepeatOffsetX
= nullptr;
394 XMLPropertyState
* pHeaderRepeatOffsetY
= nullptr;
395 XMLPropertyState
* pFooterRepeatOffsetX
= nullptr;
396 XMLPropertyState
* pFooterRepeatOffsetY
= nullptr;
398 rtl::Reference
< XMLPropertySetMapper
> aPropMapper(getPropertySetMapper());
400 // distinguish 2 cases: drawing-page export has CTF_PM_FILL, page-layout-properties export does not
401 bool const isDrawingPageExport(aPropMapper
->FindEntryIndex(CTF_PM_FILL
) != -1);
403 for( auto& rProp
: rPropState
)
405 XMLPropertyState
*pProp
= &rProp
;
406 sal_Int16 nContextId
= aPropMapper
->GetEntryContextId( pProp
->mnIndex
);
407 sal_Int16 nFlag
= nContextId
& CTF_PM_FLAGMASK
;
408 sal_Int16 nSimpleId
= nContextId
& (~CTF_PM_FLAGMASK
| XML_PM_CTF_START
);
409 sal_Int16 nPrintId
= nContextId
& CTF_PM_PRINTMASK
;
412 // tdf#103602 don't export draw:fill attributes on page-layout-properties in strict ODF
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
))
419 && ((aBackgroundImageExport
.GetExport().getSaneDefaultVersion()
420 & SvtSaveOptions::ODFSVER_EXTENDED
) == 0))
422 lcl_RemoveState(&rProp
);
426 XMLPropertyStateBuffer
* pBuffer
;
429 case CTF_PM_HEADERFLAG
: pBuffer
= &aHeaderBuffer
; break;
430 case CTF_PM_FOOTERFLAG
: pBuffer
= &aFooterBuffer
; break;
431 default: pBuffer
= &aPageBuffer
; break;
436 case CTF_PM_MARGINALL
: pBuffer
->pPMMarginAll
= pProp
; break;
437 case CTF_PM_BORDERALL
: pBuffer
->pPMBorderAll
= pProp
; break;
438 case CTF_PM_BORDERTOP
: pBuffer
->pPMBorderTop
= pProp
; break;
439 case CTF_PM_BORDERBOTTOM
: pBuffer
->pPMBorderBottom
= pProp
; break;
440 case CTF_PM_BORDERLEFT
: pBuffer
->pPMBorderLeft
= pProp
; break;
441 case CTF_PM_BORDERRIGHT
: pBuffer
->pPMBorderRight
= pProp
; break;
442 case CTF_PM_BORDERWIDTHALL
: pBuffer
->pPMBorderWidthAll
= pProp
; break;
443 case CTF_PM_BORDERWIDTHTOP
: pBuffer
->pPMBorderWidthTop
= pProp
; break;
444 case CTF_PM_BORDERWIDTHBOTTOM
: pBuffer
->pPMBorderWidthBottom
= pProp
; break;
445 case CTF_PM_BORDERWIDTHLEFT
: pBuffer
->pPMBorderWidthLeft
= pProp
; break;
446 case CTF_PM_BORDERWIDTHRIGHT
: pBuffer
->pPMBorderWidthRight
= pProp
; break;
447 case CTF_PM_PADDINGALL
: pBuffer
->pPMPaddingAll
= pProp
; break;
448 case CTF_PM_PADDINGTOP
: pBuffer
->pPMPaddingTop
= pProp
; break;
449 case CTF_PM_PADDINGBOTTOM
: pBuffer
->pPMPaddingBottom
= pProp
; break;
450 case CTF_PM_PADDINGLEFT
: pBuffer
->pPMPaddingLeft
= pProp
; break;
451 case CTF_PM_PADDINGRIGHT
: pBuffer
->pPMPaddingRight
= pProp
; break;
452 case CTF_PM_MARGINGUTTER
:
453 pBuffer
->pPMMarginGutter
= pProp
;
455 case CTF_PM_MARGINLEFT
:
456 pBuffer
->pPMMarginLeft
= pProp
;
458 case CTF_PM_RTLGUTTER
:
459 pBuffer
->pPMRtlGutter
= pProp
;
461 case CTF_PM_MARGINRIGHT
:
462 pBuffer
->pPMMarginRight
= pProp
;
464 case CTF_PM_MARGINTOP
:
465 pBuffer
->pPMMarginTop
= pProp
;
471 case CTF_PM_HEADERHEIGHT
: pPMHeaderHeight
= pProp
; break;
472 case CTF_PM_HEADERMINHEIGHT
: pPMHeaderMinHeight
= pProp
; break;
473 case CTF_PM_HEADERDYNAMIC
: pPMHeaderDynamic
= pProp
; break;
474 case CTF_PM_FOOTERHEIGHT
: pPMFooterHeight
= pProp
; break;
475 case CTF_PM_FOOTERMINHEIGHT
: pPMFooterMinHeight
= pProp
; break;
476 case CTF_PM_FOOTERDYNAMIC
: pPMFooterDynamic
= pProp
; break;
477 case CTF_PM_SCALETO
: pPMScaleTo
= pProp
; break;
478 case CTF_PM_SCALETOPAGES
: pPMScaleToPages
= pProp
; break;
479 case CTF_PM_SCALETOX
: pPMScaleToX
= pProp
; break;
480 case CTF_PM_SCALETOY
: pPMScaleToY
= pProp
; break;
481 case CTF_PM_STANDARD_MODE
: pPMStandardMode
= pProp
; break;
482 case CTP_PM_GRID_BASE_WIDTH
: pPMGridBaseWidth
= pProp
; break;
483 case CTP_PM_GRID_SNAP_TO_CHARS
: pPMGridSnapToChars
= pProp
; break;
484 case CTP_PM_GRID_SNAP_TO
: pPMGridSnapTo
= pProp
; break;
486 case CTF_PM_REPEAT_OFFSET_X
:
487 pRepeatOffsetX
= pProp
;
490 case CTF_PM_REPEAT_OFFSET_Y
:
491 pRepeatOffsetY
= pProp
;
494 case CTF_PM_HEADERREPEAT_OFFSET_X
:
495 pHeaderRepeatOffsetX
= pProp
;
498 case CTF_PM_HEADERREPEAT_OFFSET_Y
:
499 pHeaderRepeatOffsetY
= pProp
;
502 case CTF_PM_FOOTERREPEAT_OFFSET_X
:
503 pFooterRepeatOffsetX
= pProp
;
506 case CTF_PM_FOOTERREPEAT_OFFSET_Y
:
507 pFooterRepeatOffsetY
= pProp
;
510 // Sort out empty entries
511 case CTF_PM_FILLGRADIENTNAME
:
512 case CTF_PM_FILLHATCHNAME
:
513 case CTF_PM_FILLBITMAPNAME
:
514 case CTF_PM_FILLTRANSNAME
:
516 case CTF_PM_HEADERFILLGRADIENTNAME
:
517 case CTF_PM_HEADERFILLHATCHNAME
:
518 case CTF_PM_HEADERFILLBITMAPNAME
:
519 case CTF_PM_HEADERFILLTRANSNAME
:
521 case CTF_PM_FOOTERFILLGRADIENTNAME
:
522 case CTF_PM_FOOTERFILLHATCHNAME
:
523 case CTF_PM_FOOTERFILLBITMAPNAME
:
524 case CTF_PM_FOOTERFILLTRANSNAME
:
528 if( (pProp
->maValue
>>= aStr
) && 0 == aStr
.getLength() )
537 if (nPrintId
== CTF_PM_PRINTMASK
)
540 lcl_RemoveState(pPrint
);
544 // These entries need to be reduced to a single one for XML export.
545 // Both would be exported as 'draw:tile-repeat-offset' following a percent
546 // value and a 'vertical' or 'horizontal' tag as mark. If both would be active
547 // and both would be exported this would create an XML error (same property twice)
548 if(pRepeatOffsetX
&& pRepeatOffsetY
)
550 sal_Int32
nOffset(0);
552 if((pRepeatOffsetX
->maValue
>>= nOffset
) && (!nOffset
))
554 pRepeatOffsetX
->mnIndex
= -1;
558 pRepeatOffsetY
->mnIndex
= -1;
562 // Same as above for Header
563 if(pHeaderRepeatOffsetX
&& pHeaderRepeatOffsetY
)
565 sal_Int32
nOffset(0);
567 if((pHeaderRepeatOffsetX
->maValue
>>= nOffset
) && (!nOffset
))
569 pHeaderRepeatOffsetX
->mnIndex
= -1;
573 pHeaderRepeatOffsetY
->mnIndex
= -1;
577 // Same as above for Footer
578 if(pFooterRepeatOffsetX
&& pFooterRepeatOffsetY
)
580 sal_Int32
nOffset(0);
582 if((pFooterRepeatOffsetX
->maValue
>>= nOffset
) && (!nOffset
))
584 pFooterRepeatOffsetX
->mnIndex
= -1;
588 pFooterRepeatOffsetY
->mnIndex
= -1;
592 if( pPMStandardMode
&& !getBOOL(pPMStandardMode
->maValue
) )
594 lcl_RemoveState(pPMStandardMode
);
595 if( pPMGridBaseWidth
)
596 lcl_RemoveState(pPMGridBaseWidth
);
597 if( pPMGridSnapToChars
)
598 lcl_RemoveState(pPMGridSnapToChars
);
601 lcl_RemoveState(pPMGridSnapTo
);
605 if( pPMGridBaseWidth
&& pPMStandardMode
)
606 lcl_RemoveState(pPMStandardMode
);
608 aPageBuffer
.ContextFilter( rPropState
);
609 aHeaderBuffer
.ContextFilter( rPropState
);
610 aFooterBuffer
.ContextFilter( rPropState
);
612 if( pPMHeaderHeight
&& (!pPMHeaderDynamic
|| getBOOL( pPMHeaderDynamic
->maValue
)) )
613 lcl_RemoveState( pPMHeaderHeight
);
614 if( pPMHeaderMinHeight
&& pPMHeaderDynamic
&& !getBOOL( pPMHeaderDynamic
->maValue
) )
615 lcl_RemoveState( pPMHeaderMinHeight
);
616 if( pPMHeaderDynamic
)
617 lcl_RemoveState( pPMHeaderDynamic
);
619 if( pPMFooterHeight
&& (!pPMFooterDynamic
|| getBOOL( pPMFooterDynamic
->maValue
)) )
620 lcl_RemoveState( pPMFooterHeight
);
621 if( pPMFooterMinHeight
&& pPMFooterDynamic
&& !getBOOL( pPMFooterDynamic
->maValue
) )
622 lcl_RemoveState( pPMFooterMinHeight
);
623 if( pPMFooterDynamic
)
624 lcl_RemoveState( pPMFooterDynamic
);
627 lcl_RemoveStateIfZero16( pPMScaleTo
);
628 if( pPMScaleToPages
)
629 lcl_RemoveStateIfZero16( pPMScaleToPages
);
631 lcl_RemoveStateIfZero16( pPMScaleToX
);
633 lcl_RemoveStateIfZero16( pPMScaleToY
);
637 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_ANNOTATIONS
), "PrintAnnotations", rPropSet
);
638 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_CHARTS
), "PrintCharts", rPropSet
);
639 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_DRAWING
), "PrintDrawing", rPropSet
);
640 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_FORMULAS
), "PrintFormulas", rPropSet
);
641 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_GRID
), "PrintGrid", rPropSet
);
642 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_HEADERS
), "PrintHeaders", rPropSet
);
643 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_OBJECTS
), "PrintObjects", rPropSet
);
644 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_ZEROVALUES
), "PrintZeroValues", rPropSet
);
647 SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily
, rPropState
, rPropSet
);
650 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */