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

New commits:
commit 7427f4cee5fd7a0953bf0bd3d6beef504c9c3839
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Tue Nov 30 10:37:32 2021 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Dec 1 10:05:35 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.
    
    (cherry picked from commit 09732cec4cf09b215784d140c37d3cfbc5b5b1ff)
    
    Change-Id: Ic452cec40d2dd978edfb661f049d7f55dbd2fb17

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

Reply via email to