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