21#include <com/sun/star/uno/Any.hxx>
22#include <rtl/ustrbuf.hxx>
25#include <com/sun/star/table/ShadowFormat.hpp>
46 table::ShadowFormat aShadow;
47 aShadow.Location = table::ShadowLocation_BOTTOM_RIGHT;
49 bool bColorFound =
false;
50 bool bOffsetFound =
false;
52 Color aColor( 128,128, 128 );
53 std::u16string_view aToken;
59 aShadow.Location = table::ShadowLocation_NONE;
63 else if( !bColorFound && aToken.substr(0,1) ==
u"#" )
70 else if( !bOffsetFound )
72 sal_Int32 nX = 0, nY = 0;
83 aShadow.Location = table::ShadowLocation_TOP_LEFT;
85 aShadow.Location = table::ShadowLocation_BOTTOM_LEFT;
90 aShadow.Location = table::ShadowLocation_TOP_RIGHT;
92 aShadow.Location = table::ShadowLocation_BOTTOM_RIGHT;
103 aShadow.ShadowWidth = sal::static_int_cast<sal_Int16>(nWidth >> 1);
108 if( bRet && ( bColorFound || bOffsetFound ) )
111 aShadow.Color = sal_Int32(aColor);
123 table::ShadowFormat aShadow;
125 if( rValue >>= aShadow )
127 sal_Int32 nX = 1, nY = 1;
129 switch( aShadow.Location )
131 case table::ShadowLocation_TOP_LEFT:
135 case table::ShadowLocation_TOP_RIGHT:
138 case table::ShadowLocation_BOTTOM_LEFT:
141 case table::ShadowLocation_BOTTOM_RIGHT:
143 case table::ShadowLocation_NONE:
149 nX *= aShadow.ShadowWidth;
150 nY *= aShadow.ShadowWidth;
159 rStrExpValue = aOut.makeStringAndClear();
bool IsTransparent() const
bool getNextToken(std::u16string_view &rToken)
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 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 ~XMLShadowPropHdl() 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 convertColor(sal_Int32 &rColor, std::u16string_view rValue)
std::enable_if< std::is_signed< T >::value, bool >::type checked_add(T a, T b, T &result)
std::enable_if< std::is_signed< T >::value, T >::type saturating_toggle_sign(T a)
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