[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - include/vcl vcl/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 30 07:36:21 UTC 2019


 include/vcl/button.hxx        |    2 +-
 vcl/source/control/button.cxx |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit c27987010c6fd67ae68ddc2a3d316b62bdd81d84
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Tue Jul 23 13:53:21 2019 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Jul 30 09:35:37 2019 +0200

    tdf#125609 c14: vcl button: don't modify style directly
    
    LO 6.4/6.3 commit d35171456bc230efdaa9426da1398b2db7fa0df8
    could cause a recursive loop. ImplInitStyle RETURNS the
    suggested style, while ImplUncheckAll MODIFYS the
    actual style. Since the call to set WB_TABSTOP
    was already redundant in this case (and many others),
    I provided an option to avoid that direct modification.
    
    An example crashing document is attached to the bug report,
    which will eventually find its way into automatic crash testing.
    For this particular example document, it also requires
    LO 6.4 commit 5cf057c3365a0feafc8f2e4f4a9e24d69a581999
    in order to trigger a crash.
    
    Change-Id: I26dddca27471dec10650f848f787363505b16c0f
    Reviewed-on: https://gerrit.libreoffice.org/76186
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Tested-by: Justin Luth <justin_luth at sil.org>
    (cherry picked from commit a9f4913f283d34c610c4b73c755fdc828857bfce)
    Reviewed-on: https://gerrit.libreoffice.org/76574
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 2a63e47a8c9b..4e782aa7a437 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -297,7 +297,7 @@ private:
                               const Size& rImageSize, tools::Rectangle& rStateRect,
                               tools::Rectangle& rMouseRect );
     SAL_DLLPRIVATE void     ImplDrawRadioButton(vcl::RenderContext& rRenderContext );
-    SAL_DLLPRIVATE void     ImplUncheckAllOther();
+    SAL_DLLPRIVATE void     ImplUncheckAllOther( const bool bSetStyle = true);
     SAL_DLLPRIVATE Size     ImplGetRadioImageSize() const;
     SAL_DLLPRIVATE long     ImplGetImageToTextDistance() const;
 
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 1aa58877ad6d..f78fa7d92994 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1864,7 +1864,7 @@ WinBits RadioButton::ImplInitStyle( const vcl::Window* pPrevWindow, WinBits nSty
     }
 
     if ( IsChecked() && IsRadioCheckEnabled() )
-        ImplUncheckAllOther();
+        ImplUncheckAllOther( /*bSetStyle=*/false );
 
     return nStyle;
 }
@@ -2251,9 +2251,10 @@ std::vector< VclPtr<RadioButton> > RadioButton::GetRadioButtonGroup(bool bInclud
     return aGroup;
 }
 
-void RadioButton::ImplUncheckAllOther()
+void RadioButton::ImplUncheckAllOther( const bool bSetStyle )
 {
-    mpWindowImpl->mnStyle |= WB_TABSTOP;
+    if ( bSetStyle )
+        mpWindowImpl->mnStyle |= WB_TABSTOP;
 
     std::vector<VclPtr<RadioButton> > aGroup(GetRadioButtonGroup(false));
     // iterate over radio button group and checked buttons


More information about the Libreoffice-commits mailing list