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/drawing/FillStyle.hpp>
28 #include <com/sun/star/style/DropCapFormat.hpp>
29 #include <com/sun/star/text/FontRelief.hpp>
30 #include <com/sun/star/text/WrapTextMode.hpp>
31 #include <com/sun/star/text/XTextColumns.hpp>
32 #include <com/sun/star/text/TextColumn.hpp>
33 #include <com/sun/star/text/RelOrientation.hpp>
34 #include <com/sun/star/text/HoriOrientation.hpp>
35 #include <com/sun/star/text/VertOrientation.hpp>
36 #include <com/sun/star/text/RubyAdjust.hpp>
37 #include <com/sun/star/text/RubyPosition.hpp>
38 #include <com/sun/star/text/FontEmphasis.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 // OD 2004-05-05 #i28701#
235 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_WrapInfluenceOnPosition_Enum
[] =
237 // Tokens have been renamed and <XML_ITERATIVE> has been added (#i35017#)
238 { XML_ONCE_SUCCESSIVE
, WrapInfluenceOnPosition::ONCE_SUCCESSIVE
},
239 { XML_ONCE_CONCURRENT
, WrapInfluenceOnPosition::ONCE_CONCURRENT
},
240 { XML_ITERATIVE
, WrapInfluenceOnPosition::ITERATIVE
},
241 { XML_TOKEN_INVALID
, 0 }
244 SvXMLEnumMapEntry
<drawing::TextVerticalAdjust
> const pXML_VerticalAlign_Enum
[] =
246 { XML_TOP
, drawing::TextVerticalAdjust_TOP
},
247 { XML_MIDDLE
, drawing::TextVerticalAdjust_CENTER
},
248 { XML_BOTTOM
, drawing::TextVerticalAdjust_BOTTOM
},
249 { XML_JUSTIFY
, drawing::TextVerticalAdjust_BLOCK
},
250 { XML_TOKEN_INVALID
, drawing::TextVerticalAdjust(0) }
255 class XMLDropCapPropHdl_Impl
: public XMLPropertyHandler
259 const css::uno::Any
& r1
,
260 const css::uno::Any
& r2
) const override
;
262 /// TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place.
263 virtual bool importXML(
264 const OUString
& rStrImpValue
,
265 css::uno::Any
& rValue
,
266 const SvXMLUnitConverter
& ) const override
;
267 virtual bool exportXML(
268 OUString
& rStrExpValue
,
269 const css::uno::Any
& rValue
,
270 const SvXMLUnitConverter
& ) const override
;
275 bool XMLDropCapPropHdl_Impl::equals(
277 const Any
& r2
) const
279 DropCapFormat aFormat1
, aFormat2
;
283 return (aFormat1
.Lines
<=1 && aFormat2
.Lines
<=1) ||
284 (aFormat1
.Lines
== aFormat2
.Lines
&&
285 aFormat1
.Count
== aFormat2
.Count
&&
286 aFormat1
.Distance
== aFormat2
.Distance
);
289 bool XMLDropCapPropHdl_Impl::importXML(
292 const SvXMLUnitConverter
& ) const
294 SAL_WARN( "xmloff", "drop caps are an element import property" );
298 bool XMLDropCapPropHdl_Impl::exportXML(
301 const SvXMLUnitConverter
& ) const
303 SAL_WARN( "xmloff", "drop caps are an element export property" );
309 class XMLOpaquePropHdl_Impl
: public XMLPropertyHandler
312 virtual bool importXML(
313 const OUString
& rStrImpValue
,
314 css::uno::Any
& rValue
,
315 const SvXMLUnitConverter
& ) const override
;
316 virtual bool exportXML(
317 OUString
& rStrExpValue
,
318 const css::uno::Any
& rValue
,
319 const SvXMLUnitConverter
& ) const override
;
324 bool XMLOpaquePropHdl_Impl::importXML(
325 const OUString
& rStrImpValue
,
327 const SvXMLUnitConverter
& ) const
331 if( IsXMLToken( rStrImpValue
, XML_FOREGROUND
) )
333 else if( !IsXMLToken( rStrImpValue
, XML_BACKGROUND
) )
342 bool XMLOpaquePropHdl_Impl::exportXML(
343 OUString
& rStrExpValue
,
345 const SvXMLUnitConverter
& ) const
347 if( *o3tl::doAccess
<bool>(rValue
) )
348 rStrExpValue
= GetXMLToken( XML_FOREGROUND
);
350 rStrExpValue
= GetXMLToken( XML_BACKGROUND
);
357 class XMLContourModePropHdl_Impl
: public XMLPropertyHandler
360 virtual bool importXML(
361 const OUString
& rStrImpValue
,
362 css::uno::Any
& rValue
,
363 const SvXMLUnitConverter
& ) const override
;
364 virtual bool exportXML(
365 OUString
& rStrExpValue
,
366 const css::uno::Any
& rValue
,
367 const SvXMLUnitConverter
& ) const override
;
372 bool XMLContourModePropHdl_Impl::importXML(
373 const OUString
& rStrImpValue
,
375 const SvXMLUnitConverter
& ) const
379 if( IsXMLToken( rStrImpValue
, XML_OUTSIDE
) )
381 else if( ! IsXMLToken( rStrImpValue
, XML_FULL
) )
390 bool XMLContourModePropHdl_Impl::exportXML(
391 OUString
& rStrExpValue
,
393 const SvXMLUnitConverter
& ) const
395 if( *o3tl::doAccess
<bool>(rValue
) )
396 rStrExpValue
= GetXMLToken( XML_OUTSIDE
);
398 rStrExpValue
= GetXMLToken( XML_FULL
);
405 class XMLParagraphOnlyPropHdl_Impl
: public XMLPropertyHandler
408 virtual bool importXML(
409 const OUString
& rStrImpValue
,
410 css::uno::Any
& rValue
,
411 const SvXMLUnitConverter
& ) const override
;
412 virtual bool exportXML(
413 OUString
& rStrExpValue
,
414 const css::uno::Any
& rValue
,
415 const SvXMLUnitConverter
& ) const override
;
420 bool XMLParagraphOnlyPropHdl_Impl::importXML(
421 const OUString
& rStrImpValue
,
423 const SvXMLUnitConverter
& ) const
428 if( ! IsXMLToken( rStrImpValue
, XML_NO_LIMIT
) )
430 sal_Int32 nValue
= 0;
431 bRet
= ::sax::Converter::convertNumber( nValue
, rStrImpValue
);
441 bool XMLParagraphOnlyPropHdl_Impl::exportXML(
442 OUString
& rStrExpValue
,
444 const SvXMLUnitConverter
& ) const
446 if( *o3tl::doAccess
<bool>(rValue
) )
447 rStrExpValue
= GetXMLToken( XML_1
);
449 rStrExpValue
= GetXMLToken( XML_NO_LIMIT
);
454 SvXMLEnumMapEntry
<WrapTextMode
> const pXML_Wrap_Enum
[] =
456 { XML_NONE
, WrapTextMode_NONE
},
457 { XML_RUN_THROUGH
, WrapTextMode_THROUGH
},
458 { XML_PARALLEL
, WrapTextMode_PARALLEL
},
459 { XML_DYNAMIC
, WrapTextMode_DYNAMIC
},
460 { XML_LEFT
, WrapTextMode_LEFT
},
461 { XML_RIGHT
, WrapTextMode_RIGHT
},
462 { XML_TOKEN_INVALID
, WrapTextMode(0) }
467 class XMLWrapPropHdl_Impl
: public XMLPropertyHandler
470 virtual bool importXML(
471 const OUString
& rStrImpValue
,
472 css::uno::Any
& rValue
,
473 const SvXMLUnitConverter
& ) const override
;
474 virtual bool exportXML(
475 OUString
& rStrExpValue
,
476 const css::uno::Any
& rValue
,
477 const SvXMLUnitConverter
& ) const override
;
482 bool XMLWrapPropHdl_Impl::importXML(
483 const OUString
& rStrImpValue
,
485 const SvXMLUnitConverter
& ) const
488 bool bRet
= SvXMLUnitConverter::convertEnum( nWrap
, rStrImpValue
,
497 bool XMLWrapPropHdl_Impl::exportXML(
498 OUString
& rStrExpValue
,
500 const SvXMLUnitConverter
& ) const
507 bool bRet
= SvXMLUnitConverter::convertEnum( aOut
, eVal
, pXML_Wrap_Enum
, XML_NONE
);
509 rStrExpValue
= aOut
.makeStringAndClear();
516 class XMLFrameProtectPropHdl_Impl
: public XMLPropertyHandler
520 explicit XMLFrameProtectPropHdl_Impl( enum XMLTokenEnum eVal
) :
521 sVal( GetXMLToken(eVal
) ) {}
523 virtual bool importXML(
524 const OUString
& rStrImpValue
,
525 css::uno::Any
& rValue
,
526 const SvXMLUnitConverter
& ) const override
;
527 virtual bool exportXML(
528 OUString
& rStrExpValue
,
529 const css::uno::Any
& rValue
,
530 const SvXMLUnitConverter
& ) const override
;
535 bool XMLFrameProtectPropHdl_Impl::importXML(
536 const OUString
& rStrImpValue
,
538 const SvXMLUnitConverter
& ) const
542 if( ! IsXMLToken( rStrImpValue
, XML_NONE
) )
545 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
546 std::u16string_view aToken
;
547 while( aTokenEnum
.getNextToken( aToken
) )
564 bool XMLFrameProtectPropHdl_Impl::exportXML(
565 OUString
& rStrExpValue
,
567 const SvXMLUnitConverter
& ) const
569 if( *o3tl::doAccess
<bool>(rValue
) )
571 if( rStrExpValue
.isEmpty() ||
572 IsXMLToken( rStrExpValue
, XML_NONE
) )
578 rStrExpValue
+= " " + sVal
;
581 else if( rStrExpValue
.isEmpty() )
583 rStrExpValue
= GetXMLToken( XML_NONE
);
589 SvXMLEnumMapEntry
<TextContentAnchorType
> const pXML_Anchor_Enum
[] =
591 { XML_CHAR
, TextContentAnchorType_AT_CHARACTER
},
592 { XML_PAGE
, TextContentAnchorType_AT_PAGE
},
593 { XML_FRAME
, TextContentAnchorType_AT_FRAME
},
594 { XML_PARAGRAPH
, TextContentAnchorType_AT_PARAGRAPH
},
595 { XML_AS_CHAR
, TextContentAnchorType_AS_CHARACTER
},
596 { XML_TOKEN_INVALID
, TextContentAnchorType(0) }
599 bool XMLAnchorTypePropHdl::importXML(
600 const OUString
& rStrImpValue
,
602 const SvXMLUnitConverter
& ) const
604 TextContentAnchorType nAnchor
;
605 bool bRet
= SvXMLUnitConverter::convertEnum( nAnchor
, rStrImpValue
,
614 bool XMLAnchorTypePropHdl::exportXML(
615 OUString
& rStrExpValue
,
617 const SvXMLUnitConverter
& ) const
620 TextContentAnchorType eVal
;
624 bool bRet
= SvXMLUnitConverter::convertEnum( aOut
, eVal
, pXML_Anchor_Enum
, XML_PARAGRAPH
);
626 rStrExpValue
= aOut
.makeStringAndClear();
631 XMLAnchorTypePropHdl::~XMLAnchorTypePropHdl()
635 bool XMLAnchorTypePropHdl::convert( std::string_view rStrImpValue
,
636 TextContentAnchorType
& rType
)
638 TextContentAnchorType nAnchor
;
639 bool bRet
= SvXMLUnitConverter::convertEnum( nAnchor
, rStrImpValue
,
646 XMLTextColumnsPropertyHandler::~XMLTextColumnsPropertyHandler ()
650 bool XMLTextColumnsPropertyHandler::equals(
652 const Any
& r2
) const
654 Reference
< XTextColumns
> xColumns1
;
657 Reference
< XTextColumns
> xColumns2
;
660 if (!xColumns1
|| !xColumns2
)
661 return (!xColumns1
&& !xColumns2
);
663 if( xColumns1
->getColumnCount() != xColumns2
->getColumnCount() ||
664 xColumns1
->getReferenceValue() != xColumns2
->getReferenceValue() )
667 const Sequence
< TextColumn
> aColumns1
= xColumns1
->getColumns();
668 const Sequence
< TextColumn
> aColumns2
= xColumns2
->getColumns();
670 return std::equal(aColumns1
.begin(), aColumns1
.end(), aColumns2
.begin(), aColumns2
.end(),
671 [](const TextColumn
& a
, const TextColumn
& b
) {
672 return a
.Width
== b
.Width
673 && a
.LeftMargin
== b
.LeftMargin
674 && a
.RightMargin
== b
.RightMargin
;
678 bool XMLTextColumnsPropertyHandler::importXML(
681 const SvXMLUnitConverter
& ) const
683 SAL_WARN( "xmloff", "columns are an element import property" );
687 bool XMLTextColumnsPropertyHandler::exportXML(
690 const SvXMLUnitConverter
& ) const
692 SAL_WARN( "xmloff", "columns are an element export property" );
698 class XMLHoriMirrorPropHdl_Impl
: public XMLPropertyHandler
701 virtual bool importXML(
702 const OUString
& rStrImpValue
,
703 css::uno::Any
& rValue
,
704 const SvXMLUnitConverter
& ) const override
;
705 virtual bool exportXML(
706 OUString
& rStrExpValue
,
707 const css::uno::Any
& rValue
,
708 const SvXMLUnitConverter
& ) const override
;
713 bool XMLHoriMirrorPropHdl_Impl::importXML(
714 const OUString
& rStrImpValue
,
716 const SvXMLUnitConverter
& ) const
719 bool bRet
= SvXMLUnitConverter::convertEnum( nHoriMirror
, rStrImpValue
,
720 pXML_HoriMirror_Enum
);
724 rValue
<<= nHoriMirror
;
730 bool XMLHoriMirrorPropHdl_Impl::exportXML(
733 const SvXMLUnitConverter
& ) const
735 SAL_WARN( "xmloff", "HorMirror property shouldn't be exported" );
742 class XMLGrfMirrorPropHdl_Impl
: public XMLPropertyHandler
748 XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal
, bool bH
) :
749 sVal( GetXMLToken( eVal
) ),
752 virtual bool importXML(
753 const OUString
& rStrImpValue
,
754 css::uno::Any
& rValue
,
755 const SvXMLUnitConverter
& ) const override
;
756 virtual bool exportXML(
757 OUString
& rStrExpValue
,
758 const css::uno::Any
& rValue
,
759 const SvXMLUnitConverter
& ) const override
;
764 bool XMLGrfMirrorPropHdl_Impl::importXML(
765 const OUString
& rStrImpValue
,
767 const SvXMLUnitConverter
& ) const
771 if( ! IsXMLToken( rStrImpValue
, XML_NONE
) )
774 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
775 std::u16string_view aToken
;
776 while( aTokenEnum
.getNextToken( aToken
) )
779 if( aToken
== sVal
||
780 (bHori
&& IsXMLToken( aToken
, XML_HORIZONTAL
) ) )
794 bool XMLGrfMirrorPropHdl_Impl::exportXML(
795 OUString
& rStrExpValue
,
797 const SvXMLUnitConverter
& ) const
799 if( *o3tl::doAccess
<bool>(rValue
) )
801 if( rStrExpValue
.isEmpty() ||
802 IsXMLToken( rStrExpValue
, XML_NONE
) )
807 /* XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES
808 are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD.
811 ( IsXMLToken( rStrExpValue
, XML_HORIZONTAL_ON_EVEN
) ||
812 IsXMLToken( rStrExpValue
, XML_HORIZONTAL_ON_ODD
) ))
814 rStrExpValue
= GetXMLToken( XML_HORIZONTAL
);
818 rStrExpValue
+= " " + sVal
;
821 else if( rStrExpValue
.isEmpty() )
823 rStrExpValue
= GetXMLToken( XML_NONE
);
829 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_Emphasize_Enum
[] =
831 { XML_NONE
, FontEmphasis::NONE
},
832 { XML_DOT
, FontEmphasis::DOT_ABOVE
},
833 { XML_CIRCLE
, FontEmphasis::CIRCLE_ABOVE
},
834 { XML_DISC
, FontEmphasis::DISK_ABOVE
},
835 { XML_ACCENT
, FontEmphasis::ACCENT_ABOVE
},
836 { XML_TOKEN_INVALID
, 0 }
841 class XMLTextEmphasizePropHdl_Impl
: public XMLPropertyHandler
844 XMLTextEmphasizePropHdl_Impl() {}
846 virtual bool importXML(
847 const OUString
& rStrImpValue
,
848 css::uno::Any
& rValue
,
849 const SvXMLUnitConverter
& ) const override
;
850 virtual bool exportXML(
851 OUString
& rStrExpValue
,
852 const css::uno::Any
& rValue
,
853 const SvXMLUnitConverter
& ) const override
;
858 bool XMLTextEmphasizePropHdl_Impl::importXML(
859 const OUString
& rStrImpValue
,
861 const SvXMLUnitConverter
& ) const
864 sal_uInt16 nVal
= FontEmphasis::NONE
;
866 bool bHasPos
= false, bHasType
= false;
867 std::u16string_view aToken
;
869 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
870 while( aTokenEnum
.getNextToken( aToken
) )
872 if( !bHasPos
&& IsXMLToken( aToken
, XML_ABOVE
) )
877 else if( !bHasPos
&& IsXMLToken( aToken
, XML_BELOW
) )
882 else if( !bHasType
&&
883 SvXMLUnitConverter::convertEnum( nVal
, aToken
,
884 pXML_Emphasize_Enum
))
897 if( FontEmphasis::NONE
!= nVal
&& bBelow
)
899 rValue
<<= static_cast<sal_Int16
>(nVal
);
905 bool XMLTextEmphasizePropHdl_Impl::exportXML(
906 OUString
& rStrExpValue
,
908 const SvXMLUnitConverter
& ) const
910 OUStringBuffer
aOut( 15 );
912 sal_uInt16 nType
= sal_uInt16();
913 if( rValue
>>= nType
)
921 bRet
= SvXMLUnitConverter::convertEnum( aOut
, nType
,
928 enum XMLTokenEnum ePos
= bBelow
? XML_BELOW
: XML_ABOVE
;
929 aOut
.append( " " + GetXMLToken(ePos
) );
931 rStrExpValue
= aOut
.makeStringAndClear();
940 class XMLTextCombineCharPropHdl_Impl
: public XMLPropertyHandler
943 XMLTextCombineCharPropHdl_Impl() {}
945 virtual bool importXML(
946 const OUString
& rStrImpValue
,
947 css::uno::Any
& rValue
,
948 const SvXMLUnitConverter
& ) const override
;
949 virtual bool exportXML(
950 OUString
& rStrExpValue
,
951 const css::uno::Any
& rValue
,
952 const SvXMLUnitConverter
& ) const override
;
957 bool XMLTextCombineCharPropHdl_Impl::importXML(
958 const OUString
& rStrImpValue
,
960 const SvXMLUnitConverter
& ) const
962 if( !rStrImpValue
.isEmpty() )
963 rValue
<<= rStrImpValue
.copy( 0, 1 );
965 rValue
<<= rStrImpValue
;
970 bool XMLTextCombineCharPropHdl_Impl::exportXML(
971 OUString
& rStrExpValue
,
973 const SvXMLUnitConverter
& ) const
975 rValue
>>= rStrExpValue
;
977 // #i114107# attribute of type "character": export only if length is 1
978 return (1 == rStrExpValue
.getLength());
983 class XMLTextRelWidthHeightPropHdl_Impl
: public XMLPropertyHandler
986 XMLTextRelWidthHeightPropHdl_Impl() {}
988 virtual bool importXML(
989 const OUString
& rStrImpValue
,
990 css::uno::Any
& rValue
,
991 const SvXMLUnitConverter
& ) const override
;
992 virtual bool exportXML(
993 OUString
& rStrExpValue
,
994 const css::uno::Any
& rValue
,
995 const SvXMLUnitConverter
& ) const override
;
1000 bool XMLTextRelWidthHeightPropHdl_Impl::importXML(
1001 const OUString
& rStrImpValue
,
1003 const SvXMLUnitConverter
& ) const
1006 bool const bRet
= ::sax::Converter::convertPercent( nValue
, rStrImpValue
);
1008 rValue
<<= static_cast<sal_Int16
>(nValue
);
1013 bool XMLTextRelWidthHeightPropHdl_Impl::exportXML(
1014 OUString
& rStrExpValue
,
1016 const SvXMLUnitConverter
& ) const
1019 sal_Int16 nValue
= sal_Int16();
1020 if( (rValue
>>= nValue
) && nValue
> 0 )
1022 OUStringBuffer aOut
;
1023 ::sax::Converter::convertPercent( aOut
, nValue
);
1024 rStrExpValue
= aOut
.makeStringAndClear();
1034 class XMLTextSyncWidthHeightPropHdl_Impl
: public XMLPropertyHandler
1036 const OUString sValue
;
1039 explicit XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue
) :
1040 sValue( GetXMLToken(eValue
) ) {}
1042 virtual bool importXML(
1043 const OUString
& rStrImpValue
,
1044 css::uno::Any
& rValue
,
1045 const SvXMLUnitConverter
& ) const override
;
1046 virtual bool exportXML(
1047 OUString
& rStrExpValue
,
1048 const css::uno::Any
& rValue
,
1049 const SvXMLUnitConverter
& ) const override
;
1054 bool XMLTextSyncWidthHeightPropHdl_Impl::importXML(
1055 const OUString
& rStrImpValue
,
1057 const SvXMLUnitConverter
& ) const
1059 rValue
<<= (rStrImpValue
== sValue
);
1064 bool XMLTextSyncWidthHeightPropHdl_Impl::exportXML(
1065 OUString
& rStrExpValue
,
1067 const SvXMLUnitConverter
& ) const
1070 if( *o3tl::doAccess
<bool>(rValue
) )
1072 rStrExpValue
= sValue
;
1081 class XMLTextRotationAnglePropHdl_Impl
: public XMLPropertyHandler
1085 XMLTextRotationAnglePropHdl_Impl() {}
1087 virtual bool importXML(
1088 const OUString
& rStrImpValue
,
1089 css::uno::Any
& rValue
,
1090 const SvXMLUnitConverter
& ) const override
;
1091 virtual bool exportXML(
1092 OUString
& rStrExpValue
,
1093 const css::uno::Any
& rValue
,
1094 const SvXMLUnitConverter
& ) const override
;
1099 bool XMLTextRotationAnglePropHdl_Impl::importXML(
1100 const OUString
& rStrImpValue
,
1102 const SvXMLUnitConverter
& ) const
1105 bool const bRet
= ::sax::Converter::convertNumber( nValue
, rStrImpValue
);
1108 nValue
= (nValue
% 360 );
1110 nValue
= 360 + nValue
;
1112 if( nValue
< 45 || nValue
> 315 )
1114 else if( nValue
< 180 )
1116 else /* if nValue <= 315 ) */
1124 bool XMLTextRotationAnglePropHdl_Impl::exportXML(
1125 OUString
& rStrExpValue
,
1127 const SvXMLUnitConverter
& ) const
1129 sal_Int16 nAngle
= sal_Int16();
1130 bool bRet
= ( rValue
>>= nAngle
);
1133 rStrExpValue
= OUString::number( nAngle
/ 10 );
1135 OSL_ENSURE( bRet
, "illegal rotation angle" );
1142 class XMLNumber8OneBasedHdl
: public XMLPropertyHandler
1146 XMLNumber8OneBasedHdl() {}
1148 virtual bool importXML(
1149 const OUString
& rStrImpValue
,
1150 css::uno::Any
& rValue
,
1151 const SvXMLUnitConverter
& ) const override
;
1152 virtual bool exportXML(
1153 OUString
& rStrExpValue
,
1154 const css::uno::Any
& rValue
,
1155 const SvXMLUnitConverter
& ) const override
;
1160 bool XMLNumber8OneBasedHdl::importXML(
1161 const OUString
& rStrImpValue
,
1163 const SvXMLUnitConverter
& ) const
1165 sal_Int32 nValue
= 0;
1166 bool const bRet
= ::sax::Converter::convertNumber(nValue
, rStrImpValue
);
1168 rValue
<<= static_cast<sal_Int8
>( nValue
- 1 );
1172 bool XMLNumber8OneBasedHdl::exportXML(
1173 OUString
& rStrExpValue
,
1175 const SvXMLUnitConverter
& ) const
1177 sal_Int8 nValue
= sal_Int8();
1178 bool bRet
= ( rValue
>>= nValue
);
1181 rStrExpValue
= OUString::number( nValue
+ 1 );
1188 class XMLGraphicPropertyHandler
: public XMLPropertyHandler
1191 XMLGraphicPropertyHandler() {}
1193 virtual bool importXML(const OUString
& , uno::Any
& , const SvXMLUnitConverter
& ) const override
1195 SAL_WARN( "xmloff", "drop caps are an element import property" );
1199 virtual bool exportXML(OUString
& , const uno::Any
& , const SvXMLUnitConverter
& ) const override
1201 SAL_WARN( "xmloff", "drop caps are an element import property" );
1205 virtual bool equals(const css::uno::Any
& rAny1
, const css::uno::Any
& rAny2
) const override
;
1210 bool XMLGraphicPropertyHandler::equals(const Any
& rAny1
, const Any
& rAny2
) const
1212 uno::Reference
<graphic::XGraphic
> xGraphic1
;
1213 uno::Reference
<graphic::XGraphic
> xGraphic2
;
1214 rAny1
>>= xGraphic1
;
1215 rAny2
>>= xGraphic2
;
1216 Graphic
aGraphic1(xGraphic1
);
1217 Graphic
aGraphic2(xGraphic2
);
1219 return aGraphic1
== aGraphic2
;
1222 static const XMLPropertyHandler
*GetPropertyHandler
1225 const XMLPropertyHandler
* pHdl
= nullptr;
1228 case XML_TYPE_TEXT_DROPCAP
:
1229 pHdl
= new XMLDropCapPropHdl_Impl
;
1231 case XML_TYPE_TEXT_WRAP
:
1232 pHdl
= new XMLWrapPropHdl_Impl
;
1234 case XML_TYPE_TEXT_PARAGRAPH_ONLY
:
1235 pHdl
= new XMLParagraphOnlyPropHdl_Impl
;
1237 case XML_TYPE_TEXT_WRAP_OUTSIDE
:
1238 pHdl
= new XMLContourModePropHdl_Impl
;
1240 case XML_TYPE_TEXT_OPAQUE
:
1241 pHdl
= new XMLOpaquePropHdl_Impl
;
1243 case XML_TYPE_TEXT_PROTECT_CONTENT
:
1244 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_CONTENT
);
1246 case XML_TYPE_TEXT_PROTECT_SIZE
:
1247 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_SIZE
);
1249 case XML_TYPE_TEXT_PROTECT_POSITION
:
1250 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_POSITION
);
1252 case XML_TYPE_TEXT_ANCHOR_TYPE
:
1253 pHdl
= new XMLAnchorTypePropHdl
;
1255 case XML_TYPE_TEXT_COLUMNS
:
1256 pHdl
= new XMLTextColumnsPropertyHandler
;
1258 case XML_TYPE_TEXT_HORIZONTAL_POS
:
1259 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriPos_Enum
, XML_TOKEN_INVALID
);
1261 case XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED
:
1262 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriPosMirrored_Enum
, XML_TOKEN_INVALID
);
1264 case XML_TYPE_TEXT_HORIZONTAL_REL
:
1265 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriRel_Enum
, XML_TOKEN_INVALID
);
1267 case XML_TYPE_TEXT_HORIZONTAL_REL_FRAME
:
1268 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriRelFrame_Enum
, XML_TOKEN_INVALID
);
1270 case XML_TYPE_TEXT_HORIZONTAL_MIRROR
:
1271 pHdl
= new XMLHoriMirrorPropHdl_Impl
;
1273 case XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR
:
1274 pHdl
= new XMLConstantsPropertyHandler( pXML_VertPosAtChar_Enum
, XML_TOKEN_INVALID
);
1276 case XML_TYPE_TEXT_VERTICAL_REL
:
1277 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRel_Enum
, XML_TOKEN_INVALID
);
1279 case XML_TYPE_TEXT_VERTICAL_REL_PAGE
:
1280 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelPage_Enum
, XML_TOKEN_INVALID
);
1282 case XML_TYPE_TEXT_VERTICAL_REL_FRAME
:
1283 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelFrame_Enum
, XML_TOKEN_INVALID
);
1285 case XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR
:
1286 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum
, XML_TOKEN_INVALID
);
1288 case XML_TYPE_TEXT_MIRROR_VERTICAL
:
1289 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL
, false );
1291 case XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT
:
1292 // XML_HORIZONTAL_ON_LEFT_PAGES is replaced by XML_HORIZONTAL_ON_EVEN. (#i49139#)
1293 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_EVEN
, true );
1295 case XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT
:
1296 // XML_HORIZONTAL_ON_RIGHT_PAGES is replaced by XML_HORIZONTAL_ON_ODD. (#i49139#)
1297 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_ODD
, true );
1299 case XML_TYPE_TEXT_CLIP
:
1300 pHdl
= new XMLClipPropertyHandler( false );
1302 case XML_TYPE_TEXT_CLIP11
:
1303 pHdl
= new XMLClipPropertyHandler( true );
1305 case XML_TYPE_TEXT_EMPHASIZE
:
1306 pHdl
= new XMLTextEmphasizePropHdl_Impl
;
1308 case XML_TYPE_TEXT_COMBINE
:
1309 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LINES
),
1310 GetXMLToken( XML_NONE
) );
1312 case XML_TYPE_TEXT_COMBINE_CHARACTERS
:
1313 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LETTERS
),
1314 GetXMLToken( XML_NONE
) );
1316 case XML_TYPE_TEXT_COMBINECHAR
:
1317 pHdl
= new XMLTextCombineCharPropHdl_Impl
;
1319 case XML_TYPE_TEXT_AUTOSPACE
:
1320 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_IDEOGRAPH_ALPHA
),
1321 GetXMLToken( XML_NONE
) );
1323 case XML_TYPE_TEXT_PUNCTUATION_WRAP
:
1324 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_HANGING
),
1325 GetXMLToken( XML_SIMPLE
) );
1327 case XML_TYPE_TEXT_LINE_BREAK
:
1328 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_STRICT
),
1329 GetXMLToken( XML_NORMAL
) );
1331 case XML_TYPE_TEXT_REL_WIDTH_HEIGHT
:
1332 pHdl
= new XMLTextRelWidthHeightPropHdl_Impl
;
1334 case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT
:
1335 pHdl
= new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE
);
1337 case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN
:
1338 pHdl
= new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN
);
1340 case XML_TYPE_TEXT_RUBY_ADJUST
:
1341 pHdl
= new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum
, XML_TOKEN_INVALID
);
1343 case XML_TYPE_TEXT_FONT_RELIEF
:
1344 pHdl
= new XMLConstantsPropertyHandler( pXML_FontRelief_Enum
, XML_TOKEN_INVALID
);
1346 case XML_TYPE_TEXT_ROTATION_ANGLE
:
1347 pHdl
= new XMLTextRotationAnglePropHdl_Impl
;
1349 case XML_TYPE_TEXT_ROTATION_SCALE
:
1350 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_FIXED
),
1351 GetXMLToken( XML_LINE_HEIGHT
) );
1353 case XML_TYPE_TEXT_VERTICAL_ALIGN
:
1354 pHdl
= new XMLConstantsPropertyHandler( pXML_ParaVerticalAlign_Enum
, XML_TOKEN_INVALID
);
1356 case XML_TYPE_TEXT_RUBY_POSITION
:
1357 pHdl
= new XMLConstantsPropertyHandler( pXML_RubyPosition_Enum
, XML_TOKEN_INVALID
);
1359 case XML_TYPE_TEXT_RUBY_IS_ABOVE
:
1360 pHdl
= new XMLNamedBoolPropertyHdl(::xmloff::token::XML_ABOVE
, ::xmloff::token::XML_BELOW
);
1362 // OD 2004-05-05 #i28701#
1363 case XML_TYPE_WRAP_INFLUENCE_ON_POSITION
:
1364 pHdl
= new XMLConstantsPropertyHandler( pXML_WrapInfluenceOnPosition_Enum
,
1365 XML_TOKEN_INVALID
);
1367 case XML_TYPE_BORDER_MODEL
:
1368 pHdl
= new XMLNamedBoolPropertyHdl( xmloff::token::XML_COLLAPSING
,
1369 xmloff::token::XML_SEPARATING
);
1371 case XML_TYPE_TEXT_LINE_MODE
:
1372 pHdl
= new XMLNamedBoolPropertyHdl(
1373 ::xmloff::token::XML_SKIP_WHITE_SPACE
,
1374 ::xmloff::token::XML_CONTINUOUS
);
1376 case XML_TYPE_TEXT_KEEP
:
1377 pHdl
= new XMLNamedBoolPropertyHdl(
1378 ::xmloff::token::XML_ALWAYS
,
1379 ::xmloff::token::XML_AUTO
);
1381 case XML_TYPE_TEXT_NKEEP
:
1382 pHdl
= new XMLNamedBoolPropertyHdl(
1383 ::xmloff::token::XML_AUTO
,
1384 ::xmloff::token::XML_ALWAYS
);
1386 case XML_TYPE_TEXT_NUMBER8_ONE_BASED
:
1387 pHdl
= new XMLNumber8OneBasedHdl();
1389 case XML_TYPE_VERTICAL_ALIGN
:
1390 pHdl
= new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum
, XML_TOKEN_INVALID
);
1393 case XML_SW_TYPE_FILLSTYLE
:
1394 pHdl
= new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap
);
1396 case XML_SW_TYPE_FILLBITMAPSIZE
:
1397 pHdl
= new XMLFillBitmapSizePropertyHandler();
1399 case XML_SW_TYPE_LOGICAL_SIZE
:
1400 pHdl
= new XMLBitmapLogicalSizePropertyHandler();
1402 case XML_SW_TYPE_BITMAP_REFPOINT
:
1403 pHdl
= new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap
);
1405 case XML_SW_TYPE_BITMAP_MODE
:
1406 pHdl
= new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap
);
1408 case XML_SW_TYPE_BITMAPREPOFFSETX
:
1409 case XML_SW_TYPE_BITMAPREPOFFSETY
:
1410 pHdl
= new XMLBitmapRepeatOffsetPropertyHandler(XML_SW_TYPE_BITMAPREPOFFSETX
== nType
);
1412 case XML_TYPE_GRAPHIC
:
1413 pHdl
= new XMLGraphicPropertyHandler
;
1415 case XML_TYPE_COMPLEX_COLOR
:
1416 pHdl
= new XMLComplexColorHandler
;
1420 OSL_ENSURE(false, "XMLPropertyHandler missing (!)");
1428 XMLTextPropertyHandlerFactory::XMLTextPropertyHandlerFactory()
1432 const XMLPropertyHandler
*XMLTextPropertyHandlerFactory::GetPropertyHandler(
1433 sal_Int32 nType
) const
1435 const XMLPropertyHandler
*pHdl
=
1436 XMLPropertyHandlerFactory::GetPropertyHandler( nType
);
1440 const XMLPropertyHandler
*pNewHdl
= ::GetPropertyHandler( nType
);
1443 PutHdlCache( nType
, pNewHdl
);
1451 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */