loplugin:moveparam in desktop

Change-Id: Ie96a3887876bf9a0bb13ae4a69d1685186a4e9b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123384
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2021-10-11 13:53:51 +02:00
parent 433492d50a
commit ebb636473f
7 changed files with 25 additions and 31 deletions

View file

@ -595,7 +595,7 @@ void ExtMgrDialog::updatePackage( const uno::Reference< deployment::XPackage > &
std::vector< css::uno::Reference< css::deployment::XPackage > > vEntries;
vEntries.push_back(extension);
m_pManager->getCmdQueue()->checkForUpdates( vEntries );
m_pManager->getCmdQueue()->checkForUpdates( std::move(vEntries) );
}
@ -1160,7 +1160,7 @@ IMPL_LINK_NOARG(UpdateRequiredDialog, HandleUpdateBtn, weld::Button&, void)
aGuard.clear();
m_pManager->getCmdQueue()->checkForUpdates( vUpdateEntries );
m_pManager->getCmdQueue()->checkForUpdates( std::move(vUpdateEntries) );
}

View file

@ -184,10 +184,10 @@ struct ExtensionCmd
m_bWarnUser( false ),
m_xPackage( rPackage ) {};
ExtensionCmd( const E_CMD_TYPE eCommand,
const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList )
std::vector<uno::Reference<deployment::XPackage > >&&vExtensionList )
: m_eCmdType( eCommand ),
m_bWarnUser( false ),
m_vExtensionList( vExtensionList ) {};
m_vExtensionList( std::move(vExtensionList) ) {};
};
}
@ -208,7 +208,7 @@ public:
void removeExtension( const uno::Reference< deployment::XPackage > &rPackage );
void enableExtension( const uno::Reference< deployment::XPackage > &rPackage,
const bool bEnable );
void checkForUpdates( const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList );
void checkForUpdates( std::vector<uno::Reference<deployment::XPackage > > && vExtensionList );
void acceptLicense( const uno::Reference< deployment::XPackage > &rPackage );
void stop();
bool isBusy();
@ -230,7 +230,7 @@ private:
const uno::Reference< deployment::XPackage > &xPackage );
void _disableExtension( ::rtl::Reference< ProgressCmdEnv > const &rCmdEnv,
const uno::Reference< deployment::XPackage > &xPackage );
void _checkForUpdates( const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList );
void _checkForUpdates( std::vector<uno::Reference<deployment::XPackage > > &&vExtensionList );
void _acceptLicense( ::rtl::Reference< ProgressCmdEnv > const &rCmdEnv,
const uno::Reference< deployment::XPackage > &xPackage );
@ -645,9 +645,9 @@ void ExtensionCmdQueue::Thread::enableExtension( const uno::Reference< deploymen
void ExtensionCmdQueue::Thread::checkForUpdates(
const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList )
std::vector<uno::Reference<deployment::XPackage > > && vExtensionList )
{
TExtensionCmd pEntry = std::make_shared<ExtensionCmd>( ExtensionCmd::CHECK_FOR_UPDATES, vExtensionList );
TExtensionCmd pEntry = std::make_shared<ExtensionCmd>( ExtensionCmd::CHECK_FOR_UPDATES, std::move(vExtensionList) );
_insert( pEntry );
}
@ -753,7 +753,7 @@ void ExtensionCmdQueue::Thread::execute()
_disableExtension( currentCmdEnv, pEntry->m_xPackage );
break;
case ExtensionCmd::CHECK_FOR_UPDATES :
_checkForUpdates( pEntry->m_vExtensionList );
_checkForUpdates( std::vector(pEntry->m_vExtensionList) );
break;
case ExtensionCmd::ACCEPT_LICENSE :
_acceptLicense( currentCmdEnv, pEntry->m_xPackage );
@ -913,7 +913,7 @@ void ExtensionCmdQueue::Thread::_removeExtension( ::rtl::Reference< ProgressCmdE
void ExtensionCmdQueue::Thread::_checkForUpdates(
const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList )
std::vector<uno::Reference<deployment::XPackage > > && vExtensionList )
{
const SolarMutexGuard guard;
@ -921,7 +921,7 @@ void ExtensionCmdQueue::Thread::_checkForUpdates(
m_pDialogHelper->incBusy();
std::vector< UpdateData > vData;
UpdateDialog aUpdateDialog(m_xContext, m_pDialogHelper ? m_pDialogHelper->getFrameWeld() : nullptr, vExtensionList, &vData);
UpdateDialog aUpdateDialog(m_xContext, m_pDialogHelper ? m_pDialogHelper->getFrameWeld() : nullptr, std::move(vExtensionList), &vData);
aUpdateDialog.notifyMenubar( true, false ); // prepare the checking, if there updates to be notified via menu bar icon
@ -1085,9 +1085,9 @@ void ExtensionCmdQueue::enableExtension( const uno::Reference< deployment::XPack
m_thread->enableExtension( rPackage, bEnable );
}
void ExtensionCmdQueue::checkForUpdates( const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList )
void ExtensionCmdQueue::checkForUpdates( std::vector<uno::Reference<deployment::XPackage > > && vExtensionList )
{
m_thread->checkForUpdates( vExtensionList );
m_thread->checkForUpdates( std::move(vExtensionList) );
}
void ExtensionCmdQueue::acceptLicense( const uno::Reference< deployment::XPackage > &rPackage )

View file

@ -72,8 +72,7 @@ public:
void removeExtension( const css::uno::Reference< css::deployment::XPackage > &rPackage );
void enableExtension( const css::uno::Reference< css::deployment::XPackage > &rPackage,
const bool bEnable );
void checkForUpdates(const std::vector< css::uno::Reference<
css::deployment::XPackage > > &vList );
void checkForUpdates( std::vector< css::uno::Reference< css::deployment::XPackage > > && vList );
void acceptLicense( const css::uno::Reference< css::deployment::XPackage > &rPackage );
static void syncRepositories( const css::uno::Reference< css::uno::XComponentContext > & xContext );
/**

View file

@ -230,7 +230,7 @@ void TheExtensionManager::checkUpdates()
}
}
m_xExecuteCmdQueue->checkForUpdates( vEntries );
m_xExecuteCmdQueue->checkForUpdates( std::move(vEntries) );
}

View file

@ -147,7 +147,7 @@ public:
Thread(
uno::Reference< uno::XComponentContext > const & context,
UpdateDialog & dialog,
const std::vector< uno::Reference< deployment::XPackage > > & vExtensionList);
std::vector< uno::Reference< deployment::XPackage > > && vExtensionList);
void stop();
@ -185,11 +185,11 @@ private:
UpdateDialog::Thread::Thread(
uno::Reference< uno::XComponentContext > const & context,
UpdateDialog & dialog,
const std::vector< uno::Reference< deployment::XPackage > > &vExtensionList):
std::vector< uno::Reference< deployment::XPackage > >&& vExtensionList):
salhelper::Thread("dp_gui_updatedialog"),
m_context(context),
m_dialog(dialog),
m_vExtensionList(vExtensionList),
m_vExtensionList(std::move(vExtensionList)),
m_updateInformation(
deployment::UpdateInformationProvider::create(context)),
m_stop(false)
@ -418,7 +418,7 @@ bool UpdateDialog::Thread::update(
// UpdateDialog ----------------------------------------------------------
UpdateDialog::UpdateDialog(
uno::Reference< uno::XComponentContext > const & context,
weld::Window * parent, const std::vector<uno::Reference< deployment::XPackage > > &vExtensionList,
weld::Window * parent, std::vector<uno::Reference< deployment::XPackage > > && vExtensionList,
std::vector< dp_gui::UpdateData > * updateData)
: GenericDialogController(parent, "desktop/ui/updatedialog.ui", "UpdateDialog")
, m_context(context)
@ -434,7 +434,7 @@ UpdateDialog::UpdateDialog(
, m_version(DpResId(RID_DLG_UPDATE_VERSION))
, m_ignoredUpdate(DpResId(RID_DLG_UPDATE_IGNORED_UPDATE))
, m_updateData(*updateData)
, m_thread(new UpdateDialog::Thread(context, *this, vExtensionList))
, m_thread(new UpdateDialog::Thread(context, *this, std::move(vExtensionList)))
, m_xChecking(m_xBuilder->weld_label("UPDATE_CHECKING"))
, m_xThrobber(m_xBuilder->weld_spinner("THROBBER"))
, m_xUpdate(m_xBuilder->weld_label("UPDATE_LABEL"))

View file

@ -71,8 +71,7 @@ public:
UpdateDialog(
css::uno::Reference< css::uno::XComponentContext > const & context,
weld::Window * parent,
const std::vector< css::uno::Reference<
css::deployment::XPackage > > & vExtensionList,
std::vector< css::uno::Reference< css::deployment::XPackage > > && vExtensionList,
std::vector< dp_gui::UpdateData > * updateData);
virtual ~UpdateDialog() override;

View file

@ -562,12 +562,10 @@ namespace
{
// removes elements of vector 2 in vector 1
strings_v subtract(strings_v const & va, strings_v const & vb)
strings_v subtract(strings_v && a, strings_v && b)
{
strings_v a(va);
std::sort(a.begin(), a.end());
strings_v::iterator ae(std::unique(a.begin(), a.end()));
strings_v b(vb);
std::sort(b.begin(), b.end());
strings_v::iterator be(std::unique(b.begin(), b.end()));
strings_v c;
@ -581,8 +579,6 @@ strings_vr MigrationImpl::compileFileList()
{
strings_vr vrResult(new strings_v);
strings_vr vrInclude;
strings_vr vrExclude;
// get a list of all files:
strings_vr vrFiles = getAllFiles(m_aInfo.userdata);
@ -590,9 +586,9 @@ strings_vr MigrationImpl::compileFileList()
// get a file list result for each migration step
for (auto const& rMigration : *m_vrMigrations)
{
vrInclude = applyPatterns(*vrFiles, rMigration.includeFiles);
vrExclude = applyPatterns(*vrFiles, rMigration.excludeFiles);
strings_v sub(subtract(*vrInclude, *vrExclude));
strings_vr vrInclude = applyPatterns(*vrFiles, rMigration.includeFiles);
strings_vr vrExclude = applyPatterns(*vrFiles, rMigration.excludeFiles);
strings_v sub(subtract(std::move(*vrInclude), std::move(*vrExclude)));
vrResult->insert(vrResult->end(), sub.begin(), sub.end());
}
return vrResult;