24#include <com/sun/star/awt/ColorStop.hpp>
25#include <com/sun/star/awt/Gradient2.hpp>
26#include <com/sun/star/awt/XBitmap.hpp>
27#include <com/sun/star/container/XNameContainer.hpp>
28#include <com/sun/star/graphic/XGraphic.hpp>
29#include <com/sun/star/rendering/RGBColor.hpp>
49 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList)
63 const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList)
77 awt::Gradient2 aGradient;
83 uno::Reference< container::XNameContainer > xGradient(
GetImport().GetGradientHelper() );
98 catch( container::ElementExistException& )
108 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList)
122 uno::Reference< container::XNameContainer > xHatch(
GetImport().GetHatchHelper() );
138 catch( container::ElementExistException& )
149 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList)
162 const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
191 if (!
maAny.has<uno::Reference<graphic::XGraphic>>())
194 uno::Reference<container::XNameContainer> xBitmapContainer(
GetImport().GetBitmapHelper());
196 uno::Reference<graphic::XGraphic> xGraphic =
maAny.get<uno::Reference<graphic::XGraphic>>();
197 uno::Reference<awt::XBitmap> xBitmap(xGraphic, uno::UNO_QUERY);
201 if (xBitmapContainer.is())
203 if (xBitmapContainer->hasByName(
maStrName))
213 catch (container::ElementExistException&)
224 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList)
238 const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList)
248 uno::Reference< container::XNameContainer > xTransGradient(
GetImport().GetTransGradientHelper() );
254 awt::Gradient2 aGradient;
262 if(xTransGradient.is())
264 if( xTransGradient->hasByName(
maStrName ) )
274 catch( container::ElementExistException& )
284 SvXMLImport& rImport, sal_Int32 nElement,
285 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList,
286 std::vector<awt::ColorStop>& rColorStopVec)
292 double fOffset = -1.0;
293 css::rendering::RGBColor aRGBColor;
296 switch(aIter.getToken())
306 double fOpacity = 1.0;
310 double fGrayComponent = std::clamp<double>(1.0 - fOpacity, 0.0, 1.0);
311 aRGBColor.Red = fGrayComponent;
312 aRGBColor.Green = fGrayComponent;
313 aRGBColor.Blue = fGrayComponent;
321 awt::ColorStop aColorStop;
322 aColorStop.StopOffset = fOffset;
323 aColorStop.StopColor = aRGBColor;
324 rColorStopVec.push_back(aColorStop);
332 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList)
346 uno::Reference< container::XNameContainer > xMarker(
GetImport().GetMarkerHelper() );
362 catch( container::ElementExistException& )
373 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList)
387 uno::Reference< container::XNameContainer > xDashes(
GetImport().GetDashHelper() );
403 catch( container::ElementExistException& )
SvXMLImport & GetImport()
virtual ~XMLBitmapStyleContext() override
XMLBitmapStyleContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
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 ...
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
css::uno::Reference< css::io::XOutputStream > mxBase64Stream
virtual bool IsTransient() const override
if this method returns true, its parent styles context should not add it to its container.
virtual bool IsTransient() const override
if this method returns true, its parent styles context should not add it to its container.
XMLDashStyleContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
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 ...
virtual ~XMLDashStyleContext() override
void importXML(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Any &rValue, OUString &rStrName)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
virtual ~XMLGradientStyleContext() override
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 ...
XMLGradientStyleContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
std::vector< css::awt::ColorStop > maColorStopVec
virtual bool IsTransient() const override
if this method returns true, its parent styles context should not add it to its container.
void importXML(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Any &rValue, OUString &rStrName)
virtual bool IsTransient() const override
if this method returns true, its parent styles context should not add it to its container.
virtual ~XMLHatchStyleContext() override
XMLHatchStyleContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
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 ...
void importXML(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Any &rValue, OUString &rStrName)
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 ...
virtual ~XMLMarkerStyleContext() override
XMLMarkerStyleContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
virtual bool IsTransient() const override
if this method returns true, its parent styles context should not add it to its container.
void importXML(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Any &rValue, OUString &rStrName)
virtual bool IsTransient() const override
if this method returns true, its parent styles context should not add it to its container.
virtual ~XMLTransGradientStyleContext() override
std::vector< css::awt::ColorStop > maColorStopVec
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 ...
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
XMLTransGradientStyleContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
void importXML(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Any &rValue, OUString &rStrName)
XMLTransparencyStopContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, std::vector< css::awt::ColorStop > &rColorStopVec)
virtual ~XMLTransparencyStopContext() override
static void convertDouble(OUStringBuffer &rBuffer, double fNumber, bool bWriteUnits, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit)
XMLOFF_DLLPUBLIC bool importXML(css::uno::Reference< css::xml::sax::XFastAttributeList > const &xAttrList, css::uno::Any &rValue, OUString &rStrName, SvXMLImport &rImport)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
#define XMLOFF_WARN_UNKNOWN(area, rIter)
#define XML_ELEMENT(prefix, name)