officecfg/registry/schema/org/openoffice/Office/Draw.xcs |    7 ++++
 sd/inc/strings.hrc                                       |    1 
 sd/source/ui/dlg/LayerTabBar.cxx                         |   25 +++++++++++++--
 3 files changed, 30 insertions(+), 3 deletions(-)

New commits:
commit 662c6a6d70bab6b1a6ae8048457907be97f447ca
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Tue Nov 19 18:18:01 2024 -0900
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Sat Nov 23 18:48:17 2024 +0100

    related tdf#157255: add DisableLayerHighlighting expert setting
    
    This allows the layer objects overlay to not be done when the value set
    for DisableLayerHighlighting is less than the number of objects in the
    layer of the tab which the mouse is hovered over in the layer bar.
    
    Change-Id: Ie49ecb11bfb029ada57824c0acbbd133e1fe83b2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176809
    Reviewed-by: Jim Raykowski <rayk...@gmail.com>
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
index dc6fa42f9e04..0cb747cf8cc2 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Draw.xcs
@@ -417,6 +417,13 @@
           <value>2</value>
         </prop>
       </group>
+      <prop oor:name="DisableLayerHighlighting" oor:type="xs:int" 
oor:nillable="false">
+        <info>
+          <desc>Defines the maximum number of objects in a layer (0 - 65535) 
before hovering the mouse pointer over a layer tab of the layer bar does not 
cause the layer objects in the view to be highlighted.</desc>
+          <label/>
+        </info>
+        <value>65535</value>
+      </prop>
     </group>
     <group oor:name="Snap">
       <info>
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index e8a6fe8683e1..16174a94f76f 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -80,6 +80,7 @@
 #define STR_POPUP_DELETE_SNAPPOINT                      
NC_("STR_POPUP_DELETE_SNAPPOINT", "Delete Snap Point")
 #define STR_IMPRESS                                     NC_("STR_IMPRESS", 
"StarImpress 4.0")
 #define STR_LAYER                                       NC_("STR_LAYER", 
"Layer")
+#define STR_LAYER_HIGHLIGHTING_DISABLED                 
NC_("STR_LAYER_HIGHLIGHTING_DISABLED", "Layer highlighting is disabled for this 
layer. The number of layer objects exceeds the number set for 
DisableLayerHighlighting (%1).")
 #define STR_UNDO_DELETEPAGES                            
NC_("STR_UNDO_DELETEPAGES", "Delete slides")
 #define STR_UNDO_DELETEPAGES_DRAW                       
NC_("STR_UNDO_DELETEPAGES_DRAW", "Delete pages")
 #define STR_UNDO_INSERTPAGES                            
NC_("STR_UNDO_INSERTPAGES", "Insert slides")
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx
index 01c0ffc09173..0955b8551805 100644
--- a/sd/source/ui/dlg/LayerTabBar.cxx
+++ b/sd/source/ui/dlg/LayerTabBar.cxx
@@ -45,6 +45,8 @@
 #include <sdpage.hxx>
 #include <svx/sdrpaintwindow.hxx>
 
+#include <officecfg/Office/Draw.hxx>
+
 namespace sd {
 
 /**
@@ -167,14 +169,20 @@ void LayerTabBar::BringLayerObjectsToAttention(const 
sal_uInt16 nPageId)
 
     m_aBringLayerObjectsToAttentionDelayTimer.Stop();
 
+    if (m_xOverlayObject && m_xOverlayObject->getOverlayManager())
+        m_xOverlayObject->getOverlayManager()->remove(*m_xOverlayObject);
+
     m_nBringLayerObjectsToAttentionLastPageId = nPageId;
 
     std::vector<basegfx::B2DRange> aRanges;
 
     if (nPageId != 0)
     {
+        sal_uInt16 nDisableLayerObjectsOverlay
+            = officecfg::Office::Draw::Misc::DisableLayerHighlighting::get();
         OUString aLayerName(GetLayerName(nPageId));
-        if (pDrViewSh->GetView()->GetSdrPageView()->IsLayerVisible(aLayerName))
+        if (nDisableLayerObjectsOverlay > 0 // don't show tooltip message when 
0 - meaning feature is turned off
+            && 
pDrViewSh->GetView()->GetSdrPageView()->IsLayerVisible(aLayerName))
         {
             SdrLayerAdmin& rLayerAdmin = pDrViewSh->GetDoc()->GetLayerAdmin();
             SdrObjListIter aIter(pDrViewSh->GetActualPage(), 
SdrIterMode::DeepWithGroups);
@@ -191,7 +199,18 @@ void LayerTabBar::BringLayerObjectsToAttention(const 
sal_uInt16 nPageId)
                 {
                     ::tools::Rectangle aRect(pObj->GetLogicRect());
                     if (!aRect.IsEmpty())
+                    {
                         aRanges.emplace_back(aRect.Left(), aRect.Top(), 
aRect.Right(), aRect.Bottom());
+                        if (aRanges.size() > nDisableLayerObjectsOverlay)
+                        {
+                            OUString sHelpText = 
SdResId(STR_LAYER_HIGHLIGHTING_DISABLED);
+                            sHelpText = sHelpText.replaceFirst(
+                                "%1", 
OUString::number(nDisableLayerObjectsOverlay));
+                            SetQuickHelpText(sHelpText);
+                            m_xOverlayObject.reset();
+                            return;
+                        }
+                    }
                     // skip over objects in groups
                     if (pObj->IsGroupObject())
                     {
@@ -207,8 +226,8 @@ void LayerTabBar::BringLayerObjectsToAttention(const 
sal_uInt16 nPageId)
         }
     }
 
-    if (m_xOverlayObject && m_xOverlayObject->getOverlayManager())
-        m_xOverlayObject->getOverlayManager()->remove(*m_xOverlayObject);
+    SetQuickHelpText(u""_ustr);
+
     if (aRanges.empty())
         m_xOverlayObject.reset();
     else

Reply via email to