xref: /aoo42x/main/xmloff/source/text/txtprhdl.cxx (revision 870262e3)
163bba73cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
363bba73cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
463bba73cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
563bba73cSAndrew Rist  * distributed with this work for additional information
663bba73cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
763bba73cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
863bba73cSAndrew Rist  * "License"); you may not use this file except in compliance
963bba73cSAndrew Rist  * with the License.  You may obtain a copy of the License at
1063bba73cSAndrew Rist  *
1163bba73cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1263bba73cSAndrew Rist  *
1363bba73cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1463bba73cSAndrew Rist  * software distributed under the License is distributed on an
1563bba73cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1663bba73cSAndrew Rist  * KIND, either express or implied.  See the License for the
1763bba73cSAndrew Rist  * specific language governing permissions and limitations
1863bba73cSAndrew Rist  * under the License.
1963bba73cSAndrew Rist  *
2063bba73cSAndrew Rist  *************************************************************/
2163bba73cSAndrew Rist 
22cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
23cdf0e10cSrcweir #include "precompiled_xmloff.hxx"
2456b35d86SArmin Le Grand 
25cdf0e10cSrcweir #include <tools/debug.hxx>
26cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
27cdf0e10cSrcweir #include <tools/fontenum.hxx>
28cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
29cdf0e10cSrcweir #include <com/sun/star/style/DropCapFormat.hpp>
30cdf0e10cSrcweir #include <com/sun/star/text/FontRelief.hpp>
31cdf0e10cSrcweir #include <com/sun/star/text/WrapTextMode.hpp>
32cdf0e10cSrcweir #include <com/sun/star/text/XTextColumns.hpp>
33cdf0e10cSrcweir #include <com/sun/star/text/TextColumn.hpp>
34cdf0e10cSrcweir #include <com/sun/star/text/RelOrientation.hpp>
35cdf0e10cSrcweir #include <com/sun/star/text/HoriOrientation.hpp>
36cdf0e10cSrcweir #include <com/sun/star/text/VertOrientation.hpp>
37cdf0e10cSrcweir #include <com/sun/star/text/RubyAdjust.hpp>
38cdf0e10cSrcweir #include <com/sun/star/text/FontEmphasis.hpp>
39cdf0e10cSrcweir #include <com/sun/star/text/ParagraphVertAlign.hpp>
40cdf0e10cSrcweir #include <xmloff/xmltypes.hxx>
41cdf0e10cSrcweir #include <xmloff/xmluconv.hxx>
42cdf0e10cSrcweir #include <xmloff/xmltoken.hxx>
43cdf0e10cSrcweir #include "XMLAnchorTypePropHdl.hxx"
44cdf0e10cSrcweir #include <xmloff/XMLConstantsPropertyHandler.hxx>
45cdf0e10cSrcweir #include "XMLClipPropertyHandler.hxx"
46cdf0e10cSrcweir #include "XMLTextColumnsPropertyHandler.hxx"
47cdf0e10cSrcweir #include <xmloff/NamedBoolPropertyHdl.hxx>
48cdf0e10cSrcweir #include "txtprhdl.hxx"
49cdf0e10cSrcweir #include <com/sun/star/text/WrapInfluenceOnPosition.hpp>
50cdf0e10cSrcweir 
5156b35d86SArmin Le Grand //UUUU
5256b35d86SArmin Le Grand #include <xmloff/EnumPropertyHdl.hxx>
5356b35d86SArmin Le Grand #include <com/sun/star/drawing/FillStyle.hpp>
5456b35d86SArmin Le Grand #include "XMLFillBitmapSizePropertyHandler.hxx"
5556b35d86SArmin Le Grand #include "XMLBitmapLogicalSizePropertyHandler.hxx"
5656b35d86SArmin Le Grand #include <com/sun/star/drawing/RectanglePoint.hpp>
5756b35d86SArmin Le Grand #include <com/sun/star/drawing/BitmapMode.hpp>
5856b35d86SArmin Le Grand #include "XMLBitmapRepeatOffsetPropertyHandler.hxx"
59cdf0e10cSrcweir 
60cdf0e10cSrcweir using ::rtl::OUString;
61cdf0e10cSrcweir using ::rtl::OUStringBuffer;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir using namespace ::com::sun::star::uno;
64cdf0e10cSrcweir using namespace ::com::sun::star::style;
65cdf0e10cSrcweir using namespace ::com::sun::star::text;
66cdf0e10cSrcweir using namespace ::xmloff::token;
6756b35d86SArmin Le Grand 
6864b14621SArmin Le Grand //UUUU
6964b14621SArmin Le Grand using namespace ::com::sun::star::drawing;
70cdf0e10cSrcweir 
7156b35d86SArmin Le Grand //UUUU
7256b35d86SArmin Le Grand extern SvXMLEnumMapEntry aXML_FillStyle_EnumMap[];
7356b35d86SArmin Le Grand extern SvXMLEnumMapEntry aXML_RefPoint_EnumMap[];
7456b35d86SArmin Le Grand extern SvXMLEnumMapEntry aXML_BitmapMode_EnumMap[];
75cdf0e10cSrcweir 
76cdf0e10cSrcweir #define CONSTASCII_USTRINGPARAM_CMP(s) s, sizeof(s)-1
77cdf0e10cSrcweir 
78cdf0e10cSrcweir // ---------------------------------------------------------------------------
79cdf0e10cSrcweir 
80cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_HoriPos_Enum[] =
81cdf0e10cSrcweir {
82cdf0e10cSrcweir 	{ XML_FROM_LEFT,		HoriOrientation::NONE	},
83cdf0e10cSrcweir 	{ XML_FROM_INSIDE,		HoriOrientation::NONE	},	// import only
84cdf0e10cSrcweir 	{ XML_LEFT,		    	HoriOrientation::LEFT	},
85cdf0e10cSrcweir 	{ XML_INSIDE,			HoriOrientation::LEFT	},	// import only
86cdf0e10cSrcweir 	{ XML_CENTER,			HoriOrientation::CENTER	},
87cdf0e10cSrcweir 	{ XML_RIGHT,			HoriOrientation::RIGHT	},
88cdf0e10cSrcweir 	{ XML_OUTSIDE,			HoriOrientation::RIGHT	},	// import only
89cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
90cdf0e10cSrcweir };
91cdf0e10cSrcweir 
92cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_HoriPosMirrored_Enum[] =
93cdf0e10cSrcweir {
94cdf0e10cSrcweir 	{ XML_FROM_INSIDE,		HoriOrientation::NONE	},
95cdf0e10cSrcweir 	{ XML_INSIDE,			HoriOrientation::LEFT	},
96cdf0e10cSrcweir 	{ XML_CENTER,			HoriOrientation::CENTER	},
97cdf0e10cSrcweir 	{ XML_OUTSIDE,			HoriOrientation::RIGHT	},
98cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
99cdf0e10cSrcweir };
100cdf0e10cSrcweir 
101cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_HoriRel_Enum[] =
102cdf0e10cSrcweir {
103cdf0e10cSrcweir 	{ XML_PARAGRAPH,			RelOrientation::FRAME	},
104cdf0e10cSrcweir 	{ XML_PARAGRAPH_CONTENT,	RelOrientation::PRINT_AREA	},
105cdf0e10cSrcweir 	{ XML_PAGE,				    RelOrientation::PAGE_FRAME	},
106cdf0e10cSrcweir 	{ XML_PAGE_CONTENT,		    RelOrientation::PAGE_PRINT_AREA	},
107cdf0e10cSrcweir 	{ XML_PARAGRAPH_START_MARGIN,	RelOrientation::FRAME_LEFT	},
108cdf0e10cSrcweir 	{ XML_PARAGRAPH_END_MARGIN,	RelOrientation::FRAME_RIGHT	},
109cdf0e10cSrcweir 	{ XML_PAGE_START_MARGIN,	RelOrientation::PAGE_LEFT	},
110cdf0e10cSrcweir 	{ XML_PAGE_END_MARGIN,		RelOrientation::PAGE_RIGHT	},
111cdf0e10cSrcweir 	{ XML_CHAR,				    RelOrientation::CHAR	},
112cdf0e10cSrcweir 	{ XML_FRAME,				RelOrientation::FRAME	},		// import only
113cdf0e10cSrcweir 	{ XML_FRAME_CONTENT,		RelOrientation::PRINT_AREA	},	// import only
114cdf0e10cSrcweir 	{ XML_FRAME_START_MARGIN,	RelOrientation::FRAME_LEFT	},	// import only
115cdf0e10cSrcweir 	{ XML_FRAME_END_MARGIN, 	RelOrientation::FRAME_RIGHT	},	// import only
116cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
117cdf0e10cSrcweir };
118cdf0e10cSrcweir 
119cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_HoriRelFrame_Enum[] =
120cdf0e10cSrcweir {
121cdf0e10cSrcweir 	{ XML_FRAME,				RelOrientation::FRAME	},
122cdf0e10cSrcweir 	{ XML_FRAME_CONTENT,		RelOrientation::PRINT_AREA	},
123cdf0e10cSrcweir 	{ XML_PAGE,				    RelOrientation::PAGE_FRAME	},
124cdf0e10cSrcweir 	{ XML_PAGE_CONTENT,		    RelOrientation::PAGE_PRINT_AREA	},
125cdf0e10cSrcweir 	{ XML_FRAME_START_MARGIN,	RelOrientation::FRAME_LEFT	},
126cdf0e10cSrcweir 	{ XML_FRAME_END_MARGIN,	    RelOrientation::FRAME_RIGHT	},
127cdf0e10cSrcweir 	{ XML_PAGE_START_MARGIN,	RelOrientation::PAGE_LEFT	},
128cdf0e10cSrcweir 	{ XML_PAGE_END_MARGIN,		RelOrientation::PAGE_RIGHT	},
129cdf0e10cSrcweir 	{ XML_CHAR,				    RelOrientation::CHAR	},
130cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
131cdf0e10cSrcweir };
132cdf0e10cSrcweir 
133cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_HoriMirror_Enum[] =
134cdf0e10cSrcweir {
135cdf0e10cSrcweir 	{ XML_FROM_LEFT,		sal_False	},
136cdf0e10cSrcweir 	{ XML_FROM_INSIDE,		sal_True	},
137cdf0e10cSrcweir 	{ XML_LEFT,		    	sal_False	},
138cdf0e10cSrcweir 	{ XML_INSIDE,			sal_True	},
139cdf0e10cSrcweir 	{ XML_CENTER,			sal_False	},
140cdf0e10cSrcweir 	{ XML_RIGHT,			sal_False	},
141cdf0e10cSrcweir 	{ XML_OUTSIDE,			sal_True	},
142cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
143cdf0e10cSrcweir };
144cdf0e10cSrcweir 
145cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VertPos_Enum[] =
146cdf0e10cSrcweir {
147cdf0e10cSrcweir 	{ XML_FROM_TOP,		    VertOrientation::NONE		},
148cdf0e10cSrcweir 	{ XML_TOP,				VertOrientation::TOP		},
149cdf0e10cSrcweir 	{ XML_TOP,				VertOrientation::CHAR_TOP	},	// export only
150cdf0e10cSrcweir 	{ XML_TOP,				VertOrientation::LINE_TOP	},	// export only
151cdf0e10cSrcweir 	{ XML_MIDDLE,			VertOrientation::CENTER		},
152cdf0e10cSrcweir 	{ XML_MIDDLE,			VertOrientation::CHAR_CENTER	},	// export only
153cdf0e10cSrcweir 	{ XML_MIDDLE,			VertOrientation::LINE_CENTER	},	// export only
154cdf0e10cSrcweir 	{ XML_BOTTOM,			VertOrientation::BOTTOM		},
155cdf0e10cSrcweir 	{ XML_BOTTOM,			VertOrientation::CHAR_BOTTOM	},	// export only
156cdf0e10cSrcweir 	{ XML_BOTTOM,			VertOrientation::LINE_BOTTOM	},	// export only
157cdf0e10cSrcweir 	{ XML_BELOW,			VertOrientation::CHAR_BOTTOM	},	// import only
158cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
159cdf0e10cSrcweir };
160cdf0e10cSrcweir 
161cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VertPosAtChar_Enum[] =
162cdf0e10cSrcweir {
163cdf0e10cSrcweir 	{ XML_FROM_TOP,		    VertOrientation::NONE		},
164cdf0e10cSrcweir 	{ XML_TOP,				VertOrientation::TOP		},
165cdf0e10cSrcweir 	{ XML_TOP,				VertOrientation::CHAR_TOP	},	// export only
166cdf0e10cSrcweir 	{ XML_TOP,				VertOrientation::LINE_TOP	},	// export only
167cdf0e10cSrcweir 	{ XML_MIDDLE,			VertOrientation::CENTER		},
168cdf0e10cSrcweir 	{ XML_MIDDLE,			VertOrientation::CHAR_CENTER	},	// export only
169cdf0e10cSrcweir 	{ XML_MIDDLE,			VertOrientation::LINE_CENTER	},	// export only
170cdf0e10cSrcweir 	{ XML_BOTTOM,			VertOrientation::BOTTOM		},
171cdf0e10cSrcweir 	{ XML_BELOW,			VertOrientation::CHAR_BOTTOM	},	// export only
172cdf0e10cSrcweir 	{ XML_BOTTOM,			VertOrientation::LINE_BOTTOM	},	// export only
173cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
174cdf0e10cSrcweir };
175cdf0e10cSrcweir 
176cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VertRel_Enum[] =
177cdf0e10cSrcweir {
178cdf0e10cSrcweir 	{ XML_PARAGRAPH,			RelOrientation::FRAME	},
179cdf0e10cSrcweir 	{ XML_PARAGRAPH_CONTENT,	RelOrientation::PRINT_AREA	},
180cdf0e10cSrcweir 	{ XML_CHAR,				    RelOrientation::CHAR	},
181cdf0e10cSrcweir     // DVO, OD 17.09.2003 #i18732# - allow vertical alignment at page
182cdf0e10cSrcweir     { XML_PAGE,                 RelOrientation::PAGE_FRAME  },
183cdf0e10cSrcweir     { XML_PAGE_CONTENT,         RelOrientation::PAGE_PRINT_AREA },
184cdf0e10cSrcweir 	{ XML_FRAME,				RelOrientation::FRAME	},		// import only
185cdf0e10cSrcweir 	{ XML_FRAME_CONTENT,		RelOrientation::PRINT_AREA	},	// import only
186cdf0e10cSrcweir     // OD 13.11.2003 #i22341# - new vertical alignment at top of line
187cdf0e10cSrcweir     { XML_LINE,                 RelOrientation::TEXT_LINE },
188cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
189cdf0e10cSrcweir };
190cdf0e10cSrcweir 
191cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VertRelPage_Enum[] =
192cdf0e10cSrcweir {
193cdf0e10cSrcweir 	{ XML_PAGE,			RelOrientation::FRAME	},
194cdf0e10cSrcweir 	{ XML_PAGE_CONTENT,	RelOrientation::PRINT_AREA	},
195cdf0e10cSrcweir 	{ XML_PAGE,			RelOrientation::PAGE_FRAME	},
196cdf0e10cSrcweir 	{ XML_PAGE_CONTENT,	RelOrientation::PAGE_PRINT_AREA	},
197cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
198cdf0e10cSrcweir };
199cdf0e10cSrcweir 
200cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VertRelFrame_Enum[] =
201cdf0e10cSrcweir {
202cdf0e10cSrcweir 	{ XML_FRAME,			RelOrientation::FRAME	},
203cdf0e10cSrcweir 	{ XML_FRAME_CONTENT,	RelOrientation::PRINT_AREA	},
204cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
205cdf0e10cSrcweir };
206cdf0e10cSrcweir 
207cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VertRelAsChar_Enum[] =
208cdf0e10cSrcweir {
209cdf0e10cSrcweir 	{ XML_BASELINE,		VertOrientation::TOP		},
210cdf0e10cSrcweir 	{ XML_BASELINE,		VertOrientation::CENTER		},	// export only
211cdf0e10cSrcweir 	{ XML_BASELINE,		VertOrientation::BOTTOM		},	// export only
212cdf0e10cSrcweir 	{ XML_TEXT,			VertOrientation::CHAR_TOP	},
213cdf0e10cSrcweir 	{ XML_TEXT,			VertOrientation::CHAR_CENTER	},	// export only
214cdf0e10cSrcweir 	{ XML_TEXT,			VertOrientation::CHAR_BOTTOM	},	// export only
215cdf0e10cSrcweir     { XML_LINE,			VertOrientation::LINE_TOP	},
216cdf0e10cSrcweir 	{ XML_LINE,			VertOrientation::LINE_CENTER	},	// export only
217cdf0e10cSrcweir 	{ XML_LINE,			VertOrientation::LINE_BOTTOM	},	// export only
218cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
219cdf0e10cSrcweir };
220cdf0e10cSrcweir 
221cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_RubyAdjust_Enum[] =
222cdf0e10cSrcweir {
223cdf0e10cSrcweir 	{ XML_LEFT,				    RubyAdjust_LEFT },
224cdf0e10cSrcweir     { XML_CENTER,				RubyAdjust_CENTER },
225cdf0e10cSrcweir 	{ XML_RIGHT,				RubyAdjust_RIGHT },
226cdf0e10cSrcweir 	{ XML_DISTRIBUTE_LETTER,	RubyAdjust_BLOCK },
227cdf0e10cSrcweir 	{ XML_DISTRIBUTE_SPACE,	    RubyAdjust_INDENT_BLOCK },
228cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
229cdf0e10cSrcweir };
230cdf0e10cSrcweir 
231cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_FontRelief_Enum[] =
232cdf0e10cSrcweir {
233cdf0e10cSrcweir 	{ XML_NONE,				FontRelief::NONE		},
234cdf0e10cSrcweir 	{ XML_ENGRAVED,			FontRelief::ENGRAVED	},
235cdf0e10cSrcweir 	{ XML_EMBOSSED,			FontRelief::EMBOSSED	},
236cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
237cdf0e10cSrcweir };
238cdf0e10cSrcweir 
239cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VerticalAlign_Enum[] =
240cdf0e10cSrcweir {
241cdf0e10cSrcweir 	{ XML_TOP,			ParagraphVertAlign::TOP		},
242cdf0e10cSrcweir 	{ XML_MIDDLE,		ParagraphVertAlign::CENTER	},
243cdf0e10cSrcweir 	{ XML_BOTTOM,		ParagraphVertAlign::BOTTOM	},
244cdf0e10cSrcweir 	{ XML_BASELINE,	    ParagraphVertAlign::BASELINE	},
245cdf0e10cSrcweir 	{ XML_AUTO,		    ParagraphVertAlign::AUTOMATIC	},
246cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
247cdf0e10cSrcweir };
248cdf0e10cSrcweir 
249cdf0e10cSrcweir // OD 2004-05-05 #i28701#
250cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_WrapInfluenceOnPosition_Enum[] =
251cdf0e10cSrcweir {
252cdf0e10cSrcweir     // --> OD 2004-10-18 #i35017# - tokens have been renamed and
253cdf0e10cSrcweir     // <XML_ITERATIVE> has been added
254cdf0e10cSrcweir     { XML_ONCE_SUCCESSIVE, WrapInfluenceOnPosition::ONCE_SUCCESSIVE },
255cdf0e10cSrcweir     { XML_ONCE_CONCURRENT, WrapInfluenceOnPosition::ONCE_CONCURRENT },
256cdf0e10cSrcweir     { XML_ITERATIVE,       WrapInfluenceOnPosition::ITERATIVE },
257cdf0e10cSrcweir     // <--
258cdf0e10cSrcweir     { XML_TOKEN_INVALID, 0 }
259cdf0e10cSrcweir };
260cdf0e10cSrcweir 
261cdf0e10cSrcweir // ---------------------------------------------------------------------------
262cdf0e10cSrcweir 
263cdf0e10cSrcweir class XMLDropCapPropHdl_Impl : public XMLPropertyHandler
264cdf0e10cSrcweir {
265cdf0e10cSrcweir public:
266cdf0e10cSrcweir 	virtual ~XMLDropCapPropHdl_Impl ();
267cdf0e10cSrcweir 
268cdf0e10cSrcweir 	virtual bool equals(
269cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& r1,
270cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& r2 ) const;
271cdf0e10cSrcweir 
272cdf0e10cSrcweir 	/// TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place.
273cdf0e10cSrcweir 	virtual sal_Bool importXML(
274cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
275cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
276cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
277cdf0e10cSrcweir 	virtual sal_Bool exportXML(
278cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
279cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
280cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
281cdf0e10cSrcweir };
282cdf0e10cSrcweir 
~XMLDropCapPropHdl_Impl()283cdf0e10cSrcweir XMLDropCapPropHdl_Impl::~XMLDropCapPropHdl_Impl ()
284cdf0e10cSrcweir {
285cdf0e10cSrcweir }
286cdf0e10cSrcweir 
equals(const Any & r1,const Any & r2) const287cdf0e10cSrcweir bool XMLDropCapPropHdl_Impl::equals(
288cdf0e10cSrcweir 		const Any& r1,
289cdf0e10cSrcweir 		const Any& r2 ) const
290cdf0e10cSrcweir {
291cdf0e10cSrcweir 	DropCapFormat aFormat1, aFormat2;
292cdf0e10cSrcweir 	r1 >>= aFormat1;
293cdf0e10cSrcweir 	r2 >>= aFormat2;
294cdf0e10cSrcweir 
295cdf0e10cSrcweir 	return	(aFormat1.Lines <=1 && aFormat2.Lines <=1) ||
296cdf0e10cSrcweir 			(aFormat1.Lines == aFormat2.Lines &&
297cdf0e10cSrcweir 			 aFormat1.Count == aFormat2.Count &&
298cdf0e10cSrcweir 			 aFormat1.Distance == aFormat2.Distance);
299cdf0e10cSrcweir }
300cdf0e10cSrcweir 
importXML(const OUString &,Any &,const SvXMLUnitConverter &) const301cdf0e10cSrcweir sal_Bool XMLDropCapPropHdl_Impl::importXML(
302cdf0e10cSrcweir 		const OUString&,
303cdf0e10cSrcweir 	   	Any&,
304cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
305cdf0e10cSrcweir {
306*870262e3SDon Lewis 	DBG_ASSERT( sal_False, "drop caps are an element import property" );
307cdf0e10cSrcweir 	return sal_False;
308cdf0e10cSrcweir }
309cdf0e10cSrcweir 
exportXML(OUString &,const Any &,const SvXMLUnitConverter &) const310cdf0e10cSrcweir sal_Bool XMLDropCapPropHdl_Impl::exportXML(
311cdf0e10cSrcweir 		OUString&,
312cdf0e10cSrcweir 		const Any&,
313cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
314cdf0e10cSrcweir {
315*870262e3SDon Lewis 	DBG_ASSERT( sal_False, "drop caps are an element export property" );
316cdf0e10cSrcweir 	return sal_False;
317cdf0e10cSrcweir }
318cdf0e10cSrcweir 
319cdf0e10cSrcweir // ---------------------------------------------------------------------------
320cdf0e10cSrcweir 
321cdf0e10cSrcweir class XMLOpaquePropHdl_Impl : public XMLPropertyHandler
322cdf0e10cSrcweir {
323cdf0e10cSrcweir public:
324cdf0e10cSrcweir 	virtual ~XMLOpaquePropHdl_Impl ();
325cdf0e10cSrcweir 
326cdf0e10cSrcweir 	virtual sal_Bool importXML(
327cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
328cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
329cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
330cdf0e10cSrcweir 	virtual sal_Bool exportXML(
331cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
332cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
333cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
334cdf0e10cSrcweir };
335cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const336cdf0e10cSrcweir sal_Bool XMLOpaquePropHdl_Impl::importXML(
337cdf0e10cSrcweir 		const OUString& rStrImpValue,
338cdf0e10cSrcweir 	   	Any& rValue,
339cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
340cdf0e10cSrcweir {
341cdf0e10cSrcweir 	sal_Bool bRet = sal_True;
342cdf0e10cSrcweir 	sal_Bool bVal = sal_False;
343cdf0e10cSrcweir 	if( IsXMLToken( rStrImpValue, XML_FOREGROUND ) )
344cdf0e10cSrcweir 		bVal = sal_True;
345cdf0e10cSrcweir 	else if( !IsXMLToken( rStrImpValue, XML_BACKGROUND ) )
346cdf0e10cSrcweir 		bRet = sal_False;
347cdf0e10cSrcweir 
348cdf0e10cSrcweir 	if( bRet )
349cdf0e10cSrcweir 		rValue.setValue( &bVal, ::getBooleanCppuType() );
350cdf0e10cSrcweir 
351cdf0e10cSrcweir 	return bRet;
352cdf0e10cSrcweir }
353cdf0e10cSrcweir 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const354cdf0e10cSrcweir sal_Bool XMLOpaquePropHdl_Impl::exportXML(
355cdf0e10cSrcweir 		OUString& rStrExpValue,
356cdf0e10cSrcweir 		const Any& rValue,
357cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
358cdf0e10cSrcweir {
359cdf0e10cSrcweir 	if( *(sal_Bool *)rValue.getValue() )
360cdf0e10cSrcweir 	   	rStrExpValue = GetXMLToken( XML_FOREGROUND );
361cdf0e10cSrcweir 	else
362cdf0e10cSrcweir 	   	rStrExpValue = GetXMLToken( XML_BACKGROUND );
363cdf0e10cSrcweir 
364cdf0e10cSrcweir 	return sal_True;
365cdf0e10cSrcweir }
366cdf0e10cSrcweir 
~XMLOpaquePropHdl_Impl()367cdf0e10cSrcweir XMLOpaquePropHdl_Impl::~XMLOpaquePropHdl_Impl ()
368cdf0e10cSrcweir {
369cdf0e10cSrcweir }
370cdf0e10cSrcweir 
371cdf0e10cSrcweir // ---------------------------------------------------------------------------
372cdf0e10cSrcweir 
373cdf0e10cSrcweir class XMLContourModePropHdl_Impl : public XMLPropertyHandler
374cdf0e10cSrcweir {
375cdf0e10cSrcweir public:
376cdf0e10cSrcweir 	virtual ~XMLContourModePropHdl_Impl ();
377cdf0e10cSrcweir 
378cdf0e10cSrcweir 	virtual sal_Bool importXML(
379cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
380cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
381cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
382cdf0e10cSrcweir 	virtual sal_Bool exportXML(
383cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
384cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
385cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
386cdf0e10cSrcweir };
387cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const388cdf0e10cSrcweir sal_Bool XMLContourModePropHdl_Impl::importXML(
389cdf0e10cSrcweir 		const OUString& rStrImpValue,
390cdf0e10cSrcweir 	   	Any& rValue,
391cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
392cdf0e10cSrcweir {
393cdf0e10cSrcweir 	sal_Bool bRet = sal_True;
394cdf0e10cSrcweir 	sal_Bool bVal = sal_False;
395cdf0e10cSrcweir 	if( IsXMLToken( rStrImpValue, XML_OUTSIDE ) )
396cdf0e10cSrcweir 		bVal = sal_True;
397cdf0e10cSrcweir 	else if( ! IsXMLToken( rStrImpValue, XML_FULL ) )
398cdf0e10cSrcweir 		bRet = sal_False;
399cdf0e10cSrcweir 
400cdf0e10cSrcweir 	if( bRet )
401cdf0e10cSrcweir 		rValue.setValue( &bVal, ::getBooleanCppuType() );
402cdf0e10cSrcweir 
403cdf0e10cSrcweir 	return bRet;
404cdf0e10cSrcweir }
405cdf0e10cSrcweir 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const406cdf0e10cSrcweir sal_Bool XMLContourModePropHdl_Impl::exportXML(
407cdf0e10cSrcweir 		OUString& rStrExpValue,
408cdf0e10cSrcweir 		const Any& rValue,
409cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
410cdf0e10cSrcweir {
411cdf0e10cSrcweir 	if( *(sal_Bool *)rValue.getValue() )
412cdf0e10cSrcweir 	   	rStrExpValue = GetXMLToken( XML_OUTSIDE );
413cdf0e10cSrcweir 	else
414cdf0e10cSrcweir 	   	rStrExpValue = GetXMLToken( XML_FULL );
415cdf0e10cSrcweir 
416cdf0e10cSrcweir 	return sal_True;
417cdf0e10cSrcweir }
418cdf0e10cSrcweir 
~XMLContourModePropHdl_Impl()419cdf0e10cSrcweir XMLContourModePropHdl_Impl::~XMLContourModePropHdl_Impl()
420cdf0e10cSrcweir {
421cdf0e10cSrcweir }
422cdf0e10cSrcweir 
423cdf0e10cSrcweir // ---------------------------------------------------------------------------
424cdf0e10cSrcweir 
425cdf0e10cSrcweir class XMLParagraphOnlyPropHdl_Impl : public XMLPropertyHandler
426cdf0e10cSrcweir {
427cdf0e10cSrcweir public:
428cdf0e10cSrcweir 	virtual ~XMLParagraphOnlyPropHdl_Impl ();
429cdf0e10cSrcweir 
430cdf0e10cSrcweir 	virtual sal_Bool importXML(
431cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
432cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
433cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
434cdf0e10cSrcweir 	virtual sal_Bool exportXML(
435cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
436cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
437cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
438cdf0e10cSrcweir };
439cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const440cdf0e10cSrcweir sal_Bool XMLParagraphOnlyPropHdl_Impl::importXML(
441cdf0e10cSrcweir 		const OUString& rStrImpValue,
442cdf0e10cSrcweir 	   	Any& rValue,
443cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
444cdf0e10cSrcweir {
445cdf0e10cSrcweir 	sal_Bool bRet = sal_True;
446cdf0e10cSrcweir 	sal_Bool bVal = sal_False;
447cdf0e10cSrcweir 
448cdf0e10cSrcweir 	if( ! IsXMLToken( rStrImpValue, XML_NO_LIMIT ) )
449cdf0e10cSrcweir 	{
450cdf0e10cSrcweir 		sal_Int32 nValue = 0;
451cdf0e10cSrcweir 		bRet = SvXMLUnitConverter::convertNumber( nValue, rStrImpValue );
452cdf0e10cSrcweir 		bVal = 1 == nValue;
453cdf0e10cSrcweir 	}
454cdf0e10cSrcweir 
455cdf0e10cSrcweir 	if( bRet )
456cdf0e10cSrcweir 		rValue.setValue( &bVal, ::getBooleanCppuType() );
457cdf0e10cSrcweir 
458cdf0e10cSrcweir 	return bRet;
459cdf0e10cSrcweir }
460cdf0e10cSrcweir 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const461cdf0e10cSrcweir sal_Bool XMLParagraphOnlyPropHdl_Impl::exportXML(
462cdf0e10cSrcweir 		OUString& rStrExpValue,
463cdf0e10cSrcweir 		const Any& rValue,
464cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
465cdf0e10cSrcweir {
466cdf0e10cSrcweir 	if( *(sal_Bool *)rValue.getValue() )
467cdf0e10cSrcweir 	   	rStrExpValue = GetXMLToken( XML_1 );
468cdf0e10cSrcweir 	else
469cdf0e10cSrcweir 	   	rStrExpValue = GetXMLToken( XML_NO_LIMIT );
470cdf0e10cSrcweir 
471cdf0e10cSrcweir 	return sal_True;
472cdf0e10cSrcweir }
473cdf0e10cSrcweir 
~XMLParagraphOnlyPropHdl_Impl()474cdf0e10cSrcweir XMLParagraphOnlyPropHdl_Impl::~XMLParagraphOnlyPropHdl_Impl()
475cdf0e10cSrcweir {
476cdf0e10cSrcweir }
477cdf0e10cSrcweir 
478cdf0e10cSrcweir // ---------------------------------------------------------------------------
479cdf0e10cSrcweir 
480cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_Wrap_Enum[] =
481cdf0e10cSrcweir {
482cdf0e10cSrcweir 	{ XML_NONE,		    WrapTextMode_NONE },
483cdf0e10cSrcweir 	{ XML_RUN_THROUGH,	WrapTextMode_THROUGHT },
484cdf0e10cSrcweir 	{ XML_PARALLEL,	    WrapTextMode_PARALLEL },
485cdf0e10cSrcweir 	{ XML_DYNAMIC,		WrapTextMode_DYNAMIC },
486cdf0e10cSrcweir 	{ XML_LEFT,		    WrapTextMode_LEFT },
487cdf0e10cSrcweir 	{ XML_RIGHT,		WrapTextMode_RIGHT },
488cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
489cdf0e10cSrcweir };
490cdf0e10cSrcweir 
491cdf0e10cSrcweir class XMLWrapPropHdl_Impl : public XMLPropertyHandler
492cdf0e10cSrcweir {
493cdf0e10cSrcweir public:
494cdf0e10cSrcweir 	virtual ~XMLWrapPropHdl_Impl ();
495cdf0e10cSrcweir 
496cdf0e10cSrcweir 	virtual sal_Bool importXML(
497cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
498cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
499cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
500cdf0e10cSrcweir 	virtual sal_Bool exportXML(
501cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
502cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
503cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
504cdf0e10cSrcweir };
505cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const506cdf0e10cSrcweir sal_Bool XMLWrapPropHdl_Impl::importXML(
507cdf0e10cSrcweir 		const OUString& rStrImpValue,
508cdf0e10cSrcweir 	   	Any& rValue,
509cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
510cdf0e10cSrcweir {
511cdf0e10cSrcweir 	sal_uInt16 nWrap;
512cdf0e10cSrcweir 	sal_Bool bRet = SvXMLUnitConverter::convertEnum( nWrap, rStrImpValue,
513cdf0e10cSrcweir 												pXML_Wrap_Enum );
514cdf0e10cSrcweir 
515cdf0e10cSrcweir 	if( bRet )
516cdf0e10cSrcweir 		rValue <<= (WrapTextMode)nWrap;
517cdf0e10cSrcweir 
518cdf0e10cSrcweir 	return bRet;
519cdf0e10cSrcweir }
520cdf0e10cSrcweir 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const521cdf0e10cSrcweir sal_Bool XMLWrapPropHdl_Impl::exportXML(
522cdf0e10cSrcweir 		OUString& rStrExpValue,
523cdf0e10cSrcweir 		const Any& rValue,
524cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
525cdf0e10cSrcweir {
526cdf0e10cSrcweir 	OUStringBuffer aOut;
527cdf0e10cSrcweir 	WrapTextMode eVal;
528cdf0e10cSrcweir 
529cdf0e10cSrcweir 	rValue >>= eVal;
530cdf0e10cSrcweir 
531cdf0e10cSrcweir 	sal_Bool bRet = SvXMLUnitConverter::convertEnum( aOut, eVal, pXML_Wrap_Enum, XML_NONE );
532cdf0e10cSrcweir 
533cdf0e10cSrcweir 	rStrExpValue = aOut.makeStringAndClear();
534cdf0e10cSrcweir 
535cdf0e10cSrcweir 	return bRet;
536cdf0e10cSrcweir }
537cdf0e10cSrcweir 
~XMLWrapPropHdl_Impl()538cdf0e10cSrcweir XMLWrapPropHdl_Impl::~XMLWrapPropHdl_Impl ()
539cdf0e10cSrcweir {
540cdf0e10cSrcweir }
541cdf0e10cSrcweir 
542cdf0e10cSrcweir // ---------------------------------------------------------------------------
543cdf0e10cSrcweir 
544cdf0e10cSrcweir class XMLFrameProtectPropHdl_Impl : public XMLPropertyHandler
545cdf0e10cSrcweir {
546cdf0e10cSrcweir 	const OUString sVal;
547cdf0e10cSrcweir public:
XMLFrameProtectPropHdl_Impl(enum XMLTokenEnum eVal)548cdf0e10cSrcweir 	XMLFrameProtectPropHdl_Impl( enum XMLTokenEnum eVal ) :
549cdf0e10cSrcweir 	   	sVal( GetXMLToken(eVal) ) {}
550cdf0e10cSrcweir 	virtual ~XMLFrameProtectPropHdl_Impl ();
551cdf0e10cSrcweir 
552cdf0e10cSrcweir 	virtual sal_Bool importXML(
553cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
554cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
555cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
556cdf0e10cSrcweir 	virtual sal_Bool exportXML(
557cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
558cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
559cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
560cdf0e10cSrcweir };
561cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const562cdf0e10cSrcweir sal_Bool XMLFrameProtectPropHdl_Impl::importXML(
563cdf0e10cSrcweir 		const OUString& rStrImpValue,
564cdf0e10cSrcweir 	   	Any& rValue,
565cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
566cdf0e10cSrcweir {
567cdf0e10cSrcweir 	sal_Bool bRet = sal_True;
568cdf0e10cSrcweir 	sal_Bool bVal = sal_False;
569cdf0e10cSrcweir 	if( ! IsXMLToken( rStrImpValue, XML_NONE ) )
570cdf0e10cSrcweir 	{
571cdf0e10cSrcweir 		bRet = sal_False;
572cdf0e10cSrcweir 		SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
573cdf0e10cSrcweir 		OUString aToken;
574cdf0e10cSrcweir 		while( aTokenEnum.getNextToken( aToken ) )
575cdf0e10cSrcweir 		{
576cdf0e10cSrcweir 			bRet = sal_True;
577cdf0e10cSrcweir 			if( aToken == sVal )
578cdf0e10cSrcweir 			{
579cdf0e10cSrcweir 				bVal = sal_True;
580cdf0e10cSrcweir 				break;
581cdf0e10cSrcweir 			}
582cdf0e10cSrcweir 		}
583cdf0e10cSrcweir 	}
584cdf0e10cSrcweir 
585cdf0e10cSrcweir 	if( bRet )
586cdf0e10cSrcweir 		rValue.setValue( &bVal, ::getBooleanCppuType() );
587cdf0e10cSrcweir 
588cdf0e10cSrcweir 	return bRet;
589cdf0e10cSrcweir }
590cdf0e10cSrcweir 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const591cdf0e10cSrcweir sal_Bool XMLFrameProtectPropHdl_Impl::exportXML(
592cdf0e10cSrcweir 		OUString& rStrExpValue,
593cdf0e10cSrcweir 		const Any& rValue,
594cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
595cdf0e10cSrcweir {
596cdf0e10cSrcweir 	if( *(sal_Bool *)rValue.getValue() )
597cdf0e10cSrcweir 	{
598cdf0e10cSrcweir 		if( !rStrExpValue.getLength() ||
599cdf0e10cSrcweir 			IsXMLToken( rStrExpValue, XML_NONE ) )
600cdf0e10cSrcweir 		{
601cdf0e10cSrcweir 	   		rStrExpValue = sVal;
602cdf0e10cSrcweir 		}
603cdf0e10cSrcweir 		else
604cdf0e10cSrcweir 		{
605cdf0e10cSrcweir 			OUStringBuffer aOut( rStrExpValue.getLength() + 1 +
606cdf0e10cSrcweir 								 sVal.getLength() );
607cdf0e10cSrcweir 			aOut.append( rStrExpValue );
608cdf0e10cSrcweir 			aOut.append( (sal_Unicode)' ' );
609cdf0e10cSrcweir 			aOut.append( sVal );
610cdf0e10cSrcweir 			rStrExpValue = aOut.makeStringAndClear();
611cdf0e10cSrcweir 		}
612cdf0e10cSrcweir 	}
613cdf0e10cSrcweir 	else if( !rStrExpValue.getLength() )
614cdf0e10cSrcweir 	{
615cdf0e10cSrcweir 	   	rStrExpValue = GetXMLToken( XML_NONE );
616cdf0e10cSrcweir 	}
617cdf0e10cSrcweir 
618cdf0e10cSrcweir 	return sal_True;
619cdf0e10cSrcweir }
620cdf0e10cSrcweir 
~XMLFrameProtectPropHdl_Impl()621cdf0e10cSrcweir XMLFrameProtectPropHdl_Impl::~XMLFrameProtectPropHdl_Impl()
622cdf0e10cSrcweir {
623cdf0e10cSrcweir }
624cdf0e10cSrcweir 
625cdf0e10cSrcweir // ---------------------------------------------------------------------------
626cdf0e10cSrcweir 
627cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_Anchor_Enum[] =
628cdf0e10cSrcweir {
629cdf0e10cSrcweir 	{ XML_CHAR,		    TextContentAnchorType_AT_CHARACTER },
630cdf0e10cSrcweir 	{ XML_PAGE,	        TextContentAnchorType_AT_PAGE },
631cdf0e10cSrcweir 	{ XML_FRAME,	    TextContentAnchorType_AT_FRAME },
632cdf0e10cSrcweir 	{ XML_PARAGRAPH,		TextContentAnchorType_AT_PARAGRAPH },
633cdf0e10cSrcweir 	{ XML_AS_CHAR,	    TextContentAnchorType_AS_CHARACTER },
634cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
635cdf0e10cSrcweir };
636cdf0e10cSrcweir 
637cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const638cdf0e10cSrcweir sal_Bool XMLAnchorTypePropHdl::importXML(
639cdf0e10cSrcweir 		const OUString& rStrImpValue,
640cdf0e10cSrcweir 	   	Any& rValue,
641cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
642cdf0e10cSrcweir {
643cdf0e10cSrcweir 	sal_uInt16 nAnchor;
644cdf0e10cSrcweir 	sal_Bool bRet = SvXMLUnitConverter::convertEnum( nAnchor, rStrImpValue,
645cdf0e10cSrcweir 												pXML_Anchor_Enum );
646cdf0e10cSrcweir 
647cdf0e10cSrcweir 	if( bRet )
648cdf0e10cSrcweir 		rValue <<= (TextContentAnchorType)nAnchor;
649cdf0e10cSrcweir 
650cdf0e10cSrcweir 	return bRet;
651cdf0e10cSrcweir }
652cdf0e10cSrcweir 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const653cdf0e10cSrcweir sal_Bool XMLAnchorTypePropHdl::exportXML(
654cdf0e10cSrcweir 		OUString& rStrExpValue,
655cdf0e10cSrcweir 		const Any& rValue,
656cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
657cdf0e10cSrcweir {
658cdf0e10cSrcweir 	OUStringBuffer aOut;
659cdf0e10cSrcweir 	TextContentAnchorType eVal;
660cdf0e10cSrcweir 
661cdf0e10cSrcweir 	rValue >>= eVal;
662cdf0e10cSrcweir 
663cdf0e10cSrcweir 	sal_Bool bRet = SvXMLUnitConverter::convertEnum( aOut, eVal, pXML_Anchor_Enum, XML_PARAGRAPH );
664cdf0e10cSrcweir 
665cdf0e10cSrcweir 	rStrExpValue = aOut.makeStringAndClear();
666cdf0e10cSrcweir 
667cdf0e10cSrcweir 	return bRet;
668cdf0e10cSrcweir }
669cdf0e10cSrcweir 
~XMLAnchorTypePropHdl()670cdf0e10cSrcweir XMLAnchorTypePropHdl::~XMLAnchorTypePropHdl()
671cdf0e10cSrcweir {
672cdf0e10cSrcweir }
673cdf0e10cSrcweir 
convert(const OUString & rStrImpValue,TextContentAnchorType & rType)674cdf0e10cSrcweir sal_Bool XMLAnchorTypePropHdl::convert( const OUString& rStrImpValue,
675cdf0e10cSrcweir 				 TextContentAnchorType& rType )
676cdf0e10cSrcweir {
677cdf0e10cSrcweir 	sal_uInt16 nAnchor;
678cdf0e10cSrcweir 	sal_Bool bRet = SvXMLUnitConverter::convertEnum( nAnchor, rStrImpValue,
679cdf0e10cSrcweir 												pXML_Anchor_Enum );
680cdf0e10cSrcweir 	if( bRet )
681cdf0e10cSrcweir 		rType = (TextContentAnchorType)nAnchor;
682cdf0e10cSrcweir 	return bRet;
683cdf0e10cSrcweir }
684cdf0e10cSrcweir 
685cdf0e10cSrcweir // ---------------------------------------------------------------------------
686cdf0e10cSrcweir 
687cdf0e10cSrcweir 
~XMLTextColumnsPropertyHandler()688cdf0e10cSrcweir XMLTextColumnsPropertyHandler::~XMLTextColumnsPropertyHandler ()
689cdf0e10cSrcweir {
690cdf0e10cSrcweir }
691cdf0e10cSrcweir 
equals(const Any & r1,const Any & r2) const692cdf0e10cSrcweir bool XMLTextColumnsPropertyHandler::equals(
693cdf0e10cSrcweir 		const Any& r1,
694cdf0e10cSrcweir 		const Any& r2 ) const
695cdf0e10cSrcweir {
696cdf0e10cSrcweir 	Reference < XTextColumns > xColumns1;
697cdf0e10cSrcweir 	r1 >>= xColumns1;
698cdf0e10cSrcweir 
699cdf0e10cSrcweir 	Reference < XTextColumns > xColumns2;
700cdf0e10cSrcweir 	r2 >>= xColumns2;
701cdf0e10cSrcweir 
702cdf0e10cSrcweir 	if( xColumns1->getColumnCount() != xColumns2->getColumnCount() ||
703cdf0e10cSrcweir 	  	xColumns1->getReferenceValue() != xColumns2->getReferenceValue() )
704cdf0e10cSrcweir 		return sal_False;
705cdf0e10cSrcweir 
706cdf0e10cSrcweir 	Sequence < TextColumn > aColumns1 = xColumns1->getColumns();
707cdf0e10cSrcweir 	Sequence < TextColumn > aColumns2 = xColumns2->getColumns();
708cdf0e10cSrcweir 	sal_Int32 nCount = aColumns1.getLength();
709cdf0e10cSrcweir 	if( aColumns2.getLength() != nCount )
710cdf0e10cSrcweir 		return sal_False;
711cdf0e10cSrcweir 
712cdf0e10cSrcweir 	const TextColumn *pColumns1 = aColumns1.getArray();
713cdf0e10cSrcweir 	const TextColumn *pColumns2 = aColumns2.getArray();
714cdf0e10cSrcweir 
715cdf0e10cSrcweir 	while( nCount-- )
716cdf0e10cSrcweir 	{
717cdf0e10cSrcweir 		if( pColumns1->Width != pColumns2->Width ||
718cdf0e10cSrcweir 		 	pColumns1->LeftMargin != pColumns2->LeftMargin ||
719cdf0e10cSrcweir 		 	pColumns1->RightMargin != pColumns2->RightMargin )
720cdf0e10cSrcweir 			return sal_False;
721cdf0e10cSrcweir 
722cdf0e10cSrcweir 		pColumns1++;
723cdf0e10cSrcweir 		pColumns2++;
724cdf0e10cSrcweir 	}
725cdf0e10cSrcweir 
726cdf0e10cSrcweir 	return sal_True;
727cdf0e10cSrcweir }
728cdf0e10cSrcweir 
importXML(const OUString &,Any &,const SvXMLUnitConverter &) const729cdf0e10cSrcweir sal_Bool XMLTextColumnsPropertyHandler::importXML(
730cdf0e10cSrcweir 		const OUString&,
731cdf0e10cSrcweir 	   	Any&,
732cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
733cdf0e10cSrcweir {
734*870262e3SDon Lewis 	DBG_ASSERT( sal_False, "columns are an element import property" );
735cdf0e10cSrcweir 	return sal_False;
736cdf0e10cSrcweir }
737cdf0e10cSrcweir 
exportXML(OUString &,const Any &,const SvXMLUnitConverter &) const738cdf0e10cSrcweir sal_Bool XMLTextColumnsPropertyHandler::exportXML(
739cdf0e10cSrcweir 		OUString&,
740cdf0e10cSrcweir 		const Any&,
741cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
742cdf0e10cSrcweir {
743*870262e3SDon Lewis 	DBG_ASSERT( sal_False, "columns are an element export property" );
744cdf0e10cSrcweir 	return sal_False;
745cdf0e10cSrcweir }
746cdf0e10cSrcweir 
747cdf0e10cSrcweir // ---------------------------------------------------------------------------
748cdf0e10cSrcweir 
749cdf0e10cSrcweir class XMLHoriMirrorPropHdl_Impl : public XMLPropertyHandler
750cdf0e10cSrcweir {
751cdf0e10cSrcweir public:
752cdf0e10cSrcweir 	virtual ~XMLHoriMirrorPropHdl_Impl ();
753cdf0e10cSrcweir 
754cdf0e10cSrcweir 	virtual sal_Bool importXML(
755cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
756cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
757cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
758cdf0e10cSrcweir 	virtual sal_Bool exportXML(
759cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
760cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
761cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
762cdf0e10cSrcweir };
763cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const764cdf0e10cSrcweir sal_Bool XMLHoriMirrorPropHdl_Impl::importXML(
765cdf0e10cSrcweir 		const OUString& rStrImpValue,
766cdf0e10cSrcweir 	   	Any& rValue,
767cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
768cdf0e10cSrcweir {
769cdf0e10cSrcweir 	sal_uInt16 nHoriMirror;
770cdf0e10cSrcweir 	sal_Bool bRet = SvXMLUnitConverter::convertEnum( nHoriMirror, rStrImpValue,
771cdf0e10cSrcweir 												pXML_HoriMirror_Enum );
772cdf0e10cSrcweir 
773cdf0e10cSrcweir 	if( bRet )
774cdf0e10cSrcweir 	{
775cdf0e10cSrcweir 		sal_Bool bTmp = nHoriMirror != 0;
776cdf0e10cSrcweir 		rValue.setValue( &bTmp, ::getBooleanCppuType() );
777cdf0e10cSrcweir 	}
778cdf0e10cSrcweir 
779cdf0e10cSrcweir 	return bRet;
780cdf0e10cSrcweir }
781cdf0e10cSrcweir 
exportXML(OUString &,const Any &,const SvXMLUnitConverter &) const782cdf0e10cSrcweir sal_Bool XMLHoriMirrorPropHdl_Impl::exportXML(
783cdf0e10cSrcweir 		OUString&,
784cdf0e10cSrcweir 		const Any&,
785cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
786cdf0e10cSrcweir {
787*870262e3SDon Lewis 	DBG_ASSERT( sal_False, "HorMirror property shouldn't be exported" );
788cdf0e10cSrcweir 
789cdf0e10cSrcweir 	return sal_False;
790cdf0e10cSrcweir }
791cdf0e10cSrcweir 
~XMLHoriMirrorPropHdl_Impl()792cdf0e10cSrcweir XMLHoriMirrorPropHdl_Impl::~XMLHoriMirrorPropHdl_Impl ()
793cdf0e10cSrcweir {
794cdf0e10cSrcweir }
795cdf0e10cSrcweir 
796cdf0e10cSrcweir // ---------------------------------------------------------------------------
797cdf0e10cSrcweir 
798cdf0e10cSrcweir class XMLGrfMirrorPropHdl_Impl : public XMLPropertyHandler
799cdf0e10cSrcweir {
800cdf0e10cSrcweir 	const OUString sVal;
801cdf0e10cSrcweir 	sal_Bool bHori;
802cdf0e10cSrcweir 
803cdf0e10cSrcweir public:
XMLGrfMirrorPropHdl_Impl(enum XMLTokenEnum eVal,sal_Bool bH)804cdf0e10cSrcweir 	XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal, sal_Bool bH ) :
805cdf0e10cSrcweir 	   	sVal( GetXMLToken( eVal ) ),
806cdf0e10cSrcweir 		bHori( bH ) {}
807cdf0e10cSrcweir 	virtual ~XMLGrfMirrorPropHdl_Impl ();
808cdf0e10cSrcweir 
809cdf0e10cSrcweir 	virtual sal_Bool importXML(
810cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
811cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
812cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
813cdf0e10cSrcweir 	virtual sal_Bool exportXML(
814cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
815cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
816cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
817cdf0e10cSrcweir };
818cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const819cdf0e10cSrcweir sal_Bool XMLGrfMirrorPropHdl_Impl::importXML(
820cdf0e10cSrcweir 		const OUString& rStrImpValue,
821cdf0e10cSrcweir 	   	Any& rValue,
822cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
823cdf0e10cSrcweir {
824cdf0e10cSrcweir 	sal_Bool bRet = sal_True;
825cdf0e10cSrcweir 	sal_Bool bVal = sal_False;
826cdf0e10cSrcweir 	if( ! IsXMLToken( rStrImpValue, XML_NONE ) )
827cdf0e10cSrcweir 	{
828cdf0e10cSrcweir 		bRet = sal_False;
829cdf0e10cSrcweir 		SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
830cdf0e10cSrcweir 		OUString aToken;
831cdf0e10cSrcweir 		while( aTokenEnum.getNextToken( aToken ) )
832cdf0e10cSrcweir 		{
833cdf0e10cSrcweir 			bRet = sal_True;
834cdf0e10cSrcweir 			if( aToken == sVal ||
835cdf0e10cSrcweir 			 	(bHori && IsXMLToken( aToken, XML_HORIZONTAL ) ) )
836cdf0e10cSrcweir 			{
837cdf0e10cSrcweir 				bVal = sal_True;
838cdf0e10cSrcweir 				break;
839cdf0e10cSrcweir 			}
840cdf0e10cSrcweir 		}
841cdf0e10cSrcweir 	}
842cdf0e10cSrcweir 
843cdf0e10cSrcweir 	if( bRet )
844cdf0e10cSrcweir 		rValue.setValue( &bVal, ::getBooleanCppuType() );
845cdf0e10cSrcweir 
846cdf0e10cSrcweir 	return bRet;
847cdf0e10cSrcweir }
848cdf0e10cSrcweir 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const849cdf0e10cSrcweir sal_Bool XMLGrfMirrorPropHdl_Impl::exportXML(
850cdf0e10cSrcweir 		OUString& rStrExpValue,
851cdf0e10cSrcweir 		const Any& rValue,
852cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
853cdf0e10cSrcweir {
854cdf0e10cSrcweir 	if( *(sal_Bool *)rValue.getValue() )
855cdf0e10cSrcweir 	{
856cdf0e10cSrcweir 		if( !rStrExpValue.getLength() ||
857cdf0e10cSrcweir 			IsXMLToken( rStrExpValue, XML_NONE ) )
858cdf0e10cSrcweir 		{
859cdf0e10cSrcweir 	   		rStrExpValue = sVal;
860cdf0e10cSrcweir 		}
861cdf0e10cSrcweir 		else if( bHori &&
862cdf0e10cSrcweir                  // --> OD 2005-05-12 #i49139#
863cdf0e10cSrcweir                  // XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES
864cdf0e10cSrcweir                  // are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD.
865cdf0e10cSrcweir                  ( IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_EVEN ) ||
866cdf0e10cSrcweir                    IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_ODD ) ))
867cdf0e10cSrcweir                  // <--
868cdf0e10cSrcweir 		{
869cdf0e10cSrcweir 			rStrExpValue = GetXMLToken( XML_HORIZONTAL );
870cdf0e10cSrcweir 		}
871cdf0e10cSrcweir 		else
872cdf0e10cSrcweir 		{
873cdf0e10cSrcweir 			OUStringBuffer aOut( rStrExpValue.getLength() + 1 +
874cdf0e10cSrcweir 								 sVal.getLength() );
875cdf0e10cSrcweir 			aOut.append( rStrExpValue );
876cdf0e10cSrcweir 			aOut.append( (sal_Unicode)' ' );
877cdf0e10cSrcweir 			aOut.append( sVal );
878cdf0e10cSrcweir 			rStrExpValue = aOut.makeStringAndClear();
879cdf0e10cSrcweir 		}
880cdf0e10cSrcweir 	}
881cdf0e10cSrcweir 	else if( !rStrExpValue.getLength() )
882cdf0e10cSrcweir 	{
883cdf0e10cSrcweir 	   	rStrExpValue = GetXMLToken( XML_NONE );
884cdf0e10cSrcweir 	}
885cdf0e10cSrcweir 
886cdf0e10cSrcweir 	return sal_True;
887cdf0e10cSrcweir }
888cdf0e10cSrcweir 
~XMLGrfMirrorPropHdl_Impl()889cdf0e10cSrcweir XMLGrfMirrorPropHdl_Impl::~XMLGrfMirrorPropHdl_Impl()
890cdf0e10cSrcweir {
891cdf0e10cSrcweir }
892cdf0e10cSrcweir 
893cdf0e10cSrcweir // ---------------------------------------------------------------------------
894cdf0e10cSrcweir 
895cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_Emphasize_Enum[] =
896cdf0e10cSrcweir {
897cdf0e10cSrcweir 	{ XML_NONE,	    FontEmphasis::NONE },
898cdf0e10cSrcweir 	{ XML_DOT,		FontEmphasis::DOT_ABOVE },
899cdf0e10cSrcweir 	{ XML_CIRCLE,	FontEmphasis::CIRCLE_ABOVE },
900cdf0e10cSrcweir 	{ XML_DISC,	    FontEmphasis::DISK_ABOVE },
901cdf0e10cSrcweir 	{ XML_ACCENT,	FontEmphasis::ACCENT_ABOVE },
902cdf0e10cSrcweir 	{ XML_TOKEN_INVALID, 0 }
903cdf0e10cSrcweir };
904cdf0e10cSrcweir class XMLTextEmphasizePropHdl_Impl : public XMLPropertyHandler
905cdf0e10cSrcweir {
906cdf0e10cSrcweir public:
XMLTextEmphasizePropHdl_Impl()907cdf0e10cSrcweir 	XMLTextEmphasizePropHdl_Impl() {}
908cdf0e10cSrcweir 	virtual ~XMLTextEmphasizePropHdl_Impl();
909cdf0e10cSrcweir 
910cdf0e10cSrcweir 	virtual sal_Bool importXML(
911cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
912cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
913cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
914cdf0e10cSrcweir 	virtual sal_Bool exportXML(
915cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
916cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
917cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
918cdf0e10cSrcweir };
919cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const920cdf0e10cSrcweir sal_Bool XMLTextEmphasizePropHdl_Impl::importXML(
921cdf0e10cSrcweir 		const OUString& rStrImpValue,
922cdf0e10cSrcweir 	   	Any& rValue,
923cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
924cdf0e10cSrcweir {
925cdf0e10cSrcweir 	sal_Bool bRet = sal_True;
926cdf0e10cSrcweir 	sal_uInt16 nVal = FontEmphasis::NONE;
927cdf0e10cSrcweir 	sal_Bool bBelow = sal_False;
928cdf0e10cSrcweir 	sal_Bool bHasPos = sal_False, bHasType = sal_False;
929cdf0e10cSrcweir 	OUString aToken;
930cdf0e10cSrcweir 
931cdf0e10cSrcweir 	SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
932cdf0e10cSrcweir 	while( aTokenEnum.getNextToken( aToken ) )
933cdf0e10cSrcweir 	{
934cdf0e10cSrcweir 		if( !bHasPos && IsXMLToken( aToken, XML_ABOVE ) )
935cdf0e10cSrcweir 		{
936cdf0e10cSrcweir 			bBelow = sal_False;
937cdf0e10cSrcweir 			bHasPos = sal_True;
938cdf0e10cSrcweir 		}
939cdf0e10cSrcweir 		else if( !bHasPos && IsXMLToken( aToken, XML_BELOW ) )
940cdf0e10cSrcweir 		{
941cdf0e10cSrcweir 			bBelow = sal_True;
942cdf0e10cSrcweir 			bHasPos = sal_True;
943cdf0e10cSrcweir 		}
944cdf0e10cSrcweir 		else if( !bHasType &&
945cdf0e10cSrcweir 			 	 SvXMLUnitConverter::convertEnum( nVal, aToken,
946cdf0e10cSrcweir 											 pXML_Emphasize_Enum ))
947cdf0e10cSrcweir 		{
948cdf0e10cSrcweir 			bHasType = sal_True;
949cdf0e10cSrcweir 		}
950cdf0e10cSrcweir 		else
951cdf0e10cSrcweir 		{
952cdf0e10cSrcweir 			bRet = sal_False;
953cdf0e10cSrcweir 			break;
954cdf0e10cSrcweir 		}
955cdf0e10cSrcweir 	}
956cdf0e10cSrcweir 
957cdf0e10cSrcweir 	if( bRet )
958cdf0e10cSrcweir 	{
959cdf0e10cSrcweir 		if( FontEmphasis::NONE != nVal && bBelow )
960cdf0e10cSrcweir 			nVal += 10;
961cdf0e10cSrcweir 		rValue <<= (sal_Int16)nVal;
962cdf0e10cSrcweir 	}
963cdf0e10cSrcweir 
964cdf0e10cSrcweir 	return bRet;
965cdf0e10cSrcweir }
966cdf0e10cSrcweir 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const967cdf0e10cSrcweir sal_Bool XMLTextEmphasizePropHdl_Impl::exportXML(
968cdf0e10cSrcweir 		OUString& rStrExpValue,
969cdf0e10cSrcweir 		const Any& rValue,
970cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
971cdf0e10cSrcweir {
972cdf0e10cSrcweir 	OUStringBuffer aOut( 15 );
973cdf0e10cSrcweir 	sal_Bool bRet = sal_True;
974cdf0e10cSrcweir 	sal_Int16 nType = sal_Int16();
975cdf0e10cSrcweir 	if( rValue >>= nType )
976cdf0e10cSrcweir 	{
977cdf0e10cSrcweir 		sal_Bool bBelow = sal_False;
978cdf0e10cSrcweir 		if( nType > 10 )
979cdf0e10cSrcweir 		{
980cdf0e10cSrcweir 			bBelow = sal_True;
981cdf0e10cSrcweir 			nType -= 10;
982cdf0e10cSrcweir 		}
983cdf0e10cSrcweir 		bRet = SvXMLUnitConverter::convertEnum( aOut, nType,
984cdf0e10cSrcweir 										   pXML_Emphasize_Enum,
985cdf0e10cSrcweir 										   XML_DOT );
986cdf0e10cSrcweir 		if( bRet )
987cdf0e10cSrcweir 		{
988cdf0e10cSrcweir 			if( nType != 0 )
989cdf0e10cSrcweir 			{
990cdf0e10cSrcweir 				enum XMLTokenEnum ePos = bBelow ? XML_BELOW : XML_ABOVE;
991cdf0e10cSrcweir 				aOut.append( (sal_Unicode)' ' );
992cdf0e10cSrcweir 				aOut.append( GetXMLToken(ePos) );
993cdf0e10cSrcweir 			}
994cdf0e10cSrcweir 			rStrExpValue = aOut.makeStringAndClear();
995cdf0e10cSrcweir 		}
996cdf0e10cSrcweir 	}
997cdf0e10cSrcweir 
998cdf0e10cSrcweir 	return bRet;
999cdf0e10cSrcweir }
1000cdf0e10cSrcweir 
~XMLTextEmphasizePropHdl_Impl()1001cdf0e10cSrcweir XMLTextEmphasizePropHdl_Impl::~XMLTextEmphasizePropHdl_Impl()
1002cdf0e10cSrcweir {
1003cdf0e10cSrcweir }
1004cdf0e10cSrcweir 
1005cdf0e10cSrcweir 
1006cdf0e10cSrcweir // ---------------------------------------------------------------------------
1007cdf0e10cSrcweir 
1008cdf0e10cSrcweir class XMLTextCombineCharPropHdl_Impl : public XMLPropertyHandler
1009cdf0e10cSrcweir {
1010cdf0e10cSrcweir public:
XMLTextCombineCharPropHdl_Impl()1011cdf0e10cSrcweir 	XMLTextCombineCharPropHdl_Impl() {}
1012cdf0e10cSrcweir 	virtual ~XMLTextCombineCharPropHdl_Impl();
1013cdf0e10cSrcweir 
1014cdf0e10cSrcweir 	virtual sal_Bool importXML(
1015cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
1016cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
1017cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
1018cdf0e10cSrcweir 	virtual sal_Bool exportXML(
1019cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
1020cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
1021cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
1022cdf0e10cSrcweir };
1023cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const1024cdf0e10cSrcweir sal_Bool XMLTextCombineCharPropHdl_Impl::importXML(
1025cdf0e10cSrcweir 		const OUString& rStrImpValue,
1026cdf0e10cSrcweir 	   	Any& rValue,
1027cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
1028cdf0e10cSrcweir {
1029cdf0e10cSrcweir 	if( rStrImpValue.getLength() )
1030cdf0e10cSrcweir 		rValue <<= rStrImpValue.copy( 0, 1 );
1031cdf0e10cSrcweir 	else
1032cdf0e10cSrcweir 		rValue <<= rStrImpValue;
1033cdf0e10cSrcweir 
1034cdf0e10cSrcweir 	return sal_True;
1035cdf0e10cSrcweir }
1036cdf0e10cSrcweir 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const1037cdf0e10cSrcweir sal_Bool XMLTextCombineCharPropHdl_Impl::exportXML(
1038cdf0e10cSrcweir 		OUString& rStrExpValue,
1039cdf0e10cSrcweir 		const Any& rValue,
1040cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
1041cdf0e10cSrcweir {
1042cdf0e10cSrcweir 	rValue >>= rStrExpValue;
1043cdf0e10cSrcweir 
1044cdf0e10cSrcweir     // #i114107# attribute of type "character": export only if length is 1
1045cdf0e10cSrcweir     return (1 == rStrExpValue.getLength())  ? sal_True : sal_False;
1046cdf0e10cSrcweir }
1047cdf0e10cSrcweir 
~XMLTextCombineCharPropHdl_Impl()1048cdf0e10cSrcweir XMLTextCombineCharPropHdl_Impl::~XMLTextCombineCharPropHdl_Impl()
1049cdf0e10cSrcweir {
1050cdf0e10cSrcweir }
1051cdf0e10cSrcweir 
1052cdf0e10cSrcweir // ---------------------------------------------------------------------------
1053cdf0e10cSrcweir 
1054cdf0e10cSrcweir class XMLTextRelWidthHeightPropHdl_Impl : public XMLPropertyHandler
1055cdf0e10cSrcweir {
1056cdf0e10cSrcweir public:
XMLTextRelWidthHeightPropHdl_Impl()1057cdf0e10cSrcweir 	XMLTextRelWidthHeightPropHdl_Impl() {}
1058cdf0e10cSrcweir 	virtual ~XMLTextRelWidthHeightPropHdl_Impl();
1059cdf0e10cSrcweir 
1060cdf0e10cSrcweir 	virtual sal_Bool importXML(
1061cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
1062cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
1063cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
1064cdf0e10cSrcweir 	virtual sal_Bool exportXML(
1065cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
1066cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
1067cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
1068cdf0e10cSrcweir };
1069cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const1070cdf0e10cSrcweir sal_Bool XMLTextRelWidthHeightPropHdl_Impl::importXML(
1071cdf0e10cSrcweir 		const OUString& rStrImpValue,
1072cdf0e10cSrcweir 	   	Any& rValue,
1073cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
1074cdf0e10cSrcweir {
1075cdf0e10cSrcweir 	sal_Bool bRet;
1076cdf0e10cSrcweir 	sal_Int32 nValue;
1077cdf0e10cSrcweir 	bRet = SvXMLUnitConverter::convertPercent( nValue, rStrImpValue );
1078cdf0e10cSrcweir 	if( bRet )
1079cdf0e10cSrcweir 		rValue <<= (sal_Int16)nValue;
1080cdf0e10cSrcweir 
1081cdf0e10cSrcweir 	return bRet;
1082cdf0e10cSrcweir }
1083cdf0e10cSrcweir 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const1084cdf0e10cSrcweir sal_Bool XMLTextRelWidthHeightPropHdl_Impl::exportXML(
1085cdf0e10cSrcweir 		OUString& rStrExpValue,
1086cdf0e10cSrcweir 		const Any& rValue,
1087cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
1088cdf0e10cSrcweir {
1089cdf0e10cSrcweir 	sal_Bool bRet = sal_False;
1090cdf0e10cSrcweir 	sal_Int16 nValue = sal_Int16();
1091cdf0e10cSrcweir 	if( (rValue >>= nValue) && nValue > 0 )
1092cdf0e10cSrcweir 	{
1093cdf0e10cSrcweir 		OUStringBuffer aOut;
1094cdf0e10cSrcweir 	 	SvXMLUnitConverter::convertPercent( aOut, nValue );
1095cdf0e10cSrcweir 		rStrExpValue = aOut.makeStringAndClear();
1096cdf0e10cSrcweir 
1097cdf0e10cSrcweir 		bRet = sal_True;
1098cdf0e10cSrcweir 	}
1099cdf0e10cSrcweir 
1100cdf0e10cSrcweir 	return bRet;
1101cdf0e10cSrcweir }
1102cdf0e10cSrcweir 
~XMLTextRelWidthHeightPropHdl_Impl()1103cdf0e10cSrcweir XMLTextRelWidthHeightPropHdl_Impl::~XMLTextRelWidthHeightPropHdl_Impl()
1104cdf0e10cSrcweir {
1105cdf0e10cSrcweir }
1106cdf0e10cSrcweir 
1107cdf0e10cSrcweir // ---------------------------------------------------------------------------
1108cdf0e10cSrcweir 
1109cdf0e10cSrcweir class XMLTextSyncWidthHeightPropHdl_Impl : public XMLPropertyHandler
1110cdf0e10cSrcweir {
1111cdf0e10cSrcweir 	const OUString sValue;
1112cdf0e10cSrcweir 
1113cdf0e10cSrcweir public:
XMLTextSyncWidthHeightPropHdl_Impl(enum XMLTokenEnum eValue)1114cdf0e10cSrcweir 	XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue ) :
1115cdf0e10cSrcweir    		sValue( GetXMLToken(eValue) )	{}
1116cdf0e10cSrcweir 	virtual ~XMLTextSyncWidthHeightPropHdl_Impl();
1117cdf0e10cSrcweir 
1118cdf0e10cSrcweir 	virtual sal_Bool importXML(
1119cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
1120cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
1121cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
1122cdf0e10cSrcweir 	virtual sal_Bool exportXML(
1123cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
1124cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
1125cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
1126cdf0e10cSrcweir };
1127cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const1128cdf0e10cSrcweir sal_Bool XMLTextSyncWidthHeightPropHdl_Impl::importXML(
1129cdf0e10cSrcweir 		const OUString& rStrImpValue,
1130cdf0e10cSrcweir 	   	Any& rValue,
1131cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
1132cdf0e10cSrcweir {
1133cdf0e10cSrcweir 	sal_Bool bValue = (rStrImpValue == sValue );
1134cdf0e10cSrcweir 	rValue.setValue( &bValue, ::getBooleanCppuType() );
1135cdf0e10cSrcweir 
1136cdf0e10cSrcweir 	return sal_True;
1137cdf0e10cSrcweir }
1138cdf0e10cSrcweir 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const1139cdf0e10cSrcweir sal_Bool XMLTextSyncWidthHeightPropHdl_Impl::exportXML(
1140cdf0e10cSrcweir 		OUString& rStrExpValue,
1141cdf0e10cSrcweir 		const Any& rValue,
1142cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
1143cdf0e10cSrcweir {
1144cdf0e10cSrcweir 	sal_Bool bRet = sal_False;
1145cdf0e10cSrcweir 	if( *(sal_Bool *)rValue.getValue() )
1146cdf0e10cSrcweir 	{
1147cdf0e10cSrcweir 		rStrExpValue = sValue;
1148cdf0e10cSrcweir 		bRet = sal_True;
1149cdf0e10cSrcweir 	}
1150cdf0e10cSrcweir 
1151cdf0e10cSrcweir 	return bRet;
1152cdf0e10cSrcweir }
1153cdf0e10cSrcweir 
~XMLTextSyncWidthHeightPropHdl_Impl()1154cdf0e10cSrcweir XMLTextSyncWidthHeightPropHdl_Impl::~XMLTextSyncWidthHeightPropHdl_Impl()
1155cdf0e10cSrcweir {
1156cdf0e10cSrcweir }
1157cdf0e10cSrcweir 
1158cdf0e10cSrcweir // ---------------------------------------------------------------------------
1159cdf0e10cSrcweir 
1160cdf0e10cSrcweir class XMLTextRotationAnglePropHdl_Impl : public XMLPropertyHandler
1161cdf0e10cSrcweir {
1162cdf0e10cSrcweir 
1163cdf0e10cSrcweir public:
XMLTextRotationAnglePropHdl_Impl()1164cdf0e10cSrcweir 	XMLTextRotationAnglePropHdl_Impl()	{}
1165cdf0e10cSrcweir 	virtual ~XMLTextRotationAnglePropHdl_Impl();
1166cdf0e10cSrcweir 
1167cdf0e10cSrcweir 	virtual sal_Bool importXML(
1168cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
1169cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
1170cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
1171cdf0e10cSrcweir 	virtual sal_Bool exportXML(
1172cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
1173cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
1174cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
1175cdf0e10cSrcweir };
1176cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const1177cdf0e10cSrcweir sal_Bool XMLTextRotationAnglePropHdl_Impl::importXML(
1178cdf0e10cSrcweir 		const OUString& rStrImpValue,
1179cdf0e10cSrcweir 	   	Any& rValue,
1180cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
1181cdf0e10cSrcweir {
1182cdf0e10cSrcweir 	sal_Int32 nValue;
1183cdf0e10cSrcweir 	sal_Bool bRet = SvXMLUnitConverter::convertNumber( nValue, rStrImpValue );
1184cdf0e10cSrcweir 	if( bRet )
1185cdf0e10cSrcweir 	{
1186cdf0e10cSrcweir 		nValue = (nValue % 360 );
1187cdf0e10cSrcweir 		if( nValue < 0 )
1188cdf0e10cSrcweir 			nValue = 360 + nValue;
1189cdf0e10cSrcweir 		sal_Int16 nAngle;
1190cdf0e10cSrcweir 		if( nValue < 45 || nValue > 315 )
1191cdf0e10cSrcweir 			nAngle = 0;
1192cdf0e10cSrcweir 		else if( nValue < 180 )
1193cdf0e10cSrcweir 			nAngle = 900;
1194cdf0e10cSrcweir 		else /* if nValalue <= 315 ) */
1195cdf0e10cSrcweir 			nAngle = 2700;
1196cdf0e10cSrcweir 		rValue <<= nAngle;
1197cdf0e10cSrcweir 	}
1198cdf0e10cSrcweir 
1199cdf0e10cSrcweir 	return bRet;
1200cdf0e10cSrcweir }
1201cdf0e10cSrcweir 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const1202cdf0e10cSrcweir sal_Bool XMLTextRotationAnglePropHdl_Impl::exportXML(
1203cdf0e10cSrcweir 		OUString& rStrExpValue,
1204cdf0e10cSrcweir 		const Any& rValue,
1205cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
1206cdf0e10cSrcweir {
1207cdf0e10cSrcweir 	sal_Int16 nAngle = sal_Int16();
1208cdf0e10cSrcweir 	sal_Bool bRet = ( rValue >>= nAngle );
1209cdf0e10cSrcweir 	if( bRet )
1210cdf0e10cSrcweir 	{
1211cdf0e10cSrcweir 		OUStringBuffer aOut;
1212cdf0e10cSrcweir 		SvXMLUnitConverter::convertNumber( aOut, nAngle / 10 );
1213cdf0e10cSrcweir 		rStrExpValue = aOut.makeStringAndClear();
1214cdf0e10cSrcweir 	}
1215cdf0e10cSrcweir 	OSL_ENSURE( bRet, "illegal rotation angle" );
1216cdf0e10cSrcweir 
1217cdf0e10cSrcweir 	return bRet;
1218cdf0e10cSrcweir }
1219cdf0e10cSrcweir 
~XMLTextRotationAnglePropHdl_Impl()1220cdf0e10cSrcweir XMLTextRotationAnglePropHdl_Impl::~XMLTextRotationAnglePropHdl_Impl()
1221cdf0e10cSrcweir {
1222cdf0e10cSrcweir }
1223cdf0e10cSrcweir // ---------------------------------------------------------------------------
1224cdf0e10cSrcweir class XMLNumber8OneBasedHdl : public XMLPropertyHandler
1225cdf0e10cSrcweir {
1226cdf0e10cSrcweir 
1227cdf0e10cSrcweir public:
XMLNumber8OneBasedHdl()1228cdf0e10cSrcweir 	XMLNumber8OneBasedHdl()	{}
~XMLNumber8OneBasedHdl()1229cdf0e10cSrcweir 	virtual ~XMLNumber8OneBasedHdl() {};
1230cdf0e10cSrcweir 
1231cdf0e10cSrcweir 	virtual sal_Bool importXML(
1232cdf0e10cSrcweir 			const ::rtl::OUString& rStrImpValue,
1233cdf0e10cSrcweir 			::com::sun::star::uno::Any& rValue,
1234cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
1235cdf0e10cSrcweir 	virtual sal_Bool exportXML(
1236cdf0e10cSrcweir 			::rtl::OUString& rStrExpValue,
1237cdf0e10cSrcweir 			const ::com::sun::star::uno::Any& rValue,
1238cdf0e10cSrcweir 			const SvXMLUnitConverter& ) const;
1239cdf0e10cSrcweir };
1240cdf0e10cSrcweir 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const1241cdf0e10cSrcweir sal_Bool XMLNumber8OneBasedHdl::importXML(
1242cdf0e10cSrcweir 		const OUString& rStrImpValue,
1243cdf0e10cSrcweir 	   	Any& rValue,
1244cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
1245cdf0e10cSrcweir {
1246cdf0e10cSrcweir 	sal_Int32 nValue = 0;
1247cdf0e10cSrcweir 	sal_Bool bRet = SvXMLUnitConverter::convertNumber( nValue, rStrImpValue );
1248cdf0e10cSrcweir     if( bRet )
1249cdf0e10cSrcweir         rValue <<= static_cast<sal_Int8>( nValue - 1 );
1250cdf0e10cSrcweir 	return bRet;
1251cdf0e10cSrcweir }
1252cdf0e10cSrcweir 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const1253cdf0e10cSrcweir sal_Bool XMLNumber8OneBasedHdl::exportXML(
1254cdf0e10cSrcweir 		OUString& rStrExpValue,
1255cdf0e10cSrcweir 		const Any& rValue,
1256cdf0e10cSrcweir 		const SvXMLUnitConverter& ) const
1257cdf0e10cSrcweir {
1258cdf0e10cSrcweir 	sal_Int8 nValue = sal_Int8();
1259cdf0e10cSrcweir 	sal_Bool bRet = ( rValue >>= nValue );
1260cdf0e10cSrcweir     if( bRet )
1261cdf0e10cSrcweir 	{
1262cdf0e10cSrcweir         OUStringBuffer aOut;
1263cdf0e10cSrcweir 	 	SvXMLUnitConverter::convertNumber( aOut, nValue + 1 );
1264cdf0e10cSrcweir 		rStrExpValue = aOut.makeStringAndClear();
1265cdf0e10cSrcweir 	}
1266cdf0e10cSrcweir 	return bRet;
1267cdf0e10cSrcweir }
1268cdf0e10cSrcweir // ---------------------------------------------------------------------------
1269cdf0e10cSrcweir class XMLTextPropertyHandlerFactory_Impl
1270cdf0e10cSrcweir {
1271cdf0e10cSrcweir public:
1272cdf0e10cSrcweir 	const XMLPropertyHandler *GetPropertyHandler( sal_Int32 nType ) const;
1273cdf0e10cSrcweir 
1274cdf0e10cSrcweir 	XMLTextPropertyHandlerFactory_Impl();
1275cdf0e10cSrcweir 	~XMLTextPropertyHandlerFactory_Impl();
1276cdf0e10cSrcweir };
1277cdf0e10cSrcweir 
GetPropertyHandler(sal_Int32 nType) const1278cdf0e10cSrcweir const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler
1279cdf0e10cSrcweir 	( sal_Int32 nType ) const
1280cdf0e10cSrcweir {
1281cdf0e10cSrcweir 	const XMLPropertyHandler* pHdl = 0;
1282cdf0e10cSrcweir 	switch( nType )
1283cdf0e10cSrcweir 	{
1284cdf0e10cSrcweir 	case XML_TYPE_TEXT_DROPCAP:
1285cdf0e10cSrcweir 		pHdl = new XMLDropCapPropHdl_Impl;
1286cdf0e10cSrcweir 		break;
1287cdf0e10cSrcweir 	case XML_TYPE_TEXT_WRAP:
1288cdf0e10cSrcweir 		pHdl = new XMLWrapPropHdl_Impl;
1289cdf0e10cSrcweir 		break;
1290cdf0e10cSrcweir 	case XML_TYPE_TEXT_PARAGRAPH_ONLY:
1291cdf0e10cSrcweir 		pHdl = new XMLParagraphOnlyPropHdl_Impl;
1292cdf0e10cSrcweir 		break;
1293cdf0e10cSrcweir 	case XML_TYPE_TEXT_WRAP_OUTSIDE:
1294cdf0e10cSrcweir 		pHdl = new XMLContourModePropHdl_Impl;
1295cdf0e10cSrcweir 		break;
1296cdf0e10cSrcweir 	case XML_TYPE_TEXT_OPAQUE:
1297cdf0e10cSrcweir 		pHdl = new XMLOpaquePropHdl_Impl;
1298cdf0e10cSrcweir 		break;
1299cdf0e10cSrcweir 	case XML_TYPE_TEXT_PROTECT_CONTENT:
1300cdf0e10cSrcweir 		pHdl = new XMLFrameProtectPropHdl_Impl( XML_CONTENT );
1301cdf0e10cSrcweir 		break;
1302cdf0e10cSrcweir 	case XML_TYPE_TEXT_PROTECT_SIZE:
1303cdf0e10cSrcweir 		pHdl = new XMLFrameProtectPropHdl_Impl( XML_SIZE );
1304cdf0e10cSrcweir 		break;
1305cdf0e10cSrcweir 	case XML_TYPE_TEXT_PROTECT_POSITION:
1306cdf0e10cSrcweir 		pHdl = new XMLFrameProtectPropHdl_Impl( XML_POSITION );
1307cdf0e10cSrcweir 		break;
1308cdf0e10cSrcweir 	case XML_TYPE_TEXT_ANCHOR_TYPE:
1309cdf0e10cSrcweir 		pHdl = new XMLAnchorTypePropHdl;
1310cdf0e10cSrcweir 		break;
1311cdf0e10cSrcweir 	case XML_TYPE_TEXT_COLUMNS:
1312cdf0e10cSrcweir 		pHdl = new XMLTextColumnsPropertyHandler;
1313cdf0e10cSrcweir 		break;
1314cdf0e10cSrcweir 	case XML_TYPE_TEXT_HORIZONTAL_POS:
1315cdf0e10cSrcweir 		pHdl = new XMLConstantsPropertyHandler( pXML_HoriPos_Enum, XML_TOKEN_INVALID );
1316cdf0e10cSrcweir 		break;
1317cdf0e10cSrcweir 	case XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED:
1318cdf0e10cSrcweir 		pHdl = new XMLConstantsPropertyHandler( pXML_HoriPosMirrored_Enum, XML_TOKEN_INVALID );
1319cdf0e10cSrcweir 		break;
1320cdf0e10cSrcweir 	case XML_TYPE_TEXT_HORIZONTAL_REL:
1321cdf0e10cSrcweir 		pHdl = new XMLConstantsPropertyHandler( pXML_HoriRel_Enum, XML_TOKEN_INVALID );
1322cdf0e10cSrcweir 		break;
1323cdf0e10cSrcweir 	case XML_TYPE_TEXT_HORIZONTAL_REL_FRAME:
1324cdf0e10cSrcweir 		pHdl = new XMLConstantsPropertyHandler( pXML_HoriRelFrame_Enum, XML_TOKEN_INVALID );
1325cdf0e10cSrcweir 		break;
1326cdf0e10cSrcweir 	case XML_TYPE_TEXT_HORIZONTAL_MIRROR:
1327cdf0e10cSrcweir 		pHdl = new XMLHoriMirrorPropHdl_Impl;
1328cdf0e10cSrcweir 		break;
1329cdf0e10cSrcweir 	case XML_TYPE_TEXT_VERTICAL_POS:
1330cdf0e10cSrcweir 		pHdl = new XMLConstantsPropertyHandler( pXML_VertPos_Enum, XML_TOKEN_INVALID );
1331cdf0e10cSrcweir 		break;
1332cdf0e10cSrcweir 	case XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR:
1333cdf0e10cSrcweir 		pHdl = new XMLConstantsPropertyHandler( pXML_VertPosAtChar_Enum, XML_TOKEN_INVALID );
1334cdf0e10cSrcweir 		break;
1335cdf0e10cSrcweir 	case XML_TYPE_TEXT_VERTICAL_REL:
1336cdf0e10cSrcweir 		pHdl = new XMLConstantsPropertyHandler( pXML_VertRel_Enum, XML_TOKEN_INVALID );
1337cdf0e10cSrcweir 		break;
1338cdf0e10cSrcweir 	case XML_TYPE_TEXT_VERTICAL_REL_PAGE:
1339cdf0e10cSrcweir 		pHdl = new XMLConstantsPropertyHandler( pXML_VertRelPage_Enum, XML_TOKEN_INVALID );
1340cdf0e10cSrcweir 		break;
1341cdf0e10cSrcweir 	case XML_TYPE_TEXT_VERTICAL_REL_FRAME:
1342cdf0e10cSrcweir 		pHdl = new XMLConstantsPropertyHandler( pXML_VertRelFrame_Enum, XML_TOKEN_INVALID );
1343cdf0e10cSrcweir 		break;
1344cdf0e10cSrcweir 	case XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR:
1345cdf0e10cSrcweir 		pHdl = new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum, XML_TOKEN_INVALID );
1346cdf0e10cSrcweir 		break;
1347cdf0e10cSrcweir 	case XML_TYPE_TEXT_MIRROR_VERTICAL:
1348cdf0e10cSrcweir 		pHdl = new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL, sal_False );
1349cdf0e10cSrcweir 		break;
1350cdf0e10cSrcweir 	case XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT:
1351cdf0e10cSrcweir         // --> OD 2005-05-12 #i49139#
1352cdf0e10cSrcweir         // XML_HORIZONTAL_ON_LEFT_PAGES is replaced by XML_HORIZONTAL_ON_EVEN.
1353cdf0e10cSrcweir         pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_EVEN, sal_True );
1354cdf0e10cSrcweir         // <--
1355cdf0e10cSrcweir 		break;
1356cdf0e10cSrcweir 	case XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT:
1357cdf0e10cSrcweir         // --> OD 2005-05-12 #i49139#
1358cdf0e10cSrcweir         // XML_HORIZONTAL_ON_RIGHT_PAGES is replaced by XML_HORIZONTAL_ON_ODD.
1359cdf0e10cSrcweir         pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_ODD, sal_True );
1360cdf0e10cSrcweir         // <--
1361cdf0e10cSrcweir 		break;
1362cdf0e10cSrcweir 	case XML_TYPE_TEXT_CLIP:
1363cdf0e10cSrcweir 		pHdl = new XMLClipPropertyHandler( sal_False );
1364cdf0e10cSrcweir 		break;
1365cdf0e10cSrcweir 	case XML_TYPE_TEXT_CLIP11:
1366cdf0e10cSrcweir 		pHdl = new XMLClipPropertyHandler( sal_True );
1367cdf0e10cSrcweir 		break;
1368cdf0e10cSrcweir 	case XML_TYPE_TEXT_EMPHASIZE:
1369cdf0e10cSrcweir 		pHdl = new XMLTextEmphasizePropHdl_Impl;
1370cdf0e10cSrcweir 		break;
1371cdf0e10cSrcweir 	case XML_TYPE_TEXT_COMBINE:
1372cdf0e10cSrcweir 		pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LINES ),
1373cdf0e10cSrcweir                                             GetXMLToken( XML_NONE ) );
1374cdf0e10cSrcweir 		break;
1375cdf0e10cSrcweir 	case XML_TYPE_TEXT_COMBINE_CHARACTERS:
1376cdf0e10cSrcweir 		pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LETTERS ),
1377cdf0e10cSrcweir                                             GetXMLToken( XML_NONE ) );
1378cdf0e10cSrcweir 		break;
1379cdf0e10cSrcweir 	case XML_TYPE_TEXT_COMBINECHAR:
1380cdf0e10cSrcweir 		pHdl = new XMLTextCombineCharPropHdl_Impl;
1381cdf0e10cSrcweir 		break;
1382cdf0e10cSrcweir 	case XML_TYPE_TEXT_AUTOSPACE:
1383cdf0e10cSrcweir 		pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_IDEOGRAPH_ALPHA ),
1384cdf0e10cSrcweir                                             GetXMLToken( XML_NONE ) );
1385cdf0e10cSrcweir 		break;
1386cdf0e10cSrcweir 	case XML_TYPE_TEXT_PUNCTUATION_WRAP:
1387cdf0e10cSrcweir 		pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_HANGING ),
1388cdf0e10cSrcweir                                             GetXMLToken( XML_SIMPLE ) );
1389cdf0e10cSrcweir 		break;
1390cdf0e10cSrcweir 	case XML_TYPE_TEXT_LINE_BREAK:
1391cdf0e10cSrcweir 		pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_STRICT ),
1392cdf0e10cSrcweir                                             GetXMLToken( XML_NORMAL ) );
1393cdf0e10cSrcweir 		break;
1394cdf0e10cSrcweir 	case XML_TYPE_TEXT_REL_WIDTH_HEIGHT:
1395cdf0e10cSrcweir 		pHdl = new XMLTextRelWidthHeightPropHdl_Impl;
1396cdf0e10cSrcweir 		break;
1397cdf0e10cSrcweir 	case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT:
1398cdf0e10cSrcweir 		pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE );
1399cdf0e10cSrcweir 		break;
1400cdf0e10cSrcweir 	case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN:
1401cdf0e10cSrcweir 		pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN );
1402cdf0e10cSrcweir 		break;
1403cdf0e10cSrcweir 	case XML_TYPE_TEXT_RUBY_ADJUST:
1404cdf0e10cSrcweir 		pHdl = new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum, XML_TOKEN_INVALID );
1405cdf0e10cSrcweir 		break;
1406cdf0e10cSrcweir 	case XML_TYPE_TEXT_FONT_RELIEF:
1407cdf0e10cSrcweir 		pHdl = new XMLConstantsPropertyHandler( pXML_FontRelief_Enum, XML_TOKEN_INVALID );
1408cdf0e10cSrcweir 		break;
1409cdf0e10cSrcweir 	case XML_TYPE_TEXT_ROTATION_ANGLE:
1410cdf0e10cSrcweir 		pHdl = new XMLTextRotationAnglePropHdl_Impl;
1411cdf0e10cSrcweir 		break;
1412cdf0e10cSrcweir 	case XML_TYPE_TEXT_ROTATION_SCALE:
1413cdf0e10cSrcweir 		pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_FIXED ),
1414cdf0e10cSrcweir                                             GetXMLToken( XML_LINE_HEIGHT ) );
1415cdf0e10cSrcweir 		break;
1416cdf0e10cSrcweir 	case XML_TYPE_TEXT_VERTICAL_ALIGN:
1417cdf0e10cSrcweir 		pHdl = new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum, XML_TOKEN_INVALID );
1418cdf0e10cSrcweir 		break;
1419cdf0e10cSrcweir 	case XML_TYPE_TEXT_RUBY_POSITION:
1420cdf0e10cSrcweir 		pHdl = new XMLNamedBoolPropertyHdl( ::xmloff::token::XML_ABOVE,
1421cdf0e10cSrcweir 											::xmloff::token::XML_BELOW );
1422cdf0e10cSrcweir 		break;
1423cdf0e10cSrcweir     // OD 2004-05-05 #i28701#
1424cdf0e10cSrcweir     case XML_TYPE_WRAP_INFLUENCE_ON_POSITION:
1425cdf0e10cSrcweir         pHdl = new XMLConstantsPropertyHandler( pXML_WrapInfluenceOnPosition_Enum,
1426cdf0e10cSrcweir                                                 XML_TOKEN_INVALID );
1427cdf0e10cSrcweir         break;
1428cdf0e10cSrcweir     case XML_TYPE_BORDER_MODEL:
1429cdf0e10cSrcweir         pHdl = new XMLNamedBoolPropertyHdl( xmloff::token::XML_COLLAPSING,
1430cdf0e10cSrcweir                                             xmloff::token::XML_SEPARATING );
1431cdf0e10cSrcweir         break;
1432cdf0e10cSrcweir 	case XML_TYPE_TEXT_LINE_MODE:
1433cdf0e10cSrcweir 		pHdl = new XMLNamedBoolPropertyHdl(
1434cdf0e10cSrcweir 									::xmloff::token::XML_SKIP_WHITE_SPACE,
1435cdf0e10cSrcweir                                     ::xmloff::token::XML_CONTINUOUS);
1436cdf0e10cSrcweir 		break;
1437cdf0e10cSrcweir 	case XML_TYPE_TEXT_KEEP:
1438cdf0e10cSrcweir 		pHdl = new XMLNamedBoolPropertyHdl(
1439cdf0e10cSrcweir 									::xmloff::token::XML_ALWAYS,
1440cdf0e10cSrcweir                                     ::xmloff::token::XML_AUTO);
1441cdf0e10cSrcweir 		break;
1442cdf0e10cSrcweir 	case XML_TYPE_TEXT_NKEEP:
1443cdf0e10cSrcweir 		pHdl = new XMLNamedBoolPropertyHdl(
1444cdf0e10cSrcweir 									::xmloff::token::XML_AUTO,
1445cdf0e10cSrcweir                                     ::xmloff::token::XML_ALWAYS);
1446cdf0e10cSrcweir 		break;
1447cdf0e10cSrcweir     case XML_TYPE_TEXT_NUMBER8_ONE_BASED:
1448cdf0e10cSrcweir         pHdl = new XMLNumber8OneBasedHdl();
1449cdf0e10cSrcweir         break;
145064b14621SArmin Le Grand 
145156b35d86SArmin Le Grand         //UUUU
145256b35d86SArmin Le Grand         case XML_SW_TYPE_FILLSTYLE:
145356b35d86SArmin Le Grand             pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap, ::getCppuType((const FillStyle*)0) );
145456b35d86SArmin Le Grand             break;
145556b35d86SArmin Le Grand         case XML_SW_TYPE_FILLBITMAPSIZE:
145656b35d86SArmin Le Grand             pHdl = new XMLFillBitmapSizePropertyHandler();
145756b35d86SArmin Le Grand             break;
145856b35d86SArmin Le Grand         case XML_SW_TYPE_LOGICAL_SIZE:
145956b35d86SArmin Le Grand             pHdl = new XMLBitmapLogicalSizePropertyHandler();
146056b35d86SArmin Le Grand             break;
146156b35d86SArmin Le Grand         case XML_SW_TYPE_BITMAP_REFPOINT:
146256b35d86SArmin Le Grand             pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap, getCppuType((const RectanglePoint*)0) );
146356b35d86SArmin Le Grand             break;
146456b35d86SArmin Le Grand         case XML_SW_TYPE_BITMAP_MODE:
146556b35d86SArmin Le Grand             pHdl = new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap, getCppuType((const BitmapMode*)0) );
146656b35d86SArmin Le Grand             break;
146756b35d86SArmin Le Grand         case XML_SW_TYPE_BITMAPREPOFFSETX:
146856b35d86SArmin Le Grand         case XML_SW_TYPE_BITMAPREPOFFSETY:
146956b35d86SArmin Le Grand             pHdl = new XMLBitmapRepeatOffsetPropertyHandler(XML_SW_TYPE_BITMAPREPOFFSETX == nType);
147056b35d86SArmin Le Grand             break;
147156b35d86SArmin Le Grand 
147256b35d86SArmin Le Grand         //UUUU
147356b35d86SArmin Le Grand         default:
147456b35d86SArmin Le Grand         {
147556b35d86SArmin Le Grand             OSL_ENSURE(false, "XMLPropertyHandler missing (!)");
147656b35d86SArmin Le Grand             break;
147756b35d86SArmin Le Grand         }
147864b14621SArmin Le Grand     }
1479cdf0e10cSrcweir 
1480cdf0e10cSrcweir 	return pHdl;
1481cdf0e10cSrcweir }
1482cdf0e10cSrcweir 
XMLTextPropertyHandlerFactory_Impl()1483cdf0e10cSrcweir XMLTextPropertyHandlerFactory_Impl::XMLTextPropertyHandlerFactory_Impl()
1484cdf0e10cSrcweir {
1485cdf0e10cSrcweir }
1486cdf0e10cSrcweir 
~XMLTextPropertyHandlerFactory_Impl()1487cdf0e10cSrcweir XMLTextPropertyHandlerFactory_Impl::~XMLTextPropertyHandlerFactory_Impl()
1488cdf0e10cSrcweir {
1489cdf0e10cSrcweir }
1490cdf0e10cSrcweir 
1491cdf0e10cSrcweir // ----------------------------------------------------------------------------
1492cdf0e10cSrcweir 
XMLTextPropertyHandlerFactory()1493cdf0e10cSrcweir XMLTextPropertyHandlerFactory::XMLTextPropertyHandlerFactory() :
1494cdf0e10cSrcweir 	XMLPropertyHandlerFactory(),
1495cdf0e10cSrcweir    pImpl( new XMLTextPropertyHandlerFactory_Impl )
1496cdf0e10cSrcweir {
1497cdf0e10cSrcweir }
1498cdf0e10cSrcweir 
~XMLTextPropertyHandlerFactory()1499cdf0e10cSrcweir XMLTextPropertyHandlerFactory::~XMLTextPropertyHandlerFactory()
1500cdf0e10cSrcweir {
1501cdf0e10cSrcweir 	delete pImpl;
1502cdf0e10cSrcweir }
1503cdf0e10cSrcweir 
GetPropertyHandler(sal_Int32 nType) const1504cdf0e10cSrcweir const XMLPropertyHandler *XMLTextPropertyHandlerFactory::GetPropertyHandler(
1505cdf0e10cSrcweir 		sal_Int32 nType ) const
1506cdf0e10cSrcweir {
1507cdf0e10cSrcweir 	const XMLPropertyHandler *pHdl =
1508cdf0e10cSrcweir 		XMLPropertyHandlerFactory::GetPropertyHandler( nType );
1509cdf0e10cSrcweir 
1510cdf0e10cSrcweir 	if( !pHdl )
1511cdf0e10cSrcweir 	{
1512cdf0e10cSrcweir 		const XMLPropertyHandler *pNewHdl = pImpl->GetPropertyHandler( nType );
1513cdf0e10cSrcweir 
1514cdf0e10cSrcweir 		if( pNewHdl )
1515cdf0e10cSrcweir 			PutHdlCache( nType, pNewHdl );
1516cdf0e10cSrcweir 
1517cdf0e10cSrcweir 		pHdl = pNewHdl;
1518cdf0e10cSrcweir 	}
1519cdf0e10cSrcweir 
1520cdf0e10cSrcweir 	return pHdl;
1521cdf0e10cSrcweir }
1522cdf0e10cSrcweir 
1523cdf0e10cSrcweir 
1524