21#include <com/sun/star/style/GraphicLocation.hpp>
22#include <com/sun/star/graphic/XGraphic.hpp>
28#include <rtl/ustrbuf.hxx>
46 const Any *pTransparency,
48 const OUString& rLocalName )
51 if( !(pPos && ((*pPos) >>=
ePos)) )
52 ePos = GraphicLocation_AREA;
54 uno::Reference<graphic::XGraphic> xGraphic;
55 if (rGraphicAny.has<uno::Reference<graphic::XGraphic>>())
56 xGraphic = rGraphicAny.get<uno::Reference<graphic::XGraphic>>();
58 if (xGraphic.is() && GraphicLocation_NONE !=
ePos)
60 OUString sUsedMimeType;
61 OUString sInternalURL(
GetExport().AddEmbeddedXGraphic(xGraphic, sUsedMimeType));
63 if (!sInternalURL.isEmpty())
73 case GraphicLocation_LEFT_TOP:
74 case GraphicLocation_MIDDLE_TOP:
75 case GraphicLocation_RIGHT_TOP:
78 case GraphicLocation_LEFT_MIDDLE:
79 case GraphicLocation_MIDDLE_MIDDLE:
80 case GraphicLocation_RIGHT_MIDDLE:
83 case GraphicLocation_LEFT_BOTTOM:
84 case GraphicLocation_MIDDLE_BOTTOM:
85 case GraphicLocation_RIGHT_BOTTOM:
98 case GraphicLocation_LEFT_TOP:
99 case GraphicLocation_LEFT_BOTTOM:
100 case GraphicLocation_LEFT_MIDDLE:
103 case GraphicLocation_MIDDLE_TOP:
104 case GraphicLocation_MIDDLE_MIDDLE:
105 case GraphicLocation_MIDDLE_BOTTOM:
108 case GraphicLocation_RIGHT_MIDDLE:
109 case GraphicLocation_RIGHT_TOP:
110 case GraphicLocation_RIGHT_BOTTOM:
117 if( !aOut.isEmpty() )
121 if( GraphicLocation_AREA ==
ePos )
125 else if( GraphicLocation_NONE !=
ePos && GraphicLocation_TILED !=
ePos )
129 if( !aOut.isEmpty() )
131 aOut.makeStringAndClear() );
136 (*pFilter) >>= sFilter;
137 if( !sFilter.isEmpty() )
145 if( (*pTransparency) >>= nTransparency )
147 OUStringBuffer aTransOut;
150 aTransOut.makeStringAndClear() );
157 if (xGraphic.is() && GraphicLocation_NONE !=
ePos)
css::chart::ChartAxisLabelPosition ePos
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
bool AddEmbeddedXGraphicAsBase64(css::uno::Reference< css::graphic::XGraphic > const &rxGraphic)
void exportXML(const css::uno::Any &rURL, const css::uno::Any *pPos, const css::uno::Any *pFilter, const css::uno::Any *pTransparency, sal_uInt16 nPrefix, const OUString &rLocalName)
SvXMLExport & GetExport() const
XMLBackgroundImageExport(SvXMLExport &rExport)
static bool convertPercent(sal_Int32 &rValue, std::u16string_view rString)
Handling of tokens in XML:
@ XML_BACKGROUND_NO_REPEAT
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
constexpr sal_uInt16 XML_NAMESPACE_DRAW
constexpr sal_uInt16 XML_NAMESPACE_XLINK
constexpr sal_uInt16 XML_NAMESPACE_STYLE