20#include <rtl/ustrbuf.hxx>
23#include <com/sun/star/util/Duration.hpp>
24#include <com/sun/star/uno/Any.hxx>
47 const OUString& rStrImpValue,
48 css::uno::Any& rValue,
51 util::Duration aDuration;
55 const double fSeconds = ((aDuration.Days * 24 + aDuration.Hours) * 60
56 + aDuration.Minutes) * 60
64 SAL_WARN_IF(!rStrImpValue.isEmpty(),
"xmloff",
"Invalid duration: " << rStrImpValue);
70 OUString& rStrExpValue,
71 const css::uno::Any& rValue,
78 util::Duration aDuration;
79 aDuration.Seconds =
static_cast<sal_uInt16
>(nVal);
84 rStrExpValue = aOut.makeStringAndClear();
103 const OUString& rStrImpValue,
104 css::uno::Any& rValue,
110 if( rStrImpValue.indexOf(
'%' ) != -1 )
117 nValue = sal_Int32( rStrImpValue.toDouble() * 100.0 );
135 sal_Int32 nUPD, nBuild;
136 if(
mpImport->getBuildIds( nUPD, nBuild ) )
139 if( (nUPD == 680) && (nBuild < 8951) )
144 rValue <<= sal_uInt16(
nValue);
151 OUString& rStrExpValue,
152 const css::uno::Any& rValue,
156 sal_uInt16 nVal = sal_uInt16();
158 if( rValue >>= nVal )
164 rStrExpValue = aOut.makeStringAndClear();
178 const OUString& rStrImpValue,
179 css::uno::Any& rValue,
185 sal_Int32
nPos = rStrImpValue.indexOf(
"px" );
190 rValue <<= sal_Int16( -
nValue );
198 rValue <<= sal_Int16(
nValue );
207 OUString& rStrExpValue,
208 const css::uno::Any& rValue,
212 sal_Int16 nVal = sal_Int16();
214 if( rValue >>= nVal )
220 aOut.append( OUString::number(
static_cast<sal_Int32
>(-nVal) ) +
"px" );
227 rStrExpValue = aOut.makeStringAndClear();
245 rValue <<= rStrImpValue;
251 sal_Int32 nNumberFormat = 0;
252 if(
mpExport && (rValue >>= nNumberFormat) )
virtual OUString getDataStyleName(const sal_Int32 nNumberFormat, bool bTimeFormat=false) const
virtual void addDataStyle(const sal_Int32 nNumberFormat, bool bTimeFormat=false)
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
void convertMeasureToXML(OUStringBuffer &rBuffer, sal_Int32 nMeasure) const
convert measure to string: from meCoreMeasureUnit to meXMLMeasureUnit
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 ~XMLDurationPropertyHdl() 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.
XMLOpacityPropertyHdl(SvXMLImport *pImport)
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 ~XMLOpacityPropertyHdl() override
virtual ~XMLTextAnimationStepPropertyHdl() 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.
static bool convertPercent(sal_Int32 &rValue, std::u16string_view rString)
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)
#define SAL_WARN_IF(condition, area, stream)