summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2020-05-29 16:53:59 +0200
committerAndras Timar <andras.timar@collabora.com>2020-06-02 15:34:23 +0200
commitd546297203a90e7b412e00a4afb38debeb895522 (patch)
tree34790278532763946916787aa929f7627df3dd65 /vcl
parent112063051a2887a552462786b5d8d1897efbe915 (diff)
tdf#133498 Make native drawing of FormattedField work (again)
Commit 2a694f9e0e7789b4b3b792a9eedd29366fa10c1c ("lok: fix the window type of the formatted field control", 2020-05-06) had introduced the new 'WindowType::FORMATTEDFIELD' and sets it for the 'FormattedField' control, instead of using the previous default value set in the 'SpinField' ctor, which is 'WindowType::SPINFIELD'. This commit adds the corresponding 'WindowType::FORMATTEDFIELD' cases relevant to make native drawing of the control work (again). Also map the corresponding accessibility roles. Change-Id: Ied0b0548c03dee3feaf1b6252c81b2a33b68b938 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95156 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 33cac418db78f64f7fa84b8e65c01c2b02cf17a7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95357 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/edit.cxx1
-rw-r--r--vcl/source/control/spinfld.cxx1
-rw-r--r--vcl/source/window/accessibility.cxx4
-rw-r--r--vcl/source/window/brdwin.cxx2
4 files changed, 7 insertions, 1 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index c38490de2280..ab36a212855d 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -959,6 +959,7 @@ ControlType Edit::ImplGetNativeControlType() const
case WindowType::LONGCURRENCYFIELD:
case WindowType::NUMERICFIELD:
case WindowType::SPINFIELD:
+ case WindowType::FORMATTEDFIELD:
if (pControl->GetStyle() & WB_SPIN)
nCtrl = ControlType::Spinbox;
else
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index dd6d22502974..c954c698dffd 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -177,6 +177,7 @@ void ImplDrawSpinButton(vcl::RenderContext& rRenderContext, vcl::Window* pWindow
case WindowType::LONGCURRENCYFIELD:
case WindowType::NUMERICFIELD:
case WindowType::SPINFIELD:
+ case WindowType::FORMATTEDFIELD:
aControl = ControlType::Spinbox;
break;
default:
diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx
index de117cce9554..d8f66cbc3c10 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -362,7 +362,8 @@ sal_uInt16 Window::getDefaultAccessibleRole() const
case WindowType::METRICFIELD:
case WindowType::CURRENCYFIELD:
case WindowType::LONGCURRENCYFIELD:
- case WindowType::SPINFIELD: nRole = accessibility::AccessibleRole::SPIN_BOX; break;
+ case WindowType::SPINFIELD:
+ case WindowType::FORMATTEDFIELD: nRole = accessibility::AccessibleRole::SPIN_BOX; break;
case WindowType::TOOLBOX: nRole = accessibility::AccessibleRole::TOOL_BAR; break;
case WindowType::STATUSBAR: nRole = accessibility::AccessibleRole::STATUS_BAR; break;
@@ -462,6 +463,7 @@ OUString Window::getDefaultAccessibleName() const
case WindowType::DATEFIELD:
case WindowType::TIMEFIELD:
case WindowType::SPINFIELD:
+ case WindowType::FORMATTEDFIELD:
case WindowType::COMBOBOX:
case WindowType::LISTBOX:
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 9248f65c1955..ad40fe141e9d 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -474,6 +474,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
case WindowType::LONGCURRENCYFIELD:
case WindowType::NUMERICFIELD:
case WindowType::SPINFIELD:
+ case WindowType::FORMATTEDFIELD:
case WindowType::CALCINPUTLINE:
mbNWFBorder = true;
if (pCtrl->GetStyle() & WB_SPIN)
@@ -615,6 +616,7 @@ void ImplSmallBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, c
case WindowType::LONGCURRENCYFIELD:
case WindowType::NUMERICFIELD:
case WindowType::SPINFIELD:
+ case WindowType::FORMATTEDFIELD:
case WindowType::CALCINPUTLINE:
if (pCtrl->GetStyle() & WB_SPIN)
aCtrlType = ControlType::Spinbox;