From b3d41f0c0ad6790254a898f8fd242979c0e47be4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 24 Oct 2018 12:26:04 +0100 Subject: drop now unused OCommonBehaviourTabPage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0a7ff8a018cbe20481360196f6f2ed919f11ded8 Reviewed-on: https://gerrit.libreoffice.org/62293 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- dbaccess/source/ui/dlg/detailpages.cxx | 162 ++++----------------------------- dbaccess/source/ui/dlg/detailpages.hxx | 39 -------- 2 files changed, 17 insertions(+), 184 deletions(-) (limited to 'dbaccess/source/ui/dlg') diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 9b41ad6404fa..00e3c38e6333 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -54,151 +54,6 @@ namespace dbaui using namespace ::com::sun::star::container; using namespace ::dbtools; - OCommonBehaviourTabPage::OCommonBehaviourTabPage(vcl::Window* pParent, const OString& rId, - const OUString& rUIXMLDescription, const SfxItemSet& _rCoreAttrs, - OCommonBehaviourTabPageFlags nControlFlags) - - :OGenericAdministrationPage(pParent, rId, rUIXMLDescription, _rCoreAttrs) - ,m_pOptionsLabel(nullptr) - ,m_pOptions(nullptr) - ,m_pCharsetLabel(nullptr) - ,m_pCharset(nullptr) - ,m_pAutoRetrievingEnabled(nullptr) - ,m_pAutoIncrementLabel(nullptr) - ,m_pAutoIncrement(nullptr) - ,m_pAutoRetrievingLabel(nullptr) - ,m_pAutoRetrieving(nullptr) - ,m_nControlFlags(nControlFlags) - { - - if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseOptions) - { - m_pOptionsLabel = get("optionslabel"); - m_pOptionsLabel->Show(); - m_pOptions = get("options"); - m_pOptions->Show(); - m_pOptions->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl)); - } - - if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseCharset) - { - FixedText* pDataConvertLabel = get("charsetheader"); - pDataConvertLabel->Show(); - m_pCharsetLabel = get("charsetlabel"); - m_pCharsetLabel->Show(); - m_pCharset = get("charset"); - m_pCharset->Show(); - m_pCharset->SetSelectHdl(LINK(this, OCommonBehaviourTabPage, CharsetSelectHdl)); - } - } - - IMPL_LINK_NOARG(OCommonBehaviourTabPage, CharsetSelectHdl, ListBox&, void) - { - callModifiedHdl(); - } - - OCommonBehaviourTabPage::~OCommonBehaviourTabPage() - { - disposeOnce(); - } - - void OCommonBehaviourTabPage::dispose() - { - m_pOptionsLabel.disposeAndClear(); - m_pOptions.disposeAndClear(); - m_pCharsetLabel.disposeAndClear(); - m_pCharset.disposeAndClear(); - m_pAutoIncrementLabel.disposeAndClear(); - m_pAutoIncrement.disposeAndClear(); - m_pAutoRetrievingEnabled.disposeAndClear(); - m_pAutoRetrievingLabel.disposeAndClear(); - m_pAutoRetrieving.disposeAndClear(); - OGenericAdministrationPage::dispose(); - } - - void OCommonBehaviourTabPage::fillWindows(std::vector< std::unique_ptr >& _rControlList) - { - if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseOptions) - { - _rControlList.emplace_back(new ODisableWrapper(m_pOptionsLabel)); - } - - if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseCharset) - { - _rControlList.emplace_back(new ODisableWrapper(m_pCharsetLabel)); - } - } - void OCommonBehaviourTabPage::fillControls(std::vector< std::unique_ptr >& _rControlList) - { - if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseOptions) - _rControlList.emplace_back(new OSaveValueWrapper(m_pOptions)); - - if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseCharset) - _rControlList.emplace_back(new OSaveValueWrapper(m_pCharset)); - } - - void OCommonBehaviourTabPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) - { - // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) - bool bValid, bReadonly; - getFlags(_rSet, bValid, bReadonly); - - // collect the items - const SfxStringItem* pOptionsItem = _rSet.GetItem(DSID_ADDITIONALOPTIONS); - const SfxStringItem* pCharsetItem = _rSet.GetItem(DSID_CHARSET); - - // forward the values to the controls - if (bValid) - { - if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseOptions) - { - m_pOptions->SetText(pOptionsItem->GetValue()); - m_pOptions->ClearModifyFlag(); - } - - if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseCharset) - { - m_pCharset->SelectEntryByIanaName( pCharsetItem->GetValue() ); - } - } - OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue); - } - - bool OCommonBehaviourTabPage::FillItemSet(SfxItemSet* _rSet) - { - bool bChangedSomething = false; - - if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseOptions) - { - fillString(*_rSet,m_pOptions,DSID_ADDITIONALOPTIONS,bChangedSomething); - } - - if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseCharset) - { - if ( m_pCharset->StoreSelectedCharSet( *_rSet, DSID_CHARSET ) ) - bChangedSomething = true; - } - - return bChangedSomething; - } - - // ODbaseDetailsPage - ODbaseDetailsPage::ODbaseDetailsPage(TabPageParent pParent, const SfxItemSet& _rCoreAttrs) - : DBOCommonBehaviourTabPage(pParent, "dbaccess/ui/dbasepage.ui", "DbasePage", - _rCoreAttrs, OCommonBehaviourTabPageFlags::UseCharset) - , m_xShowDeleted(m_xBuilder->weld_check_button("showDelRowsCheckbutton")) - , m_xFT_Message(m_xBuilder->weld_label("specMessageLabel")) - , m_xIndexes(m_xBuilder->weld_button("indiciesButton")) - { - m_xIndexes->connect_clicked(LINK(this, ODbaseDetailsPage, OnButtonClicked)); - m_xShowDeleted->connect_clicked(LINK(this, ODbaseDetailsPage, OnButtonClicked)); - } - - ODbaseDetailsPage::~ODbaseDetailsPage() - { - disposeOnce(); - } - DBOCommonBehaviourTabPage::DBOCommonBehaviourTabPage(TabPageParent pParent, const OUString& rUIXMLDescription, const OString& rId, const SfxItemSet& rCoreAttrs, OCommonBehaviourTabPageFlags nControlFlags) @@ -309,6 +164,23 @@ namespace dbaui return bChangedSomething; } + // ODbaseDetailsPage + ODbaseDetailsPage::ODbaseDetailsPage(TabPageParent pParent, const SfxItemSet& _rCoreAttrs) + : DBOCommonBehaviourTabPage(pParent, "dbaccess/ui/dbasepage.ui", "DbasePage", + _rCoreAttrs, OCommonBehaviourTabPageFlags::UseCharset) + , m_xShowDeleted(m_xBuilder->weld_check_button("showDelRowsCheckbutton")) + , m_xFT_Message(m_xBuilder->weld_label("specMessageLabel")) + , m_xIndexes(m_xBuilder->weld_button("indiciesButton")) + { + m_xIndexes->connect_clicked(LINK(this, ODbaseDetailsPage, OnButtonClicked)); + m_xShowDeleted->connect_clicked(LINK(this, ODbaseDetailsPage, OnButtonClicked)); + } + + ODbaseDetailsPage::~ODbaseDetailsPage() + { + disposeOnce(); + } + VclPtr ODriversSettings::CreateDbase(TabPageParent pParent, const SfxItemSet* _rAttrSet) { return VclPtr::Create(pParent, *_rAttrSet); diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index 1739de02d4d5..98341ca67ea1 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -51,45 +51,6 @@ namespace dbaui The controls to be used have to be defined within the resource, as usual, but this class does all the handling necessary. */ - class OCommonBehaviourTabPage : public OGenericAdministrationPage - { - protected: - - VclPtr m_pOptionsLabel; - VclPtr m_pOptions; - - VclPtr m_pCharsetLabel; - VclPtr m_pCharset; - - VclPtr m_pAutoRetrievingEnabled; - VclPtr m_pAutoIncrementLabel; - VclPtr m_pAutoIncrement; - VclPtr m_pAutoRetrievingLabel; - VclPtr m_pAutoRetrieving; - - OCommonBehaviourTabPageFlags m_nControlFlags; - - public: - virtual bool FillItemSet (SfxItemSet* _rCoreAttrs) override; - - OCommonBehaviourTabPage(vcl::Window* pParent, const OString& rId, const OUString& rUIXMLDescription, const SfxItemSet& _rCoreAttrs, OCommonBehaviourTabPageFlags nControlFlags); - protected: - - virtual ~OCommonBehaviourTabPage() override; - virtual void dispose() override; - - // subclasses must override this, but it isn't pure virtual - virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override; - - // OGenericAdministrationPage::fillControls - virtual void fillControls(std::vector< std::unique_ptr >& _rControlList) override; - - // OGenericAdministrationPage::fillWindows - virtual void fillWindows(std::vector< std::unique_ptr >& _rControlList) override; - private: - DECL_LINK(CharsetSelectHdl, ListBox&, void); - }; - class DBOCommonBehaviourTabPage : public OGenericAdministrationPage { protected: -- cgit