20#include <com/sun/star/drawing/DashStyle.hpp>
21#include <com/sun/star/drawing/LineDash.hpp>
33#include <rtl/ustrbuf.hxx>
34#include <rtl/ustring.hxx>
43 {
XML_RECT, drawing::DashStyle_RECT },
45 {
XML_RECT, drawing::DashStyle_RECTRELATIVE },
46 {
XML_ROUND, drawing::DashStyle_ROUNDRELATIVE },
58 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList,
62 drawing::LineDash aLineDash;
63 aLineDash.Style = drawing::DashStyle_RECT;
67 aLineDash.DashLen = 0;
68 aLineDash.Distance = 20;
69 OUString aDisplayName;
77 switch( aIter.getToken() )
82 rStrName = aIter.toString();
88 aDisplayName = aIter.toString();
99 aLineDash.Dots =
static_cast<sal_Int16
>(aIter.toInt32());
105 if( aIter.toView().find(
'%' ) != std::string_view::npos )
120 aLineDash.Dashes =
static_cast<sal_Int16
>(aIter.toInt32());
126 if( aIter.toView().find(
'%' ) != std::string_view::npos )
142 if( aIter.toView().find(
'%' ) != std::string_view::npos )
160 aLineDash.Style = aLineDash.Style == drawing::DashStyle_RECT ? drawing::DashStyle_RECTRELATIVE : drawing::DashStyle_ROUNDRELATIVE;
162 rValue <<= aLineDash;
164 if( !aDisplayName.isEmpty() )
167 rStrName, aDisplayName );
168 rStrName = aDisplayName;
180 const OUString& rStrName,
185 drawing::LineDash aLineDash;
187 if( rStrName.isEmpty() )
190 if( !(rValue >>= aLineDash) )
193 bool bIsRel = aLineDash.Style == drawing::DashStyle_RECTRELATIVE || aLineDash.Style == drawing::DashStyle_ROUNDRELATIVE;
199 bool bEncoded =
false;
209 aStrValue = aOut.makeStringAndClear();
217 if( aLineDash.DotLen )
229 aStrValue = aOut.makeStringAndClear();
235 if( aLineDash.Dashes )
239 if( aLineDash.DashLen )
251 aStrValue = aOut.makeStringAndClear();
264 aLineDash.Distance );
266 aStrValue = aOut.makeStringAndClear();
SvXMLEnumMapEntry< drawing::DashStyle > const pXML_DashStyle_Enum[]
const SvXMLImport & m_rImport
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
OUString EncodeStyleName(const OUString &rName, bool *pEncoded=nullptr) const
const SvXMLUnitConverter & GetMM100UnitConverter() const
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...
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
void exportXML(const OUString &rStrName, const css::uno::Any &rValue)
XMLDashStyleExport(SvXMLExport &rExport)
void importXML(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Any &rValue, OUString &rStrName)
XMLDashStyleImport(SvXMLImport &rImport)
static bool convertPercent(sal_Int32 &rValue, std::u16string_view rString)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Handling of tokens in XML:
#define XMLOFF_WARN_UNKNOWN(area, rIter)
#define XML_ELEMENT(prefix, name)
constexpr sal_uInt16 XML_NAMESPACE_DRAW