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.hxx1
-rw-r--r--sc/source/ui/view/tabvwshb.cxx54
-rw-r--r--sc/uiconfig/scalc/menubar/menubar.xml1
-rw-r--r--sc/uiconfig/scalc/popupmenu/graphic.xml3
5 files changed, 62 insertions, 0 deletions
diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi
index 8df105eb28ec..7f33a247a394 100644
--- a/sc/sdi/tabvwsh.sdi
+++ b/sc/sdi/tabvwsh.sdi
@@ -56,6 +56,9 @@ interface BaseSelection
SID_INSERT_OBJECT [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ]
SID_INSERT_FLOATINGFRAME [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ]
SID_INSERT_AVMEDIA [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ]
+ SID_INSERT_SIGNATURELINE [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ]
+ SID_EDIT_SIGNATURELINE [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ]
+ SID_SIGN_SIGNATURELINE [ 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 8b4753e18c42..a59a0ae265ac 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -174,6 +174,7 @@ private:
void DoReadUserData( const OUString& rData );
void DoReadUserDataSequence( const css::uno::Sequence< css::beans::PropertyValue >& rSettings );
+ bool IsSignatureLineSelected();
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 ae40de856b47..c52bf0b3d1d5 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -344,6 +344,30 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
FuInsertOLE(*this, pWin, pView, pDrModel, rReq);
break;
+ case SID_INSERT_SIGNATURELINE:
+ case SID_EDIT_SIGNATURELINE:
+ {
+ const uno::Reference<frame::XModel> xModel( GetViewData().GetDocShell()->GetBaseModel() );
+
+ VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
+ ScopedVclPtr<AbstractSignatureLineDialog> pDialog(pFact->CreateSignatureLineDialog(
+ pWin->GetFrameWeld(), xModel, rReq.GetSlot() == SID_EDIT_SIGNATURELINE));
+ pDialog->Execute();
+ break;
+ }
+
+ case SID_SIGN_SIGNATURELINE:
+ {
+ const uno::Reference<frame::XModel> xModel(
+ GetViewData().GetDocShell()->GetBaseModel());
+
+ VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
+ VclPtr<AbstractSignSignatureLineDialog> pDialog
+ = pFact->CreateSignSignatureLineDialog(GetFrameWeld(), xModel);
+ pDialog->Execute();
+ break;
+ }
+
case SID_INSERT_DIAGRAM_FROM_FILE:
try
{
@@ -505,6 +529,16 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet)
rSet.DisableItem( nWhich );
break;
+ case SID_INSERT_SIGNATURELINE:
+ if ( bTabProt || bShared )
+ rSet.DisableItem( nWhich );
+ break;
+ case SID_EDIT_SIGNATURELINE:
+ case SID_SIGN_SIGNATURELINE:
+ if (!IsSignatureLineSelected())
+ rSet.DisableItem(nWhich);
+ break;
+
case SID_INSERT_GRAPHIC:
if (bTabProt || bShared)
{
@@ -539,6 +573,26 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet)
}
}
+bool ScTabViewShell::IsSignatureLineSelected()
+{
+ 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;
+
+ return pGraphic->isSignatureLine();
+}
+
void ScTabViewShell::ExecuteUndo(SfxRequest& rReq)
{
SfxShell* pSh = GetViewData().GetDispatcher().GetShell(0);
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index 9cebf9db0cd3..35d099157f0a 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -308,6 +308,7 @@
<menu:menuitem menu:id=".uno:ScrollBar"/>
</menu:menupopup>
</menu:menu>
+ <menu:menuitem menu:id=".uno:InsertSignatureLine"/>
</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 6185490898eb..716459b81a41 100644
--- a/sc/uiconfig/scalc/popupmenu/graphic.xml
+++ b/sc/uiconfig/scalc/popupmenu/graphic.xml
@@ -75,4 +75,7 @@
<menu:menuitem menu:id=".uno:Crop"/>
</menu:menupopup>
</menu:menu>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:EditSignatureLine"/>
+ <menu:menuitem menu:id=".uno:SignSignatureLine"/>
</menu:menupopup>