sw/source/uibase/utlui/content.cxx |   52 +++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 25 deletions(-)

New commits:
commit d3adc15ba3091fea5a90b654ee667b25797501db
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Thu Nov 18 10:21:27 2021 -0900
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Sat Nov 20 16:04:58 2021 +0100

    SwNavigator: Check for graphic, frame, or ole types before entering
    
    the block that handles these in UpdateTracking
    
    Change-Id: I4b435351133b28f1fc34e2733a9d453de5c117a0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125508
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <rayk...@gmail.com>

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 36686253ff83..1d18fa291da1 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3689,33 +3689,35 @@ void SwContentTree::UpdateTracking()
 
     if (bTrack)
     {
-        {
         // graphic, frame, and ole
-        OUString aContentTypeName;
-        if (m_pActiveShell->GetSelectionType() == SelectionType::Graphic &&
-                !(m_bIsRoot && m_nRootType != ContentTypeId::GRAPHIC))
-        {
-            if (!m_bImageTracking) return;
-            aContentTypeName = SwResId(STR_CONTENT_TYPE_GRAPHIC);
-        }
-        else if (m_pActiveShell->GetSelectionType() == SelectionType::Frame &&
-                 !(m_bIsRoot && m_nRootType != ContentTypeId::FRAME))
-        {
-            if (!m_bFrameTracking) return;
-            aContentTypeName = SwResId(STR_CONTENT_TYPE_FRAME);
-        }
-        else if (m_pActiveShell->GetSelectionType() == SelectionType::Ole &&
-                 !(m_bIsRoot && m_nRootType != ContentTypeId::OLE))
+        if (m_pActiveShell->GetSelectionType() &
+                (SelectionType::Graphic | SelectionType::Frame | 
SelectionType::Ole))
         {
-            if (!m_bOLEobjectTracking) return;
-            aContentTypeName = SwResId(STR_CONTENT_TYPE_OLE);
-        }
-        if (!aContentTypeName.isEmpty())
-        {
-            OUString aName(m_pActiveShell->GetFlyName());
-            lcl_SelectByContentTypeAndName(this, *m_xTreeView, 
aContentTypeName, aName);
-            return;
-        }
+            OUString aContentTypeName;
+            if (m_pActiveShell->GetSelectionType() == SelectionType::Graphic &&
+                    !(m_bIsRoot && m_nRootType != ContentTypeId::GRAPHIC))
+            {
+                if (!m_bImageTracking) return;
+                aContentTypeName = SwResId(STR_CONTENT_TYPE_GRAPHIC);
+            }
+            else if (m_pActiveShell->GetSelectionType() == 
SelectionType::Frame &&
+                     !(m_bIsRoot && m_nRootType != ContentTypeId::FRAME))
+            {
+                if (!m_bFrameTracking) return;
+                aContentTypeName = SwResId(STR_CONTENT_TYPE_FRAME);
+            }
+            else if (m_pActiveShell->GetSelectionType() == SelectionType::Ole 
&&
+                     !(m_bIsRoot && m_nRootType != ContentTypeId::OLE))
+            {
+                if (!m_bOLEobjectTracking) return;
+                aContentTypeName = SwResId(STR_CONTENT_TYPE_OLE);
+            }
+            if (!aContentTypeName.isEmpty())
+            {
+                OUString aName(m_pActiveShell->GetFlyName());
+                lcl_SelectByContentTypeAndName(this, *m_xTreeView, 
aContentTypeName, aName);
+                return;
+            }
         }
         // drawing
         if ((m_pActiveShell->GetSelectionType() & (SelectionType::DrawObject |

Reply via email to