1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: txtprhdl.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_xmloff.hxx"
33 #include <tools/debug.hxx>
34 #include <rtl/ustrbuf.hxx>
35 #include <vcl/vclenum.hxx>
36 #include <com/sun/star/uno/Any.hxx>
37 #include <com/sun/star/style/DropCapFormat.hpp>
38 #include <com/sun/star/text/FontRelief.hpp>
39 #include <com/sun/star/text/WrapTextMode.hpp>
40 #include <com/sun/star/text/XTextColumns.hpp>
41 #include <com/sun/star/text/TextColumn.hpp>
42 #include <com/sun/star/text/RelOrientation.hpp>
43 #include <com/sun/star/text/HoriOrientation.hpp>
44 #include <com/sun/star/text/VertOrientation.hpp>
45 #include <com/sun/star/text/RubyAdjust.hpp>
46 #include <com/sun/star/text/FontEmphasis.hpp>
47 #include <com/sun/star/text/ParagraphVertAlign.hpp>
48 #include <xmloff/xmltypes.hxx>
49 #include <xmloff/xmluconv.hxx>
50 #include <xmloff/xmltoken.hxx>
51 #include "XMLAnchorTypePropHdl.hxx"
52 #include <xmloff/XMLConstantsPropertyHandler.hxx>
53 #include "XMLClipPropertyHandler.hxx"
54 #ifndef _XMLOFF_XMLTEXTCOLUMNSPPROPERTYHANDLER_HXX
55 #include "XMLTextColumnsPropertyHandler.hxx"
57 #include <xmloff/NamedBoolPropertyHdl.hxx>
58 #ifndef _XMLOFF_TXTPRHDL_HXX
59 #include "txtprhdl.hxx"
61 // OD 2004-05-05 #i28701#
62 #include <com/sun/star/text/WrapInfluenceOnPosition.hpp>
65 using ::rtl::OUString
;
66 using ::rtl::OUStringBuffer
;
68 //using namespace ::com::sun::star;
69 using namespace ::com::sun::star::uno
;
70 using namespace ::com::sun::star::style
;
71 //using namespace ::com::sun::star::container;
72 //using namespace ::com::sun::star::beans;
73 using namespace ::com::sun::star::text
;
74 using namespace ::xmloff::token
;
77 #define CONSTASCII_USTRINGPARAM_CMP(s) s, sizeof(s)-1
79 // ---------------------------------------------------------------------------
81 SvXMLEnumMapEntry __READONLY_DATA pXML_HoriPos_Enum
[] =
83 { XML_FROM_LEFT
, HoriOrientation::NONE
},
84 { XML_FROM_INSIDE
, HoriOrientation::NONE
}, // import only
85 { XML_LEFT
, HoriOrientation::LEFT
},
86 { XML_INSIDE
, HoriOrientation::LEFT
}, // import only
87 { XML_CENTER
, HoriOrientation::CENTER
},
88 { XML_RIGHT
, HoriOrientation::RIGHT
},
89 { XML_OUTSIDE
, HoriOrientation::RIGHT
}, // import only
90 { XML_TOKEN_INVALID
, 0 }
93 SvXMLEnumMapEntry __READONLY_DATA pXML_HoriPosMirrored_Enum
[] =
95 { XML_FROM_INSIDE
, HoriOrientation::NONE
},
96 { XML_INSIDE
, HoriOrientation::LEFT
},
97 { XML_CENTER
, HoriOrientation::CENTER
},
98 { XML_OUTSIDE
, HoriOrientation::RIGHT
},
99 { XML_TOKEN_INVALID
, 0 }
102 SvXMLEnumMapEntry __READONLY_DATA pXML_HoriRel_Enum
[] =
104 { XML_PARAGRAPH
, RelOrientation::FRAME
},
105 { XML_PARAGRAPH_CONTENT
, RelOrientation::PRINT_AREA
},
106 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
107 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
108 { XML_PARAGRAPH_START_MARGIN
, RelOrientation::FRAME_LEFT
},
109 { XML_PARAGRAPH_END_MARGIN
, RelOrientation::FRAME_RIGHT
},
110 { XML_PAGE_START_MARGIN
, RelOrientation::PAGE_LEFT
},
111 { XML_PAGE_END_MARGIN
, RelOrientation::PAGE_RIGHT
},
112 { XML_CHAR
, RelOrientation::CHAR
},
113 { XML_FRAME
, RelOrientation::FRAME
}, // import only
114 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
}, // import only
115 { XML_FRAME_START_MARGIN
, RelOrientation::FRAME_LEFT
}, // import only
116 { XML_FRAME_END_MARGIN
, RelOrientation::FRAME_RIGHT
}, // import only
117 { XML_TOKEN_INVALID
, 0 }
120 SvXMLEnumMapEntry __READONLY_DATA pXML_HoriRelFrame_Enum
[] =
122 { XML_FRAME
, RelOrientation::FRAME
},
123 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
},
124 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
125 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
126 { XML_FRAME_START_MARGIN
, RelOrientation::FRAME_LEFT
},
127 { XML_FRAME_END_MARGIN
, RelOrientation::FRAME_RIGHT
},
128 { XML_PAGE_START_MARGIN
, RelOrientation::PAGE_LEFT
},
129 { XML_PAGE_END_MARGIN
, RelOrientation::PAGE_RIGHT
},
130 { XML_CHAR
, RelOrientation::CHAR
},
131 { XML_TOKEN_INVALID
, 0 }
134 SvXMLEnumMapEntry __READONLY_DATA pXML_HoriMirror_Enum
[] =
136 { XML_FROM_LEFT
, sal_False
},
137 { XML_FROM_INSIDE
, sal_True
},
138 { XML_LEFT
, sal_False
},
139 { XML_INSIDE
, sal_True
},
140 { XML_CENTER
, sal_False
},
141 { XML_RIGHT
, sal_False
},
142 { XML_OUTSIDE
, sal_True
},
143 { XML_TOKEN_INVALID
, 0 }
146 SvXMLEnumMapEntry __READONLY_DATA pXML_VertPos_Enum
[] =
148 { XML_FROM_TOP
, VertOrientation::NONE
},
149 { XML_TOP
, VertOrientation::TOP
},
150 { XML_TOP
, VertOrientation::CHAR_TOP
}, // export only
151 { XML_TOP
, VertOrientation::LINE_TOP
}, // export only
152 { XML_MIDDLE
, VertOrientation::CENTER
},
153 { XML_MIDDLE
, VertOrientation::CHAR_CENTER
}, // export only
154 { XML_MIDDLE
, VertOrientation::LINE_CENTER
}, // export only
155 { XML_BOTTOM
, VertOrientation::BOTTOM
},
156 { XML_BOTTOM
, VertOrientation::CHAR_BOTTOM
}, // export only
157 { XML_BOTTOM
, VertOrientation::LINE_BOTTOM
}, // export only
158 { XML_BELOW
, VertOrientation::CHAR_BOTTOM
}, // import only
159 { XML_TOKEN_INVALID
, 0 }
162 SvXMLEnumMapEntry __READONLY_DATA pXML_VertPosAtChar_Enum
[] =
164 { XML_FROM_TOP
, VertOrientation::NONE
},
165 { XML_TOP
, VertOrientation::TOP
},
166 { XML_TOP
, VertOrientation::CHAR_TOP
}, // export only
167 { XML_TOP
, VertOrientation::LINE_TOP
}, // export only
168 { XML_MIDDLE
, VertOrientation::CENTER
},
169 { XML_MIDDLE
, VertOrientation::CHAR_CENTER
}, // export only
170 { XML_MIDDLE
, VertOrientation::LINE_CENTER
}, // export only
171 { XML_BOTTOM
, VertOrientation::BOTTOM
},
172 { XML_BELOW
, VertOrientation::CHAR_BOTTOM
}, // export only
173 { XML_BOTTOM
, VertOrientation::LINE_BOTTOM
}, // export only
174 { XML_TOKEN_INVALID
, 0 }
177 SvXMLEnumMapEntry __READONLY_DATA pXML_VertRel_Enum
[] =
179 { XML_PARAGRAPH
, RelOrientation::FRAME
},
180 { XML_PARAGRAPH_CONTENT
, RelOrientation::PRINT_AREA
},
181 { XML_CHAR
, RelOrientation::CHAR
},
182 // DVO, OD 17.09.2003 #i18732# - allow vertical alignment at page
183 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
184 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
185 { XML_FRAME
, RelOrientation::FRAME
}, // import only
186 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
}, // import only
187 // OD 13.11.2003 #i22341# - new vertical alignment at top of line
188 { XML_LINE
, RelOrientation::TEXT_LINE
},
189 { XML_TOKEN_INVALID
, 0 }
192 SvXMLEnumMapEntry __READONLY_DATA pXML_VertRelPage_Enum
[] =
194 { XML_PAGE
, RelOrientation::FRAME
},
195 { XML_PAGE_CONTENT
, RelOrientation::PRINT_AREA
},
196 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
197 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
198 { XML_TOKEN_INVALID
, 0 }
201 SvXMLEnumMapEntry __READONLY_DATA pXML_VertRelFrame_Enum
[] =
203 { XML_FRAME
, RelOrientation::FRAME
},
204 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
},
205 { XML_TOKEN_INVALID
, 0 }
208 SvXMLEnumMapEntry __READONLY_DATA pXML_VertRelAsChar_Enum
[] =
210 { XML_BASELINE
, VertOrientation::TOP
},
211 { XML_BASELINE
, VertOrientation::CENTER
}, // export only
212 { XML_BASELINE
, VertOrientation::BOTTOM
}, // export only
213 { XML_TEXT
, VertOrientation::CHAR_TOP
},
214 { XML_TEXT
, VertOrientation::CHAR_CENTER
}, // export only
215 { XML_TEXT
, VertOrientation::CHAR_BOTTOM
}, // export only
216 { XML_LINE
, VertOrientation::LINE_TOP
},
217 { XML_LINE
, VertOrientation::LINE_CENTER
}, // export only
218 { XML_LINE
, VertOrientation::LINE_BOTTOM
}, // export only
219 { XML_TOKEN_INVALID
, 0 }
222 SvXMLEnumMapEntry __READONLY_DATA pXML_RubyAdjust_Enum
[] =
224 { XML_LEFT
, RubyAdjust_LEFT
},
225 { XML_CENTER
, RubyAdjust_CENTER
},
226 { XML_RIGHT
, RubyAdjust_RIGHT
},
227 { XML_DISTRIBUTE_LETTER
, RubyAdjust_BLOCK
},
228 { XML_DISTRIBUTE_SPACE
, RubyAdjust_INDENT_BLOCK
},
229 { XML_TOKEN_INVALID
, 0 }
232 SvXMLEnumMapEntry __READONLY_DATA pXML_FontRelief_Enum
[] =
234 { XML_NONE
, FontRelief::NONE
},
235 { XML_ENGRAVED
, FontRelief::ENGRAVED
},
236 { XML_EMBOSSED
, FontRelief::EMBOSSED
},
237 { XML_TOKEN_INVALID
, 0 }
240 SvXMLEnumMapEntry __READONLY_DATA pXML_VerticalAlign_Enum
[] =
242 { XML_TOP
, ParagraphVertAlign::TOP
},
243 { XML_MIDDLE
, ParagraphVertAlign::CENTER
},
244 { XML_BOTTOM
, ParagraphVertAlign::BOTTOM
},
245 { XML_BASELINE
, ParagraphVertAlign::BASELINE
},
246 { XML_AUTO
, ParagraphVertAlign::AUTOMATIC
},
247 { XML_TOKEN_INVALID
, 0 }
250 // OD 2004-05-05 #i28701#
251 SvXMLEnumMapEntry __READONLY_DATA pXML_WrapInfluenceOnPosition_Enum
[] =
253 // --> OD 2004-10-18 #i35017# - tokens have been renamed and
254 // <XML_ITERATIVE> has been added
255 { XML_ONCE_SUCCESSIVE
, WrapInfluenceOnPosition::ONCE_SUCCESSIVE
},
256 { XML_ONCE_CONCURRENT
, WrapInfluenceOnPosition::ONCE_CONCURRENT
},
257 { XML_ITERATIVE
, WrapInfluenceOnPosition::ITERATIVE
},
259 { XML_TOKEN_INVALID
, 0 }
262 // ---------------------------------------------------------------------------
264 class XMLDropCapPropHdl_Impl
: public XMLPropertyHandler
267 virtual ~XMLDropCapPropHdl_Impl ();
270 const ::com::sun::star::uno::Any
& r1
,
271 const ::com::sun::star::uno::Any
& r2
) const;
273 /// TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place.
274 virtual sal_Bool
importXML(
275 const ::rtl::OUString
& rStrImpValue
,
276 ::com::sun::star::uno::Any
& rValue
,
277 const SvXMLUnitConverter
& ) const;
278 virtual sal_Bool
exportXML(
279 ::rtl::OUString
& rStrExpValue
,
280 const ::com::sun::star::uno::Any
& rValue
,
281 const SvXMLUnitConverter
& ) const;
284 XMLDropCapPropHdl_Impl::~XMLDropCapPropHdl_Impl ()
288 bool XMLDropCapPropHdl_Impl::equals(
290 const Any
& r2
) const
292 DropCapFormat aFormat1
, aFormat2
;
296 return (aFormat1
.Lines
<=1 && aFormat2
.Lines
<=1) ||
297 (aFormat1
.Lines
== aFormat2
.Lines
&&
298 aFormat1
.Count
== aFormat2
.Count
&&
299 aFormat1
.Distance
== aFormat2
.Distance
);
302 sal_Bool
XMLDropCapPropHdl_Impl::importXML(
305 const SvXMLUnitConverter
& ) const
307 DBG_ASSERT( !this, "drop caps are an element import property" );
311 sal_Bool
XMLDropCapPropHdl_Impl::exportXML(
314 const SvXMLUnitConverter
& ) const
316 DBG_ASSERT( !this, "drop caps are an element export property" );
320 // ---------------------------------------------------------------------------
322 class XMLOpaquePropHdl_Impl
: public XMLPropertyHandler
325 virtual ~XMLOpaquePropHdl_Impl ();
327 virtual sal_Bool
importXML(
328 const ::rtl::OUString
& rStrImpValue
,
329 ::com::sun::star::uno::Any
& rValue
,
330 const SvXMLUnitConverter
& ) const;
331 virtual sal_Bool
exportXML(
332 ::rtl::OUString
& rStrExpValue
,
333 const ::com::sun::star::uno::Any
& rValue
,
334 const SvXMLUnitConverter
& ) const;
337 sal_Bool
XMLOpaquePropHdl_Impl::importXML(
338 const OUString
& rStrImpValue
,
340 const SvXMLUnitConverter
& ) const
342 sal_Bool bRet
= sal_True
;
343 sal_Bool bVal
= sal_False
;
344 if( IsXMLToken( rStrImpValue
, XML_FOREGROUND
) )
346 else if( !IsXMLToken( rStrImpValue
, XML_BACKGROUND
) )
350 rValue
.setValue( &bVal
, ::getBooleanCppuType() );
355 sal_Bool
XMLOpaquePropHdl_Impl::exportXML(
356 OUString
& rStrExpValue
,
358 const SvXMLUnitConverter
& ) const
360 if( *(sal_Bool
*)rValue
.getValue() )
361 rStrExpValue
= GetXMLToken( XML_FOREGROUND
);
363 rStrExpValue
= GetXMLToken( XML_BACKGROUND
);
368 XMLOpaquePropHdl_Impl::~XMLOpaquePropHdl_Impl ()
372 // ---------------------------------------------------------------------------
374 class XMLContourModePropHdl_Impl
: public XMLPropertyHandler
377 virtual ~XMLContourModePropHdl_Impl ();
379 virtual sal_Bool
importXML(
380 const ::rtl::OUString
& rStrImpValue
,
381 ::com::sun::star::uno::Any
& rValue
,
382 const SvXMLUnitConverter
& ) const;
383 virtual sal_Bool
exportXML(
384 ::rtl::OUString
& rStrExpValue
,
385 const ::com::sun::star::uno::Any
& rValue
,
386 const SvXMLUnitConverter
& ) const;
389 sal_Bool
XMLContourModePropHdl_Impl::importXML(
390 const OUString
& rStrImpValue
,
392 const SvXMLUnitConverter
& ) const
394 sal_Bool bRet
= sal_True
;
395 sal_Bool bVal
= sal_False
;
396 if( IsXMLToken( rStrImpValue
, XML_OUTSIDE
) )
398 else if( ! IsXMLToken( rStrImpValue
, XML_FULL
) )
402 rValue
.setValue( &bVal
, ::getBooleanCppuType() );
407 sal_Bool
XMLContourModePropHdl_Impl::exportXML(
408 OUString
& rStrExpValue
,
410 const SvXMLUnitConverter
& ) const
412 if( *(sal_Bool
*)rValue
.getValue() )
413 rStrExpValue
= GetXMLToken( XML_OUTSIDE
);
415 rStrExpValue
= GetXMLToken( XML_FULL
);
420 XMLContourModePropHdl_Impl::~XMLContourModePropHdl_Impl()
424 // ---------------------------------------------------------------------------
426 class XMLParagraphOnlyPropHdl_Impl
: public XMLPropertyHandler
429 virtual ~XMLParagraphOnlyPropHdl_Impl ();
431 virtual sal_Bool
importXML(
432 const ::rtl::OUString
& rStrImpValue
,
433 ::com::sun::star::uno::Any
& rValue
,
434 const SvXMLUnitConverter
& ) const;
435 virtual sal_Bool
exportXML(
436 ::rtl::OUString
& rStrExpValue
,
437 const ::com::sun::star::uno::Any
& rValue
,
438 const SvXMLUnitConverter
& ) const;
441 sal_Bool
XMLParagraphOnlyPropHdl_Impl::importXML(
442 const OUString
& rStrImpValue
,
444 const SvXMLUnitConverter
& ) const
446 sal_Bool bRet
= sal_True
;
447 sal_Bool bVal
= sal_False
;
449 if( ! IsXMLToken( rStrImpValue
, XML_NO_LIMIT
) )
451 sal_Int32 nValue
= 0;
452 bRet
= SvXMLUnitConverter::convertNumber( nValue
, rStrImpValue
);
457 rValue
.setValue( &bVal
, ::getBooleanCppuType() );
462 sal_Bool
XMLParagraphOnlyPropHdl_Impl::exportXML(
463 OUString
& rStrExpValue
,
465 const SvXMLUnitConverter
& ) const
467 if( *(sal_Bool
*)rValue
.getValue() )
468 rStrExpValue
= GetXMLToken( XML_1
);
470 rStrExpValue
= GetXMLToken( XML_NO_LIMIT
);
475 XMLParagraphOnlyPropHdl_Impl::~XMLParagraphOnlyPropHdl_Impl()
479 // ---------------------------------------------------------------------------
481 SvXMLEnumMapEntry __READONLY_DATA pXML_Wrap_Enum
[] =
483 { XML_NONE
, WrapTextMode_NONE
},
484 { XML_RUN_THROUGH
, WrapTextMode_THROUGHT
},
485 { XML_PARALLEL
, WrapTextMode_PARALLEL
},
486 { XML_DYNAMIC
, WrapTextMode_DYNAMIC
},
487 { XML_LEFT
, WrapTextMode_LEFT
},
488 { XML_RIGHT
, WrapTextMode_RIGHT
},
489 { XML_TOKEN_INVALID
, 0 }
492 class XMLWrapPropHdl_Impl
: public XMLPropertyHandler
495 virtual ~XMLWrapPropHdl_Impl ();
497 virtual sal_Bool
importXML(
498 const ::rtl::OUString
& rStrImpValue
,
499 ::com::sun::star::uno::Any
& rValue
,
500 const SvXMLUnitConverter
& ) const;
501 virtual sal_Bool
exportXML(
502 ::rtl::OUString
& rStrExpValue
,
503 const ::com::sun::star::uno::Any
& rValue
,
504 const SvXMLUnitConverter
& ) const;
507 sal_Bool
XMLWrapPropHdl_Impl::importXML(
508 const OUString
& rStrImpValue
,
510 const SvXMLUnitConverter
& ) const
513 sal_Bool bRet
= SvXMLUnitConverter::convertEnum( nWrap
, rStrImpValue
,
517 rValue
<<= (WrapTextMode
)nWrap
;
522 sal_Bool
XMLWrapPropHdl_Impl::exportXML(
523 OUString
& rStrExpValue
,
525 const SvXMLUnitConverter
& ) const
532 sal_Bool bRet
= SvXMLUnitConverter::convertEnum( aOut
, eVal
, pXML_Wrap_Enum
, XML_NONE
);
534 rStrExpValue
= aOut
.makeStringAndClear();
539 XMLWrapPropHdl_Impl::~XMLWrapPropHdl_Impl ()
543 // ---------------------------------------------------------------------------
545 class XMLFrameProtectPropHdl_Impl
: public XMLPropertyHandler
549 XMLFrameProtectPropHdl_Impl( enum XMLTokenEnum eVal
) :
550 sVal( GetXMLToken(eVal
) ) {}
551 virtual ~XMLFrameProtectPropHdl_Impl ();
553 virtual sal_Bool
importXML(
554 const ::rtl::OUString
& rStrImpValue
,
555 ::com::sun::star::uno::Any
& rValue
,
556 const SvXMLUnitConverter
& ) const;
557 virtual sal_Bool
exportXML(
558 ::rtl::OUString
& rStrExpValue
,
559 const ::com::sun::star::uno::Any
& rValue
,
560 const SvXMLUnitConverter
& ) const;
563 sal_Bool
XMLFrameProtectPropHdl_Impl::importXML(
564 const OUString
& rStrImpValue
,
566 const SvXMLUnitConverter
& ) const
568 sal_Bool bRet
= sal_True
;
569 sal_Bool bVal
= sal_False
;
570 if( ! IsXMLToken( rStrImpValue
, XML_NONE
) )
573 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
575 while( aTokenEnum
.getNextToken( aToken
) )
587 rValue
.setValue( &bVal
, ::getBooleanCppuType() );
592 sal_Bool
XMLFrameProtectPropHdl_Impl::exportXML(
593 OUString
& rStrExpValue
,
595 const SvXMLUnitConverter
& ) const
597 if( *(sal_Bool
*)rValue
.getValue() )
599 if( !rStrExpValue
.getLength() ||
600 IsXMLToken( rStrExpValue
, XML_NONE
) )
606 OUStringBuffer
aOut( rStrExpValue
.getLength() + 1 +
608 aOut
.append( rStrExpValue
);
609 aOut
.append( (sal_Unicode
)' ' );
611 rStrExpValue
= aOut
.makeStringAndClear();
614 else if( !rStrExpValue
.getLength() )
616 rStrExpValue
= GetXMLToken( XML_NONE
);
622 XMLFrameProtectPropHdl_Impl::~XMLFrameProtectPropHdl_Impl()
626 // ---------------------------------------------------------------------------
628 SvXMLEnumMapEntry __READONLY_DATA pXML_Anchor_Enum
[] =
630 { XML_CHAR
, TextContentAnchorType_AT_CHARACTER
},
631 { XML_PAGE
, TextContentAnchorType_AT_PAGE
},
632 { XML_FRAME
, TextContentAnchorType_AT_FRAME
},
633 { XML_PARAGRAPH
, TextContentAnchorType_AT_PARAGRAPH
},
634 { XML_AS_CHAR
, TextContentAnchorType_AS_CHARACTER
},
635 { XML_TOKEN_INVALID
, 0 }
639 sal_Bool
XMLAnchorTypePropHdl::importXML(
640 const OUString
& rStrImpValue
,
642 const SvXMLUnitConverter
& ) const
645 sal_Bool bRet
= SvXMLUnitConverter::convertEnum( nAnchor
, rStrImpValue
,
649 rValue
<<= (TextContentAnchorType
)nAnchor
;
654 sal_Bool
XMLAnchorTypePropHdl::exportXML(
655 OUString
& rStrExpValue
,
657 const SvXMLUnitConverter
& ) const
660 TextContentAnchorType eVal
;
664 sal_Bool bRet
= SvXMLUnitConverter::convertEnum( aOut
, eVal
, pXML_Anchor_Enum
, XML_PARAGRAPH
);
666 rStrExpValue
= aOut
.makeStringAndClear();
671 XMLAnchorTypePropHdl::~XMLAnchorTypePropHdl()
675 sal_Bool
XMLAnchorTypePropHdl::convert( const OUString
& rStrImpValue
,
676 TextContentAnchorType
& rType
)
679 sal_Bool bRet
= SvXMLUnitConverter::convertEnum( nAnchor
, rStrImpValue
,
682 rType
= (TextContentAnchorType
)nAnchor
;
686 // ---------------------------------------------------------------------------
689 XMLTextColumnsPropertyHandler::~XMLTextColumnsPropertyHandler ()
693 bool XMLTextColumnsPropertyHandler::equals(
695 const Any
& r2
) const
697 Reference
< XTextColumns
> xColumns1
;
700 Reference
< XTextColumns
> xColumns2
;
703 if( xColumns1
->getColumnCount() != xColumns2
->getColumnCount() ||
704 xColumns1
->getReferenceValue() != xColumns2
->getReferenceValue() )
707 Sequence
< TextColumn
> aColumns1
= xColumns1
->getColumns();
708 Sequence
< TextColumn
> aColumns2
= xColumns2
->getColumns();
709 sal_Int32 nCount
= aColumns1
.getLength();
710 if( aColumns2
.getLength() != nCount
)
713 const TextColumn
*pColumns1
= aColumns1
.getArray();
714 const TextColumn
*pColumns2
= aColumns2
.getArray();
718 if( pColumns1
->Width
!= pColumns2
->Width
||
719 pColumns1
->LeftMargin
!= pColumns2
->LeftMargin
||
720 pColumns1
->RightMargin
!= pColumns2
->RightMargin
)
730 sal_Bool
XMLTextColumnsPropertyHandler::importXML(
733 const SvXMLUnitConverter
& ) const
735 DBG_ASSERT( !this, "columns are an element import property" );
739 sal_Bool
XMLTextColumnsPropertyHandler::exportXML(
742 const SvXMLUnitConverter
& ) const
744 DBG_ASSERT( !this, "columns are an element export property" );
748 // ---------------------------------------------------------------------------
750 class XMLHoriMirrorPropHdl_Impl
: public XMLPropertyHandler
753 virtual ~XMLHoriMirrorPropHdl_Impl ();
755 virtual sal_Bool
importXML(
756 const ::rtl::OUString
& rStrImpValue
,
757 ::com::sun::star::uno::Any
& rValue
,
758 const SvXMLUnitConverter
& ) const;
759 virtual sal_Bool
exportXML(
760 ::rtl::OUString
& rStrExpValue
,
761 const ::com::sun::star::uno::Any
& rValue
,
762 const SvXMLUnitConverter
& ) const;
765 sal_Bool
XMLHoriMirrorPropHdl_Impl::importXML(
766 const OUString
& rStrImpValue
,
768 const SvXMLUnitConverter
& ) const
770 sal_uInt16 nHoriMirror
;
771 sal_Bool bRet
= SvXMLUnitConverter::convertEnum( nHoriMirror
, rStrImpValue
,
772 pXML_HoriMirror_Enum
);
776 sal_Bool bTmp
= nHoriMirror
!= 0;
777 rValue
.setValue( &bTmp
, ::getBooleanCppuType() );
783 sal_Bool
XMLHoriMirrorPropHdl_Impl::exportXML(
786 const SvXMLUnitConverter
& ) const
788 DBG_ASSERT( !this, "HorMirror properyt shouldn't be exported" );
793 XMLHoriMirrorPropHdl_Impl::~XMLHoriMirrorPropHdl_Impl ()
797 // ---------------------------------------------------------------------------
799 class XMLGrfMirrorPropHdl_Impl
: public XMLPropertyHandler
805 XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal
, sal_Bool bH
) :
806 sVal( GetXMLToken( eVal
) ),
808 virtual ~XMLGrfMirrorPropHdl_Impl ();
810 virtual sal_Bool
importXML(
811 const ::rtl::OUString
& rStrImpValue
,
812 ::com::sun::star::uno::Any
& rValue
,
813 const SvXMLUnitConverter
& ) const;
814 virtual sal_Bool
exportXML(
815 ::rtl::OUString
& rStrExpValue
,
816 const ::com::sun::star::uno::Any
& rValue
,
817 const SvXMLUnitConverter
& ) const;
820 sal_Bool
XMLGrfMirrorPropHdl_Impl::importXML(
821 const OUString
& rStrImpValue
,
823 const SvXMLUnitConverter
& ) const
825 sal_Bool bRet
= sal_True
;
826 sal_Bool bVal
= sal_False
;
827 if( ! IsXMLToken( rStrImpValue
, XML_NONE
) )
830 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
832 while( aTokenEnum
.getNextToken( aToken
) )
835 if( aToken
== sVal
||
836 (bHori
&& IsXMLToken( aToken
, XML_HORIZONTAL
) ) )
845 rValue
.setValue( &bVal
, ::getBooleanCppuType() );
850 sal_Bool
XMLGrfMirrorPropHdl_Impl::exportXML(
851 OUString
& rStrExpValue
,
853 const SvXMLUnitConverter
& ) const
855 if( *(sal_Bool
*)rValue
.getValue() )
857 if( !rStrExpValue
.getLength() ||
858 IsXMLToken( rStrExpValue
, XML_NONE
) )
863 // --> OD 2005-05-12 #i49139#
864 // XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES
865 // are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD.
866 ( IsXMLToken( rStrExpValue
, XML_HORIZONTAL_ON_EVEN
) ||
867 IsXMLToken( rStrExpValue
, XML_HORIZONTAL_ON_ODD
) ))
870 rStrExpValue
= GetXMLToken( XML_HORIZONTAL
);
874 OUStringBuffer
aOut( rStrExpValue
.getLength() + 1 +
876 aOut
.append( rStrExpValue
);
877 aOut
.append( (sal_Unicode
)' ' );
879 rStrExpValue
= aOut
.makeStringAndClear();
882 else if( !rStrExpValue
.getLength() )
884 rStrExpValue
= GetXMLToken( XML_NONE
);
890 XMLGrfMirrorPropHdl_Impl::~XMLGrfMirrorPropHdl_Impl()
894 // ---------------------------------------------------------------------------
896 SvXMLEnumMapEntry __READONLY_DATA pXML_Emphasize_Enum
[] =
898 { XML_NONE
, FontEmphasis::NONE
},
899 { XML_DOT
, FontEmphasis::DOT_ABOVE
},
900 { XML_CIRCLE
, FontEmphasis::CIRCLE_ABOVE
},
901 { XML_DISC
, FontEmphasis::DISK_ABOVE
},
902 { XML_ACCENT
, FontEmphasis::ACCENT_ABOVE
},
903 { XML_TOKEN_INVALID
, 0 }
905 class XMLTextEmphasizePropHdl_Impl
: public XMLPropertyHandler
908 XMLTextEmphasizePropHdl_Impl() {}
909 virtual ~XMLTextEmphasizePropHdl_Impl();
911 virtual sal_Bool
importXML(
912 const ::rtl::OUString
& rStrImpValue
,
913 ::com::sun::star::uno::Any
& rValue
,
914 const SvXMLUnitConverter
& ) const;
915 virtual sal_Bool
exportXML(
916 ::rtl::OUString
& rStrExpValue
,
917 const ::com::sun::star::uno::Any
& rValue
,
918 const SvXMLUnitConverter
& ) const;
921 sal_Bool
XMLTextEmphasizePropHdl_Impl::importXML(
922 const OUString
& rStrImpValue
,
924 const SvXMLUnitConverter
& ) const
926 sal_Bool bRet
= sal_True
;
927 sal_uInt16 nVal
= FontEmphasis::NONE
;
928 sal_Bool bBelow
= sal_False
;
929 sal_Bool bHasPos
= sal_False
, bHasType
= sal_False
;
932 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
933 while( aTokenEnum
.getNextToken( aToken
) )
935 if( !bHasPos
&& IsXMLToken( aToken
, XML_ABOVE
) )
940 else if( !bHasPos
&& IsXMLToken( aToken
, XML_BELOW
) )
945 else if( !bHasType
&&
946 SvXMLUnitConverter::convertEnum( nVal
, aToken
,
947 pXML_Emphasize_Enum
))
960 if( FontEmphasis::NONE
!= nVal
&& bBelow
)
962 rValue
<<= (sal_Int16
)nVal
;
968 sal_Bool
XMLTextEmphasizePropHdl_Impl::exportXML(
969 OUString
& rStrExpValue
,
971 const SvXMLUnitConverter
& ) const
973 OUStringBuffer
aOut( 15 );
974 sal_Bool bRet
= sal_True
;
975 sal_Int16 nType
= sal_Int16();
976 if( rValue
>>= nType
)
978 sal_Bool bBelow
= sal_False
;
984 bRet
= SvXMLUnitConverter::convertEnum( aOut
, nType
,
991 enum XMLTokenEnum ePos
= bBelow
? XML_BELOW
: XML_ABOVE
;
992 aOut
.append( (sal_Unicode
)' ' );
993 aOut
.append( GetXMLToken(ePos
) );
995 rStrExpValue
= aOut
.makeStringAndClear();
1002 XMLTextEmphasizePropHdl_Impl::~XMLTextEmphasizePropHdl_Impl()
1007 // ---------------------------------------------------------------------------
1009 class XMLTextCombineCharPropHdl_Impl
: public XMLPropertyHandler
1012 XMLTextCombineCharPropHdl_Impl() {}
1013 virtual ~XMLTextCombineCharPropHdl_Impl();
1015 virtual sal_Bool
importXML(
1016 const ::rtl::OUString
& rStrImpValue
,
1017 ::com::sun::star::uno::Any
& rValue
,
1018 const SvXMLUnitConverter
& ) const;
1019 virtual sal_Bool
exportXML(
1020 ::rtl::OUString
& rStrExpValue
,
1021 const ::com::sun::star::uno::Any
& rValue
,
1022 const SvXMLUnitConverter
& ) const;
1025 sal_Bool
XMLTextCombineCharPropHdl_Impl::importXML(
1026 const OUString
& rStrImpValue
,
1028 const SvXMLUnitConverter
& ) const
1030 if( rStrImpValue
.getLength() )
1031 rValue
<<= rStrImpValue
.copy( 0, 1 );
1033 rValue
<<= rStrImpValue
;
1038 sal_Bool
XMLTextCombineCharPropHdl_Impl::exportXML(
1039 OUString
& rStrExpValue
,
1041 const SvXMLUnitConverter
& ) const
1043 rValue
>>= rStrExpValue
;
1048 XMLTextCombineCharPropHdl_Impl::~XMLTextCombineCharPropHdl_Impl()
1052 // ---------------------------------------------------------------------------
1054 class XMLTextRelWidthHeightPropHdl_Impl
: public XMLPropertyHandler
1057 XMLTextRelWidthHeightPropHdl_Impl() {}
1058 virtual ~XMLTextRelWidthHeightPropHdl_Impl();
1060 virtual sal_Bool
importXML(
1061 const ::rtl::OUString
& rStrImpValue
,
1062 ::com::sun::star::uno::Any
& rValue
,
1063 const SvXMLUnitConverter
& ) const;
1064 virtual sal_Bool
exportXML(
1065 ::rtl::OUString
& rStrExpValue
,
1066 const ::com::sun::star::uno::Any
& rValue
,
1067 const SvXMLUnitConverter
& ) const;
1070 sal_Bool
XMLTextRelWidthHeightPropHdl_Impl::importXML(
1071 const OUString
& rStrImpValue
,
1073 const SvXMLUnitConverter
& ) const
1077 bRet
= SvXMLUnitConverter::convertPercent( nValue
, rStrImpValue
);
1079 rValue
<<= (sal_Int16
)nValue
;
1084 sal_Bool
XMLTextRelWidthHeightPropHdl_Impl::exportXML(
1085 OUString
& rStrExpValue
,
1087 const SvXMLUnitConverter
& ) const
1089 sal_Bool bRet
= sal_False
;
1090 sal_Int16 nValue
= sal_Int16();
1091 if( (rValue
>>= nValue
) && nValue
> 0 )
1093 OUStringBuffer aOut
;
1094 SvXMLUnitConverter::convertPercent( aOut
, nValue
);
1095 rStrExpValue
= aOut
.makeStringAndClear();
1103 XMLTextRelWidthHeightPropHdl_Impl::~XMLTextRelWidthHeightPropHdl_Impl()
1107 // ---------------------------------------------------------------------------
1109 class XMLTextSyncWidthHeightPropHdl_Impl
: public XMLPropertyHandler
1111 const OUString sValue
;
1114 XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue
) :
1115 sValue( GetXMLToken(eValue
) ) {}
1116 virtual ~XMLTextSyncWidthHeightPropHdl_Impl();
1118 virtual sal_Bool
importXML(
1119 const ::rtl::OUString
& rStrImpValue
,
1120 ::com::sun::star::uno::Any
& rValue
,
1121 const SvXMLUnitConverter
& ) const;
1122 virtual sal_Bool
exportXML(
1123 ::rtl::OUString
& rStrExpValue
,
1124 const ::com::sun::star::uno::Any
& rValue
,
1125 const SvXMLUnitConverter
& ) const;
1128 sal_Bool
XMLTextSyncWidthHeightPropHdl_Impl::importXML(
1129 const OUString
& rStrImpValue
,
1131 const SvXMLUnitConverter
& ) const
1133 sal_Bool bValue
= (rStrImpValue
== sValue
);
1134 rValue
.setValue( &bValue
, ::getBooleanCppuType() );
1139 sal_Bool
XMLTextSyncWidthHeightPropHdl_Impl::exportXML(
1140 OUString
& rStrExpValue
,
1142 const SvXMLUnitConverter
& ) const
1144 sal_Bool bRet
= sal_False
;
1145 if( *(sal_Bool
*)rValue
.getValue() )
1147 rStrExpValue
= sValue
;
1154 XMLTextSyncWidthHeightPropHdl_Impl::~XMLTextSyncWidthHeightPropHdl_Impl()
1158 // ---------------------------------------------------------------------------
1160 class XMLTextRotationAnglePropHdl_Impl
: public XMLPropertyHandler
1164 XMLTextRotationAnglePropHdl_Impl() {}
1165 virtual ~XMLTextRotationAnglePropHdl_Impl();
1167 virtual sal_Bool
importXML(
1168 const ::rtl::OUString
& rStrImpValue
,
1169 ::com::sun::star::uno::Any
& rValue
,
1170 const SvXMLUnitConverter
& ) const;
1171 virtual sal_Bool
exportXML(
1172 ::rtl::OUString
& rStrExpValue
,
1173 const ::com::sun::star::uno::Any
& rValue
,
1174 const SvXMLUnitConverter
& ) const;
1177 sal_Bool
XMLTextRotationAnglePropHdl_Impl::importXML(
1178 const OUString
& rStrImpValue
,
1180 const SvXMLUnitConverter
& ) const
1183 sal_Bool bRet
= SvXMLUnitConverter::convertNumber( nValue
, rStrImpValue
);
1186 nValue
= (nValue
% 360 );
1188 nValue
= 360 + nValue
;
1190 if( nValue
< 45 || nValue
> 315 )
1192 else if( nValue
< 180 )
1194 else /* if nValalue <= 315 ) */
1202 sal_Bool
XMLTextRotationAnglePropHdl_Impl::exportXML(
1203 OUString
& rStrExpValue
,
1205 const SvXMLUnitConverter
& ) const
1207 sal_Int16 nAngle
= sal_Int16();
1208 sal_Bool bRet
= ( rValue
>>= nAngle
);
1211 OUStringBuffer aOut
;
1212 SvXMLUnitConverter::convertNumber( aOut
, nAngle
/ 10 );
1213 rStrExpValue
= aOut
.makeStringAndClear();
1215 OSL_ENSURE( bRet
, "illegal rotation angle" );
1220 XMLTextRotationAnglePropHdl_Impl::~XMLTextRotationAnglePropHdl_Impl()
1223 // ---------------------------------------------------------------------------
1224 class XMLNumber8OneBasedHdl
: public XMLPropertyHandler
1228 XMLNumber8OneBasedHdl() {}
1229 virtual ~XMLNumber8OneBasedHdl() {};
1231 virtual sal_Bool
importXML(
1232 const ::rtl::OUString
& rStrImpValue
,
1233 ::com::sun::star::uno::Any
& rValue
,
1234 const SvXMLUnitConverter
& ) const;
1235 virtual sal_Bool
exportXML(
1236 ::rtl::OUString
& rStrExpValue
,
1237 const ::com::sun::star::uno::Any
& rValue
,
1238 const SvXMLUnitConverter
& ) const;
1241 sal_Bool
XMLNumber8OneBasedHdl::importXML(
1242 const OUString
& rStrImpValue
,
1244 const SvXMLUnitConverter
& ) const
1246 sal_Int32 nValue
= 0;
1247 sal_Bool bRet
= SvXMLUnitConverter::convertNumber( nValue
, rStrImpValue
);
1249 rValue
<<= static_cast<sal_Int8
>( nValue
- 1 );
1253 sal_Bool
XMLNumber8OneBasedHdl::exportXML(
1254 OUString
& rStrExpValue
,
1256 const SvXMLUnitConverter
& ) const
1258 sal_Int8 nValue
= sal_Int8();
1259 sal_Bool bRet
= ( rValue
>>= nValue
);
1262 OUStringBuffer aOut
;
1263 SvXMLUnitConverter::convertNumber( aOut
, nValue
+ 1 );
1264 rStrExpValue
= aOut
.makeStringAndClear();
1268 // ---------------------------------------------------------------------------
1269 class XMLTextPropertyHandlerFactory_Impl
1272 const XMLPropertyHandler
*GetPropertyHandler( sal_Int32 nType
) const;
1274 XMLTextPropertyHandlerFactory_Impl();
1275 ~XMLTextPropertyHandlerFactory_Impl();
1278 const XMLPropertyHandler
*XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler
1279 ( sal_Int32 nType
) const
1281 const XMLPropertyHandler
* pHdl
= 0;
1284 case XML_TYPE_TEXT_DROPCAP
:
1285 pHdl
= new XMLDropCapPropHdl_Impl
;
1287 case XML_TYPE_TEXT_WRAP
:
1288 pHdl
= new XMLWrapPropHdl_Impl
;
1290 case XML_TYPE_TEXT_PARAGRAPH_ONLY
:
1291 pHdl
= new XMLParagraphOnlyPropHdl_Impl
;
1293 case XML_TYPE_TEXT_WRAP_OUTSIDE
:
1294 pHdl
= new XMLContourModePropHdl_Impl
;
1296 case XML_TYPE_TEXT_OPAQUE
:
1297 pHdl
= new XMLOpaquePropHdl_Impl
;
1299 case XML_TYPE_TEXT_PROTECT_CONTENT
:
1300 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_CONTENT
);
1302 case XML_TYPE_TEXT_PROTECT_SIZE
:
1303 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_SIZE
);
1305 case XML_TYPE_TEXT_PROTECT_POSITION
:
1306 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_POSITION
);
1308 case XML_TYPE_TEXT_ANCHOR_TYPE
:
1309 pHdl
= new XMLAnchorTypePropHdl
;
1311 case XML_TYPE_TEXT_COLUMNS
:
1312 pHdl
= new XMLTextColumnsPropertyHandler
;
1314 case XML_TYPE_TEXT_HORIZONTAL_POS
:
1315 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriPos_Enum
, XML_TOKEN_INVALID
);
1317 case XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED
:
1318 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriPosMirrored_Enum
, XML_TOKEN_INVALID
);
1320 case XML_TYPE_TEXT_HORIZONTAL_REL
:
1321 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriRel_Enum
, XML_TOKEN_INVALID
);
1323 case XML_TYPE_TEXT_HORIZONTAL_REL_FRAME
:
1324 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriRelFrame_Enum
, XML_TOKEN_INVALID
);
1326 case XML_TYPE_TEXT_HORIZONTAL_MIRROR
:
1327 pHdl
= new XMLHoriMirrorPropHdl_Impl
;
1329 case XML_TYPE_TEXT_VERTICAL_POS
:
1330 pHdl
= new XMLConstantsPropertyHandler( pXML_VertPos_Enum
, XML_TOKEN_INVALID
);
1332 case XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR
:
1333 pHdl
= new XMLConstantsPropertyHandler( pXML_VertPosAtChar_Enum
, XML_TOKEN_INVALID
);
1335 case XML_TYPE_TEXT_VERTICAL_REL
:
1336 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRel_Enum
, XML_TOKEN_INVALID
);
1338 case XML_TYPE_TEXT_VERTICAL_REL_PAGE
:
1339 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelPage_Enum
, XML_TOKEN_INVALID
);
1341 case XML_TYPE_TEXT_VERTICAL_REL_FRAME
:
1342 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelFrame_Enum
, XML_TOKEN_INVALID
);
1344 case XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR
:
1345 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum
, XML_TOKEN_INVALID
);
1347 case XML_TYPE_TEXT_MIRROR_VERTICAL
:
1348 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL
, sal_False
);
1350 case XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT
:
1351 // --> OD 2005-05-12 #i49139#
1352 // XML_HORIZONTAL_ON_LEFT_PAGES is replaced by XML_HORIZONTAL_ON_EVEN.
1353 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_EVEN
, sal_True
);
1356 case XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT
:
1357 // --> OD 2005-05-12 #i49139#
1358 // XML_HORIZONTAL_ON_RIGHT_PAGES is replaced by XML_HORIZONTAL_ON_ODD.
1359 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_ODD
, sal_True
);
1362 case XML_TYPE_TEXT_CLIP
:
1363 pHdl
= new XMLClipPropertyHandler( sal_False
);
1365 case XML_TYPE_TEXT_CLIP11
:
1366 pHdl
= new XMLClipPropertyHandler( sal_True
);
1368 case XML_TYPE_TEXT_EMPHASIZE
:
1369 pHdl
= new XMLTextEmphasizePropHdl_Impl
;
1371 case XML_TYPE_TEXT_COMBINE
:
1372 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LINES
),
1373 GetXMLToken( XML_NONE
) );
1375 case XML_TYPE_TEXT_COMBINE_CHARACTERS
:
1376 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LETTERS
),
1377 GetXMLToken( XML_NONE
) );
1379 case XML_TYPE_TEXT_COMBINECHAR
:
1380 pHdl
= new XMLTextCombineCharPropHdl_Impl
;
1382 case XML_TYPE_TEXT_AUTOSPACE
:
1383 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_IDEOGRAPH_ALPHA
),
1384 GetXMLToken( XML_NONE
) );
1386 case XML_TYPE_TEXT_PUNCTUATION_WRAP
:
1387 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_HANGING
),
1388 GetXMLToken( XML_SIMPLE
) );
1390 case XML_TYPE_TEXT_LINE_BREAK
:
1391 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_STRICT
),
1392 GetXMLToken( XML_NORMAL
) );
1394 case XML_TYPE_TEXT_REL_WIDTH_HEIGHT
:
1395 pHdl
= new XMLTextRelWidthHeightPropHdl_Impl
;
1397 case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT
:
1398 pHdl
= new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE
);
1400 case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN
:
1401 pHdl
= new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN
);
1403 case XML_TYPE_TEXT_RUBY_ADJUST
:
1404 pHdl
= new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum
, XML_TOKEN_INVALID
);
1406 case XML_TYPE_TEXT_FONT_RELIEF
:
1407 pHdl
= new XMLConstantsPropertyHandler( pXML_FontRelief_Enum
, XML_TOKEN_INVALID
);
1409 case XML_TYPE_TEXT_ROTATION_ANGLE
:
1410 pHdl
= new XMLTextRotationAnglePropHdl_Impl
;
1412 case XML_TYPE_TEXT_ROTATION_SCALE
:
1413 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_FIXED
),
1414 GetXMLToken( XML_LINE_HEIGHT
) );
1416 case XML_TYPE_TEXT_VERTICAL_ALIGN
:
1417 pHdl
= new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum
, XML_TOKEN_INVALID
);
1419 case XML_TYPE_TEXT_RUBY_POSITION
:
1420 pHdl
= new XMLNamedBoolPropertyHdl( ::xmloff::token::XML_ABOVE
,
1421 ::xmloff::token::XML_BELOW
);
1423 // OD 2004-05-05 #i28701#
1424 case XML_TYPE_WRAP_INFLUENCE_ON_POSITION
:
1425 pHdl
= new XMLConstantsPropertyHandler( pXML_WrapInfluenceOnPosition_Enum
,
1426 XML_TOKEN_INVALID
);
1428 case XML_TYPE_BORDER_MODEL
:
1429 pHdl
= new XMLNamedBoolPropertyHdl( xmloff::token::XML_COLLAPSING
,
1430 xmloff::token::XML_SEPARATING
);
1432 case XML_TYPE_TEXT_LINE_MODE
:
1433 pHdl
= new XMLNamedBoolPropertyHdl(
1434 ::xmloff::token::XML_SKIP_WHITE_SPACE
,
1435 ::xmloff::token::XML_CONTINUOUS
);
1437 case XML_TYPE_TEXT_KEEP
:
1438 pHdl
= new XMLNamedBoolPropertyHdl(
1439 ::xmloff::token::XML_ALWAYS
,
1440 ::xmloff::token::XML_AUTO
);
1442 case XML_TYPE_TEXT_NKEEP
:
1443 pHdl
= new XMLNamedBoolPropertyHdl(
1444 ::xmloff::token::XML_AUTO
,
1445 ::xmloff::token::XML_ALWAYS
);
1447 case XML_TYPE_TEXT_NUMBER8_ONE_BASED
:
1448 pHdl
= new XMLNumber8OneBasedHdl();
1455 XMLTextPropertyHandlerFactory_Impl::XMLTextPropertyHandlerFactory_Impl()
1459 XMLTextPropertyHandlerFactory_Impl::~XMLTextPropertyHandlerFactory_Impl()
1463 // ----------------------------------------------------------------------------
1465 XMLTextPropertyHandlerFactory::XMLTextPropertyHandlerFactory() :
1466 XMLPropertyHandlerFactory(),
1467 pImpl( new XMLTextPropertyHandlerFactory_Impl
)
1471 XMLTextPropertyHandlerFactory::~XMLTextPropertyHandlerFactory()
1476 const XMLPropertyHandler
*XMLTextPropertyHandlerFactory::GetPropertyHandler(
1477 sal_Int32 nType
) const
1479 const XMLPropertyHandler
*pHdl
=
1480 XMLPropertyHandlerFactory::GetPropertyHandler( nType
);
1484 const XMLPropertyHandler
*pNewHdl
= pImpl
->GetPropertyHandler( nType
);
1487 PutHdlCache( nType
, pNewHdl
);