LibreOffice Module xmloff (master)  1
PageMasterExportPropMapper.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
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>
30 
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;
36 
37 static bool lcl_HasSameLineWidth( const table::BorderLine2& rLine1, const table::BorderLine2& rLine2 )
38 {
39  return (rLine1.InnerLineWidth == rLine2.InnerLineWidth) &&
40  (rLine1.OuterLineWidth == rLine2.OuterLineWidth) &&
41  (rLine1.LineDistance == rLine2.LineDistance) &&
42  (rLine1.LineWidth == rLine2.LineWidth);
43 }
44 
45 static void lcl_RemoveState( XMLPropertyState* pState )
46 {
47  pState->mnIndex = -1;
48  pState->maValue.clear();
49 }
50 
52 {
53  sal_Int16 nValue = sal_Int16();
54  if( (pState->maValue >>= nValue) && !nValue )
55  lcl_RemoveState( pState );
56 }
57 
58 static void lcl_AddState(::std::vector< XMLPropertyState >& rPropState, sal_Int32 nIndex, const OUString& rProperty, const uno::Reference< beans::XPropertySet >& xProps)
59 {
60  if(::cppu::any2bool(xProps->getPropertyValue(rProperty)))
61  rPropState.emplace_back(nIndex, css::uno::Any(true));
62 }
63 
64 // helper struct to handle equal XMLPropertyState's for page, header and footer
65 
66 namespace {
67 
68 struct XMLPropertyStateBuffer
69 {
70  XMLPropertyState* pPMMarginAll;
71 
72  XMLPropertyState* pPMBorderAll;
73  XMLPropertyState* pPMBorderTop;
74  XMLPropertyState* pPMBorderBottom;
75  XMLPropertyState* pPMBorderLeft;
76  XMLPropertyState* pPMBorderRight;
77 
78  XMLPropertyState* pPMBorderWidthAll;
79  XMLPropertyState* pPMBorderWidthTop;
80  XMLPropertyState* pPMBorderWidthBottom;
81  XMLPropertyState* pPMBorderWidthLeft;
82  XMLPropertyState* pPMBorderWidthRight;
83 
84  XMLPropertyState* pPMPaddingAll;
85  XMLPropertyState* pPMPaddingTop;
86  XMLPropertyState* pPMPaddingBottom;
87  XMLPropertyState* pPMPaddingLeft;
88  XMLPropertyState* pPMPaddingRight;
89 
90  XMLPropertyState* pPMMarginGutter;
91  XMLPropertyState* pPMMarginLeft;
92  XMLPropertyState* pPMRtlGutter;
93  XMLPropertyState* pPMMarginRight;
94  bool m_bGutterAtTop;
95  XMLPropertyState* pPMMarginTop;
96 
97  XMLPropertyStateBuffer();
98  void ContextFilter( ::std::vector< XMLPropertyState >& rPropState );
99 };
100 
101 }
102 
103 XMLPropertyStateBuffer::XMLPropertyStateBuffer()
104  : pPMMarginAll( nullptr )
105  ,
106  pPMBorderAll( nullptr ),
107  pPMBorderTop( nullptr ),
108  pPMBorderBottom( nullptr ),
109  pPMBorderLeft( nullptr ),
110  pPMBorderRight( nullptr ),
111 
112  pPMBorderWidthAll( nullptr ),
113  pPMBorderWidthTop( nullptr ),
114  pPMBorderWidthBottom( nullptr ),
115  pPMBorderWidthLeft( nullptr ),
116  pPMBorderWidthRight( nullptr ),
117 
118  pPMPaddingAll( nullptr ),
119  pPMPaddingTop( nullptr ),
120  pPMPaddingBottom( nullptr ),
121  pPMPaddingLeft( nullptr ),
122  pPMPaddingRight( nullptr ),
123 
124  pPMMarginGutter( nullptr ),
125  pPMMarginLeft( nullptr ),
126  pPMRtlGutter( nullptr ),
127  pPMMarginRight( nullptr ),
128  m_bGutterAtTop( false ),
129  pPMMarginTop( nullptr )
130 {
131 }
132 
133 void XMLPropertyStateBuffer::ContextFilter( ::std::vector< XMLPropertyState >& )
134 {
135  if (pPMMarginGutter)
136  {
137  sal_Int32 nGutterMargin{};
138  pPMMarginGutter->maValue >>= nGutterMargin;
139  if (m_bGutterAtTop)
140  {
141  if (nGutterMargin && pPMMarginTop)
142  {
143  // Increase top margin to include gutter.
144  sal_Int32 nTopMargin{};
145  pPMMarginTop->maValue >>= nTopMargin;
146  nTopMargin += nGutterMargin;
147  pPMMarginTop->maValue <<= nTopMargin;
148  }
149  }
150  else
151  {
152  bool bRtlGutter{};
153  if (nGutterMargin && pPMRtlGutter)
154  {
155  pPMRtlGutter->maValue >>= bRtlGutter;
156  }
157  if (bRtlGutter)
158  {
159  if (nGutterMargin && pPMMarginRight)
160  {
161  // Increase right margin to include gutter.
162  sal_Int32 nRightMargin{};
163  pPMMarginRight->maValue >>= nRightMargin;
164  nRightMargin += nGutterMargin;
165  pPMMarginRight->maValue <<= nRightMargin;
166  }
167  }
168  else
169  {
170  if (nGutterMargin && pPMMarginLeft)
171  {
172  // Increase left margin to include gutter.
173  sal_Int32 nLeftMargin{};
174  pPMMarginLeft->maValue >>= nLeftMargin;
175  nLeftMargin += nGutterMargin;
176  pPMMarginLeft->maValue <<= nLeftMargin;
177  }
178  }
179  }
180  }
181 
182  if (pPMMarginAll)
183  {
184  lcl_RemoveState(pPMMarginAll); // #i117696# do not write fo:margin
185  }
186 
187  if( pPMBorderAll )
188  {
189  if( pPMBorderTop && pPMBorderBottom && pPMBorderLeft && pPMBorderRight )
190  {
191  table::BorderLine2 aLineTop, aLineBottom, aLineLeft, aLineRight;
192 
193  pPMBorderTop->maValue >>= aLineTop;
194  pPMBorderBottom->maValue >>= aLineBottom;
195  pPMBorderLeft->maValue >>= aLineLeft;
196  pPMBorderRight->maValue >>= aLineRight;
197 
198  if( (aLineTop == aLineBottom) && (aLineBottom == aLineLeft) && (aLineLeft == aLineRight) )
199  {
200  lcl_RemoveState( pPMBorderTop );
201  lcl_RemoveState( pPMBorderBottom );
202  lcl_RemoveState( pPMBorderLeft );
203  lcl_RemoveState( pPMBorderRight );
204  }
205  else
206  lcl_RemoveState( pPMBorderAll );
207  }
208  else
209  lcl_RemoveState( pPMBorderAll );
210  }
211 
212  if( pPMBorderWidthAll )
213  {
214  if( pPMBorderWidthTop && pPMBorderWidthBottom && pPMBorderWidthLeft && pPMBorderWidthRight )
215  {
216  table::BorderLine2 aLineTop, aLineBottom, aLineLeft, aLineRight;
217 
218  pPMBorderWidthTop->maValue >>= aLineTop;
219  pPMBorderWidthBottom->maValue >>= aLineBottom;
220  pPMBorderWidthLeft->maValue >>= aLineLeft;
221  pPMBorderWidthRight->maValue >>= aLineRight;
222 
223  if( lcl_HasSameLineWidth( aLineTop, aLineBottom ) &&
224  lcl_HasSameLineWidth( aLineBottom, aLineLeft ) &&
225  lcl_HasSameLineWidth( aLineLeft, aLineRight ) )
226  {
227  lcl_RemoveState( pPMBorderWidthTop );
228  lcl_RemoveState( pPMBorderWidthBottom );
229  lcl_RemoveState( pPMBorderWidthLeft );
230  lcl_RemoveState( pPMBorderWidthRight );
231  }
232  else
233  lcl_RemoveState( pPMBorderWidthAll );
234  }
235  else
236  lcl_RemoveState( pPMBorderWidthAll );
237  }
238 
239  if( !pPMPaddingAll )
240  return;
241 
242  if( pPMPaddingTop && pPMPaddingBottom && pPMPaddingLeft && pPMPaddingRight )
243  {
244  sal_Int32 nTop = 0, nBottom = 0, nLeft = 0, nRight = 0;
245 
246  pPMPaddingTop->maValue >>= nTop;
247  pPMPaddingBottom->maValue >>= nBottom;
248  pPMPaddingLeft->maValue >>= nLeft;
249  pPMPaddingRight->maValue >>= nRight;
250 
251  if( (nTop == nBottom) && (nBottom == nLeft) && (nLeft == nRight) )
252  {
253  lcl_RemoveState( pPMPaddingTop );
254  lcl_RemoveState( pPMPaddingBottom );
255  lcl_RemoveState( pPMPaddingLeft );
256  lcl_RemoveState( pPMPaddingRight );
257  }
258  else
259  lcl_RemoveState( pPMPaddingAll );
260  }
261  else
262  lcl_RemoveState( pPMPaddingAll );
263 }
264 
267  SvXMLExport& rExport ) :
268  SvXMLExportPropertyMapper( rMapper ),
269  aBackgroundImageExport( rExport ),
270  aTextColumnsExport( rExport ),
271  aFootnoteSeparatorExport( rExport )
272 {
273 }
274 
276 {
277 }
278 
280  SvXMLExport&,
281  const XMLPropertyState& rProperty,
282  SvXmlExportFlags /*nFlags*/,
283  const ::std::vector< XMLPropertyState >* pProperties,
284  sal_uInt32 nIdx ) const
285 {
287 
288  sal_uInt32 nContextId = getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex );
289  switch( nContextId )
290  {
291  case CTF_PM_GRAPHICURL:
294  {
295  assert(pProperties);
296  assert(nIdx >= 2 && "horrible array ordering borked again");
297  sal_Int32 nPos(-1);
298  sal_Int32 nFilter(-1);
299  switch( nContextId )
300  {
301  case CTF_PM_GRAPHICURL:
302  nPos = CTF_PM_GRAPHICPOSITION;
303  nFilter = CTF_PM_GRAPHICFILTER;
304  break;
307  nFilter = CTF_PM_HEADERGRAPHICFILTER;
308  break;
311  nFilter = CTF_PM_FOOTERGRAPHICFILTER;
312  break;
313  default:
314  assert(false);
315  }
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)
321  {
322  pFilter = &rFilter.maValue;
323  --nIndex;
324  }
325  const XMLPropertyState& rPos = (*pProperties)[nIndex];
326  if (getPropertySetMapper()->GetEntryContextId(rPos.mnIndex) == nPos)
327  {
328  pPos = &rPos.maValue;
329  --nIndex;
330  }
331  sal_uInt32 nPropIndex = rProperty.mnIndex;
332  pThis->aBackgroundImageExport.exportXML( rProperty.maValue, pPos, pFilter, nullptr,
333  getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
334  getPropertySetMapper()->GetEntryXMLName( nPropIndex ) );
335  }
336  break;
337  case CTF_PM_TEXTCOLUMNS:
338  pThis->aTextColumnsExport.exportXML( rProperty.maValue );
339  break;
341  pThis->aFootnoteSeparatorExport.exportXML( pProperties, nIdx,
343  break;
344  }
345 }
346 
349  const XMLPropertyState&,
350  const SvXMLUnitConverter&,
351  const SvXMLNamespaceMap&,
352  const ::std::vector< XMLPropertyState >*,
353  sal_uInt32 /*nIdx*/) const
354 {
355 }
356 
358  bool bEnableFoFontFamily,
359  ::std::vector< XMLPropertyState >& rPropState,
360  const Reference< XPropertySet >& rPropSet ) const
361 {
362  XMLPropertyStateBuffer aPageBuffer;
363  if (m_bGutterAtTop)
364  {
365  aPageBuffer.m_bGutterAtTop = true;
366  }
367 
368  XMLPropertyStateBuffer aHeaderBuffer;
369  XMLPropertyStateBuffer aFooterBuffer;
370 
371  XMLPropertyState* pPMHeaderHeight = nullptr;
372  XMLPropertyState* pPMHeaderMinHeight = nullptr;
373  XMLPropertyState* pPMHeaderDynamic = nullptr;
374 
375  XMLPropertyState* pPMFooterHeight = nullptr;
376  XMLPropertyState* pPMFooterMinHeight = nullptr;
377  XMLPropertyState* pPMFooterDynamic = nullptr;
378 
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;
388 
389  XMLPropertyState* pPrint = nullptr;
390 
391  XMLPropertyState* pRepeatOffsetX = nullptr;
392  XMLPropertyState* pRepeatOffsetY = nullptr;
393  XMLPropertyState* pHeaderRepeatOffsetX = nullptr;
394  XMLPropertyState* pHeaderRepeatOffsetY = nullptr;
395  XMLPropertyState* pFooterRepeatOffsetX = nullptr;
396  XMLPropertyState* pFooterRepeatOffsetY = nullptr;
397 
399 
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);
402 
403  for( auto& rProp : rPropState )
404  {
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;
410 
411 
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))
421  {
422  lcl_RemoveState(&rProp);
423  continue;
424  }
425 
426  XMLPropertyStateBuffer* pBuffer;
427  switch( nFlag )
428  {
429  case CTF_PM_HEADERFLAG: pBuffer = &aHeaderBuffer; break;
430  case CTF_PM_FOOTERFLAG: pBuffer = &aFooterBuffer; break;
431  default: pBuffer = &aPageBuffer; break;
432  }
433 
434  switch( nSimpleId )
435  {
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;
454  break;
455  case CTF_PM_MARGINLEFT:
456  pBuffer->pPMMarginLeft = pProp;
457  break;
458  case CTF_PM_RTLGUTTER:
459  pBuffer->pPMRtlGutter = pProp;
460  break;
461  case CTF_PM_MARGINRIGHT:
462  pBuffer->pPMMarginRight = pProp;
463  break;
464  case CTF_PM_MARGINTOP:
465  pBuffer->pPMMarginTop = pProp;
466  break;
467  }
468 
469  switch( nContextId )
470  {
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;
485 
487  pRepeatOffsetX = pProp;
488  break;
489 
491  pRepeatOffsetY = pProp;
492  break;
493 
495  pHeaderRepeatOffsetX = pProp;
496  break;
497 
499  pHeaderRepeatOffsetY = pProp;
500  break;
501 
503  pFooterRepeatOffsetX = pProp;
504  break;
505 
507  pFooterRepeatOffsetY = pProp;
508  break;
509 
510  // Sort out empty entries
515 
520 
525  {
526  OUString aStr;
527 
528  if( (pProp->maValue >>= aStr) && 0 == aStr.getLength() )
529  {
530  pProp->mnIndex = -1;
531  }
532 
533  break;
534  }
535  }
536 
537  if (nPrintId == CTF_PM_PRINTMASK)
538  {
539  pPrint = pProp;
540  lcl_RemoveState(pPrint);
541  }
542  }
543 
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)
549  {
550  sal_Int32 nOffset(0);
551 
552  if((pRepeatOffsetX->maValue >>= nOffset) && (!nOffset))
553  {
554  pRepeatOffsetX->mnIndex = -1;
555  }
556  else
557  {
558  pRepeatOffsetY->mnIndex = -1;
559  }
560  }
561 
562  // Same as above for Header
563  if(pHeaderRepeatOffsetX && pHeaderRepeatOffsetY)
564  {
565  sal_Int32 nOffset(0);
566 
567  if((pHeaderRepeatOffsetX->maValue >>= nOffset) && (!nOffset))
568  {
569  pHeaderRepeatOffsetX->mnIndex = -1;
570  }
571  else
572  {
573  pHeaderRepeatOffsetY->mnIndex = -1;
574  }
575  }
576 
577  // Same as above for Footer
578  if(pFooterRepeatOffsetX && pFooterRepeatOffsetY)
579  {
580  sal_Int32 nOffset(0);
581 
582  if((pFooterRepeatOffsetX->maValue >>= nOffset) && (!nOffset))
583  {
584  pFooterRepeatOffsetX->mnIndex = -1;
585  }
586  else
587  {
588  pFooterRepeatOffsetY->mnIndex = -1;
589  }
590  }
591 
592  if( pPMStandardMode && !getBOOL(pPMStandardMode->maValue) )
593  {
594  lcl_RemoveState(pPMStandardMode);
595  if( pPMGridBaseWidth )
596  lcl_RemoveState(pPMGridBaseWidth);
597  if( pPMGridSnapToChars )
598  lcl_RemoveState(pPMGridSnapToChars);
599  if (pPMGridSnapTo)
600  {
601  lcl_RemoveState(pPMGridSnapTo);
602  }
603  }
604 
605  if( pPMGridBaseWidth && pPMStandardMode )
606  lcl_RemoveState(pPMStandardMode);
607 
608  aPageBuffer.ContextFilter( rPropState );
609  aHeaderBuffer.ContextFilter( rPropState );
610  aFooterBuffer.ContextFilter( rPropState );
611 
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 );
618 
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 );
625 
626  if( pPMScaleTo )
627  lcl_RemoveStateIfZero16( pPMScaleTo );
628  if( pPMScaleToPages )
629  lcl_RemoveStateIfZero16( pPMScaleToPages );
630  if( pPMScaleToX )
631  lcl_RemoveStateIfZero16( pPMScaleToX );
632  if( pPMScaleToY )
633  lcl_RemoveStateIfZero16( pPMScaleToY );
634 
635  if (pPrint)
636  {
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);
645  }
646 
647  SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily, rPropState, rPropSet);
648 }
649 
650 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define CTF_PM_HEADERGRAPHICPOSITION
#define CTP_PM_GRID_SNAP_TO_CHARS
#define CTF_PM_HEADERHEIGHT
#define CTF_PM_HEADERFILLTRANSNAME
#define CTF_PM_FOOTERDYNAMIC
#define CTF_PM_RTLGUTTER
#define CTF_PM_FLAGMASK
sal_Int32 nIndex
#define CTF_PM_FILLGRADIENTNAME
#define CTF_PM_HEADERFILLHATCHNAME
#define CTF_PM_PADDINGTOP
XMLBackgroundImageExport aBackgroundImageExport
#define CTF_PM_FOOTERREPEAT_OFFSET_Y
virtual void ContextFilter(bool bEnableFoFontFamily,::std::vector< XMLPropertyState > &rProperties, const css::uno::Reference< css::beans::XPropertySet > &rPropSet) const override
Application-specific filter.
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:82
#define CTF_PM_HEADERFILLBITMAPNAME
static void lcl_AddState(::std::vector< XMLPropertyState > &rPropState, sal_Int32 nIndex, const OUString &rProperty, const uno::Reference< beans::XPropertySet > &xProps)
XMLFootnoteSeparatorExport aFootnoteSeparatorExport
tools::Long const nLeftMargin
#define CTF_PM_FTN_LINE_WEIGHT
SvXMLExport & GetExport() const
static bool lcl_HasSameLineWidth(const table::BorderLine2 &rLine1, const table::BorderLine2 &rLine2)
#define CTF_PM_PRINT_DRAWING
bool getBOOL(const Any &_rAny)
#define CTF_PM_HEADERGRAPHICURL
sal_Int32 mnIndex
Definition: maptype.hxx:124
#define CTF_PM_PADDINGRIGHT
static void lcl_RemoveState(XMLPropertyState *pState)
#define CTF_PM_BORDERLEFT
#define CTF_PM_FOOTERGRAPHICURL
#define CTF_PM_MARGINRIGHT
#define CTF_PM_GRAPHICFILTER
#define CTF_PM_PADDINGBOTTOM
#define CTF_PM_HEADERMINHEIGHT
#define CTF_PM_MARGINALL
#define CTF_PM_GRAPHICURL
#define CTF_PM_FOOTERGRAPHICPOSITION
virtual void ContextFilter(bool bEnableFoFontFamily,::std::vector< XMLPropertyState > &rProperties, const css::uno::Reference< css::beans::XPropertySet > &rPropSet) const
Application-specific filter.
Definition: xmlexppr.cxx:664
#define CTF_PM_SCALETO
#define CTF_PM_BORDERTOP
#define CTF_PM_FOOTERFILLBITMAPNAME
#define CTF_PM_BORDERWIDTHLEFT
#define XML_PM_CTF_START
Definition: contextid.hxx:30
#define CTF_PM_FOOTERFILLGRADIENTNAME
#define CTF_PM_PRINT_GRID
#define CTF_PM_PRINT_HEADERS
#define CTF_PM_SCALETOX
#define CTF_PM_FILLBITMAPNAME
#define CTF_PM_HEADERREPEAT_OFFSET_Y
#define CTF_PM_MARGINTOP
#define CTF_PM_BORDERWIDTHTOP
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
returns the deterministic version for odf export
Definition: xmlexp.cxx:2323
#define CTF_PM_PRINT_ZEROVALUES
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 ...
#define CTF_PM_FOOTERREPEAT_OFFSET_X
virtual void handleSpecialItem(SvXMLAttributeList &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 ...
static void lcl_RemoveStateIfZero16(XMLPropertyState *pState)
void exportXML(const ::std::vector< XMLPropertyState > *pProperties, sal_uInt32 nIdx, const rtl::Reference< XMLPropertySetMapper > &rMapper)
#define CTF_PM_HEADERFILLGRADIENTNAME
#define CTF_PM_BORDERWIDTHRIGHT
#define CTF_PM_PRINTMASK
#define CTF_PM_BORDERWIDTHBOTTOM
#define CTF_PM_MARGINGUTTER
#define CTF_PM_REPEAT_OFFSET_X
#define CTF_PM_FOOTERGRAPHICFILTER
#define CTF_PM_PRINT_CHARTS
#define CTF_PM_PRINT_OBJECTS
#define CTF_PM_HEADERFLAG
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)
#define CTF_PM_FILLHATCHNAME
#define CTF_PM_FOOTERFILLTRANSNAME
#define CTF_PM_FOOTERFILLHATCHNAME
#define CTF_PM_GRAPHICPOSITION
tools::Long const nTopMargin
css::uno::Any maValue
Definition: maptype.hxx:125
SvXmlExportFlags
Definition: xmlexppr.hxx:39
#define CTF_PM_HEADERDYNAMIC
#define CTF_PM_BORDERWIDTHALL
#define CTF_PM_FOOTERMINHEIGHT
Handling of tokens in XML:
#define CTF_PM_SCALETOPAGES
#define CTP_PM_GRID_BASE_WIDTH
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:122
tools::Long const nRightMargin
#define CTF_PM_PRINT_ANNOTATIONS
XMLPageMasterExportPropMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper, SvXMLExport &rExport)
#define CTF_PM_FOOTERHEIGHT
#define CTF_PM_PADDINGALL
#define CTF_PM_STANDARD_MODE
#define CTF_PM_PADDINGLEFT
#define CTP_PM_GRID_SNAP_TO
#define CTF_PM_FOOTERFLAG
#define CTF_PM_HEADERGRAPHICFILTER
#define CTF_PM_FILLTRANSNAME
#define CTF_PM_SCALETOY
#define CTF_PM_BORDERBOTTOM
#define CTF_PM_BORDERALL
#define CTF_PM_FILL
aStr
#define CTF_PM_MARGINLEFT
#define CTF_PM_TEXTCOLUMNS
#define CTF_PM_REPEAT_OFFSET_Y
sal_uInt16 nPos
bool any2bool(const css::uno::Any &rAny)
#define CTF_PM_PRINT_FORMULAS
sal_Int16 nValue
const rtl::Reference< XMLPropertySetMapper > & getPropertySetMapper() const
Definition: xmlexppr.cxx:1113
#define CTF_PM_HEADERREPEAT_OFFSET_X
#define CTF_PM_BORDERRIGHT
void exportXML(const css::uno::Any &rAny)