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