diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-11-25 14:53:04 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-11-26 13:41:12 +0100 |
commit | 18a2d02f7969878fa90e0dcffd15ea5261b2369f (patch) | |
tree | 99bb768cb57a45477f31d04c9d016d9d591bc3be /sw/source/uibase/docvw/edtwin.cxx | |
parent | 1cc5c6587e72581c83f7289a95e906a3a1be38b6 (diff) |
sw: allow viewing OLE objects in protected sections
The problem was that we don't allow even opening embedded objects in
protected sections, which means the content of multi-page embedded
objects can't even be viewed in protected sections, which probably goes
too far.
Fix this relaxing the condition in SwEditWin::MouseButtonDown() to allow
launching the OLE object on double-click, and then make sure that the
native data is not updated in SfxInPlaceClient_Impl::saveObject() and
the replacement image is not updated in
svt::EmbedEventListener_Impl::stateChanged().
This is complicated by only the Writer layout knowing if a given OLE
object is anchored in a protected frame, so pass down a callback to
sfx2/ and svtools/ to check if the OLE object is protected.
Not copying the protected bit has the benefit of behaving correctly if
the section turns into non-protected: copying would not work properly,
as SfxInPlaceClient is created on demand, so not re-created when the
protectedness of the section is changed.
(cherry picked from commit 4f9f1ac33366817df61c488a9f36b09c592ee939)
Conflicts:
sw/source/core/ole/ndole.cxx
Change-Id: Ib3a8f2092d27dc1ebd3ef355c95a4a473988b163
Diffstat (limited to 'sw/source/uibase/docvw/edtwin.cxx')
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 507919f601d7..001ea389f497 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -3245,8 +3245,11 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) case 2: { g_bFrameDrag = false; - if ( !bIsDocReadOnly && rSh.IsInsideSelectedObj(aDocPos) && - FlyProtectFlags::NONE == rSh.IsSelObjProtected( FlyProtectFlags::Content|FlyProtectFlags::Parent ) ) + if (!bIsDocReadOnly && rSh.IsInsideSelectedObj(aDocPos) + && (FlyProtectFlags::NONE + == rSh.IsSelObjProtected(FlyProtectFlags::Content + | FlyProtectFlags::Parent) + || rSh.GetSelectionType() == SelectionType::Ole)) { /* This is no good: on the one hand GetSelectionType is used as flag field * (take a look into the GetSelectionType method) and on the other hand the @@ -3266,11 +3269,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) // double click on OLE object --> OLE-InPlace case SelectionType::Ole: - if (rSh.IsSelObjProtected(FlyProtectFlags::Content) == FlyProtectFlags::NONE) - { - RstMBDownFlags(); - rSh.LaunchOLEObj(); - } + RstMBDownFlags(); + rSh.LaunchOLEObj(); return; case SelectionType::Frame: |