[Libreoffice-commits] core.git: sd/source

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Tue Mar 9 01:25:38 UTC 2021


 sd/source/ui/dlg/navigatr.cxx |   18 +++++++++++++++---
 sd/source/ui/inc/navigatr.hxx |    2 ++
 sd/source/ui/inc/sdtreelb.hxx |    5 +++++
 3 files changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 740fca22fc92065436dee9beae89852fc388db54
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Thu Mar 4 22:54:28 2021 -0900
Commit:     Jim Raykowski <raykowj at gmail.com>
CommitDate: Tue Mar 9 02:24:51 2021 +0100

    tdf#139944 Disable navigator in impress and draw master mode
    
    Change-Id: I48ed310f7903502085da2469f546d371960935f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111986
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <raykowj at gmail.com>

diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 6c478bad5741..569ff6a615a2 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -44,6 +44,8 @@
 #include <FrameView.hxx>
 #include <Window.hxx>
 
+#include <DrawViewShell.hxx>
+
 /**
  * SdNavigatorWin - FloatingWindow
  */
@@ -628,14 +630,24 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId,
     if( eState < SfxItemState::DEFAULT || nSId != SID_NAVIGATOR_STATE )
         return;
 
-    const SfxUInt32Item& rStateItem = dynamic_cast<const SfxUInt32Item&>(*pItem);
-    NavState nState = static_cast<NavState>(rStateItem.GetValue());
-
     // only if doc in LB is the active
     NavDocInfo* pInfo = pNavigatorWin->GetDocInfo();
     if( !(pInfo && pInfo->IsActive()) )
         return;
 
+    if (::sd::DrawDocShell* pDrawDocShell = pInfo->GetDrawDocShell())
+    {
+        const auto pDrawViewShell =
+                static_cast<::sd::DrawViewShell *>(pDrawDocShell->GetViewShell());
+        bool bEditModePage(pDrawViewShell->GetEditMode() == EditMode::Page);
+        pNavigatorWin->mxToolbox->set_sensitive(bEditModePage);
+        pNavigatorWin->mxLbDocs->set_sensitive(bEditModePage);
+        pNavigatorWin->mxTlbObjects->set_sensitive(bEditModePage);
+    }
+
+    const SfxUInt32Item& rStateItem = dynamic_cast<const SfxUInt32Item&>(*pItem);
+    NavState nState = static_cast<NavState>(rStateItem.GetValue());
+
     // First
     if (nState & NavState::BtnFirstEnabled &&
         !pNavigatorWin->mxToolbox->get_item_sensitive("first"))
diff --git a/sd/source/ui/inc/navigatr.hxx b/sd/source/ui/inc/navigatr.hxx
index 01f8b43d20da..e43175600d24 100644
--- a/sd/source/ui/inc/navigatr.hxx
+++ b/sd/source/ui/inc/navigatr.hxx
@@ -68,6 +68,8 @@ public:
     void    SetName( bool bOn ) { bName = bOn; }
     void    SetActive( bool bOn ) { bActive = bOn; }
 
+    ::sd::DrawDocShell* GetDrawDocShell() {return mpDocShell;}
+
 private:
     friend class SdNavigatorWin;
     bool            bName   : 1;
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index 20df211605b7..ecd98842a1c7 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -156,6 +156,11 @@ public:
     SdPageObjsTLV(std::unique_ptr<weld::TreeView> xTreeview);
     ~SdPageObjsTLV();
 
+    void set_sensitive(bool bSensitive)
+    {
+        m_xTreeView->set_sensitive(bSensitive);
+    }
+
     void hide()
     {
         m_xTreeView->hide();


More information about the Libreoffice-commits mailing list