sw/source/uibase/uiview/view.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 09732cec4cf09b215784d140c37d3cfbc5b5b1ff
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Tue Nov 30 10:37:32 2021 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Nov 30 14:59:43 2021 +0100

    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 <vmik...@collabora.com>
    Tested-by: Jenkins

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 )
             {

Reply via email to