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 <sal/config.h>
22 #include <o3tl/any.hxx>
23 #include <osl/diagnose.h>
24 #include <rtl/ustrbuf.hxx>
25 #include <sal/log.hxx>
26 #include <com/sun/star/uno/Any.hxx>
27 #include <com/sun/star/style/DropCapFormat.hpp>
28 #include <com/sun/star/text/FontRelief.hpp>
29 #include <com/sun/star/text/WrapTextMode.hpp>
30 #include <com/sun/star/text/XTextColumns.hpp>
31 #include <com/sun/star/text/TextColumn.hpp>
32 #include <com/sun/star/text/RelOrientation.hpp>
33 #include <com/sun/star/text/HoriOrientation.hpp>
34 #include <com/sun/star/text/VertOrientation.hpp>
35 #include <com/sun/star/text/RubyAdjust.hpp>
36 #include <com/sun/star/text/RubyPosition.hpp>
37 #include <com/sun/star/text/FontEmphasis.hpp>
38 #include <com/sun/star/text/ParagraphHyphenationKeepType.hpp>
39 #include <com/sun/star/text/ParagraphVertAlign.hpp>
40 #include <com/sun/star/graphic/XGraphic.hpp>
41 #include <sax/tools/converter.hxx>
42 #include <xmloff/xmltypes.hxx>
43 #include <xmloff/xmluconv.hxx>
44 #include <xmloff/xmltoken.hxx>
45 #include <xmloff/xmlement.hxx>
46 #include "XMLAnchorTypePropHdl.hxx"
47 #include <enummaps.hxx>
48 #include <xmloff/XMLConstantsPropertyHandler.hxx>
49 #include <XMLClipPropertyHandler.hxx>
50 #include <XMLTextColumnsPropertyHandler.hxx>
51 #include <xmloff/NamedBoolPropertyHdl.hxx>
52 #include "txtprhdl.hxx"
53 #include <com/sun/star/text/WrapInfluenceOnPosition.hpp>
54 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
55 #include <xmloff/EnumPropertyHdl.hxx>
56 #include <XMLFillBitmapSizePropertyHandler.hxx>
57 #include <XMLBitmapLogicalSizePropertyHandler.hxx>
58 #include <XMLBitmapRepeatOffsetPropertyHandler.hxx>
59 #include <xmloff/XMLComplexColorHandler.hxx>
60 #include <vcl/graph.hxx>
62 using namespace ::com::sun::star
;
63 using namespace ::com::sun::star::uno
;
64 using namespace ::com::sun::star::style
;
65 using namespace ::com::sun::star::text
;
66 using namespace ::xmloff::token
;
67 using namespace ::com::sun::star::drawing
;
69 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_HoriPos_Enum
[] =
71 { XML_FROM_LEFT
, HoriOrientation::NONE
},
72 { XML_FROM_INSIDE
, HoriOrientation::NONE
}, // import only
73 { XML_LEFT
, HoriOrientation::LEFT
},
74 { XML_INSIDE
, HoriOrientation::LEFT
}, // import only
75 { XML_CENTER
, HoriOrientation::CENTER
},
76 { XML_RIGHT
, HoriOrientation::RIGHT
},
77 { XML_OUTSIDE
, HoriOrientation::RIGHT
}, // import only
78 { XML_TOKEN_INVALID
, 0 }
81 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_HoriPosMirrored_Enum
[] =
83 { XML_FROM_INSIDE
, HoriOrientation::NONE
},
84 { XML_INSIDE
, HoriOrientation::LEFT
},
85 { XML_CENTER
, HoriOrientation::CENTER
},
86 { XML_OUTSIDE
, HoriOrientation::RIGHT
},
87 { XML_TOKEN_INVALID
, 0 }
90 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_HoriRel_Enum
[] =
92 { XML_PARAGRAPH
, RelOrientation::FRAME
},
93 { XML_PARAGRAPH_CONTENT
, RelOrientation::PRINT_AREA
},
94 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
95 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
96 { XML_PARAGRAPH_START_MARGIN
, RelOrientation::FRAME_LEFT
},
97 { XML_PARAGRAPH_END_MARGIN
, RelOrientation::FRAME_RIGHT
},
98 { XML_PAGE_START_MARGIN
, RelOrientation::PAGE_LEFT
},
99 { XML_PAGE_END_MARGIN
, RelOrientation::PAGE_RIGHT
},
100 { XML_CHAR
, RelOrientation::CHAR
},
101 { XML_FRAME
, RelOrientation::FRAME
}, // import only
102 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
}, // import only
103 { XML_FRAME_START_MARGIN
, RelOrientation::FRAME_LEFT
}, // import only
104 { XML_FRAME_END_MARGIN
, RelOrientation::FRAME_RIGHT
}, // import only
105 { XML_TOKEN_INVALID
, 0 }
108 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_HoriRelFrame_Enum
[] =
110 { XML_FRAME
, RelOrientation::FRAME
},
111 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
},
112 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
113 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
114 { XML_FRAME_START_MARGIN
, RelOrientation::FRAME_LEFT
},
115 { XML_FRAME_END_MARGIN
, RelOrientation::FRAME_RIGHT
},
116 { XML_PAGE_START_MARGIN
, RelOrientation::PAGE_LEFT
},
117 { XML_PAGE_END_MARGIN
, RelOrientation::PAGE_RIGHT
},
118 { XML_CHAR
, RelOrientation::CHAR
},
119 { XML_TOKEN_INVALID
, 0 }
122 SvXMLEnumMapEntry
<bool> const pXML_HoriMirror_Enum
[] =
124 { XML_FROM_LEFT
, false },
125 { XML_FROM_INSIDE
, true },
127 { XML_INSIDE
, true },
128 { XML_CENTER
, false },
129 { XML_RIGHT
, false },
130 { XML_OUTSIDE
, true },
131 { XML_TOKEN_INVALID
, false }
134 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_VertPosAtChar_Enum
[] =
136 { XML_FROM_TOP
, VertOrientation::NONE
},
137 { XML_TOP
, VertOrientation::TOP
},
138 { XML_TOP
, VertOrientation::CHAR_TOP
}, // export only
139 { XML_TOP
, VertOrientation::LINE_TOP
}, // export only
140 { XML_MIDDLE
, VertOrientation::CENTER
},
141 { XML_MIDDLE
, VertOrientation::CHAR_CENTER
}, // export only
142 { XML_MIDDLE
, VertOrientation::LINE_CENTER
}, // export only
143 { XML_BOTTOM
, VertOrientation::BOTTOM
},
144 { XML_BELOW
, VertOrientation::CHAR_BOTTOM
}, // export only
145 { XML_BOTTOM
, VertOrientation::LINE_BOTTOM
}, // export only
146 { XML_TOKEN_INVALID
, 0 }
149 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_VertRel_Enum
[] =
151 { XML_PARAGRAPH
, RelOrientation::FRAME
},
152 { XML_PARAGRAPH_CONTENT
, RelOrientation::PRINT_AREA
},
153 { XML_CHAR
, RelOrientation::CHAR
},
154 // DVO, OD 17.09.2003 #i18732# - allow vertical alignment at page
155 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
156 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
157 { XML_PAGE_CONTENT_TOP
, RelOrientation::PAGE_PRINT_AREA_TOP
},
158 { XML_PAGE_CONTENT_BOTTOM
, RelOrientation::PAGE_PRINT_AREA_BOTTOM
},
159 { XML_FRAME
, RelOrientation::FRAME
}, // import only
160 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
}, // import only
161 // OD 13.11.2003 #i22341# - new vertical alignment at top of line
162 { XML_LINE
, RelOrientation::TEXT_LINE
},
163 { XML_TOKEN_INVALID
, 0 }
166 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_VertRelPage_Enum
[] =
168 { XML_PAGE
, RelOrientation::FRAME
},
169 { XML_PAGE_CONTENT
, RelOrientation::PRINT_AREA
},
170 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
171 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
172 { XML_PAGE_CONTENT_TOP
, RelOrientation::PAGE_PRINT_AREA_TOP
},
173 { XML_PAGE_CONTENT_BOTTOM
, RelOrientation::PAGE_PRINT_AREA_BOTTOM
},
174 { XML_TOKEN_INVALID
, 0 }
177 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_VertRelFrame_Enum
[] =
179 { XML_FRAME
, RelOrientation::FRAME
},
180 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
},
181 { XML_TOKEN_INVALID
, 0 }
184 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_VertRelAsChar_Enum
[] =
186 { XML_BASELINE
, VertOrientation::TOP
},
187 { XML_BASELINE
, VertOrientation::CENTER
}, // export only
188 { XML_BASELINE
, VertOrientation::BOTTOM
}, // export only
189 { XML_TEXT
, VertOrientation::CHAR_TOP
},
190 { XML_TEXT
, VertOrientation::CHAR_CENTER
}, // export only
191 { XML_TEXT
, VertOrientation::CHAR_BOTTOM
}, // export only
192 { XML_LINE
, VertOrientation::LINE_TOP
},
193 { XML_LINE
, VertOrientation::LINE_CENTER
}, // export only
194 { XML_LINE
, VertOrientation::LINE_BOTTOM
}, // export only
195 { XML_TOKEN_INVALID
, 0 }
198 SvXMLEnumMapEntry
<RubyAdjust
> const pXML_RubyAdjust_Enum
[] =
200 { XML_LEFT
, RubyAdjust_LEFT
},
201 { XML_CENTER
, RubyAdjust_CENTER
},
202 { XML_RIGHT
, RubyAdjust_RIGHT
},
203 { XML_DISTRIBUTE_LETTER
, RubyAdjust_BLOCK
},
204 { XML_DISTRIBUTE_SPACE
, RubyAdjust_INDENT_BLOCK
},
205 { XML_TOKEN_INVALID
, RubyAdjust(0) }
208 SvXMLEnumMapEntry
<sal_Int16
> const pXML_RubyPosition_Enum
[] =
210 { XML_ABOVE
, RubyPosition::ABOVE
},
211 { XML_BELOW
, RubyPosition::BELOW
},
212 { XML_INTER_CHARACTER
, RubyPosition::INTER_CHARACTER
},
213 { XML_TOKEN_INVALID
, 0 }
216 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_FontRelief_Enum
[] =
218 { XML_NONE
, FontRelief::NONE
},
219 { XML_ENGRAVED
, FontRelief::ENGRAVED
},
220 { XML_EMBOSSED
, FontRelief::EMBOSSED
},
221 { XML_TOKEN_INVALID
, 0 }
224 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_ParaVerticalAlign_Enum
[] =
226 { XML_TOP
, ParagraphVertAlign::TOP
},
227 { XML_MIDDLE
, ParagraphVertAlign::CENTER
},
228 { XML_BOTTOM
, ParagraphVertAlign::BOTTOM
},
229 { XML_BASELINE
, ParagraphVertAlign::BASELINE
},
230 { XML_AUTO
, ParagraphVertAlign::AUTOMATIC
},
231 { XML_TOKEN_INVALID
, 0 }
234 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_ParaHyphenationKeepType_Enum
[] =
236 { XML_ALWAYS
, ParagraphHyphenationKeepType::ALWAYS
},
237 { XML_AUTO
, ParagraphHyphenationKeepType::AUTO
},
238 { XML_COLUMN
, ParagraphHyphenationKeepType::COLUMN
},
239 { XML_PAGE
, ParagraphHyphenationKeepType::PAGE
},
240 { XML_SPREAD
, ParagraphHyphenationKeepType::SPREAD
},
241 { XML_TOKEN_INVALID
, 0 }
244 // OD 2004-05-05 #i28701#
245 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_WrapInfluenceOnPosition_Enum
[] =
247 // Tokens have been renamed and <XML_ITERATIVE> has been added (#i35017#)
248 { XML_ONCE_SUCCESSIVE
, WrapInfluenceOnPosition::ONCE_SUCCESSIVE
},
249 { XML_ONCE_CONCURRENT
, WrapInfluenceOnPosition::ONCE_CONCURRENT
},
250 { XML_ITERATIVE
, WrapInfluenceOnPosition::ITERATIVE
},
251 { XML_TOKEN_INVALID
, 0 }
254 SvXMLEnumMapEntry
<drawing::TextVerticalAdjust
> const pXML_VerticalAlign_Enum
[] =
256 { XML_TOP
, drawing::TextVerticalAdjust_TOP
},
257 { XML_MIDDLE
, drawing::TextVerticalAdjust_CENTER
},
258 { XML_BOTTOM
, drawing::TextVerticalAdjust_BOTTOM
},
259 { XML_JUSTIFY
, drawing::TextVerticalAdjust_BLOCK
},
260 { XML_TOKEN_INVALID
, drawing::TextVerticalAdjust(0) }
265 class XMLDropCapPropHdl_Impl
: public XMLPropertyHandler
269 const css::uno::Any
& r1
,
270 const css::uno::Any
& r2
) const override
;
272 /// TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place.
273 virtual bool importXML(
274 const OUString
& rStrImpValue
,
275 css::uno::Any
& rValue
,
276 const SvXMLUnitConverter
& ) const override
;
277 virtual bool exportXML(
278 OUString
& rStrExpValue
,
279 const css::uno::Any
& rValue
,
280 const SvXMLUnitConverter
& ) const override
;
285 bool XMLDropCapPropHdl_Impl::equals(
287 const Any
& r2
) const
289 DropCapFormat aFormat1
, aFormat2
;
293 return (aFormat1
.Lines
<=1 && aFormat2
.Lines
<=1) ||
294 (aFormat1
.Lines
== aFormat2
.Lines
&&
295 aFormat1
.Count
== aFormat2
.Count
&&
296 aFormat1
.Distance
== aFormat2
.Distance
);
299 bool XMLDropCapPropHdl_Impl::importXML(
302 const SvXMLUnitConverter
& ) const
304 SAL_WARN( "xmloff", "drop caps are an element import property" );
308 bool XMLDropCapPropHdl_Impl::exportXML(
311 const SvXMLUnitConverter
& ) const
313 SAL_WARN( "xmloff", "drop caps are an element export property" );
319 class XMLOpaquePropHdl_Impl
: public XMLPropertyHandler
322 virtual bool importXML(
323 const OUString
& rStrImpValue
,
324 css::uno::Any
& rValue
,
325 const SvXMLUnitConverter
& ) const override
;
326 virtual bool exportXML(
327 OUString
& rStrExpValue
,
328 const css::uno::Any
& rValue
,
329 const SvXMLUnitConverter
& ) const override
;
334 bool XMLOpaquePropHdl_Impl::importXML(
335 const OUString
& rStrImpValue
,
337 const SvXMLUnitConverter
& ) const
341 if( IsXMLToken( rStrImpValue
, XML_FOREGROUND
) )
343 else if( !IsXMLToken( rStrImpValue
, XML_BACKGROUND
) )
352 bool XMLOpaquePropHdl_Impl::exportXML(
353 OUString
& rStrExpValue
,
355 const SvXMLUnitConverter
& ) const
357 if( *o3tl::doAccess
<bool>(rValue
) )
358 rStrExpValue
= GetXMLToken( XML_FOREGROUND
);
360 rStrExpValue
= GetXMLToken( XML_BACKGROUND
);
367 class XMLContourModePropHdl_Impl
: public XMLPropertyHandler
370 virtual bool importXML(
371 const OUString
& rStrImpValue
,
372 css::uno::Any
& rValue
,
373 const SvXMLUnitConverter
& ) const override
;
374 virtual bool exportXML(
375 OUString
& rStrExpValue
,
376 const css::uno::Any
& rValue
,
377 const SvXMLUnitConverter
& ) const override
;
382 bool XMLContourModePropHdl_Impl::importXML(
383 const OUString
& rStrImpValue
,
385 const SvXMLUnitConverter
& ) const
389 if( IsXMLToken( rStrImpValue
, XML_OUTSIDE
) )
391 else if( ! IsXMLToken( rStrImpValue
, XML_FULL
) )
400 bool XMLContourModePropHdl_Impl::exportXML(
401 OUString
& rStrExpValue
,
403 const SvXMLUnitConverter
& ) const
405 if( *o3tl::doAccess
<bool>(rValue
) )
406 rStrExpValue
= GetXMLToken( XML_OUTSIDE
);
408 rStrExpValue
= GetXMLToken( XML_FULL
);
415 class XMLParagraphOnlyPropHdl_Impl
: public XMLPropertyHandler
418 virtual bool importXML(
419 const OUString
& rStrImpValue
,
420 css::uno::Any
& rValue
,
421 const SvXMLUnitConverter
& ) const override
;
422 virtual bool exportXML(
423 OUString
& rStrExpValue
,
424 const css::uno::Any
& rValue
,
425 const SvXMLUnitConverter
& ) const override
;
430 bool XMLParagraphOnlyPropHdl_Impl::importXML(
431 const OUString
& rStrImpValue
,
433 const SvXMLUnitConverter
& ) const
438 if( ! IsXMLToken( rStrImpValue
, XML_NO_LIMIT
) )
440 sal_Int32 nValue
= 0;
441 bRet
= ::sax::Converter::convertNumber( nValue
, rStrImpValue
);
451 bool XMLParagraphOnlyPropHdl_Impl::exportXML(
452 OUString
& rStrExpValue
,
454 const SvXMLUnitConverter
& ) const
456 if( *o3tl::doAccess
<bool>(rValue
) )
457 rStrExpValue
= GetXMLToken( XML_1
);
459 rStrExpValue
= GetXMLToken( XML_NO_LIMIT
);
464 SvXMLEnumMapEntry
<WrapTextMode
> const pXML_Wrap_Enum
[] =
466 { XML_NONE
, WrapTextMode_NONE
},
467 { XML_RUN_THROUGH
, WrapTextMode_THROUGH
},
468 { XML_PARALLEL
, WrapTextMode_PARALLEL
},
469 { XML_DYNAMIC
, WrapTextMode_DYNAMIC
},
470 { XML_LEFT
, WrapTextMode_LEFT
},
471 { XML_RIGHT
, WrapTextMode_RIGHT
},
472 { XML_TOKEN_INVALID
, WrapTextMode(0) }
477 class XMLWrapPropHdl_Impl
: public XMLPropertyHandler
480 virtual bool importXML(
481 const OUString
& rStrImpValue
,
482 css::uno::Any
& rValue
,
483 const SvXMLUnitConverter
& ) const override
;
484 virtual bool exportXML(
485 OUString
& rStrExpValue
,
486 const css::uno::Any
& rValue
,
487 const SvXMLUnitConverter
& ) const override
;
492 bool XMLWrapPropHdl_Impl::importXML(
493 const OUString
& rStrImpValue
,
495 const SvXMLUnitConverter
& ) const
498 bool bRet
= SvXMLUnitConverter::convertEnum( nWrap
, rStrImpValue
,
507 bool XMLWrapPropHdl_Impl::exportXML(
508 OUString
& rStrExpValue
,
510 const SvXMLUnitConverter
& ) const
517 bool bRet
= SvXMLUnitConverter::convertEnum( aOut
, eVal
, pXML_Wrap_Enum
, XML_NONE
);
519 rStrExpValue
= aOut
.makeStringAndClear();
526 class XMLFrameProtectPropHdl_Impl
: public XMLPropertyHandler
530 explicit XMLFrameProtectPropHdl_Impl( enum XMLTokenEnum eVal
) :
531 sVal( GetXMLToken(eVal
) ) {}
533 virtual bool importXML(
534 const OUString
& rStrImpValue
,
535 css::uno::Any
& rValue
,
536 const SvXMLUnitConverter
& ) const override
;
537 virtual bool exportXML(
538 OUString
& rStrExpValue
,
539 const css::uno::Any
& rValue
,
540 const SvXMLUnitConverter
& ) const override
;
545 bool XMLFrameProtectPropHdl_Impl::importXML(
546 const OUString
& rStrImpValue
,
548 const SvXMLUnitConverter
& ) const
552 if( ! IsXMLToken( rStrImpValue
, XML_NONE
) )
555 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
556 std::u16string_view aToken
;
557 while( aTokenEnum
.getNextToken( aToken
) )
574 bool XMLFrameProtectPropHdl_Impl::exportXML(
575 OUString
& rStrExpValue
,
577 const SvXMLUnitConverter
& ) const
579 if( *o3tl::doAccess
<bool>(rValue
) )
581 if( rStrExpValue
.isEmpty() ||
582 IsXMLToken( rStrExpValue
, XML_NONE
) )
588 rStrExpValue
+= " " + sVal
;
591 else if( rStrExpValue
.isEmpty() )
593 rStrExpValue
= GetXMLToken( XML_NONE
);
599 SvXMLEnumMapEntry
<TextContentAnchorType
> const pXML_Anchor_Enum
[] =
601 { XML_CHAR
, TextContentAnchorType_AT_CHARACTER
},
602 { XML_PAGE
, TextContentAnchorType_AT_PAGE
},
603 { XML_FRAME
, TextContentAnchorType_AT_FRAME
},
604 { XML_PARAGRAPH
, TextContentAnchorType_AT_PARAGRAPH
},
605 { XML_AS_CHAR
, TextContentAnchorType_AS_CHARACTER
},
606 { XML_TOKEN_INVALID
, TextContentAnchorType(0) }
609 bool XMLAnchorTypePropHdl::importXML(
610 const OUString
& rStrImpValue
,
612 const SvXMLUnitConverter
& ) const
614 TextContentAnchorType nAnchor
;
615 bool bRet
= SvXMLUnitConverter::convertEnum( nAnchor
, rStrImpValue
,
624 bool XMLAnchorTypePropHdl::exportXML(
625 OUString
& rStrExpValue
,
627 const SvXMLUnitConverter
& ) const
630 TextContentAnchorType eVal
;
634 bool bRet
= SvXMLUnitConverter::convertEnum( aOut
, eVal
, pXML_Anchor_Enum
, XML_PARAGRAPH
);
636 rStrExpValue
= aOut
.makeStringAndClear();
641 XMLAnchorTypePropHdl::~XMLAnchorTypePropHdl()
645 bool XMLAnchorTypePropHdl::convert( std::string_view rStrImpValue
,
646 TextContentAnchorType
& rType
)
648 TextContentAnchorType nAnchor
;
649 bool bRet
= SvXMLUnitConverter::convertEnum( nAnchor
, rStrImpValue
,
656 XMLTextColumnsPropertyHandler::~XMLTextColumnsPropertyHandler ()
660 bool XMLTextColumnsPropertyHandler::equals(
662 const Any
& r2
) const
664 Reference
< XTextColumns
> xColumns1
;
667 Reference
< XTextColumns
> xColumns2
;
670 if (!xColumns1
|| !xColumns2
)
671 return (!xColumns1
&& !xColumns2
);
673 if( xColumns1
->getColumnCount() != xColumns2
->getColumnCount() ||
674 xColumns1
->getReferenceValue() != xColumns2
->getReferenceValue() )
677 const Sequence
< TextColumn
> aColumns1
= xColumns1
->getColumns();
678 const Sequence
< TextColumn
> aColumns2
= xColumns2
->getColumns();
680 return std::equal(aColumns1
.begin(), aColumns1
.end(), aColumns2
.begin(), aColumns2
.end(),
681 [](const TextColumn
& a
, const TextColumn
& b
) {
682 return a
.Width
== b
.Width
683 && a
.LeftMargin
== b
.LeftMargin
684 && a
.RightMargin
== b
.RightMargin
;
688 bool XMLTextColumnsPropertyHandler::importXML(
691 const SvXMLUnitConverter
& ) const
693 SAL_WARN( "xmloff", "columns are an element import property" );
697 bool XMLTextColumnsPropertyHandler::exportXML(
700 const SvXMLUnitConverter
& ) const
702 SAL_WARN( "xmloff", "columns are an element export property" );
708 class XMLHoriMirrorPropHdl_Impl
: public XMLPropertyHandler
711 virtual bool importXML(
712 const OUString
& rStrImpValue
,
713 css::uno::Any
& rValue
,
714 const SvXMLUnitConverter
& ) const override
;
715 virtual bool exportXML(
716 OUString
& rStrExpValue
,
717 const css::uno::Any
& rValue
,
718 const SvXMLUnitConverter
& ) const override
;
723 bool XMLHoriMirrorPropHdl_Impl::importXML(
724 const OUString
& rStrImpValue
,
726 const SvXMLUnitConverter
& ) const
729 bool bRet
= SvXMLUnitConverter::convertEnum( nHoriMirror
, rStrImpValue
,
730 pXML_HoriMirror_Enum
);
734 rValue
<<= nHoriMirror
;
740 bool XMLHoriMirrorPropHdl_Impl::exportXML(
743 const SvXMLUnitConverter
& ) const
745 SAL_WARN( "xmloff", "HorMirror property shouldn't be exported" );
752 class XMLGrfMirrorPropHdl_Impl
: public XMLPropertyHandler
758 XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal
, bool bH
) :
759 sVal( GetXMLToken( eVal
) ),
762 virtual bool importXML(
763 const OUString
& rStrImpValue
,
764 css::uno::Any
& rValue
,
765 const SvXMLUnitConverter
& ) const override
;
766 virtual bool exportXML(
767 OUString
& rStrExpValue
,
768 const css::uno::Any
& rValue
,
769 const SvXMLUnitConverter
& ) const override
;
774 bool XMLGrfMirrorPropHdl_Impl::importXML(
775 const OUString
& rStrImpValue
,
777 const SvXMLUnitConverter
& ) const
781 if( ! IsXMLToken( rStrImpValue
, XML_NONE
) )
784 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
785 std::u16string_view aToken
;
786 while( aTokenEnum
.getNextToken( aToken
) )
789 if( aToken
== sVal
||
790 (bHori
&& IsXMLToken( aToken
, XML_HORIZONTAL
) ) )
804 bool XMLGrfMirrorPropHdl_Impl::exportXML(
805 OUString
& rStrExpValue
,
807 const SvXMLUnitConverter
& ) const
809 if( *o3tl::doAccess
<bool>(rValue
) )
811 if( rStrExpValue
.isEmpty() ||
812 IsXMLToken( rStrExpValue
, XML_NONE
) )
817 /* XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES
818 are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD.
821 ( IsXMLToken( rStrExpValue
, XML_HORIZONTAL_ON_EVEN
) ||
822 IsXMLToken( rStrExpValue
, XML_HORIZONTAL_ON_ODD
) ))
824 rStrExpValue
= GetXMLToken( XML_HORIZONTAL
);
828 rStrExpValue
+= " " + sVal
;
831 else if( rStrExpValue
.isEmpty() )
833 rStrExpValue
= GetXMLToken( XML_NONE
);
839 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_Emphasize_Enum
[] =
841 { XML_NONE
, FontEmphasis::NONE
},
842 { XML_DOT
, FontEmphasis::DOT_ABOVE
},
843 { XML_CIRCLE
, FontEmphasis::CIRCLE_ABOVE
},
844 { XML_DISC
, FontEmphasis::DISK_ABOVE
},
845 { XML_ACCENT
, FontEmphasis::ACCENT_ABOVE
},
846 { XML_TOKEN_INVALID
, 0 }
851 class XMLTextEmphasizePropHdl_Impl
: public XMLPropertyHandler
854 XMLTextEmphasizePropHdl_Impl() {}
856 virtual bool importXML(
857 const OUString
& rStrImpValue
,
858 css::uno::Any
& rValue
,
859 const SvXMLUnitConverter
& ) const override
;
860 virtual bool exportXML(
861 OUString
& rStrExpValue
,
862 const css::uno::Any
& rValue
,
863 const SvXMLUnitConverter
& ) const override
;
868 bool XMLTextEmphasizePropHdl_Impl::importXML(
869 const OUString
& rStrImpValue
,
871 const SvXMLUnitConverter
& ) const
874 sal_uInt16 nVal
= FontEmphasis::NONE
;
876 bool bHasPos
= false, bHasType
= false;
877 std::u16string_view aToken
;
879 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
880 while( aTokenEnum
.getNextToken( aToken
) )
882 if( !bHasPos
&& IsXMLToken( aToken
, XML_ABOVE
) )
887 else if( !bHasPos
&& IsXMLToken( aToken
, XML_BELOW
) )
892 else if( !bHasType
&&
893 SvXMLUnitConverter::convertEnum( nVal
, aToken
,
894 pXML_Emphasize_Enum
))
907 if( FontEmphasis::NONE
!= nVal
&& bBelow
)
909 rValue
<<= static_cast<sal_Int16
>(nVal
);
915 bool XMLTextEmphasizePropHdl_Impl::exportXML(
916 OUString
& rStrExpValue
,
918 const SvXMLUnitConverter
& ) const
920 OUStringBuffer
aOut( 15 );
922 sal_uInt16 nType
= sal_uInt16();
923 if( rValue
>>= nType
)
931 bRet
= SvXMLUnitConverter::convertEnum( aOut
, nType
,
938 enum XMLTokenEnum ePos
= bBelow
? XML_BELOW
: XML_ABOVE
;
939 aOut
.append( " " + GetXMLToken(ePos
) );
941 rStrExpValue
= aOut
.makeStringAndClear();
950 class XMLTextCombineCharPropHdl_Impl
: public XMLPropertyHandler
953 XMLTextCombineCharPropHdl_Impl() {}
955 virtual bool importXML(
956 const OUString
& rStrImpValue
,
957 css::uno::Any
& rValue
,
958 const SvXMLUnitConverter
& ) const override
;
959 virtual bool exportXML(
960 OUString
& rStrExpValue
,
961 const css::uno::Any
& rValue
,
962 const SvXMLUnitConverter
& ) const override
;
967 bool XMLTextCombineCharPropHdl_Impl::importXML(
968 const OUString
& rStrImpValue
,
970 const SvXMLUnitConverter
& ) const
972 if( !rStrImpValue
.isEmpty() )
973 rValue
<<= rStrImpValue
.copy( 0, 1 );
975 rValue
<<= rStrImpValue
;
980 bool XMLTextCombineCharPropHdl_Impl::exportXML(
981 OUString
& rStrExpValue
,
983 const SvXMLUnitConverter
& ) const
985 rValue
>>= rStrExpValue
;
987 // #i114107# attribute of type "character": export only if length is 1
988 return (1 == rStrExpValue
.getLength());
993 class XMLTextRelWidthHeightPropHdl_Impl
: public XMLPropertyHandler
996 XMLTextRelWidthHeightPropHdl_Impl() {}
998 virtual bool importXML(
999 const OUString
& rStrImpValue
,
1000 css::uno::Any
& rValue
,
1001 const SvXMLUnitConverter
& ) const override
;
1002 virtual bool exportXML(
1003 OUString
& rStrExpValue
,
1004 const css::uno::Any
& rValue
,
1005 const SvXMLUnitConverter
& ) const override
;
1010 bool XMLTextRelWidthHeightPropHdl_Impl::importXML(
1011 const OUString
& rStrImpValue
,
1013 const SvXMLUnitConverter
& ) const
1016 bool const bRet
= ::sax::Converter::convertPercent( nValue
, rStrImpValue
);
1018 rValue
<<= static_cast<sal_Int16
>(nValue
);
1023 bool XMLTextRelWidthHeightPropHdl_Impl::exportXML(
1024 OUString
& rStrExpValue
,
1026 const SvXMLUnitConverter
& ) const
1029 sal_Int16 nValue
= sal_Int16();
1030 if( (rValue
>>= nValue
) && nValue
> 0 )
1032 OUStringBuffer aOut
;
1033 ::sax::Converter::convertPercent( aOut
, nValue
);
1034 rStrExpValue
= aOut
.makeStringAndClear();
1044 class XMLTextSyncWidthHeightPropHdl_Impl
: public XMLPropertyHandler
1046 const OUString sValue
;
1049 explicit XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue
) :
1050 sValue( GetXMLToken(eValue
) ) {}
1052 virtual bool importXML(
1053 const OUString
& rStrImpValue
,
1054 css::uno::Any
& rValue
,
1055 const SvXMLUnitConverter
& ) const override
;
1056 virtual bool exportXML(
1057 OUString
& rStrExpValue
,
1058 const css::uno::Any
& rValue
,
1059 const SvXMLUnitConverter
& ) const override
;
1064 bool XMLTextSyncWidthHeightPropHdl_Impl::importXML(
1065 const OUString
& rStrImpValue
,
1067 const SvXMLUnitConverter
& ) const
1069 rValue
<<= (rStrImpValue
== sValue
);
1074 bool XMLTextSyncWidthHeightPropHdl_Impl::exportXML(
1075 OUString
& rStrExpValue
,
1077 const SvXMLUnitConverter
& ) const
1080 if( *o3tl::doAccess
<bool>(rValue
) )
1082 rStrExpValue
= sValue
;
1091 class XMLTextRotationAnglePropHdl_Impl
: public XMLPropertyHandler
1095 XMLTextRotationAnglePropHdl_Impl() {}
1097 virtual bool importXML(
1098 const OUString
& rStrImpValue
,
1099 css::uno::Any
& rValue
,
1100 const SvXMLUnitConverter
& ) const override
;
1101 virtual bool exportXML(
1102 OUString
& rStrExpValue
,
1103 const css::uno::Any
& rValue
,
1104 const SvXMLUnitConverter
& ) const override
;
1109 bool XMLTextRotationAnglePropHdl_Impl::importXML(
1110 const OUString
& rStrImpValue
,
1112 const SvXMLUnitConverter
& ) const
1115 bool const bRet
= ::sax::Converter::convertNumber( nValue
, rStrImpValue
);
1118 nValue
= (nValue
% 360 );
1120 nValue
= 360 + nValue
;
1122 if( nValue
< 45 || nValue
> 315 )
1124 else if( nValue
< 180 )
1126 else /* if nValue <= 315 ) */
1134 bool XMLTextRotationAnglePropHdl_Impl::exportXML(
1135 OUString
& rStrExpValue
,
1137 const SvXMLUnitConverter
& ) const
1139 sal_Int16 nAngle
= sal_Int16();
1140 bool bRet
= ( rValue
>>= nAngle
);
1143 rStrExpValue
= OUString::number( nAngle
/ 10 );
1145 OSL_ENSURE( bRet
, "illegal rotation angle" );
1152 class XMLNumber8OneBasedHdl
: public XMLPropertyHandler
1156 XMLNumber8OneBasedHdl() {}
1158 virtual bool importXML(
1159 const OUString
& rStrImpValue
,
1160 css::uno::Any
& rValue
,
1161 const SvXMLUnitConverter
& ) const override
;
1162 virtual bool exportXML(
1163 OUString
& rStrExpValue
,
1164 const css::uno::Any
& rValue
,
1165 const SvXMLUnitConverter
& ) const override
;
1170 bool XMLNumber8OneBasedHdl::importXML(
1171 const OUString
& rStrImpValue
,
1173 const SvXMLUnitConverter
& ) const
1175 sal_Int32 nValue
= 0;
1176 bool const bRet
= ::sax::Converter::convertNumber(nValue
, rStrImpValue
);
1178 rValue
<<= static_cast<sal_Int8
>( nValue
- 1 );
1182 bool XMLNumber8OneBasedHdl::exportXML(
1183 OUString
& rStrExpValue
,
1185 const SvXMLUnitConverter
& ) const
1187 sal_Int8 nValue
= sal_Int8();
1188 bool bRet
= ( rValue
>>= nValue
);
1191 rStrExpValue
= OUString::number( nValue
+ 1 );
1198 class XMLGraphicPropertyHandler
: public XMLPropertyHandler
1201 XMLGraphicPropertyHandler() {}
1203 virtual bool importXML(const OUString
& , uno::Any
& , const SvXMLUnitConverter
& ) const override
1205 SAL_WARN( "xmloff", "drop caps are an element import property" );
1209 virtual bool exportXML(OUString
& , const uno::Any
& , const SvXMLUnitConverter
& ) const override
1211 SAL_WARN( "xmloff", "drop caps are an element import property" );
1215 virtual bool equals(const css::uno::Any
& rAny1
, const css::uno::Any
& rAny2
) const override
;
1220 bool XMLGraphicPropertyHandler::equals(const Any
& rAny1
, const Any
& rAny2
) const
1222 uno::Reference
<graphic::XGraphic
> xGraphic1
;
1223 uno::Reference
<graphic::XGraphic
> xGraphic2
;
1224 rAny1
>>= xGraphic1
;
1225 rAny2
>>= xGraphic2
;
1226 Graphic
aGraphic1(xGraphic1
);
1227 Graphic
aGraphic2(xGraphic2
);
1229 return aGraphic1
== aGraphic2
;
1232 static const XMLPropertyHandler
*GetPropertyHandler
1235 const XMLPropertyHandler
* pHdl
= nullptr;
1238 case XML_TYPE_TEXT_DROPCAP
:
1239 pHdl
= new XMLDropCapPropHdl_Impl
;
1241 case XML_TYPE_TEXT_WRAP
:
1242 pHdl
= new XMLWrapPropHdl_Impl
;
1244 case XML_TYPE_TEXT_PARAGRAPH_ONLY
:
1245 pHdl
= new XMLParagraphOnlyPropHdl_Impl
;
1247 case XML_TYPE_TEXT_WRAP_OUTSIDE
:
1248 pHdl
= new XMLContourModePropHdl_Impl
;
1250 case XML_TYPE_TEXT_OPAQUE
:
1251 pHdl
= new XMLOpaquePropHdl_Impl
;
1253 case XML_TYPE_TEXT_PROTECT_CONTENT
:
1254 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_CONTENT
);
1256 case XML_TYPE_TEXT_PROTECT_SIZE
:
1257 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_SIZE
);
1259 case XML_TYPE_TEXT_PROTECT_POSITION
:
1260 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_POSITION
);
1262 case XML_TYPE_TEXT_ANCHOR_TYPE
:
1263 pHdl
= new XMLAnchorTypePropHdl
;
1265 case XML_TYPE_TEXT_COLUMNS
:
1266 pHdl
= new XMLTextColumnsPropertyHandler
;
1268 case XML_TYPE_TEXT_HORIZONTAL_POS
:
1269 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriPos_Enum
, XML_TOKEN_INVALID
);
1271 case XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED
:
1272 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriPosMirrored_Enum
, XML_TOKEN_INVALID
);
1274 case XML_TYPE_TEXT_HORIZONTAL_REL
:
1275 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriRel_Enum
, XML_TOKEN_INVALID
);
1277 case XML_TYPE_TEXT_HORIZONTAL_REL_FRAME
:
1278 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriRelFrame_Enum
, XML_TOKEN_INVALID
);
1280 case XML_TYPE_TEXT_HORIZONTAL_MIRROR
:
1281 pHdl
= new XMLHoriMirrorPropHdl_Impl
;
1283 case XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR
:
1284 pHdl
= new XMLConstantsPropertyHandler( pXML_VertPosAtChar_Enum
, XML_TOKEN_INVALID
);
1286 case XML_TYPE_TEXT_VERTICAL_REL
:
1287 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRel_Enum
, XML_TOKEN_INVALID
);
1289 case XML_TYPE_TEXT_VERTICAL_REL_PAGE
:
1290 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelPage_Enum
, XML_TOKEN_INVALID
);
1292 case XML_TYPE_TEXT_VERTICAL_REL_FRAME
:
1293 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelFrame_Enum
, XML_TOKEN_INVALID
);
1295 case XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR
:
1296 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum
, XML_TOKEN_INVALID
);
1298 case XML_TYPE_TEXT_MIRROR_VERTICAL
:
1299 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL
, false );
1301 case XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT
:
1302 // XML_HORIZONTAL_ON_LEFT_PAGES is replaced by XML_HORIZONTAL_ON_EVEN. (#i49139#)
1303 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_EVEN
, true );
1305 case XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT
:
1306 // XML_HORIZONTAL_ON_RIGHT_PAGES is replaced by XML_HORIZONTAL_ON_ODD. (#i49139#)
1307 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_ODD
, true );
1309 case XML_TYPE_TEXT_CLIP
:
1310 pHdl
= new XMLClipPropertyHandler( false );
1312 case XML_TYPE_TEXT_CLIP11
:
1313 pHdl
= new XMLClipPropertyHandler( true );
1315 case XML_TYPE_TEXT_EMPHASIZE
:
1316 pHdl
= new XMLTextEmphasizePropHdl_Impl
;
1318 case XML_TYPE_TEXT_COMBINE
:
1319 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LINES
),
1320 GetXMLToken( XML_NONE
) );
1322 case XML_TYPE_TEXT_COMBINE_CHARACTERS
:
1323 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LETTERS
),
1324 GetXMLToken( XML_NONE
) );
1326 case XML_TYPE_TEXT_COMBINECHAR
:
1327 pHdl
= new XMLTextCombineCharPropHdl_Impl
;
1329 case XML_TYPE_TEXT_AUTOSPACE
:
1330 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_IDEOGRAPH_ALPHA
),
1331 GetXMLToken( XML_NONE
) );
1333 case XML_TYPE_TEXT_PUNCTUATION_WRAP
:
1334 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_HANGING
),
1335 GetXMLToken( XML_SIMPLE
) );
1337 case XML_TYPE_TEXT_LINE_BREAK
:
1338 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_STRICT
),
1339 GetXMLToken( XML_NORMAL
) );
1341 case XML_TYPE_TEXT_REL_WIDTH_HEIGHT
:
1342 pHdl
= new XMLTextRelWidthHeightPropHdl_Impl
;
1344 case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT
:
1345 pHdl
= new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE
);
1347 case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN
:
1348 pHdl
= new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN
);
1350 case XML_TYPE_TEXT_RUBY_ADJUST
:
1351 pHdl
= new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum
, XML_TOKEN_INVALID
);
1353 case XML_TYPE_TEXT_FONT_RELIEF
:
1354 pHdl
= new XMLConstantsPropertyHandler( pXML_FontRelief_Enum
, XML_TOKEN_INVALID
);
1356 case XML_TYPE_TEXT_ROTATION_ANGLE
:
1357 pHdl
= new XMLTextRotationAnglePropHdl_Impl
;
1359 case XML_TYPE_TEXT_ROTATION_SCALE
:
1360 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_FIXED
),
1361 GetXMLToken( XML_LINE_HEIGHT
) );
1363 case XML_TYPE_TEXT_VERTICAL_ALIGN
:
1364 pHdl
= new XMLConstantsPropertyHandler( pXML_ParaVerticalAlign_Enum
, XML_TOKEN_INVALID
);
1366 case XML_TYPE_TEXT_RUBY_POSITION
:
1367 pHdl
= new XMLConstantsPropertyHandler( pXML_RubyPosition_Enum
, XML_TOKEN_INVALID
);
1369 case XML_TYPE_TEXT_RUBY_IS_ABOVE
:
1370 pHdl
= new XMLNamedBoolPropertyHdl(::xmloff::token::XML_ABOVE
, ::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
);
1403 case XML_SW_TYPE_FILLSTYLE
:
1404 pHdl
= new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap
);
1406 case XML_SW_TYPE_FILLBITMAPSIZE
:
1407 pHdl
= new XMLFillBitmapSizePropertyHandler();
1409 case XML_SW_TYPE_LOGICAL_SIZE
:
1410 pHdl
= new XMLBitmapLogicalSizePropertyHandler();
1412 case XML_SW_TYPE_BITMAP_REFPOINT
:
1413 pHdl
= new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap
);
1415 case XML_SW_TYPE_BITMAP_MODE
:
1416 pHdl
= new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap
);
1418 case XML_SW_TYPE_BITMAPREPOFFSETX
:
1419 case XML_SW_TYPE_BITMAPREPOFFSETY
:
1420 pHdl
= new XMLBitmapRepeatOffsetPropertyHandler(XML_SW_TYPE_BITMAPREPOFFSETX
== nType
);
1422 case XML_TYPE_GRAPHIC
:
1423 pHdl
= new XMLGraphicPropertyHandler
;
1425 case XML_TYPE_COMPLEX_COLOR
:
1426 pHdl
= new XMLComplexColorHandler
;
1428 case XML_TYPE_HYPHENATION_KEEP
:
1429 pHdl
= new XMLNamedBoolPropertyHdl( ::xmloff::token::XML_PAGE
, ::xmloff::token::XML_AUTO
);
1431 case XML_TYPE_HYPHENATION_KEEP_TYPE
:
1432 pHdl
= new XMLConstantsPropertyHandler( pXML_ParaHyphenationKeepType_Enum
, XML_TOKEN_INVALID
);
1436 OSL_ENSURE(false, "XMLPropertyHandler missing (!)");
1444 XMLTextPropertyHandlerFactory::XMLTextPropertyHandlerFactory()
1448 const XMLPropertyHandler
*XMLTextPropertyHandlerFactory::GetPropertyHandler(
1449 sal_Int32 nType
) const
1451 const XMLPropertyHandler
*pHdl
=
1452 XMLPropertyHandlerFactory::GetPropertyHandler( nType
);
1456 const XMLPropertyHandler
*pNewHdl
= ::GetPropertyHandler( nType
);
1459 PutHdlCache( nType
, pNewHdl
);
1467 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */