[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - vcl/source

Michael Weghorn (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 2 12:58:46 UTC 2020


 vcl/source/control/edit.cxx         |    1 +
 vcl/source/control/spinfld.cxx      |    1 +
 vcl/source/window/accessibility.cxx |    4 +++-
 vcl/source/window/brdwin.cxx        |    2 ++
 4 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit e548c51d15462191b9c1ce8f677afc1a8a0c1697
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Fri May 29 16:53:59 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Jun 2 14:58:13 2020 +0200

    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 at posteo.de>
    (cherry picked from commit 33cac418db78f64f7fa84b8e65c01c2b02cf17a7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95358
    Tested-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 8cb0a06594fa..75f224d64acb 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -955,6 +955,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 c3b18a4d82c0..e4cac9a03766 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 b50c610645f4..a52ea7a785a4 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -309,7 +309,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;
@@ -409,6 +410,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 349102848bd1..5cddefa96228 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -470,6 +470,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)
@@ -611,6 +612,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;


More information about the Libreoffice-commits mailing list