diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-11-06 10:16:25 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-11-06 15:00:58 +0100 |
commit | 7b6f477799d55d80775b6120ba0b5ce1bb45fb3c (patch) | |
tree | 94ad09d469dd609da0eef4a9dba3929113e931cc /sw | |
parent | ff8fdc310a13e677dfc97151f0752d7e88356b84 (diff) |
tdf#118582 Disable signature line signing once it is signed
Change-Id: I720d7d4920ae9c2f5d74ad827e1e214a62fe81a9
Reviewed-on: https://gerrit.libreoffice.org/62947
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/view.hxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewdlg2.cxx | 21 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewstat.cxx | 2 |
3 files changed, 23 insertions, 1 deletions
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index 2bddda1a67cd..ae3db0670892 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -534,6 +534,7 @@ public: bool BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=nullptr, vcl::Window* pWin=nullptr, bool bIsNewObj=false, bool bSetSelectionToStart=false ); bool isSignatureLineSelected(); + bool isSignatureLineSigned(); void StateTabWin(SfxItemSet&); diff --git a/sw/source/uibase/uiview/viewdlg2.cxx b/sw/source/uibase/uiview/viewdlg2.cxx index 6308b552a1ae..08b3985a046e 100644 --- a/sw/source/uibase/uiview/viewdlg2.cxx +++ b/sw/source/uibase/uiview/viewdlg2.cxx @@ -111,6 +111,27 @@ bool SwView::isSignatureLineSelected() return pGraphic->isSignatureLine(); } +bool SwView::isSignatureLineSigned() +{ + 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->isSignatureLineSigned(); +} + 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 49020bde88e1..38ffb27df5da 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -113,7 +113,7 @@ void SwView::GetState(SfxItemSet &rSet) break; case SID_EDIT_SIGNATURELINE: case SID_SIGN_SIGNATURELINE: - if (!isSignatureLineSelected()) + if (!isSignatureLineSelected() || isSignatureLineSigned()) rSet.DisableItem(nWhich); break; case FN_INSERT_CAPTION: |