xref: /aoo42x/main/xmloff/source/text/txtexppr.cxx (revision 64b14621)
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 
54 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 
137 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 
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 
200 XMLTextExportPropertySetMapper::~XMLTextExportPropertySetMapper()
201 {
202 }
203 
204 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 
264 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
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 
326 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     XMLPropertyState* pAllParaMargin = NULL;
468     XMLPropertyState* pAllMargin = NULL;
469 
470     //UUUU
471 	XMLPropertyState* pRepeatOffsetX = NULL;
472 	XMLPropertyState* pRepeatOffsetY = 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         //UUUU
594         case CTF_SW_REPEAT_OFFSET_X:
595             pRepeatOffsetX = propertie;
596             break;
597 
598         //UUUU
599         case CTF_SW_REPEAT_OFFSET_Y:
600             pRepeatOffsetY = propertie;
601             break;
602 
603         //UUUU
604         case CTF_SW_FILLGRADIENTNAME:
605         case CTF_SW_FILLHATCHNAME:
606         case CTF_SW_FILLBITMAPNAME:
607         case CTF_SW_FILLTRANSNAME:
608             {
609                 OUString aStr;
610                 if( (propertie->maValue >>= aStr) && 0 == aStr.getLength() )
611                     propertie->mnIndex = -1;
612             }
613             break;
614 		}
615 	}
616 
617     //UUUU
618     if( pRepeatOffsetX && pRepeatOffsetY )
619     {
620         sal_Int32 nOffset = 0;
621         if( ( pRepeatOffsetX->maValue >>= nOffset ) && ( nOffset == 0 ) )
622             pRepeatOffsetX->mnIndex = -1;
623         else
624             pRepeatOffsetY->mnIndex = -1;
625     }
626 
627 	if( pFontNameState )
628 		ContextFontFilter( pFontNameState, pFontFamilyNameState,
629 						   pFontStyleNameState, pFontFamilyState,
630 						   pFontPitchState, pFontCharsetState );
631 	if( pFontNameCJKState )
632 		ContextFontFilter( pFontNameCJKState, pFontFamilyNameCJKState,
633 						   pFontStyleNameCJKState, pFontFamilyCJKState,
634 						   pFontPitchCJKState, pFontCharsetCJKState );
635 	if( pFontNameCTLState )
636 		ContextFontFilter( pFontNameCTLState, pFontFamilyNameCTLState,
637 						   pFontStyleNameCTLState, pFontFamilyCTLState,
638 						   pFontPitchCTLState, pFontCharsetCTLState );
639 
640 	if( pCharHeightState && (pCharPropHeightState || pCharDiffHeightState ) )
641 		ContextFontHeightFilter( pCharHeightState, pCharPropHeightState,
642 								 pCharDiffHeightState  );
643 	if( pCharHeightCJKState &&
644 		(pCharPropHeightCJKState || pCharDiffHeightCJKState ) )
645 		ContextFontHeightFilter( pCharHeightCJKState, pCharPropHeightCJKState,
646 								 pCharDiffHeightCJKState  );
647 	if( pCharHeightCTLState &&
648 		(pCharPropHeightCTLState || pCharDiffHeightCTLState ) )
649 		ContextFontHeightFilter( pCharHeightCTLState, pCharPropHeightCTLState,
650 								 pCharDiffHeightCTLState  );
651 	if( pUnderlineColorState || pUnderlineHasColorState )
652 	{
653 		sal_Bool bClear = !pUnderlineState;
654 		if( !bClear )
655 		{
656 			sal_Int16 nUnderline = 0;
657 			pUnderlineState->maValue >>= nUnderline;
658 			bClear = FontUnderline::NONE == nUnderline;
659 		}
660 		if( bClear )
661 		{
662 			if( pUnderlineColorState )
663 				pUnderlineColorState->mnIndex = -1;
664 			if( pUnderlineHasColorState )
665 				pUnderlineHasColorState->mnIndex = -1;
666 		}
667 	}
668 
669     lcl_checkMultiProperty(pParaLeftMarginState, pParaLeftMarginRelState);
670     lcl_checkMultiProperty(pParaRightMarginState, pParaRightMarginRelState);
671     lcl_checkMultiProperty(pParaTopMarginState, pParaTopMarginRelState);
672     lcl_checkMultiProperty(pParaBottomMarginState, pParaBottomMarginRelState);
673     lcl_checkMultiProperty(pParaFirstLineState, pParaFirstLineRelState);
674 
675     if (pAllParaMargin)
676     {
677         pAllParaMargin->mnIndex = -1; // just export individual attributes...
678         pAllParaMargin->maValue.clear();
679     }
680     if (pAllMargin)
681     {
682         pAllMargin->mnIndex = -1; // just export individual attributes...
683         pAllMargin->maValue.clear();
684     }
685 
686 	if( pAllBorderWidthState )
687 	{
688 		if( pLeftBorderWidthState && pRightBorderWidthState && pTopBorderWidthState && pBottomBorderWidthState )
689 		{
690 			table::BorderLine aLeft, aRight, aTop, aBottom;
691 
692 			pLeftBorderWidthState->maValue >>= aLeft;
693 			pRightBorderWidthState->maValue >>= aRight;
694 			pTopBorderWidthState->maValue >>= aTop;
695 			pBottomBorderWidthState->maValue >>= aBottom;
696 			if( aLeft.Color == aRight.Color && aLeft.InnerLineWidth == aRight.InnerLineWidth &&
697 				aLeft.OuterLineWidth == aRight.OuterLineWidth && aLeft.LineDistance == aRight.LineDistance &&
698 				aLeft.Color == aTop.Color && aLeft.InnerLineWidth == aTop.InnerLineWidth &&
699 				aLeft.OuterLineWidth == aTop.OuterLineWidth && aLeft.LineDistance == aTop.LineDistance &&
700 				aLeft.Color == aBottom.Color && aLeft.InnerLineWidth == aBottom.InnerLineWidth &&
701 				aLeft.OuterLineWidth == aBottom.OuterLineWidth && aLeft.LineDistance == aBottom.LineDistance )
702 			{
703 				pLeftBorderWidthState->mnIndex = -1;
704 				pLeftBorderWidthState->maValue.clear();
705 				pRightBorderWidthState->mnIndex = -1;
706 				pRightBorderWidthState->maValue.clear();
707 				pTopBorderWidthState->mnIndex = -1;
708 				pTopBorderWidthState->maValue.clear();
709 				pBottomBorderWidthState->mnIndex = -1;
710 				pBottomBorderWidthState->maValue.clear();
711 			}
712 			else
713 			{
714 				pAllBorderWidthState->mnIndex = -1;
715 				pAllBorderWidthState->maValue.clear();
716 			}
717 		}
718 		else
719 		{
720 			pAllBorderWidthState->mnIndex = -1;
721 			pAllBorderWidthState->maValue.clear();
722 		}
723 	}
724 
725 	if( pAllBorderDistanceState )
726 	{
727 		if( pLeftBorderDistanceState && pRightBorderDistanceState && pTopBorderDistanceState && pBottomBorderDistanceState )
728 		{
729 			sal_Int32 aLeft = 0, aRight = 0, aTop = 0, aBottom = 0;
730 
731 			pLeftBorderDistanceState->maValue >>= aLeft;
732 			pRightBorderDistanceState->maValue >>= aRight;
733 			pTopBorderDistanceState->maValue >>= aTop;
734 			pBottomBorderDistanceState->maValue >>= aBottom;
735 			if( aLeft == aRight && aLeft == aTop && aLeft == aBottom )
736 			{
737 				pLeftBorderDistanceState->mnIndex = -1;
738 				pLeftBorderDistanceState->maValue.clear();
739 				pRightBorderDistanceState->mnIndex = -1;
740 				pRightBorderDistanceState->maValue.clear();
741 				pTopBorderDistanceState->mnIndex = -1;
742 				pTopBorderDistanceState->maValue.clear();
743 				pBottomBorderDistanceState->mnIndex = -1;
744 				pBottomBorderDistanceState->maValue.clear();
745 			}
746 			else
747 			{
748 				pAllBorderDistanceState->mnIndex = -1;
749 				pAllBorderDistanceState->maValue.clear();
750 			}
751 		}
752 		else
753 		{
754 			pAllBorderDistanceState->mnIndex = -1;
755 			pAllBorderDistanceState->maValue.clear();
756 		}
757 	}
758 
759 	if( pAllBorderState )
760 	{
761 		if( pLeftBorderState && pRightBorderState && pTopBorderState && pBottomBorderState )
762 		{
763 			table::BorderLine aLeft, aRight, aTop, aBottom;
764 
765 			pLeftBorderState->maValue >>= aLeft;
766 			pRightBorderState->maValue >>= aRight;
767 			pTopBorderState->maValue >>= aTop;
768 			pBottomBorderState->maValue >>= aBottom;
769 			if( aLeft.Color == aRight.Color && aLeft.InnerLineWidth == aRight.InnerLineWidth &&
770 				aLeft.OuterLineWidth == aRight.OuterLineWidth && aLeft.LineDistance == aRight.LineDistance &&
771 				aLeft.Color == aTop.Color && aLeft.InnerLineWidth == aTop.InnerLineWidth &&
772 				aLeft.OuterLineWidth == aTop.OuterLineWidth && aLeft.LineDistance == aTop.LineDistance &&
773 				aLeft.Color == aBottom.Color && aLeft.InnerLineWidth == aBottom.InnerLineWidth &&
774 				aLeft.OuterLineWidth == aBottom.OuterLineWidth && aLeft.LineDistance == aBottom.LineDistance )
775 			{
776 				pLeftBorderState->mnIndex = -1;
777 				pLeftBorderState->maValue.clear();
778 				pRightBorderState->mnIndex = -1;
779 				pRightBorderState->maValue.clear();
780 				pTopBorderState->mnIndex = -1;
781 				pTopBorderState->maValue.clear();
782 				pBottomBorderState->mnIndex = -1;
783 				pBottomBorderState->maValue.clear();
784 			}
785 			else
786 			{
787 				pAllBorderState->mnIndex = -1;
788 				pAllBorderState->maValue.clear();
789 			}
790 		}
791 		else
792 		{
793 			pAllBorderState->mnIndex = -1;
794 			pAllBorderState->maValue.clear();
795 		}
796 	}
797 
798 	sal_Int16 nSizeType = SizeType::FIX;
799 	if( pSizeTypeState )
800 	{
801 		pSizeTypeState->maValue >>= nSizeType;
802 		pSizeTypeState->mnIndex = -1;
803 	}
804 
805 	if( pHeightMinAbsState )
806 	{
807 		sal_Int16 nRel = sal_Int16();
808 		if( (SizeType::FIX == nSizeType) ||
809 			( pHeightMinRelState &&
810 			  ( !(pHeightMinRelState->maValue >>= nRel) || nRel > 0 ) ) )
811 		{
812 			pHeightMinAbsState->mnIndex = -1;
813 		}
814 
815         // export SizeType::VARIABLE als min-width="0"
816         if( SizeType::VARIABLE == nSizeType )
817             pHeightMinAbsState->maValue <<= static_cast<sal_Int32>( 0 );
818 	}
819 	if( pHeightMinRelState  && SizeType::MIN != nSizeType)
820 		pHeightMinRelState->mnIndex = -1;
821 	if( pHeightAbsState && pHeightMinAbsState &&
822 		-1 != pHeightMinAbsState->mnIndex )
823 		pHeightAbsState->mnIndex = -1;
824 	if( pHeightRelState && SizeType::FIX != nSizeType)
825 		pHeightRelState->mnIndex = -1;
826 
827     // frame width
828     nSizeType = SizeType::FIX;
829     if( pWidthTypeState )
830     {
831         pWidthTypeState->maValue >>= nSizeType;
832         pWidthTypeState->mnIndex = -1;
833     }
834     if( pWidthMinAbsState )
835     {
836         sal_Int16 nRel = sal_Int16();
837         if( (SizeType::FIX == nSizeType) ||
838             ( pWidthMinRelState &&
839               ( !(pWidthMinRelState->maValue >>= nRel) || nRel > 0 ) ) )
840         {
841             pWidthMinAbsState->mnIndex = -1;
842         }
843 
844         // export SizeType::VARIABLE als min-width="0"
845         if( SizeType::VARIABLE == nSizeType )
846             pWidthMinAbsState->maValue <<= static_cast<sal_Int32>( 0 );
847     }
848 	if( pWidthMinRelState  && SizeType::MIN != nSizeType)
849 		pWidthMinRelState->mnIndex = -1;
850 	if( pWidthAbsState && pWidthMinAbsState &&
851 		-1 != pWidthMinAbsState->mnIndex )
852 		pWidthAbsState->mnIndex = -1;
853 	if( pWidthRelState && SizeType::FIX != nSizeType)
854 		pWidthRelState->mnIndex = -1;
855 
856 	if( pWrapState )
857 	{
858 		WrapTextMode eVal;
859 		pWrapState->maValue >>= eVal;
860 		switch( eVal )
861 		{
862 		case WrapTextMode_NONE:
863             // no wrapping: disable para-only and contour
864 			if( pWrapParagraphOnlyState )
865 				pWrapParagraphOnlyState->mnIndex = -1;
866             // no break
867 		case WrapTextMode_THROUGHT:
868             // wrap through: disable only contour
869 			if( pWrapContourState )
870 				pWrapContourState->mnIndex = -1;
871 			break;
872 		default:
873 			break;
874 		}
875 		if( pWrapContourModeState  &&
876 			(!pWrapContourState ||
877 			 !*(sal_Bool *)pWrapContourState ->maValue.getValue() ) )
878 			pWrapContourModeState->mnIndex = -1;
879 	}
880 
881 	TextContentAnchorType eAnchor = TextContentAnchorType_AT_PARAGRAPH;
882 	if( pAnchorTypeState )
883 		pAnchorTypeState->maValue >>= eAnchor;
884 	else if( bNeedsAnchor )
885 	{
886 		Any aAny = rPropSet->getPropertyValue(
887 					::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AnchorType") ) );
888 		aAny >>= eAnchor;
889 	}
890 
891     // states for frame positioning attributes
892     {
893         if( pHoriOrientState && pHoriOrientMirroredState )
894         {
895             if( pHoriOrientMirrorState &&
896                 *(sal_Bool *)pHoriOrientMirrorState->maValue.getValue() )
897                 pHoriOrientState->mnIndex = -1;
898             else
899                 pHoriOrientMirroredState->mnIndex = -1;
900         }
901         if( pHoriOrientMirrorState )
902             pHoriOrientMirrorState->mnIndex = -1;
903 
904         if( pHoriOrientRelState && TextContentAnchorType_AT_FRAME == eAnchor )
905             pHoriOrientRelState->mnIndex = -1;
906         if( pHoriOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
907             pHoriOrientRelFrameState->mnIndex = -1;;
908 
909         if( pVertOrientState && TextContentAnchorType_AT_CHARACTER == eAnchor )
910             pVertOrientState->mnIndex = -1;
911         if( pVertOrientAtCharState && TextContentAnchorType_AT_CHARACTER != eAnchor )
912             pVertOrientAtCharState->mnIndex = -1;
913         if( pVertOrientRelState && TextContentAnchorType_AT_PARAGRAPH != eAnchor &&
914             TextContentAnchorType_AT_CHARACTER != eAnchor )
915             pVertOrientRelState->mnIndex = -1;
916         if( pVertOrientRelPageState && TextContentAnchorType_AT_PAGE != eAnchor )
917             pVertOrientRelPageState->mnIndex = -1;
918         if( pVertOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
919             pVertOrientRelFrameState->mnIndex = -1;
920         if( pVertOrientRelAsCharState && TextContentAnchorType_AS_CHARACTER != eAnchor )
921             pVertOrientRelAsCharState->mnIndex = -1;
922     }
923 
924     // --> OD 2004-08-09 #i28749# - states for shape positioning properties
925     if ( eAnchor != TextContentAnchorType_AS_CHARACTER &&
926          ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 )
927     {
928         // no export of shape positioning properties,
929         // if shape isn't anchored as-character and
930         // destination file format is OpenOffice.org file format
931         if ( pShapeHoriOrientState )
932             pShapeHoriOrientState->mnIndex = -1;
933         if ( pShapeHoriOrientMirroredState )
934             pShapeHoriOrientMirroredState->mnIndex = -1;
935         if ( pShapeHoriOrientRelState )
936             pShapeHoriOrientRelState->mnIndex = -1;
937         if ( pShapeHoriOrientRelFrameState )
938             pShapeHoriOrientRelFrameState->mnIndex = -1;
939         if ( pShapeHoriOrientMirrorState )
940             pShapeHoriOrientMirrorState->mnIndex = -1;
941         if ( pShapeVertOrientState )
942             pShapeVertOrientState->mnIndex = -1;
943         if ( pShapeVertOrientAtCharState )
944             pShapeVertOrientAtCharState->mnIndex = -1;
945         if ( pShapeVertOrientRelState )
946             pShapeVertOrientRelState->mnIndex = -1;
947         if ( pShapeVertOrientRelPageState )
948             pShapeVertOrientRelPageState->mnIndex = -1;
949         if ( pShapeVertOrientRelFrameState )
950             pShapeVertOrientRelFrameState->mnIndex = -1;
951     }
952     else
953     {
954         // handling of shape positioning property states as for frames - see above
955         if( pShapeHoriOrientState && pShapeHoriOrientMirroredState )
956         {
957             if( pShapeHoriOrientMirrorState &&
958                 *(sal_Bool *)pShapeHoriOrientMirrorState->maValue.getValue() )
959                 pShapeHoriOrientState->mnIndex = -1;
960             else
961                 pShapeHoriOrientMirroredState->mnIndex = -1;
962         }
963         if( pShapeHoriOrientMirrorState )
964             pShapeHoriOrientMirrorState->mnIndex = -1;
965 
966         if( pShapeHoriOrientRelState && TextContentAnchorType_AT_FRAME == eAnchor )
967             pShapeHoriOrientRelState->mnIndex = -1;
968         if( pShapeHoriOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
969             pShapeHoriOrientRelFrameState->mnIndex = -1;;
970 
971         if( pShapeVertOrientState && TextContentAnchorType_AT_CHARACTER == eAnchor )
972             pShapeVertOrientState->mnIndex = -1;
973         if( pShapeVertOrientAtCharState && TextContentAnchorType_AT_CHARACTER != eAnchor )
974             pShapeVertOrientAtCharState->mnIndex = -1;
975         if( pShapeVertOrientRelState && TextContentAnchorType_AT_PARAGRAPH != eAnchor &&
976             TextContentAnchorType_AT_CHARACTER != eAnchor )
977             pShapeVertOrientRelState->mnIndex = -1;
978         if( pShapeVertOrientRelPageState && TextContentAnchorType_AT_PAGE != eAnchor )
979             pShapeVertOrientRelPageState->mnIndex = -1;
980         if( pShapeVertOrientRelFrameState && TextContentAnchorType_AT_FRAME != eAnchor )
981             pShapeVertOrientRelFrameState->mnIndex = -1;
982     }
983     // <--
984 
985     // list style name: remove list style if it is the default outline style
986     if( pListStyleName != NULL )
987     {
988         OUString sListStyleName;
989         pListStyleName->maValue >>= sListStyleName;
990         if( lcl_IsOutlineStyle( GetExport(), sListStyleName ) )
991             pListStyleName->mnIndex = -1;
992     }
993 
994 	if( pClipState != NULL && pClip11State != NULL  )
995 		pClip11State->mnIndex = -1;
996 
997 	SvXMLExportPropertyMapper::ContextFilter(rProperties,rPropSet);
998 }
999 
1000 
1001 bool lcl_IsOutlineStyle(const SvXMLExport &rExport, const OUString & rName)
1002 {
1003     Reference< XChapterNumberingSupplier >
1004         xCNSupplier(rExport.GetModel(), UNO_QUERY);
1005 
1006     OUString sOutlineName;
1007     OUString sName(RTL_CONSTASCII_USTRINGPARAM("Name"));
1008 
1009     if (xCNSupplier.is())
1010     {
1011         Reference<XPropertySet> xNumRule(
1012             xCNSupplier->getChapterNumberingRules(), UNO_QUERY );
1013         DBG_ASSERT( xNumRule.is(), "no chapter numbering rules" );
1014         if (xNumRule.is())
1015         {
1016             xNumRule->getPropertyValue(sName) >>= sOutlineName;
1017         }
1018     }
1019 
1020     return rName == sOutlineName;
1021 }
1022