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