summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-11-30 10:37:32 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-12-01 10:05:35 +0100
commit7427f4cee5fd7a0953bf0bd3d6beef504c9c3839 (patch)
tree3378fc7eeef210898e64df2f632cec9eda261fce
parent6f85752705c5e5bdb4eef539f669bc0961f14356 (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. (cherry picked from commit 09732cec4cf09b215784d140c37d3cfbc5b5b1ff) Change-Id: Ic452cec40d2dd978edfb661f049d7f55dbd2fb17
-rw-r--r--sw/source/uibase/uiview/view.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index d7837c800bfb..c21190fecb85 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -131,7 +131,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 )
{