Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "PageMasterExportPropMapper.hxx"
30 : : #include <xmloff/xmltoken.hxx>
31 : : #include <comphelper/types.hxx>
32 : : #include <com/sun/star/table/BorderLine2.hpp>
33 : : #include <xmloff/PageMasterStyleMap.hxx>
34 : : #include <tools/debug.hxx>
35 : : #include <rtl/ustrbuf.hxx>
36 : : #include <comphelper/extract.hxx>
37 : :
38 : : using namespace ::com::sun::star;
39 : : using namespace ::com::sun::star::uno;
40 : : using namespace ::com::sun::star::beans;
41 : : using namespace ::comphelper;
42 : : using namespace ::xmloff::token;
43 : :
44 : :
45 : : //______________________________________________________________________________
46 : :
47 : 48 : inline sal_Bool lcl_HasSameLineWidth( const table::BorderLine2& rLine1, const table::BorderLine2& rLine2 )
48 : : {
49 : : return (rLine1.InnerLineWidth == rLine2.InnerLineWidth) &&
50 : : (rLine1.OuterLineWidth == rLine2.OuterLineWidth) &&
51 : : (rLine1.LineDistance == rLine2.LineDistance) &&
52 [ + - ][ + - ]: 48 : (rLine1.LineWidth == rLine2.LineWidth);
[ + - ][ + - ]
53 : : }
54 : :
55 : 24 : inline sal_Bool operator==( const table::BorderLine2& rLine1, const table::BorderLine2& rLine2 )
56 : : {
57 : : return (rLine1.Color == rLine2.Color) &&
58 : 24 : lcl_HasSameLineWidth( rLine1, rLine2 ) &&
59 [ + - + - ]: 48 : ( rLine1.LineStyle == rLine2.LineStyle );
[ + - ]
60 : : }
61 : :
62 : 182 : inline void lcl_RemoveState( XMLPropertyState* pState )
63 : : {
64 : 182 : pState->mnIndex = -1;
65 : 182 : pState->maValue.clear();
66 : 182 : }
67 : :
68 : 0 : void lcl_RemoveStateIfZero16( XMLPropertyState* pState )
69 : : {
70 : 0 : sal_Int16 nValue = sal_Int16();
71 [ # # ][ # # ]: 0 : if( (pState->maValue >>= nValue) && !nValue )
[ # # ]
72 : 0 : lcl_RemoveState( pState );
73 : 0 : }
74 : :
75 : 0 : void lcl_AddState(::std::vector< XMLPropertyState >& rPropState, sal_Int32 nIndex, const rtl::OUString& rProperty, uno::Reference< beans::XPropertySet >& xProps)
76 : : {
77 [ # # ][ # # ]: 0 : if(::cppu::any2bool(xProps->getPropertyValue(rProperty)))
78 [ # # ]: 0 : rPropState.push_back(XMLPropertyState (nIndex, cppu::bool2any(sal_True)));
79 : 0 : }
80 : :
81 : : //______________________________________________________________________________
82 : : // helper struct to handle equal XMLPropertyState's for page, header and footer
83 : :
84 : : struct XMLPropertyStateBuffer
85 : : {
86 : : XMLPropertyState* pPMMarginAll;
87 : : XMLPropertyState* pPMMarginTop;
88 : : XMLPropertyState* pPMMarginBottom;
89 : : XMLPropertyState* pPMMarginLeft;
90 : : XMLPropertyState* pPMMarginRight;
91 : :
92 : : XMLPropertyState* pPMBorderAll;
93 : : XMLPropertyState* pPMBorderTop;
94 : : XMLPropertyState* pPMBorderBottom;
95 : : XMLPropertyState* pPMBorderLeft;
96 : : XMLPropertyState* pPMBorderRight;
97 : :
98 : : XMLPropertyState* pPMBorderWidthAll;
99 : : XMLPropertyState* pPMBorderWidthTop;
100 : : XMLPropertyState* pPMBorderWidthBottom;
101 : : XMLPropertyState* pPMBorderWidthLeft;
102 : : XMLPropertyState* pPMBorderWidthRight;
103 : :
104 : : XMLPropertyState* pPMPaddingAll;
105 : : XMLPropertyState* pPMPaddingTop;
106 : : XMLPropertyState* pPMPaddingBottom;
107 : : XMLPropertyState* pPMPaddingLeft;
108 : : XMLPropertyState* pPMPaddingRight;
109 : :
110 : : XMLPropertyStateBuffer();
111 : : void ContextFilter( ::std::vector< XMLPropertyState >& rPropState );
112 : : };
113 : :
114 : 159 : XMLPropertyStateBuffer::XMLPropertyStateBuffer()
115 : : : pPMMarginAll( NULL )
116 : : , pPMMarginTop( NULL )
117 : : , pPMMarginBottom( NULL )
118 : : , pPMMarginLeft( NULL )
119 : : , pPMMarginRight( NULL )
120 : : ,
121 : : pPMBorderAll( NULL ),
122 : : pPMBorderTop( NULL ),
123 : : pPMBorderBottom( NULL ),
124 : : pPMBorderLeft( NULL ),
125 : : pPMBorderRight( NULL ),
126 : :
127 : : pPMBorderWidthAll( NULL ),
128 : : pPMBorderWidthTop( NULL ),
129 : : pPMBorderWidthBottom( NULL ),
130 : : pPMBorderWidthLeft( NULL ),
131 : : pPMBorderWidthRight( NULL ),
132 : :
133 : : pPMPaddingAll( NULL ),
134 : : pPMPaddingTop( NULL ),
135 : : pPMPaddingBottom( NULL ),
136 : : pPMPaddingLeft( NULL ),
137 : 159 : pPMPaddingRight( NULL )
138 : : {
139 : 159 : }
140 : :
141 : 159 : void XMLPropertyStateBuffer::ContextFilter( ::std::vector< XMLPropertyState >& )
142 : : {
143 [ + + ]: 159 : if (pPMMarginAll)
144 : : {
145 [ + + ][ + + ]: 40 : if (pPMMarginTop && pPMMarginBottom && pPMMarginLeft && pPMMarginRight)
[ + - ][ + - ]
146 : : {
147 : 24 : sal_Int32 nTop = 0, nBottom = 0, nLeft = 0, nRight = 0;
148 : :
149 : 24 : pPMMarginTop->maValue >>= nTop;
150 : 24 : pPMMarginBottom->maValue >>= nBottom;
151 : 24 : pPMMarginLeft->maValue >>= nLeft;
152 : 24 : pPMMarginRight->maValue >>= nRight;
153 : :
154 : : // Don't remove the Margin Left,Right,Top,Bottom for backward compatibility
155 [ + + ][ - + ]: 24 : if ((nTop != nBottom) || (nBottom != nLeft) || (nLeft != nRight))
[ + - ]
156 : 24 : lcl_RemoveState( pPMMarginAll );
157 : : }
158 : : else
159 : 40 : lcl_RemoveState( pPMMarginAll );
160 : : }
161 : :
162 [ + + ]: 159 : if( pPMBorderAll )
163 : : {
164 [ + - ][ + - ]: 8 : if( pPMBorderTop && pPMBorderBottom && pPMBorderLeft && pPMBorderRight )
[ + - ][ + - ]
165 : : {
166 : 8 : table::BorderLine2 aLineTop, aLineBottom, aLineLeft, aLineRight;
167 : :
168 [ + - ]: 8 : pPMBorderTop->maValue >>= aLineTop;
169 [ + - ]: 8 : pPMBorderBottom->maValue >>= aLineBottom;
170 [ + - ]: 8 : pPMBorderLeft->maValue >>= aLineLeft;
171 [ + - ]: 8 : pPMBorderRight->maValue >>= aLineRight;
172 : :
173 [ + - ][ + - ]: 8 : if( (aLineTop == aLineBottom) && (aLineBottom == aLineLeft) && (aLineLeft == aLineRight) )
[ + - ][ + - ]
174 : : {
175 : 8 : lcl_RemoveState( pPMBorderTop );
176 : 8 : lcl_RemoveState( pPMBorderBottom );
177 : 8 : lcl_RemoveState( pPMBorderLeft );
178 : 8 : lcl_RemoveState( pPMBorderRight );
179 : : }
180 : : else
181 : 8 : lcl_RemoveState( pPMBorderAll );
182 : : }
183 : : else
184 : 8 : lcl_RemoveState( pPMBorderAll );
185 : : }
186 : :
187 [ + + ]: 159 : if( pPMBorderWidthAll )
188 : : {
189 [ + - ][ + - ]: 8 : if( pPMBorderWidthTop && pPMBorderWidthBottom && pPMBorderWidthLeft && pPMBorderWidthRight )
[ + - ][ + - ]
190 : : {
191 : 8 : table::BorderLine2 aLineTop, aLineBottom, aLineLeft, aLineRight;
192 : :
193 [ + - ]: 8 : pPMBorderWidthTop->maValue >>= aLineTop;
194 [ + - ]: 8 : pPMBorderWidthBottom->maValue >>= aLineBottom;
195 [ + - ]: 8 : pPMBorderWidthLeft->maValue >>= aLineLeft;
196 [ + - ]: 8 : pPMBorderWidthRight->maValue >>= aLineRight;
197 : :
198 [ + - + - : 24 : if( lcl_HasSameLineWidth( aLineTop, aLineBottom ) &&
+ - ][ + - ]
199 : 8 : lcl_HasSameLineWidth( aLineBottom, aLineLeft ) &&
200 : 8 : lcl_HasSameLineWidth( aLineLeft, aLineRight ) )
201 : : {
202 : 8 : lcl_RemoveState( pPMBorderWidthTop );
203 : 8 : lcl_RemoveState( pPMBorderWidthBottom );
204 : 8 : lcl_RemoveState( pPMBorderWidthLeft );
205 : 8 : lcl_RemoveState( pPMBorderWidthRight );
206 : : }
207 : : else
208 : 8 : lcl_RemoveState( pPMBorderWidthAll );
209 : : }
210 : : else
211 : 8 : lcl_RemoveState( pPMBorderWidthAll );
212 : : }
213 : :
214 [ + + ]: 159 : if( pPMPaddingAll )
215 : : {
216 [ + - ][ + - ]: 8 : if( pPMPaddingTop && pPMPaddingBottom && pPMPaddingLeft && pPMPaddingRight )
[ + - ][ + - ]
217 : : {
218 : 8 : sal_Int32 nTop = 0, nBottom = 0, nLeft = 0, nRight = 0;
219 : :
220 : 8 : pPMPaddingTop->maValue >>= nTop;
221 : 8 : pPMPaddingBottom->maValue >>= nBottom;
222 : 8 : pPMPaddingLeft->maValue >>= nLeft;
223 : 8 : pPMPaddingRight->maValue >>= nRight;
224 : :
225 [ + - ][ + - ]: 8 : if( (nTop == nBottom) && (nBottom == nLeft) && (nLeft == nRight) )
[ + - ]
226 : : {
227 : 8 : lcl_RemoveState( pPMPaddingTop );
228 : 8 : lcl_RemoveState( pPMPaddingBottom );
229 : 8 : lcl_RemoveState( pPMPaddingLeft );
230 : 8 : lcl_RemoveState( pPMPaddingRight );
231 : : }
232 : : else
233 : 8 : lcl_RemoveState( pPMPaddingAll );
234 : : }
235 : : else
236 : 8 : lcl_RemoveState( pPMPaddingAll );
237 : : }
238 : 159 : }
239 : :
240 : : //______________________________________________________________________________
241 : :
242 : 25 : XMLPageMasterExportPropMapper::XMLPageMasterExportPropMapper(
243 : : const UniReference< XMLPropertySetMapper >& rMapper,
244 : : SvXMLExport& rExport ) :
245 : : SvXMLExportPropertyMapper( rMapper ),
246 : : aBackgroundImageExport( rExport ),
247 : : aTextColumnsExport( rExport ),
248 [ + - ][ + - ]: 25 : aFootnoteSeparatorExport( rExport )
[ + - ]
249 : : {
250 : 25 : }
251 : :
252 [ + - ][ + - ]: 25 : XMLPageMasterExportPropMapper::~XMLPageMasterExportPropMapper()
253 : : {
254 [ - + ]: 50 : }
255 : :
256 : 56 : void XMLPageMasterExportPropMapper::handleElementItem(
257 : : SvXMLExport&,
258 : : const XMLPropertyState& rProperty,
259 : : sal_uInt16 /*nFlags*/,
260 : : const ::std::vector< XMLPropertyState >* pProperties,
261 : : sal_uInt32 nIdx ) const
262 : : {
263 : 56 : XMLPageMasterExportPropMapper* pThis = (XMLPageMasterExportPropMapper*) this;
264 : :
265 : 56 : sal_uInt32 nContextId = getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex );
266 [ + - + + ]: 56 : switch( nContextId )
267 : : {
268 : : case CTF_PM_GRAPHICURL:
269 : : case CTF_PM_HEADERGRAPHICURL:
270 : : case CTF_PM_FOOTERGRAPHICURL:
271 : : {
272 : : DBG_ASSERT( pProperties && (nIdx >= 2), "property vector missing" );
273 : : sal_Int32 nPos;
274 : : sal_Int32 nFilter;
275 [ - + + - ]: 8 : switch( nContextId )
276 : : {
277 : : case CTF_PM_GRAPHICURL:
278 : 0 : nPos = CTF_PM_GRAPHICPOSITION;
279 : 0 : nFilter = CTF_PM_GRAPHICFILTER;
280 : 0 : break;
281 : : case CTF_PM_HEADERGRAPHICURL:
282 : 4 : nPos = CTF_PM_HEADERGRAPHICPOSITION;
283 : 4 : nFilter = CTF_PM_HEADERGRAPHICFILTER;
284 : 4 : break;
285 : : case CTF_PM_FOOTERGRAPHICURL:
286 : 4 : nPos = CTF_PM_FOOTERGRAPHICPOSITION;
287 : 4 : nFilter = CTF_PM_FOOTERGRAPHICFILTER;
288 : 4 : break;
289 : : default:
290 : 0 : nPos = 0; // TODO What values should this be?
291 : 0 : nFilter = 0;
292 : : }
293 : 8 : const Any* pPos = NULL;
294 : 8 : const Any* pFilter = NULL;
295 [ + - ][ + - ]: 8 : if( pProperties && (nIdx >= 2) )
296 : : {
297 : 8 : const XMLPropertyState& rPos = (*pProperties)[nIdx - 2];
298 : : DBG_ASSERT( getPropertySetMapper()->GetEntryContextId( rPos.mnIndex ) == nPos,
299 : : "invalid property map: pos expected" );
300 [ + - ]: 8 : if( getPropertySetMapper()->GetEntryContextId( rPos.mnIndex ) == nPos )
301 : 8 : pPos = &rPos.maValue;
302 : :
303 : 8 : const XMLPropertyState& rFilter = (*pProperties)[nIdx - 1];
304 : : DBG_ASSERT( getPropertySetMapper()->GetEntryContextId( rFilter.mnIndex ) == nFilter,
305 : : "invalid property map: filter expected" );
306 [ + - ]: 8 : if( getPropertySetMapper()->GetEntryContextId( rFilter.mnIndex ) == nFilter )
307 : 8 : pFilter = &rFilter.maValue;
308 : : }
309 : 8 : sal_uInt32 nPropIndex = rProperty.mnIndex;
310 : : pThis->aBackgroundImageExport.exportXML( rProperty.maValue, pPos, pFilter, NULL,
311 : 8 : getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
312 : 16 : getPropertySetMapper()->GetEntryXMLName( nPropIndex ) );
313 : : }
314 : 8 : break;
315 : : case CTF_PM_TEXTCOLUMNS:
316 : 0 : pThis->aTextColumnsExport.exportXML( rProperty.maValue );
317 : 0 : break;
318 : : case CTF_PM_FTN_LINE_WEIGTH:
319 : : pThis->aFootnoteSeparatorExport.exportXML( pProperties, nIdx,
320 : 24 : getPropertySetMapper());
321 : 24 : break;
322 : : }
323 : 56 : }
324 : :
325 : 160 : void XMLPageMasterExportPropMapper::handleSpecialItem(
326 : : SvXMLAttributeList&,
327 : : const XMLPropertyState&,
328 : : const SvXMLUnitConverter&,
329 : : const SvXMLNamespaceMap&,
330 : : const ::std::vector< XMLPropertyState >*,
331 : : sal_uInt32 /*nIdx*/) const
332 : : {
333 : 160 : }
334 : :
335 : 53 : void XMLPageMasterExportPropMapper::ContextFilter(
336 : : ::std::vector< XMLPropertyState >& rPropState,
337 : : Reference< XPropertySet > rPropSet ) const
338 : : {
339 : 53 : XMLPropertyStateBuffer aPageBuffer;
340 : 53 : XMLPropertyStateBuffer aHeaderBuffer;
341 : 53 : XMLPropertyStateBuffer aFooterBuffer;
342 : :
343 : 53 : XMLPropertyState* pPMHeaderHeight = NULL;
344 : 53 : XMLPropertyState* pPMHeaderMinHeight = NULL;
345 : 53 : XMLPropertyState* pPMHeaderDynamic = NULL;
346 : :
347 : 53 : XMLPropertyState* pPMFooterHeight = NULL;
348 : 53 : XMLPropertyState* pPMFooterMinHeight = NULL;
349 : 53 : XMLPropertyState* pPMFooterDynamic = NULL;
350 : :
351 : 53 : XMLPropertyState* pPMScaleTo = NULL;
352 : 53 : XMLPropertyState* pPMScaleToPages = NULL;
353 : 53 : XMLPropertyState* pPMScaleToX = NULL;
354 : 53 : XMLPropertyState* pPMScaleToY = NULL;
355 : 53 : XMLPropertyState* pPMStandardMode = NULL;
356 : 53 : XMLPropertyState* pPMGridBaseWidth = NULL;
357 : : // same as pPMGridSnapTo but for backward compatibility only
358 : 53 : XMLPropertyState* pPMGridSnapToChars = NULL;
359 : 53 : XMLPropertyState* pPMGridSnapTo = NULL;
360 : :
361 : 53 : XMLPropertyState* pPrint = NULL;
362 : :
363 [ + - ]: 53 : UniReference < XMLPropertySetMapper > aPropMapper(getPropertySetMapper());
364 : :
365 [ + - ][ + + ]: 899 : for( ::std::vector< XMLPropertyState >::iterator aIter = rPropState.begin(); aIter != rPropState.end(); ++aIter )
366 : : {
367 : 846 : XMLPropertyState *pProp = &(*aIter);
368 [ + - ][ + - ]: 846 : sal_Int16 nContextId = aPropMapper->GetEntryContextId( pProp->mnIndex );
369 : 846 : sal_Int16 nFlag = nContextId & CTF_PM_FLAGMASK;
370 : 846 : sal_Int16 nSimpleId = nContextId & (~CTF_PM_FLAGMASK | XML_PM_CTF_START);
371 : 846 : sal_Int16 nPrintId = nContextId & CTF_PM_PRINTMASK;
372 : :
373 : : XMLPropertyStateBuffer* pBuffer;
374 [ + + + ]: 846 : switch( nFlag )
375 : : {
376 : 128 : case CTF_PM_HEADERFLAG: pBuffer = &aHeaderBuffer; break;
377 : 128 : case CTF_PM_FOOTERFLAG: pBuffer = &aFooterBuffer; break;
378 : 590 : default: pBuffer = &aPageBuffer; break;
379 : : }
380 : :
381 [ + + + + : 846 : switch( nSimpleId )
+ + + + +
+ + + + +
+ + + + +
+ + ]
382 : : {
383 : 40 : case CTF_PM_MARGINALL: pBuffer->pPMMarginAll = pProp; break;
384 : 32 : case CTF_PM_MARGINTOP: pBuffer->pPMMarginTop = pProp; break;
385 : 32 : case CTF_PM_MARGINBOTTOM: pBuffer->pPMMarginBottom = pProp; break;
386 : 40 : case CTF_PM_MARGINLEFT: pBuffer->pPMMarginLeft = pProp; break;
387 : 40 : case CTF_PM_MARGINRIGHT: pBuffer->pPMMarginRight = pProp; break;
388 : 8 : case CTF_PM_BORDERALL: pBuffer->pPMBorderAll = pProp; break;
389 : 8 : case CTF_PM_BORDERTOP: pBuffer->pPMBorderTop = pProp; break;
390 : 8 : case CTF_PM_BORDERBOTTOM: pBuffer->pPMBorderBottom = pProp; break;
391 : 8 : case CTF_PM_BORDERLEFT: pBuffer->pPMBorderLeft = pProp; break;
392 : 8 : case CTF_PM_BORDERRIGHT: pBuffer->pPMBorderRight = pProp; break;
393 : 8 : case CTF_PM_BORDERWIDTHALL: pBuffer->pPMBorderWidthAll = pProp; break;
394 : 8 : case CTF_PM_BORDERWIDTHTOP: pBuffer->pPMBorderWidthTop = pProp; break;
395 : 8 : case CTF_PM_BORDERWIDTHBOTTOM: pBuffer->pPMBorderWidthBottom = pProp; break;
396 : 8 : case CTF_PM_BORDERWIDTHLEFT: pBuffer->pPMBorderWidthLeft = pProp; break;
397 : 8 : case CTF_PM_BORDERWIDTHRIGHT: pBuffer->pPMBorderWidthRight = pProp; break;
398 : 8 : case CTF_PM_PADDINGALL: pBuffer->pPMPaddingAll = pProp; break;
399 : 8 : case CTF_PM_PADDINGTOP: pBuffer->pPMPaddingTop = pProp; break;
400 : 8 : case CTF_PM_PADDINGBOTTOM: pBuffer->pPMPaddingBottom = pProp; break;
401 : 8 : case CTF_PM_PADDINGLEFT: pBuffer->pPMPaddingLeft = pProp; break;
402 : 8 : case CTF_PM_PADDINGRIGHT: pBuffer->pPMPaddingRight = pProp; break;
403 : : }
404 : :
405 [ + + - + : 846 : switch( nContextId )
+ - - - -
- + + + +
+ ]
406 : : {
407 : 8 : case CTF_PM_HEADERHEIGHT: pPMHeaderHeight = pProp; break;
408 : 8 : case CTF_PM_HEADERMINHEIGHT: pPMHeaderMinHeight = pProp; break;
409 : 0 : case CTF_PM_HEADERDYNAMIC: pPMHeaderDynamic = pProp; break;
410 : 8 : case CTF_PM_FOOTERHEIGHT: pPMFooterHeight = pProp; break;
411 : 8 : case CTF_PM_FOOTERMINHEIGHT: pPMFooterMinHeight = pProp; break;
412 : 0 : case CTF_PM_FOOTERDYNAMIC: pPMFooterDynamic = pProp; break;
413 : 0 : case CTF_PM_SCALETO: pPMScaleTo = pProp; break;
414 : 0 : case CTF_PM_SCALETOPAGES: pPMScaleToPages = pProp; break;
415 : 0 : case CTF_PM_SCALETOX: pPMScaleToX = pProp; break;
416 : 0 : case CTF_PM_SCALETOY: pPMScaleToY = pProp; break;
417 : 27 : case CTF_PM_STANDARD_MODE: pPMStandardMode = pProp; break;
418 : 6 : case CTP_PM_GRID_BASE_WIDTH: pPMGridBaseWidth = pProp; break;
419 : 6 : case CTP_PM_GRID_SNAP_TO_CHARS: pPMGridSnapToChars = pProp; break;
420 : 6 : case CTP_PM_GRID_SNAP_TO: pPMGridSnapTo = pProp; break;
421 : : }
422 [ - + ]: 846 : if (nPrintId == CTF_PM_PRINTMASK)
423 : : {
424 : 0 : pPrint = pProp;
425 : 0 : lcl_RemoveState(pPrint);
426 : : }
427 : : }
428 : :
429 [ + + ][ + - ]: 53 : if( pPMStandardMode && !getBOOL(pPMStandardMode->maValue) )
[ + - ][ + + ]
430 : : {
431 : 27 : lcl_RemoveState(pPMStandardMode);
432 [ + + ]: 27 : if( pPMGridBaseWidth )
433 : 6 : lcl_RemoveState(pPMGridBaseWidth);
434 [ + + ]: 27 : if( pPMGridSnapToChars )
435 : 6 : lcl_RemoveState(pPMGridSnapToChars);
436 [ + + ]: 27 : if (pPMGridSnapTo)
437 : : {
438 : 6 : lcl_RemoveState(pPMGridSnapTo);
439 : : }
440 : : }
441 : :
442 [ + + ][ + - ]: 53 : if( pPMGridBaseWidth && pPMStandardMode )
443 : 6 : lcl_RemoveState(pPMStandardMode);
444 : :
445 [ + - ]: 53 : aPageBuffer.ContextFilter( rPropState );
446 [ + - ]: 53 : aHeaderBuffer.ContextFilter( rPropState );
447 [ + - ]: 53 : aFooterBuffer.ContextFilter( rPropState );
448 : :
449 [ + + ][ - + ]: 53 : if( pPMHeaderHeight && (!pPMHeaderDynamic || (pPMHeaderDynamic && getBOOL( pPMHeaderDynamic->maValue ))) )
[ # # ][ # # ]
[ # # ][ + + ]
450 : 8 : lcl_RemoveState( pPMHeaderHeight );
451 [ + + ][ - + ]: 53 : if( pPMHeaderMinHeight && pPMHeaderDynamic && !getBOOL( pPMHeaderDynamic->maValue ) )
[ # # ][ # # ]
[ - + ]
452 : 0 : lcl_RemoveState( pPMHeaderMinHeight );
453 [ - + ]: 53 : if( pPMHeaderDynamic )
454 : 0 : lcl_RemoveState( pPMHeaderDynamic );
455 : :
456 [ + + ][ - + ]: 53 : if( pPMFooterHeight && (!pPMFooterDynamic || (pPMFooterDynamic && getBOOL( pPMFooterDynamic->maValue ))) )
[ # # ][ # # ]
[ # # ][ + + ]
457 : 8 : lcl_RemoveState( pPMFooterHeight );
458 [ + + ][ - + ]: 53 : if( pPMFooterMinHeight && pPMFooterDynamic && !getBOOL( pPMFooterDynamic->maValue ) )
[ # # ][ # # ]
[ - + ]
459 : 0 : lcl_RemoveState( pPMFooterMinHeight );
460 [ - + ]: 53 : if( pPMFooterDynamic )
461 : 0 : lcl_RemoveState( pPMFooterDynamic );
462 : :
463 [ - + ]: 53 : if( pPMScaleTo )
464 : 0 : lcl_RemoveStateIfZero16( pPMScaleTo );
465 [ - + ]: 53 : if( pPMScaleToPages )
466 : 0 : lcl_RemoveStateIfZero16( pPMScaleToPages );
467 [ - + ]: 53 : if( pPMScaleToX )
468 : 0 : lcl_RemoveStateIfZero16( pPMScaleToX );
469 [ - + ]: 53 : if( pPMScaleToY )
470 : 0 : lcl_RemoveStateIfZero16( pPMScaleToY );
471 : :
472 [ - + ]: 53 : if (pPrint)
473 : : {
474 [ # # ][ # # ]: 0 : lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_ANNOTATIONS), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintAnnotations")), rPropSet);
[ # # ][ # # ]
475 [ # # ][ # # ]: 0 : lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_CHARTS), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintCharts")), rPropSet);
[ # # ][ # # ]
476 [ # # ][ # # ]: 0 : lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_DRAWING), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintDrawing")), rPropSet);
[ # # ][ # # ]
477 [ # # ][ # # ]: 0 : lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_FORMULAS), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintFormulas")), rPropSet);
[ # # ][ # # ]
478 [ # # ][ # # ]: 0 : lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_GRID), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintGrid")), rPropSet);
[ # # ][ # # ]
479 [ # # ][ # # ]: 0 : lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_HEADERS), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintHeaders")), rPropSet);
[ # # ][ # # ]
480 [ # # ][ # # ]: 0 : lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_OBJECTS), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintObjects")), rPropSet);
[ # # ][ # # ]
481 [ # # ][ # # ]: 0 : lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_ZEROVALUES), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrintZeroValues")), rPropSet);
[ # # ][ # # ]
482 : : }
483 : :
484 [ + - ][ + - ]: 53 : SvXMLExportPropertyMapper::ContextFilter(rPropState,rPropSet);
485 : 53 : }
486 : :
487 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|