summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/sdi/tabvwsh.sdi3
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx2
-rw-r--r--sc/source/ui/view/tabvwshb.cxx48
-rw-r--r--sc/uiconfig/scalc/menubar/menubar.xml1
-rw-r--r--sc/uiconfig/scalc/popupmenu/graphic.xml2
5 files changed, 56 insertions, 0 deletions
diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi
index 4f9b451b05e2..965e8656d34d 100644
--- a/sc/sdi/tabvwsh.sdi
+++ b/sc/sdi/tabvwsh.sdi
@@ -60,6 +60,9 @@ interface BaseSelection
SID_EDIT_SIGNATURELINE [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ]
SID_SIGN_SIGNATURELINE [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ]
+ SID_INSERT_QRCODE [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ]
+ SID_EDIT_QRCODE [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ]
+
SID_IMAP [ ExecMethod = ExecImageMap; StateMethod = GetImageMapState; ]
SID_IMAP_EXEC [ ExecMethod = ExecImageMap; StateMethod = GetImageMapState; ]
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 64951da8ab4c..3e863a3881bb 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -20,6 +20,7 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_TABVWSH_HXX
#define INCLUDED_SC_SOURCE_UI_INC_TABVWSH_HXX
+#include <com/sun/star/drawing/QRCode.hpp>
#include <formula/errorcodes.hxx>
#include <formula/opcode.hxx>
#include <svx/fmshell.hxx>
@@ -171,6 +172,7 @@ private:
void DoReadUserDataSequence( const css::uno::Sequence< css::beans::PropertyValue >& rSettings );
bool IsSignatureLineSelected();
bool IsSignatureLineSigned();
+ bool IsQRCodeSelected();
DECL_LINK( SimpleRefClose, const OUString*, void );
DECL_LINK( SimpleRefDone, const OUString&, void );
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index cc7492d8a17a..8c7cc954f009 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/embed/EmbedMisc.hpp>
#include <com/sun/star/embed/EmbedStates.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/drawing/QRCode.hpp>
#include <vcl/errinf.hxx>
#include <sfx2/app.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -370,6 +371,18 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
break;
}
+ case SID_INSERT_QRCODE:
+ case SID_EDIT_QRCODE:
+ {
+ const uno::Reference<frame::XModel> xModel( GetViewData().GetDocShell()->GetBaseModel() );
+
+ VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
+ ScopedVclPtr<AbstractQrCodeGenDialog> pDialog(pFact->CreateQrCodeGenDialog(
+ pWin->GetFrameWeld(), xModel, rReq.GetSlot() == SID_EDIT_QRCODE));
+ pDialog->Execute();
+ break;
+ }
+
case SID_OBJECTRESIZE:
{
// the server would like to change the client size
@@ -523,6 +536,15 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet)
rSet.DisableItem(nWhich);
break;
+ case SID_INSERT_QRCODE:
+ if ( bTabProt || bShared || (pSdrView && pSdrView->GetMarkedObjectCount() != 0))
+ rSet.DisableItem( nWhich );
+ break;
+ case SID_EDIT_QRCODE:
+ if (!IsQRCodeSelected())
+ rSet.DisableItem(nWhich);
+ break;
+
case SID_INSERT_GRAPHIC:
if (bTabProt || bShared)
{
@@ -577,6 +599,32 @@ bool ScTabViewShell::IsSignatureLineSelected()
return pGraphic->isSignatureLine();
}
+bool ScTabViewShell::IsQRCodeSelected()
+{
+ SdrView* pSdrView = GetSdrView();
+ if (!pSdrView)
+ return false;
+
+ if (pSdrView->GetMarkedObjectCount() != 1)
+ return false;
+
+ SdrObject* pPickObj = pSdrView->GetMarkedObjectByIndex(0);
+ if (!pPickObj)
+ return false;
+
+ SdrGrafObj* pGraphic = dynamic_cast<SdrGrafObj*>(pPickObj);
+ if (!pGraphic)
+ return false;
+
+ if(pGraphic->getQrCode())
+ {
+ return true;
+ }
+ else{
+ return false;
+ }
+}
+
bool ScTabViewShell::IsSignatureLineSigned()
{
SdrView* pSdrView = GetSdrView();
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index 4a45eee3aab7..416b25a67d93 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -311,6 +311,7 @@
</menu:menupopup>
</menu:menu>
<menu:menuitem menu:id=".uno:InsertSignatureLine" menu:style="text"/>
+ <menu:menuitem menu:id=".uno:InsertQrCode" menu:style="text"/>
</menu:menupopup>
</menu:menu>
<menu:menu menu:id=".uno:FormatMenu">
diff --git a/sc/uiconfig/scalc/popupmenu/graphic.xml b/sc/uiconfig/scalc/popupmenu/graphic.xml
index dd08d1cc56e2..72477181eb05 100644
--- a/sc/uiconfig/scalc/popupmenu/graphic.xml
+++ b/sc/uiconfig/scalc/popupmenu/graphic.xml
@@ -68,4 +68,6 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:EditSignatureLine"/>
<menu:menuitem menu:id=".uno:SignSignatureLine"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:EditQrCode"/>
</menu:menupopup>