summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2022-01-25 10:40:21 +0200
committerJustin Luth <jluth@mail.com>2022-02-01 07:07:37 +0100
commitc0f914ad912796ef521ea151abf8ea7e9bc2f771 (patch)
treeffaebb22d889246ecc76c418a3618e8e8cba6d96 /svx
parent48575b3eb856406d9de406cb1d2de23866b0178f (diff)
tdf#111733 TextCharacterSpacingControl::GrabFocus kerning spinbutton
When the kerning menu opens, it defaulted to very tight, regardless of what the current setting was. However, the current value can easily be connected to the menu options, so lets do that. This depends on increasing the spinbutton range beyond -2.0, done via LO 7.4 commit 2334561bf15ec9b061636919efbd0e2a7b89e29b Change-Id: I0be0956bf1cc3604faecc691aeac70a5bbba807b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128909 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingControl.cxx25
1 files changed, 24 insertions, 1 deletions
diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
index e3685146b6f5..3da72391476a 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
@@ -67,7 +67,30 @@ TextCharacterSpacingControl::TextCharacterSpacingControl(TextCharacterSpacingPop
void TextCharacterSpacingControl::GrabFocus()
{
- mxVeryTight->grab_focus();
+ tools::Long nKerning = mxEditKerning->get_value(FieldUnit::NONE);
+ switch (nKerning)
+ {
+ case SPACING_VERY_TIGHT:
+ mxVeryTight->grab_focus();
+ break;
+ case SPACING_TIGHT:
+ mxTight->grab_focus();
+ break;
+ case SPACING_NORMAL:
+ mxNormal->grab_focus();
+ break;
+ case SPACING_LOOSE:
+ mxLoose->grab_focus();
+ break;
+ case SPACING_VERY_LOOSE:
+ mxVeryLoose->grab_focus();
+ break;
+ default:
+ if (nKerning == mnCustomKern)
+ mxLastCustom->grab_focus();
+ else
+ mxEditKerning->grab_focus();
+ }
}
TextCharacterSpacingControl::~TextCharacterSpacingControl()