1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <tools/debug.hxx>
21 #include <rtl/ustrbuf.hxx>
22 #include <tools/fontenum.hxx>
23 #include <com/sun/star/uno/Any.hxx>
24 #include <com/sun/star/drawing/FillStyle.hpp>
25 #include <com/sun/star/style/DropCapFormat.hpp>
26 #include <com/sun/star/text/FontRelief.hpp>
27 #include <com/sun/star/text/WrapTextMode.hpp>
28 #include <com/sun/star/text/XTextColumns.hpp>
29 #include <com/sun/star/text/TextColumn.hpp>
30 #include <com/sun/star/text/RelOrientation.hpp>
31 #include <com/sun/star/text/HoriOrientation.hpp>
32 #include <com/sun/star/text/VertOrientation.hpp>
33 #include <com/sun/star/text/RubyAdjust.hpp>
34 #include <com/sun/star/text/FontEmphasis.hpp>
35 #include <com/sun/star/text/ParagraphVertAlign.hpp>
36 #include <sax/tools/converter.hxx>
37 #include <xmloff/xmltypes.hxx>
38 #include <xmloff/xmluconv.hxx>
39 #include <xmloff/xmltoken.hxx>
40 #include "XMLAnchorTypePropHdl.hxx"
41 #include <xmloff/XMLConstantsPropertyHandler.hxx>
42 #include "XMLClipPropertyHandler.hxx"
43 #include "XMLTextColumnsPropertyHandler.hxx"
44 #include <xmloff/NamedBoolPropertyHdl.hxx>
45 #include "txtprhdl.hxx"
46 // OD 2004-05-05 #i28701#
47 #include <com/sun/star/text/WrapInfluenceOnPosition.hpp>
51 using namespace ::com::sun::star
;
52 using namespace ::com::sun::star::uno
;
53 using namespace ::com::sun::star::style
;
54 using namespace ::com::sun::star::text
;
55 using namespace ::xmloff::token
;
57 // ---------------------------------------------------------------------------
59 SvXMLEnumMapEntry
const pXML_HoriPos_Enum
[] =
61 { XML_FROM_LEFT
, HoriOrientation::NONE
},
62 { XML_FROM_INSIDE
, HoriOrientation::NONE
}, // import only
63 { XML_LEFT
, HoriOrientation::LEFT
},
64 { XML_INSIDE
, HoriOrientation::LEFT
}, // import only
65 { XML_CENTER
, HoriOrientation::CENTER
},
66 { XML_RIGHT
, HoriOrientation::RIGHT
},
67 { XML_OUTSIDE
, HoriOrientation::RIGHT
}, // import only
68 { XML_TOKEN_INVALID
, 0 }
71 SvXMLEnumMapEntry
const pXML_HoriPosMirrored_Enum
[] =
73 { XML_FROM_INSIDE
, HoriOrientation::NONE
},
74 { XML_INSIDE
, HoriOrientation::LEFT
},
75 { XML_CENTER
, HoriOrientation::CENTER
},
76 { XML_OUTSIDE
, HoriOrientation::RIGHT
},
77 { XML_TOKEN_INVALID
, 0 }
80 SvXMLEnumMapEntry
const pXML_HoriRel_Enum
[] =
82 { XML_PARAGRAPH
, RelOrientation::FRAME
},
83 { XML_PARAGRAPH_CONTENT
, RelOrientation::PRINT_AREA
},
84 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
85 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
86 { XML_PARAGRAPH_START_MARGIN
, RelOrientation::FRAME_LEFT
},
87 { XML_PARAGRAPH_END_MARGIN
, RelOrientation::FRAME_RIGHT
},
88 { XML_PAGE_START_MARGIN
, RelOrientation::PAGE_LEFT
},
89 { XML_PAGE_END_MARGIN
, RelOrientation::PAGE_RIGHT
},
90 { XML_CHAR
, RelOrientation::CHAR
},
91 { XML_FRAME
, RelOrientation::FRAME
}, // import only
92 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
}, // import only
93 { XML_FRAME_START_MARGIN
, RelOrientation::FRAME_LEFT
}, // import only
94 { XML_FRAME_END_MARGIN
, RelOrientation::FRAME_RIGHT
}, // import only
95 { XML_TOKEN_INVALID
, 0 }
98 SvXMLEnumMapEntry
const pXML_HoriRelFrame_Enum
[] =
100 { XML_FRAME
, RelOrientation::FRAME
},
101 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
},
102 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
103 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
104 { XML_FRAME_START_MARGIN
, RelOrientation::FRAME_LEFT
},
105 { XML_FRAME_END_MARGIN
, RelOrientation::FRAME_RIGHT
},
106 { XML_PAGE_START_MARGIN
, RelOrientation::PAGE_LEFT
},
107 { XML_PAGE_END_MARGIN
, RelOrientation::PAGE_RIGHT
},
108 { XML_CHAR
, RelOrientation::CHAR
},
109 { XML_TOKEN_INVALID
, 0 }
112 SvXMLEnumMapEntry
const pXML_HoriMirror_Enum
[] =
114 { XML_FROM_LEFT
, sal_False
},
115 { XML_FROM_INSIDE
, sal_True
},
116 { XML_LEFT
, sal_False
},
117 { XML_INSIDE
, sal_True
},
118 { XML_CENTER
, sal_False
},
119 { XML_RIGHT
, sal_False
},
120 { XML_OUTSIDE
, sal_True
},
121 { XML_TOKEN_INVALID
, 0 }
124 SvXMLEnumMapEntry
const pXML_VertPos_Enum
[] =
126 { XML_FROM_TOP
, VertOrientation::NONE
},
127 { XML_TOP
, VertOrientation::TOP
},
128 { XML_TOP
, VertOrientation::CHAR_TOP
}, // export only
129 { XML_TOP
, VertOrientation::LINE_TOP
}, // export only
130 { XML_MIDDLE
, VertOrientation::CENTER
},
131 { XML_MIDDLE
, VertOrientation::CHAR_CENTER
}, // export only
132 { XML_MIDDLE
, VertOrientation::LINE_CENTER
}, // export only
133 { XML_BOTTOM
, VertOrientation::BOTTOM
},
134 { XML_BOTTOM
, VertOrientation::CHAR_BOTTOM
}, // export only
135 { XML_BOTTOM
, VertOrientation::LINE_BOTTOM
}, // export only
136 { XML_BELOW
, VertOrientation::CHAR_BOTTOM
}, // import only
137 { XML_TOKEN_INVALID
, 0 }
140 SvXMLEnumMapEntry
const pXML_VertPosAtChar_Enum
[] =
142 { XML_FROM_TOP
, VertOrientation::NONE
},
143 { XML_TOP
, VertOrientation::TOP
},
144 { XML_TOP
, VertOrientation::CHAR_TOP
}, // export only
145 { XML_TOP
, VertOrientation::LINE_TOP
}, // export only
146 { XML_MIDDLE
, VertOrientation::CENTER
},
147 { XML_MIDDLE
, VertOrientation::CHAR_CENTER
}, // export only
148 { XML_MIDDLE
, VertOrientation::LINE_CENTER
}, // export only
149 { XML_BOTTOM
, VertOrientation::BOTTOM
},
150 { XML_BELOW
, VertOrientation::CHAR_BOTTOM
}, // export only
151 { XML_BOTTOM
, VertOrientation::LINE_BOTTOM
}, // export only
152 { XML_TOKEN_INVALID
, 0 }
155 SvXMLEnumMapEntry
const pXML_VertRel_Enum
[] =
157 { XML_PARAGRAPH
, RelOrientation::FRAME
},
158 { XML_PARAGRAPH_CONTENT
, RelOrientation::PRINT_AREA
},
159 { XML_CHAR
, RelOrientation::CHAR
},
160 // DVO, OD 17.09.2003 #i18732# - allow vertical alignment at page
161 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
162 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
163 { XML_FRAME
, RelOrientation::FRAME
}, // import only
164 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
}, // import only
165 // OD 13.11.2003 #i22341# - new vertical alignment at top of line
166 { XML_LINE
, RelOrientation::TEXT_LINE
},
167 { XML_TOKEN_INVALID
, 0 }
170 SvXMLEnumMapEntry
const pXML_VertRelPage_Enum
[] =
172 { XML_PAGE
, RelOrientation::FRAME
},
173 { XML_PAGE_CONTENT
, RelOrientation::PRINT_AREA
},
174 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
175 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
176 { XML_TOKEN_INVALID
, 0 }
179 SvXMLEnumMapEntry
const pXML_VertRelFrame_Enum
[] =
181 { XML_FRAME
, RelOrientation::FRAME
},
182 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
},
183 { XML_TOKEN_INVALID
, 0 }
186 SvXMLEnumMapEntry
const pXML_VertRelAsChar_Enum
[] =
188 { XML_BASELINE
, VertOrientation::TOP
},
189 { XML_BASELINE
, VertOrientation::CENTER
}, // export only
190 { XML_BASELINE
, VertOrientation::BOTTOM
}, // export only
191 { XML_TEXT
, VertOrientation::CHAR_TOP
},
192 { XML_TEXT
, VertOrientation::CHAR_CENTER
}, // export only
193 { XML_TEXT
, VertOrientation::CHAR_BOTTOM
}, // export only
194 { XML_LINE
, VertOrientation::LINE_TOP
},
195 { XML_LINE
, VertOrientation::LINE_CENTER
}, // export only
196 { XML_LINE
, VertOrientation::LINE_BOTTOM
}, // export only
197 { XML_TOKEN_INVALID
, 0 }
200 SvXMLEnumMapEntry
const pXML_RubyAdjust_Enum
[] =
202 { XML_LEFT
, RubyAdjust_LEFT
},
203 { XML_CENTER
, RubyAdjust_CENTER
},
204 { XML_RIGHT
, RubyAdjust_RIGHT
},
205 { XML_DISTRIBUTE_LETTER
, RubyAdjust_BLOCK
},
206 { XML_DISTRIBUTE_SPACE
, RubyAdjust_INDENT_BLOCK
},
207 { XML_TOKEN_INVALID
, 0 }
210 SvXMLEnumMapEntry
const pXML_FontRelief_Enum
[] =
212 { XML_NONE
, FontRelief::NONE
},
213 { XML_ENGRAVED
, FontRelief::ENGRAVED
},
214 { XML_EMBOSSED
, FontRelief::EMBOSSED
},
215 { XML_TOKEN_INVALID
, 0 }
218 SvXMLEnumMapEntry
const pXML_VerticalAlign_Enum
[] =
220 { XML_TOP
, ParagraphVertAlign::TOP
},
221 { XML_MIDDLE
, ParagraphVertAlign::CENTER
},
222 { XML_BOTTOM
, ParagraphVertAlign::BOTTOM
},
223 { XML_BASELINE
, ParagraphVertAlign::BASELINE
},
224 { XML_AUTO
, ParagraphVertAlign::AUTOMATIC
},
225 { XML_TOKEN_INVALID
, 0 }
228 // OD 2004-05-05 #i28701#
229 SvXMLEnumMapEntry
const pXML_WrapInfluenceOnPosition_Enum
[] =
231 // Tokens have been renamed and <XML_ITERATIVE> has been added (#i35017#)
232 { XML_ONCE_SUCCESSIVE
, WrapInfluenceOnPosition::ONCE_SUCCESSIVE
},
233 { XML_ONCE_CONCURRENT
, WrapInfluenceOnPosition::ONCE_CONCURRENT
},
234 { XML_ITERATIVE
, WrapInfluenceOnPosition::ITERATIVE
},
235 { XML_TOKEN_INVALID
, 0 }
238 SvXMLEnumMapEntry
const pXML_FillStyle_Enum
[] =
240 { XML_NONE
, drawing::FillStyle_NONE
},
241 { XML_SOLID
, drawing::FillStyle_SOLID
},
242 { XML_BITMAP
, drawing::FillStyle_BITMAP
},
243 { XML_GRADIENT
, drawing::FillStyle_GRADIENT
},
244 { XML_HATCH
, drawing::FillStyle_HATCH
},
245 { XML_TOKEN_INVALID
, 0 }
248 // ---------------------------------------------------------------------------
250 class XMLDropCapPropHdl_Impl
: public XMLPropertyHandler
253 virtual ~XMLDropCapPropHdl_Impl ();
256 const ::com::sun::star::uno::Any
& r1
,
257 const ::com::sun::star::uno::Any
& r2
) const;
259 /// TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place.
260 virtual sal_Bool
importXML(
261 const OUString
& rStrImpValue
,
262 ::com::sun::star::uno::Any
& rValue
,
263 const SvXMLUnitConverter
& ) const;
264 virtual sal_Bool
exportXML(
265 OUString
& rStrExpValue
,
266 const ::com::sun::star::uno::Any
& rValue
,
267 const SvXMLUnitConverter
& ) const;
270 XMLDropCapPropHdl_Impl::~XMLDropCapPropHdl_Impl ()
274 bool XMLDropCapPropHdl_Impl::equals(
276 const Any
& r2
) const
278 DropCapFormat aFormat1
, aFormat2
;
282 return (aFormat1
.Lines
<=1 && aFormat2
.Lines
<=1) ||
283 (aFormat1
.Lines
== aFormat2
.Lines
&&
284 aFormat1
.Count
== aFormat2
.Count
&&
285 aFormat1
.Distance
== aFormat2
.Distance
);
288 sal_Bool
XMLDropCapPropHdl_Impl::importXML(
291 const SvXMLUnitConverter
& ) const
293 DBG_ASSERT( !this, "drop caps are an element import property" );
297 sal_Bool
XMLDropCapPropHdl_Impl::exportXML(
300 const SvXMLUnitConverter
& ) const
302 DBG_ASSERT( !this, "drop caps are an element export property" );
306 // ---------------------------------------------------------------------------
308 class XMLOpaquePropHdl_Impl
: public XMLPropertyHandler
311 virtual ~XMLOpaquePropHdl_Impl ();
313 virtual sal_Bool
importXML(
314 const OUString
& rStrImpValue
,
315 ::com::sun::star::uno::Any
& rValue
,
316 const SvXMLUnitConverter
& ) const;
317 virtual sal_Bool
exportXML(
318 OUString
& rStrExpValue
,
319 const ::com::sun::star::uno::Any
& rValue
,
320 const SvXMLUnitConverter
& ) const;
323 sal_Bool
XMLOpaquePropHdl_Impl::importXML(
324 const OUString
& rStrImpValue
,
326 const SvXMLUnitConverter
& ) const
328 sal_Bool bRet
= sal_True
;
329 sal_Bool bVal
= sal_False
;
330 if( IsXMLToken( rStrImpValue
, XML_FOREGROUND
) )
332 else if( !IsXMLToken( rStrImpValue
, XML_BACKGROUND
) )
336 rValue
.setValue( &bVal
, ::getBooleanCppuType() );
341 sal_Bool
XMLOpaquePropHdl_Impl::exportXML(
342 OUString
& rStrExpValue
,
344 const SvXMLUnitConverter
& ) const
346 if( *(sal_Bool
*)rValue
.getValue() )
347 rStrExpValue
= GetXMLToken( XML_FOREGROUND
);
349 rStrExpValue
= GetXMLToken( XML_BACKGROUND
);
354 XMLOpaquePropHdl_Impl::~XMLOpaquePropHdl_Impl ()
358 // ---------------------------------------------------------------------------
360 class XMLContourModePropHdl_Impl
: public XMLPropertyHandler
363 virtual ~XMLContourModePropHdl_Impl ();
365 virtual sal_Bool
importXML(
366 const OUString
& rStrImpValue
,
367 ::com::sun::star::uno::Any
& rValue
,
368 const SvXMLUnitConverter
& ) const;
369 virtual sal_Bool
exportXML(
370 OUString
& rStrExpValue
,
371 const ::com::sun::star::uno::Any
& rValue
,
372 const SvXMLUnitConverter
& ) const;
375 sal_Bool
XMLContourModePropHdl_Impl::importXML(
376 const OUString
& rStrImpValue
,
378 const SvXMLUnitConverter
& ) const
380 sal_Bool bRet
= sal_True
;
381 sal_Bool bVal
= sal_False
;
382 if( IsXMLToken( rStrImpValue
, XML_OUTSIDE
) )
384 else if( ! IsXMLToken( rStrImpValue
, XML_FULL
) )
388 rValue
.setValue( &bVal
, ::getBooleanCppuType() );
393 sal_Bool
XMLContourModePropHdl_Impl::exportXML(
394 OUString
& rStrExpValue
,
396 const SvXMLUnitConverter
& ) const
398 if( *(sal_Bool
*)rValue
.getValue() )
399 rStrExpValue
= GetXMLToken( XML_OUTSIDE
);
401 rStrExpValue
= GetXMLToken( XML_FULL
);
406 XMLContourModePropHdl_Impl::~XMLContourModePropHdl_Impl()
410 // ---------------------------------------------------------------------------
412 class XMLParagraphOnlyPropHdl_Impl
: public XMLPropertyHandler
415 virtual ~XMLParagraphOnlyPropHdl_Impl ();
417 virtual sal_Bool
importXML(
418 const OUString
& rStrImpValue
,
419 ::com::sun::star::uno::Any
& rValue
,
420 const SvXMLUnitConverter
& ) const;
421 virtual sal_Bool
exportXML(
422 OUString
& rStrExpValue
,
423 const ::com::sun::star::uno::Any
& rValue
,
424 const SvXMLUnitConverter
& ) const;
427 sal_Bool
XMLParagraphOnlyPropHdl_Impl::importXML(
428 const OUString
& rStrImpValue
,
430 const SvXMLUnitConverter
& ) const
432 sal_Bool bRet
= sal_True
;
433 sal_Bool bVal
= sal_False
;
435 if( ! IsXMLToken( rStrImpValue
, XML_NO_LIMIT
) )
437 sal_Int32 nValue
= 0;
438 bRet
= ::sax::Converter::convertNumber( nValue
, rStrImpValue
);
443 rValue
.setValue( &bVal
, ::getBooleanCppuType() );
448 sal_Bool
XMLParagraphOnlyPropHdl_Impl::exportXML(
449 OUString
& rStrExpValue
,
451 const SvXMLUnitConverter
& ) const
453 if( *(sal_Bool
*)rValue
.getValue() )
454 rStrExpValue
= GetXMLToken( XML_1
);
456 rStrExpValue
= GetXMLToken( XML_NO_LIMIT
);
461 XMLParagraphOnlyPropHdl_Impl::~XMLParagraphOnlyPropHdl_Impl()
465 // ---------------------------------------------------------------------------
467 SvXMLEnumMapEntry
const pXML_Wrap_Enum
[] =
469 { XML_NONE
, WrapTextMode_NONE
},
470 { XML_RUN_THROUGH
, WrapTextMode_THROUGHT
},
471 { XML_PARALLEL
, WrapTextMode_PARALLEL
},
472 { XML_DYNAMIC
, WrapTextMode_DYNAMIC
},
473 { XML_LEFT
, WrapTextMode_LEFT
},
474 { XML_RIGHT
, WrapTextMode_RIGHT
},
475 { XML_TOKEN_INVALID
, 0 }
478 class XMLWrapPropHdl_Impl
: public XMLPropertyHandler
481 virtual ~XMLWrapPropHdl_Impl ();
483 virtual sal_Bool
importXML(
484 const OUString
& rStrImpValue
,
485 ::com::sun::star::uno::Any
& rValue
,
486 const SvXMLUnitConverter
& ) const;
487 virtual sal_Bool
exportXML(
488 OUString
& rStrExpValue
,
489 const ::com::sun::star::uno::Any
& rValue
,
490 const SvXMLUnitConverter
& ) const;
493 sal_Bool
XMLWrapPropHdl_Impl::importXML(
494 const OUString
& rStrImpValue
,
496 const SvXMLUnitConverter
& ) const
499 sal_Bool bRet
= SvXMLUnitConverter::convertEnum( nWrap
, rStrImpValue
,
503 rValue
<<= (WrapTextMode
)nWrap
;
508 sal_Bool
XMLWrapPropHdl_Impl::exportXML(
509 OUString
& rStrExpValue
,
511 const SvXMLUnitConverter
& ) const
518 sal_Bool bRet
= SvXMLUnitConverter::convertEnum( aOut
, eVal
, pXML_Wrap_Enum
, XML_NONE
);
520 rStrExpValue
= aOut
.makeStringAndClear();
525 XMLWrapPropHdl_Impl::~XMLWrapPropHdl_Impl ()
529 // ---------------------------------------------------------------------------
531 class XMLFrameProtectPropHdl_Impl
: public XMLPropertyHandler
535 XMLFrameProtectPropHdl_Impl( enum XMLTokenEnum eVal
) :
536 sVal( GetXMLToken(eVal
) ) {}
537 virtual ~XMLFrameProtectPropHdl_Impl ();
539 virtual sal_Bool
importXML(
540 const OUString
& rStrImpValue
,
541 ::com::sun::star::uno::Any
& rValue
,
542 const SvXMLUnitConverter
& ) const;
543 virtual sal_Bool
exportXML(
544 OUString
& rStrExpValue
,
545 const ::com::sun::star::uno::Any
& rValue
,
546 const SvXMLUnitConverter
& ) const;
549 sal_Bool
XMLFrameProtectPropHdl_Impl::importXML(
550 const OUString
& rStrImpValue
,
552 const SvXMLUnitConverter
& ) const
554 sal_Bool bRet
= sal_True
;
555 sal_Bool bVal
= sal_False
;
556 if( ! IsXMLToken( rStrImpValue
, XML_NONE
) )
559 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
561 while( aTokenEnum
.getNextToken( aToken
) )
573 rValue
.setValue( &bVal
, ::getBooleanCppuType() );
578 sal_Bool
XMLFrameProtectPropHdl_Impl::exportXML(
579 OUString
& rStrExpValue
,
581 const SvXMLUnitConverter
& ) const
583 if( *(sal_Bool
*)rValue
.getValue() )
585 if( rStrExpValue
.isEmpty() ||
586 IsXMLToken( rStrExpValue
, XML_NONE
) )
592 OUStringBuffer
aOut( rStrExpValue
.getLength() + 1 +
594 aOut
.append( rStrExpValue
);
595 aOut
.append( (sal_Unicode
)' ' );
597 rStrExpValue
= aOut
.makeStringAndClear();
600 else if( rStrExpValue
.isEmpty() )
602 rStrExpValue
= GetXMLToken( XML_NONE
);
608 XMLFrameProtectPropHdl_Impl::~XMLFrameProtectPropHdl_Impl()
612 // ---------------------------------------------------------------------------
614 SvXMLEnumMapEntry
const pXML_Anchor_Enum
[] =
616 { XML_CHAR
, TextContentAnchorType_AT_CHARACTER
},
617 { XML_PAGE
, TextContentAnchorType_AT_PAGE
},
618 { XML_FRAME
, TextContentAnchorType_AT_FRAME
},
619 { XML_PARAGRAPH
, TextContentAnchorType_AT_PARAGRAPH
},
620 { XML_AS_CHAR
, TextContentAnchorType_AS_CHARACTER
},
621 { XML_TOKEN_INVALID
, 0 }
625 sal_Bool
XMLAnchorTypePropHdl::importXML(
626 const OUString
& rStrImpValue
,
628 const SvXMLUnitConverter
& ) const
631 sal_Bool bRet
= SvXMLUnitConverter::convertEnum( nAnchor
, rStrImpValue
,
635 rValue
<<= (TextContentAnchorType
)nAnchor
;
640 sal_Bool
XMLAnchorTypePropHdl::exportXML(
641 OUString
& rStrExpValue
,
643 const SvXMLUnitConverter
& ) const
646 TextContentAnchorType eVal
;
650 sal_Bool bRet
= SvXMLUnitConverter::convertEnum( aOut
, eVal
, pXML_Anchor_Enum
, XML_PARAGRAPH
);
652 rStrExpValue
= aOut
.makeStringAndClear();
657 XMLAnchorTypePropHdl::~XMLAnchorTypePropHdl()
661 sal_Bool
XMLAnchorTypePropHdl::convert( const OUString
& rStrImpValue
,
662 TextContentAnchorType
& rType
)
665 sal_Bool bRet
= SvXMLUnitConverter::convertEnum( nAnchor
, rStrImpValue
,
668 rType
= (TextContentAnchorType
)nAnchor
;
672 // ---------------------------------------------------------------------------
675 XMLTextColumnsPropertyHandler::~XMLTextColumnsPropertyHandler ()
679 bool XMLTextColumnsPropertyHandler::equals(
681 const Any
& r2
) const
683 Reference
< XTextColumns
> xColumns1
;
686 Reference
< XTextColumns
> xColumns2
;
689 if( xColumns1
->getColumnCount() != xColumns2
->getColumnCount() ||
690 xColumns1
->getReferenceValue() != xColumns2
->getReferenceValue() )
693 Sequence
< TextColumn
> aColumns1
= xColumns1
->getColumns();
694 Sequence
< TextColumn
> aColumns2
= xColumns2
->getColumns();
695 sal_Int32 nCount
= aColumns1
.getLength();
696 if( aColumns2
.getLength() != nCount
)
699 const TextColumn
*pColumns1
= aColumns1
.getArray();
700 const TextColumn
*pColumns2
= aColumns2
.getArray();
704 if( pColumns1
->Width
!= pColumns2
->Width
||
705 pColumns1
->LeftMargin
!= pColumns2
->LeftMargin
||
706 pColumns1
->RightMargin
!= pColumns2
->RightMargin
)
716 sal_Bool
XMLTextColumnsPropertyHandler::importXML(
719 const SvXMLUnitConverter
& ) const
721 DBG_ASSERT( !this, "columns are an element import property" );
725 sal_Bool
XMLTextColumnsPropertyHandler::exportXML(
728 const SvXMLUnitConverter
& ) const
730 DBG_ASSERT( !this, "columns are an element export property" );
734 // ---------------------------------------------------------------------------
736 class XMLHoriMirrorPropHdl_Impl
: public XMLPropertyHandler
739 virtual ~XMLHoriMirrorPropHdl_Impl ();
741 virtual sal_Bool
importXML(
742 const OUString
& rStrImpValue
,
743 ::com::sun::star::uno::Any
& rValue
,
744 const SvXMLUnitConverter
& ) const;
745 virtual sal_Bool
exportXML(
746 OUString
& rStrExpValue
,
747 const ::com::sun::star::uno::Any
& rValue
,
748 const SvXMLUnitConverter
& ) const;
751 sal_Bool
XMLHoriMirrorPropHdl_Impl::importXML(
752 const OUString
& rStrImpValue
,
754 const SvXMLUnitConverter
& ) const
756 sal_uInt16 nHoriMirror
;
757 sal_Bool bRet
= SvXMLUnitConverter::convertEnum( nHoriMirror
, rStrImpValue
,
758 pXML_HoriMirror_Enum
);
762 sal_Bool bTmp
= nHoriMirror
!= 0;
763 rValue
.setValue( &bTmp
, ::getBooleanCppuType() );
769 sal_Bool
XMLHoriMirrorPropHdl_Impl::exportXML(
772 const SvXMLUnitConverter
& ) const
774 DBG_ASSERT( !this, "HorMirror properyt shouldn't be exported" );
779 XMLHoriMirrorPropHdl_Impl::~XMLHoriMirrorPropHdl_Impl ()
783 // ---------------------------------------------------------------------------
785 class XMLGrfMirrorPropHdl_Impl
: public XMLPropertyHandler
791 XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal
, sal_Bool bH
) :
792 sVal( GetXMLToken( eVal
) ),
794 virtual ~XMLGrfMirrorPropHdl_Impl ();
796 virtual sal_Bool
importXML(
797 const OUString
& rStrImpValue
,
798 ::com::sun::star::uno::Any
& rValue
,
799 const SvXMLUnitConverter
& ) const;
800 virtual sal_Bool
exportXML(
801 OUString
& rStrExpValue
,
802 const ::com::sun::star::uno::Any
& rValue
,
803 const SvXMLUnitConverter
& ) const;
806 sal_Bool
XMLGrfMirrorPropHdl_Impl::importXML(
807 const OUString
& rStrImpValue
,
809 const SvXMLUnitConverter
& ) const
811 sal_Bool bRet
= sal_True
;
812 sal_Bool bVal
= sal_False
;
813 if( ! IsXMLToken( rStrImpValue
, XML_NONE
) )
816 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
818 while( aTokenEnum
.getNextToken( aToken
) )
821 if( aToken
== sVal
||
822 (bHori
&& IsXMLToken( aToken
, XML_HORIZONTAL
) ) )
831 rValue
.setValue( &bVal
, ::getBooleanCppuType() );
836 sal_Bool
XMLGrfMirrorPropHdl_Impl::exportXML(
837 OUString
& rStrExpValue
,
839 const SvXMLUnitConverter
& ) const
841 if( *(sal_Bool
*)rValue
.getValue() )
843 if( rStrExpValue
.isEmpty() ||
844 IsXMLToken( rStrExpValue
, XML_NONE
) )
849 /* XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES
850 are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD.
853 ( IsXMLToken( rStrExpValue
, XML_HORIZONTAL_ON_EVEN
) ||
854 IsXMLToken( rStrExpValue
, XML_HORIZONTAL_ON_ODD
) ))
856 rStrExpValue
= GetXMLToken( XML_HORIZONTAL
);
860 OUStringBuffer
aOut( rStrExpValue
.getLength() + 1 +
862 aOut
.append( rStrExpValue
);
863 aOut
.append( (sal_Unicode
)' ' );
865 rStrExpValue
= aOut
.makeStringAndClear();
868 else if( rStrExpValue
.isEmpty() )
870 rStrExpValue
= GetXMLToken( XML_NONE
);
876 XMLGrfMirrorPropHdl_Impl::~XMLGrfMirrorPropHdl_Impl()
880 // ---------------------------------------------------------------------------
882 SvXMLEnumMapEntry
const pXML_Emphasize_Enum
[] =
884 { XML_NONE
, FontEmphasis::NONE
},
885 { XML_DOT
, FontEmphasis::DOT_ABOVE
},
886 { XML_CIRCLE
, FontEmphasis::CIRCLE_ABOVE
},
887 { XML_DISC
, FontEmphasis::DISK_ABOVE
},
888 { XML_ACCENT
, FontEmphasis::ACCENT_ABOVE
},
889 { XML_TOKEN_INVALID
, 0 }
891 class XMLTextEmphasizePropHdl_Impl
: public XMLPropertyHandler
894 XMLTextEmphasizePropHdl_Impl() {}
895 virtual ~XMLTextEmphasizePropHdl_Impl();
897 virtual sal_Bool
importXML(
898 const OUString
& rStrImpValue
,
899 ::com::sun::star::uno::Any
& rValue
,
900 const SvXMLUnitConverter
& ) const;
901 virtual sal_Bool
exportXML(
902 OUString
& rStrExpValue
,
903 const ::com::sun::star::uno::Any
& rValue
,
904 const SvXMLUnitConverter
& ) const;
907 sal_Bool
XMLTextEmphasizePropHdl_Impl::importXML(
908 const OUString
& rStrImpValue
,
910 const SvXMLUnitConverter
& ) const
912 sal_Bool bRet
= sal_True
;
913 sal_uInt16 nVal
= FontEmphasis::NONE
;
914 sal_Bool bBelow
= sal_False
;
915 sal_Bool bHasPos
= sal_False
, bHasType
= sal_False
;
918 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
919 while( aTokenEnum
.getNextToken( aToken
) )
921 if( !bHasPos
&& IsXMLToken( aToken
, XML_ABOVE
) )
926 else if( !bHasPos
&& IsXMLToken( aToken
, XML_BELOW
) )
931 else if( !bHasType
&&
932 SvXMLUnitConverter::convertEnum( nVal
, aToken
,
933 pXML_Emphasize_Enum
))
946 if( FontEmphasis::NONE
!= nVal
&& bBelow
)
948 rValue
<<= (sal_Int16
)nVal
;
954 sal_Bool
XMLTextEmphasizePropHdl_Impl::exportXML(
955 OUString
& rStrExpValue
,
957 const SvXMLUnitConverter
& ) const
959 OUStringBuffer
aOut( 15 );
960 sal_Bool bRet
= sal_True
;
961 sal_Int16 nType
= sal_Int16();
962 if( rValue
>>= nType
)
964 sal_Bool bBelow
= sal_False
;
970 bRet
= SvXMLUnitConverter::convertEnum( aOut
, nType
,
977 enum XMLTokenEnum ePos
= bBelow
? XML_BELOW
: XML_ABOVE
;
978 aOut
.append( (sal_Unicode
)' ' );
979 aOut
.append( GetXMLToken(ePos
) );
981 rStrExpValue
= aOut
.makeStringAndClear();
988 XMLTextEmphasizePropHdl_Impl::~XMLTextEmphasizePropHdl_Impl()
993 // ---------------------------------------------------------------------------
995 class XMLTextCombineCharPropHdl_Impl
: public XMLPropertyHandler
998 XMLTextCombineCharPropHdl_Impl() {}
999 virtual ~XMLTextCombineCharPropHdl_Impl();
1001 virtual sal_Bool
importXML(
1002 const OUString
& rStrImpValue
,
1003 ::com::sun::star::uno::Any
& rValue
,
1004 const SvXMLUnitConverter
& ) const;
1005 virtual sal_Bool
exportXML(
1006 OUString
& rStrExpValue
,
1007 const ::com::sun::star::uno::Any
& rValue
,
1008 const SvXMLUnitConverter
& ) const;
1011 sal_Bool
XMLTextCombineCharPropHdl_Impl::importXML(
1012 const OUString
& rStrImpValue
,
1014 const SvXMLUnitConverter
& ) const
1016 if( !rStrImpValue
.isEmpty() )
1017 rValue
<<= rStrImpValue
.copy( 0, 1 );
1019 rValue
<<= rStrImpValue
;
1024 sal_Bool
XMLTextCombineCharPropHdl_Impl::exportXML(
1025 OUString
& rStrExpValue
,
1027 const SvXMLUnitConverter
& ) const
1029 rValue
>>= rStrExpValue
;
1031 // #i114107# attribute of type "character": export only if length is 1
1032 return (1 == rStrExpValue
.getLength()) ? sal_True
: sal_False
;
1035 XMLTextCombineCharPropHdl_Impl::~XMLTextCombineCharPropHdl_Impl()
1039 // ---------------------------------------------------------------------------
1041 class XMLTextRelWidthHeightPropHdl_Impl
: public XMLPropertyHandler
1044 XMLTextRelWidthHeightPropHdl_Impl() {}
1045 virtual ~XMLTextRelWidthHeightPropHdl_Impl();
1047 virtual sal_Bool
importXML(
1048 const OUString
& rStrImpValue
,
1049 ::com::sun::star::uno::Any
& rValue
,
1050 const SvXMLUnitConverter
& ) const;
1051 virtual sal_Bool
exportXML(
1052 OUString
& rStrExpValue
,
1053 const ::com::sun::star::uno::Any
& rValue
,
1054 const SvXMLUnitConverter
& ) const;
1057 sal_Bool
XMLTextRelWidthHeightPropHdl_Impl::importXML(
1058 const OUString
& rStrImpValue
,
1060 const SvXMLUnitConverter
& ) const
1063 bool const bRet
= ::sax::Converter::convertPercent( nValue
, rStrImpValue
);
1065 rValue
<<= (sal_Int16
)nValue
;
1070 sal_Bool
XMLTextRelWidthHeightPropHdl_Impl::exportXML(
1071 OUString
& rStrExpValue
,
1073 const SvXMLUnitConverter
& ) const
1075 sal_Bool bRet
= sal_False
;
1076 sal_Int16 nValue
= sal_Int16();
1077 if( (rValue
>>= nValue
) && nValue
> 0 )
1079 OUStringBuffer aOut
;
1080 ::sax::Converter::convertPercent( aOut
, nValue
);
1081 rStrExpValue
= aOut
.makeStringAndClear();
1089 XMLTextRelWidthHeightPropHdl_Impl::~XMLTextRelWidthHeightPropHdl_Impl()
1093 // ---------------------------------------------------------------------------
1095 class XMLTextSyncWidthHeightPropHdl_Impl
: public XMLPropertyHandler
1097 const OUString sValue
;
1100 XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue
) :
1101 sValue( GetXMLToken(eValue
) ) {}
1102 virtual ~XMLTextSyncWidthHeightPropHdl_Impl();
1104 virtual sal_Bool
importXML(
1105 const OUString
& rStrImpValue
,
1106 ::com::sun::star::uno::Any
& rValue
,
1107 const SvXMLUnitConverter
& ) const;
1108 virtual sal_Bool
exportXML(
1109 OUString
& rStrExpValue
,
1110 const ::com::sun::star::uno::Any
& rValue
,
1111 const SvXMLUnitConverter
& ) const;
1114 sal_Bool
XMLTextSyncWidthHeightPropHdl_Impl::importXML(
1115 const OUString
& rStrImpValue
,
1117 const SvXMLUnitConverter
& ) const
1119 sal_Bool bValue
= (rStrImpValue
== sValue
);
1120 rValue
.setValue( &bValue
, ::getBooleanCppuType() );
1125 sal_Bool
XMLTextSyncWidthHeightPropHdl_Impl::exportXML(
1126 OUString
& rStrExpValue
,
1128 const SvXMLUnitConverter
& ) const
1130 sal_Bool bRet
= sal_False
;
1131 if( *(sal_Bool
*)rValue
.getValue() )
1133 rStrExpValue
= sValue
;
1140 XMLTextSyncWidthHeightPropHdl_Impl::~XMLTextSyncWidthHeightPropHdl_Impl()
1144 // ---------------------------------------------------------------------------
1146 class XMLTextRotationAnglePropHdl_Impl
: public XMLPropertyHandler
1150 XMLTextRotationAnglePropHdl_Impl() {}
1151 virtual ~XMLTextRotationAnglePropHdl_Impl();
1153 virtual sal_Bool
importXML(
1154 const OUString
& rStrImpValue
,
1155 ::com::sun::star::uno::Any
& rValue
,
1156 const SvXMLUnitConverter
& ) const;
1157 virtual sal_Bool
exportXML(
1158 OUString
& rStrExpValue
,
1159 const ::com::sun::star::uno::Any
& rValue
,
1160 const SvXMLUnitConverter
& ) const;
1163 sal_Bool
XMLTextRotationAnglePropHdl_Impl::importXML(
1164 const OUString
& rStrImpValue
,
1166 const SvXMLUnitConverter
& ) const
1169 bool const bRet
= ::sax::Converter::convertNumber( nValue
, rStrImpValue
);
1172 nValue
= (nValue
% 360 );
1174 nValue
= 360 + nValue
;
1176 if( nValue
< 45 || nValue
> 315 )
1178 else if( nValue
< 180 )
1180 else /* if nValalue <= 315 ) */
1188 sal_Bool
XMLTextRotationAnglePropHdl_Impl::exportXML(
1189 OUString
& rStrExpValue
,
1191 const SvXMLUnitConverter
& ) const
1193 sal_Int16 nAngle
= sal_Int16();
1194 sal_Bool bRet
= ( rValue
>>= nAngle
);
1197 OUStringBuffer aOut
;
1198 ::sax::Converter::convertNumber( aOut
, nAngle
/ 10 );
1199 rStrExpValue
= aOut
.makeStringAndClear();
1201 OSL_ENSURE( bRet
, "illegal rotation angle" );
1206 XMLTextRotationAnglePropHdl_Impl::~XMLTextRotationAnglePropHdl_Impl()
1209 // ---------------------------------------------------------------------------
1210 class XMLNumber8OneBasedHdl
: public XMLPropertyHandler
1214 XMLNumber8OneBasedHdl() {}
1215 virtual ~XMLNumber8OneBasedHdl() {};
1217 virtual sal_Bool
importXML(
1218 const OUString
& rStrImpValue
,
1219 ::com::sun::star::uno::Any
& rValue
,
1220 const SvXMLUnitConverter
& ) const;
1221 virtual sal_Bool
exportXML(
1222 OUString
& rStrExpValue
,
1223 const ::com::sun::star::uno::Any
& rValue
,
1224 const SvXMLUnitConverter
& ) const;
1227 sal_Bool
XMLNumber8OneBasedHdl::importXML(
1228 const OUString
& rStrImpValue
,
1230 const SvXMLUnitConverter
& ) const
1232 sal_Int32 nValue
= 0;
1233 bool const bRet
= ::sax::Converter::convertNumber(nValue
, rStrImpValue
);
1235 rValue
<<= static_cast<sal_Int8
>( nValue
- 1 );
1239 sal_Bool
XMLNumber8OneBasedHdl::exportXML(
1240 OUString
& rStrExpValue
,
1242 const SvXMLUnitConverter
& ) const
1244 sal_Int8 nValue
= sal_Int8();
1245 sal_Bool bRet
= ( rValue
>>= nValue
);
1248 OUStringBuffer aOut
;
1249 ::sax::Converter::convertNumber( aOut
, nValue
+ 1 );
1250 rStrExpValue
= aOut
.makeStringAndClear();
1254 // ---------------------------------------------------------------------------
1255 class XMLTextPropertyHandlerFactory_Impl
1258 const XMLPropertyHandler
*GetPropertyHandler( sal_Int32 nType
) const;
1260 XMLTextPropertyHandlerFactory_Impl();
1261 ~XMLTextPropertyHandlerFactory_Impl();
1264 const XMLPropertyHandler
*XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler
1265 ( sal_Int32 nType
) const
1267 const XMLPropertyHandler
* pHdl
= 0;
1270 case XML_TYPE_TEXT_DROPCAP
:
1271 pHdl
= new XMLDropCapPropHdl_Impl
;
1273 case XML_TYPE_TEXT_WRAP
:
1274 pHdl
= new XMLWrapPropHdl_Impl
;
1276 case XML_TYPE_TEXT_PARAGRAPH_ONLY
:
1277 pHdl
= new XMLParagraphOnlyPropHdl_Impl
;
1279 case XML_TYPE_TEXT_WRAP_OUTSIDE
:
1280 pHdl
= new XMLContourModePropHdl_Impl
;
1282 case XML_TYPE_TEXT_OPAQUE
:
1283 pHdl
= new XMLOpaquePropHdl_Impl
;
1285 case XML_TYPE_TEXT_PROTECT_CONTENT
:
1286 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_CONTENT
);
1288 case XML_TYPE_TEXT_PROTECT_SIZE
:
1289 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_SIZE
);
1291 case XML_TYPE_TEXT_PROTECT_POSITION
:
1292 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_POSITION
);
1294 case XML_TYPE_TEXT_ANCHOR_TYPE
:
1295 pHdl
= new XMLAnchorTypePropHdl
;
1297 case XML_TYPE_TEXT_COLUMNS
:
1298 pHdl
= new XMLTextColumnsPropertyHandler
;
1300 case XML_TYPE_TEXT_HORIZONTAL_POS
:
1301 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriPos_Enum
, XML_TOKEN_INVALID
);
1303 case XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED
:
1304 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriPosMirrored_Enum
, XML_TOKEN_INVALID
);
1306 case XML_TYPE_TEXT_HORIZONTAL_REL
:
1307 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriRel_Enum
, XML_TOKEN_INVALID
);
1309 case XML_TYPE_TEXT_HORIZONTAL_REL_FRAME
:
1310 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriRelFrame_Enum
, XML_TOKEN_INVALID
);
1312 case XML_TYPE_TEXT_HORIZONTAL_MIRROR
:
1313 pHdl
= new XMLHoriMirrorPropHdl_Impl
;
1315 case XML_TYPE_TEXT_VERTICAL_POS
:
1316 pHdl
= new XMLConstantsPropertyHandler( pXML_VertPos_Enum
, XML_TOKEN_INVALID
);
1318 case XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR
:
1319 pHdl
= new XMLConstantsPropertyHandler( pXML_VertPosAtChar_Enum
, XML_TOKEN_INVALID
);
1321 case XML_TYPE_TEXT_VERTICAL_REL
:
1322 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRel_Enum
, XML_TOKEN_INVALID
);
1324 case XML_TYPE_TEXT_VERTICAL_REL_PAGE
:
1325 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelPage_Enum
, XML_TOKEN_INVALID
);
1327 case XML_TYPE_TEXT_VERTICAL_REL_FRAME
:
1328 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelFrame_Enum
, XML_TOKEN_INVALID
);
1330 case XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR
:
1331 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum
, XML_TOKEN_INVALID
);
1333 case XML_TYPE_TEXT_MIRROR_VERTICAL
:
1334 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL
, sal_False
);
1336 case XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT
:
1337 // XML_HORIZONTAL_ON_LEFT_PAGES is replaced by XML_HORIZONTAL_ON_EVEN. (#i49139#)
1338 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_EVEN
, sal_True
);
1340 case XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT
:
1341 // XML_HORIZONTAL_ON_RIGHT_PAGES is replaced by XML_HORIZONTAL_ON_ODD. (#i49139#)
1342 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_ODD
, sal_True
);
1344 case XML_TYPE_TEXT_CLIP
:
1345 pHdl
= new XMLClipPropertyHandler( sal_False
);
1347 case XML_TYPE_TEXT_CLIP11
:
1348 pHdl
= new XMLClipPropertyHandler( sal_True
);
1350 case XML_TYPE_TEXT_EMPHASIZE
:
1351 pHdl
= new XMLTextEmphasizePropHdl_Impl
;
1353 case XML_TYPE_TEXT_COMBINE
:
1354 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LINES
),
1355 GetXMLToken( XML_NONE
) );
1357 case XML_TYPE_TEXT_COMBINE_CHARACTERS
:
1358 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LETTERS
),
1359 GetXMLToken( XML_NONE
) );
1361 case XML_TYPE_TEXT_COMBINECHAR
:
1362 pHdl
= new XMLTextCombineCharPropHdl_Impl
;
1364 case XML_TYPE_TEXT_AUTOSPACE
:
1365 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_IDEOGRAPH_ALPHA
),
1366 GetXMLToken( XML_NONE
) );
1368 case XML_TYPE_TEXT_PUNCTUATION_WRAP
:
1369 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_HANGING
),
1370 GetXMLToken( XML_SIMPLE
) );
1372 case XML_TYPE_TEXT_LINE_BREAK
:
1373 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_STRICT
),
1374 GetXMLToken( XML_NORMAL
) );
1376 case XML_TYPE_TEXT_REL_WIDTH_HEIGHT
:
1377 pHdl
= new XMLTextRelWidthHeightPropHdl_Impl
;
1379 case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT
:
1380 pHdl
= new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE
);
1382 case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN
:
1383 pHdl
= new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN
);
1385 case XML_TYPE_TEXT_RUBY_ADJUST
:
1386 pHdl
= new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum
, XML_TOKEN_INVALID
);
1388 case XML_TYPE_TEXT_FONT_RELIEF
:
1389 pHdl
= new XMLConstantsPropertyHandler( pXML_FontRelief_Enum
, XML_TOKEN_INVALID
);
1391 case XML_TYPE_TEXT_ROTATION_ANGLE
:
1392 pHdl
= new XMLTextRotationAnglePropHdl_Impl
;
1394 case XML_TYPE_TEXT_ROTATION_SCALE
:
1395 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_FIXED
),
1396 GetXMLToken( XML_LINE_HEIGHT
) );
1398 case XML_TYPE_TEXT_VERTICAL_ALIGN
:
1399 pHdl
= new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum
, XML_TOKEN_INVALID
);
1401 case XML_TYPE_TEXT_RUBY_POSITION
:
1402 pHdl
= new XMLNamedBoolPropertyHdl( ::xmloff::token::XML_ABOVE
,
1403 ::xmloff::token::XML_BELOW
);
1405 // OD 2004-05-05 #i28701#
1406 case XML_TYPE_WRAP_INFLUENCE_ON_POSITION
:
1407 pHdl
= new XMLConstantsPropertyHandler( pXML_WrapInfluenceOnPosition_Enum
,
1408 XML_TOKEN_INVALID
);
1410 case XML_TYPE_BORDER_MODEL
:
1411 pHdl
= new XMLNamedBoolPropertyHdl( xmloff::token::XML_COLLAPSING
,
1412 xmloff::token::XML_SEPARATING
);
1414 case XML_TYPE_TEXT_LINE_MODE
:
1415 pHdl
= new XMLNamedBoolPropertyHdl(
1416 ::xmloff::token::XML_SKIP_WHITE_SPACE
,
1417 ::xmloff::token::XML_CONTINUOUS
);
1419 case XML_TYPE_TEXT_KEEP
:
1420 pHdl
= new XMLNamedBoolPropertyHdl(
1421 ::xmloff::token::XML_ALWAYS
,
1422 ::xmloff::token::XML_AUTO
);
1424 case XML_TYPE_TEXT_NKEEP
:
1425 pHdl
= new XMLNamedBoolPropertyHdl(
1426 ::xmloff::token::XML_AUTO
,
1427 ::xmloff::token::XML_ALWAYS
);
1429 case XML_TYPE_TEXT_NUMBER8_ONE_BASED
:
1430 pHdl
= new XMLNumber8OneBasedHdl();
1432 case XML_TYPE_FILLSTYLE
:
1433 pHdl
= new XMLConstantsPropertyHandler( pXML_FillStyle_Enum
, XML_TOKEN_INVALID
);
1440 XMLTextPropertyHandlerFactory_Impl::XMLTextPropertyHandlerFactory_Impl()
1444 XMLTextPropertyHandlerFactory_Impl::~XMLTextPropertyHandlerFactory_Impl()
1448 // ----------------------------------------------------------------------------
1450 XMLTextPropertyHandlerFactory::XMLTextPropertyHandlerFactory() :
1451 XMLPropertyHandlerFactory(),
1452 pImpl( new XMLTextPropertyHandlerFactory_Impl
)
1456 XMLTextPropertyHandlerFactory::~XMLTextPropertyHandlerFactory()
1461 const XMLPropertyHandler
*XMLTextPropertyHandlerFactory::GetPropertyHandler(
1462 sal_Int32 nType
) const
1464 const XMLPropertyHandler
*pHdl
=
1465 XMLPropertyHandlerFactory::GetPropertyHandler( nType
);
1469 const XMLPropertyHandler
*pNewHdl
= pImpl
->GetPropertyHandler( nType
);
1472 PutHdlCache( nType
, pNewHdl
);
1481 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */