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 <tools/debug.hxx>
30 : : #include <xmloff/txtprmap.hxx>
31 : : #include <com/sun/star/table/BorderLine2.hpp>
32 : :
33 : : #include "txtexppr.hxx"
34 : :
35 : : #include <com/sun/star/text/SizeType.hpp>
36 : : #include <com/sun/star/text/WrapTextMode.hpp>
37 : : #include <com/sun/star/text/TextContentAnchorType.hpp>
38 : : #include <com/sun/star/awt/FontFamily.hpp>
39 : : #include <com/sun/star/awt/FontPitch.hpp>
40 : : #include <com/sun/star/awt/FontUnderline.hpp>
41 : : #include <com/sun/star/text/XChapterNumberingSupplier.hpp>
42 : :
43 : : #include <xmloff/xmlexp.hxx>
44 : : #include "XMLSectionFootnoteConfigExport.hxx"
45 : :
46 : : using ::rtl::OUString;
47 : : using ::rtl::OUStringBuffer;
48 : :
49 : : using namespace ::com::sun::star;
50 : : using namespace ::com::sun::star::uno;
51 : : using namespace ::com::sun::star::style;
52 : : using namespace ::com::sun::star::beans;
53 : : using namespace ::com::sun::star::text;
54 : : using namespace ::com::sun::star::awt;
55 : :
56 : 43 : void XMLTextExportPropertySetMapper::handleElementItem(
57 : : SvXMLExport& rExp,
58 : : const XMLPropertyState& rProperty,
59 : : sal_uInt16 nFlags,
60 : : const ::std::vector< XMLPropertyState > *pProperties,
61 : : sal_uInt32 nIdx ) const
62 : : {
63 : : XMLTextExportPropertySetMapper *pThis =
64 : 43 : ((XMLTextExportPropertySetMapper *)this);
65 : :
66 [ - + + + : 43 : switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ) )
- - - ]
67 : : {
68 : : case CTF_DROPCAPFORMAT:
69 : : pThis->maDropCapExport.exportXML( rProperty.maValue, bDropWholeWord,
70 : 0 : sDropCharStyle );
71 : 0 : pThis->bDropWholeWord = sal_False;
72 : 0 : pThis->sDropCharStyle = OUString();
73 : 0 : break;
74 : :
75 : : case CTF_TABSTOP:
76 : 33 : pThis->maTabStopExport.Export( rProperty.maValue );
77 : 33 : break;
78 : :
79 : : case CTF_TEXTCOLUMNS:
80 : 8 : pThis->maTextColumnsExport.exportXML( rProperty.maValue );
81 : 8 : break;
82 : :
83 : : case CTF_BACKGROUND_URL:
84 : : {
85 : : DBG_ASSERT( pProperties && nIdx >= 3,
86 : : "property vector missing" );
87 : 2 : const Any *pPos = 0, *pFilter = 0, *pTrans = 0;
88 [ + - ][ + - ]: 2 : if( pProperties && nIdx >= 3 )
89 : : {
90 : 2 : const XMLPropertyState& rTrans = (*pProperties)[nIdx-3];
91 : : // #99657# transparency may be there, but doesn't have to be.
92 : : // If it's there, it must be in the right position.
93 [ - + ]: 4 : if( CTF_BACKGROUND_TRANSPARENCY == getPropertySetMapper()
94 : 2 : ->GetEntryContextId( rTrans.mnIndex ) )
95 : 0 : pTrans = &rTrans.maValue;
96 : :
97 : 2 : const XMLPropertyState& rPos = (*pProperties)[nIdx-2];
98 : : DBG_ASSERT( CTF_BACKGROUND_POS == getPropertySetMapper()
99 : : ->GetEntryContextId( rPos.mnIndex ),
100 : : "invalid property map: pos expected" );
101 [ + - ]: 4 : if( CTF_BACKGROUND_POS == getPropertySetMapper()
102 : 2 : ->GetEntryContextId( rPos.mnIndex ) )
103 : 2 : pPos = &rPos.maValue;
104 : :
105 : 2 : const XMLPropertyState& rFilter = (*pProperties)[nIdx-1];
106 : : DBG_ASSERT( CTF_BACKGROUND_FILTER == getPropertySetMapper()
107 : : ->GetEntryContextId( rFilter.mnIndex ),
108 : : "invalid property map: filter expected" );
109 [ + - ]: 4 : if( CTF_BACKGROUND_FILTER == getPropertySetMapper()
110 : 2 : ->GetEntryContextId( rFilter.mnIndex ) )
111 : 2 : pFilter = &rFilter.maValue;
112 : : }
113 : 2 : sal_uInt32 nPropIndex = rProperty.mnIndex;
114 : : pThis->maBackgroundImageExport.exportXML(
115 : : rProperty.maValue, pPos, pFilter, pTrans,
116 : 2 : getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
117 : 4 : getPropertySetMapper()->GetEntryXMLName( nPropIndex ) );
118 : : }
119 : 2 : break;
120 : :
121 : : case CTF_SECTION_FOOTNOTE_END:
122 : : XMLSectionFootnoteConfigExport::exportXML(rExp, sal_False,
123 : : pProperties, nIdx,
124 : 0 : getPropertySetMapper());
125 : 0 : break;
126 : :
127 : : case CTF_SECTION_ENDNOTE_END:
128 : : XMLSectionFootnoteConfigExport::exportXML(rExp, sal_True,
129 : : pProperties, nIdx,
130 : 0 : getPropertySetMapper());
131 : 0 : break;
132 : :
133 : : default:
134 : 0 : SvXMLExportPropertyMapper::handleElementItem( rExp, rProperty, nFlags, pProperties, nIdx );
135 : 0 : break;
136 : : }
137 : 43 : }
138 : :
139 : 7 : void XMLTextExportPropertySetMapper::handleSpecialItem(
140 : : SvXMLAttributeList& rAttrList,
141 : : const XMLPropertyState& rProperty,
142 : : const SvXMLUnitConverter& rUnitConverter,
143 : : const SvXMLNamespaceMap& rNamespaceMap,
144 : : const ::std::vector< XMLPropertyState > *pProperties,
145 : : sal_uInt32 nIdx ) const
146 : : {
147 : : XMLTextExportPropertySetMapper *pThis =
148 : 7 : ((XMLTextExportPropertySetMapper *)this);
149 : :
150 [ - - + - ]: 7 : switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ) )
151 : : {
152 : : case CTF_DROPCAPWHOLEWORD:
153 : : DBG_ASSERT( !bDropWholeWord, "drop whole word is set already!" );
154 : 0 : pThis->bDropWholeWord = *(sal_Bool *)rProperty.maValue.getValue();
155 : 0 : break;
156 : : case CTF_DROPCAPCHARSTYLE:
157 : : DBG_ASSERT( sDropCharStyle.isEmpty(), "drop char style is set already!" );
158 : 0 : rProperty.maValue >>= pThis->sDropCharStyle;
159 : 0 : break;
160 : : case CTF_NUMBERINGSTYLENAME:
161 : : case CTF_PAGEDESCNAME:
162 : : case CTF_OLDTEXTBACKGROUND:
163 : : case CTF_BACKGROUND_POS:
164 : : case CTF_BACKGROUND_FILTER:
165 : : case CTF_BACKGROUND_TRANSPARENCY:
166 : : case CTF_SECTION_FOOTNOTE_NUM_OWN:
167 : : case CTF_SECTION_FOOTNOTE_NUM_RESTART:
168 : : case CTF_SECTION_FOOTNOTE_NUM_RESTART_AT:
169 : : case CTF_SECTION_FOOTNOTE_NUM_TYPE:
170 : : case CTF_SECTION_FOOTNOTE_NUM_PREFIX:
171 : : case CTF_SECTION_FOOTNOTE_NUM_SUFFIX:
172 : : case CTF_SECTION_ENDNOTE_NUM_OWN:
173 : : case CTF_SECTION_ENDNOTE_NUM_RESTART:
174 : : case CTF_SECTION_ENDNOTE_NUM_RESTART_AT:
175 : : case CTF_SECTION_ENDNOTE_NUM_TYPE:
176 : : case CTF_SECTION_ENDNOTE_NUM_PREFIX:
177 : : case CTF_SECTION_ENDNOTE_NUM_SUFFIX:
178 : : case CTF_DEFAULT_OUTLINE_LEVEL:
179 : : case CTF_OLD_FLOW_WITH_TEXT:
180 : : // There's nothing to do here!
181 : 7 : break;
182 : : default:
183 : 0 : SvXMLExportPropertyMapper::handleSpecialItem(rAttrList, rProperty, rUnitConverter, rNamespaceMap, pProperties, nIdx );
184 : 0 : break;
185 : : }
186 : 7 : }
187 : :
188 : 753 : XMLTextExportPropertySetMapper::XMLTextExportPropertySetMapper(
189 : : const UniReference< XMLPropertySetMapper >& rMapper,
190 : : SvXMLExport& rExp ) :
191 : : SvXMLExportPropertyMapper( rMapper ),
192 : : rExport( rExp ),
193 : : bDropWholeWord( sal_False ),
194 : : maDropCapExport( rExp ),
195 : : maTabStopExport( rExp ),
196 : : maTextColumnsExport( rExp ),
197 [ + - ][ + - ]: 753 : maBackgroundImageExport( rExp )
[ + - ][ + - ]
198 : : {
199 : 753 : }
200 : :
201 [ + - ][ + - ]: 743 : XMLTextExportPropertySetMapper::~XMLTextExportPropertySetMapper()
[ + - ]
202 : : {
203 [ - + ]: 1486 : }
204 : :
205 : 455 : void XMLTextExportPropertySetMapper::ContextFontFilter(
206 : : XMLPropertyState *pFontNameState,
207 : : XMLPropertyState *pFontFamilyNameState,
208 : : XMLPropertyState *pFontStyleNameState,
209 : : XMLPropertyState *pFontFamilyState,
210 : : XMLPropertyState *pFontPitchState,
211 : : XMLPropertyState *pFontCharsetState ) const
212 : : {
213 : 455 : OUString sFamilyName;
214 : 455 : OUString sStyleName;
215 : 455 : sal_Int16 nFamily = FontFamily::DONTKNOW;
216 : 455 : sal_Int16 nPitch = FontPitch::DONTKNOW;
217 : 455 : rtl_TextEncoding eEnc = RTL_TEXTENCODING_DONTKNOW;
218 : :
219 : 455 : OUString sTmp;
220 [ + - ][ + + ]: 455 : if( pFontFamilyNameState && (pFontFamilyNameState->maValue >>= sTmp ) )
[ + + ]
221 : 392 : sFamilyName = sTmp;
222 [ + + ][ + - ]: 455 : if( pFontStyleNameState && (pFontStyleNameState->maValue >>= sTmp ) )
[ + + ]
223 : 392 : sStyleName = sTmp;
224 : :
225 : 455 : sal_Int16 nTmp = sal_Int16();
226 [ + + ][ + - ]: 455 : if( pFontFamilyState && (pFontFamilyState->maValue >>= nTmp ) )
[ + + ]
227 : 392 : nFamily = nTmp;
228 [ + + ][ + - ]: 455 : if( pFontPitchState && (pFontPitchState->maValue >>= nTmp ) )
[ + + ]
229 : 392 : nPitch = nTmp;
230 [ + + ][ + - ]: 455 : if( pFontCharsetState && (pFontCharsetState->maValue >>= nTmp ) )
[ + + ]
231 : 392 : eEnc = (rtl_TextEncoding)nTmp;
232 : :
233 : 455 : OUString sName( ((SvXMLExport&)GetExport()).GetFontAutoStylePool()->Find(
234 [ + - ][ + - ]: 455 : sFamilyName, sStyleName, nFamily, nPitch, eEnc ) );
[ + - ][ + - ]
235 [ + + ]: 455 : if( !sName.isEmpty() )
236 : : {
237 [ + - ]: 272 : pFontNameState->maValue <<= sName;
238 [ + - ]: 272 : if( pFontFamilyNameState )
239 : 272 : pFontFamilyNameState->mnIndex = -1;
240 [ + - ]: 272 : if( pFontStyleNameState )
241 : 272 : pFontStyleNameState->mnIndex = -1;
242 [ + - ]: 272 : if( pFontFamilyState )
243 : 272 : pFontFamilyState->mnIndex = -1;
244 [ + - ]: 272 : if( pFontPitchState )
245 : 272 : pFontPitchState->mnIndex = -1;
246 [ + - ]: 272 : if( pFontCharsetState )
247 : 272 : pFontCharsetState->mnIndex = -1;
248 : : }
249 : : else
250 : : {
251 : 183 : pFontNameState->mnIndex = -1;
252 : : }
253 : :
254 [ + + ][ - + ]: 455 : if( pFontFamilyNameState && sFamilyName.isEmpty() )
[ - + ]
255 : : {
256 : 0 : pFontFamilyNameState->mnIndex = -1;
257 : : }
258 : :
259 [ + + ][ + - ]: 455 : if( pFontStyleNameState && sStyleName.isEmpty() )
[ + + ]
260 : : {
261 : 392 : pFontStyleNameState->mnIndex = -1;
262 : 455 : }
263 : 455 : }
264 : :
265 : 233 : void XMLTextExportPropertySetMapper::ContextFontHeightFilter(
266 : : XMLPropertyState* pCharHeightState,
267 : : XMLPropertyState* pCharPropHeightState,
268 : : XMLPropertyState* pCharDiffHeightState ) const
269 : : {
270 [ + - ]: 233 : if( pCharPropHeightState )
271 : : {
272 : 233 : sal_Int32 nTemp = 0;
273 : 233 : pCharPropHeightState->maValue >>= nTemp;
274 [ + - ]: 233 : if( nTemp == 100 )
275 : : {
276 : 233 : pCharPropHeightState->mnIndex = -1;
277 : 233 : pCharPropHeightState->maValue.clear();
278 : : }
279 : : else
280 : : {
281 : 0 : pCharHeightState->mnIndex = -1;
282 : 233 : pCharHeightState->maValue.clear();
283 : : }
284 : : }
285 [ + - ]: 233 : if( pCharDiffHeightState )
286 : : {
287 : 233 : float nTemp = 0;
288 : 233 : pCharDiffHeightState->maValue >>= nTemp;
289 [ + - ]: 233 : if( nTemp == 0. )
290 : : {
291 : 233 : pCharDiffHeightState->mnIndex = -1;
292 : 233 : pCharDiffHeightState->maValue.clear();
293 : : }
294 : : else
295 : : {
296 : 0 : pCharHeightState->mnIndex = -1;
297 : 233 : pCharHeightState->maValue.clear();
298 : : }
299 : : }
300 : :
301 : 233 : }
302 : :
303 : : // helper method; implementation below
304 : : bool lcl_IsOutlineStyle(const SvXMLExport&, const OUString&);
305 : :
306 : : static void
307 : 6010 : lcl_checkMultiProperty(XMLPropertyState *const pState,
308 : : XMLPropertyState *const pRelState)
309 : : {
310 [ + + ][ + + ]: 6010 : if (pState && pRelState)
311 : : {
312 : 162 : sal_Int32 nTemp = 0;
313 : 162 : pRelState->maValue >>= nTemp;
314 [ + - ]: 162 : if (100 == nTemp)
315 : : {
316 : 162 : pRelState->mnIndex = -1;
317 : 162 : pRelState->maValue.clear();
318 : : }
319 : : else
320 : : {
321 : 0 : pState->mnIndex = -1;
322 : 162 : pState->maValue.clear();
323 : : }
324 : : }
325 : 6010 : }
326 : :
327 : 1202 : void XMLTextExportPropertySetMapper::ContextFilter(
328 : : ::std::vector< XMLPropertyState >& rProperties,
329 : : Reference< XPropertySet > rPropSet ) const
330 : : {
331 : : // filter font
332 : 1202 : XMLPropertyState *pFontNameState = 0;
333 : 1202 : XMLPropertyState *pFontFamilyNameState = 0;
334 : 1202 : XMLPropertyState *pFontStyleNameState = 0;
335 : 1202 : XMLPropertyState *pFontFamilyState = 0;
336 : 1202 : XMLPropertyState *pFontPitchState = 0;
337 : 1202 : XMLPropertyState *pFontCharsetState = 0;
338 : 1202 : XMLPropertyState *pFontNameCJKState = 0;
339 : 1202 : XMLPropertyState *pFontFamilyNameCJKState = 0;
340 : 1202 : XMLPropertyState *pFontStyleNameCJKState = 0;
341 : 1202 : XMLPropertyState *pFontFamilyCJKState = 0;
342 : 1202 : XMLPropertyState *pFontPitchCJKState = 0;
343 : 1202 : XMLPropertyState *pFontCharsetCJKState = 0;
344 : 1202 : XMLPropertyState *pFontNameCTLState = 0;
345 : 1202 : XMLPropertyState *pFontFamilyNameCTLState = 0;
346 : 1202 : XMLPropertyState *pFontStyleNameCTLState = 0;
347 : 1202 : XMLPropertyState *pFontFamilyCTLState = 0;
348 : 1202 : XMLPropertyState *pFontPitchCTLState = 0;
349 : 1202 : XMLPropertyState *pFontCharsetCTLState = 0;
350 : :
351 : : // filter char height point/percent
352 : 1202 : XMLPropertyState* pCharHeightState = NULL;
353 : 1202 : XMLPropertyState* pCharPropHeightState = NULL;
354 : 1202 : XMLPropertyState* pCharDiffHeightState = NULL;
355 : 1202 : XMLPropertyState* pCharHeightCJKState = NULL;
356 : 1202 : XMLPropertyState* pCharPropHeightCJKState = NULL;
357 : 1202 : XMLPropertyState* pCharDiffHeightCJKState = NULL;
358 : 1202 : XMLPropertyState* pCharHeightCTLState = NULL;
359 : 1202 : XMLPropertyState* pCharPropHeightCTLState = NULL;
360 : 1202 : XMLPropertyState* pCharDiffHeightCTLState = NULL;
361 : :
362 : : // filter left margin measure/percent
363 : 1202 : XMLPropertyState* pParaLeftMarginState = NULL;
364 : 1202 : XMLPropertyState* pParaLeftMarginRelState = NULL;
365 : :
366 : : // filter right margin measure/percent
367 : 1202 : XMLPropertyState* pParaRightMarginState = NULL;
368 : 1202 : XMLPropertyState* pParaRightMarginRelState = NULL;
369 : :
370 : : // filter first line indent measure/percent
371 : 1202 : XMLPropertyState* pParaFirstLineState = NULL;
372 : 1202 : XMLPropertyState* pParaFirstLineRelState = NULL;
373 : :
374 : : // filter ParaTopMargin/Relative
375 : 1202 : XMLPropertyState* pParaTopMarginState = NULL;
376 : 1202 : XMLPropertyState* pParaTopMarginRelState = NULL;
377 : :
378 : : // filter ParaTopMargin/Relative
379 : 1202 : XMLPropertyState* pParaBottomMarginState = NULL;
380 : 1202 : XMLPropertyState* pParaBottomMarginRelState = NULL;
381 : :
382 : : // filter (Left|Right|Top|Bottom|)BorderWidth
383 : 1202 : XMLPropertyState* pAllBorderWidthState = NULL;
384 : 1202 : XMLPropertyState* pLeftBorderWidthState = NULL;
385 : 1202 : XMLPropertyState* pRightBorderWidthState = NULL;
386 : 1202 : XMLPropertyState* pTopBorderWidthState = NULL;
387 : 1202 : XMLPropertyState* pBottomBorderWidthState = NULL;
388 : :
389 : : // filter (Left|Right|Top|)BorderDistance
390 : 1202 : XMLPropertyState* pAllBorderDistanceState = NULL;
391 : 1202 : XMLPropertyState* pLeftBorderDistanceState = NULL;
392 : 1202 : XMLPropertyState* pRightBorderDistanceState = NULL;
393 : 1202 : XMLPropertyState* pTopBorderDistanceState = NULL;
394 : 1202 : XMLPropertyState* pBottomBorderDistanceState = NULL;
395 : :
396 : : // filter (Left|Right|Top|Bottom|)Border
397 : 1202 : XMLPropertyState* pAllBorderState = NULL;
398 : 1202 : XMLPropertyState* pLeftBorderState = NULL;
399 : 1202 : XMLPropertyState* pRightBorderState = NULL;
400 : 1202 : XMLPropertyState* pTopBorderState = NULL;
401 : 1202 : XMLPropertyState* pBottomBorderState = NULL;
402 : :
403 : : // filter height properties
404 : 1202 : XMLPropertyState* pHeightMinAbsState = NULL;
405 : 1202 : XMLPropertyState* pHeightMinRelState = NULL;
406 : 1202 : XMLPropertyState* pHeightAbsState = NULL;
407 : 1202 : XMLPropertyState* pHeightRelState = NULL;
408 : 1202 : XMLPropertyState* pSizeTypeState = NULL;
409 : :
410 : : // filter width properties
411 : 1202 : XMLPropertyState* pWidthMinAbsState = NULL;
412 : 1202 : XMLPropertyState* pWidthMinRelState = NULL;
413 : 1202 : XMLPropertyState* pWidthAbsState = NULL;
414 : 1202 : XMLPropertyState* pWidthRelState = NULL;
415 : 1202 : XMLPropertyState* pWidthTypeState = NULL;
416 : :
417 : : // wrap
418 : 1202 : XMLPropertyState* pWrapState = NULL;
419 : 1202 : XMLPropertyState* pWrapContourState = NULL;
420 : 1202 : XMLPropertyState* pWrapContourModeState = NULL;
421 : 1202 : XMLPropertyState* pWrapParagraphOnlyState = NULL;
422 : :
423 : : // anchor
424 : 1202 : XMLPropertyState* pAnchorTypeState = NULL;
425 : :
426 : : // horizontal position and relation
427 : 1202 : XMLPropertyState* pHoriOrientState = NULL;
428 : 1202 : XMLPropertyState* pHoriOrientMirroredState = NULL;
429 : 1202 : XMLPropertyState* pHoriOrientRelState = NULL;
430 : 1202 : XMLPropertyState* pHoriOrientRelFrameState = NULL;
431 : 1202 : XMLPropertyState* pHoriOrientMirrorState = NULL;
432 : : // Horizontal position and relation for shapes (#i28749#)
433 : 1202 : XMLPropertyState* pShapeHoriOrientState = NULL;
434 : 1202 : XMLPropertyState* pShapeHoriOrientMirroredState = NULL;
435 : 1202 : XMLPropertyState* pShapeHoriOrientRelState = NULL;
436 : 1202 : XMLPropertyState* pShapeHoriOrientRelFrameState = NULL;
437 : 1202 : XMLPropertyState* pShapeHoriOrientMirrorState = NULL;
438 : :
439 : : // vertical position and relation
440 : 1202 : XMLPropertyState* pVertOrientState = NULL;
441 : 1202 : XMLPropertyState* pVertOrientAtCharState = NULL;
442 : 1202 : XMLPropertyState* pVertOrientRelState = NULL;
443 : 1202 : XMLPropertyState* pVertOrientRelPageState = NULL;
444 : 1202 : XMLPropertyState* pVertOrientRelFrameState = NULL;
445 : 1202 : XMLPropertyState* pVertOrientRelAsCharState = NULL;
446 : :
447 : : // Vertical position and relation for shapes (#i28749#)
448 : 1202 : XMLPropertyState* pShapeVertOrientState = NULL;
449 : 1202 : XMLPropertyState* pShapeVertOrientAtCharState = NULL;
450 : 1202 : XMLPropertyState* pShapeVertOrientRelState = NULL;
451 : 1202 : XMLPropertyState* pShapeVertOrientRelPageState = NULL;
452 : 1202 : XMLPropertyState* pShapeVertOrientRelFrameState = NULL;
453 : :
454 : : // filter underline color
455 : 1202 : XMLPropertyState* pUnderlineState = NULL;
456 : 1202 : XMLPropertyState* pUnderlineColorState = NULL;
457 : 1202 : XMLPropertyState* pUnderlineHasColorState = NULL;
458 : :
459 : : // filter list style name
460 : 1202 : XMLPropertyState* pListStyleName = NULL;
461 : :
462 : : // filter fo:clip
463 : 1202 : XMLPropertyState* pClip11State = NULL;
464 : 1202 : XMLPropertyState* pClipState = NULL;
465 : :
466 : 1202 : XMLPropertyState* pAllParaMargin = NULL;
467 : 1202 : XMLPropertyState* pAllMargin = NULL;
468 : :
469 : 1202 : sal_Bool bNeedsAnchor = sal_False;
470 : :
471 [ + - ][ + + ]: 28966 : for( ::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin();
472 : 14483 : aIter != rProperties.end();
473 : : ++aIter )
474 : : {
475 : 13281 : XMLPropertyState *propertie = &(*aIter);
476 [ + + ]: 13281 : if( propertie->mnIndex == -1 )
477 : 761 : continue;
478 : :
479 [ + - ][ + - ]: 12520 : switch( getPropertySetMapper()->GetEntryContextId( propertie->mnIndex ) )
[ + + + +
+ + + + +
+ + + + +
+ + + + +
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- + + + +
+ + + + +
+ + + + +
+ + + + +
+ + - - -
+ - + ]
480 : : {
481 : 684 : case CTF_CHARHEIGHT: pCharHeightState = propertie; break;
482 : 69 : case CTF_CHARHEIGHT_REL: pCharPropHeightState = propertie; break;
483 : 69 : case CTF_CHARHEIGHT_DIFF: pCharDiffHeightState = propertie; break;
484 : 514 : case CTF_CHARHEIGHT_CJK: pCharHeightCJKState = propertie; break;
485 : 95 : case CTF_CHARHEIGHT_REL_CJK: pCharPropHeightCJKState = propertie; break;
486 : 95 : case CTF_CHARHEIGHT_DIFF_CJK: pCharDiffHeightCJKState = propertie; break;
487 : 488 : case CTF_CHARHEIGHT_CTL: pCharHeightCTLState = propertie; break;
488 : 69 : case CTF_CHARHEIGHT_REL_CTL: pCharPropHeightCTLState = propertie; break;
489 : 69 : case CTF_CHARHEIGHT_DIFF_CTL: pCharDiffHeightCTLState = propertie; break;
490 : 94 : case CTF_PARALEFTMARGIN: pParaLeftMarginState = propertie; break;
491 : 14 : case CTF_PARALEFTMARGIN_REL: pParaLeftMarginRelState = propertie; break;
492 : 94 : case CTF_PARARIGHTMARGIN: pParaRightMarginState = propertie; break;
493 : 14 : case CTF_PARARIGHTMARGIN_REL: pParaRightMarginRelState = propertie; break;
494 : 94 : case CTF_PARAFIRSTLINE: pParaFirstLineState = propertie; break;
495 : 14 : case CTF_PARAFIRSTLINE_REL: pParaFirstLineRelState = propertie; break;
496 : 219 : case CTF_PARATOPMARGIN: pParaTopMarginState = propertie; break;
497 : 60 : case CTF_PARATOPMARGIN_REL: pParaTopMarginRelState = propertie; break;
498 : 219 : case CTF_PARABOTTOMMARGIN: pParaBottomMarginState = propertie; break;
499 : 60 : case CTF_PARABOTTOMMARGIN_REL: pParaBottomMarginRelState = propertie; break;
500 : 0 : case CTF_ALLBORDERWIDTH: pAllBorderWidthState = propertie; break;
501 : 0 : case CTF_LEFTBORDERWIDTH: pLeftBorderWidthState = propertie; break;
502 : 0 : case CTF_RIGHTBORDERWIDTH: pRightBorderWidthState = propertie; break;
503 : 0 : case CTF_TOPBORDERWIDTH: pTopBorderWidthState = propertie; break;
504 : 0 : case CTF_BOTTOMBORDERWIDTH: pBottomBorderWidthState = propertie; break;
505 : 0 : case CTF_ALLBORDERDISTANCE: pAllBorderDistanceState = propertie; break;
506 : 0 : case CTF_LEFTBORDERDISTANCE: pLeftBorderDistanceState = propertie; break;
507 : 0 : case CTF_RIGHTBORDERDISTANCE: pRightBorderDistanceState = propertie; break;
508 : 0 : case CTF_TOPBORDERDISTANCE: pTopBorderDistanceState = propertie; break;
509 : 0 : case CTF_BOTTOMBORDERDISTANCE: pBottomBorderDistanceState = propertie; break;
510 : 0 : case CTF_ALLBORDER: pAllBorderState = propertie; break;
511 : 0 : case CTF_LEFTBORDER: pLeftBorderState = propertie; break;
512 : 0 : case CTF_RIGHTBORDER: pRightBorderState = propertie; break;
513 : 0 : case CTF_TOPBORDER: pTopBorderState = propertie; break;
514 : 0 : case CTF_BOTTOMBORDER: pBottomBorderState = propertie; break;
515 : :
516 : 0 : case CTF_FRAMEHEIGHT_MIN_ABS: pHeightMinAbsState = propertie; break;
517 : 0 : case CTF_FRAMEHEIGHT_MIN_REL: pHeightMinRelState = propertie; break;
518 : 0 : case CTF_FRAMEHEIGHT_ABS: pHeightAbsState = propertie; break;
519 : 0 : case CTF_FRAMEHEIGHT_REL: pHeightRelState = propertie; break;
520 : 0 : case CTF_SIZETYPE: pSizeTypeState = propertie; break;
521 : :
522 : 0 : case CTF_FRAMEWIDTH_MIN_ABS: pWidthMinAbsState = propertie; break;
523 : 0 : case CTF_FRAMEWIDTH_MIN_REL: pWidthMinRelState = propertie; break;
524 : 0 : case CTF_FRAMEWIDTH_ABS: pWidthAbsState = propertie; break;
525 : 0 : case CTF_FRAMEWIDTH_REL: pWidthRelState = propertie; break;
526 : 0 : case CTF_FRAMEWIDTH_TYPE: pWidthTypeState = propertie; break;
527 : :
528 : 0 : case CTF_WRAP: pWrapState = propertie; break;
529 : 0 : case CTF_WRAP_CONTOUR: pWrapContourState = propertie; break;
530 : 0 : case CTF_WRAP_CONTOUR_MODE: pWrapContourModeState = propertie; break;
531 : 0 : case CTF_WRAP_PARAGRAPH_ONLY: pWrapParagraphOnlyState = propertie; break;
532 : 0 : case CTF_ANCHORTYPE: pAnchorTypeState = propertie; break;
533 : :
534 : 0 : case CTF_HORIZONTALPOS: pHoriOrientState = propertie; bNeedsAnchor = sal_True; break;
535 : 0 : case CTF_HORIZONTALPOS_MIRRORED: pHoriOrientMirroredState = propertie; bNeedsAnchor = sal_True; break;
536 : 0 : case CTF_HORIZONTALREL: pHoriOrientRelState = propertie; bNeedsAnchor = sal_True; break;
537 : 0 : case CTF_HORIZONTALREL_FRAME: pHoriOrientRelFrameState = propertie; bNeedsAnchor = sal_True; break;
538 : 0 : case CTF_HORIZONTALMIRROR: pHoriOrientMirrorState = propertie; bNeedsAnchor = sal_True; break;
539 : 0 : case CTF_VERTICALPOS: pVertOrientState = propertie; bNeedsAnchor = sal_True; break;
540 : 0 : case CTF_VERTICALPOS_ATCHAR: pVertOrientAtCharState = propertie; bNeedsAnchor = sal_True; break;
541 : 0 : case CTF_VERTICALREL: pVertOrientRelState = propertie; bNeedsAnchor = sal_True; break;
542 : 0 : case CTF_VERTICALREL_PAGE: pVertOrientRelPageState = propertie; bNeedsAnchor = sal_True; break;
543 : 0 : case CTF_VERTICALREL_FRAME: pVertOrientRelFrameState = propertie; bNeedsAnchor = sal_True; break;
544 : 0 : case CTF_VERTICALREL_ASCHAR: pVertOrientRelAsCharState = propertie; bNeedsAnchor = sal_True; break;
545 : :
546 : : // Handle new CTFs for shape positioning properties (#i28749#)
547 : 0 : case CTF_SHAPE_HORIZONTALPOS: pShapeHoriOrientState = propertie; bNeedsAnchor = sal_True; break;
548 : 0 : case CTF_SHAPE_HORIZONTALPOS_MIRRORED: pShapeHoriOrientMirroredState = propertie; bNeedsAnchor = sal_True; break;
549 : 0 : case CTF_SHAPE_HORIZONTALREL: pShapeHoriOrientRelState = propertie; bNeedsAnchor = sal_True; break;
550 : 0 : case CTF_SHAPE_HORIZONTALREL_FRAME: pShapeHoriOrientRelFrameState = propertie; bNeedsAnchor = sal_True; break;
551 : 0 : case CTF_SHAPE_HORIZONTALMIRROR: pShapeHoriOrientMirrorState = propertie; bNeedsAnchor = sal_True; break;
552 : 0 : case CTF_SHAPE_VERTICALPOS: pShapeVertOrientState = propertie; bNeedsAnchor = sal_True; break;
553 : 0 : case CTF_SHAPE_VERTICALPOS_ATCHAR: pShapeVertOrientAtCharState = propertie; bNeedsAnchor = sal_True; break;
554 : 0 : case CTF_SHAPE_VERTICALREL: pShapeVertOrientRelState = propertie; bNeedsAnchor = sal_True; break;
555 : 0 : case CTF_SHAPE_VERTICALREL_PAGE: pShapeVertOrientRelPageState = propertie; bNeedsAnchor = sal_True; break;
556 : 0 : case CTF_SHAPE_VERTICALREL_FRAME: pShapeVertOrientRelFrameState = propertie; bNeedsAnchor = sal_True; break;
557 : 132 : case CTF_FONTNAME: pFontNameState = propertie; break;
558 : 135 : case CTF_FONTFAMILYNAME: pFontFamilyNameState = propertie; break;
559 : 111 : case CTF_FONTSTYLENAME: pFontStyleNameState = propertie; break;
560 : 135 : case CTF_FONTFAMILY: pFontFamilyState = propertie; break;
561 : 135 : case CTF_FONTPITCH: pFontPitchState = propertie; break;
562 : 135 : case CTF_FONTCHARSET: pFontCharsetState = propertie; break;
563 : :
564 : 130 : case CTF_FONTNAME_CJK: pFontNameCJKState = propertie; break;
565 : 133 : case CTF_FONTFAMILYNAME_CJK: pFontFamilyNameCJKState = propertie; break;
566 : 109 : case CTF_FONTSTYLENAME_CJK: pFontStyleNameCJKState = propertie; break;
567 : 133 : case CTF_FONTFAMILY_CJK: pFontFamilyCJKState = propertie; break;
568 : 133 : case CTF_FONTPITCH_CJK: pFontPitchCJKState = propertie; break;
569 : 133 : case CTF_FONTCHARSET_CJK: pFontCharsetCJKState = propertie; break;
570 : :
571 : 193 : case CTF_FONTNAME_CTL: pFontNameCTLState = propertie; break;
572 : 196 : case CTF_FONTFAMILYNAME_CTL: pFontFamilyNameCTLState = propertie; break;
573 : 172 : case CTF_FONTSTYLENAME_CTL: pFontStyleNameCTLState = propertie; break;
574 : 196 : case CTF_FONTFAMILY_CTL: pFontFamilyCTLState = propertie; break;
575 : 196 : case CTF_FONTPITCH_CTL: pFontPitchCTLState = propertie; break;
576 : 196 : case CTF_FONTCHARSET_CTL: pFontCharsetCTLState = propertie; break;
577 : 46 : case CTF_UNDERLINE: pUnderlineState = propertie; break;
578 : 34 : case CTF_UNDERLINE_COLOR: pUnderlineColorState = propertie; break;
579 : 34 : case CTF_UNDERLINE_HASCOLOR: pUnderlineHasColorState = propertie; break;
580 : 0 : case CTF_NUMBERINGSTYLENAME: pListStyleName = propertie; break;
581 : 0 : case CTF_TEXT_CLIP11: pClip11State = propertie; break;
582 : 0 : case CTF_TEXT_CLIP: pClipState = propertie; break;
583 : 58 : case CTF_PARAMARGINALL: pAllParaMargin = propertie; break;
584 : 0 : case CTF_MARGINALL: pAllMargin = propertie; break;
585 : : }
586 : : }
587 : :
588 [ + + ]: 1202 : if( pFontNameState )
589 : : ContextFontFilter( pFontNameState, pFontFamilyNameState,
590 : : pFontStyleNameState, pFontFamilyState,
591 [ + - ]: 132 : pFontPitchState, pFontCharsetState );
592 [ + + ]: 1202 : if( pFontNameCJKState )
593 : : ContextFontFilter( pFontNameCJKState, pFontFamilyNameCJKState,
594 : : pFontStyleNameCJKState, pFontFamilyCJKState,
595 [ + - ]: 130 : pFontPitchCJKState, pFontCharsetCJKState );
596 [ + + ]: 1202 : if( pFontNameCTLState )
597 : : ContextFontFilter( pFontNameCTLState, pFontFamilyNameCTLState,
598 : : pFontStyleNameCTLState, pFontFamilyCTLState,
599 [ + - ]: 193 : pFontPitchCTLState, pFontCharsetCTLState );
600 : :
601 [ + + ][ + + ]: 1202 : if( pCharHeightState && (pCharPropHeightState || pCharDiffHeightState ) )
[ - + ]
602 : : ContextFontHeightFilter( pCharHeightState, pCharPropHeightState,
603 : 69 : pCharDiffHeightState );
604 [ + + ][ + + ]: 1202 : if( pCharHeightCJKState &&
[ - + ]
605 : : (pCharPropHeightCJKState || pCharDiffHeightCJKState ) )
606 : : ContextFontHeightFilter( pCharHeightCJKState, pCharPropHeightCJKState,
607 : 95 : pCharDiffHeightCJKState );
608 [ + + ][ + + ]: 1202 : if( pCharHeightCTLState &&
[ - + ]
609 : : (pCharPropHeightCTLState || pCharDiffHeightCTLState ) )
610 : : ContextFontHeightFilter( pCharHeightCTLState, pCharPropHeightCTLState,
611 : 69 : pCharDiffHeightCTLState );
612 [ + + ][ - + ]: 1202 : if( pUnderlineColorState || pUnderlineHasColorState )
613 : : {
614 : 34 : sal_Bool bClear = !pUnderlineState;
615 [ + - ]: 34 : if( !bClear )
616 : : {
617 : 34 : sal_Int16 nUnderline = 0;
618 : 34 : pUnderlineState->maValue >>= nUnderline;
619 : 34 : bClear = FontUnderline::NONE == nUnderline;
620 : : }
621 [ + + ]: 34 : if( bClear )
622 : : {
623 [ + - ]: 30 : if( pUnderlineColorState )
624 : 30 : pUnderlineColorState->mnIndex = -1;
625 [ + - ]: 30 : if( pUnderlineHasColorState )
626 : 30 : pUnderlineHasColorState->mnIndex = -1;
627 : : }
628 : : }
629 : :
630 : 1202 : lcl_checkMultiProperty(pParaLeftMarginState, pParaLeftMarginRelState);
631 : 1202 : lcl_checkMultiProperty(pParaRightMarginState, pParaRightMarginRelState);
632 : 1202 : lcl_checkMultiProperty(pParaTopMarginState, pParaTopMarginRelState);
633 : 1202 : lcl_checkMultiProperty(pParaBottomMarginState, pParaBottomMarginRelState);
634 : 1202 : lcl_checkMultiProperty(pParaFirstLineState, pParaFirstLineRelState);
635 : :
636 [ + + ]: 1202 : if (pAllParaMargin)
637 : : {
638 : 58 : pAllParaMargin->mnIndex = -1; // just export individual attributes...
639 : 58 : pAllParaMargin->maValue.clear();
640 : : }
641 [ - + ]: 1202 : if (pAllMargin)
642 : : {
643 : 0 : pAllMargin->mnIndex = -1; // just export individual attributes...
644 : 0 : pAllMargin->maValue.clear();
645 : : }
646 : :
647 [ - + ]: 1202 : if( pAllBorderWidthState )
648 : : {
649 [ # # ][ # # ]: 0 : if( pLeftBorderWidthState && pRightBorderWidthState && pTopBorderWidthState && pBottomBorderWidthState )
[ # # ][ # # ]
650 : : {
651 : 0 : table::BorderLine2 aLeft, aRight, aTop, aBottom;
652 : :
653 [ # # ]: 0 : pLeftBorderWidthState->maValue >>= aLeft;
654 [ # # ]: 0 : pRightBorderWidthState->maValue >>= aRight;
655 [ # # ]: 0 : pTopBorderWidthState->maValue >>= aTop;
656 [ # # ]: 0 : pBottomBorderWidthState->maValue >>= aBottom;
657 [ # # ][ # # ]: 0 : if( aLeft.Color == aRight.Color && aLeft.InnerLineWidth == aRight.InnerLineWidth &&
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
658 : : aLeft.OuterLineWidth == aRight.OuterLineWidth && aLeft.LineDistance == aRight.LineDistance &&
659 : : aLeft.LineStyle == aRight.LineStyle &&
660 : : aLeft.LineWidth == aRight.LineWidth &&
661 : : aLeft.Color == aTop.Color && aLeft.InnerLineWidth == aTop.InnerLineWidth &&
662 : : aLeft.OuterLineWidth == aTop.OuterLineWidth && aLeft.LineDistance == aTop.LineDistance &&
663 : : aLeft.LineStyle == aTop.LineStyle &&
664 : : aLeft.LineWidth == aTop.LineWidth &&
665 : : aLeft.Color == aBottom.Color && aLeft.InnerLineWidth == aBottom.InnerLineWidth &&
666 : : aLeft.OuterLineWidth == aBottom.OuterLineWidth && aLeft.LineDistance == aBottom.LineDistance &&
667 : : aLeft.LineStyle == aBottom.LineStyle &&
668 : : aLeft.LineWidth == aBottom.LineWidth )
669 : : {
670 : 0 : pLeftBorderWidthState->mnIndex = -1;
671 : 0 : pLeftBorderWidthState->maValue.clear();
672 : 0 : pRightBorderWidthState->mnIndex = -1;
673 : 0 : pRightBorderWidthState->maValue.clear();
674 : 0 : pTopBorderWidthState->mnIndex = -1;
675 : 0 : pTopBorderWidthState->maValue.clear();
676 : 0 : pBottomBorderWidthState->mnIndex = -1;
677 : 0 : pBottomBorderWidthState->maValue.clear();
678 : : }
679 : : else
680 : : {
681 : 0 : pAllBorderWidthState->mnIndex = -1;
682 : 0 : pAllBorderWidthState->maValue.clear();
683 : 0 : }
684 : : }
685 : : else
686 : : {
687 : 0 : pAllBorderWidthState->mnIndex = -1;
688 : 0 : pAllBorderWidthState->maValue.clear();
689 : : }
690 : : }
691 : :
692 [ - + ]: 1202 : if( pAllBorderDistanceState )
693 : : {
694 [ # # ][ # # ]: 0 : if( pLeftBorderDistanceState && pRightBorderDistanceState && pTopBorderDistanceState && pBottomBorderDistanceState )
[ # # ][ # # ]
695 : : {
696 : 0 : sal_Int32 aLeft = 0, aRight = 0, aTop = 0, aBottom = 0;
697 : :
698 : 0 : pLeftBorderDistanceState->maValue >>= aLeft;
699 : 0 : pRightBorderDistanceState->maValue >>= aRight;
700 : 0 : pTopBorderDistanceState->maValue >>= aTop;
701 : 0 : pBottomBorderDistanceState->maValue >>= aBottom;
702 [ # # ][ # # ]: 0 : if( aLeft == aRight && aLeft == aTop && aLeft == aBottom )
[ # # ]
703 : : {
704 : 0 : pLeftBorderDistanceState->mnIndex = -1;
705 : 0 : pLeftBorderDistanceState->maValue.clear();
706 : 0 : pRightBorderDistanceState->mnIndex = -1;
707 : 0 : pRightBorderDistanceState->maValue.clear();
708 : 0 : pTopBorderDistanceState->mnIndex = -1;
709 : 0 : pTopBorderDistanceState->maValue.clear();
710 : 0 : pBottomBorderDistanceState->mnIndex = -1;
711 : 0 : pBottomBorderDistanceState->maValue.clear();
712 : : }
713 : : else
714 : : {
715 : 0 : pAllBorderDistanceState->mnIndex = -1;
716 : 0 : pAllBorderDistanceState->maValue.clear();
717 : 0 : }
718 : : }
719 : : else
720 : : {
721 : 0 : pAllBorderDistanceState->mnIndex = -1;
722 : 0 : pAllBorderDistanceState->maValue.clear();
723 : : }
724 : : }
725 : :
726 [ - + ]: 1202 : if( pAllBorderState )
727 : : {
728 [ # # ][ # # ]: 0 : if( pLeftBorderState && pRightBorderState && pTopBorderState && pBottomBorderState )
[ # # ][ # # ]
729 : : {
730 : 0 : table::BorderLine2 aLeft, aRight, aTop, aBottom;
731 : :
732 [ # # ]: 0 : pLeftBorderState->maValue >>= aLeft;
733 [ # # ]: 0 : pRightBorderState->maValue >>= aRight;
734 [ # # ]: 0 : pTopBorderState->maValue >>= aTop;
735 [ # # ]: 0 : pBottomBorderState->maValue >>= aBottom;
736 [ # # ][ # # ]: 0 : if( aLeft.Color == aRight.Color && aLeft.InnerLineWidth == aRight.InnerLineWidth &&
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
737 : : aLeft.OuterLineWidth == aRight.OuterLineWidth && aLeft.LineDistance == aRight.LineDistance &&
738 : : aLeft.LineStyle == aRight.LineStyle &&
739 : : aLeft.LineWidth == aRight.LineWidth &&
740 : : aLeft.Color == aTop.Color && aLeft.InnerLineWidth == aTop.InnerLineWidth &&
741 : : aLeft.OuterLineWidth == aTop.OuterLineWidth && aLeft.LineDistance == aTop.LineDistance &&
742 : : aLeft.LineStyle == aTop.LineStyle &&
743 : : aLeft.LineWidth == aTop.LineWidth &&
744 : : aLeft.Color == aBottom.Color && aLeft.InnerLineWidth == aBottom.InnerLineWidth &&
745 : : aLeft.OuterLineWidth == aBottom.OuterLineWidth && aLeft.LineDistance == aBottom.LineDistance &&
746 : : aLeft.LineWidth == aBottom.LineWidth &&
747 : : aLeft.LineStyle == aBottom.LineStyle )
748 : : {
749 : 0 : pLeftBorderState->mnIndex = -1;
750 : 0 : pLeftBorderState->maValue.clear();
751 : 0 : pRightBorderState->mnIndex = -1;
752 : 0 : pRightBorderState->maValue.clear();
753 : 0 : pTopBorderState->mnIndex = -1;
754 : 0 : pTopBorderState->maValue.clear();
755 : 0 : pBottomBorderState->mnIndex = -1;
756 : 0 : pBottomBorderState->maValue.clear();
757 : : }
758 : : else
759 : : {
760 : 0 : pAllBorderState->mnIndex = -1;
761 : 0 : pAllBorderState->maValue.clear();
762 : 0 : }
763 : : }
764 : : else
765 : : {
766 : 0 : pAllBorderState->mnIndex = -1;
767 : 0 : pAllBorderState->maValue.clear();
768 : : }
769 : : }
770 : :
771 : 1202 : sal_Int16 nSizeType = SizeType::FIX;
772 [ - + ]: 1202 : if( pSizeTypeState )
773 : : {
774 : 0 : pSizeTypeState->maValue >>= nSizeType;
775 : 0 : pSizeTypeState->mnIndex = -1;
776 : : }
777 : :
778 [ - + ]: 1202 : if( pHeightMinAbsState )
779 : : {
780 : 0 : sal_Int16 nRel = sal_Int16();
781 [ # # ]: 0 : if( (SizeType::FIX == nSizeType) ||
[ # # # # ]
[ # # ][ # # ]
782 : : ( pHeightMinRelState &&
783 : 0 : ( !(pHeightMinRelState->maValue >>= nRel) || nRel > 0 ) ) )
784 : : {
785 : 0 : pHeightMinAbsState->mnIndex = -1;
786 : : }
787 : :
788 : : // export SizeType::VARIABLE als min-width="0"
789 [ # # ]: 0 : if( SizeType::VARIABLE == nSizeType )
790 [ # # ]: 0 : pHeightMinAbsState->maValue <<= static_cast<sal_Int32>( 0 );
791 : : }
792 [ - + ][ # # ]: 1202 : if( pHeightMinRelState && SizeType::MIN != nSizeType)
793 : 0 : pHeightMinRelState->mnIndex = -1;
794 [ - + ][ # # ]: 1202 : if( pHeightAbsState && pHeightMinAbsState &&
[ # # ]
795 : : -1 != pHeightMinAbsState->mnIndex )
796 : 0 : pHeightAbsState->mnIndex = -1;
797 [ - + ][ # # ]: 1202 : if( pHeightRelState && SizeType::FIX != nSizeType)
798 : 0 : pHeightRelState->mnIndex = -1;
799 : :
800 : : // frame width
801 : 1202 : nSizeType = SizeType::FIX;
802 [ - + ]: 1202 : if( pWidthTypeState )
803 : : {
804 : 0 : pWidthTypeState->maValue >>= nSizeType;
805 : 0 : pWidthTypeState->mnIndex = -1;
806 : : }
807 [ - + ]: 1202 : if( pWidthMinAbsState )
808 : : {
809 : 0 : sal_Int16 nRel = sal_Int16();
810 [ # # ]: 0 : if( (SizeType::FIX == nSizeType) ||
[ # # # # ]
[ # # ][ # # ]
811 : : ( pWidthMinRelState &&
812 : 0 : ( !(pWidthMinRelState->maValue >>= nRel) || nRel > 0 ) ) )
813 : : {
814 : 0 : pWidthMinAbsState->mnIndex = -1;
815 : : }
816 : :
817 : : // export SizeType::VARIABLE als min-width="0"
818 [ # # ]: 0 : if( SizeType::VARIABLE == nSizeType )
819 [ # # ]: 0 : pWidthMinAbsState->maValue <<= static_cast<sal_Int32>( 0 );
820 : : }
821 [ - + ][ # # ]: 1202 : if( pWidthMinRelState && SizeType::MIN != nSizeType)
822 : 0 : pWidthMinRelState->mnIndex = -1;
823 [ - + ][ # # ]: 1202 : if( pWidthAbsState && pWidthMinAbsState &&
[ # # ]
824 : : -1 != pWidthMinAbsState->mnIndex )
825 : 0 : pWidthAbsState->mnIndex = -1;
826 [ - + ][ # # ]: 1202 : if( pWidthRelState && SizeType::FIX != nSizeType)
827 : 0 : pWidthRelState->mnIndex = -1;
828 : :
829 [ - + ]: 1202 : if( pWrapState )
830 : : {
831 : : WrapTextMode eVal;
832 [ # # ]: 0 : pWrapState->maValue >>= eVal;
833 [ # # # ]: 0 : switch( eVal )
834 : : {
835 : : case WrapTextMode_NONE:
836 : : // no wrapping: disable para-only and contour
837 [ # # ]: 0 : if( pWrapParagraphOnlyState )
838 : 0 : pWrapParagraphOnlyState->mnIndex = -1;
839 : : // no break
840 : : case WrapTextMode_THROUGHT:
841 : : // wrap through: disable only contour
842 [ # # ]: 0 : if( pWrapContourState )
843 : 0 : pWrapContourState->mnIndex = -1;
844 : 0 : break;
845 : : default:
846 : 0 : break;
847 : : }
848 [ # # ]: 0 : if( pWrapContourModeState &&
[ # # # # ]
[ # # ]
849 : : (!pWrapContourState ||
850 : 0 : !*(sal_Bool *)pWrapContourState ->maValue.getValue() ) )
851 : 0 : pWrapContourModeState->mnIndex = -1;
852 : : }
853 : :
854 : 1202 : TextContentAnchorType eAnchor = TextContentAnchorType_AT_PARAGRAPH;
855 [ - + ]: 1202 : if( pAnchorTypeState )
856 [ # # ]: 0 : pAnchorTypeState->maValue >>= eAnchor;
857 [ - + ]: 1202 : else if( bNeedsAnchor )
858 : : {
859 [ # # ]: 0 : Any aAny = rPropSet->getPropertyValue(
860 [ # # ][ # # ]: 0 : ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AnchorType") ) );
861 [ # # ]: 0 : aAny >>= eAnchor;
862 : : }
863 : :
864 : : // states for frame positioning attributes
865 : : {
866 [ - + ][ # # ]: 1202 : if( pHoriOrientState && pHoriOrientMirroredState )
867 : : {
868 [ # # # # ]: 0 : if( pHoriOrientMirrorState &&
[ # # ]
869 : 0 : *(sal_Bool *)pHoriOrientMirrorState->maValue.getValue() )
870 : 0 : pHoriOrientState->mnIndex = -1;
871 : : else
872 : 0 : pHoriOrientMirroredState->mnIndex = -1;
873 : : }
874 [ - + ]: 1202 : if( pHoriOrientMirrorState )
875 : 0 : pHoriOrientMirrorState->mnIndex = -1;
876 : :
877 [ - + ][ # # ]: 1202 : if( pHoriOrientRelState && TextContentAnchorType_AT_FRAME == eAnchor )
878 : 0 : pHoriOrientRelState->mnIndex = -1;
879 [ - + ][ # # ]: 1202 : if( pHoriOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
880 : 0 : pHoriOrientRelFrameState->mnIndex = -1;
881 : :
882 [ - + ][ # # ]: 1202 : if( pVertOrientState && TextContentAnchorType_AT_CHARACTER == eAnchor )
883 : 0 : pVertOrientState->mnIndex = -1;
884 [ - + ][ # # ]: 1202 : if( pVertOrientAtCharState && TextContentAnchorType_AT_CHARACTER != eAnchor )
885 : 0 : pVertOrientAtCharState->mnIndex = -1;
886 [ - + ][ # # ]: 1202 : if( pVertOrientRelState && TextContentAnchorType_AT_PARAGRAPH != eAnchor &&
[ # # ]
887 : : TextContentAnchorType_AT_CHARACTER != eAnchor )
888 : 0 : pVertOrientRelState->mnIndex = -1;
889 [ - + ][ # # ]: 1202 : if( pVertOrientRelPageState && TextContentAnchorType_AT_PAGE != eAnchor )
890 : 0 : pVertOrientRelPageState->mnIndex = -1;
891 [ - + ][ # # ]: 1202 : if( pVertOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
892 : 0 : pVertOrientRelFrameState->mnIndex = -1;
893 [ - + ][ # # ]: 1202 : if( pVertOrientRelAsCharState && TextContentAnchorType_AS_CHARACTER != eAnchor )
894 : 0 : pVertOrientRelAsCharState->mnIndex = -1;
895 : : }
896 : :
897 : : // States for shape positioning properties (#i28749#)
898 [ + - + + ]: 2404 : if ( eAnchor != TextContentAnchorType_AS_CHARACTER &&
[ + + ]
899 : 1202 : ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 )
900 : : {
901 : : // no export of shape positioning properties,
902 : : // if shape isn't anchored as-character and
903 : : // destination file format is OpenOffice.org file format
904 [ - + ]: 474 : if ( pShapeHoriOrientState )
905 : 0 : pShapeHoriOrientState->mnIndex = -1;
906 [ - + ]: 474 : if ( pShapeHoriOrientMirroredState )
907 : 0 : pShapeHoriOrientMirroredState->mnIndex = -1;
908 [ - + ]: 474 : if ( pShapeHoriOrientRelState )
909 : 0 : pShapeHoriOrientRelState->mnIndex = -1;
910 [ - + ]: 474 : if ( pShapeHoriOrientRelFrameState )
911 : 0 : pShapeHoriOrientRelFrameState->mnIndex = -1;
912 [ - + ]: 474 : if ( pShapeHoriOrientMirrorState )
913 : 0 : pShapeHoriOrientMirrorState->mnIndex = -1;
914 [ - + ]: 474 : if ( pShapeVertOrientState )
915 : 0 : pShapeVertOrientState->mnIndex = -1;
916 [ - + ]: 474 : if ( pShapeVertOrientAtCharState )
917 : 0 : pShapeVertOrientAtCharState->mnIndex = -1;
918 [ - + ]: 474 : if ( pShapeVertOrientRelState )
919 : 0 : pShapeVertOrientRelState->mnIndex = -1;
920 [ - + ]: 474 : if ( pShapeVertOrientRelPageState )
921 : 0 : pShapeVertOrientRelPageState->mnIndex = -1;
922 [ - + ]: 474 : if ( pShapeVertOrientRelFrameState )
923 : 0 : pShapeVertOrientRelFrameState->mnIndex = -1;
924 : : }
925 : : else
926 : : {
927 : : // handling of shape positioning property states as for frames - see above
928 [ - + ][ # # ]: 728 : if( pShapeHoriOrientState && pShapeHoriOrientMirroredState )
929 : : {
930 [ # # # # ]: 0 : if( pShapeHoriOrientMirrorState &&
[ # # ]
931 : 0 : *(sal_Bool *)pShapeHoriOrientMirrorState->maValue.getValue() )
932 : 0 : pShapeHoriOrientState->mnIndex = -1;
933 : : else
934 : 0 : pShapeHoriOrientMirroredState->mnIndex = -1;
935 : : }
936 [ - + ]: 728 : if( pShapeHoriOrientMirrorState )
937 : 0 : pShapeHoriOrientMirrorState->mnIndex = -1;
938 : :
939 [ - + ][ # # ]: 728 : if( pShapeHoriOrientRelState && TextContentAnchorType_AT_FRAME == eAnchor )
940 : 0 : pShapeHoriOrientRelState->mnIndex = -1;
941 [ - + ][ # # ]: 728 : if( pShapeHoriOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
942 : 0 : pShapeHoriOrientRelFrameState->mnIndex = -1;
943 : :
944 [ - + ][ # # ]: 728 : if( pShapeVertOrientState && TextContentAnchorType_AT_CHARACTER == eAnchor )
945 : 0 : pShapeVertOrientState->mnIndex = -1;
946 [ - + ][ # # ]: 728 : if( pShapeVertOrientAtCharState && TextContentAnchorType_AT_CHARACTER != eAnchor )
947 : 0 : pShapeVertOrientAtCharState->mnIndex = -1;
948 [ - + ][ # # ]: 728 : if( pShapeVertOrientRelState && TextContentAnchorType_AT_PARAGRAPH != eAnchor &&
[ # # ]
949 : : TextContentAnchorType_AT_CHARACTER != eAnchor )
950 : 0 : pShapeVertOrientRelState->mnIndex = -1;
951 [ - + ][ # # ]: 728 : if( pShapeVertOrientRelPageState && TextContentAnchorType_AT_PAGE != eAnchor )
952 : 0 : pShapeVertOrientRelPageState->mnIndex = -1;
953 [ - + ][ # # ]: 728 : if( pShapeVertOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
954 : 0 : pShapeVertOrientRelFrameState->mnIndex = -1;
955 : : }
956 : :
957 : : // list style name: remove list style if it is the default outline style
958 [ - + ]: 1202 : if( pListStyleName != NULL )
959 : : {
960 : 0 : OUString sListStyleName;
961 : 0 : pListStyleName->maValue >>= sListStyleName;
962 [ # # ][ # # ]: 0 : if( lcl_IsOutlineStyle( GetExport(), sListStyleName ) )
963 : 0 : pListStyleName->mnIndex = -1;
964 : : }
965 : :
966 [ - + ][ # # ]: 1202 : if( pClipState != NULL && pClip11State != NULL )
967 : 0 : pClip11State->mnIndex = -1;
968 : :
969 [ + - ]: 1202 : SvXMLExportPropertyMapper::ContextFilter(rProperties,rPropSet);
970 : 1202 : }
971 : :
972 : :
973 : 0 : bool lcl_IsOutlineStyle(const SvXMLExport &rExport, const OUString & rName)
974 : : {
975 : : Reference< XChapterNumberingSupplier >
976 [ # # ]: 0 : xCNSupplier(rExport.GetModel(), UNO_QUERY);
977 : :
978 : 0 : OUString sOutlineName;
979 [ # # ]: 0 : OUString sName(RTL_CONSTASCII_USTRINGPARAM("Name"));
980 : :
981 [ # # ]: 0 : if (xCNSupplier.is())
982 : : {
983 : : Reference<XPropertySet> xNumRule(
984 [ # # ][ # # ]: 0 : xCNSupplier->getChapterNumberingRules(), UNO_QUERY );
[ # # ]
985 : : DBG_ASSERT( xNumRule.is(), "no chapter numbering rules" );
986 [ # # ]: 0 : if (xNumRule.is())
987 : : {
988 [ # # ][ # # ]: 0 : xNumRule->getPropertyValue(sName) >>= sOutlineName;
989 : 0 : }
990 : : }
991 : :
992 : 0 : return rName == sOutlineName;
993 : : }
994 : :
995 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|