20 #include <com/sun/star/beans/XPropertySet.hpp>
21 #include <com/sun/star/graphic/XGraphic.hpp>
22 #include <osl/diagnose.h>
31 using ::com::sun::star::uno::Reference;
32 using ::com::sun::star::uno::makeAny;
41 const Reference< XFastAttributeList > & rAttrList,
44 m_xPropSet( rPropSet )
56 "neither URL nor base64 image data given" );
57 uno::Reference<graphic::XGraphic>
xGraphic;
71 catch (uno::Exception
const &)
74 Reference < XPropertySetInfo > xPropSetInfo =
m_xPropSet->getPropertySetInfo();
76 if (xGraphic.is() && xPropSetInfo->hasPropertyByName(
"Graphic"))
78 m_xPropSet->setPropertyValue(
"Graphic", uno::makeAny(xGraphic));
84 const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
css::uno::Reference< css::graphic::XGraphic > loadGraphicFromBase64(css::uno::Reference< css::io::XOutputStream > const &rxOutputStream)
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
SvXMLImport & GetImport()
css::uno::Reference< css::graphic::XGraphic > loadGraphicByURL(OUString const &rURL)
XMLReplacementImageContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &rAttrList, const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
css::uno::Reference< css::io::XOutputStream > GetStreamForGraphicObjectURLFromBase64() const
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
This class deliberately does not support XWeak, to improve performance when loading large documents...
Handling of tokens in XML:
#define XML_ELEMENT(prefix, name)
css::uno::Reference< css::io::XOutputStream > m_xBase64Stream
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
virtual ~XMLReplacementImageContext() override
css::uno::Reference< css::beans::XPropertySet > m_xPropSet
Reference< XGraphic > xGraphic