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