24#include <rtl/ustrbuf.hxx>
25#include <osl/diagnose.h>
27#include <com/sun/star/uno/Any.hxx>
28#include <com/sun/star/awt/FontUnderline.hpp>
36 {
XML_NONE, awt::FontUnderline::NONE },
43 {
XML_SINGLE, awt::FontUnderline::DASHDOTDOT },
46 {
XML_SINGLE, awt::FontUnderline::BOLDDOTTED },
48 {
XML_SINGLE, awt::FontUnderline::BOLDLONGDASH },
49 {
XML_SINGLE, awt::FontUnderline::BOLDDASHDOT },
50 {
XML_SINGLE, awt::FontUnderline::BOLDDASHDOTDOT },
52 {
XML_DOUBLE, awt::FontUnderline::DOUBLEWAVE },
59 {
XML_NONE, awt::FontUnderline::NONE },
60 {
XML_SOLID, awt::FontUnderline::SINGLE },
61 {
XML_SOLID, awt::FontUnderline::DOUBLE },
63 {
XML_DASH, awt::FontUnderline::DASH },
67 {
XML_WAVE, awt::FontUnderline::WAVE },
69 {
XML_DOTTED, awt::FontUnderline::BOLDDOTTED },
70 {
XML_DASH, awt::FontUnderline::BOLDDASH },
74 {
XML_WAVE, awt::FontUnderline::BOLDWAVE },
75 {
XML_WAVE, awt::FontUnderline::DOUBLEWAVE },
82 {
XML_AUTO, awt::FontUnderline::NONE },
83 {
XML_AUTO, awt::FontUnderline::SINGLE },
84 {
XML_AUTO, awt::FontUnderline::DOUBLE },
85 {
XML_AUTO, awt::FontUnderline::DOTTED },
86 {
XML_AUTO, awt::FontUnderline::DASH },
87 {
XML_AUTO, awt::FontUnderline::LONGDASH },
88 {
XML_AUTO, awt::FontUnderline::DASHDOT },
89 {
XML_AUTO, awt::FontUnderline::DASHDOTDOT },
90 {
XML_AUTO, awt::FontUnderline::WAVE },
91 {
XML_BOLD, awt::FontUnderline::BOLD },
92 {
XML_BOLD, awt::FontUnderline::BOLDDOTTED },
93 {
XML_BOLD, awt::FontUnderline::BOLDDASH },
94 {
XML_BOLD, awt::FontUnderline::BOLDLONGDASH },
95 {
XML_BOLD, awt::FontUnderline::BOLDDASHDOT },
96 {
XML_BOLD, awt::FontUnderline::BOLDDASHDOTDOT },
97 {
XML_BOLD, awt::FontUnderline::BOLDWAVE },
98 {
XML_AUTO, awt::FontUnderline::DOUBLEWAVE },
99 {
XML_THIN, awt::FontUnderline::NONE },
115 sal_uInt16 eNewUnderline(0);
122 sal_Int16 eUnderline = sal_Int16();
123 if( (rValue >>= eUnderline) && awt::FontUnderline::NONE!=eUnderline )
125 switch( eNewUnderline )
127 case awt::FontUnderline::NONE:
128 case awt::FontUnderline::SINGLE:
130 eNewUnderline = eUnderline;
132 case awt::FontUnderline::DOUBLE:
137 case awt::FontUnderline::SINGLE:
138 case awt::FontUnderline::BOLD:
140 case awt::FontUnderline::WAVE:
141 case awt::FontUnderline::BOLDWAVE:
142 eNewUnderline = awt::FontUnderline::DOUBLEWAVE;
147 eNewUnderline = eUnderline;
152 OSL_ENSURE( bRet,
"unexpected line type value" );
155 if( eNewUnderline != eUnderline )
156 rValue <<= static_cast<sal_Int16>(eNewUnderline);
160 rValue <<= static_cast<sal_Int16>(eNewUnderline);
170 sal_uInt16
nValue = sal_uInt16();
172 if( (rValue >>=
nValue) &&
173 (awt::FontUnderline::DOUBLE ==
nValue ||
174 awt::FontUnderline::DOUBLEWAVE ==
nValue) )
180 rStrExpValue = aOut.makeStringAndClear();
196 sal_uInt16 eNewUnderline(0);
203 sal_Int16 eUnderline = sal_Int16();
204 if( (rValue >>= eUnderline) && awt::FontUnderline::NONE!=eUnderline )
206 switch( eNewUnderline )
208 case awt::FontUnderline::NONE:
209 case awt::FontUnderline::SINGLE:
211 eNewUnderline = eUnderline;
213 case awt::FontUnderline::DOTTED:
215 if( awt::FontUnderline::BOLD == eUnderline )
216 eNewUnderline = awt::FontUnderline::BOLDDOTTED;
218 case awt::FontUnderline::DASH:
219 if( awt::FontUnderline::BOLD == eUnderline )
220 eNewUnderline = awt::FontUnderline::BOLDDASH;
222 case awt::FontUnderline::LONGDASH:
223 if( awt::FontUnderline::BOLD == eUnderline )
224 eNewUnderline = awt::FontUnderline::BOLDLONGDASH;
226 case awt::FontUnderline::DASHDOT:
227 if( awt::FontUnderline::BOLD == eUnderline )
228 eNewUnderline = awt::FontUnderline::BOLDDASHDOT;
230 case awt::FontUnderline::DASHDOTDOT:
231 if( awt::FontUnderline::BOLD == eUnderline )
232 eNewUnderline = awt::FontUnderline::BOLDDASHDOTDOT;
234 case awt::FontUnderline::WAVE:
235 if( awt::FontUnderline::DOUBLE == eUnderline )
236 eNewUnderline = awt::FontUnderline::DOUBLEWAVE;
237 else if( awt::FontUnderline::BOLD == eUnderline )
238 eNewUnderline = awt::FontUnderline::BOLDWAVE;
240 case awt::FontUnderline::SMALLWAVE:
243 OSL_ENSURE( bRet,
"unexpected line style value" );
246 if( eNewUnderline != eUnderline )
247 rValue <<= static_cast<sal_Int16>(eNewUnderline);
251 rValue <<= static_cast<sal_Int16>(eNewUnderline);
261 sal_uInt16
nValue = sal_uInt16();
269 rStrExpValue = aOut.makeStringAndClear();
285 sal_uInt16 eNewUnderline(0);
292 sal_Int16 eUnderline = sal_Int16();
293 if( (rValue >>= eUnderline) && awt::FontUnderline::NONE!=eUnderline )
295 switch( eNewUnderline )
297 case awt::FontUnderline::NONE:
299 eNewUnderline = eUnderline;
301 case awt::FontUnderline::BOLD:
306 case awt::FontUnderline::SINGLE:
308 case awt::FontUnderline::DOTTED:
309 eNewUnderline = awt::FontUnderline::BOLDDOTTED;
311 case awt::FontUnderline::DASH:
312 eNewUnderline = awt::FontUnderline::BOLDDASH;
314 case awt::FontUnderline::LONGDASH:
315 eNewUnderline = awt::FontUnderline::BOLDLONGDASH;
317 case awt::FontUnderline::DASHDOT:
318 eNewUnderline = awt::FontUnderline::BOLDDASHDOT;
320 case awt::FontUnderline::DASHDOTDOT:
321 eNewUnderline = awt::FontUnderline::BOLDDASHDOTDOT;
323 case awt::FontUnderline::WAVE:
324 eNewUnderline = awt::FontUnderline::BOLDWAVE;
328 eNewUnderline = eUnderline;
333 OSL_ENSURE( bRet,
"unexpected line width value" );
336 if( eNewUnderline != eUnderline )
337 rValue <<= static_cast<sal_Int16>(eNewUnderline);
341 rValue <<= static_cast<sal_Int16>(eNewUnderline);
351 sal_uInt16
nValue = sal_uInt16();
353 if( (rValue >>=
nValue) && (awt::FontUnderline::NONE !=
nValue) )
359 rStrExpValue = aOut.makeStringAndClear();
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class.
virtual ~XMLUnderlineStylePropHdl() override
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Exports the given value according to the XML-data-type corresponding to the derived class.
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class.
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Exports the given value according to the XML-data-type corresponding to the derived class.
virtual ~XMLUnderlineTypePropHdl() override
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Exports the given value according to the XML-data-type corresponding to the derived class.
virtual ~XMLUnderlineWidthPropHdl() override
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class.
Handling of tokens in XML:
SvXMLEnumMapEntry< sal_uInt16 > const pXML_UnderlineType_Enum[]
SvXMLEnumMapEntry< sal_uInt16 > const pXML_UnderlineWidth_Enum[]
SvXMLEnumMapEntry< sal_uInt16 > const pXML_UnderlineStyle_Enum[]