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