summaryrefslogtreecommitdiff
path: root/cui/source/customize
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-09-20 20:29:36 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-09-26 09:54:18 +0200
commita37e559ed123789f6bc8f7972242d6461ce692ab (patch)
tree7c6304b4541335b2bb706efda58b882132fe3819 /cui/source/customize
parentb3f249c1351642be6f2774230ff80a6d20bd1401 (diff)
disinherit OWizardPage and SfxTabPage from vcl TabPage
Now that there's no need to support weld/unwelded mixes of pages in dialog any more. inherit from a BuilderPage which contains a Builder and Toplevel container BuilderPage Activate and Deactivate replace TabPage ActivatePage and DeactivatePage, allowing disambiguation wrt SfxTabPage ActivatePage and DeactivatePage. Change-Id: I5706e50fd92f712a25328ee9791e054bb9ad9812 Reviewed-on: https://gerrit.libreoffice.org/79317 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source/customize')
-rw-r--r--cui/source/customize/SvxMenuConfigPage.cxx13
-rw-r--r--cui/source/customize/SvxNotebookbarConfigPage.cxx2
-rw-r--r--cui/source/customize/SvxToolbarConfigPage.cxx11
-rw-r--r--cui/source/customize/acccfg.cxx7
-rw-r--r--cui/source/customize/cfg.cxx33
-rw-r--r--cui/source/customize/eventdlg.cxx1
-rw-r--r--cui/source/customize/macropg.cxx9
7 files changed, 23 insertions, 53 deletions
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx
index d68582f7da5f..08fb276030be 100644
--- a/cui/source/customize/SvxMenuConfigPage.cxx
+++ b/cui/source/customize/SvxMenuConfigPage.cxx
@@ -134,7 +134,9 @@ IMPL_LINK(SvxMenuConfigPage, MenuEntriesSizeAllocHdl, const Size&, rSize, void)
SvxMenuConfigPage::~SvxMenuConfigPage()
{
- disposeOnce();
+ for (int i = 0, nCount = m_xSaveInListBox->get_count(); i < nCount; ++i)
+ delete reinterpret_cast<SaveInData*>(m_xSaveInListBox->get_id(i).toInt64());
+ m_xSaveInListBox->clear();
}
// Populates the Menu combo box
@@ -156,15 +158,6 @@ void SvxMenuConfigPage::Init()
m_xCommandCategoryListBox->categorySelected(m_xFunctions.get(), OUString(), GetSaveInData());
}
-void SvxMenuConfigPage::dispose()
-{
- for (int i = 0, nCount = m_xSaveInListBox->get_count(); i < nCount; ++i)
- delete reinterpret_cast<SaveInData*>(m_xSaveInListBox->get_id(i).toInt64());
- m_xSaveInListBox->clear();
-
- SvxConfigPage::dispose();
-}
-
IMPL_LINK_NOARG(SvxMenuConfigPage, SelectMenuEntry, weld::TreeView&, void)
{
UpdateButtonStates();
diff --git a/cui/source/customize/SvxNotebookbarConfigPage.cxx b/cui/source/customize/SvxNotebookbarConfigPage.cxx
index 521aafcfa67e..5c439ab8182b 100644
--- a/cui/source/customize/SvxNotebookbarConfigPage.cxx
+++ b/cui/source/customize/SvxNotebookbarConfigPage.cxx
@@ -152,7 +152,7 @@ SvxNotebookbarConfigPage::SvxNotebookbarConfigPage(TabPageParent pParent, const
rTreeView.show();
}
-SvxNotebookbarConfigPage::~SvxNotebookbarConfigPage() { disposeOnce(); }
+SvxNotebookbarConfigPage::~SvxNotebookbarConfigPage() {}
void SvxNotebookbarConfigPage::DeleteSelectedTopLevel() {}
diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx
index ff63843fb261..39de9ba9f08d 100644
--- a/cui/source/customize/SvxToolbarConfigPage.cxx
+++ b/cui/source/customize/SvxToolbarConfigPage.cxx
@@ -156,11 +156,6 @@ IMPL_LINK_NOARG(SvxToolbarConfigPage, ListModifiedHdl, weld::TreeView&, void)
SvxToolbarConfigPage::~SvxToolbarConfigPage()
{
- disposeOnce();
-}
-
-void SvxToolbarConfigPage::dispose()
-{
for (int i = 0, nCount = m_xSaveInListBox->get_count(); i < nCount; ++i)
{
ToolbarSaveInData* pData =
@@ -168,8 +163,6 @@ void SvxToolbarConfigPage::dispose()
delete pData;
}
m_xSaveInListBox->clear();
-
- SvxConfigPage::dispose();
}
void SvxToolbarConfigPage::DeleteSelectedTopLevel()
@@ -860,10 +853,10 @@ void SvxToolbarEntriesListBox::ChangedVisibility(int nRow)
{
pEntryData->SetVisible(m_xControl->get_toggle(nRow, 0) == TRISTATE_TRUE);
- SvxConfigEntry* pToolbar = pPage->GetTopLevelSelection();
+ SvxConfigEntry* pToolbar = m_pPage->GetTopLevelSelection();
ToolbarSaveInData* pToolbarSaveInData = static_cast<ToolbarSaveInData*>(
- pPage->GetSaveInData() );
+ m_pPage->GetSaveInData() );
pToolbarSaveInData->ApplyToolbar( pToolbar );
}
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 3437ca718166..2cdca489eb75 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -906,11 +906,6 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage(TabPageParent pParent, const
SfxAcceleratorConfigPage::~SfxAcceleratorConfigPage()
{
- disposeOnce();
-}
-
-void SfxAcceleratorConfigPage::dispose()
-{
m_aFillGroupIdle.Stop();
// free memory - remove all dynamic user data
@@ -919,8 +914,6 @@ void SfxAcceleratorConfigPage::dispose()
TAccInfo* pUserData = reinterpret_cast<TAccInfo*>(m_xEntriesBox->get_id(i).toInt64());
delete pUserData;
}
-
- SfxTabPage::dispose();
}
void SfxAcceleratorConfigPage::InitAccCfg()
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index def983911b70..0246f66d82a8 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -161,35 +161,35 @@ SvxConfigPage::CanConfig( const OUString& aModuleId )
return !(aModuleId == "com.sun.star.script.BasicIDE" || aModuleId == "com.sun.star.frame.Bibliography");
}
-static VclPtr<SfxTabPage> CreateSvxMenuConfigPage( TabPageParent pParent, const SfxItemSet* rSet )
+static std::unique_ptr<SfxTabPage> CreateSvxMenuConfigPage( TabPageParent pParent, const SfxItemSet* rSet )
{
- return VclPtr<SvxMenuConfigPage>::Create(pParent, *rSet);
+ return std::make_unique<SvxMenuConfigPage>(pParent, *rSet);
}
-static VclPtr<SfxTabPage> CreateSvxContextMenuConfigPage( TabPageParent pParent, const SfxItemSet* rSet )
+static std::unique_ptr<SfxTabPage> CreateSvxContextMenuConfigPage( TabPageParent pParent, const SfxItemSet* rSet )
{
- return VclPtr<SvxMenuConfigPage>::Create(pParent, *rSet, false);
+ return std::make_unique<SvxMenuConfigPage>(pParent, *rSet, false);
}
-static VclPtr<SfxTabPage> CreateKeyboardConfigPage( TabPageParent pParent, const SfxItemSet* rSet )
+static std::unique_ptr<SfxTabPage> CreateKeyboardConfigPage( TabPageParent pParent, const SfxItemSet* rSet )
{
- return VclPtr<SfxAcceleratorConfigPage>::Create(pParent, *rSet);
+ return std::make_unique<SfxAcceleratorConfigPage>(pParent, *rSet);
}
-static VclPtr<SfxTabPage> CreateSvxNotebookbarConfigPage(TabPageParent pParent,
+static std::unique_ptr<SfxTabPage> CreateSvxNotebookbarConfigPage(TabPageParent pParent,
const SfxItemSet* rSet)
{
- return VclPtr<SvxNotebookbarConfigPage>::Create(pParent, *rSet);
+ return std::make_unique<SvxNotebookbarConfigPage>(pParent, *rSet);
}
-static VclPtr<SfxTabPage> CreateSvxToolbarConfigPage( TabPageParent pParent, const SfxItemSet* rSet )
+static std::unique_ptr<SfxTabPage> CreateSvxToolbarConfigPage( TabPageParent pParent, const SfxItemSet* rSet )
{
- return VclPtr<SvxToolbarConfigPage>::Create(pParent, *rSet);
+ return std::make_unique<SvxToolbarConfigPage>(pParent, *rSet);
}
-static VclPtr<SfxTabPage> CreateSvxEventConfigPage( TabPageParent pParent, const SfxItemSet* rSet )
+static std::unique_ptr<SfxTabPage> CreateSvxEventConfigPage( TabPageParent pParent, const SfxItemSet* rSet )
{
- return VclPtr<SvxEventConfigPage>::Create(pParent, *rSet, SvxEventConfigPage::EarlyInit());
+ return std::make_unique<SvxEventConfigPage>(pParent, *rSet, SvxEventConfigPage::EarlyInit());
}
/******************************************************************************
@@ -927,7 +927,7 @@ void SvxMenuEntriesListBox::CreateDropDown()
SvxMenuEntriesListBox::SvxMenuEntriesListBox(std::unique_ptr<weld::TreeView> xControl, SvxConfigPage* pPg)
: m_xControl(std::move(xControl))
, m_xDropDown(m_xControl->create_virtual_device())
- , pPage(pPg)
+ , m_pPage(pPg)
{
CreateDropDown();
m_xControl->connect_key_press(LINK(this, SvxMenuEntriesListBox, KeyInputHdl));
@@ -944,16 +944,16 @@ IMPL_LINK(SvxMenuEntriesListBox, KeyInputHdl, const KeyEvent&, rKeyEvent, bool)
// support DELETE for removing the current entry
if ( keycode == KEY_DELETE )
{
- pPage->DeleteSelectedContent();
+ m_pPage->DeleteSelectedContent();
}
// support CTRL+UP and CTRL+DOWN for moving selected entries
else if ( keycode.GetCode() == KEY_UP && keycode.IsMod1() )
{
- pPage->MoveEntry( true );
+ m_pPage->MoveEntry( true );
}
else if ( keycode.GetCode() == KEY_DOWN && keycode.IsMod1() )
{
- pPage->MoveEntry( false );
+ m_pPage->MoveEntry( false );
}
else
{
@@ -1019,7 +1019,6 @@ IMPL_LINK_NOARG(SvxConfigPage, SelectElementHdl, weld::ComboBox&, void)
SvxConfigPage::~SvxConfigPage()
{
- disposeOnce();
}
void SvxConfigPage::Reset( const SfxItemSet* )
diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx
index 44ff4f9e9137..155708aba3ce 100644
--- a/cui/source/customize/eventdlg.cxx
+++ b/cui/source/customize/eventdlg.cxx
@@ -74,7 +74,6 @@ void SvxEventConfigPage::LateInit( const uno::Reference< frame::XFrame >& _rxFra
SvxEventConfigPage::~SvxEventConfigPage()
{
- disposeOnce();
}
void SvxEventConfigPage::ImplInitDocument()
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 4a608f6c9883..d7d005487832 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -84,13 +84,7 @@ SvxMacroTabPage_::SvxMacroTabPage_(TabPageParent pParent, const OUString& rUIXML
SvxMacroTabPage_::~SvxMacroTabPage_()
{
- disposeOnce();
-}
-
-void SvxMacroTabPage_::dispose()
-{
mpImpl.reset();
- SfxTabPage::dispose();
}
void SvxMacroTabPage_::InitResources()
@@ -622,8 +616,7 @@ SvxMacroAssignDlg::SvxMacroAssignDlg(weld::Window* pParent, const Reference< fra
: SvxMacroAssignSingleTabDialog(pParent, rSet)
{
TabPageParent pPageParent(get_content_area(), this);
- auto pPage = VclPtr<SvxMacroTabPage>::Create(pPageParent, _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex);
- SetTabPage(pPage);
+ SetTabPage(std::make_unique<SvxMacroTabPage>(pPageParent, _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex));
}
IMPL_LINK_NOARG(AssignComponentDialog, ButtonHandler, weld::Button&, void)