[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/source

Michael Weghorn (via logerrit) logerrit at kemper.freedesktop.org
Fri May 29 20:54:07 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 b03223b25366c981f40973152afaf9ed404fca76
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Fri May 29 16:53:59 2020 +0200
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Fri May 29 22:53:36 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 0ea1d6939b6b8b97b010c9aa3adc94bb892cd5d9)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95127

diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index fe79d666f68a..000b660ca04a 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -954,6 +954,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 175c0828a540..a5206cf72a4d 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 ba1cdca98492..ddcfd56aaa73 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -310,7 +310,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;
@@ -410,6 +411,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 abfcd3ecf5b0..4195cf0bba95 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