Line data Source code
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 :
21 : #include "PageMasterImportPropMapper.hxx"
22 : #include "PageMasterPropMapper.hxx"
23 : #include <xmloff/PageMasterStyleMap.hxx>
24 : #include <xmloff/maptype.hxx>
25 : #include <com/sun/star/table/BorderLine2.hpp>
26 : #include <com/sun/star/container/XNameContainer.hpp>
27 : #include <xmloff/xmlimp.hxx>
28 : #include <boost/scoped_ptr.hpp>
29 :
30 : #define XML_LINE_LEFT 0
31 : #define XML_LINE_RIGHT 1
32 : #define XML_LINE_TOP 2
33 : #define XML_LINE_BOTTOM 3
34 :
35 : using namespace ::com::sun::star;
36 : using namespace ::com::sun::star::uno;
37 : using namespace ::com::sun::star::container;
38 :
39 284 : PageMasterImportPropertyMapper::PageMasterImportPropertyMapper(
40 : const UniReference< XMLPropertySetMapper >& rMapper,
41 : SvXMLImport& rImp ) :
42 : SvXMLImportPropertyMapper( rMapper, rImp ),
43 284 : rImport( rImp )
44 : {
45 284 : }
46 :
47 568 : PageMasterImportPropertyMapper::~PageMasterImportPropertyMapper()
48 : {
49 568 : }
50 :
51 0 : bool PageMasterImportPropertyMapper::handleSpecialItem(
52 : XMLPropertyState& rProperty,
53 : ::std::vector< XMLPropertyState >& rProperties,
54 : const OUString& rValue,
55 : const SvXMLUnitConverter& rUnitConverter,
56 : const SvXMLNamespaceMap& rNamespaceMap ) const
57 : {
58 0 : sal_Bool bRet = sal_False;
59 : sal_Int16 nContextID =
60 0 : getPropertySetMapper()->GetEntryContextId(rProperty.mnIndex);
61 :
62 0 : if( CTF_PM_REGISTER_STYLE==nContextID )
63 : {
64 : OUString sDisplayName( rImport.GetStyleDisplayName(
65 0 : XML_STYLE_FAMILY_TEXT_PARAGRAPH, rValue ) );
66 : Reference < XNameContainer > xParaStyles =
67 0 : rImport.GetTextImport()->GetParaStyles();
68 0 : if( xParaStyles.is() && xParaStyles->hasByName( sDisplayName ) )
69 : {
70 0 : rProperty.maValue <<= sDisplayName;
71 0 : bRet = sal_True;
72 0 : }
73 : }
74 : else
75 : {
76 : bRet = SvXMLImportPropertyMapper::handleSpecialItem(
77 : rProperty, rProperties, rValue,
78 0 : rUnitConverter, rNamespaceMap );
79 : }
80 :
81 0 : return bRet;
82 : }
83 :
84 :
85 913 : void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >& rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const
86 : {
87 913 : SvXMLImportPropertyMapper::finished(rProperties, nStartIndex, nEndIndex);
88 913 : XMLPropertyState* pAllPaddingProperty = NULL;
89 913 : XMLPropertyState* pPadding[4] = { NULL, NULL, NULL, NULL };
90 913 : XMLPropertyState* pNewPadding[4] = { NULL, NULL, NULL, NULL };
91 913 : XMLPropertyState* pAllBorderProperty = NULL;
92 913 : XMLPropertyState* pBorders[4] = { NULL, NULL, NULL, NULL };
93 913 : XMLPropertyState* pNewBorders[4] = { NULL, NULL, NULL, NULL };
94 913 : XMLPropertyState* pAllBorderWidthProperty = NULL;
95 913 : XMLPropertyState* pBorderWidths[4] = { NULL, NULL, NULL, NULL };
96 913 : XMLPropertyState* pAllHeaderPaddingProperty = NULL;
97 913 : XMLPropertyState* pHeaderPadding[4] = { NULL, NULL, NULL, NULL };
98 913 : XMLPropertyState* pHeaderNewPadding[4] = { NULL, NULL, NULL, NULL };
99 913 : XMLPropertyState* pAllHeaderBorderProperty = NULL;
100 913 : XMLPropertyState* pHeaderBorders[4] = { NULL, NULL, NULL, NULL };
101 913 : XMLPropertyState* pHeaderNewBorders[4] = { NULL, NULL, NULL, NULL };
102 913 : XMLPropertyState* pAllHeaderBorderWidthProperty = NULL;
103 913 : XMLPropertyState* pHeaderBorderWidths[4] = { NULL, NULL, NULL, NULL };
104 913 : XMLPropertyState* pAllFooterPaddingProperty = NULL;
105 913 : XMLPropertyState* pFooterPadding[4] = { NULL, NULL, NULL, NULL };
106 913 : XMLPropertyState* pFooterNewPadding[4] = { NULL, NULL, NULL, NULL };
107 913 : XMLPropertyState* pAllFooterBorderProperty = NULL;
108 913 : XMLPropertyState* pFooterBorders[4] = { NULL, NULL, NULL, NULL };
109 913 : XMLPropertyState* pFooterNewBorders[4] = { NULL, NULL, NULL, NULL };
110 913 : XMLPropertyState* pAllFooterBorderWidthProperty = NULL;
111 913 : XMLPropertyState* pFooterBorderWidths[4] = { NULL, NULL, NULL, NULL };
112 913 : XMLPropertyState* pHeaderHeight = NULL;
113 913 : XMLPropertyState* pHeaderMinHeight = NULL;
114 913 : boost::scoped_ptr<XMLPropertyState> xHeaderDynamic;
115 913 : XMLPropertyState* pFooterHeight = NULL;
116 913 : XMLPropertyState* pFooterMinHeight = NULL;
117 1826 : boost::scoped_ptr<XMLPropertyState> xFooterDynamic;
118 913 : XMLPropertyState* pAllMarginProperty = NULL;
119 913 : XMLPropertyState* pMargins[4] = { NULL, NULL, NULL, NULL };
120 : SAL_WNODEPRECATED_DECLARATIONS_PUSH
121 1826 : ::std::auto_ptr<XMLPropertyState> pNewMargins[4];
122 : SAL_WNODEPRECATED_DECLARATIONS_POP
123 913 : XMLPropertyState* pAllHeaderMarginProperty = NULL;
124 913 : XMLPropertyState* pHeaderMargins[4] = { NULL, NULL, NULL, NULL };
125 : SAL_WNODEPRECATED_DECLARATIONS_PUSH
126 1826 : ::std::auto_ptr<XMLPropertyState> pNewHeaderMargins[4];
127 : SAL_WNODEPRECATED_DECLARATIONS_POP
128 913 : XMLPropertyState* pAllFooterMarginProperty = NULL;
129 913 : XMLPropertyState* pFooterMargins[4] = { NULL, NULL, NULL, NULL };
130 : SAL_WNODEPRECATED_DECLARATIONS_PUSH
131 1826 : ::std::auto_ptr<XMLPropertyState> pNewFooterMargins[4];
132 : SAL_WNODEPRECATED_DECLARATIONS_POP
133 :
134 913 : ::std::vector< XMLPropertyState >::iterator aEnd = rProperties.end();
135 10681 : for (::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin(); aIter != aEnd; ++aIter)
136 : {
137 9768 : XMLPropertyState *property = &(*aIter);
138 9768 : sal_Int16 nContextID = getPropertySetMapper()->GetEntryContextId(property->mnIndex);
139 9768 : if (property->mnIndex >= nStartIndex && property->mnIndex < nEndIndex)
140 : {
141 5588 : switch (nContextID)
142 : {
143 4 : case CTF_PM_PADDINGALL : pAllPaddingProperty = property; break;
144 3 : case CTF_PM_PADDINGLEFT : pPadding[XML_LINE_LEFT] = property; break;
145 3 : case CTF_PM_PADDINGRIGHT : pPadding[XML_LINE_RIGHT] = property; break;
146 3 : case CTF_PM_PADDINGTOP : pPadding[XML_LINE_TOP] = property; break;
147 3 : case CTF_PM_PADDINGBOTTOM : pPadding[XML_LINE_BOTTOM] = property; break;
148 5 : case CTF_PM_BORDERALL : pAllBorderProperty = property; break;
149 1 : case CTF_PM_BORDERLEFT : pBorders[XML_LINE_LEFT] = property; break;
150 1 : case CTF_PM_BORDERRIGHT : pBorders[XML_LINE_RIGHT] = property; break;
151 1 : case CTF_PM_BORDERTOP : pBorders[XML_LINE_TOP] = property; break;
152 1 : case CTF_PM_BORDERBOTTOM : pBorders[XML_LINE_BOTTOM] = property; break;
153 0 : case CTF_PM_BORDERWIDTHALL : pAllBorderWidthProperty = property; break;
154 0 : case CTF_PM_BORDERWIDTHLEFT : pBorderWidths[XML_LINE_LEFT] = property; break;
155 1 : case CTF_PM_BORDERWIDTHRIGHT : pBorderWidths[XML_LINE_RIGHT] = property; break;
156 0 : case CTF_PM_BORDERWIDTHTOP : pBorderWidths[XML_LINE_TOP] = property; break;
157 0 : case CTF_PM_BORDERWIDTHBOTTOM : pBorderWidths[XML_LINE_BOTTOM] = property; break;
158 112 : case CTF_PM_HEADERPADDINGALL : pAllHeaderPaddingProperty = property; break;
159 0 : case CTF_PM_HEADERPADDINGLEFT : pHeaderPadding[XML_LINE_LEFT] = property; break;
160 0 : case CTF_PM_HEADERPADDINGRIGHT : pHeaderPadding[XML_LINE_RIGHT] = property; break;
161 0 : case CTF_PM_HEADERPADDINGTOP : pHeaderPadding[XML_LINE_TOP] = property; break;
162 0 : case CTF_PM_HEADERPADDINGBOTTOM : pHeaderPadding[XML_LINE_BOTTOM] = property; break;
163 107 : case CTF_PM_HEADERBORDERALL : pAllHeaderBorderProperty = property; break;
164 4 : case CTF_PM_HEADERBORDERLEFT : pHeaderBorders[XML_LINE_LEFT] = property; break;
165 4 : case CTF_PM_HEADERBORDERRIGHT : pHeaderBorders[XML_LINE_RIGHT] = property; break;
166 4 : case CTF_PM_HEADERBORDERTOP : pHeaderBorders[XML_LINE_TOP] = property; break;
167 4 : case CTF_PM_HEADERBORDERBOTTOM : pHeaderBorders[XML_LINE_BOTTOM] = property; break;
168 0 : case CTF_PM_HEADERBORDERWIDTHALL : pAllHeaderBorderWidthProperty = property; break;
169 0 : case CTF_PM_HEADERBORDERWIDTHLEFT : pHeaderBorderWidths[XML_LINE_LEFT] = property; break;
170 0 : case CTF_PM_HEADERBORDERWIDTHRIGHT : pHeaderBorderWidths[XML_LINE_RIGHT] = property; break;
171 0 : case CTF_PM_HEADERBORDERWIDTHTOP : pHeaderBorderWidths[XML_LINE_TOP] = property; break;
172 1 : case CTF_PM_HEADERBORDERWIDTHBOTTOM : pHeaderBorderWidths[XML_LINE_BOTTOM] = property; break;
173 108 : case CTF_PM_FOOTERPADDINGALL : pAllFooterPaddingProperty = property; break;
174 0 : case CTF_PM_FOOTERPADDINGLEFT : pFooterPadding[XML_LINE_LEFT] = property; break;
175 0 : case CTF_PM_FOOTERPADDINGRIGHT : pFooterPadding[XML_LINE_RIGHT] = property; break;
176 0 : case CTF_PM_FOOTERPADDINGTOP : pFooterPadding[XML_LINE_TOP] = property; break;
177 0 : case CTF_PM_FOOTERPADDINGBOTTOM : pFooterPadding[XML_LINE_BOTTOM] = property; break;
178 107 : case CTF_PM_FOOTERBORDERALL : pAllFooterBorderProperty = property; break;
179 0 : case CTF_PM_FOOTERBORDERLEFT : pFooterBorders[XML_LINE_LEFT] = property; break;
180 0 : case CTF_PM_FOOTERBORDERRIGHT : pFooterBorders[XML_LINE_RIGHT] = property; break;
181 0 : case CTF_PM_FOOTERBORDERTOP : pFooterBorders[XML_LINE_TOP] = property; break;
182 0 : case CTF_PM_FOOTERBORDERBOTTOM : pFooterBorders[XML_LINE_BOTTOM] = property; break;
183 0 : case CTF_PM_FOOTERBORDERWIDTHALL : pAllFooterBorderWidthProperty = property; break;
184 0 : case CTF_PM_FOOTERBORDERWIDTHLEFT : pFooterBorderWidths[XML_LINE_LEFT] = property; break;
185 0 : case CTF_PM_FOOTERBORDERWIDTHRIGHT : pFooterBorderWidths[XML_LINE_RIGHT] = property; break;
186 0 : case CTF_PM_FOOTERBORDERWIDTHTOP : pFooterBorderWidths[XML_LINE_TOP] = property; break;
187 0 : case CTF_PM_FOOTERBORDERWIDTHBOTTOM : pFooterBorderWidths[XML_LINE_BOTTOM] = property; break;
188 3 : case CTF_PM_HEADERHEIGHT : pHeaderHeight = property; break;
189 236 : case CTF_PM_HEADERMINHEIGHT : pHeaderMinHeight = property; break;
190 4 : case CTF_PM_FOOTERHEIGHT : pFooterHeight = property; break;
191 234 : case CTF_PM_FOOTERMINHEIGHT : pFooterMinHeight = property; break;
192 : case CTF_PM_MARGINALL :
193 25 : pAllMarginProperty = property; break;
194 : case CTF_PM_MARGINTOP :
195 201 : pMargins[XML_LINE_TOP] = property; break;
196 : case CTF_PM_MARGINBOTTOM:
197 201 : pMargins[XML_LINE_BOTTOM] = property; break;
198 : case CTF_PM_MARGINLEFT :
199 201 : pMargins[XML_LINE_LEFT] = property; break;
200 : case CTF_PM_MARGINRIGHT :
201 201 : pMargins[XML_LINE_RIGHT] = property; break;
202 : case CTF_PM_HEADERMARGINALL :
203 0 : pAllHeaderMarginProperty = property; break;
204 : case CTF_PM_HEADERMARGINTOP :
205 0 : pHeaderMargins[XML_LINE_TOP] = property; break;
206 : case CTF_PM_HEADERMARGINBOTTOM:
207 239 : pHeaderMargins[XML_LINE_BOTTOM] = property; break;
208 : case CTF_PM_HEADERMARGINLEFT :
209 238 : pHeaderMargins[XML_LINE_LEFT] = property; break;
210 : case CTF_PM_HEADERMARGINRIGHT :
211 238 : pHeaderMargins[XML_LINE_RIGHT] = property; break;
212 : case CTF_PM_FOOTERMARGINALL :
213 0 : pAllFooterMarginProperty = property; break;
214 : case CTF_PM_FOOTERMARGINTOP :
215 238 : pFooterMargins[XML_LINE_TOP] = property; break;
216 : case CTF_PM_FOOTERMARGINBOTTOM:
217 0 : pFooterMargins[XML_LINE_BOTTOM] = property; break;
218 : case CTF_PM_FOOTERMARGINLEFT :
219 238 : pFooterMargins[XML_LINE_LEFT] = property; break;
220 : case CTF_PM_FOOTERMARGINRIGHT :
221 238 : pFooterMargins[XML_LINE_RIGHT] = property; break;
222 : }
223 : }
224 : }
225 :
226 4565 : for (sal_uInt16 i = 0; i < 4; i++)
227 : {
228 3652 : if (pAllMarginProperty && !pMargins[i])
229 : {
230 0 : pNewMargins[i].reset(new XMLPropertyState(
231 0 : pAllMarginProperty->mnIndex + 1 + i,
232 0 : pAllMarginProperty->maValue));
233 : }
234 3652 : if (pAllHeaderMarginProperty && !pHeaderMargins[i])
235 : {
236 0 : pNewHeaderMargins[i].reset(new XMLPropertyState(
237 0 : pAllHeaderMarginProperty->mnIndex + 1 + i,
238 0 : pAllHeaderMarginProperty->maValue));
239 : }
240 3652 : if (pAllFooterMarginProperty && !pFooterMargins[i])
241 : {
242 0 : pNewFooterMargins[i].reset(new XMLPropertyState(
243 0 : pAllFooterMarginProperty->mnIndex + 1 + i,
244 0 : pAllFooterMarginProperty->maValue));
245 : }
246 3652 : if (pAllPaddingProperty && !pPadding[i])
247 16 : pNewPadding[i] = new XMLPropertyState(pAllPaddingProperty->mnIndex + 1 + i, pAllPaddingProperty->maValue);
248 3652 : if (pAllBorderProperty && !pBorders[i])
249 : {
250 20 : pNewBorders[i] = new XMLPropertyState(pAllBorderProperty->mnIndex + 1 + i, pAllBorderProperty->maValue);
251 20 : pBorders[i] = pNewBorders[i];
252 : }
253 3652 : if( !pBorderWidths[i] )
254 3651 : pBorderWidths[i] = pAllBorderWidthProperty;
255 : else
256 1 : pBorderWidths[i]->mnIndex = -1;
257 3652 : if( pBorders[i] )
258 : {
259 24 : table::BorderLine2 aBorderLine;
260 24 : pBorders[i]->maValue >>= aBorderLine;
261 24 : if( pBorderWidths[i] )
262 : {
263 1 : table::BorderLine2 aBorderLineWidth;
264 1 : pBorderWidths[i]->maValue >>= aBorderLineWidth;
265 1 : aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
266 1 : aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
267 1 : aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
268 1 : aBorderLine.LineWidth = aBorderLineWidth.LineWidth;
269 1 : pBorders[i]->maValue <<= aBorderLine;
270 : }
271 : }
272 3652 : if (pAllHeaderPaddingProperty && !pHeaderPadding[i])
273 448 : pHeaderNewPadding[i] = new XMLPropertyState(pAllHeaderPaddingProperty->mnIndex + 1 + i, pAllHeaderPaddingProperty->maValue);
274 3652 : if (pAllHeaderBorderProperty && !pHeaderBorders[i])
275 428 : pHeaderNewBorders[i] = new XMLPropertyState(pAllHeaderBorderProperty->mnIndex + 1 + i, pAllHeaderBorderProperty->maValue);
276 3652 : if( !pHeaderBorderWidths[i] )
277 3651 : pHeaderBorderWidths[i] = pAllHeaderBorderWidthProperty;
278 : else
279 1 : pHeaderBorderWidths[i]->mnIndex = -1;
280 3652 : if( pHeaderBorders[i] )
281 : {
282 16 : table::BorderLine2 aBorderLine;
283 16 : pHeaderBorders[i]->maValue >>= aBorderLine;
284 16 : if( pHeaderBorderWidths[i] )
285 : {
286 1 : table::BorderLine2 aBorderLineWidth;
287 1 : pHeaderBorderWidths[i]->maValue >>= aBorderLineWidth;
288 1 : aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
289 1 : aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
290 1 : aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
291 1 : aBorderLine.LineWidth = aBorderLineWidth.LineWidth;
292 1 : pHeaderBorders[i]->maValue <<= aBorderLine;
293 : }
294 : }
295 3652 : if (pAllFooterPaddingProperty && !pFooterPadding[i])
296 432 : pFooterNewPadding[i] = new XMLPropertyState(pAllFooterPaddingProperty->mnIndex + 1 + i, pAllFooterPaddingProperty->maValue);
297 3652 : if (pAllFooterBorderProperty && !pFooterBorders[i])
298 428 : pFooterNewBorders[i] = new XMLPropertyState(pAllFooterBorderProperty->mnIndex + 1 + i, pAllFooterBorderProperty->maValue);
299 3652 : if( !pFooterBorderWidths[i] )
300 3652 : pFooterBorderWidths[i] = pAllFooterBorderWidthProperty;
301 : else
302 0 : pFooterBorderWidths[i]->mnIndex = -1;
303 3652 : if( pFooterBorders[i] )
304 : {
305 0 : table::BorderLine2 aBorderLine;
306 0 : pFooterBorders[i]->maValue >>= aBorderLine;
307 0 : if( pFooterBorderWidths[i] )
308 : {
309 0 : table::BorderLine2 aBorderLineWidth;
310 0 : pFooterBorderWidths[i]->maValue >>= aBorderLineWidth;
311 0 : aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
312 0 : aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
313 0 : aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
314 0 : aBorderLine.LineWidth = aBorderLineWidth.LineWidth;
315 0 : pFooterBorders[i]->maValue <<= aBorderLine;
316 : }
317 : }
318 : }
319 :
320 913 : if (pHeaderHeight)
321 : {
322 3 : sal_Bool bValue(sal_False);
323 3 : uno::Any aAny;
324 3 : aAny.setValue( &bValue, ::getBooleanCppuType() );
325 3 : xHeaderDynamic.reset(new XMLPropertyState(pHeaderHeight->mnIndex + 2, aAny));
326 : }
327 913 : if (pHeaderMinHeight)
328 : {
329 236 : sal_Bool bValue(sal_True);
330 236 : uno::Any aAny;
331 236 : aAny.setValue( &bValue, ::getBooleanCppuType() );
332 236 : xHeaderDynamic.reset(new XMLPropertyState(pHeaderMinHeight->mnIndex + 1, aAny));
333 : }
334 913 : if (pFooterHeight)
335 : {
336 4 : sal_Bool bValue(sal_False);
337 4 : uno::Any aAny;
338 4 : aAny.setValue( &bValue, ::getBooleanCppuType() );
339 4 : xFooterDynamic.reset(new XMLPropertyState(pFooterHeight->mnIndex + 2, aAny));
340 : }
341 913 : if (pFooterMinHeight)
342 : {
343 234 : sal_Bool bValue(sal_True);
344 234 : uno::Any aAny;
345 234 : aAny.setValue( &bValue, ::getBooleanCppuType() );
346 234 : xFooterDynamic.reset(new XMLPropertyState(pFooterMinHeight->mnIndex + 1, aAny));
347 : }
348 :
349 : // fdo#38056: nerf the various AllFoo properties so they do not override
350 : // the individual Foo properties later on
351 913 : if (pAllPaddingProperty)
352 : {
353 4 : pAllPaddingProperty->mnIndex = -1;
354 : }
355 913 : if (pAllBorderProperty)
356 : {
357 5 : pAllBorderProperty->mnIndex = -1;
358 : }
359 913 : if (pAllBorderWidthProperty)
360 : {
361 0 : pAllBorderWidthProperty->mnIndex = -1;
362 : }
363 913 : if (pAllHeaderPaddingProperty)
364 : {
365 112 : pAllHeaderPaddingProperty->mnIndex = -1;
366 : }
367 913 : if (pAllHeaderBorderProperty)
368 : {
369 107 : pAllHeaderBorderProperty->mnIndex = -1;
370 : }
371 913 : if (pAllHeaderBorderWidthProperty)
372 : {
373 0 : pAllHeaderBorderWidthProperty->mnIndex = -1;
374 : }
375 913 : if (pAllFooterPaddingProperty)
376 : {
377 108 : pAllFooterPaddingProperty->mnIndex = -1;
378 : }
379 913 : if (pAllFooterBorderProperty)
380 : {
381 107 : pAllFooterBorderProperty->mnIndex = -1;
382 : }
383 913 : if (pAllFooterBorderWidthProperty)
384 : {
385 0 : pAllFooterBorderWidthProperty->mnIndex = -1;
386 : }
387 913 : if (pAllMarginProperty)
388 : {
389 25 : pAllMarginProperty->mnIndex = -1;
390 : }
391 913 : if (pAllHeaderMarginProperty)
392 : {
393 0 : pAllHeaderMarginProperty->mnIndex = -1;
394 : }
395 913 : if (pAllFooterMarginProperty)
396 : {
397 0 : pAllFooterMarginProperty->mnIndex = -1;
398 : }
399 :
400 4565 : for (sal_uInt16 i = 0; i < 4; i++)
401 : {
402 3652 : if (pNewMargins[i].get())
403 : {
404 0 : rProperties.push_back(*pNewMargins[i]);
405 : }
406 3652 : if (pNewHeaderMargins[i].get())
407 : {
408 0 : rProperties.push_back(*pNewHeaderMargins[i]);
409 : }
410 3652 : if (pNewFooterMargins[i].get())
411 : {
412 0 : rProperties.push_back(*pNewFooterMargins[i]);
413 : }
414 3652 : if (pNewPadding[i])
415 : {
416 16 : rProperties.push_back(*pNewPadding[i]);
417 16 : delete pNewPadding[i];
418 : }
419 3652 : if (pNewBorders[i])
420 : {
421 20 : rProperties.push_back(*pNewBorders[i]);
422 20 : delete pNewBorders[i];
423 : }
424 3652 : if (pHeaderNewPadding[i])
425 : {
426 448 : rProperties.push_back(*pHeaderNewPadding[i]);
427 448 : delete pHeaderNewPadding[i];
428 : }
429 3652 : if (pHeaderNewBorders[i])
430 : {
431 428 : rProperties.push_back(*pHeaderNewBorders[i]);
432 428 : delete pHeaderNewBorders[i];
433 : }
434 3652 : if (pFooterNewPadding[i])
435 : {
436 432 : rProperties.push_back(*pFooterNewPadding[i]);
437 432 : delete pFooterNewPadding[i];
438 : }
439 3652 : if (pFooterNewBorders[i])
440 : {
441 428 : rProperties.push_back(*pFooterNewBorders[i]);
442 428 : delete pFooterNewBorders[i];
443 : }
444 : }
445 913 : if(xHeaderDynamic)
446 : {
447 239 : rProperties.push_back(*xHeaderDynamic);
448 239 : xHeaderDynamic.reset();
449 : }
450 913 : if(xFooterDynamic)
451 : {
452 238 : rProperties.push_back(*xFooterDynamic);
453 238 : xFooterDynamic.reset();
454 913 : }
455 913 : }
456 :
457 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|