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

Vasily Melenchuk (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 26 13:19:34 UTC 2021


 sw/source/ui/fldui/flddok.cxx |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit 965636121cb1fb09739fcbca2c85f0a07bf6bf96
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Wed Jul 21 21:28:59 2021 +0300
Commit:     Thorsten Behrens <thorsten.behrens at allotropia.de>
CommitDate: Mon Jul 26 15:18:56 2021 +0200

    tdf#143483: sw field edit: improved selection of format
    
    During selection of used field format do this after list
    is initialized. Otherwise selection can be lost during
    further treelist filling.
    
    Removed ancient hack which was trying to select at least
    something in field format list: it is incorrect and does
    not cover all possible fields/formats. It is just hiding
    any potenial initialization problems.
    
    Change-Id: Ibbbdd1e9a3436fec37cc49c11e6e235e8afcf4ac
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119341
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index 7164c4ff2692..e7d5ad8a3930 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -464,19 +464,11 @@ sal_Int32 SwFieldDokPage::FillFormatLB(SwFieldTypesEnum nTypeId)
         const sal_uInt16 nFormatId = GetFieldMgr().GetFormatId( nTypeId, i );
         OUString sId(OUString::number(nFormatId));
         m_xFormatLB->append(sId, GetFieldMgr().GetFormatStr(nTypeId, i));
-        if (IsFieldEdit() && nFormatId == (GetCurField()->GetFormat() & ~AF_FIXED))
-            m_xFormatLB->select_id(sId);
     }
 
-    if (nSize && m_xFormatLB->get_selected_index() == -1)
+    if (IsFieldEdit())
     {
-        m_xFormatLB->select_text( SwResId(FMT_NUM_PAGEDESC) );
-        if (m_xFormatLB->get_selected_index() == -1)
-        {
-            m_xFormatLB->select_text( SwResId(FMT_NUM_ARABIC) );
-            if (m_xFormatLB->get_selected_index() == -1)
-                m_xFormatLB->select( 0 );
-        }
+        m_xFormatLB->select_id(OUString::number(GetCurField()->GetFormat() & ~AF_FIXED));
     }
 
     FormatHdl(*m_xFormatLB);


More information about the Libreoffice-commits mailing list