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