summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2022-04-13 20:19:35 +0300
committerMichael Stahl <michael.stahl@allotropia.de>2022-04-19 12:28:46 +0200
commitf67484bdb6d99589789dfe0c2ac49f6160e9d95d (patch)
tree269164e481981a640b61ce34147e527076f1fa6d
parent0fc0d1a9fb14a23357219e797e1b35092f7d8ee6 (diff)
tdf#148551: sw ui: set default format value for Insert Field dlg
My previous implementation was changing current format selection only for field edit dialog. However it should be initialized also for insert field dlg. It is not always first element. Instead of older confusing approach right now there is a switch to set defaults: it is less confusing IMO. Change-Id: I189339ba66effc49267004a42345a28892cb693c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132980 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> (cherry picked from commit b2b821715a3745718a941fa99dda92137c0f0c86) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133045 (cherry picked from commit 911d7c3336f07a4ea49bb539bf1bd35f11eea2a0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133050 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--sw/source/ui/fldui/flddok.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index fba96e93cb4a..3bd1b4f5dea1 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -471,6 +471,19 @@ sal_Int32 SwFieldDokPage::FillFormatLB(SwFieldTypesEnum nTypeId)
{
m_xFormatLB->select_id(OUString::number(GetCurField()->GetFormat() & ~AF_FIXED));
}
+ else
+ {
+ // Select default selected value for "Insert" dialog
+ switch (nTypeId)
+ {
+ case SwFieldTypesEnum::PageNumber:
+ case SwFieldTypesEnum::DocumentStatistics:
+ m_xFormatLB->select_text(SwResId(FMT_NUM_PAGEDESC));
+ break;
+ default:
+ m_xFormatLB->select(0);
+ }
+ }
FormatHdl(*m_xFormatLB);