sd/source/ui/view/ViewShellBase.cxx |   20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

New commits:
commit 4ff2e148fa25933e64b7bbecbcd3ed551ad686ab
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Jun 16 12:46:54 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Jun 16 11:03:09 2024 +0200

    LOK: differentiate page kinds in sd::ViewShellBase::getEditMode
    
    E.g., sending a LOK_CALLBACK_GRAPHIC_VIEW_SELECTION payload, the
    "mode" must be different for notes view and for normal view.
    
    Change-Id: I1f328290087f3185b7bef69560b28df6adb82e90
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168917
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins

diff --git a/sd/source/ui/view/ViewShellBase.cxx 
b/sd/source/ui/view/ViewShellBase.cxx
index efefb6287288..4522b8a32510 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -1002,9 +1002,25 @@ int ViewShellBase::getEditMode() const
         switch ( pDrawViewShell->GetEditMode() )
         {
         case EditMode::Page:
-            return 0;
+            switch (pDrawViewShell->GetPageKind())
+            {
+                case PageKind::Standard:
+                    return 0;
+                case PageKind::Notes:
+                    return 2;
+                default:
+                    assert(!"Unhandled page kind");
+                    return 0;
+            }
         case EditMode::MasterPage:
-            return 1;
+            switch (pDrawViewShell->GetPageKind())
+            {
+                case PageKind::Standard:
+                    return 1;
+                default:
+                    assert(!"Unhandled page kind");
+                    return 1;
+            }
         }
     }
 

Reply via email to