sw/source/ui/index/swuiidxmrk.cxx |   23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

New commits:
commit 9c2d977e27e09d02e2e98090c4c2e433ad8abc79
Author:     Vojtěch Doležal <dolez...@cvut.cz>
AuthorDate: Wed Mar 5 18:08:17 2025 +0100
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Fri Mar 21 04:27:28 2025 +0100

    tdf#165577 Fix bibliography regressions
    
    Fix regressions introduced in b0299c4141f80dfd9989f1f376a960a9590f7a07, 
i.e.:
    
    1) Do not clear bibliography type options to allow new bibliography entry 
creations
    
    2) Set the short name so that it is not deleted when clicking Edit after 
creation
    
    Change-Id: Id3d500872cbbb578fc45cdf75f0b7f7f89144aa0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182586
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit 8adf0851ee87475d9abe133de8076b39876292e5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183167
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/sw/source/ui/index/swuiidxmrk.cxx 
b/sw/source/ui/index/swuiidxmrk.cxx
index 422a639b6737..e3f61cf04b03 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -1108,7 +1108,7 @@ class SwCreateAuthEntryDlg_Impl : public 
weld::GenericDialogController
     DECL_LINK(PageNumHdl, weld::Toggleable&, void);
     DECL_LINK(TargetTypeHdl, weld::ComboBox&, void);
 
-    void SetFields(const OUString pFields[], bool bNewEntry, bool 
bSetIdentifier);
+    void SetFields(const OUString pFields[], bool bNewEntry);
 
 public:
     SwCreateAuthEntryDlg_Impl(weld::Window* pParent,
@@ -1737,33 +1737,32 @@ 
SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(weld::Window* pParent,
             ++nRightRow;
         bLeft = !bLeft;
     }
-    SetFields(pFields, bNewEntry, !bNewEntry);
+    SetFields(pFields, bNewEntry);
     assert(m_xTypeListBox && "this will exist after the loop");
     EnableHdl(*m_xTypeListBox);
 }
 
-void SwCreateAuthEntryDlg_Impl::SetFields(const OUString pFields[], bool 
bNewEntry, bool bSetIdentifier) {
+void SwCreateAuthEntryDlg_Impl::SetFields(const OUString pFields[], bool 
bNewEntry) {
     for (int nIndex = 0; nIndex < AUTH_FIELD_END; ++nIndex)
     {
         switch (const TextInfo aCurInfo = aTextInfoArr[nIndex]; 
aCurInfo.nToxField)
         {
         case AUTH_FIELD_IDENTIFIER:
-            if (!bNewEntry && bSetIdentifier)
+            if (bNewEntry)
             {
+                assert(m_pEdits[nIndex]);
+                m_pEdits[nIndex]->set_text(pFields[aCurInfo.nToxField]);
+            } else {
                 assert(m_xIdentifierBox);
                 m_xIdentifierBox->set_entry_text(pFields[aCurInfo.nToxField]);
             }
             break;
         case AUTH_FIELD_AUTHORITY_TYPE:
-            if (!pFields[aCurInfo.nToxField].isEmpty())
-            {
-                
m_xTypeListBox->set_active(pFields[aCurInfo.nToxField].toInt32());
-            }
-            else
             {
-                m_xTypeListBox->clear();
+                int v = !pFields[aCurInfo.nToxField].isEmpty() ? 
pFields[aCurInfo.nToxField].toInt32() : -1;
+                m_xTypeListBox->set_active(v);
+                break;
             }
-            break;
         case AUTH_FIELD_TARGET_TYPE:
             if (!pFields[aCurInfo.nToxField].isEmpty())
             {
@@ -1854,7 +1853,7 @@ IMPL_LINK(SwCreateAuthEntryDlg_Impl, IdentifierHdl, 
weld::ComboBox&, rBox, void)
     OUString sFields[AUTH_FIELD_END];
     for(int ii = 0; ii < AUTH_FIELD_END; ++ii)
         sFields[ii] = pEntry->GetAuthorField(ToxAuthorityField(ii));
-    SetFields(sFields, false, false);
+    SetFields(sFields, false);
 }
 
 IMPL_LINK(SwCreateAuthEntryDlg_Impl, ShortNameHdl, weld::Entry&, rEdit, void)

Reply via email to