summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/tabvwshb.cxx
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-06-29 09:10:48 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-07-06 07:41:04 +0200
commit9891fd076c30d353e9edfee9678f0b8e96d26238 (patch)
tree3ec45dce87e478fc8b1b7f38c9bcdde9242921f0 /sc/source/ui/view/tabvwshb.cxx
parent3f66d987ce3a46eb836f2c11bbaf360bd6195e27 (diff)
tdf#117903 Add signature line feature to calc
Change-Id: I4e9121803a26cba1f40f8f1c673c7809543ef2ec Reviewed-on: https://gerrit.libreoffice.org/57015 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sc/source/ui/view/tabvwshb.cxx')
-rw-r--r--sc/source/ui/view/tabvwshb.cxx54
1 files changed, 54 insertions, 0 deletions
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);