[Libreoffice-commits] core.git: include/vcl vcl/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 30 05:18:12 UTC 2019


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

New commits:
commit a9f4913f283d34c610c4b73c755fdc828857bfce
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Tue Jul 23 13:53:21 2019 +0300
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Tue Jul 30 07:17:13 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>

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 6e0e70346215..5f6194e52bd5 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1855,7 +1855,7 @@ WinBits RadioButton::ImplInitStyle( const vcl::Window* pPrevWindow, WinBits nSty
         nStyle |= WB_TABSTOP;
 
     if ( IsChecked() && IsRadioCheckEnabled() )
-        ImplUncheckAllOther();
+        ImplUncheckAllOther( /*bSetStyle=*/false );
 
     return nStyle;
 }
@@ -2243,9 +2243,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