From d37a44a9ebdafec1435f98194417a1d8cc8208b5 Mon Sep 17 00:00:00 2001 From: homeboy445 Date: Mon, 12 Apr 2021 20:31:05 +0530 Subject: [PATCH] tdf#141193 Added support for bar codes in qrcode dialog box[API Change]. Change-Id: I6b79ece1d5419ef92b76755d3bd921a64d6e38fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113989 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas --- cui/source/dialogs/QrCodeGenDialog.cxx | 68 +++++++++++------- cui/source/inc/QrCodeGenDialog.hxx | 1 + cui/uiconfig/ui/qrcodegen.ui | 43 ++++++++++- include/editeng/unoprnms.hxx | 2 +- include/svx/svdograf.hxx | 12 ++-- include/svx/unoshprp.hxx | 4 +- include/xmloff/xmltoken.hxx | 1 + offapi/UnoApi_offapi.mk | 4 +- .../star/drawing/{QRCode.idl => BarCode.idl} | 26 ++++--- ...rection.idl => BarCodeErrorCorrection.idl} | 16 ++--- .../sun/star/drawing/GraphicObjectShape.idl | 4 +- offapi/type_reference/offapi.idl | 7 +- .../openoffice/Office/UI/GenericCommands.xcu | 4 +- sc/qa/uitest/calc_tests3/insertQrCodeGen.py | 12 ++-- .../OpenDocument-v1.3+libreoffice-schema.rng | 3 + svx/source/svdraw/svdograf.cxx | 6 +- svx/source/unodraw/unoshap2.cxx | 10 +-- .../odfexport/data/qrcode-properties.odt | Bin 36407 -> 11634 bytes sw/qa/extras/odfexport/odfexport.cxx | 14 ++-- sw/qa/uitest/writer_tests3/insertQrCodeGen.py | 12 ++-- xmloff/source/core/xmltoken.cxx | 1 + xmloff/source/draw/QRCodeContext.cxx | 27 ++++--- xmloff/source/draw/shapeexport.cxx | 27 +++---- xmloff/source/token/tokens.txt | 1 + 24 files changed, 190 insertions(+), 115 deletions(-) rename offapi/com/sun/star/drawing/{QRCode.idl => BarCode.idl} (53%) rename offapi/com/sun/star/drawing/{QRCodeErrorCorrection.idl => BarCodeErrorCorrection.idl} (76%) diff --git a/cui/source/dialogs/QrCodeGenDialog.cxx b/cui/source/dialogs/QrCodeGenDialog.cxx index d2a0f42878ff..271d14999cbf 100644 --- a/cui/source/dialogs/QrCodeGenDialog.cxx +++ b/cui/source/dialogs/QrCodeGenDialog.cxx @@ -43,8 +43,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -100,29 +100,40 @@ OString ConvertToSVGFormat(const ZXing::BitMatrix& bitmatrix) return sb.toString(); } -OString GenerateQRCode(std::u16string_view aQRText, tools::Long aQRECC, int aQRBorder) +std::string GetBarCodeType(const int& type) +{ + switch (type) + { + case 1: + return "CODE_128"; + default: + return "QR_CODE"; + } +} + +OString GenerateQRCode(std::u16string_view aQRText, tools::Long aQRECC, int aQRBorder, int aQRType) { // Associated ZXing error correction levels (0-8) to our constants arbitrarily. int bqrEcc = 1; switch (aQRECC) { - case css::drawing::QRCodeErrorCorrection::LOW: + case css::drawing::BarCodeErrorCorrection::LOW: { bqrEcc = 1; break; } - case css::drawing::QRCodeErrorCorrection::MEDIUM: + case css::drawing::BarCodeErrorCorrection::MEDIUM: { bqrEcc = 3; break; } - case css::drawing::QRCodeErrorCorrection::QUARTILE: + case css::drawing::BarCodeErrorCorrection::QUARTILE: { bqrEcc = 5; break; } - case css::drawing::QRCodeErrorCorrection::HIGH: + case css::drawing::BarCodeErrorCorrection::HIGH: { bqrEcc = 7; break; @@ -131,7 +142,7 @@ OString GenerateQRCode(std::u16string_view aQRText, tools::Long aQRECC, int aQRB OString o = OUStringToOString(aQRText, RTL_TEXTENCODING_UTF8); std::string QRText(o.getStr(), o.getLength()); - ZXing::BarcodeFormat format = ZXing::BarcodeFormatFromString("QR_CODE"); + ZXing::BarcodeFormat format = ZXing::BarcodeFormatFromString(GetBarCodeType(aQRType)); auto writer = ZXing::MultiFormatWriter(format).setMargin(aQRBorder).setEccLevel(bqrEcc); writer.setEncoding(ZXing::CharacterSet::UTF8); ZXing::BitMatrix bitmatrix = writer.encode(ZXing::TextUtfEncoding::FromUtf8(QRText), 0, 0); @@ -151,6 +162,7 @@ QrCodeGenDialog::QrCodeGenDialog(weld::Widget* pParent, Reference xModel m_xBuilder->weld_radio_button("button_quartile"), m_xBuilder->weld_radio_button("button_high") } , m_xSpinBorder(m_xBuilder->weld_spin_button("edit_margin")) + , m_xComboType(m_xBuilder->weld_combo_box("choose_type")) #if ENABLE_ZXING , mpParent(pParent) #endif @@ -173,15 +185,17 @@ QrCodeGenDialog::QrCodeGenDialog(weld::Widget* pParent, Reference xModel Reference xProps(xIndexAccess->getByIndex(0), UNO_QUERY_THROW); // Read properties from selected QR Code - css::drawing::QRCode aQRCode; - xProps->getPropertyValue("QRCodeProperties") >>= aQRCode; + css::drawing::BarCode aBarCode; + xProps->getPropertyValue("BarCodeProperties") >>= aBarCode; - m_xEdittext->set_text(aQRCode.Payload); + m_xEdittext->set_text(aBarCode.Payload); //Get Error Correction Constant from selected QR Code - GetErrorCorrection(aQRCode.ErrorCorrection); + GetErrorCorrection(aBarCode.ErrorCorrection); - m_xSpinBorder->set_value(aQRCode.Border); + m_xSpinBorder->set_value(aBarCode.Border); + + m_xComboType->set_active(aBarCode.Type); // Mark this as existing shape m_xExistingShapeProperties = xProps; @@ -221,8 +235,9 @@ short QrCodeGenDialog::run() void QrCodeGenDialog::Apply() { #if ENABLE_ZXING - css::drawing::QRCode aQRCode; - aQRCode.Payload = m_xEdittext->get_text(); + css::drawing::BarCode aBarCode; + aBarCode.Payload = m_xEdittext->get_text(); + aBarCode.Type = m_xComboType->get_active(); bool bLowECCActive(m_xECC[0]->get_active()); bool bMediumECCActive(m_xECC[1]->get_active()); @@ -230,25 +245,26 @@ void QrCodeGenDialog::Apply() if (bLowECCActive) { - aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::LOW; + aBarCode.ErrorCorrection = css::drawing::BarCodeErrorCorrection::LOW; } else if (bMediumECCActive) { - aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::MEDIUM; + aBarCode.ErrorCorrection = css::drawing::BarCodeErrorCorrection::MEDIUM; } else if (bQuartileECCActive) { - aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::QUARTILE; + aBarCode.ErrorCorrection = css::drawing::BarCodeErrorCorrection::QUARTILE; } else { - aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::HIGH; + aBarCode.ErrorCorrection = css::drawing::BarCodeErrorCorrection::HIGH; } - aQRCode.Border = m_xSpinBorder->get_value(); + aBarCode.Border = m_xSpinBorder->get_value(); // Read svg and replace placeholder texts - OString aSvgImage = GenerateQRCode(aQRCode.Payload, aQRCode.ErrorCorrection, aQRCode.Border); + OString aSvgImage = GenerateQRCode(aBarCode.Payload, aBarCode.ErrorCorrection, aBarCode.Border, + aBarCode.Type); // Insert/Update graphic SvMemoryStream aSvgStream(4096, 4096); @@ -273,7 +289,7 @@ void QrCodeGenDialog::Apply() xShapeProps->setPropertyValue("Graphic", Any(xGraphic)); // Set QRCode properties - xShapeProps->setPropertyValue("QRCodeProperties", Any(aQRCode)); + xShapeProps->setPropertyValue("BarCodeProperties", Any(aBarCode)); if (bIsExistingQRCode) return; @@ -346,22 +362,22 @@ void QrCodeGenDialog::GetErrorCorrection(tools::Long ErrorCorrection) { switch (ErrorCorrection) { - case css::drawing::QRCodeErrorCorrection::LOW: + case css::drawing::BarCodeErrorCorrection::LOW: { m_xECC[0]->set_active(true); break; } - case css::drawing::QRCodeErrorCorrection::MEDIUM: + case css::drawing::BarCodeErrorCorrection::MEDIUM: { m_xECC[1]->set_active(true); break; } - case css::drawing::QRCodeErrorCorrection::QUARTILE: + case css::drawing::BarCodeErrorCorrection::QUARTILE: { m_xECC[2]->set_active(true); break; } - case css::drawing::QRCodeErrorCorrection::HIGH: + case css::drawing::BarCodeErrorCorrection::HIGH: { m_xECC[3]->set_active(true); break; diff --git a/cui/source/inc/QrCodeGenDialog.hxx b/cui/source/inc/QrCodeGenDialog.hxx index 6935c3045869..165bc6d75f4a 100644 --- a/cui/source/inc/QrCodeGenDialog.hxx +++ b/cui/source/inc/QrCodeGenDialog.hxx @@ -33,6 +33,7 @@ private: std::unique_ptr m_xEdittext; std::unique_ptr m_xECC[4]; std::unique_ptr m_xSpinBorder; + std::unique_ptr m_xComboType; #if ENABLE_ZXING weld::Widget* mpParent; #endif diff --git a/cui/uiconfig/ui/qrcodegen.ui b/cui/uiconfig/ui/qrcodegen.ui index 51a71f7c39d7..8b1734c5ae1a 100644 --- a/cui/uiconfig/ui/qrcodegen.ui +++ b/cui/uiconfig/ui/qrcodegen.ui @@ -9,9 +9,9 @@ 10 - False - 6 - QR Code Generator + False + 6 + QR and Barcode True 0 0 @@ -154,6 +154,43 @@ 2 + + + True + False + start + Type: + True + choose_type + 0 + + + 0 + 3 + + + + + True + False + True + 0 + + QR Code + Bar Code + + + + The type which is to be generated. + + + + + 1 + 3 + 2 + + diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx index f99ddac50414..4f1d4ad4b0e1 100644 --- a/include/editeng/unoprnms.hxx +++ b/include/editeng/unoprnms.hxx @@ -181,7 +181,7 @@ #define UNO_NAME_GRAPHOBJ_SIGNATURELINE_CAN_ADD_COMMENT "SignatureLineCanAddComment" #define UNO_NAME_GRAPHOBJ_SIGNATURELINE_UNSIGNED_IMAGE "SignatureLineUnsignedImage" #define UNO_NAME_GRAPHOBJ_SIGNATURELINE_IS_SIGNED "SignatureLineIsSigned" -#define UNO_NAME_GRAPHOBJ_QRCODE "QRCodeProperties" +#define UNO_NAME_GRAPHOBJ_QRCODE "BarCodeProperties" #define UNO_NAME_OLE2_METAFILE "MetaFile" #define UNO_NAME_OLE2_PERSISTNAME "PersistName" diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx index 69ce11533caa..7c6f9865002e 100644 --- a/include/svx/svdograf.hxx +++ b/include/svx/svdograf.hxx @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include @@ -102,7 +102,7 @@ private: bool mbSignatureLineIsSigned; css::uno::Reference mpSignatureLineUnsignedGraphic; - std::unique_ptr mpQrCode; + std::unique_ptr mpBarCode; void ImpRegisterLink(); void ImpDeregisterLink(); void ImpSetLinkedGraphic( const Graphic& rGraphic ); @@ -287,14 +287,14 @@ public: void setSignatureLineIsSigned(bool bIsSigned) { mbSignatureLineIsSigned = bIsSigned; } // Qr Code - void setQrCode(css::drawing::QRCode& rQrCode) + void setQrCode(css::drawing::BarCode& rBarCode) { - mpQrCode = std::make_unique(rQrCode); + mpBarCode = std::make_unique(rBarCode); } - css::drawing::QRCode* getQrCode() const + css::drawing::BarCode* getQrCode() const { - return mpQrCode.get(); + return mpBarCode.get(); } }; diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx index 93c5faaa3f0c..ebc79e5ebee5 100644 --- a/include/svx/unoshprp.hxx +++ b/include/svx/unoshprp.hxx @@ -65,7 +65,7 @@ #include #include #include -#include +#include #include #include @@ -464,7 +464,7 @@ { u"" UNO_NAME_GRAPHOBJ_SIGNATURELINE_CAN_ADD_COMMENT, OWN_ATTR_SIGNATURELINE_CAN_ADD_COMMENT, cppu::UnoType::get(), 0, 0}, \ { u"" UNO_NAME_GRAPHOBJ_SIGNATURELINE_UNSIGNED_IMAGE, OWN_ATTR_SIGNATURELINE_UNSIGNED_IMAGE, cppu::UnoType::get(), 0, 0}, \ { u"" UNO_NAME_GRAPHOBJ_SIGNATURELINE_IS_SIGNED, OWN_ATTR_SIGNATURELINE_IS_SIGNED , cppu::UnoType::get(), 0, 0}, \ - { u"" UNO_NAME_GRAPHOBJ_QRCODE, OWN_ATTR_QRCODE , cppu::UnoType::get(), 0, 0}, + { u"" UNO_NAME_GRAPHOBJ_QRCODE, OWN_ATTR_QRCODE , cppu::UnoType::get(), 0, 0}, #define SPECIAL_3DSCENEOBJECT_PROPERTIES_DEFAULTS \ { u"" UNO_NAME_3D_SCENE_AMBIENTCOLOR, SDRATTR_3DSCENE_AMBIENTCOLOR , ::cppu::UnoType::get(), 0, 0}, \ diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index c8dedd84b4b2..c510b8cab00d 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -1550,6 +1550,7 @@ namespace xmloff::token { XML_QRCODE, XML_QRCODE_BORDER, XML_QRCODE_ERROR_CORRECTION, + XML_QRCODE_TYPE, XML_QUARTER, XML_QUERY_NAME, XML_QUO_VADIS, diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 7509d0ff5163..26b56bedd8e5 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -2269,6 +2269,8 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/document,\ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/drawing,\ Alignment \ Arrangement \ + BarCode \ + BarCodeErrorCorrection \ BezierPoint \ BitmapMode \ BoundVolume \ @@ -2331,8 +2333,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/drawing,\ PolygonKind \ Position3D \ ProjectionMode \ - QRCode \ - QRCodeErrorCorrection \ RectanglePoint \ ShadeMode \ ShadingPattern \ diff --git a/offapi/com/sun/star/drawing/QRCode.idl b/offapi/com/sun/star/drawing/BarCode.idl similarity index 53% rename from offapi/com/sun/star/drawing/QRCode.idl rename to offapi/com/sun/star/drawing/BarCode.idl index 09144f0f40bc..ef26aa9458be 100644 --- a/offapi/com/sun/star/drawing/QRCode.idl +++ b/offapi/com/sun/star/drawing/BarCode.idl @@ -7,29 +7,35 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef __com_sun_star_drawing_QRCode_idl__ -#define __com_sun_star_drawing_QRCode_idl__ +#ifndef __com_sun_star_drawing_BarCode_idl__ +#define __com_sun_star_drawing_BarCode_idl__ module com { module sun { module star { module drawing { -/// This struct defines the attributes of a QR Code -/// @since LibreOffice 6.4 +/// This struct defines the attributes of a Bar Code +/// @since LibreOffice 7.3 -published struct QRCode +published struct BarCode { - /** Text for which QR Code is made + /** Type of the Bar Code + that is to be generated. + Supported types - 0:"QR Code", 1:"Code 128" + */ + long Type; + + /** Text for which Bar Code is made */ string Payload; - /** Qr Code Error Correction Level - @see drawing/QRCodeErrorCorrection + /** Bar Code Error Correction Level + @see drawing/BarCodeErrorCorrection */ long ErrorCorrection; - /** Border surrounding the Qr Code + /** Border surrounding the Bar Code It is a non-negative value. - One Border unit is equal to one dot in the generated QR code. + One Border unit is equal to one dot in the generated Bar code. */ long Border; }; diff --git a/offapi/com/sun/star/drawing/QRCodeErrorCorrection.idl b/offapi/com/sun/star/drawing/BarCodeErrorCorrection.idl similarity index 76% rename from offapi/com/sun/star/drawing/QRCodeErrorCorrection.idl rename to offapi/com/sun/star/drawing/BarCodeErrorCorrection.idl index b1d45e858571..9314bacb5b97 100644 --- a/offapi/com/sun/star/drawing/QRCodeErrorCorrection.idl +++ b/offapi/com/sun/star/drawing/BarCodeErrorCorrection.idl @@ -7,16 +7,16 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef __com_sun_star_drawing_QRCodeErrorCorrection_idl__ -#define __com_sun_star_drawing_QRCodeErrorCorrection_idl__ +#ifndef __com_sun_star_drawing_BarCodeErrorCorrection_idl__ +#define __com_sun_star_drawing_BarCodeErrorCorrection_idl__ module com { module sun { module star { module drawing { /** These constants identify the type of Error Correction for - a QR Code. + a Bar Code. -

