diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-07-09 20:16:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-07-12 18:16:22 +0200 |
commit | 8328d84a0ce8c1b9592ce0dbab17dbbecc423b3c (patch) | |
tree | b25fd10fd460280b1e03d5057dffde1e95cf0bb8 /dbaccess | |
parent | 1663b961ce2f9f109ad7634f165445f9ea785db3 (diff) |
weld CheckBoxControl
Change-Id: Iea057189ab17c1fdaf6663f1c328b9d288d97a18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98532
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/control/TableGrantCtrl.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 28 |
2 files changed, 17 insertions, 20 deletions
diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx index dd2f4b4574b8..6aba975d6b8a 100644 --- a/dbaccess/source/ui/control/TableGrantCtrl.cxx +++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx @@ -27,7 +27,6 @@ #include <com/sun/star/sdbcx/XAuthorizable.hpp> #include <connectivity/dbtools.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <vcl/button.hxx> #include <vcl/svapp.hxx> #include <osl/diagnose.h> #include <strings.hrc> @@ -133,8 +132,8 @@ void OTableGrantControl::Init() // instantiate ComboBox if(!m_pCheckCell) { - m_pCheckCell = VclPtr<CheckBoxControl>::Create( &GetDataWindow() ); - m_pCheckCell->GetBox().EnableTriState(false); + m_pCheckCell = VclPtr<CheckBoxControl>::Create( &GetDataWindow() ); + m_pCheckCell->EnableTriState(false); m_pEdit = VclPtr<EditControl>::Create(&GetDataWindow()); weld::Entry& rEntry = m_pEdit->get_widget(); @@ -195,7 +194,7 @@ bool OTableGrantControl::IsTabAllowed(bool bForward) const } #define GRANT_REVOKE_RIGHT(what) \ - if(m_pCheckCell->GetBox().IsChecked()) \ + if (m_pCheckCell->GetBox().get_active()) \ xAuth->grantPrivileges(sTableName,PrivilegeObject::TABLE,what);\ else \ xAuth->revokePrivileges(sTableName,PrivilegeObject::TABLE,what) @@ -281,7 +280,7 @@ void OTableGrantControl::InitController( CellControllerRef& /*rController*/, lon { // get the privileges from the user TTablePrivilegeMap::const_iterator aFind = findPrivilege(nRow); - m_pCheckCell->GetBox().Check(aFind != m_aPrivMap.end() && isAllowed(nColumnId,aFind->second.nRights)); + m_pCheckCell->GetBox().set_active(aFind != m_aPrivMap.end() && isAllowed(nColumnId,aFind->second.nRights)); } } diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index ecdd09bd4fb4..bb7bd9584115 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -34,7 +34,6 @@ #include <strings.hxx> #include <helpids.h> #include "QTableWindow.hxx" -#include <vcl/button.hxx> #include <vcl/weld.hxx> #include <vcl/settings.hxx> #include "QueryDesignFieldUndoAct.hxx" @@ -134,7 +133,7 @@ OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent ) m_pFunctionCell->SetHelpId(HID_QRYDGN_ROW_FUNCTION); // switch off triState of css::form::CheckBox - m_pVisibleCell->GetBox().EnableTriState( false ); + m_pVisibleCell->EnableTriState( false ); vcl::Font aTitleFont = OutputDevice::GetDefaultFont( DefaultFontType::SANS_UNICODE,Window::GetSettings().GetLanguageTag().getLanguageType(),GetDefaultFontFlags::OnlyOne); aTitleFont.SetFontSize(Size(0, 6)); @@ -513,8 +512,8 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon } break; case BROW_VIS_ROW: { - m_pVisibleCell->GetBox().Check(pEntry->IsVisible()); - m_pVisibleCell->GetBox().SaveValue(); + m_pVisibleCell->GetBox().set_active(pEntry->IsVisible()); + m_pVisibleCell->GetBox().save_state(); enableControl(pEntry,m_pTextCell); @@ -522,10 +521,9 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon { // a column has to visible in order to show up in ORDER BY pEntry->SetVisible(); - m_pVisibleCell->GetBox().Check(pEntry->IsVisible()); - m_pVisibleCell->GetBox().SaveValue(); - m_pVisibleCell->GetBox().Disable(); - m_pVisibleCell->GetBox().EnableInput(false); + m_pVisibleCell->GetBox().set_active(pEntry->IsVisible()); + m_pVisibleCell->GetBox().save_state(); + m_pVisibleCell->GetBox().set_sensitive(false); OUString aMessage(DBA_RES(STR_QRY_ORDERBY_UNRELATED)); OQueryDesignView* paDView = getDesignView(); std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(paDView ? paDView->GetFrameWeld() : nullptr, @@ -914,19 +912,19 @@ bool OSelectionBrowseBox::SaveModified() { case BROW_VIS_ROW: { - bool bOldValue = m_pVisibleCell->GetBox().GetSavedValue() != TRISTATE_FALSE; + bool bOldValue = m_pVisibleCell->GetBox().get_saved_state() != TRISTATE_FALSE; strOldCellContents = bOldValue ? OUStringLiteral("1") : OUStringLiteral("0"); sNewValue = !bOldValue ? OUStringLiteral("1") : OUStringLiteral("0"); } if((m_bOrderByUnRelated || pEntry->GetOrderDir() == ORDER_NONE) && (m_bGroupByUnRelated || !pEntry->IsGroupBy())) { - pEntry->SetVisible(m_pVisibleCell->GetBox().IsChecked()); + pEntry->SetVisible(m_pVisibleCell->GetBox().get_active()); } else { pEntry->SetVisible(); - m_pVisibleCell->GetBox().Check(); + m_pVisibleCell->GetBox().set_active(true); } break; @@ -1030,7 +1028,7 @@ bool OSelectionBrowseBox::SaveModified() if(!m_bOrderByUnRelated) { pEntry->SetVisible(); - m_pVisibleCell->GetBox().Check(); + m_pVisibleCell->GetBox().set_active(true); RowModified(GetBrowseRow(BROW_VIS_ROW), GetCurColumnId()); } sNewValue = OUString::number(static_cast<sal_uInt16>(pEntry->GetOrderDir())); @@ -1058,7 +1056,7 @@ bool OSelectionBrowseBox::SaveModified() { // we have to change the visible flag, so we must append also an undo action pEntry->SetVisible(); - m_pVisibleCell->GetBox().Check(); + m_pVisibleCell->GetBox().set_active(true); appendUndoAction("0","1",BROW_VIS_ROW,bListAction); RowModified(GetBrowseRow(BROW_VIS_ROW), GetCurColumnId()); } @@ -1873,11 +1871,11 @@ void OSelectionBrowseBox::CellModified() !pEntry->IsEmpty() && pEntry->GetOrderDir() != ORDER_NONE) { - m_pVisibleCell->GetBox().Check(); + m_pVisibleCell->GetBox().set_active(true); pEntry->SetVisible(); } else - pEntry->SetVisible(m_pVisibleCell->GetBox().IsChecked()); + pEntry->SetVisible(m_pVisibleCell->GetBox().get_active()); } break; } |