12#include <com/sun/star/beans/XPropertySet.hpp>
13#include <com/sun/star/embed/XStorage.hpp>
14#include <com/sun/star/frame/XStorable.hpp>
15#include <com/sun/star/graphic/XGraphic.hpp>
16#include <com/sun/star/drawing/BarCode.hpp>
17#include <com/sun/star/drawing/BarCodeErrorCorrection.hpp>
18#include <com/sun/star/xml/sax/XAttributeList.hpp>
26#include <rtl/ustring.hxx>
29using namespace css::xml::sax;
30using namespace css::uno;
31using namespace css::drawing;
32using namespace css::embed;
33using namespace css::frame;
34using namespace css::io;
35using namespace css::graphic;
39 const Reference<XFastAttributeList>& xAttrList,
40 const Reference<XShape>& rxShape)
43 Reference<beans::XPropertySet> xPropSet(rxShape, UNO_QUERY_THROW);
45 css::drawing::BarCode aBarCode;
49 switch (aIter.getToken())
53 OUString aErrorCorrValue = aIter.toString();
55 if (aErrorCorrValue ==
"low")
56 aBarCode.ErrorCorrection = css::drawing::BarCodeErrorCorrection::LOW;
57 else if (aErrorCorrValue ==
"medium")
58 aBarCode.ErrorCorrection = css::drawing::BarCodeErrorCorrection::MEDIUM;
59 else if (aErrorCorrValue ==
"quartile")
60 aBarCode.ErrorCorrection = css::drawing::BarCodeErrorCorrection::QUARTILE;
62 aBarCode.ErrorCorrection = css::drawing::BarCodeErrorCorrection::HIGH;
69 aBarCode.Border = nAttrVal;
74 aBarCode.Payload = aIter.toString();
81 aBarCode.Type = nAttrVal;
88 xPropSet->setPropertyValue(
"BarCodeProperties",
Any(aBarCode));
QRCodeContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, const css::uno::Reference< css::drawing::XShape > &rxShape)
This class deliberately does not support XWeak, to improve performance when loading large documents.
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Handling of tokens in XML:
@ XML_QRCODE_ERROR_CORRECTION
#define XMLOFF_WARN_UNKNOWN(area, rIter)
#define XML_ELEMENT(prefix, name)