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 <osl/diagnose.h>
22 #include <rtl/ustrbuf.hxx>
23 #include <tools/fontenum.hxx>
24 #include <com/sun/star/uno/Any.hxx>
25 #include <com/sun/star/drawing/FillStyle.hpp>
26 #include <com/sun/star/style/DropCapFormat.hpp>
27 #include <com/sun/star/text/FontRelief.hpp>
28 #include <com/sun/star/text/WrapTextMode.hpp>
29 #include <com/sun/star/text/XTextColumns.hpp>
30 #include <com/sun/star/text/TextColumn.hpp>
31 #include <com/sun/star/text/RelOrientation.hpp>
32 #include <com/sun/star/text/HoriOrientation.hpp>
33 #include <com/sun/star/text/VertOrientation.hpp>
34 #include <com/sun/star/text/RubyAdjust.hpp>
35 #include <com/sun/star/text/FontEmphasis.hpp>
36 #include <com/sun/star/text/ParagraphVertAlign.hpp>
37 #include <sax/tools/converter.hxx>
38 #include <xmloff/xmltypes.hxx>
39 #include <xmloff/xmluconv.hxx>
40 #include <xmloff/xmltoken.hxx>
41 #include "XMLAnchorTypePropHdl.hxx"
42 #include <xmloff/XMLConstantsPropertyHandler.hxx>
43 #include "XMLClipPropertyHandler.hxx"
44 #include "XMLTextColumnsPropertyHandler.hxx"
45 #include <xmloff/NamedBoolPropertyHdl.hxx>
46 #include "txtprhdl.hxx"
47 #include <com/sun/star/text/WrapInfluenceOnPosition.hpp>
48 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
51 #include <xmloff/EnumPropertyHdl.hxx>
52 #include "XMLFillBitmapSizePropertyHandler.hxx"
53 #include "XMLBitmapLogicalSizePropertyHandler.hxx"
54 #include <com/sun/star/drawing/RectanglePoint.hpp>
55 #include <com/sun/star/drawing/BitmapMode.hpp>
56 #include "XMLBitmapRepeatOffsetPropertyHandler.hxx"
58 using namespace ::com::sun::star
;
59 using namespace ::com::sun::star::uno
;
60 using namespace ::com::sun::star::style
;
61 using namespace ::com::sun::star::text
;
62 using namespace ::xmloff::token
;
65 using namespace ::com::sun::star::drawing
;
68 extern SvXMLEnumMapEntry aXML_FillStyle_EnumMap
[];
69 extern SvXMLEnumMapEntry aXML_RefPoint_EnumMap
[];
70 extern SvXMLEnumMapEntry aXML_BitmapMode_EnumMap
[];
72 static SvXMLEnumMapEntry
const pXML_HoriPos_Enum
[] =
74 { XML_FROM_LEFT
, HoriOrientation::NONE
},
75 { XML_FROM_INSIDE
, HoriOrientation::NONE
}, // import only
76 { XML_LEFT
, HoriOrientation::LEFT
},
77 { XML_INSIDE
, HoriOrientation::LEFT
}, // import only
78 { XML_CENTER
, HoriOrientation::CENTER
},
79 { XML_RIGHT
, HoriOrientation::RIGHT
},
80 { XML_OUTSIDE
, HoriOrientation::RIGHT
}, // import only
81 { XML_TOKEN_INVALID
, 0 }
84 static SvXMLEnumMapEntry
const pXML_HoriPosMirrored_Enum
[] =
86 { XML_FROM_INSIDE
, HoriOrientation::NONE
},
87 { XML_INSIDE
, HoriOrientation::LEFT
},
88 { XML_CENTER
, HoriOrientation::CENTER
},
89 { XML_OUTSIDE
, HoriOrientation::RIGHT
},
90 { XML_TOKEN_INVALID
, 0 }
93 static SvXMLEnumMapEntry
const pXML_HoriRel_Enum
[] =
95 { XML_PARAGRAPH
, RelOrientation::FRAME
},
96 { XML_PARAGRAPH_CONTENT
, RelOrientation::PRINT_AREA
},
97 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
98 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
99 { XML_PARAGRAPH_START_MARGIN
, RelOrientation::FRAME_LEFT
},
100 { XML_PARAGRAPH_END_MARGIN
, RelOrientation::FRAME_RIGHT
},
101 { XML_PAGE_START_MARGIN
, RelOrientation::PAGE_LEFT
},
102 { XML_PAGE_END_MARGIN
, RelOrientation::PAGE_RIGHT
},
103 { XML_CHAR
, RelOrientation::CHAR
},
104 { XML_FRAME
, RelOrientation::FRAME
}, // import only
105 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
}, // import only
106 { XML_FRAME_START_MARGIN
, RelOrientation::FRAME_LEFT
}, // import only
107 { XML_FRAME_END_MARGIN
, RelOrientation::FRAME_RIGHT
}, // import only
108 { XML_TOKEN_INVALID
, 0 }
111 static SvXMLEnumMapEntry
const pXML_HoriRelFrame_Enum
[] =
113 { XML_FRAME
, RelOrientation::FRAME
},
114 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
},
115 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
116 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
117 { XML_FRAME_START_MARGIN
, RelOrientation::FRAME_LEFT
},
118 { XML_FRAME_END_MARGIN
, RelOrientation::FRAME_RIGHT
},
119 { XML_PAGE_START_MARGIN
, RelOrientation::PAGE_LEFT
},
120 { XML_PAGE_END_MARGIN
, RelOrientation::PAGE_RIGHT
},
121 { XML_CHAR
, RelOrientation::CHAR
},
122 { XML_TOKEN_INVALID
, 0 }
125 static SvXMLEnumMapEntry
const pXML_HoriMirror_Enum
[] =
127 { XML_FROM_LEFT
, sal_uInt16(false) },
128 { XML_FROM_INSIDE
, sal_uInt16(true) },
129 { XML_LEFT
, sal_uInt16(false) },
130 { XML_INSIDE
, sal_uInt16(true) },
131 { XML_CENTER
, sal_uInt16(false) },
132 { XML_RIGHT
, sal_uInt16(false) },
133 { XML_OUTSIDE
, sal_uInt16(true) },
134 { XML_TOKEN_INVALID
, 0 }
137 static SvXMLEnumMapEntry
const pXML_VertPos_Enum
[] =
139 { XML_FROM_TOP
, VertOrientation::NONE
},
140 { XML_TOP
, VertOrientation::TOP
},
141 { XML_TOP
, VertOrientation::CHAR_TOP
}, // export only
142 { XML_TOP
, VertOrientation::LINE_TOP
}, // export only
143 { XML_MIDDLE
, VertOrientation::CENTER
},
144 { XML_MIDDLE
, VertOrientation::CHAR_CENTER
}, // export only
145 { XML_MIDDLE
, VertOrientation::LINE_CENTER
}, // export only
146 { XML_BOTTOM
, VertOrientation::BOTTOM
},
147 { XML_BOTTOM
, VertOrientation::CHAR_BOTTOM
}, // export only
148 { XML_BOTTOM
, VertOrientation::LINE_BOTTOM
}, // export only
149 { XML_BELOW
, VertOrientation::CHAR_BOTTOM
}, // import only
150 { XML_TOKEN_INVALID
, 0 }
153 static SvXMLEnumMapEntry
const pXML_VertPosAtChar_Enum
[] =
155 { XML_FROM_TOP
, VertOrientation::NONE
},
156 { XML_TOP
, VertOrientation::TOP
},
157 { XML_TOP
, VertOrientation::CHAR_TOP
}, // export only
158 { XML_TOP
, VertOrientation::LINE_TOP
}, // export only
159 { XML_MIDDLE
, VertOrientation::CENTER
},
160 { XML_MIDDLE
, VertOrientation::CHAR_CENTER
}, // export only
161 { XML_MIDDLE
, VertOrientation::LINE_CENTER
}, // export only
162 { XML_BOTTOM
, VertOrientation::BOTTOM
},
163 { XML_BELOW
, VertOrientation::CHAR_BOTTOM
}, // export only
164 { XML_BOTTOM
, VertOrientation::LINE_BOTTOM
}, // export only
165 { XML_TOKEN_INVALID
, 0 }
168 static SvXMLEnumMapEntry
const pXML_VertRel_Enum
[] =
170 { XML_PARAGRAPH
, RelOrientation::FRAME
},
171 { XML_PARAGRAPH_CONTENT
, RelOrientation::PRINT_AREA
},
172 { XML_CHAR
, RelOrientation::CHAR
},
173 // DVO, OD 17.09.2003 #i18732# - allow vertical alignment at page
174 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
175 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
176 { XML_FRAME
, RelOrientation::FRAME
}, // import only
177 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
}, // import only
178 // OD 13.11.2003 #i22341# - new vertical alignment at top of line
179 { XML_LINE
, RelOrientation::TEXT_LINE
},
180 { XML_TOKEN_INVALID
, 0 }
183 static SvXMLEnumMapEntry
const pXML_VertRelPage_Enum
[] =
185 { XML_PAGE
, RelOrientation::FRAME
},
186 { XML_PAGE_CONTENT
, RelOrientation::PRINT_AREA
},
187 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
188 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
189 { XML_TOKEN_INVALID
, 0 }
192 static SvXMLEnumMapEntry
const pXML_VertRelFrame_Enum
[] =
194 { XML_FRAME
, RelOrientation::FRAME
},
195 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
},
196 { XML_TOKEN_INVALID
, 0 }
199 static SvXMLEnumMapEntry
const pXML_VertRelAsChar_Enum
[] =
201 { XML_BASELINE
, VertOrientation::TOP
},
202 { XML_BASELINE
, VertOrientation::CENTER
}, // export only
203 { XML_BASELINE
, VertOrientation::BOTTOM
}, // export only
204 { XML_TEXT
, VertOrientation::CHAR_TOP
},
205 { XML_TEXT
, VertOrientation::CHAR_CENTER
}, // export only
206 { XML_TEXT
, VertOrientation::CHAR_BOTTOM
}, // export only
207 { XML_LINE
, VertOrientation::LINE_TOP
},
208 { XML_LINE
, VertOrientation::LINE_CENTER
}, // export only
209 { XML_LINE
, VertOrientation::LINE_BOTTOM
}, // export only
210 { XML_TOKEN_INVALID
, 0 }
213 static SvXMLEnumMapEntry
const pXML_RubyAdjust_Enum
[] =
215 { XML_LEFT
, RubyAdjust_LEFT
},
216 { XML_CENTER
, RubyAdjust_CENTER
},
217 { XML_RIGHT
, RubyAdjust_RIGHT
},
218 { XML_DISTRIBUTE_LETTER
, RubyAdjust_BLOCK
},
219 { XML_DISTRIBUTE_SPACE
, RubyAdjust_INDENT_BLOCK
},
220 { XML_TOKEN_INVALID
, 0 }
223 static SvXMLEnumMapEntry
const pXML_FontRelief_Enum
[] =
225 { XML_NONE
, FontRelief::NONE
},
226 { XML_ENGRAVED
, FontRelief::ENGRAVED
},
227 { XML_EMBOSSED
, FontRelief::EMBOSSED
},
228 { XML_TOKEN_INVALID
, 0 }
231 static SvXMLEnumMapEntry
const pXML_ParaVerticalAlign_Enum
[] =
233 { XML_TOP
, ParagraphVertAlign::TOP
},
234 { XML_MIDDLE
, ParagraphVertAlign::CENTER
},
235 { XML_BOTTOM
, ParagraphVertAlign::BOTTOM
},
236 { XML_BASELINE
, ParagraphVertAlign::BASELINE
},
237 { XML_AUTO
, ParagraphVertAlign::AUTOMATIC
},
238 { XML_TOKEN_INVALID
, 0 }
241 // OD 2004-05-05 #i28701#
242 static SvXMLEnumMapEntry
const pXML_WrapInfluenceOnPosition_Enum
[] =
244 // Tokens have been renamed and <XML_ITERATIVE> has been added (#i35017#)
245 { XML_ONCE_SUCCESSIVE
, WrapInfluenceOnPosition::ONCE_SUCCESSIVE
},
246 { XML_ONCE_CONCURRENT
, WrapInfluenceOnPosition::ONCE_CONCURRENT
},
247 { XML_ITERATIVE
, WrapInfluenceOnPosition::ITERATIVE
},
248 { XML_TOKEN_INVALID
, 0 }
251 static SvXMLEnumMapEntry
const pXML_VerticalAlign_Enum
[] =
253 { XML_TOP
, drawing::TextVerticalAdjust_TOP
},
254 { XML_MIDDLE
, drawing::TextVerticalAdjust_CENTER
},
255 { XML_BOTTOM
, drawing::TextVerticalAdjust_BOTTOM
},
256 { XML_JUSTIFY
, drawing::TextVerticalAdjust_BLOCK
},
257 { XML_TOKEN_INVALID
, 0 }
260 class XMLDropCapPropHdl_Impl
: public XMLPropertyHandler
263 virtual ~XMLDropCapPropHdl_Impl ();
266 const ::com::sun::star::uno::Any
& r1
,
267 const ::com::sun::star::uno::Any
& r2
) const SAL_OVERRIDE
;
269 /// TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place.
270 virtual bool importXML(
271 const OUString
& rStrImpValue
,
272 ::com::sun::star::uno::Any
& rValue
,
273 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
274 virtual bool exportXML(
275 OUString
& rStrExpValue
,
276 const ::com::sun::star::uno::Any
& rValue
,
277 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
280 XMLDropCapPropHdl_Impl::~XMLDropCapPropHdl_Impl ()
284 bool XMLDropCapPropHdl_Impl::equals(
286 const Any
& r2
) const
288 DropCapFormat aFormat1
, aFormat2
;
292 return (aFormat1
.Lines
<=1 && aFormat2
.Lines
<=1) ||
293 (aFormat1
.Lines
== aFormat2
.Lines
&&
294 aFormat1
.Count
== aFormat2
.Count
&&
295 aFormat1
.Distance
== aFormat2
.Distance
);
298 bool XMLDropCapPropHdl_Impl::importXML(
301 const SvXMLUnitConverter
& ) const
303 DBG_ASSERT( false, "drop caps are an element import property" );
307 bool XMLDropCapPropHdl_Impl::exportXML(
310 const SvXMLUnitConverter
& ) const
312 DBG_ASSERT( false, "drop caps are an element export property" );
316 class XMLOpaquePropHdl_Impl
: public XMLPropertyHandler
319 virtual ~XMLOpaquePropHdl_Impl ();
321 virtual bool importXML(
322 const OUString
& rStrImpValue
,
323 ::com::sun::star::uno::Any
& rValue
,
324 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
325 virtual bool exportXML(
326 OUString
& rStrExpValue
,
327 const ::com::sun::star::uno::Any
& rValue
,
328 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
331 bool XMLOpaquePropHdl_Impl::importXML(
332 const OUString
& rStrImpValue
,
334 const SvXMLUnitConverter
& ) const
337 sal_Bool bVal
= sal_False
;
338 if( IsXMLToken( rStrImpValue
, XML_FOREGROUND
) )
340 else if( !IsXMLToken( rStrImpValue
, XML_BACKGROUND
) )
344 rValue
.setValue( &bVal
, cppu::UnoType
<bool>::get() );
349 bool XMLOpaquePropHdl_Impl::exportXML(
350 OUString
& rStrExpValue
,
352 const SvXMLUnitConverter
& ) const
354 if( *static_cast<sal_Bool
const *>(rValue
.getValue()) )
355 rStrExpValue
= GetXMLToken( XML_FOREGROUND
);
357 rStrExpValue
= GetXMLToken( XML_BACKGROUND
);
362 XMLOpaquePropHdl_Impl::~XMLOpaquePropHdl_Impl ()
366 class XMLContourModePropHdl_Impl
: public XMLPropertyHandler
369 virtual ~XMLContourModePropHdl_Impl ();
371 virtual bool importXML(
372 const OUString
& rStrImpValue
,
373 ::com::sun::star::uno::Any
& rValue
,
374 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
375 virtual bool exportXML(
376 OUString
& rStrExpValue
,
377 const ::com::sun::star::uno::Any
& rValue
,
378 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
381 bool XMLContourModePropHdl_Impl::importXML(
382 const OUString
& rStrImpValue
,
384 const SvXMLUnitConverter
& ) const
387 sal_Bool bVal
= sal_False
;
388 if( IsXMLToken( rStrImpValue
, XML_OUTSIDE
) )
390 else if( ! IsXMLToken( rStrImpValue
, XML_FULL
) )
394 rValue
.setValue( &bVal
, cppu::UnoType
<bool>::get() );
399 bool XMLContourModePropHdl_Impl::exportXML(
400 OUString
& rStrExpValue
,
402 const SvXMLUnitConverter
& ) const
404 if( *static_cast<sal_Bool
const *>(rValue
.getValue()) )
405 rStrExpValue
= GetXMLToken( XML_OUTSIDE
);
407 rStrExpValue
= GetXMLToken( XML_FULL
);
412 XMLContourModePropHdl_Impl::~XMLContourModePropHdl_Impl()
416 class XMLParagraphOnlyPropHdl_Impl
: public XMLPropertyHandler
419 virtual ~XMLParagraphOnlyPropHdl_Impl ();
421 virtual bool importXML(
422 const OUString
& rStrImpValue
,
423 ::com::sun::star::uno::Any
& rValue
,
424 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
425 virtual bool exportXML(
426 OUString
& rStrExpValue
,
427 const ::com::sun::star::uno::Any
& rValue
,
428 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
431 bool XMLParagraphOnlyPropHdl_Impl::importXML(
432 const OUString
& rStrImpValue
,
434 const SvXMLUnitConverter
& ) const
437 sal_Bool bVal
= sal_False
;
439 if( ! IsXMLToken( rStrImpValue
, XML_NO_LIMIT
) )
441 sal_Int32 nValue
= 0;
442 bRet
= ::sax::Converter::convertNumber( nValue
, rStrImpValue
);
447 rValue
.setValue( &bVal
, cppu::UnoType
<bool>::get() );
452 bool XMLParagraphOnlyPropHdl_Impl::exportXML(
453 OUString
& rStrExpValue
,
455 const SvXMLUnitConverter
& ) const
457 if( *static_cast<sal_Bool
const *>(rValue
.getValue()) )
458 rStrExpValue
= GetXMLToken( XML_1
);
460 rStrExpValue
= GetXMLToken( XML_NO_LIMIT
);
465 XMLParagraphOnlyPropHdl_Impl::~XMLParagraphOnlyPropHdl_Impl()
469 SvXMLEnumMapEntry
const pXML_Wrap_Enum
[] =
471 { XML_NONE
, WrapTextMode_NONE
},
472 { XML_RUN_THROUGH
, WrapTextMode_THROUGHT
},
473 { XML_PARALLEL
, WrapTextMode_PARALLEL
},
474 { XML_DYNAMIC
, WrapTextMode_DYNAMIC
},
475 { XML_LEFT
, WrapTextMode_LEFT
},
476 { XML_RIGHT
, WrapTextMode_RIGHT
},
477 { XML_TOKEN_INVALID
, 0 }
480 class XMLWrapPropHdl_Impl
: public XMLPropertyHandler
483 virtual ~XMLWrapPropHdl_Impl ();
485 virtual bool importXML(
486 const OUString
& rStrImpValue
,
487 ::com::sun::star::uno::Any
& rValue
,
488 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
489 virtual bool exportXML(
490 OUString
& rStrExpValue
,
491 const ::com::sun::star::uno::Any
& rValue
,
492 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
495 bool XMLWrapPropHdl_Impl::importXML(
496 const OUString
& rStrImpValue
,
498 const SvXMLUnitConverter
& ) const
501 bool bRet
= SvXMLUnitConverter::convertEnum( nWrap
, rStrImpValue
,
505 rValue
<<= (WrapTextMode
)nWrap
;
510 bool XMLWrapPropHdl_Impl::exportXML(
511 OUString
& rStrExpValue
,
513 const SvXMLUnitConverter
& ) const
520 bool bRet
= SvXMLUnitConverter::convertEnum( aOut
, eVal
, pXML_Wrap_Enum
, XML_NONE
);
522 rStrExpValue
= aOut
.makeStringAndClear();
527 XMLWrapPropHdl_Impl::~XMLWrapPropHdl_Impl ()
531 class XMLFrameProtectPropHdl_Impl
: public XMLPropertyHandler
535 XMLFrameProtectPropHdl_Impl( enum XMLTokenEnum eVal
) :
536 sVal( GetXMLToken(eVal
) ) {}
537 virtual ~XMLFrameProtectPropHdl_Impl ();
539 virtual bool importXML(
540 const OUString
& rStrImpValue
,
541 ::com::sun::star::uno::Any
& rValue
,
542 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
543 virtual bool exportXML(
544 OUString
& rStrExpValue
,
545 const ::com::sun::star::uno::Any
& rValue
,
546 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
549 bool XMLFrameProtectPropHdl_Impl::importXML(
550 const OUString
& rStrImpValue
,
552 const SvXMLUnitConverter
& ) const
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
, cppu::UnoType
<bool>::get() );
578 bool XMLFrameProtectPropHdl_Impl::exportXML(
579 OUString
& rStrExpValue
,
581 const SvXMLUnitConverter
& ) const
583 if( *static_cast<sal_Bool
const *>(rValue
.getValue()) )
585 if( rStrExpValue
.isEmpty() ||
586 IsXMLToken( rStrExpValue
, XML_NONE
) )
592 rStrExpValue
= rStrExpValue
+ " " + sVal
;
595 else if( rStrExpValue
.isEmpty() )
597 rStrExpValue
= GetXMLToken( XML_NONE
);
603 XMLFrameProtectPropHdl_Impl::~XMLFrameProtectPropHdl_Impl()
607 SvXMLEnumMapEntry
const pXML_Anchor_Enum
[] =
609 { XML_CHAR
, TextContentAnchorType_AT_CHARACTER
},
610 { XML_PAGE
, TextContentAnchorType_AT_PAGE
},
611 { XML_FRAME
, TextContentAnchorType_AT_FRAME
},
612 { XML_PARAGRAPH
, TextContentAnchorType_AT_PARAGRAPH
},
613 { XML_AS_CHAR
, TextContentAnchorType_AS_CHARACTER
},
614 { XML_TOKEN_INVALID
, 0 }
617 bool XMLAnchorTypePropHdl::importXML(
618 const OUString
& rStrImpValue
,
620 const SvXMLUnitConverter
& ) const
623 bool bRet
= SvXMLUnitConverter::convertEnum( nAnchor
, rStrImpValue
,
627 rValue
<<= (TextContentAnchorType
)nAnchor
;
632 bool XMLAnchorTypePropHdl::exportXML(
633 OUString
& rStrExpValue
,
635 const SvXMLUnitConverter
& ) const
638 TextContentAnchorType eVal
;
642 bool bRet
= SvXMLUnitConverter::convertEnum( aOut
, eVal
, pXML_Anchor_Enum
, XML_PARAGRAPH
);
644 rStrExpValue
= aOut
.makeStringAndClear();
649 XMLAnchorTypePropHdl::~XMLAnchorTypePropHdl()
653 bool XMLAnchorTypePropHdl::convert( const OUString
& rStrImpValue
,
654 TextContentAnchorType
& rType
)
657 bool bRet
= SvXMLUnitConverter::convertEnum( nAnchor
, rStrImpValue
,
660 rType
= (TextContentAnchorType
)nAnchor
;
664 XMLTextColumnsPropertyHandler::~XMLTextColumnsPropertyHandler ()
668 bool XMLTextColumnsPropertyHandler::equals(
670 const Any
& r2
) const
672 Reference
< XTextColumns
> xColumns1
;
675 Reference
< XTextColumns
> xColumns2
;
678 if( xColumns1
->getColumnCount() != xColumns2
->getColumnCount() ||
679 xColumns1
->getReferenceValue() != xColumns2
->getReferenceValue() )
682 Sequence
< TextColumn
> aColumns1
= xColumns1
->getColumns();
683 Sequence
< TextColumn
> aColumns2
= xColumns2
->getColumns();
684 sal_Int32 nCount
= aColumns1
.getLength();
685 if( aColumns2
.getLength() != nCount
)
688 const TextColumn
*pColumns1
= aColumns1
.getArray();
689 const TextColumn
*pColumns2
= aColumns2
.getArray();
693 if( pColumns1
->Width
!= pColumns2
->Width
||
694 pColumns1
->LeftMargin
!= pColumns2
->LeftMargin
||
695 pColumns1
->RightMargin
!= pColumns2
->RightMargin
)
705 bool XMLTextColumnsPropertyHandler::importXML(
708 const SvXMLUnitConverter
& ) const
710 DBG_ASSERT( false, "columns are an element import property" );
714 bool XMLTextColumnsPropertyHandler::exportXML(
717 const SvXMLUnitConverter
& ) const
719 DBG_ASSERT( false, "columns are an element export property" );
723 class XMLHoriMirrorPropHdl_Impl
: public XMLPropertyHandler
726 virtual ~XMLHoriMirrorPropHdl_Impl ();
728 virtual bool importXML(
729 const OUString
& rStrImpValue
,
730 ::com::sun::star::uno::Any
& rValue
,
731 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
732 virtual bool exportXML(
733 OUString
& rStrExpValue
,
734 const ::com::sun::star::uno::Any
& rValue
,
735 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
738 bool XMLHoriMirrorPropHdl_Impl::importXML(
739 const OUString
& rStrImpValue
,
741 const SvXMLUnitConverter
& ) const
743 sal_uInt16 nHoriMirror
;
744 bool bRet
= SvXMLUnitConverter::convertEnum( nHoriMirror
, rStrImpValue
,
745 pXML_HoriMirror_Enum
);
749 sal_Bool bTmp
= nHoriMirror
!= 0;
750 rValue
.setValue( &bTmp
, cppu::UnoType
<bool>::get() );
756 bool XMLHoriMirrorPropHdl_Impl::exportXML(
759 const SvXMLUnitConverter
& ) const
761 DBG_ASSERT( false, "HorMirror properyt shouldn't be exported" );
766 XMLHoriMirrorPropHdl_Impl::~XMLHoriMirrorPropHdl_Impl ()
770 class XMLGrfMirrorPropHdl_Impl
: public XMLPropertyHandler
776 XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal
, bool bH
) :
777 sVal( GetXMLToken( eVal
) ),
779 virtual ~XMLGrfMirrorPropHdl_Impl ();
781 virtual bool importXML(
782 const OUString
& rStrImpValue
,
783 ::com::sun::star::uno::Any
& rValue
,
784 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
785 virtual bool exportXML(
786 OUString
& rStrExpValue
,
787 const ::com::sun::star::uno::Any
& rValue
,
788 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
791 bool XMLGrfMirrorPropHdl_Impl::importXML(
792 const OUString
& rStrImpValue
,
794 const SvXMLUnitConverter
& ) const
797 sal_Bool bVal
= sal_False
;
798 if( ! IsXMLToken( rStrImpValue
, XML_NONE
) )
801 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
803 while( aTokenEnum
.getNextToken( aToken
) )
806 if( aToken
== sVal
||
807 (bHori
&& IsXMLToken( aToken
, XML_HORIZONTAL
) ) )
816 rValue
.setValue( &bVal
, cppu::UnoType
<bool>::get() );
821 bool XMLGrfMirrorPropHdl_Impl::exportXML(
822 OUString
& rStrExpValue
,
824 const SvXMLUnitConverter
& ) const
826 if( *static_cast<sal_Bool
const *>(rValue
.getValue()) )
828 if( rStrExpValue
.isEmpty() ||
829 IsXMLToken( rStrExpValue
, XML_NONE
) )
834 /* XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES
835 are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD.
838 ( IsXMLToken( rStrExpValue
, XML_HORIZONTAL_ON_EVEN
) ||
839 IsXMLToken( rStrExpValue
, XML_HORIZONTAL_ON_ODD
) ))
841 rStrExpValue
= GetXMLToken( XML_HORIZONTAL
);
845 rStrExpValue
= rStrExpValue
+ " " + sVal
;
848 else if( rStrExpValue
.isEmpty() )
850 rStrExpValue
= GetXMLToken( XML_NONE
);
856 XMLGrfMirrorPropHdl_Impl::~XMLGrfMirrorPropHdl_Impl()
860 SvXMLEnumMapEntry
const pXML_Emphasize_Enum
[] =
862 { XML_NONE
, FontEmphasis::NONE
},
863 { XML_DOT
, FontEmphasis::DOT_ABOVE
},
864 { XML_CIRCLE
, FontEmphasis::CIRCLE_ABOVE
},
865 { XML_DISC
, FontEmphasis::DISK_ABOVE
},
866 { XML_ACCENT
, FontEmphasis::ACCENT_ABOVE
},
867 { XML_TOKEN_INVALID
, 0 }
869 class XMLTextEmphasizePropHdl_Impl
: public XMLPropertyHandler
872 XMLTextEmphasizePropHdl_Impl() {}
873 virtual ~XMLTextEmphasizePropHdl_Impl();
875 virtual bool importXML(
876 const OUString
& rStrImpValue
,
877 ::com::sun::star::uno::Any
& rValue
,
878 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
879 virtual bool exportXML(
880 OUString
& rStrExpValue
,
881 const ::com::sun::star::uno::Any
& rValue
,
882 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
885 bool XMLTextEmphasizePropHdl_Impl::importXML(
886 const OUString
& rStrImpValue
,
888 const SvXMLUnitConverter
& ) const
891 sal_uInt16 nVal
= FontEmphasis::NONE
;
893 bool bHasPos
= false, bHasType
= false;
896 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
897 while( aTokenEnum
.getNextToken( aToken
) )
899 if( !bHasPos
&& IsXMLToken( aToken
, XML_ABOVE
) )
904 else if( !bHasPos
&& IsXMLToken( aToken
, XML_BELOW
) )
909 else if( !bHasType
&&
910 SvXMLUnitConverter::convertEnum( nVal
, aToken
,
911 pXML_Emphasize_Enum
))
924 if( FontEmphasis::NONE
!= nVal
&& bBelow
)
926 rValue
<<= (sal_Int16
)nVal
;
932 bool XMLTextEmphasizePropHdl_Impl::exportXML(
933 OUString
& rStrExpValue
,
935 const SvXMLUnitConverter
& ) const
937 OUStringBuffer
aOut( 15 );
939 sal_Int16 nType
= sal_Int16();
940 if( rValue
>>= nType
)
948 bRet
= SvXMLUnitConverter::convertEnum( aOut
, nType
,
955 enum XMLTokenEnum ePos
= bBelow
? XML_BELOW
: XML_ABOVE
;
957 aOut
.append( GetXMLToken(ePos
) );
959 rStrExpValue
= aOut
.makeStringAndClear();
966 XMLTextEmphasizePropHdl_Impl::~XMLTextEmphasizePropHdl_Impl()
970 class XMLTextCombineCharPropHdl_Impl
: public XMLPropertyHandler
973 XMLTextCombineCharPropHdl_Impl() {}
974 virtual ~XMLTextCombineCharPropHdl_Impl();
976 virtual bool importXML(
977 const OUString
& rStrImpValue
,
978 ::com::sun::star::uno::Any
& rValue
,
979 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
980 virtual bool exportXML(
981 OUString
& rStrExpValue
,
982 const ::com::sun::star::uno::Any
& rValue
,
983 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
986 bool XMLTextCombineCharPropHdl_Impl::importXML(
987 const OUString
& rStrImpValue
,
989 const SvXMLUnitConverter
& ) const
991 if( !rStrImpValue
.isEmpty() )
992 rValue
<<= rStrImpValue
.copy( 0, 1 );
994 rValue
<<= rStrImpValue
;
999 bool XMLTextCombineCharPropHdl_Impl::exportXML(
1000 OUString
& rStrExpValue
,
1002 const SvXMLUnitConverter
& ) const
1004 rValue
>>= rStrExpValue
;
1006 // #i114107# attribute of type "character": export only if length is 1
1007 return (1 == rStrExpValue
.getLength());
1010 XMLTextCombineCharPropHdl_Impl::~XMLTextCombineCharPropHdl_Impl()
1014 class XMLTextRelWidthHeightPropHdl_Impl
: public XMLPropertyHandler
1017 XMLTextRelWidthHeightPropHdl_Impl() {}
1018 virtual ~XMLTextRelWidthHeightPropHdl_Impl();
1020 virtual bool importXML(
1021 const OUString
& rStrImpValue
,
1022 ::com::sun::star::uno::Any
& rValue
,
1023 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
1024 virtual bool exportXML(
1025 OUString
& rStrExpValue
,
1026 const ::com::sun::star::uno::Any
& rValue
,
1027 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
1030 bool XMLTextRelWidthHeightPropHdl_Impl::importXML(
1031 const OUString
& rStrImpValue
,
1033 const SvXMLUnitConverter
& ) const
1036 bool const bRet
= ::sax::Converter::convertPercent( nValue
, rStrImpValue
);
1038 rValue
<<= (sal_Int16
)nValue
;
1043 bool XMLTextRelWidthHeightPropHdl_Impl::exportXML(
1044 OUString
& rStrExpValue
,
1046 const SvXMLUnitConverter
& ) const
1049 sal_Int16 nValue
= sal_Int16();
1050 if( (rValue
>>= nValue
) && nValue
> 0 )
1052 OUStringBuffer aOut
;
1053 ::sax::Converter::convertPercent( aOut
, nValue
);
1054 rStrExpValue
= aOut
.makeStringAndClear();
1062 XMLTextRelWidthHeightPropHdl_Impl::~XMLTextRelWidthHeightPropHdl_Impl()
1066 class XMLTextSyncWidthHeightPropHdl_Impl
: public XMLPropertyHandler
1068 const OUString sValue
;
1071 XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue
) :
1072 sValue( GetXMLToken(eValue
) ) {}
1073 virtual ~XMLTextSyncWidthHeightPropHdl_Impl();
1075 virtual bool importXML(
1076 const OUString
& rStrImpValue
,
1077 ::com::sun::star::uno::Any
& rValue
,
1078 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
1079 virtual bool exportXML(
1080 OUString
& rStrExpValue
,
1081 const ::com::sun::star::uno::Any
& rValue
,
1082 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
1085 bool XMLTextSyncWidthHeightPropHdl_Impl::importXML(
1086 const OUString
& rStrImpValue
,
1088 const SvXMLUnitConverter
& ) const
1090 sal_Bool bValue
= (rStrImpValue
== sValue
);
1091 rValue
.setValue( &bValue
, cppu::UnoType
<bool>::get() );
1096 bool XMLTextSyncWidthHeightPropHdl_Impl::exportXML(
1097 OUString
& rStrExpValue
,
1099 const SvXMLUnitConverter
& ) const
1102 if( *static_cast<sal_Bool
const *>(rValue
.getValue()) )
1104 rStrExpValue
= sValue
;
1111 XMLTextSyncWidthHeightPropHdl_Impl::~XMLTextSyncWidthHeightPropHdl_Impl()
1115 class XMLTextRotationAnglePropHdl_Impl
: public XMLPropertyHandler
1119 XMLTextRotationAnglePropHdl_Impl() {}
1120 virtual ~XMLTextRotationAnglePropHdl_Impl();
1122 virtual bool importXML(
1123 const OUString
& rStrImpValue
,
1124 ::com::sun::star::uno::Any
& rValue
,
1125 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
1126 virtual bool exportXML(
1127 OUString
& rStrExpValue
,
1128 const ::com::sun::star::uno::Any
& rValue
,
1129 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
1132 bool XMLTextRotationAnglePropHdl_Impl::importXML(
1133 const OUString
& rStrImpValue
,
1135 const SvXMLUnitConverter
& ) const
1138 bool const bRet
= ::sax::Converter::convertNumber( nValue
, rStrImpValue
);
1141 nValue
= (nValue
% 360 );
1143 nValue
= 360 + nValue
;
1145 if( nValue
< 45 || nValue
> 315 )
1147 else if( nValue
< 180 )
1149 else /* if nValalue <= 315 ) */
1157 bool XMLTextRotationAnglePropHdl_Impl::exportXML(
1158 OUString
& rStrExpValue
,
1160 const SvXMLUnitConverter
& ) const
1162 sal_Int16 nAngle
= sal_Int16();
1163 bool bRet
= ( rValue
>>= nAngle
);
1166 OUStringBuffer aOut
;
1167 ::sax::Converter::convertNumber( aOut
, nAngle
/ 10 );
1168 rStrExpValue
= aOut
.makeStringAndClear();
1170 OSL_ENSURE( bRet
, "illegal rotation angle" );
1175 XMLTextRotationAnglePropHdl_Impl::~XMLTextRotationAnglePropHdl_Impl()
1178 class XMLNumber8OneBasedHdl
: public XMLPropertyHandler
1182 XMLNumber8OneBasedHdl() {}
1183 virtual ~XMLNumber8OneBasedHdl() {};
1185 virtual bool importXML(
1186 const OUString
& rStrImpValue
,
1187 ::com::sun::star::uno::Any
& rValue
,
1188 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
1189 virtual bool exportXML(
1190 OUString
& rStrExpValue
,
1191 const ::com::sun::star::uno::Any
& rValue
,
1192 const SvXMLUnitConverter
& ) const SAL_OVERRIDE
;
1195 bool XMLNumber8OneBasedHdl::importXML(
1196 const OUString
& rStrImpValue
,
1198 const SvXMLUnitConverter
& ) const
1200 sal_Int32 nValue
= 0;
1201 bool const bRet
= ::sax::Converter::convertNumber(nValue
, rStrImpValue
);
1203 rValue
<<= static_cast<sal_Int8
>( nValue
- 1 );
1207 bool XMLNumber8OneBasedHdl::exportXML(
1208 OUString
& rStrExpValue
,
1210 const SvXMLUnitConverter
& ) const
1212 sal_Int8 nValue
= sal_Int8();
1213 bool bRet
= ( rValue
>>= nValue
);
1216 OUStringBuffer aOut
;
1217 ::sax::Converter::convertNumber( aOut
, nValue
+ 1 );
1218 rStrExpValue
= aOut
.makeStringAndClear();
1222 class XMLTextPropertyHandlerFactory_Impl
1225 static const XMLPropertyHandler
*GetPropertyHandler( sal_Int32 nType
);
1227 XMLTextPropertyHandlerFactory_Impl();
1228 ~XMLTextPropertyHandlerFactory_Impl();
1231 const XMLPropertyHandler
*XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler
1234 const XMLPropertyHandler
* pHdl
= 0;
1237 case XML_TYPE_TEXT_DROPCAP
:
1238 pHdl
= new XMLDropCapPropHdl_Impl
;
1240 case XML_TYPE_TEXT_WRAP
:
1241 pHdl
= new XMLWrapPropHdl_Impl
;
1243 case XML_TYPE_TEXT_PARAGRAPH_ONLY
:
1244 pHdl
= new XMLParagraphOnlyPropHdl_Impl
;
1246 case XML_TYPE_TEXT_WRAP_OUTSIDE
:
1247 pHdl
= new XMLContourModePropHdl_Impl
;
1249 case XML_TYPE_TEXT_OPAQUE
:
1250 pHdl
= new XMLOpaquePropHdl_Impl
;
1252 case XML_TYPE_TEXT_PROTECT_CONTENT
:
1253 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_CONTENT
);
1255 case XML_TYPE_TEXT_PROTECT_SIZE
:
1256 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_SIZE
);
1258 case XML_TYPE_TEXT_PROTECT_POSITION
:
1259 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_POSITION
);
1261 case XML_TYPE_TEXT_ANCHOR_TYPE
:
1262 pHdl
= new XMLAnchorTypePropHdl
;
1264 case XML_TYPE_TEXT_COLUMNS
:
1265 pHdl
= new XMLTextColumnsPropertyHandler
;
1267 case XML_TYPE_TEXT_HORIZONTAL_POS
:
1268 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriPos_Enum
, XML_TOKEN_INVALID
);
1270 case XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED
:
1271 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriPosMirrored_Enum
, XML_TOKEN_INVALID
);
1273 case XML_TYPE_TEXT_HORIZONTAL_REL
:
1274 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriRel_Enum
, XML_TOKEN_INVALID
);
1276 case XML_TYPE_TEXT_HORIZONTAL_REL_FRAME
:
1277 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriRelFrame_Enum
, XML_TOKEN_INVALID
);
1279 case XML_TYPE_TEXT_HORIZONTAL_MIRROR
:
1280 pHdl
= new XMLHoriMirrorPropHdl_Impl
;
1282 case XML_TYPE_TEXT_VERTICAL_POS
:
1283 pHdl
= new XMLConstantsPropertyHandler( pXML_VertPos_Enum
, XML_TOKEN_INVALID
);
1285 case XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR
:
1286 pHdl
= new XMLConstantsPropertyHandler( pXML_VertPosAtChar_Enum
, XML_TOKEN_INVALID
);
1288 case XML_TYPE_TEXT_VERTICAL_REL
:
1289 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRel_Enum
, XML_TOKEN_INVALID
);
1291 case XML_TYPE_TEXT_VERTICAL_REL_PAGE
:
1292 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelPage_Enum
, XML_TOKEN_INVALID
);
1294 case XML_TYPE_TEXT_VERTICAL_REL_FRAME
:
1295 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelFrame_Enum
, XML_TOKEN_INVALID
);
1297 case XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR
:
1298 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum
, XML_TOKEN_INVALID
);
1300 case XML_TYPE_TEXT_MIRROR_VERTICAL
:
1301 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL
, false );
1303 case XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT
:
1304 // XML_HORIZONTAL_ON_LEFT_PAGES is replaced by XML_HORIZONTAL_ON_EVEN. (#i49139#)
1305 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_EVEN
, true );
1307 case XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT
:
1308 // XML_HORIZONTAL_ON_RIGHT_PAGES is replaced by XML_HORIZONTAL_ON_ODD. (#i49139#)
1309 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_ODD
, true );
1311 case XML_TYPE_TEXT_CLIP
:
1312 pHdl
= new XMLClipPropertyHandler( false );
1314 case XML_TYPE_TEXT_CLIP11
:
1315 pHdl
= new XMLClipPropertyHandler( true );
1317 case XML_TYPE_TEXT_EMPHASIZE
:
1318 pHdl
= new XMLTextEmphasizePropHdl_Impl
;
1320 case XML_TYPE_TEXT_COMBINE
:
1321 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LINES
),
1322 GetXMLToken( XML_NONE
) );
1324 case XML_TYPE_TEXT_COMBINE_CHARACTERS
:
1325 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LETTERS
),
1326 GetXMLToken( XML_NONE
) );
1328 case XML_TYPE_TEXT_COMBINECHAR
:
1329 pHdl
= new XMLTextCombineCharPropHdl_Impl
;
1331 case XML_TYPE_TEXT_AUTOSPACE
:
1332 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_IDEOGRAPH_ALPHA
),
1333 GetXMLToken( XML_NONE
) );
1335 case XML_TYPE_TEXT_PUNCTUATION_WRAP
:
1336 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_HANGING
),
1337 GetXMLToken( XML_SIMPLE
) );
1339 case XML_TYPE_TEXT_LINE_BREAK
:
1340 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_STRICT
),
1341 GetXMLToken( XML_NORMAL
) );
1343 case XML_TYPE_TEXT_REL_WIDTH_HEIGHT
:
1344 pHdl
= new XMLTextRelWidthHeightPropHdl_Impl
;
1346 case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT
:
1347 pHdl
= new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE
);
1349 case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN
:
1350 pHdl
= new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN
);
1352 case XML_TYPE_TEXT_RUBY_ADJUST
:
1353 pHdl
= new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum
, XML_TOKEN_INVALID
);
1355 case XML_TYPE_TEXT_FONT_RELIEF
:
1356 pHdl
= new XMLConstantsPropertyHandler( pXML_FontRelief_Enum
, XML_TOKEN_INVALID
);
1358 case XML_TYPE_TEXT_ROTATION_ANGLE
:
1359 pHdl
= new XMLTextRotationAnglePropHdl_Impl
;
1361 case XML_TYPE_TEXT_ROTATION_SCALE
:
1362 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_FIXED
),
1363 GetXMLToken( XML_LINE_HEIGHT
) );
1365 case XML_TYPE_TEXT_VERTICAL_ALIGN
:
1366 pHdl
= new XMLConstantsPropertyHandler( pXML_ParaVerticalAlign_Enum
, XML_TOKEN_INVALID
);
1368 case XML_TYPE_TEXT_RUBY_POSITION
:
1369 pHdl
= new XMLNamedBoolPropertyHdl( ::xmloff::token::XML_ABOVE
,
1370 ::xmloff::token::XML_BELOW
);
1372 // OD 2004-05-05 #i28701#
1373 case XML_TYPE_WRAP_INFLUENCE_ON_POSITION
:
1374 pHdl
= new XMLConstantsPropertyHandler( pXML_WrapInfluenceOnPosition_Enum
,
1375 XML_TOKEN_INVALID
);
1377 case XML_TYPE_BORDER_MODEL
:
1378 pHdl
= new XMLNamedBoolPropertyHdl( xmloff::token::XML_COLLAPSING
,
1379 xmloff::token::XML_SEPARATING
);
1381 case XML_TYPE_TEXT_LINE_MODE
:
1382 pHdl
= new XMLNamedBoolPropertyHdl(
1383 ::xmloff::token::XML_SKIP_WHITE_SPACE
,
1384 ::xmloff::token::XML_CONTINUOUS
);
1386 case XML_TYPE_TEXT_KEEP
:
1387 pHdl
= new XMLNamedBoolPropertyHdl(
1388 ::xmloff::token::XML_ALWAYS
,
1389 ::xmloff::token::XML_AUTO
);
1391 case XML_TYPE_TEXT_NKEEP
:
1392 pHdl
= new XMLNamedBoolPropertyHdl(
1393 ::xmloff::token::XML_AUTO
,
1394 ::xmloff::token::XML_ALWAYS
);
1396 case XML_TYPE_TEXT_NUMBER8_ONE_BASED
:
1397 pHdl
= new XMLNumber8OneBasedHdl();
1399 case XML_TYPE_VERTICAL_ALIGN
:
1400 pHdl
= new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum
, XML_TOKEN_INVALID
);
1404 case XML_SW_TYPE_FILLSTYLE
:
1405 pHdl
= new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap
, cppu::UnoType
<FillStyle
>::get());
1407 case XML_SW_TYPE_FILLBITMAPSIZE
:
1408 pHdl
= new XMLFillBitmapSizePropertyHandler();
1410 case XML_SW_TYPE_LOGICAL_SIZE
:
1411 pHdl
= new XMLBitmapLogicalSizePropertyHandler();
1413 case XML_SW_TYPE_BITMAP_REFPOINT
:
1414 pHdl
= new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap
, cppu::UnoType
<RectanglePoint
>::get());
1416 case XML_SW_TYPE_BITMAP_MODE
:
1417 pHdl
= new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap
, cppu::UnoType
<BitmapMode
>::get());
1419 case XML_SW_TYPE_BITMAPREPOFFSETX
:
1420 case XML_SW_TYPE_BITMAPREPOFFSETY
:
1421 pHdl
= new XMLBitmapRepeatOffsetPropertyHandler(XML_SW_TYPE_BITMAPREPOFFSETX
== nType
);
1427 OSL_ENSURE(false, "XMLPropertyHandler missing (!)");
1435 XMLTextPropertyHandlerFactory_Impl::XMLTextPropertyHandlerFactory_Impl()
1439 XMLTextPropertyHandlerFactory_Impl::~XMLTextPropertyHandlerFactory_Impl()
1443 XMLTextPropertyHandlerFactory::XMLTextPropertyHandlerFactory() :
1444 XMLPropertyHandlerFactory(),
1445 pImpl( new XMLTextPropertyHandlerFactory_Impl
)
1449 XMLTextPropertyHandlerFactory::~XMLTextPropertyHandlerFactory()
1454 const XMLPropertyHandler
*XMLTextPropertyHandlerFactory::GetPropertyHandler(
1455 sal_Int32 nType
) const
1457 const XMLPropertyHandler
*pHdl
=
1458 XMLPropertyHandlerFactory::GetPropertyHandler( nType
);
1462 const XMLPropertyHandler
*pNewHdl
= XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler( nType
);
1465 PutHdlCache( nType
, pNewHdl
);
1473 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */