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/xmlexp.hxx>
23 #include <comphelper/types.hxx>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/table/BorderLine2.hpp>
26 #include <PageMasterStyleMap.hxx>
27 #include <rtl/ref.hxx>
28 #include <comphelper/extract.hxx>
30 using namespace ::com::sun::star
;
31 using namespace ::com::sun::star::uno
;
32 using namespace ::com::sun::star::beans
;
33 using namespace ::comphelper
;
35 static bool lcl_HasSameLineWidth( const table::BorderLine2
& rLine1
, const table::BorderLine2
& rLine2
)
37 return (rLine1
.InnerLineWidth
== rLine2
.InnerLineWidth
) &&
38 (rLine1
.OuterLineWidth
== rLine2
.OuterLineWidth
) &&
39 (rLine1
.LineDistance
== rLine2
.LineDistance
) &&
40 (rLine1
.LineWidth
== rLine2
.LineWidth
);
43 static void lcl_RemoveState( XMLPropertyState
* pState
)
46 pState
->maValue
.clear();
49 static void lcl_RemoveStateIfZero16( XMLPropertyState
* pState
)
51 sal_Int16 nValue
= sal_Int16();
52 if( (pState
->maValue
>>= nValue
) && !nValue
)
53 lcl_RemoveState( pState
);
56 static void lcl_AddState(::std::vector
< XMLPropertyState
>& rPropState
, sal_Int32 nIndex
, const OUString
& rProperty
, const uno::Reference
< beans::XPropertySet
>& xProps
)
58 if(::cppu::any2bool(xProps
->getPropertyValue(rProperty
)))
59 rPropState
.emplace_back(nIndex
, css::uno::Any(true));
62 // helper struct to handle equal XMLPropertyState's for page, header and footer
66 struct XMLPropertyStateBuffer
68 XMLPropertyState
* pPMMarginAll
;
70 XMLPropertyState
* pPMBorderAll
;
71 XMLPropertyState
* pPMBorderTop
;
72 XMLPropertyState
* pPMBorderBottom
;
73 XMLPropertyState
* pPMBorderLeft
;
74 XMLPropertyState
* pPMBorderRight
;
76 XMLPropertyState
* pPMBorderWidthAll
;
77 XMLPropertyState
* pPMBorderWidthTop
;
78 XMLPropertyState
* pPMBorderWidthBottom
;
79 XMLPropertyState
* pPMBorderWidthLeft
;
80 XMLPropertyState
* pPMBorderWidthRight
;
82 XMLPropertyState
* pPMPaddingAll
;
83 XMLPropertyState
* pPMPaddingTop
;
84 XMLPropertyState
* pPMPaddingBottom
;
85 XMLPropertyState
* pPMPaddingLeft
;
86 XMLPropertyState
* pPMPaddingRight
;
88 XMLPropertyState
* pPMMarginGutter
;
89 XMLPropertyState
* pPMMarginLeft
;
90 XMLPropertyState
* pPMRtlGutter
;
91 XMLPropertyState
* pPMMarginRight
;
93 XMLPropertyState
* pPMMarginTop
;
95 XMLPropertyStateBuffer();
96 void ContextFilter( ::std::vector
< XMLPropertyState
>& rPropState
);
101 XMLPropertyStateBuffer::XMLPropertyStateBuffer()
102 : pPMMarginAll( nullptr )
104 pPMBorderAll( nullptr ),
105 pPMBorderTop( nullptr ),
106 pPMBorderBottom( nullptr ),
107 pPMBorderLeft( nullptr ),
108 pPMBorderRight( nullptr ),
110 pPMBorderWidthAll( nullptr ),
111 pPMBorderWidthTop( nullptr ),
112 pPMBorderWidthBottom( nullptr ),
113 pPMBorderWidthLeft( nullptr ),
114 pPMBorderWidthRight( nullptr ),
116 pPMPaddingAll( nullptr ),
117 pPMPaddingTop( nullptr ),
118 pPMPaddingBottom( nullptr ),
119 pPMPaddingLeft( nullptr ),
120 pPMPaddingRight( nullptr ),
122 pPMMarginGutter( nullptr ),
123 pPMMarginLeft( nullptr ),
124 pPMRtlGutter( nullptr ),
125 pPMMarginRight( nullptr ),
126 m_bGutterAtTop( false ),
127 pPMMarginTop( nullptr )
131 void XMLPropertyStateBuffer::ContextFilter( ::std::vector
< XMLPropertyState
>& )
135 sal_Int32 nGutterMargin
{};
136 pPMMarginGutter
->maValue
>>= nGutterMargin
;
139 if (nGutterMargin
&& pPMMarginTop
)
141 // Increase top margin to include gutter.
142 sal_Int32 nTopMargin
{};
143 pPMMarginTop
->maValue
>>= nTopMargin
;
144 nTopMargin
+= nGutterMargin
;
145 pPMMarginTop
->maValue
<<= nTopMargin
;
151 if (nGutterMargin
&& pPMRtlGutter
)
153 pPMRtlGutter
->maValue
>>= bRtlGutter
;
157 if (nGutterMargin
&& pPMMarginRight
)
159 // Increase right margin to include gutter.
160 sal_Int32 nRightMargin
{};
161 pPMMarginRight
->maValue
>>= nRightMargin
;
162 nRightMargin
+= nGutterMargin
;
163 pPMMarginRight
->maValue
<<= nRightMargin
;
168 if (nGutterMargin
&& pPMMarginLeft
)
170 // Increase left margin to include gutter.
171 sal_Int32 nLeftMargin
{};
172 pPMMarginLeft
->maValue
>>= nLeftMargin
;
173 nLeftMargin
+= nGutterMargin
;
174 pPMMarginLeft
->maValue
<<= nLeftMargin
;
182 lcl_RemoveState(pPMMarginAll
); // #i117696# do not write fo:margin
187 if( pPMBorderTop
&& pPMBorderBottom
&& pPMBorderLeft
&& pPMBorderRight
)
189 table::BorderLine2 aLineTop
, aLineBottom
, aLineLeft
, aLineRight
;
191 pPMBorderTop
->maValue
>>= aLineTop
;
192 pPMBorderBottom
->maValue
>>= aLineBottom
;
193 pPMBorderLeft
->maValue
>>= aLineLeft
;
194 pPMBorderRight
->maValue
>>= aLineRight
;
196 if( (aLineTop
== aLineBottom
) && (aLineBottom
== aLineLeft
) && (aLineLeft
== aLineRight
) )
198 lcl_RemoveState( pPMBorderTop
);
199 lcl_RemoveState( pPMBorderBottom
);
200 lcl_RemoveState( pPMBorderLeft
);
201 lcl_RemoveState( pPMBorderRight
);
204 lcl_RemoveState( pPMBorderAll
);
207 lcl_RemoveState( pPMBorderAll
);
210 if( pPMBorderWidthAll
)
212 if( pPMBorderWidthTop
&& pPMBorderWidthBottom
&& pPMBorderWidthLeft
&& pPMBorderWidthRight
)
214 table::BorderLine2 aLineTop
, aLineBottom
, aLineLeft
, aLineRight
;
216 pPMBorderWidthTop
->maValue
>>= aLineTop
;
217 pPMBorderWidthBottom
->maValue
>>= aLineBottom
;
218 pPMBorderWidthLeft
->maValue
>>= aLineLeft
;
219 pPMBorderWidthRight
->maValue
>>= aLineRight
;
221 if( lcl_HasSameLineWidth( aLineTop
, aLineBottom
) &&
222 lcl_HasSameLineWidth( aLineBottom
, aLineLeft
) &&
223 lcl_HasSameLineWidth( aLineLeft
, aLineRight
) )
225 lcl_RemoveState( pPMBorderWidthTop
);
226 lcl_RemoveState( pPMBorderWidthBottom
);
227 lcl_RemoveState( pPMBorderWidthLeft
);
228 lcl_RemoveState( pPMBorderWidthRight
);
231 lcl_RemoveState( pPMBorderWidthAll
);
234 lcl_RemoveState( pPMBorderWidthAll
);
240 if( pPMPaddingTop
&& pPMPaddingBottom
&& pPMPaddingLeft
&& pPMPaddingRight
)
242 sal_Int32 nTop
= 0, nBottom
= 0, nLeft
= 0, nRight
= 0;
244 pPMPaddingTop
->maValue
>>= nTop
;
245 pPMPaddingBottom
->maValue
>>= nBottom
;
246 pPMPaddingLeft
->maValue
>>= nLeft
;
247 pPMPaddingRight
->maValue
>>= nRight
;
249 if( (nTop
== nBottom
) && (nBottom
== nLeft
) && (nLeft
== nRight
) )
251 lcl_RemoveState( pPMPaddingTop
);
252 lcl_RemoveState( pPMPaddingBottom
);
253 lcl_RemoveState( pPMPaddingLeft
);
254 lcl_RemoveState( pPMPaddingRight
);
257 lcl_RemoveState( pPMPaddingAll
);
260 lcl_RemoveState( pPMPaddingAll
);
263 XMLPageMasterExportPropMapper::XMLPageMasterExportPropMapper(
264 const rtl::Reference
< XMLPropertySetMapper
>& rMapper
,
265 SvXMLExport
& rExport
) :
266 SvXMLExportPropertyMapper( rMapper
),
267 aBackgroundImageExport( rExport
),
268 aTextColumnsExport( rExport
),
269 aFootnoteSeparatorExport( rExport
)
273 XMLPageMasterExportPropMapper::~XMLPageMasterExportPropMapper()
277 void XMLPageMasterExportPropMapper::handleElementItem(
279 const XMLPropertyState
& rProperty
,
280 SvXmlExportFlags
/*nFlags*/,
281 const ::std::vector
< XMLPropertyState
>* pProperties
,
282 sal_uInt32 nIdx
) const
284 XMLPageMasterExportPropMapper
* pThis
= const_cast<XMLPageMasterExportPropMapper
*>(this);
286 sal_uInt32 nContextId
= getPropertySetMapper()->GetEntryContextId( rProperty
.mnIndex
);
289 case CTF_PM_GRAPHICURL
:
290 case CTF_PM_HEADERGRAPHICURL
:
291 case CTF_PM_FOOTERGRAPHICURL
:
294 assert(nIdx
>= 2 && "horrible array ordering borked again");
296 sal_Int32
nFilter(-1);
299 case CTF_PM_GRAPHICURL
:
300 nPos
= CTF_PM_GRAPHICPOSITION
;
301 nFilter
= CTF_PM_GRAPHICFILTER
;
303 case CTF_PM_HEADERGRAPHICURL
:
304 nPos
= CTF_PM_HEADERGRAPHICPOSITION
;
305 nFilter
= CTF_PM_HEADERGRAPHICFILTER
;
307 case CTF_PM_FOOTERGRAPHICURL
:
308 nPos
= CTF_PM_FOOTERGRAPHICPOSITION
;
309 nFilter
= CTF_PM_FOOTERGRAPHICFILTER
;
314 const Any
* pPos
= nullptr;
315 const Any
* pFilter
= nullptr;
316 sal_uInt32
nIndex(nIdx
- 1);
317 const XMLPropertyState
& rFilter
= (*pProperties
)[nIndex
];
318 if (getPropertySetMapper()->GetEntryContextId(rFilter
.mnIndex
) == nFilter
)
320 pFilter
= &rFilter
.maValue
;
323 const XMLPropertyState
& rPos
= (*pProperties
)[nIndex
];
324 if (getPropertySetMapper()->GetEntryContextId(rPos
.mnIndex
) == nPos
)
326 pPos
= &rPos
.maValue
;
329 sal_uInt32 nPropIndex
= rProperty
.mnIndex
;
330 pThis
->aBackgroundImageExport
.exportXML( rProperty
.maValue
, pPos
, pFilter
, nullptr,
331 getPropertySetMapper()->GetEntryNameSpace( nPropIndex
),
332 getPropertySetMapper()->GetEntryXMLName( nPropIndex
) );
335 case CTF_PM_TEXTCOLUMNS
:
336 pThis
->aTextColumnsExport
.exportXML( rProperty
.maValue
);
338 case CTF_PM_FTN_LINE_WEIGHT
:
339 pThis
->aFootnoteSeparatorExport
.exportXML( pProperties
, nIdx
,
340 getPropertySetMapper());
345 void XMLPageMasterExportPropMapper::handleSpecialItem(
346 comphelper::AttributeList
&,
347 const XMLPropertyState
&,
348 const SvXMLUnitConverter
&,
349 const SvXMLNamespaceMap
&,
350 const ::std::vector
< XMLPropertyState
>*,
351 sal_uInt32
/*nIdx*/) const
355 void XMLPageMasterExportPropMapper::ContextFilter(
356 bool bEnableFoFontFamily
,
357 ::std::vector
< XMLPropertyState
>& rPropState
,
358 const Reference
< XPropertySet
>& rPropSet
) const
360 XMLPropertyStateBuffer aPageBuffer
;
363 aPageBuffer
.m_bGutterAtTop
= true;
366 XMLPropertyStateBuffer aHeaderBuffer
;
367 XMLPropertyStateBuffer aFooterBuffer
;
369 XMLPropertyState
* pPMHeaderHeight
= nullptr;
370 XMLPropertyState
* pPMHeaderMinHeight
= nullptr;
371 XMLPropertyState
* pPMHeaderDynamic
= nullptr;
373 XMLPropertyState
* pPMFooterHeight
= nullptr;
374 XMLPropertyState
* pPMFooterMinHeight
= nullptr;
375 XMLPropertyState
* pPMFooterDynamic
= nullptr;
377 XMLPropertyState
* pPMScaleTo
= nullptr;
378 XMLPropertyState
* pPMScaleToPages
= nullptr;
379 XMLPropertyState
* pPMScaleToX
= nullptr;
380 XMLPropertyState
* pPMScaleToY
= nullptr;
381 XMLPropertyState
* pPMStandardMode
= nullptr;
382 XMLPropertyState
* pPMGridBaseWidth
= nullptr;
383 // same as pPMGridSnapTo but for backward compatibility only
384 XMLPropertyState
* pPMGridSnapToChars
= nullptr;
385 XMLPropertyState
* pPMGridSnapTo
= nullptr;
387 XMLPropertyState
* pPrint
= nullptr;
389 XMLPropertyState
* pRepeatOffsetX
= nullptr;
390 XMLPropertyState
* pRepeatOffsetY
= nullptr;
391 XMLPropertyState
* pHeaderRepeatOffsetX
= nullptr;
392 XMLPropertyState
* pHeaderRepeatOffsetY
= nullptr;
393 XMLPropertyState
* pFooterRepeatOffsetX
= nullptr;
394 XMLPropertyState
* pFooterRepeatOffsetY
= nullptr;
396 rtl::Reference
< XMLPropertySetMapper
> aPropMapper(getPropertySetMapper());
398 // distinguish 2 cases: drawing-page export has CTF_PM_FILL, page-layout-properties export does not
399 bool const isDrawingPageExport(aPropMapper
->FindEntryIndex(CTF_PM_FILL
) != -1);
401 for( auto& rProp
: rPropState
)
403 XMLPropertyState
*pProp
= &rProp
;
404 sal_Int16 nContextId
= aPropMapper
->GetEntryContextId( pProp
->mnIndex
);
405 sal_Int16 nFlag
= nContextId
& CTF_PM_FLAGMASK
;
406 sal_Int16 nSimpleId
= nContextId
& (~CTF_PM_FLAGMASK
| XML_PM_CTF_START
);
407 sal_Int16 nPrintId
= nContextId
& CTF_PM_PRINTMASK
;
410 // tdf#103602 don't export draw:fill attributes on page-layout-properties in strict ODF
411 if (!isDrawingPageExport
412 && [](OUString
const& rName
) -> bool {
413 return rName
.startsWith("Fill")
414 || rName
.startsWith("HeaderFill")
415 || rName
.startsWith("FooterFill");
416 } (aPropMapper
->GetEntryAPIName(rProp
.mnIndex
))
417 && ((aBackgroundImageExport
.GetExport().getSaneDefaultVersion()
418 & SvtSaveOptions::ODFSVER_EXTENDED
) == 0))
420 lcl_RemoveState(&rProp
);
424 XMLPropertyStateBuffer
* pBuffer
;
427 case CTF_PM_HEADERFLAG
: pBuffer
= &aHeaderBuffer
; break;
428 case CTF_PM_FOOTERFLAG
: pBuffer
= &aFooterBuffer
; break;
429 default: pBuffer
= &aPageBuffer
; break;
434 case CTF_PM_MARGINALL
: pBuffer
->pPMMarginAll
= pProp
; break;
435 case CTF_PM_BORDERALL
: pBuffer
->pPMBorderAll
= pProp
; break;
436 case CTF_PM_BORDERTOP
: pBuffer
->pPMBorderTop
= pProp
; break;
437 case CTF_PM_BORDERBOTTOM
: pBuffer
->pPMBorderBottom
= pProp
; break;
438 case CTF_PM_BORDERLEFT
: pBuffer
->pPMBorderLeft
= pProp
; break;
439 case CTF_PM_BORDERRIGHT
: pBuffer
->pPMBorderRight
= pProp
; break;
440 case CTF_PM_BORDERWIDTHALL
: pBuffer
->pPMBorderWidthAll
= pProp
; break;
441 case CTF_PM_BORDERWIDTHTOP
: pBuffer
->pPMBorderWidthTop
= pProp
; break;
442 case CTF_PM_BORDERWIDTHBOTTOM
: pBuffer
->pPMBorderWidthBottom
= pProp
; break;
443 case CTF_PM_BORDERWIDTHLEFT
: pBuffer
->pPMBorderWidthLeft
= pProp
; break;
444 case CTF_PM_BORDERWIDTHRIGHT
: pBuffer
->pPMBorderWidthRight
= pProp
; break;
445 case CTF_PM_PADDINGALL
: pBuffer
->pPMPaddingAll
= pProp
; break;
446 case CTF_PM_PADDINGTOP
: pBuffer
->pPMPaddingTop
= pProp
; break;
447 case CTF_PM_PADDINGBOTTOM
: pBuffer
->pPMPaddingBottom
= pProp
; break;
448 case CTF_PM_PADDINGLEFT
: pBuffer
->pPMPaddingLeft
= pProp
; break;
449 case CTF_PM_PADDINGRIGHT
: pBuffer
->pPMPaddingRight
= pProp
; break;
450 case CTF_PM_MARGINGUTTER
:
451 pBuffer
->pPMMarginGutter
= pProp
;
453 case CTF_PM_MARGINLEFT
:
454 pBuffer
->pPMMarginLeft
= pProp
;
456 case CTF_PM_RTLGUTTER
:
457 pBuffer
->pPMRtlGutter
= pProp
;
459 case CTF_PM_MARGINRIGHT
:
460 pBuffer
->pPMMarginRight
= pProp
;
462 case CTF_PM_MARGINTOP
:
463 pBuffer
->pPMMarginTop
= pProp
;
469 case CTF_PM_HEADERHEIGHT
: pPMHeaderHeight
= pProp
; break;
470 case CTF_PM_HEADERMINHEIGHT
: pPMHeaderMinHeight
= pProp
; break;
471 case CTF_PM_HEADERDYNAMIC
: pPMHeaderDynamic
= pProp
; break;
472 case CTF_PM_FOOTERHEIGHT
: pPMFooterHeight
= pProp
; break;
473 case CTF_PM_FOOTERMINHEIGHT
: pPMFooterMinHeight
= pProp
; break;
474 case CTF_PM_FOOTERDYNAMIC
: pPMFooterDynamic
= pProp
; break;
475 case CTF_PM_SCALETO
: pPMScaleTo
= pProp
; break;
476 case CTF_PM_SCALETOPAGES
: pPMScaleToPages
= pProp
; break;
477 case CTF_PM_SCALETOX
: pPMScaleToX
= pProp
; break;
478 case CTF_PM_SCALETOY
: pPMScaleToY
= pProp
; break;
479 case CTF_PM_STANDARD_MODE
: pPMStandardMode
= pProp
; break;
480 case CTP_PM_GRID_BASE_WIDTH
: pPMGridBaseWidth
= pProp
; break;
481 case CTP_PM_GRID_SNAP_TO_CHARS
: pPMGridSnapToChars
= pProp
; break;
482 case CTP_PM_GRID_SNAP_TO
: pPMGridSnapTo
= pProp
; break;
484 case CTF_PM_REPEAT_OFFSET_X
:
485 pRepeatOffsetX
= pProp
;
488 case CTF_PM_REPEAT_OFFSET_Y
:
489 pRepeatOffsetY
= pProp
;
492 case CTF_PM_HEADERREPEAT_OFFSET_X
:
493 pHeaderRepeatOffsetX
= pProp
;
496 case CTF_PM_HEADERREPEAT_OFFSET_Y
:
497 pHeaderRepeatOffsetY
= pProp
;
500 case CTF_PM_FOOTERREPEAT_OFFSET_X
:
501 pFooterRepeatOffsetX
= pProp
;
504 case CTF_PM_FOOTERREPEAT_OFFSET_Y
:
505 pFooterRepeatOffsetY
= pProp
;
508 // Sort out empty entries
509 case CTF_PM_FILLGRADIENTNAME
:
510 case CTF_PM_FILLHATCHNAME
:
511 case CTF_PM_FILLBITMAPNAME
:
512 case CTF_PM_FILLTRANSNAME
:
514 case CTF_PM_HEADERFILLGRADIENTNAME
:
515 case CTF_PM_HEADERFILLHATCHNAME
:
516 case CTF_PM_HEADERFILLBITMAPNAME
:
517 case CTF_PM_HEADERFILLTRANSNAME
:
519 case CTF_PM_FOOTERFILLGRADIENTNAME
:
520 case CTF_PM_FOOTERFILLHATCHNAME
:
521 case CTF_PM_FOOTERFILLBITMAPNAME
:
522 case CTF_PM_FOOTERFILLTRANSNAME
:
526 if( (pProp
->maValue
>>= aStr
) && 0 == aStr
.getLength() )
535 if (nPrintId
== CTF_PM_PRINTMASK
)
538 lcl_RemoveState(pPrint
);
542 // These entries need to be reduced to a single one for XML export.
543 // Both would be exported as 'draw:tile-repeat-offset' following a percent
544 // value and a 'vertical' or 'horizontal' tag as mark. If both would be active
545 // and both would be exported this would create an XML error (same property twice)
546 if(pRepeatOffsetX
&& pRepeatOffsetY
)
548 sal_Int32
nOffset(0);
550 if((pRepeatOffsetX
->maValue
>>= nOffset
) && (!nOffset
))
552 pRepeatOffsetX
->mnIndex
= -1;
556 pRepeatOffsetY
->mnIndex
= -1;
560 // Same as above for Header
561 if(pHeaderRepeatOffsetX
&& pHeaderRepeatOffsetY
)
563 sal_Int32
nOffset(0);
565 if((pHeaderRepeatOffsetX
->maValue
>>= nOffset
) && (!nOffset
))
567 pHeaderRepeatOffsetX
->mnIndex
= -1;
571 pHeaderRepeatOffsetY
->mnIndex
= -1;
575 // Same as above for Footer
576 if(pFooterRepeatOffsetX
&& pFooterRepeatOffsetY
)
578 sal_Int32
nOffset(0);
580 if((pFooterRepeatOffsetX
->maValue
>>= nOffset
) && (!nOffset
))
582 pFooterRepeatOffsetX
->mnIndex
= -1;
586 pFooterRepeatOffsetY
->mnIndex
= -1;
590 if( pPMStandardMode
&& !getBOOL(pPMStandardMode
->maValue
) )
592 lcl_RemoveState(pPMStandardMode
);
593 if( pPMGridBaseWidth
)
594 lcl_RemoveState(pPMGridBaseWidth
);
595 if( pPMGridSnapToChars
)
596 lcl_RemoveState(pPMGridSnapToChars
);
599 lcl_RemoveState(pPMGridSnapTo
);
603 if( pPMGridBaseWidth
&& pPMStandardMode
)
604 lcl_RemoveState(pPMStandardMode
);
606 aPageBuffer
.ContextFilter( rPropState
);
607 aHeaderBuffer
.ContextFilter( rPropState
);
608 aFooterBuffer
.ContextFilter( rPropState
);
610 if( pPMHeaderHeight
&& (!pPMHeaderDynamic
|| getBOOL( pPMHeaderDynamic
->maValue
)) )
611 lcl_RemoveState( pPMHeaderHeight
);
612 if( pPMHeaderMinHeight
&& pPMHeaderDynamic
&& !getBOOL( pPMHeaderDynamic
->maValue
) )
613 lcl_RemoveState( pPMHeaderMinHeight
);
614 if( pPMHeaderDynamic
)
615 lcl_RemoveState( pPMHeaderDynamic
);
617 if( pPMFooterHeight
&& (!pPMFooterDynamic
|| getBOOL( pPMFooterDynamic
->maValue
)) )
618 lcl_RemoveState( pPMFooterHeight
);
619 if( pPMFooterMinHeight
&& pPMFooterDynamic
&& !getBOOL( pPMFooterDynamic
->maValue
) )
620 lcl_RemoveState( pPMFooterMinHeight
);
621 if( pPMFooterDynamic
)
622 lcl_RemoveState( pPMFooterDynamic
);
625 lcl_RemoveStateIfZero16( pPMScaleTo
);
626 if( pPMScaleToPages
)
627 lcl_RemoveStateIfZero16( pPMScaleToPages
);
629 lcl_RemoveStateIfZero16( pPMScaleToX
);
631 lcl_RemoveStateIfZero16( pPMScaleToY
);
635 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_ANNOTATIONS
), u
"PrintAnnotations"_ustr
, rPropSet
);
636 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_CHARTS
), u
"PrintCharts"_ustr
, rPropSet
);
637 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_DRAWING
), u
"PrintDrawing"_ustr
, rPropSet
);
638 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_FORMULAS
), u
"PrintFormulas"_ustr
, rPropSet
);
639 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_GRID
), u
"PrintGrid"_ustr
, rPropSet
);
640 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_HEADERS
), u
"PrintHeaders"_ustr
, rPropSet
);
641 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_OBJECTS
), u
"PrintObjects"_ustr
, rPropSet
);
642 lcl_AddState(rPropState
, aPropMapper
->FindEntryIndex(CTF_PM_PRINT_ZEROVALUES
), u
"PrintZeroValues"_ustr
, rPropSet
);
645 SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily
, rPropState
, rPropSet
);
648 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */