21#include <rtl/ustrbuf.hxx>
22#include <osl/diagnose.h>
23#include <com/sun/star/uno/Any.hxx>
33 const OUString& rStrImpValue,
39 nEnum, rStrImpValue,
m_pMap );
42 rValue <<= static_cast<sal_Int16>(nEnum);
48 OUString& rStrExpValue,
56 if( rValue.hasValue() && (rValue.getValueTypeClass() == TypeClass_ENUM))
58 nEnum = *
static_cast<sal_Int32
const *
>(rValue.getValue());
63 bRet = (rValue >>= nEnum );
68 if( (nEnum >= 0) && (nEnum <= 0xffff) )
70 sal_uInt16 nConst =
static_cast<sal_uInt16
>( nEnum );
76 rStrExpValue = aOut.makeStringAndClear();
80 OSL_FAIL(
"XMLConstantsPropertyHandler::exportXML() constant is out of range for implementation using sal_uInt16");
85 OSL_FAIL(
"XMLConstantsPropertyHandler::exportXML() could not convert any to sal_Int32");
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 in case of the given XML-data-type.
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Exports the given value in case of the given XML-data-type.
enum ::xmloff::token::XMLTokenEnum m_eDefault
const SvXMLEnumMapEntry< sal_uInt16 > * m_pMap
virtual ~XMLConstantsPropertyHandler() override