replace find_if by none_of
A set of cases where find_if is used just to test if there are no matches; use none_of as per tdf#153109 Change-Id: I6c705ab7a8289914743199722a444ee40d11d746 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152200 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
2d6dff8d98
commit
b480552d9c
@@ -621,11 +621,10 @@ OUString DocPasswordHelper::GetOoxHashAsBase64(
|
||||
|
||||
if (eResult == DocPasswordVerifierResult::OK && !aPassword.isEmpty())
|
||||
{
|
||||
if (std::find_if(std::cbegin(aEncData), std::cend(aEncData),
|
||||
if (std::none_of(std::cbegin(aEncData), std::cend(aEncData),
|
||||
[](const css::beans::NamedValue& val) {
|
||||
return val.Name == PACKAGE_ENCRYPTIONDATA_SHA256UTF8;
|
||||
})
|
||||
== std::cend(aEncData))
|
||||
}))
|
||||
{
|
||||
// tdf#118639: We need ODF encryption data for autorecovery, where password
|
||||
// will already be unavailable, so generate and append it here
|
||||
|
@@ -2192,11 +2192,11 @@ void ScModule::RegisterRefController(sal_uInt16 nSlotId, std::shared_ptr<SfxDial
|
||||
{
|
||||
std::vector<std::pair<std::shared_ptr<SfxDialogController>, weld::Window*>> & rlRefWindow = m_mapRefController[nSlotId];
|
||||
|
||||
if (std::find_if(rlRefWindow.begin(), rlRefWindow.end(),
|
||||
if (std::none_of(rlRefWindow.begin(), rlRefWindow.end(),
|
||||
[rWnd](const std::pair<std::shared_ptr<SfxDialogController>, weld::Window*>& rCandidate)
|
||||
{
|
||||
return rCandidate.first.get() == rWnd.get();
|
||||
}) == rlRefWindow.end())
|
||||
}))
|
||||
{
|
||||
rlRefWindow.emplace_back(rWnd, pWndAncestor);
|
||||
}
|
||||
|
@@ -691,7 +691,7 @@ void GraphicFilter::MakeGraphicsAvailableThreaded(std::vector<Graphic*>& graphic
|
||||
{
|
||||
// Graphic objects share internal ImpGraphic, do not process any of those twice.
|
||||
const auto predicate = [graphic](Graphic* item) { return item->ImplGetImpGraphic() == graphic->ImplGetImpGraphic(); };
|
||||
if( std::find_if(toLoad.begin(), toLoad.end(), predicate ) == toLoad.end())
|
||||
if( std::none_of(toLoad.begin(), toLoad.end(), predicate ))
|
||||
toLoad.push_back( graphic );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user