From 7fb43031b7eec663768f5a4e78e60da86379df41 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 21 Oct 2019 13:38:33 +0200 Subject: loplugin:constantparam Change-Id: Ibfe70492683ff3ec208cee95d8a11155ec54f690 Reviewed-on: https://gerrit.libreoffice.org/81314 Tested-by: Jenkins Reviewed-by: Noel Grandin --- cui/source/customize/SvxMenuConfigPage.cxx | 4 ++-- cui/source/customize/SvxToolbarConfigPage.cxx | 2 +- cui/source/customize/cfg.cxx | 15 ++++----------- 3 files changed, 7 insertions(+), 14 deletions(-) (limited to 'cui/source/customize') diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx index f7d7a5647d1e..f560a25f1632 100644 --- a/cui/source/customize/SvxMenuConfigPage.cxx +++ b/cui/source/customize/SvxMenuConfigPage.cxx @@ -386,7 +386,7 @@ IMPL_LINK(SvxMenuConfigPage, InsertHdl, const OString&, rIdent, void) { SvxConfigEntry* pNewEntryData = new SvxConfigEntry; pNewEntryData->SetUserDefined(); - int nPos = InsertEntry(pNewEntryData, -1); + int nPos = AppendEntry(pNewEntryData, -1); InsertEntryIntoUI(pNewEntryData, nPos, 0); } else if (rIdent == "insertsubmenu") @@ -407,7 +407,7 @@ IMPL_LINK(SvxMenuConfigPage, InsertHdl, const OString&, rIdent, void) pNewEntryData->SetName( aNewName ); pNewEntryData->SetUserDefined(); - int nPos = InsertEntry(pNewEntryData, -1); + int nPos = AppendEntry(pNewEntryData, -1); InsertEntryIntoUI(pNewEntryData, nPos, 0); ReloadTopLevelListBox(); diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx index 7f6efd83803c..36b3fd202d32 100644 --- a/cui/source/customize/SvxToolbarConfigPage.cxx +++ b/cui/source/customize/SvxToolbarConfigPage.cxx @@ -463,7 +463,7 @@ IMPL_LINK(SvxToolbarConfigPage, InsertHdl, const OString&, rIdent, void) SvxConfigEntry* pNewEntryData = new SvxConfigEntry; pNewEntryData->SetUserDefined(); - int nPos = InsertEntry(pNewEntryData, -1); + int nPos = AppendEntry(pNewEntryData, -1); InsertEntryIntoUI(pNewEntryData, nPos, 1); static_cast( GetSaveInData())->ApplyToolbar( pToolbar ); diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index b9f08fe53149..ae4d0da10834 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1446,13 +1446,12 @@ int SvxConfigPage::AddFunction(int nTarget, bool bAllowDuplicates) } } - return InsertEntry(pNewEntryData, nTarget, /*bFront*/false); + return AppendEntry(pNewEntryData, nTarget); } -int SvxConfigPage::InsertEntry( +int SvxConfigPage::AppendEntry( SvxConfigEntry* pNewEntryData, - int nTarget, - bool bFront) + int nTarget) { SvxConfigEntry* pTopLevelSelection = GetTopLevelSelection(); @@ -1468,13 +1467,7 @@ int SvxConfigPage::InsertEntry( OUString sId(OUString::number(reinterpret_cast(pNewEntryData))); - if (bFront) - { - pEntries->insert( pEntries->begin(), pNewEntryData ); - m_xContentsListBox->insert(0, sId); - nNewEntry = 0; - } - else if (nCurEntry == -1 || nCurEntry == m_xContentsListBox->n_children() - 1) + if (nCurEntry == -1 || nCurEntry == m_xContentsListBox->n_children() - 1) { pEntries->push_back( pNewEntryData ); m_xContentsListBox->insert(-1, sId); -- cgit