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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri May 8 08:12:20 UTC 2020


 include/vcl/button.hxx                |    9 ---------
 sc/source/ui/cctrl/checklistmenu.cxx  |    4 +++-
 sc/source/ui/inc/checklistmenu.hxx    |    2 +-
 svtools/source/brwbox/ebbcontrols.cxx |    3 ++-
 toolkit/source/awt/vclxtoolkit.cxx    |    3 ++-
 vcl/source/control/button.cxx         |    6 ------
 vcl/source/window/builder.cxx         |    7 +------
 7 files changed, 9 insertions(+), 25 deletions(-)

New commits:
commit 962bf806f655e3c631bc1b77f8419e5e8fc64c0c
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu May 7 20:28:33 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri May 8 10:11:43 2020 +0200

    remove TriStateBox class
    
    Change-Id: Ia6c76a9f0fc0be7790d0c801cbca4a7b8d478976
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93680
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 35e98c52bba6..97fc939e9c1e 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -489,15 +489,6 @@ public:
                  ImageButton( vcl::Window* pParent, WinBits nStyle = 0 );
 };
 
-class VCL_DLLPUBLIC TriStateBox final : public CheckBox
-{
-                    TriStateBox( const TriStateBox & ) = delete;
-                    TriStateBox & operator= ( const TriStateBox & ) = delete;
-
-public:
-    explicit        TriStateBox( vcl::Window* pParent, WinBits nStyle );
-};
-
 #endif // INCLUDED_VCL_BUTTON_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 69903842c2f0..d892e8015443 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -881,7 +881,7 @@ ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* p
     ScMenuFloatingWindow(pParent, pDoc),
     maEdSearch(VclPtr<ScSearchEdit>::Create(this)),
     maChecks(VclPtr<ScCheckListBox>::Create(this)),
-    maChkToggleAll(VclPtr<TriStateBox>::Create(this, 0)),
+    maChkToggleAll(VclPtr<CheckBox>::Create(this, 0)),
     maBtnSelectSingle(VclPtr<ImageButton>::Create(this, 0)),
     maBtnUnselectSingle(VclPtr<ImageButton>::Create(this, 0)),
     maBtnOk(VclPtr<OKButton>::Create(this)),
@@ -890,6 +890,8 @@ ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* p
     mePrevToggleAllState(TRISTATE_INDET),
     maTabStops(this)
 {
+    maChkToggleAll->EnableTriState(true);
+
     float fScaleFactor = GetDPIScaleFactor();
 
     nWidth = std::max<int>(nWidth, 200 * fScaleFactor);
diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx
index 2ff574a15252..6fba5f249840 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -421,7 +421,7 @@ private:
     VclPtr<ScSearchEdit>   maEdSearch;
     VclPtr<ScCheckListBox> maChecks;
 
-    VclPtr<TriStateBox>     maChkToggleAll;
+    VclPtr<CheckBox>        maChkToggleAll;
     VclPtr<ImageButton>     maBtnSelectSingle;
     VclPtr<ImageButton>     maBtnUnselectSingle;
 
diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx
index 27261014908a..c90561c6a89a 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -230,7 +230,8 @@ namespace svt
 
         EnableChildTransparentMode();
 
-        pBox = VclPtr<TriStateBox>::Create(this,WB_CENTER|WB_VCENTER);
+        pBox = VclPtr<CheckBox>::Create(this,WB_CENTER|WB_VCENTER);
+        pBox->EnableTriState( true );
         pBox->SetLegacyNoTextAlign( true );
         pBox->EnableChildTransparentMode();
         pBox->SetPaintTransparent( true );
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 69d4c01d1e4d..773b3e930537 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -1668,7 +1668,8 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
                 *ppNewComp = new VCLXToolBox;
             break;
             case WindowType::TRISTATEBOX:
-                pNewWindow = VclPtr<TriStateBox>::Create( pParent, nWinBits );
+                pNewWindow = VclPtr<CheckBox>::Create( pParent, nWinBits );
+                static_cast<CheckBox*>(pNewWindow.get())->EnableTriState(true);
             break;
             case WindowType::WARNINGBOX:
                 pNewWindow = VclPtr<WarningBox>::Create( pParent, nMessBoxStyle, nWinBits, OUString() );
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 20528189da18..45c922dcb362 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -3696,10 +3696,4 @@ void ImageButton::ImplInitStyle()
     SetStyle( nStyle );
 }
 
-TriStateBox::TriStateBox( vcl::Window* pParent, WinBits nStyle ) :
-    CheckBox( pParent, nStyle )
-{
-    EnableTriState();
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 9aef02f6c887..6189412ac8b9 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1983,13 +1983,8 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
         OUString sWrap = BuilderUtils::extractCustomProperty(rMap);
         if (!sWrap.isEmpty())
             nBits |= WB_WORDBREAK;
-        //maybe always import as TriStateBox and enable/disable tristate
         bool bIsTriState = extractInconsistent(rMap);
-        VclPtr<CheckBox> xCheckBox;
-        if (bIsTriState && m_bLegacy)
-            xCheckBox = VclPtr<TriStateBox>::Create(pParent, nBits);
-        else
-            xCheckBox = VclPtr<CheckBox>::Create(pParent, nBits);
+        VclPtr<CheckBox> xCheckBox = VclPtr<CheckBox>::Create(pParent, nBits);
         if (bIsTriState)
         {
             xCheckBox->EnableTriState(true);


More information about the Libreoffice-commits mailing list