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