LibreOffice Module xmloff (master)  1
PageMasterImportPropMapper.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 
20 
22 #include <PageMasterStyleMap.hxx>
23 #include <xmloff/maptype.hxx>
24 #include <com/sun/star/table/BorderLine2.hpp>
25 #include <com/sun/star/container/XNameContainer.hpp>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
28 #include <com/sun/star/frame/XModel.hpp>
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <xmloff/xmlimp.hxx>
31 #include <xmloff/xmlprmap.hxx>
32 #include <memory>
33 
34 #define XML_LINE_LEFT 0
35 #define XML_LINE_RIGHT 1
36 #define XML_LINE_TOP 2
37 #define XML_LINE_BOTTOM 3
38 
39 using namespace ::com::sun::star;
40 using namespace ::com::sun::star::uno;
41 using namespace ::com::sun::star::container;
42 
45  SvXMLImport& rImp ) :
46  SvXMLImportPropertyMapper( rMapper, rImp ),
47  rImport( rImp )
48 {
49 }
50 
52 {
53 }
54 
56  XMLPropertyState& rProperty,
57  std::vector< XMLPropertyState >& rProperties,
58  const OUString& rValue,
59  const SvXMLUnitConverter& rUnitConverter,
60  const SvXMLNamespaceMap& rNamespaceMap ) const
61 {
62  bool bRet = false;
63  sal_Int16 nContextID =
64  getPropertySetMapper()->GetEntryContextId(rProperty.mnIndex);
65 
66  if( CTF_PM_REGISTER_STYLE==nContextID )
67  {
70  Reference < XNameContainer > xParaStyles =
71  rImport.GetTextImport()->GetParaStyles();
72  if( xParaStyles.is() && xParaStyles->hasByName( sDisplayName ) )
73  {
74  rProperty.maValue <<= sDisplayName;
75  bRet = true;
76  }
77  }
78  else
79  {
81  rProperty, rProperties, rValue,
82  rUnitConverter, rNamespaceMap );
83  }
84 
85  return bRet;
86 }
87 
88 
89 void PageMasterImportPropertyMapper::finished(std::vector< XMLPropertyState >& rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const
90 {
91  SvXMLImportPropertyMapper::finished(rProperties, nStartIndex, nEndIndex);
92  XMLPropertyState* pAllPaddingProperty = nullptr;
93  XMLPropertyState* pPadding[4] = { nullptr, nullptr, nullptr, nullptr };
94  XMLPropertyState* pNewPadding[4] = { nullptr, nullptr, nullptr, nullptr };
95  XMLPropertyState* pAllBorderProperty = nullptr;
96  XMLPropertyState* pBorders[4] = { nullptr, nullptr, nullptr, nullptr };
97  XMLPropertyState* pNewBorders[4] = { nullptr, nullptr, nullptr, nullptr };
98  XMLPropertyState* pAllBorderWidthProperty = nullptr;
99  XMLPropertyState* pBorderWidths[4] = { nullptr, nullptr, nullptr, nullptr };
100  XMLPropertyState* pAllHeaderPaddingProperty = nullptr;
101  XMLPropertyState* pHeaderPadding[4] = { nullptr, nullptr, nullptr, nullptr };
102  XMLPropertyState* pHeaderNewPadding[4] = { nullptr, nullptr, nullptr, nullptr };
103  XMLPropertyState* pAllHeaderBorderProperty = nullptr;
104  XMLPropertyState* pHeaderBorders[4] = { nullptr, nullptr, nullptr, nullptr };
105  XMLPropertyState* pHeaderNewBorders[4] = { nullptr, nullptr, nullptr, nullptr };
106  XMLPropertyState* pAllHeaderBorderWidthProperty = nullptr;
107  XMLPropertyState* pHeaderBorderWidths[4] = { nullptr, nullptr, nullptr, nullptr };
108  XMLPropertyState* pAllFooterPaddingProperty = nullptr;
109  XMLPropertyState* pFooterPadding[4] = { nullptr, nullptr, nullptr, nullptr };
110  XMLPropertyState* pFooterNewPadding[4] = { nullptr, nullptr, nullptr, nullptr };
111  XMLPropertyState* pAllFooterBorderProperty = nullptr;
112  XMLPropertyState* pFooterBorders[4] = { nullptr, nullptr, nullptr, nullptr };
113  XMLPropertyState* pFooterNewBorders[4] = { nullptr, nullptr, nullptr, nullptr };
114  XMLPropertyState* pAllFooterBorderWidthProperty = nullptr;
115  XMLPropertyState* pFooterBorderWidths[4] = { nullptr, nullptr, nullptr, nullptr };
116  XMLPropertyState* pHeaderHeight = nullptr;
117  XMLPropertyState* pHeaderMinHeight = nullptr;
118  std::unique_ptr<XMLPropertyState> xHeaderDynamic;
119  XMLPropertyState* pFooterHeight = nullptr;
120  XMLPropertyState* pFooterMinHeight = nullptr;
121  std::unique_ptr<XMLPropertyState> xFooterDynamic;
122  XMLPropertyState* pAllMarginProperty = nullptr;
123  XMLPropertyState* pMargins[4] = { nullptr, nullptr, nullptr, nullptr };
124  std::unique_ptr<XMLPropertyState> pNewMargins[4];
125  XMLPropertyState* pAllHeaderMarginProperty = nullptr;
126  XMLPropertyState* pHeaderMargins[4] = { nullptr, nullptr, nullptr, nullptr };
127  std::unique_ptr<XMLPropertyState> pNewHeaderMargins[4];
128  XMLPropertyState* pAllFooterMarginProperty = nullptr;
129  XMLPropertyState* pFooterMargins[4] = { nullptr, nullptr, nullptr, nullptr };
130  std::unique_ptr<XMLPropertyState> pNewFooterMargins[4];
131  XMLPropertyState* pMarginGutter = nullptr;
132  XMLPropertyState* pRtlGutter = nullptr;
133 
134  for (auto& rProp : rProperties)
135  {
136  XMLPropertyState *property = &rProp;
137  sal_Int16 nContextID = getPropertySetMapper()->GetEntryContextId(property->mnIndex);
138  if (property->mnIndex >= nStartIndex && property->mnIndex < nEndIndex)
139  {
140  switch (nContextID)
141  {
142  case CTF_PM_PADDINGALL : pAllPaddingProperty = property; break;
143  case CTF_PM_PADDINGLEFT : pPadding[XML_LINE_LEFT] = property; break;
144  case CTF_PM_PADDINGRIGHT : pPadding[XML_LINE_RIGHT] = property; break;
145  case CTF_PM_PADDINGTOP : pPadding[XML_LINE_TOP] = property; break;
146  case CTF_PM_PADDINGBOTTOM : pPadding[XML_LINE_BOTTOM] = property; break;
147  case CTF_PM_BORDERALL : pAllBorderProperty = property; break;
148  case CTF_PM_BORDERLEFT : pBorders[XML_LINE_LEFT] = property; break;
149  case CTF_PM_BORDERRIGHT : pBorders[XML_LINE_RIGHT] = property; break;
150  case CTF_PM_BORDERTOP : pBorders[XML_LINE_TOP] = property; break;
151  case CTF_PM_BORDERBOTTOM : pBorders[XML_LINE_BOTTOM] = property; break;
152  case CTF_PM_BORDERWIDTHALL : pAllBorderWidthProperty = property; break;
153  case CTF_PM_BORDERWIDTHLEFT : pBorderWidths[XML_LINE_LEFT] = property; break;
154  case CTF_PM_BORDERWIDTHRIGHT : pBorderWidths[XML_LINE_RIGHT] = property; break;
155  case CTF_PM_BORDERWIDTHTOP : pBorderWidths[XML_LINE_TOP] = property; break;
156  case CTF_PM_BORDERWIDTHBOTTOM : pBorderWidths[XML_LINE_BOTTOM] = property; break;
157  case CTF_PM_HEADERPADDINGALL : pAllHeaderPaddingProperty = property; break;
158  case CTF_PM_HEADERPADDINGLEFT : pHeaderPadding[XML_LINE_LEFT] = property; break;
159  case CTF_PM_HEADERPADDINGRIGHT : pHeaderPadding[XML_LINE_RIGHT] = property; break;
160  case CTF_PM_HEADERPADDINGTOP : pHeaderPadding[XML_LINE_TOP] = property; break;
161  case CTF_PM_HEADERPADDINGBOTTOM : pHeaderPadding[XML_LINE_BOTTOM] = property; break;
162  case CTF_PM_HEADERBORDERALL : pAllHeaderBorderProperty = property; break;
163  case CTF_PM_HEADERBORDERLEFT : pHeaderBorders[XML_LINE_LEFT] = property; break;
164  case CTF_PM_HEADERBORDERRIGHT : pHeaderBorders[XML_LINE_RIGHT] = property; break;
165  case CTF_PM_HEADERBORDERTOP : pHeaderBorders[XML_LINE_TOP] = property; break;
166  case CTF_PM_HEADERBORDERBOTTOM : pHeaderBorders[XML_LINE_BOTTOM] = property; break;
167  case CTF_PM_HEADERBORDERWIDTHALL : pAllHeaderBorderWidthProperty = property; break;
168  case CTF_PM_HEADERBORDERWIDTHLEFT : pHeaderBorderWidths[XML_LINE_LEFT] = property; break;
169  case CTF_PM_HEADERBORDERWIDTHRIGHT : pHeaderBorderWidths[XML_LINE_RIGHT] = property; break;
170  case CTF_PM_HEADERBORDERWIDTHTOP : pHeaderBorderWidths[XML_LINE_TOP] = property; break;
171  case CTF_PM_HEADERBORDERWIDTHBOTTOM : pHeaderBorderWidths[XML_LINE_BOTTOM] = property; break;
172  case CTF_PM_FOOTERPADDINGALL : pAllFooterPaddingProperty = property; break;
173  case CTF_PM_FOOTERPADDINGLEFT : pFooterPadding[XML_LINE_LEFT] = property; break;
174  case CTF_PM_FOOTERPADDINGRIGHT : pFooterPadding[XML_LINE_RIGHT] = property; break;
175  case CTF_PM_FOOTERPADDINGTOP : pFooterPadding[XML_LINE_TOP] = property; break;
176  case CTF_PM_FOOTERPADDINGBOTTOM : pFooterPadding[XML_LINE_BOTTOM] = property; break;
177  case CTF_PM_FOOTERBORDERALL : pAllFooterBorderProperty = property; break;
178  case CTF_PM_FOOTERBORDERLEFT : pFooterBorders[XML_LINE_LEFT] = property; break;
179  case CTF_PM_FOOTERBORDERRIGHT : pFooterBorders[XML_LINE_RIGHT] = property; break;
180  case CTF_PM_FOOTERBORDERTOP : pFooterBorders[XML_LINE_TOP] = property; break;
181  case CTF_PM_FOOTERBORDERBOTTOM : pFooterBorders[XML_LINE_BOTTOM] = property; break;
182  case CTF_PM_FOOTERBORDERWIDTHALL : pAllFooterBorderWidthProperty = property; break;
183  case CTF_PM_FOOTERBORDERWIDTHLEFT : pFooterBorderWidths[XML_LINE_LEFT] = property; break;
184  case CTF_PM_FOOTERBORDERWIDTHRIGHT : pFooterBorderWidths[XML_LINE_RIGHT] = property; break;
185  case CTF_PM_FOOTERBORDERWIDTHTOP : pFooterBorderWidths[XML_LINE_TOP] = property; break;
186  case CTF_PM_FOOTERBORDERWIDTHBOTTOM : pFooterBorderWidths[XML_LINE_BOTTOM] = property; break;
187  case CTF_PM_HEADERHEIGHT : pHeaderHeight = property; break;
188  case CTF_PM_HEADERMINHEIGHT : pHeaderMinHeight = property; break;
189  case CTF_PM_FOOTERHEIGHT : pFooterHeight = property; break;
190  case CTF_PM_FOOTERMINHEIGHT : pFooterMinHeight = property; break;
191  case CTF_PM_MARGINALL :
192  pAllMarginProperty = property; break;
193  case CTF_PM_MARGINTOP :
194  pMargins[XML_LINE_TOP] = property; break;
195  case CTF_PM_MARGINBOTTOM:
196  pMargins[XML_LINE_BOTTOM] = property; break;
197  case CTF_PM_MARGINLEFT :
198  pMargins[XML_LINE_LEFT] = property; break;
199  case CTF_PM_MARGINRIGHT :
200  pMargins[XML_LINE_RIGHT] = property; break;
201  case CTF_PM_MARGINGUTTER:
202  pMarginGutter = property;
203  break;
204  case CTF_PM_RTLGUTTER:
205  pRtlGutter = property;
206  break;
208  pAllHeaderMarginProperty = property; break;
210  pHeaderMargins[XML_LINE_TOP] = property; break;
212  pHeaderMargins[XML_LINE_BOTTOM] = property; break;
214  pHeaderMargins[XML_LINE_LEFT] = property; break;
216  pHeaderMargins[XML_LINE_RIGHT] = property; break;
218  pAllFooterMarginProperty = property; break;
220  pFooterMargins[XML_LINE_TOP] = property; break;
222  pFooterMargins[XML_LINE_BOTTOM] = property; break;
224  pFooterMargins[XML_LINE_LEFT] = property; break;
226  pFooterMargins[XML_LINE_RIGHT] = property; break;
227  }
228  }
229  }
230 
231  for (sal_uInt16 i = 0; i < 4; i++)
232  {
233  if (pAllMarginProperty && !pMargins[i])
234  {
235  pNewMargins[i].reset(new XMLPropertyState(
236  pAllMarginProperty->mnIndex + 1 + i,
237  pAllMarginProperty->maValue));
238  }
239  if (pAllHeaderMarginProperty && !pHeaderMargins[i])
240  {
241  pNewHeaderMargins[i].reset(new XMLPropertyState(
242  pAllHeaderMarginProperty->mnIndex + 1 + i,
243  pAllHeaderMarginProperty->maValue));
244  }
245  if (pAllFooterMarginProperty && !pFooterMargins[i])
246  {
247  pNewFooterMargins[i].reset(new XMLPropertyState(
248  pAllFooterMarginProperty->mnIndex + 1 + i,
249  pAllFooterMarginProperty->maValue));
250  }
251  if (pAllPaddingProperty && !pPadding[i])
252  pNewPadding[i] = new XMLPropertyState(pAllPaddingProperty->mnIndex + 1 + i, pAllPaddingProperty->maValue);
253  if (pAllBorderProperty && !pBorders[i])
254  {
255  pNewBorders[i] = new XMLPropertyState(pAllBorderProperty->mnIndex + 1 + i, pAllBorderProperty->maValue);
256  pBorders[i] = pNewBorders[i];
257  }
258  if( !pBorderWidths[i] )
259  pBorderWidths[i] = pAllBorderWidthProperty;
260  else
261  pBorderWidths[i]->mnIndex = -1;
262  if( pBorders[i] )
263  {
264  table::BorderLine2 aBorderLine;
265  pBorders[i]->maValue >>= aBorderLine;
266  if( pBorderWidths[i] )
267  {
268  table::BorderLine2 aBorderLineWidth;
269  pBorderWidths[i]->maValue >>= aBorderLineWidth;
270  aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
271  aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
272  aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
273  aBorderLine.LineWidth = aBorderLineWidth.LineWidth;
274  pBorders[i]->maValue <<= aBorderLine;
275  }
276  }
277  if (pAllHeaderPaddingProperty && !pHeaderPadding[i])
278  pHeaderNewPadding[i] = new XMLPropertyState(pAllHeaderPaddingProperty->mnIndex + 1 + i, pAllHeaderPaddingProperty->maValue);
279  if (pAllHeaderBorderProperty && !pHeaderBorders[i])
280  pHeaderNewBorders[i] = new XMLPropertyState(pAllHeaderBorderProperty->mnIndex + 1 + i, pAllHeaderBorderProperty->maValue);
281  if( !pHeaderBorderWidths[i] )
282  pHeaderBorderWidths[i] = pAllHeaderBorderWidthProperty;
283  else
284  pHeaderBorderWidths[i]->mnIndex = -1;
285  if( pHeaderBorders[i] )
286  {
287  table::BorderLine2 aBorderLine;
288  pHeaderBorders[i]->maValue >>= aBorderLine;
289  if( pHeaderBorderWidths[i] )
290  {
291  table::BorderLine2 aBorderLineWidth;
292  pHeaderBorderWidths[i]->maValue >>= aBorderLineWidth;
293  aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
294  aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
295  aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
296  aBorderLine.LineWidth = aBorderLineWidth.LineWidth;
297  pHeaderBorders[i]->maValue <<= aBorderLine;
298  }
299  }
300  if (pAllFooterPaddingProperty && !pFooterPadding[i])
301  pFooterNewPadding[i] = new XMLPropertyState(pAllFooterPaddingProperty->mnIndex + 1 + i, pAllFooterPaddingProperty->maValue);
302  if (pAllFooterBorderProperty && !pFooterBorders[i])
303  pFooterNewBorders[i] = new XMLPropertyState(pAllFooterBorderProperty->mnIndex + 1 + i, pAllFooterBorderProperty->maValue);
304  if( !pFooterBorderWidths[i] )
305  pFooterBorderWidths[i] = pAllFooterBorderWidthProperty;
306  else
307  pFooterBorderWidths[i]->mnIndex = -1;
308  if( pFooterBorders[i] )
309  {
310  table::BorderLine2 aBorderLine;
311  pFooterBorders[i]->maValue >>= aBorderLine;
312  if( pFooterBorderWidths[i] )
313  {
314  table::BorderLine2 aBorderLineWidth;
315  pFooterBorderWidths[i]->maValue >>= aBorderLineWidth;
316  aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
317  aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
318  aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
319  aBorderLine.LineWidth = aBorderLineWidth.LineWidth;
320  pFooterBorders[i]->maValue <<= aBorderLine;
321  }
322  }
323  }
324 
325  if (pHeaderHeight)
326  {
327  xHeaderDynamic.reset(new XMLPropertyState(pHeaderHeight->mnIndex + 2, Any(false)));
328  }
329  if (pHeaderMinHeight)
330  {
331  xHeaderDynamic.reset(new XMLPropertyState(pHeaderMinHeight->mnIndex + 1, Any(true)));
332  }
333  if (pFooterHeight)
334  {
335  xFooterDynamic.reset(new XMLPropertyState(pFooterHeight->mnIndex + 2, Any(false)));
336  }
337  if (pFooterMinHeight)
338  {
339  xFooterDynamic.reset(new XMLPropertyState(pFooterMinHeight->mnIndex + 1, Any(true)));
340  }
341 
342  // fdo#38056: nerf the various AllFoo properties so they do not override
343  // the individual Foo properties later on
344  if (pAllPaddingProperty)
345  {
346  pAllPaddingProperty->mnIndex = -1;
347  }
348  if (pAllBorderProperty)
349  {
350  pAllBorderProperty->mnIndex = -1;
351  }
352  if (pAllBorderWidthProperty)
353  {
354  pAllBorderWidthProperty->mnIndex = -1;
355  }
356  if (pAllHeaderPaddingProperty)
357  {
358  pAllHeaderPaddingProperty->mnIndex = -1;
359  }
360  if (pAllHeaderBorderProperty)
361  {
362  pAllHeaderBorderProperty->mnIndex = -1;
363  }
364  if (pAllHeaderBorderWidthProperty)
365  {
366  pAllHeaderBorderWidthProperty->mnIndex = -1;
367  }
368  if (pAllFooterPaddingProperty)
369  {
370  pAllFooterPaddingProperty->mnIndex = -1;
371  }
372  if (pAllFooterBorderProperty)
373  {
374  pAllFooterBorderProperty->mnIndex = -1;
375  }
376  if (pAllFooterBorderWidthProperty)
377  {
378  pAllFooterBorderWidthProperty->mnIndex = -1;
379  }
380  if (pAllMarginProperty)
381  {
382  pAllMarginProperty->mnIndex = -1;
383  }
384  if (pAllHeaderMarginProperty)
385  {
386  pAllHeaderMarginProperty->mnIndex = -1;
387  }
388  if (pAllFooterMarginProperty)
389  {
390  pAllFooterMarginProperty->mnIndex = -1;
391  }
392 
393  if (pMarginGutter)
394  {
395  sal_Int32 nGutterMargin{};
396  pMarginGutter->maValue >>= nGutterMargin;
397 
398  bool bGutterAtTop{};
399  uno::Reference<lang::XServiceInfo> xSI(GetImport().GetModel(), uno::UNO_QUERY);
400  if (xSI.is() && xSI->supportsService("com.sun.star.text.TextDocument"))
401  {
402  uno::Reference<lang::XMultiServiceFactory> xFac(GetImport().GetModel(), uno::UNO_QUERY);
403  if (xFac.is())
404  {
405  uno::Reference<beans::XPropertySet> xProps(
406  xFac->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY);
407  if (xProps.is())
408  {
409  xProps->getPropertyValue("GutterAtTop") >>= bGutterAtTop;
410  }
411  }
412  }
413  if (bGutterAtTop)
414  {
415  if (nGutterMargin && pMargins[XML_LINE_TOP])
416  {
417  // Decrease top margin to not include gutter.
418  sal_Int32 nTopMargin{};
419  pMargins[XML_LINE_TOP]->maValue >>= nTopMargin;
420  nTopMargin -= nGutterMargin;
421  pMargins[XML_LINE_TOP]->maValue <<= nTopMargin;
422  }
423  }
424  else
425  {
426  bool bRtlGutter{};
427  if (nGutterMargin && pRtlGutter)
428  {
429  pRtlGutter->maValue >>= bRtlGutter;
430  }
431  if (bRtlGutter)
432  {
433  if (nGutterMargin && pMargins[XML_LINE_RIGHT])
434  {
435  // Decrease right margin to not include gutter.
436  sal_Int32 nRightMargin{};
437  pMargins[XML_LINE_RIGHT]->maValue >>= nRightMargin;
438  nRightMargin -= nGutterMargin;
439  pMargins[XML_LINE_RIGHT]->maValue <<= nRightMargin;
440  }
441  }
442  else
443  {
444  if (nGutterMargin && pMargins[XML_LINE_LEFT])
445  {
446  // Decrease left margin to not include gutter.
447  sal_Int32 nLeftMargin{};
448  pMargins[XML_LINE_LEFT]->maValue >>= nLeftMargin;
449  nLeftMargin -= nGutterMargin;
450  pMargins[XML_LINE_LEFT]->maValue <<= nLeftMargin;
451  }
452  }
453  }
454  }
455 
456  // CAUTION!
457  // The following code adds into the rProperties vector, so all the
458  // XMLPropertyState* pointers that are pointing to the rProperties
459  // elements could potentially be deallocated, so don't use them after
460  // this!
461  for (sal_uInt16 i = 0; i < 4; i++)
462  {
463  if (pNewMargins[i])
464  {
465  rProperties.push_back(*pNewMargins[i]);
466  }
467  if (pNewHeaderMargins[i])
468  {
469  rProperties.push_back(*pNewHeaderMargins[i]);
470  }
471  if (pNewFooterMargins[i])
472  {
473  rProperties.push_back(*pNewFooterMargins[i]);
474  }
475  if (pNewPadding[i])
476  {
477  rProperties.push_back(*pNewPadding[i]);
478  delete pNewPadding[i];
479  }
480  if (pNewBorders[i])
481  {
482  rProperties.push_back(*pNewBorders[i]);
483  delete pNewBorders[i];
484  }
485  if (pHeaderNewPadding[i])
486  {
487  rProperties.push_back(*pHeaderNewPadding[i]);
488  delete pHeaderNewPadding[i];
489  }
490  if (pHeaderNewBorders[i])
491  {
492  rProperties.push_back(*pHeaderNewBorders[i]);
493  delete pHeaderNewBorders[i];
494  }
495  if (pFooterNewPadding[i])
496  {
497  rProperties.push_back(*pFooterNewPadding[i]);
498  delete pFooterNewPadding[i];
499  }
500  if (pFooterNewBorders[i])
501  {
502  rProperties.push_back(*pFooterNewBorders[i]);
503  delete pFooterNewBorders[i];
504  }
505  }
506  // CAUTION - do not use XMLPropertyState* pointers (like pMargins,
507  // pMarginGutter) after this.
508 
509  if(xHeaderDynamic)
510  {
511  rProperties.push_back(*xHeaderDynamic);
512  xHeaderDynamic.reset();
513  }
514  if(xFooterDynamic)
515  {
516  rProperties.push_back(*xFooterDynamic);
517  xFooterDynamic.reset();
518  }
519 
520 }
521 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define CTF_PM_HEADERBORDERRIGHT
#define CTF_PM_HEADERHEIGHT
PageMasterImportPropertyMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper, SvXMLImport &rImp)
#define CTF_PM_HEADERPADDINGTOP
#define CTF_PM_FOOTERBORDERRIGHT
#define CTF_PM_RTLGUTTER
#define CTF_PM_HEADERPADDINGALL
#define CTF_PM_PADDINGTOP
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:82
#define CTF_PM_HEADERPADDINGLEFT
#define CTF_PM_HEADERBORDERWIDTHLEFT
tools::Long const nLeftMargin
#define CTF_PM_FOOTERMARGINLEFT
#define CTF_PM_FOOTERMARGINBOTTOM
#define CTF_PM_HEADERPADDINGBOTTOM
sal_Int32 mnIndex
Definition: maptype.hxx:141
#define CTF_PM_PADDINGRIGHT
#define CTF_PM_FOOTERBORDERWIDTHLEFT
#define CTF_PM_FOOTERMARGINALL
rtl::Reference< XMLTextImportHelper > const & GetTextImport()
Definition: xmlimp.hxx:599
#define CTF_PM_HEADERMARGINLEFT
#define CTF_PM_BORDERLEFT
#define CTF_PM_MARGINRIGHT
const rtl::Reference< XMLPropertySetMapper > & getPropertySetMapper() const
Definition: xmlimppr.hxx:197
#define CTF_PM_PADDINGBOTTOM
#define CTF_PM_HEADERMINHEIGHT
#define CTF_PM_MARGINALL
#define CTF_PM_HEADERPADDINGRIGHT
#define CTF_PM_FOOTERPADDINGRIGHT
#define CTF_PM_FOOTERPADDINGBOTTOM
#define CTF_PM_HEADERBORDERLEFT
#define CTF_PM_BORDERTOP
#define CTF_PM_HEADERBORDERALL
#define CTF_PM_HEADERBORDERBOTTOM
#define CTF_PM_BORDERWIDTHLEFT
SvXMLImport & GetImport() const
Definition: xmlimppr.hxx:76
#define CTF_PM_FOOTERBORDERWIDTHTOP
virtual bool handleSpecialItem(XMLPropertyState &rProperty,::std::vector< XMLPropertyState > &rProperties, const OUString &rValue, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap) const override
this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_IMPORT flag set ...
#define CTF_PM_MARGINTOP
#define CTF_PM_BORDERWIDTHTOP
#define CTF_PM_HEADERBORDERWIDTHTOP
#define CTF_PM_HEADERBORDERWIDTHRIGHT
#define XML_LINE_RIGHT
virtual bool handleSpecialItem(XMLPropertyState &rProperty,::std::vector< XMLPropertyState > &rProperties, const OUString &rValue, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap) const
this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_IMPORT flag set ...
Definition: xmlimppr.cxx:347
#define CTF_PM_HEADERMARGINTOP
int i
#define CTF_PM_HEADERMARGINALL
#define CTF_PM_FOOTERMARGINTOP
virtual void finished(::std::vector< XMLPropertyState > &rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex) const
This method is called when all attributes have benn processed.
Definition: xmlimppr.cxx:753
#define CTF_PM_BORDERWIDTHRIGHT
#define CTF_PM_FOOTERBORDERWIDTHALL
#define CTF_PM_HEADERBORDERWIDTHBOTTOM
#define CTF_PM_FOOTERBORDERTOP
#define CTF_PM_FOOTERBORDERLEFT
#define CTF_PM_BORDERWIDTHBOTTOM
#define CTF_PM_FOOTERPADDINGALL
#define CTF_PM_MARGINGUTTER
#define XML_LINE_BOTTOM
#define CTF_PM_REGISTER_STYLE
#define CTF_PM_HEADERBORDERTOP
#define CTF_PM_MARGINBOTTOM
#define CTF_PM_HEADERMARGINBOTTOM
tools::Long const nTopMargin
css::uno::Any maValue
Definition: maptype.hxx:142
OUString GetStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName) const
Definition: xmlimp.cxx:1404
#define CTF_PM_BORDERWIDTHALL
#define CTF_PM_FOOTERMINHEIGHT
#define CTF_PM_FOOTERMARGINRIGHT
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:139
tools::Long const nRightMargin
#define CTF_PM_FOOTERBORDERWIDTHRIGHT
#define CTF_PM_FOOTERBORDERWIDTHBOTTOM
#define CTF_PM_FOOTERHEIGHT
#define CTF_PM_PADDINGALL
virtual void finished(::std::vector< XMLPropertyState > &rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex) const override
This method is called when all attributes have been processed.
#define CTF_PM_PADDINGLEFT
#define CTF_PM_FOOTERPADDINGTOP
#define CTF_PM_HEADERMARGINRIGHT
#define XML_LINE_LEFT
#define CTF_PM_FOOTERBORDERALL
#define CTF_PM_BORDERBOTTOM
#define CTF_PM_BORDERALL
#define CTF_PM_FOOTERBORDERBOTTOM
#define CTF_PM_HEADERBORDERWIDTHALL
#define CTF_PM_FOOTERPADDINGLEFT
#define CTF_PM_MARGINLEFT
#define XML_LINE_TOP
OUString sDisplayName
#define CTF_PM_BORDERRIGHT