diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-07-24 19:03:23 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-07-25 17:35:32 +0200 |
commit | 2a00e1f98d4cca448c1394e2504cc7539cb9ac1d (patch) | |
tree | 82ea0a0318e92b2ea98010957189d2b607da5f3e | |
parent | 7e24a32d7bcdcc630d6be2106a8c9117a0122772 (diff) |
tdf#118777: Disable signature line slot if non-text object
both in sw and sc
Change-Id: I54f7ec336026013d09ac6262779e7fcbd17c2084
Reviewed-on: https://gerrit.libreoffice.org/57949
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r-- | sc/source/ui/view/tabvwshb.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewstat.cxx | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 5fc41502f1ea..9fa70ff0ed0f 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -500,6 +500,7 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet) bool bTabProt = GetViewData().GetDocument()->IsTabProtected(GetViewData().GetTabNo()); ScDocShell* pDocShell = GetViewData().GetDocShell(); bool bShared = pDocShell && pDocShell->IsDocShared(); + SdrView* pSdrView = GetSdrView(); SfxWhichIter aIter(rSet); sal_uInt16 nWhich = aIter.FirstWhich(); @@ -530,7 +531,7 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet) break; case SID_INSERT_SIGNATURELINE: - if ( bTabProt || bShared ) + if ( bTabProt || bShared || (pSdrView && pSdrView->GetMarkedObjectCount() != 0)) rSet.DisableItem( nWhich ); break; case SID_EDIT_SIGNATURELINE: diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index 73661dca0b1b..04e344d0b10e 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -97,12 +97,18 @@ void SwView::GetState(SfxItemSet &rSet) break; case SID_INSERT_GRAPHIC: - case SID_INSERT_SIGNATURELINE: if( m_pWrtShell->CursorInsideInputField() ) { rSet.DisableItem(nWhich); } break; + case SID_INSERT_SIGNATURELINE: + if( !( m_nSelectionType & SelectionType::Text || + m_nSelectionType & SelectionType::NumberList ) ) + { + rSet.DisableItem(nWhich); + } + break; case SID_EDIT_SIGNATURELINE: case SID_SIGN_SIGNATURELINE: if (!isSignatureLineSelected()) |