26#include <rtl/ustring.hxx>
28#include <com/sun/star/uno/Any.hxx>
29#include <com/sun/star/awt/FontWeight.hpp>
36struct FontWeightMapper
46 { css::awt::FontWeight::DONTKNOW, 0 },
47 { css::awt::FontWeight::THIN, 100 },
48 { css::awt::FontWeight::ULTRALIGHT, 150 },
49 { css::awt::FontWeight::LIGHT, 250 },
50 { css::awt::FontWeight::SEMILIGHT, 350 },
51 { css::awt::FontWeight::NORMAL, 400 },
52 { css::awt::FontWeight::NORMAL, 450 },
53 { css::awt::FontWeight::SEMIBOLD, 600 },
54 { css::awt::FontWeight::BOLD, 700 },
55 { css::awt::FontWeight::ULTRABOLD, 800 },
56 { css::awt::FontWeight::BLACK, 900 },
57 { css::awt::FontWeight::DONTKNOW, 1000 }
69 sal_uInt16 nWeight = 0;
86 nWeight = sal::static_int_cast< sal_uInt16 >(nTemp);
100 if( nDiff1 < nDiff2 )
118 float fValue = float();
119 if( !( rValue >>= fValue ) )
124 fValue =
static_cast<float>(
nValue);
133 sal_uInt16 nWeight = 0;
136 if( fValue <= pair.fWeight )
138 nWeight = pair.nValue;
145 else if( 700 == nWeight )
148 rStrExpValue = OUString::number( nWeight );
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
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 ~XMLFontWeightPropHdl() 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.
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)
#define SAL_N_ELEMENTS(arr)
Handling of tokens in XML:
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
FontWeightMapper const aFontWeightMap[]