diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-03-11 09:11:38 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-03-11 11:49:22 +0100 |
commit | fe902aa8f3b7e6d43bc0d7ea3e6f77d25da40311 (patch) | |
tree | 9204477aa2c5f8b228ea96079c0d59dbee5d58bf /cui/source/customize | |
parent | 57cbadcd84bff198811629470f0554396b041f40 (diff) |
Remove unused code from Macro Selector dialog
Change-Id: I9930fd7eaf2410447f84aa4798478a10915ea738
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112316
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'cui/source/customize')
-rw-r--r-- | cui/source/customize/cfgutil.cxx | 41 | ||||
-rw-r--r-- | cui/source/customize/macropg.cxx | 2 |
2 files changed, 12 insertions, 31 deletions
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index a980d4b7fa3f..fa9d9139d1f5 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -1050,37 +1050,27 @@ void CuiConfigGroupListBox::SelectMacro( const OUString& rBasic, */ SvxScriptSelectorDialog::SvxScriptSelectorDialog( - weld::Window* pParent, bool bShowSlots, const css::uno::Reference< css::frame::XFrame >& xFrame) + weld::Window* pParent, const css::uno::Reference< css::frame::XFrame >& xFrame) : GenericDialogController(pParent, "cui/ui/macroselectordialog.ui", "MacroSelectorDialog") - , m_bShowSlots(bShowSlots) - , m_xDialogDescription(m_xBuilder->weld_label(bShowSlots ? "helptoolbar" : "helpmacro")) + , m_xDialogDescription(m_xBuilder->weld_label("helpmacro")) , m_xCategories(new CuiConfigGroupListBox(m_xBuilder->weld_tree_view("categories"))) , m_xCommands(new CuiConfigFunctionListBox(m_xBuilder->weld_tree_view("commands"))) , m_xLibraryFT(m_xBuilder->weld_label("libraryft")) - , m_xCategoryFT(m_xBuilder->weld_label("categoryft")) , m_xMacronameFT(m_xBuilder->weld_label("macronameft")) - , m_xCommandsFT(m_xBuilder->weld_label("commandsft")) - , m_xOKButton(m_xBuilder->weld_button(bShowSlots ? "add" : "ok")) - , m_xCancelButton(m_xBuilder->weld_button(bShowSlots ? "close" : "cancel")) + , m_xOKButton(m_xBuilder->weld_button("ok")) + , m_xCancelButton(m_xBuilder->weld_button("cancel")) , m_xDescriptionText(m_xBuilder->weld_text_view("description")) { - if (m_bShowSlots) - { - // If we are showing Slot API commands update labels in the UI - m_xDialog->set_title(CuiResId(RID_SVXSTR_SELECTOR_ADD_COMMANDS)); - } m_xCancelButton->show(); m_xDialogDescription->show(); m_xOKButton->show(); - m_xLibraryFT->set_visible(!m_bShowSlots); - m_xCategoryFT->set_visible(m_bShowSlots); - m_xMacronameFT->set_visible(!m_bShowSlots); - m_xCommandsFT->set_visible(m_bShowSlots); + m_xLibraryFT->set_visible(true); + m_xMacronameFT->set_visible(true); const OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(xFrame)); m_xCategories->SetFunctionListBox(m_xCommands.get()); - m_xCategories->Init(comphelper::getProcessComponentContext(), xFrame, aModuleName, bShowSlots); + m_xCategories->Init(comphelper::getProcessComponentContext(), xFrame, aModuleName, /*bShowSlots*/false); m_xCategories->connect_changed( LINK( this, SvxScriptSelectorDialog, SelectHdl ) ); @@ -1104,6 +1094,9 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog( m_xCategories->SetStylesInfo(&m_aStylesInfo); UpdateUI(); + + if (comphelper::LibreOfficeKit::isActive()) + m_xDescriptionText->hide(); } SvxScriptSelectorDialog::~SvxScriptSelectorDialog() @@ -1154,19 +1147,7 @@ IMPL_LINK(SvxScriptSelectorDialog, ClickHdl, weld::Button&, rButton, void) } else if (&rButton == m_xOKButton.get()) { - // If we are displaying Slot API commands then this the dialog is being - // run from Tools/Configure and we should not close it - if ( !m_bShowSlots ) - { - m_xDialog->response(RET_OK); - } - else - { - // Select the next entry in the list if possible - std::unique_ptr<weld::TreeIter> xIter = m_xCommands->make_iterator(); - if (m_xCommands->get_selected(xIter.get()) && m_xCommands->iter_next_sibling(*xIter)) - m_xCommands->select(*xIter); - } + m_xDialog->response(RET_OK); } } diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 2fb442dbdb24..cdf07498f83e 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -460,7 +460,7 @@ void SvxMacroTabPage_::GenericHandler_Impl(SvxMacroTabPage_* pThis, const weld:: else if( bAssEnabled ) { // assign pressed - SvxScriptSelectorDialog aDlg(pThis->GetFrameWeld(), false, pThis->GetFrame()); + SvxScriptSelectorDialog aDlg(pThis->GetFrameWeld(), pThis->GetFrame()); short ret = aDlg.run(); if ( ret ) { |