sw/source/uibase/utlui/content.cxx |   68 ++++++++++++++++++-------------------
 1 file changed, 34 insertions(+), 34 deletions(-)

New commits:
commit a1b1f5a472497e04d315323e429f06fa55c19c71
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Wed Nov 17 22:39:52 2021 -0900
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Thu Nov 18 19:38:36 2021 +0100

    SwNavigator: Track drawing objects before other content
    
    Do this to prevent other trackable content from being tracked before
    drawing objects when Navigator is used to go to drawing objects.
    
    Change-Id: Ib9d322208a2e358140bfb8c80ad94b4e0084f06a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125437
    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 2227cb04f4c8..8b5c13ffb088 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3717,6 +3717,40 @@ void SwContentTree::UpdateTracking()
             return;
         }
         }
+        // drawing
+        if ((m_pActiveShell->GetSelectionType() & (SelectionType::DrawObject |
+                                                   
SelectionType::DrawObjectEditMode |
+                                                   SelectionType::DbForm)) &&
+                !(m_bIsRoot && m_nRootType != ContentTypeId::DRAWOBJECT))
+        {
+            if (m_bDrawingObjectTracking)
+            {
+                // Multiple selection is possible when in root content 
navigation view so unselect all
+                // selected entries before reselecting. This causes a bit of 
an annoyance when the treeview
+                // scroll bar is used and focus is in the document by causing 
the last selected entry to
+                // scroll back into view.
+                if (m_bIsRoot)
+                    m_xTreeView->unselect_all();
+                SdrView* pSdrView = m_pActiveShell->GetDrawView();
+                if (pSdrView)
+                {
+                    for (size_t nIdx(0); nIdx < 
pSdrView->GetMarkedObjectCount(); nIdx++)
+                    {
+                        SdrObject* pSelected = 
pSdrView->GetMarkedObjectByIndex(nIdx);
+                        OUString aName(pSelected->GetName());
+                        if (!aName.isEmpty())
+                            lcl_SelectDrawObjectByName(*m_xTreeView, aName);
+                    }
+                }
+                else
+                {
+                    // clear treeview selections
+                    m_xTreeView->unselect_all();
+                }
+                Select();
+            }
+            return;
+        }
         // footnotes and endnotes
         if (SwContentAtPos aContentAtPos(IsAttrAtPos::Ftn);
                 
m_pActiveShell->GetContentAtPos(m_pActiveShell->GetCursorDocPos(), 
aContentAtPos) &&
@@ -3809,40 +3843,6 @@ void SwContentTree::UpdateTracking()
             }
             return;
         }
-        // drawing
-        if ((m_pActiveShell->GetSelectionType() & (SelectionType::DrawObject |
-                                                   
SelectionType::DrawObjectEditMode |
-                                                   SelectionType::DbForm)) &&
-                !(m_bIsRoot && m_nRootType != ContentTypeId::DRAWOBJECT))
-        {
-            if (m_bDrawingObjectTracking)
-            {
-                // Multiple selection is possible when in root content 
navigation view so unselect all
-                // selected entries before reselecting. This causes a bit of 
an annoyance when the treeview
-                // scroll bar is used and focus is in the document by causing 
the last selected entry to
-                // scroll back into view.
-                if (m_bIsRoot)
-                    m_xTreeView->unselect_all();
-                SdrView* pSdrView = m_pActiveShell->GetDrawView();
-                if (pSdrView)
-                {
-                    for (size_t nIdx(0); nIdx < 
pSdrView->GetMarkedObjectCount(); nIdx++)
-                    {
-                        SdrObject* pSelected = 
pSdrView->GetMarkedObjectByIndex(nIdx);
-                        OUString aName(pSelected->GetName());
-                        if (!aName.isEmpty())
-                            lcl_SelectDrawObjectByName(*m_xTreeView, aName);
-                    }
-                }
-                else
-                {
-                    // clear treeview selections
-                    m_xTreeView->unselect_all();
-                }
-                Select();
-            }
-            return;
-        }
         // table
         if (m_pActiveShell->IsCursorInTable() &&
                 !(m_bIsRoot && m_nRootType != ContentTypeId::TABLE))

Reply via email to