summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cui/source/factory/dlgfact.cxx13
-rw-r--r--cui/source/factory/dlgfact.hxx18
-rw-r--r--include/svx/svxids.hrc5
-rw-r--r--include/vcl/abstdlg.hxx13
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu16
-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
-rw-r--r--svx/sdi/svx.sdi34
-rw-r--r--sw/inc/view.hxx1
-rw-r--r--sw/sdi/viewsh.sdi12
-rw-r--r--sw/source/uibase/uiview/viewdlg2.cxx32
-rw-r--r--sw/source/uibase/uiview/viewstat.cxx11
-rw-r--r--sw/uiconfig/sglobal/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/swform/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/swriter/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/swxform/menubar/menubar.xml1
19 files changed, 214 insertions, 1 deletions
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index ce64ed27db69..37460b879aa0 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -61,6 +61,7 @@
#include <linkdlg.hxx>
#include <SignatureLineDialog.hxx>
#include <SignSignatureLineDialog.hxx>
+#include <QrCodeGenDialog.hxx>
#include <SpellDialog.hxx>
#include <cfg.hxx>
#include <numpages.hxx>
@@ -319,6 +320,11 @@ short AbstractSignSignatureLineDialog_Impl::Execute()
return m_xDlg->run();
}
+short AbstractQrCodeGenDialog_Impl::Execute()
+{
+ return m_xDlg->run();
+}
+
IMPL_ABSTDLG_BASE(AbstractScreenshotAnnotationDlg_Impl);
short CuiAbstractTabController_Impl::Execute()
@@ -1622,6 +1628,13 @@ AbstractDialogFactory_Impl::CreateSignSignatureLineDialog(weld::Window* pParent,
std::make_unique<SignSignatureLineDialog>(pParent, xModel));
}
+VclPtr<AbstractQrCodeGenDialog> AbstractDialogFactory_Impl::CreateQrCodeGenDialog(
+ weld::Window* pParent, const Reference<XModel> xModel, bool bEditExisting)
+{
+ return VclPtr<AbstractQrCodeGenDialog_Impl>::Create(
+ std::make_unique<QrCodeGenDialog>(pParent, xModel, bEditExisting));
+}
+
VclPtr<AbstractTipOfTheDayDialog>
AbstractDialogFactory_Impl::CreateTipOfTheDayDialog(weld::Window* pParent)
{
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 68267c61a122..9948e71fcf24 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -48,6 +48,7 @@
#include <passwdomdlg.hxx>
#include <pastedlg.hxx>
#include <postdlg.hxx>
+#include <QrCodeGenDialog.hxx>
#include <screenshotannotationdlg.hxx>
#include <showcols.hxx>
#include <SignatureLineDialog.hxx>
@@ -698,6 +699,19 @@ public:
virtual short Execute() override;
};
+class QrCodeGenDialog;
+class AbstractQrCodeGenDialog_Impl : public AbstractQrCodeGenDialog
+{
+ std::unique_ptr<QrCodeGenDialog> m_xDlg;
+
+public:
+ explicit AbstractQrCodeGenDialog_Impl(std::unique_ptr<QrCodeGenDialog> p)
+ : m_xDlg(std::move(p))
+ {
+ }
+ virtual short Execute() override;
+};
+
class SignSignatureLineDialog;
class AbstractSignSignatureLineDialog_Impl : public AbstractSignSignatureLineDialog
{
@@ -907,6 +921,10 @@ public:
CreateSignSignatureLineDialog(weld::Window* pParent,
const css::uno::Reference<css::frame::XModel> xModel) override;
+ virtual VclPtr<AbstractQrCodeGenDialog>
+ CreateQrCodeGenDialog(weld::Window* pParent,
+ const css::uno::Reference<css::frame::XModel> xModel, bool bEditExisting) override;
+
virtual VclPtr<AbstractTipOfTheDayDialog> CreateTipOfTheDayDialog(weld::Window* pParent) override;
};
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index bbca92682819..d430f6de692f 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -982,8 +982,11 @@ class SvxSetItem;
#define SID_TOGGLE_RESOLVED_NOTES ( SID_SVX_START + 1190 )
+#define SID_INSERT_QRCODE ( SID_SVX_START + 1191 )
+#define SID_EDIT_QRCODE ( SID_SVX_START + 1192 )
+
// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE ( SID_SVX_START + 1190 + 1 )
+#define SID_SVX_FIRSTFREE ( SID_SVX_START + 1192 + 1 )
// Overflow check for slot IDs
#if SID_SVX_FIRSTFREE > SID_SVX_END
diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx
index b4b839c71fe4..365a8f6e04ed 100644
--- a/include/vcl/abstdlg.hxx
+++ b/include/vcl/abstdlg.hxx
@@ -119,6 +119,12 @@ protected:
virtual ~AbstractSignSignatureLineDialog() override = default;
};
+class VCL_DLLPUBLIC AbstractQrCodeGenDialog : public VclAbstractDialog
+{
+protected:
+ virtual ~AbstractQrCodeGenDialog() override = default;
+};
+
class VCL_DLLPUBLIC AbstractTipOfTheDayDialog : public VclAbstractDialog
{
protected:
@@ -149,6 +155,13 @@ public:
const css::uno::Reference<css::frame::XModel> xModel)
= 0;
+ // creates instance of QrCodeDialog from cui
+ virtual VclPtr<AbstractQrCodeGenDialog>
+ CreateQrCodeGenDialog(weld::Window* pParent,
+ const css::uno::Reference<css::frame::XModel> xModel,
+ bool bEditExisting)
+ = 0;
+
// creates instance of ScreenshotAnnotationDlg from cui
virtual VclPtr<AbstractScreenshotAnnotationDlg> CreateScreenshotAnnotationDlg(
vcl::Window* pParent,
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index dbae1db0bdd3..8d2235d198c1 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -7039,6 +7039,22 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:InsertQrCode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~QR Code...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:EditQrCode" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~Edit QR Code...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
<node oor:name=".uno:FormMoreFieldsMenu" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">More Fields</value>
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>
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index a7c15fb4d701..1c62757707dc 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -12081,4 +12081,38 @@ SfxVoidItem RemoveHyperlink SID_REMOVE_HYPERLINK
MenuConfig = TRUE,
ToolBoxConfig = TRUE,
GroupId = SfxGroupId::Edit;
+]
+
+SfxVoidItem InsertQrCode SID_INSERT_QRCODE
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Insert;
+]
+
+SfxVoidItem EditQrCode SID_EDIT_QRCODE
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Edit;
] \ No newline at end of file
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index 1162c4a9f6ab..7dbb4be8440f 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -532,6 +532,7 @@ public:
vcl::Window* pWin=nullptr, bool bIsNewObj=false, bool bSetSelectionToStart=false );
bool isSignatureLineSelected();
bool isSignatureLineSigned();
+ bool isQRCodeSelected();
void StateTabWin(SfxItemSet&);
diff --git a/sw/sdi/viewsh.sdi b/sw/sdi/viewsh.sdi
index 9980f21153cd..561b41ff2040 100644
--- a/sw/sdi/viewsh.sdi
+++ b/sw/sdi/viewsh.sdi
@@ -54,6 +54,18 @@ interface TextEditView : BaseTextEditView
StateMethod = GetState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
+ SID_INSERT_QRCODE // status()
+ [
+ ExecMethod = ExecDlgExt ;
+ StateMethod = GetState ;
+ DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
+ ]
+ SID_EDIT_QRCODE // status()
+ [
+ ExecMethod = ExecDlgExt ;
+ StateMethod = GetState ;
+ DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
+ ]
FN_EDIT_FOOTNOTE // status(final|play)
[
ExecMethod = ExecDlgExt ;
diff --git a/sw/source/uibase/uiview/viewdlg2.cxx b/sw/source/uibase/uiview/viewdlg2.cxx
index 5d2d756803b1..40263d66b9f0 100644
--- a/sw/source/uibase/uiview/viewdlg2.cxx
+++ b/sw/source/uibase/uiview/viewdlg2.cxx
@@ -26,6 +26,7 @@
#include <fldmgr.hxx>
#include <expfld.hxx>
#include <modcfg.hxx>
+#include <com/sun/star/drawing/QRCode.hpp>
#include <swmodule.hxx>
#include <view.hxx>
@@ -67,6 +68,16 @@ void SwView::ExecDlgExt(SfxRequest const &rReq)
pDialog->Execute();
break;
}
+ case SID_INSERT_QRCODE:
+ case SID_EDIT_QRCODE:
+ {
+ VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
+ const uno::Reference<frame::XModel> xModel(GetCurrentDocument());
+ ScopedVclPtr<AbstractQrCodeGenDialog> pDialog(pFact->CreateQrCodeGenDialog(
+ GetFrameWeld(), xModel, rReq.GetSlot() == SID_EDIT_QRCODE));
+ pDialog->Execute();
+ break;
+ }
case SID_SIGN_SIGNATURELINE:
{
VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
@@ -132,6 +143,27 @@ bool SwView::isSignatureLineSigned()
return pGraphic->isSignatureLineSigned();
}
+bool SwView::isQRCodeSelected()
+{
+ SwWrtShell& rSh = GetWrtShell();
+ SdrView* pSdrView = rSh.GetDrawView();
+ 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;
+
+ return pGraphic->getQrCode() != nullptr;
+}
+
void SwView::AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId)
{
SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index f43e511636ef..c901557a145b 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -117,6 +117,17 @@ void SwView::GetState(SfxItemSet &rSet)
if (!isSignatureLineSelected() || isSignatureLineSigned())
rSet.DisableItem(nWhich);
break;
+ case SID_INSERT_QRCODE:
+ if( !( m_nSelectionType & SelectionType::Text ||
+ m_nSelectionType & SelectionType::NumberList ) )
+ {
+ rSet.DisableItem(nWhich);
+ }
+ break;
+ case SID_EDIT_QRCODE:
+ if (!isQRCodeSelected())
+ rSet.DisableItem(nWhich);
+ break;
case FN_INSERT_CAPTION:
{
// There are captions for graphics, OLE objects, frames and tables
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index 03e09f826858..a07aea1118a2 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -346,6 +346,7 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:InsertEnvelope" menu:style="text"/>
<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/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml
index 19c0c55165bb..bb1d9c0dae6e 100644
--- a/sw/uiconfig/swform/menubar/menubar.xml
+++ b/sw/uiconfig/swform/menubar/menubar.xml
@@ -299,6 +299,7 @@
</menu:menu>
<menu:menuseparator/>
<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/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index 66b40f38b2f6..af3eee70c760 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -348,6 +348,7 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:InsertEnvelope" menu:style="text"/>
<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/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index 016644b738a2..74c56bd5ec11 100644
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -345,6 +345,7 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:InsertEnvelope" menu:style="text"/>
<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">