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 <vcl/graph.hxx>
61 using namespace ::com::sun::star
;
62 using namespace ::com::sun::star::uno
;
63 using namespace ::com::sun::star::style
;
64 using namespace ::com::sun::star::text
;
65 using namespace ::xmloff::token
;
66 using namespace ::com::sun::star::drawing
;
68 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_HoriPos_Enum
[] =
70 { XML_FROM_LEFT
, HoriOrientation::NONE
},
71 { XML_FROM_INSIDE
, HoriOrientation::NONE
}, // import only
72 { XML_LEFT
, HoriOrientation::LEFT
},
73 { XML_INSIDE
, HoriOrientation::LEFT
}, // import only
74 { XML_CENTER
, HoriOrientation::CENTER
},
75 { XML_RIGHT
, HoriOrientation::RIGHT
},
76 { XML_OUTSIDE
, HoriOrientation::RIGHT
}, // import only
77 { XML_TOKEN_INVALID
, 0 }
80 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_HoriPosMirrored_Enum
[] =
82 { XML_FROM_INSIDE
, HoriOrientation::NONE
},
83 { XML_INSIDE
, HoriOrientation::LEFT
},
84 { XML_CENTER
, HoriOrientation::CENTER
},
85 { XML_OUTSIDE
, HoriOrientation::RIGHT
},
86 { XML_TOKEN_INVALID
, 0 }
89 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_HoriRel_Enum
[] =
91 { XML_PARAGRAPH
, RelOrientation::FRAME
},
92 { XML_PARAGRAPH_CONTENT
, RelOrientation::PRINT_AREA
},
93 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
94 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
95 { XML_PARAGRAPH_START_MARGIN
, RelOrientation::FRAME_LEFT
},
96 { XML_PARAGRAPH_END_MARGIN
, RelOrientation::FRAME_RIGHT
},
97 { XML_PAGE_START_MARGIN
, RelOrientation::PAGE_LEFT
},
98 { XML_PAGE_END_MARGIN
, RelOrientation::PAGE_RIGHT
},
99 { XML_CHAR
, RelOrientation::CHAR
},
100 { XML_FRAME
, RelOrientation::FRAME
}, // import only
101 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
}, // import only
102 { XML_FRAME_START_MARGIN
, RelOrientation::FRAME_LEFT
}, // import only
103 { XML_FRAME_END_MARGIN
, RelOrientation::FRAME_RIGHT
}, // import only
104 { XML_TOKEN_INVALID
, 0 }
107 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_HoriRelFrame_Enum
[] =
109 { XML_FRAME
, RelOrientation::FRAME
},
110 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
},
111 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
112 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
113 { XML_FRAME_START_MARGIN
, RelOrientation::FRAME_LEFT
},
114 { XML_FRAME_END_MARGIN
, RelOrientation::FRAME_RIGHT
},
115 { XML_PAGE_START_MARGIN
, RelOrientation::PAGE_LEFT
},
116 { XML_PAGE_END_MARGIN
, RelOrientation::PAGE_RIGHT
},
117 { XML_CHAR
, RelOrientation::CHAR
},
118 { XML_TOKEN_INVALID
, 0 }
121 SvXMLEnumMapEntry
<bool> const pXML_HoriMirror_Enum
[] =
123 { XML_FROM_LEFT
, false },
124 { XML_FROM_INSIDE
, true },
126 { XML_INSIDE
, true },
127 { XML_CENTER
, false },
128 { XML_RIGHT
, false },
129 { XML_OUTSIDE
, true },
130 { XML_TOKEN_INVALID
, false }
133 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_VertPosAtChar_Enum
[] =
135 { XML_FROM_TOP
, VertOrientation::NONE
},
136 { XML_TOP
, VertOrientation::TOP
},
137 { XML_TOP
, VertOrientation::CHAR_TOP
}, // export only
138 { XML_TOP
, VertOrientation::LINE_TOP
}, // export only
139 { XML_MIDDLE
, VertOrientation::CENTER
},
140 { XML_MIDDLE
, VertOrientation::CHAR_CENTER
}, // export only
141 { XML_MIDDLE
, VertOrientation::LINE_CENTER
}, // export only
142 { XML_BOTTOM
, VertOrientation::BOTTOM
},
143 { XML_BELOW
, VertOrientation::CHAR_BOTTOM
}, // export only
144 { XML_BOTTOM
, VertOrientation::LINE_BOTTOM
}, // export only
145 { XML_TOKEN_INVALID
, 0 }
148 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_VertRel_Enum
[] =
150 { XML_PARAGRAPH
, RelOrientation::FRAME
},
151 { XML_PARAGRAPH_CONTENT
, RelOrientation::PRINT_AREA
},
152 { XML_CHAR
, RelOrientation::CHAR
},
153 // DVO, OD 17.09.2003 #i18732# - allow vertical alignment at page
154 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
155 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
156 { XML_PAGE_CONTENT_TOP
, RelOrientation::PAGE_PRINT_AREA_TOP
},
157 { XML_PAGE_CONTENT_BOTTOM
, RelOrientation::PAGE_PRINT_AREA_BOTTOM
},
158 { XML_FRAME
, RelOrientation::FRAME
}, // import only
159 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
}, // import only
160 // OD 13.11.2003 #i22341# - new vertical alignment at top of line
161 { XML_LINE
, RelOrientation::TEXT_LINE
},
162 { XML_TOKEN_INVALID
, 0 }
165 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_VertRelPage_Enum
[] =
167 { XML_PAGE
, RelOrientation::FRAME
},
168 { XML_PAGE_CONTENT
, RelOrientation::PRINT_AREA
},
169 { XML_PAGE
, RelOrientation::PAGE_FRAME
},
170 { XML_PAGE_CONTENT
, RelOrientation::PAGE_PRINT_AREA
},
171 { XML_PAGE_CONTENT_TOP
, RelOrientation::PAGE_PRINT_AREA_TOP
},
172 { XML_PAGE_CONTENT_BOTTOM
, RelOrientation::PAGE_PRINT_AREA_BOTTOM
},
173 { XML_TOKEN_INVALID
, 0 }
176 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_VertRelFrame_Enum
[] =
178 { XML_FRAME
, RelOrientation::FRAME
},
179 { XML_FRAME_CONTENT
, RelOrientation::PRINT_AREA
},
180 { XML_TOKEN_INVALID
, 0 }
183 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_VertRelAsChar_Enum
[] =
185 { XML_BASELINE
, VertOrientation::TOP
},
186 { XML_BASELINE
, VertOrientation::CENTER
}, // export only
187 { XML_BASELINE
, VertOrientation::BOTTOM
}, // export only
188 { XML_TEXT
, VertOrientation::CHAR_TOP
},
189 { XML_TEXT
, VertOrientation::CHAR_CENTER
}, // export only
190 { XML_TEXT
, VertOrientation::CHAR_BOTTOM
}, // export only
191 { XML_LINE
, VertOrientation::LINE_TOP
},
192 { XML_LINE
, VertOrientation::LINE_CENTER
}, // export only
193 { XML_LINE
, VertOrientation::LINE_BOTTOM
}, // export only
194 { XML_TOKEN_INVALID
, 0 }
197 SvXMLEnumMapEntry
<RubyAdjust
> const pXML_RubyAdjust_Enum
[] =
199 { XML_LEFT
, RubyAdjust_LEFT
},
200 { XML_CENTER
, RubyAdjust_CENTER
},
201 { XML_RIGHT
, RubyAdjust_RIGHT
},
202 { XML_DISTRIBUTE_LETTER
, RubyAdjust_BLOCK
},
203 { XML_DISTRIBUTE_SPACE
, RubyAdjust_INDENT_BLOCK
},
204 { XML_TOKEN_INVALID
, RubyAdjust(0) }
207 SvXMLEnumMapEntry
<sal_Int16
> const pXML_RubyPosition_Enum
[] =
209 { XML_ABOVE
, RubyPosition::ABOVE
},
210 { XML_BELOW
, RubyPosition::BELOW
},
211 { XML_INTER_CHARACTER
, RubyPosition::INTER_CHARACTER
},
212 { XML_TOKEN_INVALID
, 0 }
215 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_FontRelief_Enum
[] =
217 { XML_NONE
, FontRelief::NONE
},
218 { XML_ENGRAVED
, FontRelief::ENGRAVED
},
219 { XML_EMBOSSED
, FontRelief::EMBOSSED
},
220 { XML_TOKEN_INVALID
, 0 }
223 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_ParaVerticalAlign_Enum
[] =
225 { XML_TOP
, ParagraphVertAlign::TOP
},
226 { XML_MIDDLE
, ParagraphVertAlign::CENTER
},
227 { XML_BOTTOM
, ParagraphVertAlign::BOTTOM
},
228 { XML_BASELINE
, ParagraphVertAlign::BASELINE
},
229 { XML_AUTO
, ParagraphVertAlign::AUTOMATIC
},
230 { XML_TOKEN_INVALID
, 0 }
233 // OD 2004-05-05 #i28701#
234 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_WrapInfluenceOnPosition_Enum
[] =
236 // Tokens have been renamed and <XML_ITERATIVE> has been added (#i35017#)
237 { XML_ONCE_SUCCESSIVE
, WrapInfluenceOnPosition::ONCE_SUCCESSIVE
},
238 { XML_ONCE_CONCURRENT
, WrapInfluenceOnPosition::ONCE_CONCURRENT
},
239 { XML_ITERATIVE
, WrapInfluenceOnPosition::ITERATIVE
},
240 { XML_TOKEN_INVALID
, 0 }
243 SvXMLEnumMapEntry
<drawing::TextVerticalAdjust
> const pXML_VerticalAlign_Enum
[] =
245 { XML_TOP
, drawing::TextVerticalAdjust_TOP
},
246 { XML_MIDDLE
, drawing::TextVerticalAdjust_CENTER
},
247 { XML_BOTTOM
, drawing::TextVerticalAdjust_BOTTOM
},
248 { XML_JUSTIFY
, drawing::TextVerticalAdjust_BLOCK
},
249 { XML_TOKEN_INVALID
, drawing::TextVerticalAdjust(0) }
254 class XMLDropCapPropHdl_Impl
: public XMLPropertyHandler
258 const css::uno::Any
& r1
,
259 const css::uno::Any
& r2
) const override
;
261 /// TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place.
262 virtual bool importXML(
263 const OUString
& rStrImpValue
,
264 css::uno::Any
& rValue
,
265 const SvXMLUnitConverter
& ) const override
;
266 virtual bool exportXML(
267 OUString
& rStrExpValue
,
268 const css::uno::Any
& rValue
,
269 const SvXMLUnitConverter
& ) const override
;
274 bool XMLDropCapPropHdl_Impl::equals(
276 const Any
& r2
) const
278 DropCapFormat aFormat1
, aFormat2
;
282 return (aFormat1
.Lines
<=1 && aFormat2
.Lines
<=1) ||
283 (aFormat1
.Lines
== aFormat2
.Lines
&&
284 aFormat1
.Count
== aFormat2
.Count
&&
285 aFormat1
.Distance
== aFormat2
.Distance
);
288 bool XMLDropCapPropHdl_Impl::importXML(
291 const SvXMLUnitConverter
& ) const
293 SAL_WARN( "xmloff", "drop caps are an element import property" );
297 bool XMLDropCapPropHdl_Impl::exportXML(
300 const SvXMLUnitConverter
& ) const
302 SAL_WARN( "xmloff", "drop caps are an element export property" );
308 class XMLOpaquePropHdl_Impl
: public XMLPropertyHandler
311 virtual bool importXML(
312 const OUString
& rStrImpValue
,
313 css::uno::Any
& rValue
,
314 const SvXMLUnitConverter
& ) const override
;
315 virtual bool exportXML(
316 OUString
& rStrExpValue
,
317 const css::uno::Any
& rValue
,
318 const SvXMLUnitConverter
& ) const override
;
323 bool XMLOpaquePropHdl_Impl::importXML(
324 const OUString
& rStrImpValue
,
326 const SvXMLUnitConverter
& ) const
330 if( IsXMLToken( rStrImpValue
, XML_FOREGROUND
) )
332 else if( !IsXMLToken( rStrImpValue
, XML_BACKGROUND
) )
341 bool XMLOpaquePropHdl_Impl::exportXML(
342 OUString
& rStrExpValue
,
344 const SvXMLUnitConverter
& ) const
346 if( *o3tl::doAccess
<bool>(rValue
) )
347 rStrExpValue
= GetXMLToken( XML_FOREGROUND
);
349 rStrExpValue
= GetXMLToken( XML_BACKGROUND
);
356 class XMLContourModePropHdl_Impl
: public XMLPropertyHandler
359 virtual bool importXML(
360 const OUString
& rStrImpValue
,
361 css::uno::Any
& rValue
,
362 const SvXMLUnitConverter
& ) const override
;
363 virtual bool exportXML(
364 OUString
& rStrExpValue
,
365 const css::uno::Any
& rValue
,
366 const SvXMLUnitConverter
& ) const override
;
371 bool XMLContourModePropHdl_Impl::importXML(
372 const OUString
& rStrImpValue
,
374 const SvXMLUnitConverter
& ) const
378 if( IsXMLToken( rStrImpValue
, XML_OUTSIDE
) )
380 else if( ! IsXMLToken( rStrImpValue
, XML_FULL
) )
389 bool XMLContourModePropHdl_Impl::exportXML(
390 OUString
& rStrExpValue
,
392 const SvXMLUnitConverter
& ) const
394 if( *o3tl::doAccess
<bool>(rValue
) )
395 rStrExpValue
= GetXMLToken( XML_OUTSIDE
);
397 rStrExpValue
= GetXMLToken( XML_FULL
);
404 class XMLParagraphOnlyPropHdl_Impl
: public XMLPropertyHandler
407 virtual bool importXML(
408 const OUString
& rStrImpValue
,
409 css::uno::Any
& rValue
,
410 const SvXMLUnitConverter
& ) const override
;
411 virtual bool exportXML(
412 OUString
& rStrExpValue
,
413 const css::uno::Any
& rValue
,
414 const SvXMLUnitConverter
& ) const override
;
419 bool XMLParagraphOnlyPropHdl_Impl::importXML(
420 const OUString
& rStrImpValue
,
422 const SvXMLUnitConverter
& ) const
427 if( ! IsXMLToken( rStrImpValue
, XML_NO_LIMIT
) )
429 sal_Int32 nValue
= 0;
430 bRet
= ::sax::Converter::convertNumber( nValue
, rStrImpValue
);
440 bool XMLParagraphOnlyPropHdl_Impl::exportXML(
441 OUString
& rStrExpValue
,
443 const SvXMLUnitConverter
& ) const
445 if( *o3tl::doAccess
<bool>(rValue
) )
446 rStrExpValue
= GetXMLToken( XML_1
);
448 rStrExpValue
= GetXMLToken( XML_NO_LIMIT
);
453 SvXMLEnumMapEntry
<WrapTextMode
> const pXML_Wrap_Enum
[] =
455 { XML_NONE
, WrapTextMode_NONE
},
456 { XML_RUN_THROUGH
, WrapTextMode_THROUGH
},
457 { XML_PARALLEL
, WrapTextMode_PARALLEL
},
458 { XML_DYNAMIC
, WrapTextMode_DYNAMIC
},
459 { XML_LEFT
, WrapTextMode_LEFT
},
460 { XML_RIGHT
, WrapTextMode_RIGHT
},
461 { XML_TOKEN_INVALID
, WrapTextMode(0) }
466 class XMLWrapPropHdl_Impl
: public XMLPropertyHandler
469 virtual bool importXML(
470 const OUString
& rStrImpValue
,
471 css::uno::Any
& rValue
,
472 const SvXMLUnitConverter
& ) const override
;
473 virtual bool exportXML(
474 OUString
& rStrExpValue
,
475 const css::uno::Any
& rValue
,
476 const SvXMLUnitConverter
& ) const override
;
481 bool XMLWrapPropHdl_Impl::importXML(
482 const OUString
& rStrImpValue
,
484 const SvXMLUnitConverter
& ) const
487 bool bRet
= SvXMLUnitConverter::convertEnum( nWrap
, rStrImpValue
,
496 bool XMLWrapPropHdl_Impl::exportXML(
497 OUString
& rStrExpValue
,
499 const SvXMLUnitConverter
& ) const
506 bool bRet
= SvXMLUnitConverter::convertEnum( aOut
, eVal
, pXML_Wrap_Enum
, XML_NONE
);
508 rStrExpValue
= aOut
.makeStringAndClear();
515 class XMLFrameProtectPropHdl_Impl
: public XMLPropertyHandler
519 explicit XMLFrameProtectPropHdl_Impl( enum XMLTokenEnum eVal
) :
520 sVal( GetXMLToken(eVal
) ) {}
522 virtual bool importXML(
523 const OUString
& rStrImpValue
,
524 css::uno::Any
& rValue
,
525 const SvXMLUnitConverter
& ) const override
;
526 virtual bool exportXML(
527 OUString
& rStrExpValue
,
528 const css::uno::Any
& rValue
,
529 const SvXMLUnitConverter
& ) const override
;
534 bool XMLFrameProtectPropHdl_Impl::importXML(
535 const OUString
& rStrImpValue
,
537 const SvXMLUnitConverter
& ) const
541 if( ! IsXMLToken( rStrImpValue
, XML_NONE
) )
544 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
546 while( aTokenEnum
.getNextToken( aToken
) )
563 bool XMLFrameProtectPropHdl_Impl::exportXML(
564 OUString
& rStrExpValue
,
566 const SvXMLUnitConverter
& ) const
568 if( *o3tl::doAccess
<bool>(rValue
) )
570 if( rStrExpValue
.isEmpty() ||
571 IsXMLToken( rStrExpValue
, XML_NONE
) )
577 rStrExpValue
+= " " + sVal
;
580 else if( rStrExpValue
.isEmpty() )
582 rStrExpValue
= GetXMLToken( XML_NONE
);
588 SvXMLEnumMapEntry
<TextContentAnchorType
> const pXML_Anchor_Enum
[] =
590 { XML_CHAR
, TextContentAnchorType_AT_CHARACTER
},
591 { XML_PAGE
, TextContentAnchorType_AT_PAGE
},
592 { XML_FRAME
, TextContentAnchorType_AT_FRAME
},
593 { XML_PARAGRAPH
, TextContentAnchorType_AT_PARAGRAPH
},
594 { XML_AS_CHAR
, TextContentAnchorType_AS_CHARACTER
},
595 { XML_TOKEN_INVALID
, TextContentAnchorType(0) }
598 bool XMLAnchorTypePropHdl::importXML(
599 const OUString
& rStrImpValue
,
601 const SvXMLUnitConverter
& ) const
603 TextContentAnchorType nAnchor
;
604 bool bRet
= SvXMLUnitConverter::convertEnum( nAnchor
, rStrImpValue
,
613 bool XMLAnchorTypePropHdl::exportXML(
614 OUString
& rStrExpValue
,
616 const SvXMLUnitConverter
& ) const
619 TextContentAnchorType eVal
;
623 bool bRet
= SvXMLUnitConverter::convertEnum( aOut
, eVal
, pXML_Anchor_Enum
, XML_PARAGRAPH
);
625 rStrExpValue
= aOut
.makeStringAndClear();
630 XMLAnchorTypePropHdl::~XMLAnchorTypePropHdl()
634 bool XMLAnchorTypePropHdl::convert( const OUString
& rStrImpValue
,
635 TextContentAnchorType
& rType
)
637 TextContentAnchorType nAnchor
;
638 bool bRet
= SvXMLUnitConverter::convertEnum( nAnchor
, rStrImpValue
,
645 XMLTextColumnsPropertyHandler::~XMLTextColumnsPropertyHandler ()
649 bool XMLTextColumnsPropertyHandler::equals(
651 const Any
& r2
) const
653 Reference
< XTextColumns
> xColumns1
;
656 Reference
< XTextColumns
> xColumns2
;
659 if( xColumns1
->getColumnCount() != xColumns2
->getColumnCount() ||
660 xColumns1
->getReferenceValue() != xColumns2
->getReferenceValue() )
663 Sequence
< TextColumn
> aColumns1
= xColumns1
->getColumns();
664 Sequence
< TextColumn
> aColumns2
= xColumns2
->getColumns();
666 return std::equal(aColumns1
.begin(), aColumns1
.end(), aColumns2
.begin(), aColumns2
.end(),
667 [](const TextColumn
& a
, const TextColumn
& b
) {
668 return a
.Width
== b
.Width
669 && a
.LeftMargin
== b
.LeftMargin
670 && a
.RightMargin
== b
.RightMargin
;
674 bool XMLTextColumnsPropertyHandler::importXML(
677 const SvXMLUnitConverter
& ) const
679 SAL_WARN( "xmloff", "columns are an element import property" );
683 bool XMLTextColumnsPropertyHandler::exportXML(
686 const SvXMLUnitConverter
& ) const
688 SAL_WARN( "xmloff", "columns are an element export property" );
694 class XMLHoriMirrorPropHdl_Impl
: public XMLPropertyHandler
697 virtual bool importXML(
698 const OUString
& rStrImpValue
,
699 css::uno::Any
& rValue
,
700 const SvXMLUnitConverter
& ) const override
;
701 virtual bool exportXML(
702 OUString
& rStrExpValue
,
703 const css::uno::Any
& rValue
,
704 const SvXMLUnitConverter
& ) const override
;
709 bool XMLHoriMirrorPropHdl_Impl::importXML(
710 const OUString
& rStrImpValue
,
712 const SvXMLUnitConverter
& ) const
715 bool bRet
= SvXMLUnitConverter::convertEnum( nHoriMirror
, rStrImpValue
,
716 pXML_HoriMirror_Enum
);
720 rValue
<<= nHoriMirror
;
726 bool XMLHoriMirrorPropHdl_Impl::exportXML(
729 const SvXMLUnitConverter
& ) const
731 SAL_WARN( "xmloff", "HorMirror property shouldn't be exported" );
738 class XMLGrfMirrorPropHdl_Impl
: public XMLPropertyHandler
744 XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal
, bool bH
) :
745 sVal( GetXMLToken( eVal
) ),
748 virtual bool importXML(
749 const OUString
& rStrImpValue
,
750 css::uno::Any
& rValue
,
751 const SvXMLUnitConverter
& ) const override
;
752 virtual bool exportXML(
753 OUString
& rStrExpValue
,
754 const css::uno::Any
& rValue
,
755 const SvXMLUnitConverter
& ) const override
;
760 bool XMLGrfMirrorPropHdl_Impl::importXML(
761 const OUString
& rStrImpValue
,
763 const SvXMLUnitConverter
& ) const
767 if( ! IsXMLToken( rStrImpValue
, XML_NONE
) )
770 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
772 while( aTokenEnum
.getNextToken( aToken
) )
775 if( aToken
== sVal
||
776 (bHori
&& IsXMLToken( aToken
, XML_HORIZONTAL
) ) )
790 bool XMLGrfMirrorPropHdl_Impl::exportXML(
791 OUString
& rStrExpValue
,
793 const SvXMLUnitConverter
& ) const
795 if( *o3tl::doAccess
<bool>(rValue
) )
797 if( rStrExpValue
.isEmpty() ||
798 IsXMLToken( rStrExpValue
, XML_NONE
) )
803 /* XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES
804 are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD.
807 ( IsXMLToken( rStrExpValue
, XML_HORIZONTAL_ON_EVEN
) ||
808 IsXMLToken( rStrExpValue
, XML_HORIZONTAL_ON_ODD
) ))
810 rStrExpValue
= GetXMLToken( XML_HORIZONTAL
);
814 rStrExpValue
+= " " + sVal
;
817 else if( rStrExpValue
.isEmpty() )
819 rStrExpValue
= GetXMLToken( XML_NONE
);
825 SvXMLEnumMapEntry
<sal_uInt16
> const pXML_Emphasize_Enum
[] =
827 { XML_NONE
, FontEmphasis::NONE
},
828 { XML_DOT
, FontEmphasis::DOT_ABOVE
},
829 { XML_CIRCLE
, FontEmphasis::CIRCLE_ABOVE
},
830 { XML_DISC
, FontEmphasis::DISK_ABOVE
},
831 { XML_ACCENT
, FontEmphasis::ACCENT_ABOVE
},
832 { XML_TOKEN_INVALID
, 0 }
837 class XMLTextEmphasizePropHdl_Impl
: public XMLPropertyHandler
840 XMLTextEmphasizePropHdl_Impl() {}
842 virtual bool importXML(
843 const OUString
& rStrImpValue
,
844 css::uno::Any
& rValue
,
845 const SvXMLUnitConverter
& ) const override
;
846 virtual bool exportXML(
847 OUString
& rStrExpValue
,
848 const css::uno::Any
& rValue
,
849 const SvXMLUnitConverter
& ) const override
;
854 bool XMLTextEmphasizePropHdl_Impl::importXML(
855 const OUString
& rStrImpValue
,
857 const SvXMLUnitConverter
& ) const
860 sal_uInt16 nVal
= FontEmphasis::NONE
;
862 bool bHasPos
= false, bHasType
= false;
865 SvXMLTokenEnumerator
aTokenEnum( rStrImpValue
);
866 while( aTokenEnum
.getNextToken( aToken
) )
868 if( !bHasPos
&& IsXMLToken( aToken
, XML_ABOVE
) )
873 else if( !bHasPos
&& IsXMLToken( aToken
, XML_BELOW
) )
878 else if( !bHasType
&&
879 SvXMLUnitConverter::convertEnum( nVal
, aToken
,
880 pXML_Emphasize_Enum
))
893 if( FontEmphasis::NONE
!= nVal
&& bBelow
)
895 rValue
<<= static_cast<sal_Int16
>(nVal
);
901 bool XMLTextEmphasizePropHdl_Impl::exportXML(
902 OUString
& rStrExpValue
,
904 const SvXMLUnitConverter
& ) const
906 OUStringBuffer
aOut( 15 );
908 sal_uInt16 nType
= sal_uInt16();
909 if( rValue
>>= nType
)
917 bRet
= SvXMLUnitConverter::convertEnum( aOut
, nType
,
924 enum XMLTokenEnum ePos
= bBelow
? XML_BELOW
: XML_ABOVE
;
926 aOut
.append( GetXMLToken(ePos
) );
928 rStrExpValue
= aOut
.makeStringAndClear();
937 class XMLTextCombineCharPropHdl_Impl
: public XMLPropertyHandler
940 XMLTextCombineCharPropHdl_Impl() {}
942 virtual bool importXML(
943 const OUString
& rStrImpValue
,
944 css::uno::Any
& rValue
,
945 const SvXMLUnitConverter
& ) const override
;
946 virtual bool exportXML(
947 OUString
& rStrExpValue
,
948 const css::uno::Any
& rValue
,
949 const SvXMLUnitConverter
& ) const override
;
954 bool XMLTextCombineCharPropHdl_Impl::importXML(
955 const OUString
& rStrImpValue
,
957 const SvXMLUnitConverter
& ) const
959 if( !rStrImpValue
.isEmpty() )
960 rValue
<<= rStrImpValue
.copy( 0, 1 );
962 rValue
<<= rStrImpValue
;
967 bool XMLTextCombineCharPropHdl_Impl::exportXML(
968 OUString
& rStrExpValue
,
970 const SvXMLUnitConverter
& ) const
972 rValue
>>= rStrExpValue
;
974 // #i114107# attribute of type "character": export only if length is 1
975 return (1 == rStrExpValue
.getLength());
980 class XMLTextRelWidthHeightPropHdl_Impl
: public XMLPropertyHandler
983 XMLTextRelWidthHeightPropHdl_Impl() {}
985 virtual bool importXML(
986 const OUString
& rStrImpValue
,
987 css::uno::Any
& rValue
,
988 const SvXMLUnitConverter
& ) const override
;
989 virtual bool exportXML(
990 OUString
& rStrExpValue
,
991 const css::uno::Any
& rValue
,
992 const SvXMLUnitConverter
& ) const override
;
997 bool XMLTextRelWidthHeightPropHdl_Impl::importXML(
998 const OUString
& rStrImpValue
,
1000 const SvXMLUnitConverter
& ) const
1003 bool const bRet
= ::sax::Converter::convertPercent( nValue
, rStrImpValue
);
1005 rValue
<<= static_cast<sal_Int16
>(nValue
);
1010 bool XMLTextRelWidthHeightPropHdl_Impl::exportXML(
1011 OUString
& rStrExpValue
,
1013 const SvXMLUnitConverter
& ) const
1016 sal_Int16 nValue
= sal_Int16();
1017 if( (rValue
>>= nValue
) && nValue
> 0 )
1019 OUStringBuffer aOut
;
1020 ::sax::Converter::convertPercent( aOut
, nValue
);
1021 rStrExpValue
= aOut
.makeStringAndClear();
1031 class XMLTextSyncWidthHeightPropHdl_Impl
: public XMLPropertyHandler
1033 const OUString sValue
;
1036 explicit XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue
) :
1037 sValue( GetXMLToken(eValue
) ) {}
1039 virtual bool importXML(
1040 const OUString
& rStrImpValue
,
1041 css::uno::Any
& rValue
,
1042 const SvXMLUnitConverter
& ) const override
;
1043 virtual bool exportXML(
1044 OUString
& rStrExpValue
,
1045 const css::uno::Any
& rValue
,
1046 const SvXMLUnitConverter
& ) const override
;
1051 bool XMLTextSyncWidthHeightPropHdl_Impl::importXML(
1052 const OUString
& rStrImpValue
,
1054 const SvXMLUnitConverter
& ) const
1056 rValue
<<= (rStrImpValue
== sValue
);
1061 bool XMLTextSyncWidthHeightPropHdl_Impl::exportXML(
1062 OUString
& rStrExpValue
,
1064 const SvXMLUnitConverter
& ) const
1067 if( *o3tl::doAccess
<bool>(rValue
) )
1069 rStrExpValue
= sValue
;
1078 class XMLTextRotationAnglePropHdl_Impl
: public XMLPropertyHandler
1082 XMLTextRotationAnglePropHdl_Impl() {}
1084 virtual bool importXML(
1085 const OUString
& rStrImpValue
,
1086 css::uno::Any
& rValue
,
1087 const SvXMLUnitConverter
& ) const override
;
1088 virtual bool exportXML(
1089 OUString
& rStrExpValue
,
1090 const css::uno::Any
& rValue
,
1091 const SvXMLUnitConverter
& ) const override
;
1096 bool XMLTextRotationAnglePropHdl_Impl::importXML(
1097 const OUString
& rStrImpValue
,
1099 const SvXMLUnitConverter
& ) const
1102 bool const bRet
= ::sax::Converter::convertNumber( nValue
, rStrImpValue
);
1105 nValue
= (nValue
% 360 );
1107 nValue
= 360 + nValue
;
1109 if( nValue
< 45 || nValue
> 315 )
1111 else if( nValue
< 180 )
1113 else /* if nValue <= 315 ) */
1121 bool XMLTextRotationAnglePropHdl_Impl::exportXML(
1122 OUString
& rStrExpValue
,
1124 const SvXMLUnitConverter
& ) const
1126 sal_Int16 nAngle
= sal_Int16();
1127 bool bRet
= ( rValue
>>= nAngle
);
1130 rStrExpValue
= OUString::number( nAngle
/ 10 );
1132 OSL_ENSURE( bRet
, "illegal rotation angle" );
1139 class XMLNumber8OneBasedHdl
: public XMLPropertyHandler
1143 XMLNumber8OneBasedHdl() {}
1145 virtual bool importXML(
1146 const OUString
& rStrImpValue
,
1147 css::uno::Any
& rValue
,
1148 const SvXMLUnitConverter
& ) const override
;
1149 virtual bool exportXML(
1150 OUString
& rStrExpValue
,
1151 const css::uno::Any
& rValue
,
1152 const SvXMLUnitConverter
& ) const override
;
1157 bool XMLNumber8OneBasedHdl::importXML(
1158 const OUString
& rStrImpValue
,
1160 const SvXMLUnitConverter
& ) const
1162 sal_Int32 nValue
= 0;
1163 bool const bRet
= ::sax::Converter::convertNumber(nValue
, rStrImpValue
);
1165 rValue
<<= static_cast<sal_Int8
>( nValue
- 1 );
1169 bool XMLNumber8OneBasedHdl::exportXML(
1170 OUString
& rStrExpValue
,
1172 const SvXMLUnitConverter
& ) const
1174 sal_Int8 nValue
= sal_Int8();
1175 bool bRet
= ( rValue
>>= nValue
);
1178 rStrExpValue
= OUString::number( nValue
+ 1 );
1185 class XMLGraphicPropertyHandler
: public XMLPropertyHandler
1188 XMLGraphicPropertyHandler() {}
1190 virtual bool importXML(const OUString
& , uno::Any
& , const SvXMLUnitConverter
& ) const override
1192 SAL_WARN( "xmloff", "drop caps are an element import property" );
1196 virtual bool exportXML(OUString
& , const uno::Any
& , const SvXMLUnitConverter
& ) const override
1198 SAL_WARN( "xmloff", "drop caps are an element import property" );
1202 virtual bool equals(const css::uno::Any
& rAny1
, const css::uno::Any
& rAny2
) const override
;
1207 bool XMLGraphicPropertyHandler::equals(const Any
& rAny1
, const Any
& rAny2
) const
1209 uno::Reference
<graphic::XGraphic
> xGraphic1
;
1210 uno::Reference
<graphic::XGraphic
> xGraphic2
;
1211 rAny1
>>= xGraphic1
;
1212 rAny2
>>= xGraphic2
;
1213 Graphic
aGraphic1(xGraphic1
);
1214 Graphic
aGraphic2(xGraphic2
);
1216 return aGraphic1
== aGraphic2
;
1219 static const XMLPropertyHandler
*GetPropertyHandler
1222 const XMLPropertyHandler
* pHdl
= nullptr;
1225 case XML_TYPE_TEXT_DROPCAP
:
1226 pHdl
= new XMLDropCapPropHdl_Impl
;
1228 case XML_TYPE_TEXT_WRAP
:
1229 pHdl
= new XMLWrapPropHdl_Impl
;
1231 case XML_TYPE_TEXT_PARAGRAPH_ONLY
:
1232 pHdl
= new XMLParagraphOnlyPropHdl_Impl
;
1234 case XML_TYPE_TEXT_WRAP_OUTSIDE
:
1235 pHdl
= new XMLContourModePropHdl_Impl
;
1237 case XML_TYPE_TEXT_OPAQUE
:
1238 pHdl
= new XMLOpaquePropHdl_Impl
;
1240 case XML_TYPE_TEXT_PROTECT_CONTENT
:
1241 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_CONTENT
);
1243 case XML_TYPE_TEXT_PROTECT_SIZE
:
1244 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_SIZE
);
1246 case XML_TYPE_TEXT_PROTECT_POSITION
:
1247 pHdl
= new XMLFrameProtectPropHdl_Impl( XML_POSITION
);
1249 case XML_TYPE_TEXT_ANCHOR_TYPE
:
1250 pHdl
= new XMLAnchorTypePropHdl
;
1252 case XML_TYPE_TEXT_COLUMNS
:
1253 pHdl
= new XMLTextColumnsPropertyHandler
;
1255 case XML_TYPE_TEXT_HORIZONTAL_POS
:
1256 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriPos_Enum
, XML_TOKEN_INVALID
);
1258 case XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED
:
1259 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriPosMirrored_Enum
, XML_TOKEN_INVALID
);
1261 case XML_TYPE_TEXT_HORIZONTAL_REL
:
1262 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriRel_Enum
, XML_TOKEN_INVALID
);
1264 case XML_TYPE_TEXT_HORIZONTAL_REL_FRAME
:
1265 pHdl
= new XMLConstantsPropertyHandler( pXML_HoriRelFrame_Enum
, XML_TOKEN_INVALID
);
1267 case XML_TYPE_TEXT_HORIZONTAL_MIRROR
:
1268 pHdl
= new XMLHoriMirrorPropHdl_Impl
;
1270 case XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR
:
1271 pHdl
= new XMLConstantsPropertyHandler( pXML_VertPosAtChar_Enum
, XML_TOKEN_INVALID
);
1273 case XML_TYPE_TEXT_VERTICAL_REL
:
1274 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRel_Enum
, XML_TOKEN_INVALID
);
1276 case XML_TYPE_TEXT_VERTICAL_REL_PAGE
:
1277 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelPage_Enum
, XML_TOKEN_INVALID
);
1279 case XML_TYPE_TEXT_VERTICAL_REL_FRAME
:
1280 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelFrame_Enum
, XML_TOKEN_INVALID
);
1282 case XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR
:
1283 pHdl
= new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum
, XML_TOKEN_INVALID
);
1285 case XML_TYPE_TEXT_MIRROR_VERTICAL
:
1286 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL
, false );
1288 case XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT
:
1289 // XML_HORIZONTAL_ON_LEFT_PAGES is replaced by XML_HORIZONTAL_ON_EVEN. (#i49139#)
1290 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_EVEN
, true );
1292 case XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT
:
1293 // XML_HORIZONTAL_ON_RIGHT_PAGES is replaced by XML_HORIZONTAL_ON_ODD. (#i49139#)
1294 pHdl
= new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_ODD
, true );
1296 case XML_TYPE_TEXT_CLIP
:
1297 pHdl
= new XMLClipPropertyHandler( false );
1299 case XML_TYPE_TEXT_CLIP11
:
1300 pHdl
= new XMLClipPropertyHandler( true );
1302 case XML_TYPE_TEXT_EMPHASIZE
:
1303 pHdl
= new XMLTextEmphasizePropHdl_Impl
;
1305 case XML_TYPE_TEXT_COMBINE
:
1306 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LINES
),
1307 GetXMLToken( XML_NONE
) );
1309 case XML_TYPE_TEXT_COMBINE_CHARACTERS
:
1310 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LETTERS
),
1311 GetXMLToken( XML_NONE
) );
1313 case XML_TYPE_TEXT_COMBINECHAR
:
1314 pHdl
= new XMLTextCombineCharPropHdl_Impl
;
1316 case XML_TYPE_TEXT_AUTOSPACE
:
1317 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_IDEOGRAPH_ALPHA
),
1318 GetXMLToken( XML_NONE
) );
1320 case XML_TYPE_TEXT_PUNCTUATION_WRAP
:
1321 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_HANGING
),
1322 GetXMLToken( XML_SIMPLE
) );
1324 case XML_TYPE_TEXT_LINE_BREAK
:
1325 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_STRICT
),
1326 GetXMLToken( XML_NORMAL
) );
1328 case XML_TYPE_TEXT_REL_WIDTH_HEIGHT
:
1329 pHdl
= new XMLTextRelWidthHeightPropHdl_Impl
;
1331 case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT
:
1332 pHdl
= new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE
);
1334 case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN
:
1335 pHdl
= new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN
);
1337 case XML_TYPE_TEXT_RUBY_ADJUST
:
1338 pHdl
= new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum
, XML_TOKEN_INVALID
);
1340 case XML_TYPE_TEXT_FONT_RELIEF
:
1341 pHdl
= new XMLConstantsPropertyHandler( pXML_FontRelief_Enum
, XML_TOKEN_INVALID
);
1343 case XML_TYPE_TEXT_ROTATION_ANGLE
:
1344 pHdl
= new XMLTextRotationAnglePropHdl_Impl
;
1346 case XML_TYPE_TEXT_ROTATION_SCALE
:
1347 pHdl
= new XMLNamedBoolPropertyHdl( GetXMLToken( XML_FIXED
),
1348 GetXMLToken( XML_LINE_HEIGHT
) );
1350 case XML_TYPE_TEXT_VERTICAL_ALIGN
:
1351 pHdl
= new XMLConstantsPropertyHandler( pXML_ParaVerticalAlign_Enum
, XML_TOKEN_INVALID
);
1353 case XML_TYPE_TEXT_RUBY_POSITION
:
1354 pHdl
= new XMLConstantsPropertyHandler( pXML_RubyPosition_Enum
, XML_TOKEN_INVALID
);
1356 case XML_TYPE_TEXT_RUBY_IS_ABOVE
:
1357 pHdl
= new XMLNamedBoolPropertyHdl(::xmloff::token::XML_ABOVE
, ::xmloff::token::XML_BELOW
);
1359 // OD 2004-05-05 #i28701#
1360 case XML_TYPE_WRAP_INFLUENCE_ON_POSITION
:
1361 pHdl
= new XMLConstantsPropertyHandler( pXML_WrapInfluenceOnPosition_Enum
,
1362 XML_TOKEN_INVALID
);
1364 case XML_TYPE_BORDER_MODEL
:
1365 pHdl
= new XMLNamedBoolPropertyHdl( xmloff::token::XML_COLLAPSING
,
1366 xmloff::token::XML_SEPARATING
);
1368 case XML_TYPE_TEXT_LINE_MODE
:
1369 pHdl
= new XMLNamedBoolPropertyHdl(
1370 ::xmloff::token::XML_SKIP_WHITE_SPACE
,
1371 ::xmloff::token::XML_CONTINUOUS
);
1373 case XML_TYPE_TEXT_KEEP
:
1374 pHdl
= new XMLNamedBoolPropertyHdl(
1375 ::xmloff::token::XML_ALWAYS
,
1376 ::xmloff::token::XML_AUTO
);
1378 case XML_TYPE_TEXT_NKEEP
:
1379 pHdl
= new XMLNamedBoolPropertyHdl(
1380 ::xmloff::token::XML_AUTO
,
1381 ::xmloff::token::XML_ALWAYS
);
1383 case XML_TYPE_TEXT_NUMBER8_ONE_BASED
:
1384 pHdl
= new XMLNumber8OneBasedHdl();
1386 case XML_TYPE_VERTICAL_ALIGN
:
1387 pHdl
= new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum
, XML_TOKEN_INVALID
);
1390 case XML_SW_TYPE_FILLSTYLE
:
1391 pHdl
= new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap
);
1393 case XML_SW_TYPE_FILLBITMAPSIZE
:
1394 pHdl
= new XMLFillBitmapSizePropertyHandler();
1396 case XML_SW_TYPE_LOGICAL_SIZE
:
1397 pHdl
= new XMLBitmapLogicalSizePropertyHandler();
1399 case XML_SW_TYPE_BITMAP_REFPOINT
:
1400 pHdl
= new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap
);
1402 case XML_SW_TYPE_BITMAP_MODE
:
1403 pHdl
= new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap
);
1405 case XML_SW_TYPE_BITMAPREPOFFSETX
:
1406 case XML_SW_TYPE_BITMAPREPOFFSETY
:
1407 pHdl
= new XMLBitmapRepeatOffsetPropertyHandler(XML_SW_TYPE_BITMAPREPOFFSETX
== nType
);
1409 case XML_TYPE_GRAPHIC
:
1410 pHdl
= new XMLGraphicPropertyHandler
;
1414 OSL_ENSURE(false, "XMLPropertyHandler missing (!)");
1422 XMLTextPropertyHandlerFactory::XMLTextPropertyHandlerFactory() :
1423 XMLPropertyHandlerFactory()
1427 const XMLPropertyHandler
*XMLTextPropertyHandlerFactory::GetPropertyHandler(
1428 sal_Int32 nType
) const
1430 const XMLPropertyHandler
*pHdl
=
1431 XMLPropertyHandlerFactory::GetPropertyHandler( nType
);
1435 const XMLPropertyHandler
*pNewHdl
= ::GetPropertyHandler( nType
);
1438 PutHdlCache( nType
, pNewHdl
);
1446 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */