diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-12-06 13:49:39 +0500 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-12-19 11:36:23 +0100 |
commit | 1070d93d7536470d9beed29c7a458646029fb40e (patch) | |
tree | c7bdc11a053b4006f95e280cc7c53242eda2c6f7 | |
parent | 1250c1e0f3b424cf18c378f3b21a14f6e531cbf7 (diff) |
tdf#164213: don't activate OLE objects in read-only mode
Similar to the check done in SwEditWin::MouseButtonDown.
Change-Id: I1a1b8966502a6b1557d424f28cfc1c1ecdf4b65e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177930
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 5950fe86b84bb062e88034e382fc5df90bb1e98c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178565
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sd/source/ui/func/fudraw.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/func/fupoor.cxx | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index d40f325f2392..28e1bf7e96f3 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -640,7 +640,8 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt) SdrInventor nInv = pObj->GetObjInventor(); SdrObjKind nSdrObjKind = pObj->GetObjIdentifier(); - if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::OLE2) + if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::OLE2 + && !mpDocSh->IsReadOnly()) { // activate OLE-object SfxInt16Item aItem(SID_OBJECT, 0); @@ -649,7 +650,8 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt) SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem }); } - else if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::Graphic && pObj->IsEmptyPresObj() ) + else if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::Graphic + && pObj->IsEmptyPresObj() && !mpDocSh->IsReadOnly()) { mpViewShell->GetViewFrame()-> GetDispatcher()->Execute( SID_INSERT_GRAPHIC, diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index 2a1c9023015b..5d952d1e4a40 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -232,7 +232,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) bReturn = true; } } - else + else if (!mpDocSh->IsReadOnly()) { // activate OLE object on RETURN for selected object // activate text edit on RETURN for selected object |