The Error Correction for a QR code is a measure that - helps a QR code to recover, if it is destroyed. +

The Error Correction for a Bar code is a measure that + helps a Bar code to recover, if it is destroyed. Level L (Low) 7% of codewords can be restored. Level M (Medium) 15% of codewords can be restored. @@ -26,13 +26,13 @@ module com { module sun { module star { module drawing { More Info - here

- @see QRCode + @see BarCode @see GraphicObectShape - @since LibreOffice 6.4 + @since LibreOffice 7.3 */ -published constants QRCodeErrorCorrection +published constants BarCodeErrorCorrection { const long LOW = 1; diff --git a/offapi/com/sun/star/drawing/GraphicObjectShape.idl b/offapi/com/sun/star/drawing/GraphicObjectShape.idl index 3e415c1f466b..4a9272b517ae 100644 --- a/offapi/com/sun/star/drawing/GraphicObjectShape.idl +++ b/offapi/com/sun/star/drawing/GraphicObjectShape.idl @@ -32,7 +32,7 @@ #include #include -#include +#include module com { module sun { module star { module drawing { @@ -158,7 +158,7 @@ published service GraphicObjectShape /// Shape as a QR Code /// @since LibreOffice 6.4 - [optional, property] com::sun::star::drawing::QRCode QRCodeProperties; + [optional, property] com::sun::star::drawing::BarCode BarCodeProperties; }; diff --git a/offapi/type_reference/offapi.idl b/offapi/type_reference/offapi.idl index eac8de069d1e..6c4b9ddb1c68 100644 --- a/offapi/type_reference/offapi.idl +++ b/offapi/type_reference/offapi.idl @@ -5538,7 +5538,8 @@ module com { interface ::com::sun::star::document::XMimeTypeInfo; }; published service GraphicExportFilter: ::com::sun::star::drawing::XGraphicExportFilter; - published struct QRCode { + published struct BarCode { + long Type; string Payload; long ErrorCorrection; long Border; @@ -5571,7 +5572,7 @@ module com { [property, optional] boolean SignatureLineCanAddComment; [property, optional] ::com::sun::star::graphic::XGraphic SignatureLineUnsignedImage; [property, optional] boolean SignatureLineIsSigned; - [property, optional] ::com::sun::star::drawing::QRCode QRCodeProperties; + [property, optional] ::com::sun::star::drawing::BarCode BarCodeProperties; }; /** @deprecated */ published interface XShapeGroup { interface ::com::sun::star::drawing::XShape; @@ -5745,7 +5746,7 @@ module com { ::com::sun::star::drawing::DoubleSequenceSequence SequenceY; ::com::sun::star::drawing::DoubleSequenceSequence SequenceZ; }; - published constants QRCodeErrorCorrection { + published constants BarCodeErrorCorrection { const long HIGH = 4; const long LOW = 1; const long MEDIUM = 2; diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index c45aab0823b4..b3a0a96cd346 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -7203,7 +7203,7 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 - ~QR Code... + ~Bar Code... 1 @@ -7211,7 +7211,7 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 - ~Edit QR Code... + ~Edit Bar Code... 1 diff --git a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py index 2f87eedec717..ffc2dd37047f 100644 --- a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py +++ b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py @@ -38,9 +38,9 @@ class insertQrCode(UITestCase): xBorder.executeAction("DOWN", tuple()) # check the QR code in the document - self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org") - self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1) - self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Border, 1) + self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.Payload, "www.libreoffice.org") + self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.ErrorCorrection, 1) + self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.Border, 1) def test_insert_qr_code_gen2(self): @@ -60,8 +60,8 @@ class insertQrCode(UITestCase): xBorder.executeAction("DOWN", tuple()) #check the QR Code in the document - self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org") - self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1) - self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Border, 1) + self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.Payload, "www.libreoffice.org") + self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.ErrorCorrection, 1) + self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.Border, 1) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng index 0c467fdc3780..3919ba47f04f 100644 --- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng +++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng @@ -1811,6 +1811,9 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1. + + + diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 03600b9b0759..027301bedb43 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -236,13 +236,13 @@ SdrGrafObj::SdrGrafObj(SdrModel& rSdrModel, SdrGrafObj const & rSource) mbSignatureLineIsSigned = false; mpSignatureLineUnsignedGraphic = rSource.mpSignatureLineUnsignedGraphic; - if(rSource.mpQrCode) + if(rSource.mpBarCode) { - mpQrCode = std::make_unique(*rSource.mpQrCode); + mpBarCode = std::make_unique(*rSource.mpBarCode); } else { - mpQrCode.reset(); + mpBarCode.reset(); } if (mbIsSignatureLine && rSource.mpSignatureLineUnsignedGraphic) diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index ad441e7a725d..710f2e38099d 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -1382,10 +1382,10 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte case OWN_ATTR_QRCODE: { - css::drawing::QRCode aQrCode; - if (rValue >>= aQrCode) + css::drawing::BarCode aBarCode; + if (rValue >>= aBarCode) { - static_cast(GetSdrObject())->setQrCode(aQrCode); + static_cast(GetSdrObject())->setQrCode(aBarCode); bOk = true; } break; @@ -1535,7 +1535,7 @@ bool SvxGraphicObject::getPropertyValueImpl( const OUString& rName, const SfxIte case OWN_ATTR_QRCODE: { - css::drawing::QRCode* ptr = static_cast(GetSdrObject())->getQrCode(); + css::drawing::BarCode* ptr = static_cast(GetSdrObject())->getQrCode(); if(ptr) { rValue <<= *ptr; diff --git a/sw/qa/extras/odfexport/data/qrcode-properties.odt b/sw/qa/extras/odfexport/data/qrcode-properties.odt index 6aa3ed252b50fc58a6a00a49d7e9cbf6a613cfeb..2de59b0414ee2ed62b81cee920d25f38776534f2 100644 GIT binary patch literal 11634 zcmd6NbzGEdxAq9qC?h4^C?GX-BPlH)C0#=~gfQe#($d`>(%oGW5+WTE0s_+A3>?_+ z@pbQgw(obo@2_vo@0t64<~QrQJJwp4qAcQlTmS$S007Ccz0&Pw!+Z(=0PddKp8%HT zmSCu}4cNfO24Zex05!L^VsWrCX0|r4Gq+>5wgFoiTN~M1f~}y;P_PqJ@h@Pv`u`S^ z+nkuSm5I5jz3m?`c5EyLMn+%=`1aM>mgV=F)ZfRf&wqp@Bhgurg*!>4(qJL0^ zT3bVG46MMA|Dg9z)wQv;Hnj!Y*%=!Ar|SMwiFQx}sQv#zkKi{o{m-TSla>j@+5igv zzpbNa?LgZ9hhF)o((Y7#)e#jH^^bXU+n9d~=55Z>z{=bNYzJkwH8vTH8np6e z1^Vm?_<}!AJ!e5evZd>*w@7Q_^wU6MIY`8wZwZZ3Q_3#bNE=%&kz`*8txDQ9An6UN z$ZJ>OFrugJlQOGbf5z9yT%YrmZ)U3I8F?bB}d?V5S$hH$C0%0V3R{BxG+Mfh6P0lDgnQbk!5 z)T&dn5u|$nfHxul@UQv*Pu=&&G6X{nn4K&kA+JO#lPCz9PSuSerRY+b5ug^?+}ufX z)5On5u_9+2RmdbCWyp0qytu+t43J^NroglpHhRwNfcpeDm6=g)=LWWVw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DaJ9WtF3i{EeAC#? z=5>Sfx4o-$q_tJmvcrx(FH~={H>JfcFI)Yg{W9q6ULP~f_G8T{Y>TZ-WAxk~OOs`( zpgcVGGox&2of)mAVt(qMOVqN9%AHyp%7gw|FBf+ms6%KK*BRwS%9PE=V*9C}y{J#Q z=X(=Ov;Ug6A784Si}uue&6suNwewcL-&k^m^LJlc*5B5301I z)M{G2wYqvNSMMKMvtD_rNbYhpb_SiwvnRKP_mXVyx)t^9sjXKX-`?)k!lY^qJ#A=? zeie zasF8d(`7e5N|(I#z{=0^d*=)X<@U2mu_I|S+`2Cf^VJRI8IaM2eSrqx@1Mqkee=9}^gnkW(*BC=33gcyr dB|Se`t@x5uccsJSUHkcv@-P2KUa #include #include -#include -#include +#include +#include #include #include #include @@ -2866,14 +2866,14 @@ DECLARE_ODFEXPORT_TEST(testQrCodeGenProperties, "qrcode-properties.odt") uno::Reference xShape = getShape(1); CPPUNIT_ASSERT(xShape.is()); - css::drawing::QRCode aQRCode = getProperty(xShape, "QRCodeProperties"); + css::drawing::BarCode aBarCode = getProperty(xShape, "BarCodeProperties"); CPPUNIT_ASSERT_EQUAL(OUString("www.libreoffice.org"), - aQRCode.Payload); - CPPUNIT_ASSERT_EQUAL(css::drawing::QRCodeErrorCorrection::LOW, - aQRCode.ErrorCorrection); + aBarCode.Payload); + CPPUNIT_ASSERT_EQUAL(css::drawing::BarCodeErrorCorrection::LOW, + aBarCode.ErrorCorrection); CPPUNIT_ASSERT_EQUAL(sal_Int32(5), - aQRCode.Border); + aBarCode.Border); } DECLARE_ODFEXPORT_TEST(testChapterNumberingNewLine, "chapter-number-new-line.odt") diff --git a/sw/qa/uitest/writer_tests3/insertQrCodeGen.py b/sw/qa/uitest/writer_tests3/insertQrCodeGen.py index caf7bf660861..761fd0f2d790 100644 --- a/sw/qa/uitest/writer_tests3/insertQrCodeGen.py +++ b/sw/qa/uitest/writer_tests3/insertQrCodeGen.py @@ -37,9 +37,9 @@ class insertQrCode(UITestCase): xBorder.executeAction("DOWN", tuple()) # check the QR code in the document - self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org") - self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1) - self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.Border, 1) + self.assertEqual(document.DrawPage.getByIndex(0).BarCodeProperties.Payload, "www.libreoffice.org") + self.assertEqual(document.DrawPage.getByIndex(0).BarCodeProperties.ErrorCorrection, 1) + self.assertEqual(document.DrawPage.getByIndex(0).BarCodeProperties.Border, 1) def test_insert_qr_code_gen2(self): @@ -58,8 +58,8 @@ class insertQrCode(UITestCase): xBorder.executeAction("DOWN", tuple()) #check the QR Code in the document - self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org") - self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1) - self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.Border, 1) + self.assertEqual(document.DrawPage.getByIndex(0).BarCodeProperties.Payload, "www.libreoffice.org") + self.assertEqual(document.DrawPage.getByIndex(0).BarCodeProperties.ErrorCorrection, 1) + self.assertEqual(document.DrawPage.getByIndex(0).BarCodeProperties.Border, 1) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 52ecd9038cbb..704f374a5026 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -1563,6 +1563,7 @@ namespace xmloff::token { TOKEN( "qrcode", XML_QRCODE ), TOKEN( "qrcode-border", XML_QRCODE_BORDER ), TOKEN( "qrcode-errorcorrection", XML_QRCODE_ERROR_CORRECTION ), + TOKEN( "qrcode-type", XML_QRCODE_TYPE ), TOKEN( "quarter", XML_QUARTER ), TOKEN( "query-name", XML_QUERY_NAME ), TOKEN( "quo-vadis", XML_QUO_VADIS ), diff --git a/xmloff/source/draw/QRCodeContext.cxx b/xmloff/source/draw/QRCodeContext.cxx index f217fcf17ffa..597838f78cad 100644 --- a/xmloff/source/draw/QRCodeContext.cxx +++ b/xmloff/source/draw/QRCodeContext.cxx @@ -13,8 +13,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -42,7 +42,7 @@ QRCodeContext::QRCodeContext(SvXMLImport& rImport, sal_Int32 /*nElement*/, { Reference xPropSet(rxShape, UNO_QUERY_THROW); - css::drawing::QRCode aQRCode; + css::drawing::BarCode aBarCode; for (auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList)) { @@ -53,32 +53,39 @@ QRCodeContext::QRCodeContext(SvXMLImport& rImport, sal_Int32 /*nElement*/, OUString aErrorCorrValue = aIter.toString(); if (aErrorCorrValue == "low") - aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::LOW; + aBarCode.ErrorCorrection = css::drawing::BarCodeErrorCorrection::LOW; else if (aErrorCorrValue == "medium") - aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::MEDIUM; + aBarCode.ErrorCorrection = css::drawing::BarCodeErrorCorrection::MEDIUM; else if (aErrorCorrValue == "quartile") - aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::QUARTILE; + aBarCode.ErrorCorrection = css::drawing::BarCodeErrorCorrection::QUARTILE; else - aQRCode.ErrorCorrection = css::drawing::QRCodeErrorCorrection::HIGH; + aBarCode.ErrorCorrection = css::drawing::BarCodeErrorCorrection::HIGH; break; } case XML_ELEMENT(LO_EXT, XML_QRCODE_BORDER): { sal_Int32 nAttrVal; if (sax::Converter::convertNumber(nAttrVal, aIter.toView(), 0)) - aQRCode.Border = nAttrVal; + aBarCode.Border = nAttrVal; break; } case XML_ELEMENT(OFFICE, XML_STRING_VALUE): { - aQRCode.Payload = aIter.toString(); + aBarCode.Payload = aIter.toString(); + break; + } + case XML_ELEMENT(LO_EXT, XML_QRCODE_TYPE): + { + sal_Int32 nAttrVal; + if (sax::Converter::convertNumber(nAttrVal, aIter.toView(), 0)) + aBarCode.Type = nAttrVal; break; } default: XMLOFF_WARN_UNKNOWN("xmloff", aIter); } } - xPropSet->setPropertyValue("QRCodeProperties", Any(aQRCode)); + xPropSet->setPropertyValue("BarCodeProperties", Any(aBarCode)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index fd22a4dca5a2..dbd52fadd1d1 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -59,8 +59,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -1370,33 +1370,34 @@ void XMLShapeExport::ImpExportQRCode(const uno::Reference& xSha { uno::Reference xPropSet(xShape, uno::UNO_QUERY); - uno::Any aAny = xPropSet->getPropertyValue("QRCodeProperties"); + uno::Any aAny = xPropSet->getPropertyValue("BarCodeProperties"); - css::drawing::QRCode aQRCode; - if(!(aAny >>= aQRCode)) + css::drawing::BarCode aBarCode; + if(!(aAny >>= aBarCode)) return; - mrExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_STRING_VALUE, aQRCode.Payload); + mrExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_STRING_VALUE, aBarCode.Payload); /* Export QR Code as per customised schema, @see OpenDocument-schema-v1.3+libreoffice */ OUString temp; - switch(aQRCode.ErrorCorrection){ - case css::drawing::QRCodeErrorCorrection::LOW : + switch(aBarCode.ErrorCorrection){ + case css::drawing::BarCodeErrorCorrection::LOW : temp = "low"; break; - case css::drawing::QRCodeErrorCorrection::MEDIUM: + case css::drawing::BarCodeErrorCorrection::MEDIUM: temp = "medium"; break; - case css::drawing::QRCodeErrorCorrection::QUARTILE: + case css::drawing::BarCodeErrorCorrection::QUARTILE: temp = "quartile"; break; - case css::drawing::QRCodeErrorCorrection::HIGH: + case css::drawing::BarCodeErrorCorrection::HIGH: temp = "high"; break; } mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_QRCODE_ERROR_CORRECTION, temp); - mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_QRCODE_BORDER, OUString::number(aQRCode.Border)); + mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_QRCODE_BORDER, OUStringBuffer(20).append(aBarCode.Border).makeStringAndClear()); + mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_QRCODE_TYPE, OUStringBuffer(20).append(aBarCode.Type).makeStringAndClear()); - SvXMLElementExport aQRCodeElement(mrExport, XML_NAMESPACE_LO_EXT, XML_QRCODE, true, + SvXMLElementExport aBarCodeElement(mrExport, XML_NAMESPACE_LO_EXT, XML_QRCODE, true, true); } diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt index 395dffe62cf1..6e34ec554fab 100644 --- a/xmloff/source/token/tokens.txt +++ b/xmloff/source/token/tokens.txt @@ -1463,6 +1463,7 @@ pyramid qrcode qrcode-border qrcode-errorcorrection +qrcode-type quarter query-name quo-vadis