diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2021-05-20 14:38:16 +0200 |
---|---|---|
committer | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2021-06-07 19:02:52 +0200 |
commit | 629fe3a8e6fdf1602add0803b7d06e70215cda33 (patch) | |
tree | 44c088f772273f2c4bfc4641e28294a2100c8fc7 /sfx2 | |
parent | 02c435082058ecf7f9d4d73cb47d31d0218dc10d (diff) |
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@yahoo.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
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(); |