diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-11-30 10:37:32 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-11-30 14:59:43 +0100 |
commit | 09732cec4cf09b215784d140c37d3cfbc5b5b1ff (patch) | |
tree | a7171ab2c9abfcc68c06c3de08a24f5671683739 /sw | |
parent | 4ed5fc68374a1ca0901c6fc4acc366b198918608 (diff) |
sw, viewing OLE objects: provide an 'Open' context menu
The menu items of the OLE object were disabled in protected mode. Allow
the menu items in protected mode, now that commit
32842d4bf250bcab281eb71a218d618485c60290 (sw, viewing OLE objects: also
protect "common" embeded objects, 2021-11-26) made sure that launching
an OLE object in protected mode is only viewing, not editing.
Note that the actual menu items are returned by IOleObject::EnumVerbs()
as documented at
<https://docs.microsoft.com/en-us/windows/win32/api/oleidl/nf-oleidl-ioleobject-enumverbs>,
i.e. application-specific. MS Paint provides Edit=0, Open=1, so would be
nice to filter out 0 to only show Open. But then e.g. PowerPoint
provides Show=0 and Open/Edit is provided as 1/2. So don't filter out
anything to be on the safe side when the editing application would only
provide a single verb.
Change-Id: Ic452cec40d2dd978edfb661f049d7f55dbd2fb17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126108
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/uiview/view.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 7d418acd17b0..094f3b92cad7 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -146,7 +146,8 @@ void SwView::ImpSetVerb( SelectionType nSelType ) if ( !GetViewFrame()->GetFrame().IsInPlace() && (SelectionType::Ole|SelectionType::Graphic) & nSelType ) { - if ( m_pWrtShell->IsSelObjProtected(FlyProtectFlags::Content) == FlyProtectFlags::NONE ) + FlyProtectFlags eProtectFlags = m_pWrtShell->IsSelObjProtected(FlyProtectFlags::Content); + if (eProtectFlags == FlyProtectFlags::NONE || nSelType & SelectionType::Ole) { if ( nSelType & SelectionType::Ole ) { |