sd/source/ui/func/fudraw.cxx |    6 ++++--
 sd/source/ui/func/fupoor.cxx |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 5950fe86b84bb062e88034e382fc5df90bb1e98c
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Fri Dec 6 13:49:39 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Fri Dec 6 11:09:38 2024 +0100

    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.kagan...@collabora.com>

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

Reply via email to