29#include <com/sun/star/uno/Any.hxx>
44 else if(
nValue > SCHAR_MAX )
46 rValue <<= static_cast<sal_Int8>(
nValue);
51 else if(
nValue > SHRT_MAX )
53 rValue <<= static_cast<sal_Int16>(
nValue);
71 bRet = rValue >>= nValue8;
77 sal_Int16 nValue16 = 0;
78 bRet = rValue >>= nValue16;
112 rStrExpValue = OUString::number(
nValue );
169 rStrExpValue = OUString::number(
nValue );
201 rStrExpValue = aOut.makeStringAndClear();
245 if (rValue >>= bValue)
249 rStrExpValue = aOut.makeStringAndClear();
277 if (rValue >>= bValue)
281 rStrExpValue = aOut.makeStringAndClear();
313 rStrExpValue = aOut.makeStringAndClear();
328 if( rStrImpValue.indexOf(
'%' ) == -1 )
330 fValue = rStrImpValue.toDouble();
336 fValue =
static_cast<double>(
nValue) / 100.0;
348 if( rValue >>= fValue )
351 if( fValue > 0 ) fValue += 0.5;
else fValue -= 0.5;
353 sal_Int32
nValue =
static_cast<sal_Int32
>(fValue);
357 rStrExpValue = aOut.makeStringAndClear();
372 rValue <<= static_cast<sal_Int16>(
nValue * 100);
388 rStrExpValue = aOut.makeStringAndClear();
406 bRet = !o3tl::checked_sub<sal_Int32>(100,
nValue,
nValue);
421 rStrExpValue = aOut.makeStringAndClear();
451 rStrExpValue = aOut.makeStringAndClear();
469 if( rStrImpValue.matchIgnoreAsciiCase(
"hsl" ) )
471 sal_Int32 nOpen = rStrImpValue.indexOf(
'(' );
472 sal_Int32 nClose = rStrImpValue.lastIndexOf(
')' );
474 if( (nOpen != -1) && (nClose > nOpen) )
476 const std::u16string_view aTmp( rStrImpValue.subView( nOpen+1, nClose - nOpen-1) );
480 Sequence< double > aHSL
503 sal_Int32 nColor = 0;
506 if( rValue >>= nColor )
509 rStrExpValue = aOut.makeStringAndClear();
515 Sequence< double > aHSL;
516 if( (rValue >>= aHSL) && (aHSL.getLength() == 3) )
518 rStrExpValue =
"hsl(" + OUString::number(aHSL[0]) +
"," +
519 OUString::number(aHSL[1] * 100.0) +
"%," +
520 OUString::number(aHSL[2] * 100.0) +
"%)";
547 sal_uInt32 nRsid = 0;
549 if( rValue >>= nRsid )
553 rStrExpValue = aOut.makeStringAndClear();
573 rValue <<= rStrImpValue;
581 if( rValue >>= rStrExpValue )
597 if( rValue >>= rStrExpValue )
614 double fDblValue(0.0);
616 rValue <<= fDblValue;
626 if( rValue >>= fValue )
630 rStrExpValue = aOut.makeStringAndClear();
668 sal_Int32 nColor = 0;
672 else if( rValue >>= nColor )
676 rStrExpValue = aOut.makeStringAndClear();
689 bTransPropValue( bTransPropVal )
713 bool bValue = *o3tl::doAccess<bool>(rValue);
742 sal_Int32 nColor = 0;
743 if( !(rValue >>= nColor) || -1 != nColor )
757 sal_Int32 nColor = 0;
758 if( (rValue >>= nColor) && -1 != nColor )
762 rStrExpValue = aOut.makeStringAndClear();
786 rValue <<= sal_Int32(-1);
794 sal_Int32 nColor = 0;
796 if( (rValue >>= nColor) && -1 == nColor )
800 rStrExpValue = aOut.makeStringAndClear();
816 SAL_WARN(
"xmloff",
"importXML called for compare-only-property" );
822 SAL_WARN(
"xmloff",
"exportXML called for compare-only-property" );
837 const OUString& rStrImpValue,
857 rStrExpValue = OUString::number(
nValue);
869 const OUString& rStrImpValue,
898 rStrExpValue = OUString::number(
nValue);
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
bool convertMeasureToCore(sal_Int32 &rValue, std::u16string_view rString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32) const
convert string to measure with meCoreMeasureUnit, using optional min and max values
OUString encodeStyleName(const OUString &rName, bool *pEncoded=nullptr) const
static bool convertHex(sal_uInt32 &nVal, std::u16string_view rValue)
convert string (hex) to number (sal_uInt32)
void convertMeasureToXML(OUStringBuffer &rBuffer, sal_Int32 nMeasure) const
convert measure to string: from meCoreMeasureUnit to meXMLMeasureUnit
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 ~XMLBoolFalsePropHdl() 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 ~XMLBoolPropHdl() 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 ~XMLColorAutoPropHdl() 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.
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 ~XMLColorPropHdl() 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.
const OUString sTransparent
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.
XMLColorTransparentPropHdl(enum ::xmloff::token::XMLTokenEnum eTransparent=xmloff::token::XML_TOKEN_INVALID)
virtual ~XMLColorTransparentPropHdl() 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 ~XMLCompareOnlyPropHdl() 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.
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 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 ~XMLDoublePropHdl() 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 ~XMLHexPropHdl() 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.
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 ~XMLIsAutoColorPropHdl() 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 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.
XMLIsTransparentPropHdl(enum ::xmloff::token::XMLTokenEnum eTransparent=xmloff::token::XML_TOKEN_INVALID, bool bTransPropValue=true)
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.
const OUString sTransparent
virtual ~XMLIsTransparentPropHdl() 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.
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 ~XMLMeasurePropHdl() 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 ~XMLMeasurePxPropHdl() 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.
virtual ~XMLNBoolPropHdl() 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.
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 ~XMLNegPercentPropHdl() 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 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 ~XMLNumberNonePropHdl() override
XMLNumberNonePropHdl(sal_Int8 nB=4)
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 ~XMLNumberPropHdl() 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 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 ~XMLNumberWithAutoForVoidPropHdl() 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.
XMLNumberWithoutZeroPropHdl(sal_Int8 nB)
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 ~XMLNumberWithoutZeroPropHdl() override
virtual ~XMLPercentPropHdl() 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 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 ~XMLStringPropHdl() override
virtual ~XMLStyleNamePropHdl() 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.
static void convertDouble(OUStringBuffer &rBuffer, double fNumber, bool bWriteUnits, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit)
static bool convertMeasurePx(sal_Int32 &rValue, std::u16string_view rString)
static bool convertPercent(sal_Int32 &rValue, std::u16string_view rString)
static bool convertColor(sal_Int32 &rColor, std::u16string_view rValue)
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)
static bool convertBool(bool &rBool, std::u16string_view rString)
#define SAL_WARN(area, stream)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
double toDouble(std::u16string_view str)
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
static bool lcl_xmloff_getAny(const Any &rValue, sal_Int32 &nValue, sal_Int8 nBytes)
static void lcl_xmloff_setAny(Any &rValue, sal_Int32 nValue, sal_Int8 nBytes)