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

Andreas Heinisch (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 7 17:03:31 UTC 2021


 sfx2/source/dialog/dinfdlg.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 629fe3a8e6fdf1602add0803b7d06e70215cda33
Author:     Andreas Heinisch <andreas.heinisch at yahoo.de>
AuthorDate: Thu May 20 14:38:16 2021 +0200
Commit:     Andreas Heinisch <andreas.heinisch at yahoo.de>
CommitDate: Mon Jun 7 19:02:52 2021 +0200

    tdf#132667 - Grab focus on the last inserted property
    
    On removing/adding custom document properties, grab the focus on the
    last empty shown name box.
    
    Change-Id: Ifd66566d4ae9fa57b9f1a9aae5f9cb93dbb74070
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115872
    Tested-by: Jenkins
    Reviewed-by: Andreas Heinisch <andreas.heinisch at yahoo.de>

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 40bd42c63f6e..13349d3bf47c 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1492,7 +1492,6 @@ void CustomPropertiesWindow::CreateNewLine()
         pNewLine->m_xRemoveButton->get_buildable_name() + OString::number(nSize));
 
     pNewLine->DoTypeHdl(*pNewLine->m_xTypeBox);
-    pNewLine->m_xNameBox->grab_focus();
 }
 
 bool CustomPropertiesWindow::AreAllLinesValid() const
@@ -1770,6 +1769,13 @@ void CustomPropertiesWindow::ReloadLinesContent()
         pLine->DoTypeHdl(*pLine->m_xTypeBox);
     }
 
+    // tdf#132667 - grab focus on the last inserted property
+    if (i > 0 && m_aCustomProperties[nDataModelPos + i - 1]->m_sName.isEmpty())
+    {
+        CustomPropertyLine* pLine = m_aCustomPropertiesLines[i - 1].get();
+        pLine->m_xNameBox->grab_focus();
+    }
+
     while (nDataModelPos + i >= GetTotalLineCount() && i < GetExistingLineCount())
     {
         CustomPropertyLine* pLine = m_aCustomPropertiesLines[i].get();


More information about the Libreoffice-commits mailing list