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

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Thu Dec 3 20:39:24 UTC 2020


 include/svx/svdobj.hxx         |    2 +-
 sd/source/ui/dlg/sdtreelb.cxx  |   15 ++++++++++++++-
 sd/source/ui/view/drviewsd.cxx |    2 +-
 svx/source/svdraw/svdobj.cxx   |    9 ++++++---
 4 files changed, 22 insertions(+), 6 deletions(-)

New commits:
commit f0878173e1963cf8db5f60ced6d19da24e18bc41
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Tue Dec 1 00:25:52 2020 -0900
Commit:     Jim Raykowski <raykowj at gmail.com>
CommitDate: Thu Dec 3 21:38:48 2020 +0100

    tdf#34828 sd navigator: make unnamed shape select select shape object
    
    Change-Id: I4685d7db802767553018d08d23d8b33bca7efff2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106958
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <raykowj at gmail.com>

diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 2c9ce6813fba..b7af53864a77 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -373,7 +373,7 @@ public:
     // An object may have a user-set Name (Get/SetName()), e.g SdrGrafObj, SdrObjGroup
     // or SdrOle2Obj.
     // It may also have a Title and a Description for accessibility purposes.
-    void SetName(const OUString& rStr);
+    void SetName(const OUString& rStr, const bool bSetChanged = true);
     OUString GetName() const;
     void MakeNameUnique();
     void MakeNameUnique(std::unordered_set<OUString>& rNameSet);
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index bd9215fcb5b1..12ba6be2cf45 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -701,7 +701,20 @@ void SdPageObjsTLV::Select()
     m_aChangeHdl.Call(*m_xTreeView);
 
     if (m_bSelectionHandlerNavigates)
-        m_aRowActivatedHdl.Call(*m_xTreeView);
+    {
+        SdrObject* pObject = reinterpret_cast<SdrObject*>(m_xTreeView->get_selected_id().toInt64());
+        if (pObject && pObject->GetName().isEmpty())
+        {
+            const bool bUndo = pObject->getSdrModelFromSdrObject().IsUndoEnabled();
+            pObject->getSdrModelFromSdrObject().EnableUndo(false);
+            pObject->SetName(m_xTreeView->get_selected_text(), false);
+            m_aRowActivatedHdl.Call(*m_xTreeView);
+            pObject->SetName(OUString(), false);
+            pObject->getSdrModelFromSdrObject().EnableUndo(bUndo);
+        }
+        else
+            m_aRowActivatedHdl.Call(*m_xTreeView);
+    }
 
     if (!m_xNavigator)
     {
diff --git a/sd/source/ui/view/drviewsd.cxx b/sd/source/ui/view/drviewsd.cxx
index 8f6e627029d4..6dc4448d32f1 100644
--- a/sd/source/ui/view/drviewsd.cxx
+++ b/sd/source/ui/view/drviewsd.cxx
@@ -137,7 +137,7 @@ void DrawViewShell::ExecNavigatorWin( SfxRequest& rReq )
                 SfxFrameItem aFrameItem(SID_DOCFRAME, pFrame);
                 SfxBoolItem aBrowseItem(SID_BROWSE, true);
                 pFrame->GetDispatcher()->
-                ExecuteList(SID_OPENDOC, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+                ExecuteList(SID_OPENDOC, SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
                     { &aStrItem, &aFrameItem, &aBrowseItem, &aReferer });
             }
 
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 638c590a52cd..260d0b0dd2ac 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -661,7 +661,7 @@ SdrObject* SdrObject::getParentSdrObjectFromSdrObject() const
     return pParent->getSdrObjectFromSdrObjList();
 }
 
-void SdrObject::SetName(const OUString& rStr)
+void SdrObject::SetName(const OUString& rStr, const bool bSetChanged)
 {
     if (!rStr.isEmpty() && !pPlusData)
     {
@@ -691,8 +691,11 @@ void SdrObject::SetName(const OUString& rStr)
     {
         getSdrModelFromSdrObject().EndUndo();
     }
-    SetChanged();
-    BroadcastObjectChange();
+    if (bSetChanged)
+    {
+        SetChanged();
+        BroadcastObjectChange();
+    }
 }
 
 OUString SdrObject::GetName() const


More information about the Libreoffice-commits mailing list