diff options
author | Shubham Goyal <22shubh22@gmail.com> | 2019-07-03 12:15:08 +0530 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-07-25 07:15:10 +0200 |
commit | 2de42b53b7c23223c38e64a75eae248d8a0cd4ec (patch) | |
tree | dc4b2fc96a0569b7c0ebfdc80446181c842a9964 /svx | |
parent | 5ccc8124a03cffca3a1848f754524a06a063cb51 (diff) |
QRCode Dialog Box feature
The patch handles the created QR code as a Customized Shape (Graphic
Object)
Change-Id: I1cee6f0e7fac585de880a9ac34e3bc441a4b7390
Reviewed-on: https://gerrit.libreoffice.org/74167
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 10 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap2.cxx | 22 |
2 files changed, 32 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index b99ab8de5251..c74de64e69a4 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -743,6 +743,16 @@ SdrGrafObj& SdrGrafObj::operator=( const SdrGrafObj& rObj ) mbIsSignatureLineCanAddComment = rObj.mbIsSignatureLineCanAddComment; mbSignatureLineIsSigned = false; mpSignatureLineUnsignedGraphic = rObj.mpSignatureLineUnsignedGraphic; + + if(rObj.mpQrCode) + { + mpQrCode = std::make_unique<css::drawing::QRCode>(*rObj.mpQrCode); + } + else + { + mpQrCode.reset(); + } + if (mbIsSignatureLine && rObj.mpSignatureLineUnsignedGraphic) mpGraphicObject->SetGraphic(rObj.mpSignatureLineUnsignedGraphic); else diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 13e8205e353d..3589c088ac36 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/drawing/PointSequence.hpp> #include <com/sun/star/drawing/PolygonKind.hpp> #include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/drawing/QRCode.hpp> #include <o3tl/any.hxx> #include <tools/urlobj.hxx> #include <vcl/svapp.hxx> @@ -1416,6 +1417,17 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte break; } + case OWN_ATTR_QRCODE: + { + css::drawing::QRCode aQrCode; + if (rValue >>= aQrCode) + { + static_cast<SdrGrafObj*>(GetSdrObject())->setQrCode(aQrCode); + bOk = true; + } + break; + } + default: return SvxShapeText::setPropertyValueImpl( rName, pProperty, rValue ); } @@ -1558,6 +1570,16 @@ bool SvxGraphicObject::getPropertyValueImpl( const OUString& rName, const SfxIte break; } + case OWN_ATTR_QRCODE: + { + css::drawing::QRCode* ptr = static_cast<SdrGrafObj*>(GetSdrObject())->getQrCode(); + if(ptr) + { + rValue <<= *ptr; + } + break; + } + default: return SvxShapeText::getPropertyValueImpl(rName, pProperty,rValue); } |