summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2021-07-21 21:28:59 +0300
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-07-26 15:18:56 +0200
commit965636121cb1fb09739fcbca2c85f0a07bf6bf96 (patch)
tree1a63357760e9244d79132dd3747306183069afde /sw
parentd44730148a95933f4a45a70241cb6d1d0546f626 (diff)
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@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/fldui/flddok.cxx12
1 files changed, 2 insertions, 10 deletions
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);