xref: /AOO42X/main/xmloff/source/style/PageMasterImportPropMapper.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_xmloff.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "PageMasterImportPropMapper.hxx"
32*cdf0e10cSrcweir #include "PageMasterPropMapper.hxx"
33*cdf0e10cSrcweir #include <xmloff/PageMasterStyleMap.hxx>
34*cdf0e10cSrcweir #include <xmloff/maptype.hxx>
35*cdf0e10cSrcweir #include <com/sun/star/table/BorderLine.hpp>
36*cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp>
37*cdf0e10cSrcweir #include <xmloff/xmlimp.hxx>
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir #define XML_LINE_LEFT 0
40*cdf0e10cSrcweir #define XML_LINE_RIGHT 1
41*cdf0e10cSrcweir #define XML_LINE_TOP 2
42*cdf0e10cSrcweir #define XML_LINE_BOTTOM 3
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir using namespace ::com::sun::star;
45*cdf0e10cSrcweir using namespace ::com::sun::star::uno;
46*cdf0e10cSrcweir using namespace ::com::sun::star::container;
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir PageMasterImportPropertyMapper::PageMasterImportPropertyMapper(
49*cdf0e10cSrcweir         const UniReference< XMLPropertySetMapper >& rMapper,
50*cdf0e10cSrcweir         SvXMLImport& rImp ) :
51*cdf0e10cSrcweir     SvXMLImportPropertyMapper( rMapper, rImp ),
52*cdf0e10cSrcweir     rImport( rImp )
53*cdf0e10cSrcweir {
54*cdf0e10cSrcweir }
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir PageMasterImportPropertyMapper::~PageMasterImportPropertyMapper()
57*cdf0e10cSrcweir {
58*cdf0e10cSrcweir }
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir sal_Bool PageMasterImportPropertyMapper::handleSpecialItem(
61*cdf0e10cSrcweir         XMLPropertyState& rProperty,
62*cdf0e10cSrcweir         ::std::vector< XMLPropertyState >& rProperties,
63*cdf0e10cSrcweir         const ::rtl::OUString& rValue,
64*cdf0e10cSrcweir         const SvXMLUnitConverter& rUnitConverter,
65*cdf0e10cSrcweir         const SvXMLNamespaceMap& rNamespaceMap ) const
66*cdf0e10cSrcweir {
67*cdf0e10cSrcweir     sal_Bool bRet = sal_False;
68*cdf0e10cSrcweir     sal_Int16 nContextID =
69*cdf0e10cSrcweir             getPropertySetMapper()->GetEntryContextId(rProperty.mnIndex);
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir     if( CTF_PM_REGISTER_STYLE==nContextID )
72*cdf0e10cSrcweir     {
73*cdf0e10cSrcweir         ::rtl::OUString sDisplayName( rImport.GetStyleDisplayName(
74*cdf0e10cSrcweir                     XML_STYLE_FAMILY_TEXT_PARAGRAPH, rValue ) );
75*cdf0e10cSrcweir         Reference < XNameContainer > xParaStyles =
76*cdf0e10cSrcweir             rImport.GetTextImport()->GetParaStyles();
77*cdf0e10cSrcweir         if( xParaStyles.is() && xParaStyles->hasByName( sDisplayName ) )
78*cdf0e10cSrcweir         {
79*cdf0e10cSrcweir             rProperty.maValue <<= sDisplayName;
80*cdf0e10cSrcweir             bRet = sal_True;
81*cdf0e10cSrcweir         }
82*cdf0e10cSrcweir     }
83*cdf0e10cSrcweir     else
84*cdf0e10cSrcweir     {
85*cdf0e10cSrcweir         bRet = SvXMLImportPropertyMapper::handleSpecialItem(
86*cdf0e10cSrcweir                     rProperty, rProperties, rValue,
87*cdf0e10cSrcweir                     rUnitConverter, rNamespaceMap );
88*cdf0e10cSrcweir     }
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir     return bRet;
91*cdf0e10cSrcweir }
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >& rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const
95*cdf0e10cSrcweir {
96*cdf0e10cSrcweir     SvXMLImportPropertyMapper::finished(rProperties, nStartIndex, nEndIndex);
97*cdf0e10cSrcweir     XMLPropertyState* pAllPaddingProperty = NULL;
98*cdf0e10cSrcweir     XMLPropertyState* pPadding[4] = { NULL, NULL, NULL, NULL };
99*cdf0e10cSrcweir     XMLPropertyState* pNewPadding[4] = { NULL, NULL, NULL, NULL };
100*cdf0e10cSrcweir     XMLPropertyState* pAllBorderProperty = NULL;
101*cdf0e10cSrcweir     XMLPropertyState* pBorders[4] = { NULL, NULL, NULL, NULL };
102*cdf0e10cSrcweir     XMLPropertyState* pNewBorders[4] = { NULL, NULL, NULL, NULL };
103*cdf0e10cSrcweir     XMLPropertyState* pAllBorderWidthProperty = NULL;
104*cdf0e10cSrcweir     XMLPropertyState* pBorderWidths[4] = { NULL, NULL, NULL, NULL };
105*cdf0e10cSrcweir     XMLPropertyState* pAllHeaderPaddingProperty = NULL;
106*cdf0e10cSrcweir     XMLPropertyState* pHeaderPadding[4] = { NULL, NULL, NULL, NULL };
107*cdf0e10cSrcweir     XMLPropertyState* pHeaderNewPadding[4] = { NULL, NULL, NULL, NULL };
108*cdf0e10cSrcweir     XMLPropertyState* pAllHeaderBorderProperty = NULL;
109*cdf0e10cSrcweir     XMLPropertyState* pHeaderBorders[4] = { NULL, NULL, NULL, NULL };
110*cdf0e10cSrcweir     XMLPropertyState* pHeaderNewBorders[4] = { NULL, NULL, NULL, NULL };
111*cdf0e10cSrcweir     XMLPropertyState* pAllHeaderBorderWidthProperty = NULL;
112*cdf0e10cSrcweir     XMLPropertyState* pHeaderBorderWidths[4] = { NULL, NULL, NULL, NULL };
113*cdf0e10cSrcweir     XMLPropertyState* pAllFooterPaddingProperty = NULL;
114*cdf0e10cSrcweir     XMLPropertyState* pFooterPadding[4] = { NULL, NULL, NULL, NULL };
115*cdf0e10cSrcweir     XMLPropertyState* pFooterNewPadding[4] = { NULL, NULL, NULL, NULL };
116*cdf0e10cSrcweir     XMLPropertyState* pAllFooterBorderProperty = NULL;
117*cdf0e10cSrcweir     XMLPropertyState* pFooterBorders[4] = { NULL, NULL, NULL, NULL };
118*cdf0e10cSrcweir     XMLPropertyState* pFooterNewBorders[4] = { NULL, NULL, NULL, NULL };
119*cdf0e10cSrcweir     XMLPropertyState* pAllFooterBorderWidthProperty = NULL;
120*cdf0e10cSrcweir     XMLPropertyState* pFooterBorderWidths[4] = { NULL, NULL, NULL, NULL };
121*cdf0e10cSrcweir     XMLPropertyState* pHeaderHeight = NULL;
122*cdf0e10cSrcweir     XMLPropertyState* pHeaderMinHeight = NULL;
123*cdf0e10cSrcweir     XMLPropertyState* pHeaderDynamic = NULL;
124*cdf0e10cSrcweir     XMLPropertyState* pFooterHeight = NULL;
125*cdf0e10cSrcweir     XMLPropertyState* pFooterMinHeight = NULL;
126*cdf0e10cSrcweir     XMLPropertyState* pFooterDynamic = NULL;
127*cdf0e10cSrcweir     XMLPropertyState* pAllMarginProperty = NULL;
128*cdf0e10cSrcweir     XMLPropertyState* pMargins[4] = { NULL, NULL, NULL, NULL };
129*cdf0e10cSrcweir     ::std::auto_ptr<XMLPropertyState> pNewMargins[4];
130*cdf0e10cSrcweir     XMLPropertyState* pAllHeaderMarginProperty = NULL;
131*cdf0e10cSrcweir     XMLPropertyState* pHeaderMargins[4] = { NULL, NULL, NULL, NULL };
132*cdf0e10cSrcweir     ::std::auto_ptr<XMLPropertyState> pNewHeaderMargins[4];
133*cdf0e10cSrcweir     XMLPropertyState* pAllFooterMarginProperty = NULL;
134*cdf0e10cSrcweir     XMLPropertyState* pFooterMargins[4] = { NULL, NULL, NULL, NULL };
135*cdf0e10cSrcweir     ::std::auto_ptr<XMLPropertyState> pNewFooterMargins[4];
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir     ::std::vector< XMLPropertyState >::iterator aEnd = rProperties.end();
138*cdf0e10cSrcweir     for (::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin(); aIter != aEnd; ++aIter)
139*cdf0e10cSrcweir     {
140*cdf0e10cSrcweir         XMLPropertyState *property = &(*aIter);
141*cdf0e10cSrcweir         sal_Int16 nContextID = getPropertySetMapper()->GetEntryContextId(property->mnIndex);
142*cdf0e10cSrcweir         if (property->mnIndex >= nStartIndex && property->mnIndex < nEndIndex)
143*cdf0e10cSrcweir         {
144*cdf0e10cSrcweir             switch (nContextID)
145*cdf0e10cSrcweir             {
146*cdf0e10cSrcweir                 case CTF_PM_PADDINGALL                  : pAllPaddingProperty = property; break;
147*cdf0e10cSrcweir                 case CTF_PM_PADDINGLEFT                 : pPadding[XML_LINE_LEFT] = property; break;
148*cdf0e10cSrcweir                 case CTF_PM_PADDINGRIGHT                : pPadding[XML_LINE_RIGHT] = property; break;
149*cdf0e10cSrcweir                 case CTF_PM_PADDINGTOP                  : pPadding[XML_LINE_TOP] = property; break;
150*cdf0e10cSrcweir                 case CTF_PM_PADDINGBOTTOM               : pPadding[XML_LINE_BOTTOM] = property; break;
151*cdf0e10cSrcweir                 case CTF_PM_BORDERALL                   : pAllBorderProperty = property; break;
152*cdf0e10cSrcweir                 case CTF_PM_BORDERLEFT                  : pBorders[XML_LINE_LEFT] = property; break;
153*cdf0e10cSrcweir                 case CTF_PM_BORDERRIGHT                 : pBorders[XML_LINE_RIGHT] = property; break;
154*cdf0e10cSrcweir                 case CTF_PM_BORDERTOP                   : pBorders[XML_LINE_TOP] = property; break;
155*cdf0e10cSrcweir                 case CTF_PM_BORDERBOTTOM                : pBorders[XML_LINE_BOTTOM] = property; break;
156*cdf0e10cSrcweir                 case CTF_PM_BORDERWIDTHALL              : pAllBorderWidthProperty = property; break;
157*cdf0e10cSrcweir                 case CTF_PM_BORDERWIDTHLEFT             : pBorderWidths[XML_LINE_LEFT] = property; break;
158*cdf0e10cSrcweir                 case CTF_PM_BORDERWIDTHRIGHT            : pBorderWidths[XML_LINE_RIGHT] = property; break;
159*cdf0e10cSrcweir                 case CTF_PM_BORDERWIDTHTOP              : pBorderWidths[XML_LINE_TOP] = property; break;
160*cdf0e10cSrcweir                 case CTF_PM_BORDERWIDTHBOTTOM           : pBorderWidths[XML_LINE_BOTTOM] = property; break;
161*cdf0e10cSrcweir                 case CTF_PM_HEADERPADDINGALL            : pAllHeaderPaddingProperty = property; break;
162*cdf0e10cSrcweir                 case CTF_PM_HEADERPADDINGLEFT           : pHeaderPadding[XML_LINE_LEFT] = property; break;
163*cdf0e10cSrcweir                 case CTF_PM_HEADERPADDINGRIGHT          : pHeaderPadding[XML_LINE_RIGHT] = property; break;
164*cdf0e10cSrcweir                 case CTF_PM_HEADERPADDINGTOP            : pHeaderPadding[XML_LINE_TOP] = property; break;
165*cdf0e10cSrcweir                 case CTF_PM_HEADERPADDINGBOTTOM         : pHeaderPadding[XML_LINE_BOTTOM] = property; break;
166*cdf0e10cSrcweir                 case CTF_PM_HEADERBORDERALL             : pAllHeaderBorderProperty = property; break;
167*cdf0e10cSrcweir                 case CTF_PM_HEADERBORDERLEFT            : pHeaderBorders[XML_LINE_LEFT] = property; break;
168*cdf0e10cSrcweir                 case CTF_PM_HEADERBORDERRIGHT           : pHeaderBorders[XML_LINE_RIGHT] = property; break;
169*cdf0e10cSrcweir                 case CTF_PM_HEADERBORDERTOP             : pHeaderBorders[XML_LINE_TOP] = property; break;
170*cdf0e10cSrcweir                 case CTF_PM_HEADERBORDERBOTTOM          : pHeaderBorders[XML_LINE_BOTTOM] = property; break;
171*cdf0e10cSrcweir                 case CTF_PM_HEADERBORDERWIDTHALL        : pAllHeaderBorderWidthProperty = property; break;
172*cdf0e10cSrcweir                 case CTF_PM_HEADERBORDERWIDTHLEFT       : pHeaderBorderWidths[XML_LINE_LEFT] = property; break;
173*cdf0e10cSrcweir                 case CTF_PM_HEADERBORDERWIDTHRIGHT      : pHeaderBorderWidths[XML_LINE_RIGHT] = property; break;
174*cdf0e10cSrcweir                 case CTF_PM_HEADERBORDERWIDTHTOP        : pHeaderBorderWidths[XML_LINE_TOP] = property; break;
175*cdf0e10cSrcweir                 case CTF_PM_HEADERBORDERWIDTHBOTTOM     : pHeaderBorderWidths[XML_LINE_BOTTOM] = property; break;
176*cdf0e10cSrcweir                 case CTF_PM_FOOTERPADDINGALL            : pAllFooterPaddingProperty = property; break;
177*cdf0e10cSrcweir                 case CTF_PM_FOOTERPADDINGLEFT           : pFooterPadding[XML_LINE_LEFT] = property; break;
178*cdf0e10cSrcweir                 case CTF_PM_FOOTERPADDINGRIGHT          : pFooterPadding[XML_LINE_RIGHT] = property; break;
179*cdf0e10cSrcweir                 case CTF_PM_FOOTERPADDINGTOP            : pFooterPadding[XML_LINE_TOP] = property; break;
180*cdf0e10cSrcweir                 case CTF_PM_FOOTERPADDINGBOTTOM         : pFooterPadding[XML_LINE_BOTTOM] = property; break;
181*cdf0e10cSrcweir                 case CTF_PM_FOOTERBORDERALL             : pAllFooterBorderProperty = property; break;
182*cdf0e10cSrcweir                 case CTF_PM_FOOTERBORDERLEFT            : pFooterBorders[XML_LINE_LEFT] = property; break;
183*cdf0e10cSrcweir                 case CTF_PM_FOOTERBORDERRIGHT           : pFooterBorders[XML_LINE_RIGHT] = property; break;
184*cdf0e10cSrcweir                 case CTF_PM_FOOTERBORDERTOP             : pFooterBorders[XML_LINE_TOP] = property; break;
185*cdf0e10cSrcweir                 case CTF_PM_FOOTERBORDERBOTTOM          : pFooterBorders[XML_LINE_BOTTOM] = property; break;
186*cdf0e10cSrcweir                 case CTF_PM_FOOTERBORDERWIDTHALL        : pAllFooterBorderWidthProperty = property; break;
187*cdf0e10cSrcweir                 case CTF_PM_FOOTERBORDERWIDTHLEFT       : pFooterBorderWidths[XML_LINE_LEFT] = property; break;
188*cdf0e10cSrcweir                 case CTF_PM_FOOTERBORDERWIDTHRIGHT      : pFooterBorderWidths[XML_LINE_RIGHT] = property; break;
189*cdf0e10cSrcweir                 case CTF_PM_FOOTERBORDERWIDTHTOP        : pFooterBorderWidths[XML_LINE_TOP] = property; break;
190*cdf0e10cSrcweir                 case CTF_PM_FOOTERBORDERWIDTHBOTTOM     : pFooterBorderWidths[XML_LINE_BOTTOM] = property; break;
191*cdf0e10cSrcweir                 case CTF_PM_HEADERHEIGHT                : pHeaderHeight = property; break;
192*cdf0e10cSrcweir                 case CTF_PM_HEADERMINHEIGHT             : pHeaderMinHeight = property; break;
193*cdf0e10cSrcweir                 case CTF_PM_FOOTERHEIGHT                : pFooterHeight = property; break;
194*cdf0e10cSrcweir                 case CTF_PM_FOOTERMINHEIGHT             : pFooterMinHeight = property; break;
195*cdf0e10cSrcweir                 case CTF_PM_MARGINALL   :
196*cdf0e10cSrcweir                       pAllMarginProperty = property; break;
197*cdf0e10cSrcweir                 case CTF_PM_MARGINTOP   :
198*cdf0e10cSrcweir                       pMargins[XML_LINE_TOP] = property; break;
199*cdf0e10cSrcweir                 case CTF_PM_MARGINBOTTOM:
200*cdf0e10cSrcweir                       pMargins[XML_LINE_BOTTOM] = property; break;
201*cdf0e10cSrcweir                 case CTF_PM_MARGINLEFT  :
202*cdf0e10cSrcweir                       pMargins[XML_LINE_LEFT] = property; break;
203*cdf0e10cSrcweir                 case CTF_PM_MARGINRIGHT :
204*cdf0e10cSrcweir                       pMargins[XML_LINE_RIGHT] = property; break;
205*cdf0e10cSrcweir                 case CTF_PM_HEADERMARGINALL   :
206*cdf0e10cSrcweir                       pAllHeaderMarginProperty = property; break;
207*cdf0e10cSrcweir                 case CTF_PM_HEADERMARGINTOP   :
208*cdf0e10cSrcweir                       pHeaderMargins[XML_LINE_TOP] = property; break;
209*cdf0e10cSrcweir                 case CTF_PM_HEADERMARGINBOTTOM:
210*cdf0e10cSrcweir                       pHeaderMargins[XML_LINE_BOTTOM] = property; break;
211*cdf0e10cSrcweir                 case CTF_PM_HEADERMARGINLEFT  :
212*cdf0e10cSrcweir                       pHeaderMargins[XML_LINE_LEFT] = property; break;
213*cdf0e10cSrcweir                 case CTF_PM_HEADERMARGINRIGHT :
214*cdf0e10cSrcweir                       pHeaderMargins[XML_LINE_RIGHT] = property; break;
215*cdf0e10cSrcweir                 case CTF_PM_FOOTERMARGINALL   :
216*cdf0e10cSrcweir                       pAllFooterMarginProperty = property; break;
217*cdf0e10cSrcweir                 case CTF_PM_FOOTERMARGINTOP   :
218*cdf0e10cSrcweir                       pFooterMargins[XML_LINE_TOP] = property; break;
219*cdf0e10cSrcweir                 case CTF_PM_FOOTERMARGINBOTTOM:
220*cdf0e10cSrcweir                       pFooterMargins[XML_LINE_BOTTOM] = property; break;
221*cdf0e10cSrcweir                 case CTF_PM_FOOTERMARGINLEFT  :
222*cdf0e10cSrcweir                       pFooterMargins[XML_LINE_LEFT] = property; break;
223*cdf0e10cSrcweir                 case CTF_PM_FOOTERMARGINRIGHT :
224*cdf0e10cSrcweir                       pFooterMargins[XML_LINE_RIGHT] = property; break;
225*cdf0e10cSrcweir             }
226*cdf0e10cSrcweir         }
227*cdf0e10cSrcweir     }
228*cdf0e10cSrcweir 
229*cdf0e10cSrcweir     for (sal_uInt16 i = 0; i < 4; i++)
230*cdf0e10cSrcweir     {
231*cdf0e10cSrcweir         if (pAllMarginProperty && !pMargins[i])
232*cdf0e10cSrcweir         {
233*cdf0e10cSrcweir             pNewMargins[i].reset(new XMLPropertyState(
234*cdf0e10cSrcweir                 pAllMarginProperty->mnIndex + 1 + i,
235*cdf0e10cSrcweir                 pAllMarginProperty->maValue));
236*cdf0e10cSrcweir         }
237*cdf0e10cSrcweir         if (pAllHeaderMarginProperty && !pHeaderMargins[i])
238*cdf0e10cSrcweir         {
239*cdf0e10cSrcweir             pNewHeaderMargins[i].reset(new XMLPropertyState(
240*cdf0e10cSrcweir                 pAllHeaderMarginProperty->mnIndex + 1 + i,
241*cdf0e10cSrcweir                 pAllHeaderMarginProperty->maValue));
242*cdf0e10cSrcweir         }
243*cdf0e10cSrcweir         if (pAllFooterMarginProperty && !pFooterMargins[i])
244*cdf0e10cSrcweir         {
245*cdf0e10cSrcweir             pNewFooterMargins[i].reset(new XMLPropertyState(
246*cdf0e10cSrcweir                 pAllFooterMarginProperty->mnIndex + 1 + i,
247*cdf0e10cSrcweir                 pAllFooterMarginProperty->maValue));
248*cdf0e10cSrcweir         }
249*cdf0e10cSrcweir         if (pAllPaddingProperty && !pPadding[i])
250*cdf0e10cSrcweir             pNewPadding[i] = new XMLPropertyState(pAllPaddingProperty->mnIndex + 1 + i, pAllPaddingProperty->maValue);
251*cdf0e10cSrcweir         if (pAllBorderProperty && !pBorders[i])
252*cdf0e10cSrcweir         {
253*cdf0e10cSrcweir             pNewBorders[i] = new XMLPropertyState(pAllBorderProperty->mnIndex + 1 + i, pAllBorderProperty->maValue);
254*cdf0e10cSrcweir             pBorders[i] = pNewBorders[i];
255*cdf0e10cSrcweir         }
256*cdf0e10cSrcweir         if( !pBorderWidths[i] )
257*cdf0e10cSrcweir             pBorderWidths[i] = pAllBorderWidthProperty;
258*cdf0e10cSrcweir         else
259*cdf0e10cSrcweir             pBorderWidths[i]->mnIndex = -1;
260*cdf0e10cSrcweir         if( pBorders[i] )
261*cdf0e10cSrcweir         {
262*cdf0e10cSrcweir             table::BorderLine aBorderLine;
263*cdf0e10cSrcweir             pBorders[i]->maValue >>= aBorderLine;
264*cdf0e10cSrcweir             if( pBorderWidths[i] )
265*cdf0e10cSrcweir             {
266*cdf0e10cSrcweir                 table::BorderLine aBorderLineWidth;
267*cdf0e10cSrcweir                 pBorderWidths[i]->maValue >>= aBorderLineWidth;
268*cdf0e10cSrcweir                 aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
269*cdf0e10cSrcweir                 aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
270*cdf0e10cSrcweir                 aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
271*cdf0e10cSrcweir                 pBorders[i]->maValue <<= aBorderLine;
272*cdf0e10cSrcweir             }
273*cdf0e10cSrcweir         }
274*cdf0e10cSrcweir         if (pAllHeaderPaddingProperty && !pHeaderPadding[i])
275*cdf0e10cSrcweir             pHeaderNewPadding[i] = new XMLPropertyState(pAllHeaderPaddingProperty->mnIndex + 1 + i, pAllHeaderPaddingProperty->maValue);
276*cdf0e10cSrcweir         if (pAllHeaderBorderProperty && !pHeaderBorders[i])
277*cdf0e10cSrcweir             pHeaderNewBorders[i] = new XMLPropertyState(pAllHeaderBorderProperty->mnIndex + 1 + i, pAllHeaderBorderProperty->maValue);
278*cdf0e10cSrcweir         if( !pHeaderBorderWidths[i] )
279*cdf0e10cSrcweir             pHeaderBorderWidths[i] = pAllHeaderBorderWidthProperty;
280*cdf0e10cSrcweir         else
281*cdf0e10cSrcweir             pHeaderBorderWidths[i]->mnIndex = -1;
282*cdf0e10cSrcweir         if( pHeaderBorders[i] )
283*cdf0e10cSrcweir         {
284*cdf0e10cSrcweir             table::BorderLine aBorderLine;
285*cdf0e10cSrcweir             pHeaderBorders[i]->maValue >>= aBorderLine;
286*cdf0e10cSrcweir             if( pHeaderBorderWidths[i] )
287*cdf0e10cSrcweir             {
288*cdf0e10cSrcweir                 table::BorderLine aBorderLineWidth;
289*cdf0e10cSrcweir                 pHeaderBorderWidths[i]->maValue >>= aBorderLineWidth;
290*cdf0e10cSrcweir                 aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
291*cdf0e10cSrcweir                 aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
292*cdf0e10cSrcweir                 aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
293*cdf0e10cSrcweir                 pHeaderBorders[i]->maValue <<= aBorderLine;
294*cdf0e10cSrcweir             }
295*cdf0e10cSrcweir         }
296*cdf0e10cSrcweir         if (pAllFooterPaddingProperty && !pFooterPadding[i])
297*cdf0e10cSrcweir             pFooterNewPadding[i] = new XMLPropertyState(pAllFooterPaddingProperty->mnIndex + 1 + i, pAllFooterPaddingProperty->maValue);
298*cdf0e10cSrcweir         if (pAllFooterBorderProperty && !pFooterBorders[i])
299*cdf0e10cSrcweir             pFooterNewBorders[i] = new XMLPropertyState(pAllFooterBorderProperty->mnIndex + 1 + i, pAllFooterBorderProperty->maValue);
300*cdf0e10cSrcweir         if( !pFooterBorderWidths[i] )
301*cdf0e10cSrcweir             pFooterBorderWidths[i] = pAllFooterBorderWidthProperty;
302*cdf0e10cSrcweir         else
303*cdf0e10cSrcweir             pFooterBorderWidths[i]->mnIndex = -1;
304*cdf0e10cSrcweir         if( pFooterBorders[i] )
305*cdf0e10cSrcweir         {
306*cdf0e10cSrcweir             table::BorderLine aBorderLine;
307*cdf0e10cSrcweir             pFooterBorders[i]->maValue >>= aBorderLine;
308*cdf0e10cSrcweir             if( pFooterBorderWidths[i] )
309*cdf0e10cSrcweir             {
310*cdf0e10cSrcweir                 table::BorderLine aBorderLineWidth;
311*cdf0e10cSrcweir                 pFooterBorderWidths[i]->maValue >>= aBorderLineWidth;
312*cdf0e10cSrcweir                 aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
313*cdf0e10cSrcweir                 aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
314*cdf0e10cSrcweir                 aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
315*cdf0e10cSrcweir                 pFooterBorders[i]->maValue <<= aBorderLine;
316*cdf0e10cSrcweir             }
317*cdf0e10cSrcweir         }
318*cdf0e10cSrcweir     }
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir     if (pHeaderHeight)
321*cdf0e10cSrcweir     {
322*cdf0e10cSrcweir         sal_Bool bValue(sal_False);
323*cdf0e10cSrcweir         uno::Any aAny;
324*cdf0e10cSrcweir         aAny.setValue( &bValue, ::getBooleanCppuType() );
325*cdf0e10cSrcweir         pHeaderDynamic = new XMLPropertyState(pHeaderHeight->mnIndex + 2, aAny);
326*cdf0e10cSrcweir     }
327*cdf0e10cSrcweir     if (pHeaderMinHeight)
328*cdf0e10cSrcweir     {
329*cdf0e10cSrcweir         sal_Bool bValue(sal_True);
330*cdf0e10cSrcweir         uno::Any aAny;
331*cdf0e10cSrcweir         aAny.setValue( &bValue, ::getBooleanCppuType() );
332*cdf0e10cSrcweir         pHeaderDynamic = new XMLPropertyState(pHeaderMinHeight->mnIndex + 1, aAny);
333*cdf0e10cSrcweir     }
334*cdf0e10cSrcweir     if (pFooterHeight)
335*cdf0e10cSrcweir     {
336*cdf0e10cSrcweir         sal_Bool bValue(sal_False);
337*cdf0e10cSrcweir         uno::Any aAny;
338*cdf0e10cSrcweir         aAny.setValue( &bValue, ::getBooleanCppuType() );
339*cdf0e10cSrcweir         pFooterDynamic = new XMLPropertyState(pFooterHeight->mnIndex + 2, aAny);
340*cdf0e10cSrcweir     }
341*cdf0e10cSrcweir     if (pFooterMinHeight)
342*cdf0e10cSrcweir     {
343*cdf0e10cSrcweir         sal_Bool bValue(sal_True);
344*cdf0e10cSrcweir         uno::Any aAny;
345*cdf0e10cSrcweir         aAny.setValue( &bValue, ::getBooleanCppuType() );
346*cdf0e10cSrcweir         pFooterDynamic = new XMLPropertyState(pFooterMinHeight->mnIndex + 1, aAny);
347*cdf0e10cSrcweir     }
348*cdf0e10cSrcweir     for (sal_uInt16 i = 0; i < 4; i++)
349*cdf0e10cSrcweir     {
350*cdf0e10cSrcweir         if (pNewMargins[i].get())
351*cdf0e10cSrcweir         {
352*cdf0e10cSrcweir             rProperties.push_back(*pNewMargins[i]);
353*cdf0e10cSrcweir         }
354*cdf0e10cSrcweir         if (pNewHeaderMargins[i].get())
355*cdf0e10cSrcweir         {
356*cdf0e10cSrcweir             rProperties.push_back(*pNewHeaderMargins[i]);
357*cdf0e10cSrcweir         }
358*cdf0e10cSrcweir         if (pNewFooterMargins[i].get())
359*cdf0e10cSrcweir         {
360*cdf0e10cSrcweir             rProperties.push_back(*pNewFooterMargins[i]);
361*cdf0e10cSrcweir         }
362*cdf0e10cSrcweir         if (pNewPadding[i])
363*cdf0e10cSrcweir         {
364*cdf0e10cSrcweir             rProperties.push_back(*pNewPadding[i]);
365*cdf0e10cSrcweir             delete pNewPadding[i];
366*cdf0e10cSrcweir         }
367*cdf0e10cSrcweir         if (pNewBorders[i])
368*cdf0e10cSrcweir         {
369*cdf0e10cSrcweir             rProperties.push_back(*pNewBorders[i]);
370*cdf0e10cSrcweir             delete pNewBorders[i];
371*cdf0e10cSrcweir         }
372*cdf0e10cSrcweir         if (pHeaderNewPadding[i])
373*cdf0e10cSrcweir         {
374*cdf0e10cSrcweir             rProperties.push_back(*pHeaderNewPadding[i]);
375*cdf0e10cSrcweir             delete pHeaderNewPadding[i];
376*cdf0e10cSrcweir         }
377*cdf0e10cSrcweir         if (pHeaderNewBorders[i])
378*cdf0e10cSrcweir         {
379*cdf0e10cSrcweir             rProperties.push_back(*pHeaderNewBorders[i]);
380*cdf0e10cSrcweir             delete pHeaderNewBorders[i];
381*cdf0e10cSrcweir         }
382*cdf0e10cSrcweir         if (pFooterNewPadding[i])
383*cdf0e10cSrcweir         {
384*cdf0e10cSrcweir             rProperties.push_back(*pFooterNewPadding[i]);
385*cdf0e10cSrcweir             delete pFooterNewPadding[i];
386*cdf0e10cSrcweir         }
387*cdf0e10cSrcweir         if (pFooterNewBorders[i])
388*cdf0e10cSrcweir         {
389*cdf0e10cSrcweir             rProperties.push_back(*pFooterNewBorders[i]);
390*cdf0e10cSrcweir             delete pFooterNewBorders[i];
391*cdf0e10cSrcweir         }
392*cdf0e10cSrcweir     }
393*cdf0e10cSrcweir     if(pHeaderDynamic)
394*cdf0e10cSrcweir     {
395*cdf0e10cSrcweir         rProperties.push_back(*pHeaderDynamic);
396*cdf0e10cSrcweir         delete pHeaderDynamic;
397*cdf0e10cSrcweir     }
398*cdf0e10cSrcweir     if(pFooterDynamic)
399*cdf0e10cSrcweir     {
400*cdf0e10cSrcweir         rProperties.push_back(*pFooterDynamic);
401*cdf0e10cSrcweir         delete pFooterDynamic;
402*cdf0e10cSrcweir     }
403*cdf0e10cSrcweir }
404*cdf0e10cSrcweir 
405