Replace find_if with proper quantifier algorithms
Change-Id: Icc820a47ac891c358883f9c01224f676c58fdd11 Reviewed-on: https://gerrit.libreoffice.org/59744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
b0e74b65a8
commit
085269d25a
@@ -485,11 +485,9 @@ void DataBrowserModel::removeDataSeriesOrComplexCategoryLevel( sal_Int32 nAtColu
|
||||
Sequence<Reference<chart2::data::XLabeledDataSequence> > aSequencesOfDeleted = xSourceOfDeleted->getDataSequences();
|
||||
for (sal_Int32 i = 0; i < aSequencesOfDeleted.getLength(); ++i)
|
||||
{
|
||||
std::vector<Reference<chart2::data::XLabeledDataSequence> >::const_iterator aHitIt(
|
||||
std::find_if( aAllDataSeqs.begin(), aAllDataSeqs.end(),
|
||||
lcl_RepresentationsOfLSeqMatch( aSequencesOfDeleted[i] )));
|
||||
// if not used by the remaining series this sequence can be deleted
|
||||
if( aHitIt == aAllDataSeqs.end() )
|
||||
if( std::none_of( aAllDataSeqs.begin(), aAllDataSeqs.end(),
|
||||
lcl_RepresentationsOfLSeqMatch( aSequencesOfDeleted[i] )) )
|
||||
aSequenceIndexesToDelete.push_back( lcl_getValuesRepresentationIndex( aSequencesOfDeleted[i] ) );
|
||||
}
|
||||
|
||||
@@ -873,8 +871,8 @@ void DataBrowserModel::updateFromModel()
|
||||
else if( aRole == "values-x" )
|
||||
nSequenceNumberFormatKey = nXAxisNumberFormat;
|
||||
|
||||
if( std::find_if( aSharedSequences.begin(), aSharedSequences.end(),
|
||||
lcl_RepresentationsOfLSeqMatch( aLSeqs[nSeqIdx] )) == aSharedSequences.end())
|
||||
if( std::none_of( aSharedSequences.begin(), aSharedSequences.end(),
|
||||
lcl_RepresentationsOfLSeqMatch( aLSeqs[nSeqIdx] )) )
|
||||
{
|
||||
// no shared sequence
|
||||
m_aColumns.emplace_back(
|
||||
|
||||
@@ -286,8 +286,8 @@ Reference< data::XDataSource > SAL_CALL DataInterpreter::mergeInterpretedData(
|
||||
Reference< data::XLabeledDataSequence > xAdd( aSeq[nSeqIdx] );
|
||||
|
||||
// only add if sequence is not yet in the result
|
||||
if( find_if( aResultVec.begin(), aResultVec.end(),
|
||||
lcl_LabeledSequenceEquals( xAdd )) == aResultVec.end())
|
||||
if( none_of( aResultVec.begin(), aResultVec.end(),
|
||||
lcl_LabeledSequenceEquals( xAdd )) )
|
||||
{
|
||||
aResultVec.push_back( xAdd );
|
||||
}
|
||||
|
||||
@@ -154,12 +154,11 @@ bool OPropertyContainerHelper::isRegisteredProperty( const OUString& _rName ) co
|
||||
// i.e. registered and revoked even though the XPropertySet has already been
|
||||
// accessed, a vector is not really the best data structure anymore ...
|
||||
|
||||
ConstPropertiesIterator pos = std::find_if(
|
||||
return std::any_of(
|
||||
m_aProperties.begin(),
|
||||
m_aProperties.end(),
|
||||
PropertyDescriptionNameMatch( _rName )
|
||||
);
|
||||
return pos != m_aProperties.end();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -63,11 +63,10 @@ int SetNode::getMandatory() const {
|
||||
|
||||
bool SetNode::isValidTemplate(OUString const & templateName) const {
|
||||
return Data::equalTemplateNames(templateName, defaultTemplateName_) ||
|
||||
(std::find_if(
|
||||
std::any_of(
|
||||
additionalTemplateNames_.begin(),
|
||||
additionalTemplateNames_.end(),
|
||||
[&templateName](OUString const & longName) { return Data::equalTemplateNames(templateName, longName); } ) !=
|
||||
additionalTemplateNames_.end());
|
||||
[&templateName](OUString const & longName) { return Data::equalTemplateNames(templateName, longName); } );
|
||||
}
|
||||
|
||||
SetNode::SetNode(SetNode const & other, bool keepTemplateName):
|
||||
|
||||
@@ -1690,9 +1690,8 @@ void OSQLParseNode::append(OSQLParseNode* pNewNode)
|
||||
{
|
||||
OSL_ENSURE(pNewNode != nullptr, "OSQLParseNode: invalid NewSubTree");
|
||||
OSL_ENSURE(pNewNode->getParent() == nullptr, "OSQLParseNode: Node is not an orphan");
|
||||
OSL_ENSURE(std::find_if(m_aChildren.begin(), m_aChildren.end(),
|
||||
[&] (std::unique_ptr<OSQLParseNode> const & r) { return r.get() == pNewNode; })
|
||||
== m_aChildren.end(),
|
||||
OSL_ENSURE(std::none_of(m_aChildren.begin(), m_aChildren.end(),
|
||||
[&] (std::unique_ptr<OSQLParseNode> const & r) { return r.get() == pNewNode; }),
|
||||
"OSQLParseNode::append() Node already element of parent");
|
||||
|
||||
// Create connection to getParent
|
||||
@@ -2394,13 +2393,11 @@ OSQLParseNode* OSQLParseNode::replace(OSQLParseNode* pOldSubNode, OSQLParseNode*
|
||||
{
|
||||
OSL_ENSURE(pOldSubNode != nullptr && pNewSubNode != nullptr, "OSQLParseNode: invalid nodes");
|
||||
OSL_ENSURE(pNewSubNode->getParent() == nullptr, "OSQLParseNode: node already has getParent");
|
||||
OSL_ENSURE(std::find_if(m_aChildren.begin(), m_aChildren.end(),
|
||||
[&] (std::unique_ptr<OSQLParseNode> const & r) { return r.get() == pOldSubNode; })
|
||||
!= m_aChildren.end(),
|
||||
OSL_ENSURE(std::any_of(m_aChildren.begin(), m_aChildren.end(),
|
||||
[&] (std::unique_ptr<OSQLParseNode> const & r) { return r.get() == pOldSubNode; }),
|
||||
"OSQLParseNode::Replace() Node not element of parent");
|
||||
OSL_ENSURE(std::find_if(m_aChildren.begin(), m_aChildren.end(),
|
||||
[&] (std::unique_ptr<OSQLParseNode> const & r) { return r.get() == pNewSubNode; })
|
||||
== m_aChildren.end(),
|
||||
OSL_ENSURE(std::none_of(m_aChildren.begin(), m_aChildren.end(),
|
||||
[&] (std::unique_ptr<OSQLParseNode> const & r) { return r.get() == pNewSubNode; }),
|
||||
"OSQLParseNode::Replace() Node already element of parent");
|
||||
|
||||
pOldSubNode->setParent( nullptr );
|
||||
|
||||
@@ -143,14 +143,13 @@ SotClipboardFormatId SvPasteObjectDialog::GetFormat( const TransferableDataHelpe
|
||||
aName = SvPasteObjectHelper::GetSotFormatUIName( nFormat );
|
||||
|
||||
// Show RICHTEXT only in case RTF is not present.
|
||||
if (nFormat == SotClipboardFormatId::RICHTEXT)
|
||||
if (nFormat == SotClipboardFormatId::RICHTEXT &&
|
||||
std::any_of(pFormats->begin(), pFormats->end(),
|
||||
[](const DataFlavorEx& rFlavor) {
|
||||
return rFlavor.mnSotId == SotClipboardFormatId::RTF;
|
||||
}))
|
||||
{
|
||||
auto it = std::find_if(pFormats->begin(), pFormats->end(),
|
||||
[](const DataFlavorEx& rFlavor) {
|
||||
return rFlavor.mnSotId == SotClipboardFormatId::RTF;
|
||||
});
|
||||
if (it != pFormats->end())
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectLB().find_text(aName) == -1)
|
||||
|
||||
@@ -455,12 +455,12 @@ namespace dbaui
|
||||
if ( !_rName.isEmpty() )
|
||||
{
|
||||
// check there does not already exist such a component
|
||||
SubComponents::const_iterator existentPos = std::find_if(
|
||||
auto subComponentNotExists = std::none_of(
|
||||
m_pData->m_aComponents.begin(),
|
||||
m_pData->m_aComponents.end(),
|
||||
SubComponentMatch( _rName, _nComponentType, _eOpenMode )
|
||||
);
|
||||
OSL_ENSURE( existentPos == m_pData->m_aComponents.end(), "already existent!" );
|
||||
OSL_ENSURE( subComponentNotExists, "already existent!" );
|
||||
}
|
||||
#endif
|
||||
SubComponentDescriptor aElement( _rName, _nComponentType, _eOpenMode, _rxComponent );
|
||||
|
||||
@@ -1419,9 +1419,9 @@ void SbaXFormAdapter::implInsert(const Any& aElement, sal_Int32 nIndex, const OU
|
||||
|
||||
sal_Int32 SbaXFormAdapter::implGetPos(const OUString& rName)
|
||||
{
|
||||
std::vector< OUString>::const_iterator aIter = std::find_if( m_aChildNames.begin(),
|
||||
std::vector< OUString>::const_iterator aIter = std::find( m_aChildNames.begin(),
|
||||
m_aChildNames.end(),
|
||||
[&rName](OUString const & s) { return s == rName; });
|
||||
rName);
|
||||
|
||||
if(aIter != m_aChildNames.end())
|
||||
return aIter - m_aChildNames.begin();
|
||||
|
||||
@@ -524,12 +524,12 @@ void OGenericUnoController::ImplInvalidateFeature( sal_Int32 _nId, const Referen
|
||||
#if OSL_DEBUG_LEVEL > 0
|
||||
if ( _nId != -1 )
|
||||
{
|
||||
SupportedFeatures::const_iterator aFeaturePos = std::find_if(
|
||||
auto isSupportedFeature = std::any_of(
|
||||
m_aSupportedFeatures.begin(),
|
||||
m_aSupportedFeatures.end(),
|
||||
CompareFeatureById( _nId )
|
||||
);
|
||||
OSL_ENSURE( aFeaturePos != m_aSupportedFeatures.end(), "OGenericUnoController::ImplInvalidateFeature: invalidating an unsupported feature is suspicious, at least!" );
|
||||
OSL_ENSURE( isSupportedFeature, "OGenericUnoController::ImplInvalidateFeature: invalidating an unsupported feature is suspicious, at least!" );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -100,8 +100,8 @@ bool ORowSetImportExport::Write()
|
||||
bool ORowSetImportExport::Read()
|
||||
{
|
||||
// check if there is any column to copy
|
||||
if(std::find_if(m_aColumnMapping.begin(),m_aColumnMapping.end(),
|
||||
[](sal_Int32 n) { return n > 0; }) == m_aColumnMapping.end())
|
||||
if(std::none_of(m_aColumnMapping.begin(),m_aColumnMapping.end(),
|
||||
[](sal_Int32 n) { return n > 0; }))
|
||||
return false;
|
||||
bool bContinue = true;
|
||||
if(m_aSelection.getLength())
|
||||
|
||||
@@ -866,9 +866,9 @@ IMPL_LINK_NOARG(OCopyTableWizard, ImplOKHdl, Button*, void)
|
||||
{
|
||||
if ( supportsPrimaryKey() )
|
||||
{
|
||||
ODatabaseExport::TColumns::const_iterator aFind = std::find_if(m_vDestColumns.begin(),m_vDestColumns.end(),
|
||||
bool noPrimaryKey = std::none_of(m_vDestColumns.begin(),m_vDestColumns.end(),
|
||||
[] (const ODatabaseExport::TColumns::value_type& tCol) { return tCol.second->IsPrimaryKey(); });
|
||||
if ( aFind == m_vDestColumns.end() && m_xInteractionHandler.is() )
|
||||
if ( noPrimaryKey && m_xInteractionHandler.is() )
|
||||
{
|
||||
|
||||
OUString sMsg(DBA_RES(STR_TABLEDESIGN_NO_PRIM_KEY));
|
||||
|
||||
@@ -1100,7 +1100,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
|
||||
{
|
||||
// if we have to invalidate all of the window, ignore
|
||||
// any part invalidation message
|
||||
const auto& pos = std::find_if(m_queue.rbegin(), m_queue.rend(),
|
||||
auto invAllExist = std::any_of(m_queue.rbegin(), m_queue.rend(),
|
||||
[&nLOKWindowId] (const queue_type::value_type& elem)
|
||||
{
|
||||
if (elem.first != LOK_CALLBACK_WINDOW)
|
||||
@@ -1120,7 +1120,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
|
||||
});
|
||||
|
||||
// we found a invalidate-all window callback
|
||||
if (pos != m_queue.rend())
|
||||
if (invAllExist)
|
||||
{
|
||||
SAL_INFO("lok.dialog", "Skipping queue [" << type << "]: [" << payload << "] since whole window needs to be invalidated.");
|
||||
return;
|
||||
|
||||
@@ -74,10 +74,10 @@ uno::Sequence<datatransfer::DataFlavor> SAL_CALL LOKTransferable::getTransferDat
|
||||
sal_Bool SAL_CALL LOKTransferable::isDataFlavorSupported(const datatransfer::DataFlavor& rFlavor)
|
||||
{
|
||||
const std::vector<datatransfer::DataFlavor> aFlavors = getTransferDataFlavorsAsVector();
|
||||
return std::find_if(aFlavors.begin(), aFlavors.end(), [&rFlavor](const datatransfer::DataFlavor& i)
|
||||
return std::any_of(aFlavors.begin(), aFlavors.end(), [&rFlavor](const datatransfer::DataFlavor& i)
|
||||
{
|
||||
return i.MimeType == rFlavor.MimeType && i.DataType == rFlavor.DataType;
|
||||
}) != aFlavors.end();
|
||||
});
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
@@ -953,11 +953,9 @@ void EditTextObjectImpl::GetAllSections( std::vector<editeng::Section>& rAttrs )
|
||||
{
|
||||
editeng::Section& rSecAttr = *itCurAttr;
|
||||
// serious bug: will cause duplicate attributes to be exported
|
||||
auto iter(std::find_if(
|
||||
rSecAttr.maAttributes.begin(), rSecAttr.maAttributes.end(),
|
||||
if (std::none_of(rSecAttr.maAttributes.begin(), rSecAttr.maAttributes.end(),
|
||||
[&pItem](SfxPoolItem const*const pIt)
|
||||
{ return pIt->Which() == pItem->Which(); }));
|
||||
if (rSecAttr.maAttributes.end() == iter)
|
||||
{ return pIt->Which() == pItem->Which(); }))
|
||||
{
|
||||
rSecAttr.maAttributes.push_back(pItem);
|
||||
}
|
||||
|
||||
@@ -381,15 +381,11 @@ namespace pcr
|
||||
if ( xDocumentFactory.is() )
|
||||
aAvailableServices = xDocumentFactory->getAvailableServiceNames( );
|
||||
|
||||
const OUString* pFound = std::find_if(
|
||||
bYesItIs = std::any_of(
|
||||
aAvailableServices.begin(),
|
||||
aAvailableServices.end(),
|
||||
StringCompare( _rService )
|
||||
);
|
||||
if ( pFound != aAvailableServices.end() )
|
||||
{
|
||||
bYesItIs = true;
|
||||
}
|
||||
}
|
||||
|
||||
return bYesItIs;
|
||||
|
||||
@@ -966,12 +966,12 @@ namespace pcr
|
||||
aProperties.reserve( aProperties.size() + aThisHandlersProperties.size() );
|
||||
for (const auto & aThisHandlersPropertie : aThisHandlersProperties)
|
||||
{
|
||||
std::vector< Property >::const_iterator previous = std::find_if(
|
||||
auto noPrevious = std::none_of(
|
||||
aProperties.begin(),
|
||||
aProperties.end(),
|
||||
FindPropertyByName( aThisHandlersPropertie.Name )
|
||||
);
|
||||
if ( previous == aProperties.end() )
|
||||
if ( noPrevious )
|
||||
{
|
||||
aProperties.push_back( aThisHandlersPropertie );
|
||||
continue;
|
||||
|
||||
@@ -467,11 +467,11 @@ namespace frm
|
||||
_rPropertyNames.begin(), _rPropertyNames.end(),
|
||||
[](OUString const & s) { return s == PROPERTY_SELECT_SEQ; }
|
||||
);
|
||||
const OUString* pStringItemListPos = ::std::find_if(
|
||||
auto aStringItemListExists = std::any_of(
|
||||
_rPropertyNames.begin(), _rPropertyNames.end(),
|
||||
[](OUString const & s) { return s == PROPERTY_STRINGITEMLIST; }
|
||||
);
|
||||
if ( ( pSelectedItemsPos != _rPropertyNames.end() ) && ( pStringItemListPos != _rPropertyNames.end() ) )
|
||||
if ( ( pSelectedItemsPos != _rPropertyNames.end() ) && aStringItemListExists )
|
||||
{
|
||||
// both properties are present
|
||||
// -> remember the value for the select sequence
|
||||
|
||||
@@ -498,10 +498,9 @@ sal_Int32 FormulaDlg_Impl::GetFunctionPos(sal_Int32 nPos)
|
||||
bFlag = false;
|
||||
nFuncPos = nPrevFuncPos;
|
||||
}
|
||||
bool bIsFunction = ::std::find_if( m_aFunctionOpCodes.getConstArray(),
|
||||
bool bIsFunction = std::any_of( m_aFunctionOpCodes.getConstArray(),
|
||||
m_pFunctionOpCodesEnd,
|
||||
[&eOp](const sheet::FormulaOpCodeMapEntry& aEntry) { return aEntry.Token.OpCode == eOp; })
|
||||
!= m_pFunctionOpCodesEnd;
|
||||
[&eOp](const sheet::FormulaOpCodeMapEntry& aEntry) { return aEntry.Token.OpCode == eOp; });
|
||||
|
||||
if ( bIsFunction && m_aSpecialOpCodes[sheet::FormulaMapGroupSpecialOffset::SPACES].Token.OpCode != eOp )
|
||||
{
|
||||
|
||||
@@ -128,10 +128,7 @@ bool addJREInfo(
|
||||
rtl::Reference<VendorBase> const & info,
|
||||
std::vector<rtl::Reference<VendorBase>> & infos)
|
||||
{
|
||||
auto i(
|
||||
std::find_if(
|
||||
infos.begin(), infos.end(), InfoFindSame(info->getHome())));
|
||||
if (i == infos.end()) {
|
||||
if (std::none_of(infos.begin(), infos.end(), InfoFindSame(info->getHome()))) {
|
||||
infos.push_back(info);
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -118,13 +118,12 @@ javaFrameworkError jfw_findAllJREs(std::vector<std::unique_ptr<JavaInfo>> *pparI
|
||||
// for the vendors for which there is a javaSelection/plugins/
|
||||
// library entry in the javavendors.xml; jfw_getJavaInfoByPath
|
||||
// can return a JavaInfo of any vendor:
|
||||
if ((std::find_if(
|
||||
if ((std::none_of(
|
||||
vecInfo.begin(), vecInfo.end(),
|
||||
[&aInfo](std::unique_ptr<JavaInfo> const & info) {
|
||||
return areEqualJavaInfo(
|
||||
info.get(), aInfo.get());
|
||||
})
|
||||
== vecInfo.end())
|
||||
}))
|
||||
&& (std::find(
|
||||
vecVendors.begin(), vecVendors.end(),
|
||||
aInfo->sVendor)
|
||||
|
||||
@@ -206,7 +206,7 @@ bool addRecursiveTests(const std::vector<std::string>& test_names, CppUnit::Test
|
||||
{
|
||||
CppUnit::Test* pNewTest = pTest->getChildTestAt(i);
|
||||
ret |= addRecursiveTests(test_names, pNewTest, rRunner);
|
||||
if (std::find_if(test_names.begin(), test_names.end(), test_name_compare(pNewTest->getName())) != test_names.end())
|
||||
if (std::any_of(test_names.begin(), test_names.end(), test_name_compare(pNewTest->getName())))
|
||||
{
|
||||
rRunner.addTest(pNewTest);
|
||||
ret = true;
|
||||
|
||||
@@ -89,8 +89,8 @@ bool SAL_CALL osl_detail_ObjectRegistry_storeAddresses( char const* pName )
|
||||
if ( rFirst == "all" )
|
||||
return true;
|
||||
auto const iEnd( rVec.cend() );
|
||||
return std::find_if( rVec.begin(), iEnd,
|
||||
[pName] (OString const& it) { return isSubStr(pName, it); }) != iEnd;
|
||||
return std::any_of( rVec.begin(), iEnd,
|
||||
[pName] (OString const& it) { return isSubStr(pName, it); });
|
||||
}
|
||||
|
||||
bool SAL_CALL osl_detail_ObjectRegistry_checkObjectCount(
|
||||
|
||||
@@ -763,8 +763,8 @@ void SetTableColumnName( ::std::vector<OUString>& rVec, size_t nIndex, const OUS
|
||||
aStr = rName;
|
||||
++nCount;
|
||||
}
|
||||
auto it( ::std::find_if( rVec.begin(), rVec.end(), TableColumnNameSearch( aStr)));
|
||||
if (it == rVec.end())
|
||||
|
||||
if (std::none_of( rVec.begin(), rVec.end(), TableColumnNameSearch( aStr)))
|
||||
{
|
||||
rVec[nIndex] = aStr;
|
||||
break; // do while
|
||||
@@ -1263,7 +1263,7 @@ bool ScDBCollection::AnonDBs::empty() const
|
||||
|
||||
bool ScDBCollection::AnonDBs::has( const ScDBData* p ) const
|
||||
{
|
||||
return find_if(m_DBs.begin(), m_DBs.end(), FindByPointer(p)) != m_DBs.end();
|
||||
return any_of(m_DBs.begin(), m_DBs.end(), FindByPointer(p));
|
||||
}
|
||||
|
||||
bool ScDBCollection::AnonDBs::operator== (const AnonDBs& r) const
|
||||
|
||||
@@ -515,9 +515,7 @@ void ScFilterDlg::UpdateValueList( size_t nList )
|
||||
{
|
||||
// See if the header value is already in the list.
|
||||
std::vector<ScTypedStrData>::iterator itBeg = pList->maFilterEntries.begin(), itEnd = pList->maFilterEntries.end();
|
||||
std::vector<ScTypedStrData>::iterator it = std::find_if(
|
||||
itBeg, itEnd, FindTypedStrData(aHdrColl.front(), bCaseSens));
|
||||
if (it == itEnd)
|
||||
if (std::none_of(itBeg, itEnd, FindTypedStrData(aHdrColl.front(), bCaseSens)))
|
||||
{
|
||||
// Not in the list. Insert it.
|
||||
pList->maFilterEntries.push_back(aHdrColl.front());
|
||||
@@ -529,7 +527,7 @@ void ScFilterDlg::UpdateValueList( size_t nList )
|
||||
// Record its position.
|
||||
itBeg = pList->maFilterEntries.begin();
|
||||
itEnd = pList->maFilterEntries.end();
|
||||
it = std::find_if(itBeg, itEnd, FindTypedStrData(aHdrColl.front(), bCaseSens));
|
||||
auto it = std::find_if(itBeg, itEnd, FindTypedStrData(aHdrColl.front(), bCaseSens));
|
||||
pList->mnHeaderPos = std::distance(itBeg, it);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,11 +239,10 @@ IMPL_LINK(MasterPageContainerQueue, DelayedPreviewCreation, Timer*, pTimer, void
|
||||
|
||||
bool MasterPageContainerQueue::HasRequest (MasterPageContainer::Token aToken) const
|
||||
{
|
||||
RequestQueue::iterator iRequest (::std::find_if(
|
||||
return std::any_of(
|
||||
mpRequestQueue->begin(),
|
||||
mpRequestQueue->end(),
|
||||
PreviewCreationRequest::CompareToken(aToken)));
|
||||
return (iRequest != mpRequestQueue->end());
|
||||
PreviewCreationRequest::CompareToken(aToken));
|
||||
}
|
||||
|
||||
bool MasterPageContainerQueue::IsEmpty() const
|
||||
|
||||
@@ -518,11 +518,7 @@ void ViewShellManager::Implementation::ActivateSubShell (
|
||||
::osl::MutexGuard aGuard (maMutex);
|
||||
|
||||
// Check that the given view shell is active.
|
||||
ActiveShellList::iterator iShell (::std::find_if (
|
||||
maActiveViewShells.begin(),
|
||||
maActiveViewShells.end(),
|
||||
IsShell(&rParentShell)));
|
||||
if (iShell == maActiveViewShells.end())
|
||||
if (std::none_of (maActiveViewShells.begin(), maActiveViewShells.end(), IsShell(&rParentShell)))
|
||||
return;
|
||||
|
||||
// Create the sub shell list if it does not yet exist.
|
||||
@@ -533,7 +529,7 @@ void ViewShellManager::Implementation::ActivateSubShell (
|
||||
// Do not activate an object bar that is already active. Requesting
|
||||
// this is not exactly an error but may be an indication of one.
|
||||
SubShellSubList& rList (iList->second);
|
||||
if (::std::find_if(rList.begin(),rList.end(), IsId(nId)) != rList.end())
|
||||
if (std::any_of(rList.begin(),rList.end(), IsId(nId)))
|
||||
return;
|
||||
|
||||
// Add just the id of the sub shell. The actual shell is created
|
||||
|
||||
@@ -671,10 +671,7 @@ namespace sfx2
|
||||
// -> append the wildcard
|
||||
aExtendWildcard( *aBelongsToLocal );
|
||||
|
||||
MapGroupEntry2GroupEntry::iterator aThisGroupFinalPos =
|
||||
::std::find_if( aLocalFinalPositions.begin(), aLocalFinalPositions.end(), FindGroupEntry( aBelongsToLocal->second ) );
|
||||
|
||||
if ( aLocalFinalPositions.end() == aThisGroupFinalPos )
|
||||
if ( std::none_of( aLocalFinalPositions.begin(), aLocalFinalPositions.end(), FindGroupEntry( aBelongsToLocal->second ) ) )
|
||||
{ // the position within aCollectedLocals has not been mapped to a final position
|
||||
// within the "real" group (aCollectedLocals is only temporary)
|
||||
// -> do this now (as we just encountered the first filter belonging to this local class
|
||||
|
||||
@@ -575,7 +575,7 @@ XmlIdRegistryDocument::XmlIdRegistry_Impl::TryInsertMetadatable(
|
||||
// this is only called from TryRegister now, so check
|
||||
// if all elements in the list are deleted (in undo) or
|
||||
// placeholders, then "steal" the id from them
|
||||
if ( pList->end() == ::std::find_if(pList->begin(), pList->end(),
|
||||
if ( std::none_of(pList->begin(), pList->end(),
|
||||
[](Metadatable* item)->bool {
|
||||
return !(item->IsInUndo() || item->IsInClipboard());
|
||||
} ) )
|
||||
|
||||
@@ -416,10 +416,10 @@ void SfxClassificationHelper::Impl::parsePolicy()
|
||||
|
||||
static bool lcl_containsProperty(const uno::Sequence<beans::Property>& rProperties, const OUString& rName)
|
||||
{
|
||||
return std::find_if(rProperties.begin(), rProperties.end(), [&](const beans::Property& rProperty)
|
||||
return std::any_of(rProperties.begin(), rProperties.end(), [&](const beans::Property& rProperty)
|
||||
{
|
||||
return rProperty.Name == rName;
|
||||
}) != rProperties.end();
|
||||
});
|
||||
}
|
||||
|
||||
void SfxClassificationHelper::Impl::setStartValidity(SfxClassificationPolicyType eType)
|
||||
|
||||
@@ -98,10 +98,8 @@ namespace /* private */ {
|
||||
|
||||
bool has_group(const string_t& name) const
|
||||
{
|
||||
auto iter_end = groups_.cend();
|
||||
return (has_groups() &&
|
||||
iter_end != std::find_if(
|
||||
groups_.cbegin(), iter_end,
|
||||
std::any_of(groups_.cbegin(), groups_.cend(),
|
||||
[&name](const string_t& s)
|
||||
{ return (0 == strcasecmp(s.c_str(), name.c_str())); })
|
||||
// compare two string_t's case insensitive
|
||||
|
||||
@@ -535,10 +535,8 @@ bool ZipFile::HasContent(const std::string &ContentName) const
|
||||
//case in-sensitive as it is not defined that such
|
||||
//names must be handled case sensitive
|
||||
DirectoryPtr_t dir = GetDirectory();
|
||||
Directory_t::iterator iter =
|
||||
std::find_if(dir->begin(), dir->end(), internal::stricmp(ContentName));
|
||||
|
||||
return (iter != dir->end());
|
||||
return std::any_of(dir->begin(), dir->end(), internal::stricmp(ContentName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -614,8 +614,8 @@ void TransferableHelper::RemoveFormat( const DataFlavor& rFlavor )
|
||||
|
||||
bool TransferableHelper::HasFormat( SotClipboardFormatId nFormat )
|
||||
{
|
||||
return (std::find_if(maFormats.begin(), maFormats.end(),
|
||||
[&](const DataFlavorEx& data) { return data.mnSotId == nFormat; }) != maFormats.end());
|
||||
return std::any_of(maFormats.begin(), maFormats.end(),
|
||||
[&](const DataFlavorEx& data) { return data.mnSotId == nFormat; });
|
||||
}
|
||||
|
||||
|
||||
@@ -1303,8 +1303,8 @@ void TransferableDataHelper::InitFormats()
|
||||
bool TransferableDataHelper::HasFormat( SotClipboardFormatId nFormat ) const
|
||||
{
|
||||
::osl::MutexGuard aGuard(mxImpl->maMutex);
|
||||
return (std::find_if(maFormats.begin(), maFormats.end(),
|
||||
[&](const DataFlavorEx& data) { return data.mnSotId == nFormat; }) != maFormats.end());
|
||||
return std::any_of(maFormats.begin(), maFormats.end(),
|
||||
[&](const DataFlavorEx& data) { return data.mnSotId == nFormat; });
|
||||
}
|
||||
|
||||
bool TransferableDataHelper::HasFormat( const DataFlavor& rFlavor ) const
|
||||
|
||||
@@ -296,8 +296,8 @@ sal_Int8 DropTargetHelper::ExecuteDrop( const ExecuteDropEvent& )
|
||||
|
||||
bool DropTargetHelper::IsDropFormatSupported( SotClipboardFormatId nFormat )
|
||||
{
|
||||
return (std::find_if(maFormats.begin(), maFormats.end(),
|
||||
[&](const DataFlavorEx& data) { return data.mnSotId == nFormat; }) != maFormats.end());
|
||||
return std::any_of(maFormats.begin(), maFormats.end(),
|
||||
[&](const DataFlavorEx& data) { return data.mnSotId == nFormat; });
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -58,9 +58,8 @@ OUString getProperty(uno::Reference<beans::XPropertyContainer> const& rxProperty
|
||||
|
||||
bool containsProperty(uno::Sequence<beans::Property> const& rProperties, OUString const& rName)
|
||||
{
|
||||
return std::find_if(rProperties.begin(), rProperties.end(),
|
||||
[&](const beans::Property& rProperty) { return rProperty.Name == rName; })
|
||||
!= rProperties.end();
|
||||
return std::any_of(rProperties.begin(), rProperties.end(),
|
||||
[&](const beans::Property& rProperty) { return rProperty.Name == rName; });
|
||||
}
|
||||
|
||||
void removeAllProperties(uno::Reference<beans::XPropertyContainer> const& rxPropertyContainer)
|
||||
|
||||
@@ -204,19 +204,16 @@ void SvxShowCharSet::getFavCharacterList()
|
||||
|
||||
bool SvxShowCharSet::isFavChar(const OUString& sTitle, const OUString& rFont)
|
||||
{
|
||||
auto itChar = std::find_if(maFavCharList.begin(),
|
||||
auto isFavCharTitleExists = std::any_of(maFavCharList.begin(),
|
||||
maFavCharList.end(),
|
||||
[sTitle] (const OUString & a) { return a == sTitle; });
|
||||
|
||||
auto itChar2 = std::find_if(maFavCharFontList.begin(),
|
||||
auto isFavCharFontExists = std::any_of(maFavCharFontList.begin(),
|
||||
maFavCharFontList.end(),
|
||||
[rFont] (const OUString & a) { return a == rFont; });
|
||||
|
||||
// if Fav char to be added is already in list, return true
|
||||
if( itChar != maFavCharList.end() && itChar2 != maFavCharFontList.end() )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return isFavCharTitleExists && isFavCharFontExists;
|
||||
}
|
||||
|
||||
void SvxShowCharSet::createContextMenu()
|
||||
|
||||
@@ -141,7 +141,7 @@ void SdrCustomShapeGeometryItem::SetPropertyValue( const css::beans::PropertyVal
|
||||
}
|
||||
else
|
||||
{ // it's a new property
|
||||
assert(aPropSeq.end() == std::find_if(aPropSeq.begin(), aPropSeq.end(),
|
||||
assert(std::none_of(aPropSeq.begin(), aPropSeq.end(),
|
||||
[&rPropVal](beans::PropertyValue const& rVal)
|
||||
{ return rVal.Name == rPropVal.Name; } ));
|
||||
sal_uInt32 nIndex = aPropSeq.getLength();
|
||||
@@ -167,7 +167,7 @@ void SdrCustomShapeGeometryItem::SetPropertyValue( const OUString& rSequenceName
|
||||
aValue.Name = rSequenceName;
|
||||
aValue.Value <<= aSeq;
|
||||
|
||||
assert(aPropSeq.end() == std::find_if(aPropSeq.begin(), aPropSeq.end(),
|
||||
assert(std::none_of(aPropSeq.begin(), aPropSeq.end(),
|
||||
[&rSequenceName](beans::PropertyValue const& rV)
|
||||
{ return rV.Name == rSequenceName; } ));
|
||||
sal_uInt32 nIndex = aPropSeq.getLength();
|
||||
|
||||
@@ -222,10 +222,9 @@ void SwLayoutWriter::testTdf118672()
|
||||
= linguistic2::LinguServiceManager::create(comphelper::getProcessComponentContext());
|
||||
uno::Sequence<lang::Locale> aLocales
|
||||
= xLinguServiceManager->getAvailableLocales("com.sun.star.linguistic2.Hyphenator");
|
||||
auto it = std::find_if(aLocales.begin(), aLocales.end(), [](const lang::Locale& rLocale) {
|
||||
return rLocale.Language == "en" && rLocale.Country == "US";
|
||||
});
|
||||
if (it == aLocales.end())
|
||||
if (std::none_of(aLocales.begin(), aLocales.end(), [](const lang::Locale& rLocale) {
|
||||
return rLocale.Language == "en" && rLocale.Country == "US";
|
||||
}))
|
||||
return;
|
||||
|
||||
OUString aLine1("He heard quiet steps behind him. That didn't bode well. Who could be fol*1 2 "
|
||||
|
||||
@@ -1304,13 +1304,13 @@ bool SwRegHistory::InsertItems( const SfxItemSet& rSet,
|
||||
continue; // special case, may get set on text node itself
|
||||
// tdf#105077 even worse, node's set could cause
|
||||
// nothing at all to be inserted
|
||||
assert(std::find_if(
|
||||
assert(std::any_of(
|
||||
m_pHistory->m_SwpHstry.begin(), m_pHistory->m_SwpHstry.end(),
|
||||
[nExpected](std::unique_ptr<SwHistoryHint> const& pHint) -> bool {
|
||||
SwHistoryResetText const*const pReset(
|
||||
dynamic_cast<SwHistoryResetText const*>(pHint.get()));
|
||||
return pReset && (pReset->GetWhich() == nExpected);
|
||||
}) != m_pHistory->m_SwpHstry.end());
|
||||
}));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -484,9 +484,8 @@ uno::Sequence< OUString > SwXStyleFamilies::getElementNames()
|
||||
sal_Bool SwXStyleFamilies::hasByName(const OUString& Name)
|
||||
{
|
||||
auto pEntries(lcl_GetStyleFamilyEntries());
|
||||
const auto pEntry = std::find_if(pEntries->begin(), pEntries->end(),
|
||||
return std::any_of(pEntries->begin(), pEntries->end(),
|
||||
[&Name] (const StyleFamilyEntry& e) { return e.m_sName == Name; });
|
||||
return pEntry != pEntries->end();
|
||||
}
|
||||
|
||||
sal_Int32 SwXStyleFamilies::getCount()
|
||||
@@ -1113,7 +1112,7 @@ public:
|
||||
|
||||
bool AllowsKey(const OUString& rName)
|
||||
{
|
||||
return aPropertyEntries.end() != std::find_if(aPropertyEntries.begin(), aPropertyEntries.end(),
|
||||
return std::any_of(aPropertyEntries.begin(), aPropertyEntries.end(),
|
||||
[rName] (const SfxItemPropertyNamedEntry& rEntry) {return rName == rEntry.sName;} );
|
||||
}
|
||||
bool SetProperty(const OUString& rName, const uno::Any& rValue)
|
||||
|
||||
@@ -602,13 +602,7 @@
|
||||
// look if this id is one we recognized as duplicate
|
||||
IntArrayArray::value_type& rDuplicateIds = AmbiguousPropertyIds::get()[ m_nPropertyMapId ];
|
||||
|
||||
IntArrayArray::value_type::const_iterator aPos = ::std::find_if(
|
||||
rDuplicateIds.begin(),
|
||||
rDuplicateIds.end(),
|
||||
Int32Equal( _nHandle )
|
||||
);
|
||||
|
||||
if ( rDuplicateIds.end() != aPos )
|
||||
if ( std::any_of(rDuplicateIds.begin(), rDuplicateIds.end(), Int32Equal( _nHandle )) )
|
||||
{
|
||||
// yes, it is such a property
|
||||
OUString sPropName;
|
||||
|
||||
@@ -728,11 +728,10 @@ void checkMap(
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
for (auto & i: ent2A->getDirectOptionalBaseServices()) {
|
||||
if (std::find_if(
|
||||
if (std::none_of(
|
||||
ent2B->getDirectOptionalBaseServices().begin(),
|
||||
ent2B->getDirectOptionalBaseServices().end(),
|
||||
EqualsAnnotation(i.name))
|
||||
== ent2B->getDirectOptionalBaseServices().end())
|
||||
EqualsAnnotation(i.name)))
|
||||
{
|
||||
std::cerr
|
||||
<< "accumulation-based service " << name
|
||||
@@ -789,12 +788,11 @@ void checkMap(
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
for (auto & i: ent2A->getDirectOptionalBaseInterfaces()) {
|
||||
if (std::find_if(
|
||||
if (std::none_of(
|
||||
(ent2B->getDirectOptionalBaseInterfaces()
|
||||
.begin()),
|
||||
ent2B->getDirectOptionalBaseInterfaces().end(),
|
||||
EqualsAnnotation(i.name))
|
||||
== ent2B->getDirectOptionalBaseInterfaces().end())
|
||||
EqualsAnnotation(i.name)))
|
||||
{
|
||||
std::cerr
|
||||
<< "accumulation-based service " << name
|
||||
|
||||
@@ -573,10 +573,10 @@ const PPDParser* PPDParser::getParser( const OUString& rFile )
|
||||
{
|
||||
// this may actually be the SGENPRT parser,
|
||||
// so ensure uniqueness here (but don't remove last we delete us!)
|
||||
if (std::find_if(
|
||||
if (std::none_of(
|
||||
rPPDCache.aAllParsers.begin(),
|
||||
rPPDCache.aAllParsers.end(),
|
||||
[pNewParser] (std::unique_ptr<PPDParser> const & x) { return x.get() == pNewParser; } ) == rPPDCache.aAllParsers.end())
|
||||
[pNewParser] (std::unique_ptr<PPDParser> const & x) { return x.get() == pNewParser; } ))
|
||||
{
|
||||
// insert new parser to vector
|
||||
rPPDCache.aAllParsers.emplace_back(pNewParser);
|
||||
|
||||
@@ -186,7 +186,7 @@ sal_Bool SAL_CALL GtkTransferable::isDataFlavorSupported(const css::datatransfer
|
||||
const std::vector<css::datatransfer::DataFlavor> aAll =
|
||||
getTransferDataFlavorsAsVector();
|
||||
|
||||
return std::find_if(aAll.begin(), aAll.end(), DataFlavorEq(rFlavor)) != aAll.end();
|
||||
return std::any_of(aAll.begin(), aAll.end(), DataFlavorEq(rFlavor));
|
||||
}
|
||||
|
||||
class GtkClipboardTransferable : public GtkTransferable
|
||||
|
||||
@@ -1397,11 +1397,10 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
|
||||
uno::Sequence<beans::PropertyValue> aPrevPropertiesSeq;
|
||||
m_xPreviousParagraph->getPropertyValue("ParaInteropGrabBag") >>= aPrevPropertiesSeq;
|
||||
auto aPrevProperties = comphelper::sequenceToContainer< std::vector<beans::PropertyValue> >(aPrevPropertiesSeq);
|
||||
auto itPrevParaAutoAfter = std::find_if(aPrevProperties.begin(), aPrevProperties.end(), [](const beans::PropertyValue& rValue)
|
||||
bool bPrevParaAutoAfter = std::any_of(aPrevProperties.begin(), aPrevProperties.end(), [](const beans::PropertyValue& rValue)
|
||||
{
|
||||
return rValue.Name == "ParaBottomMarginAfterAutoSpacing";
|
||||
});
|
||||
bool bPrevParaAutoAfter = itPrevParaAutoAfter != aPrevProperties.end();
|
||||
if (bPrevParaAutoAfter)
|
||||
{
|
||||
// Previous after spacing is set to auto, set previous after space to 0.
|
||||
@@ -1453,22 +1452,18 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
|
||||
// set top margin of the previous auto paragraph in cells, keeping zero bottom margin only at the first one
|
||||
if (m_nTableDepth > 0 && m_nTableDepth == m_nTableCellDepth && m_xPreviousParagraph.is())
|
||||
{
|
||||
bool bParaChangedTopMargin = false;
|
||||
auto itParaTopMargin = std::find_if(aProperties.begin(), aProperties.end(), [](const beans::PropertyValue& rValue)
|
||||
bool bParaChangedTopMargin = std::any_of(aProperties.begin(), aProperties.end(), [](const beans::PropertyValue& rValue)
|
||||
{
|
||||
return rValue.Name == "ParaTopMargin";
|
||||
});
|
||||
if (itParaTopMargin != aProperties.end())
|
||||
bParaChangedTopMargin = true;
|
||||
|
||||
uno::Sequence<beans::PropertyValue> aPrevPropertiesSeq;
|
||||
m_xPreviousParagraph->getPropertyValue("ParaInteropGrabBag") >>= aPrevPropertiesSeq;
|
||||
auto aPrevProperties = comphelper::sequenceToContainer< std::vector<beans::PropertyValue> >(aPrevPropertiesSeq);
|
||||
auto itPrevParaAutoBefore = std::find_if(aPrevProperties.begin(), aPrevProperties.end(), [](const beans::PropertyValue& rValue)
|
||||
bool bPrevParaAutoBefore = std::any_of(aPrevProperties.begin(), aPrevProperties.end(), [](const beans::PropertyValue& rValue)
|
||||
{
|
||||
return rValue.Name == "ParaTopMarginBeforeAutoSpacing";
|
||||
});
|
||||
bool bPrevParaAutoBefore = itPrevParaAutoBefore != aPrevProperties.end();
|
||||
|
||||
if ((bPrevParaAutoBefore && !bParaChangedTopMargin) || (bParaChangedTopMargin && m_bParaAutoBefore))
|
||||
{
|
||||
@@ -2517,11 +2512,10 @@ void DomainMapper_Impl::ClearPreviousParagraph()
|
||||
uno::Sequence<beans::PropertyValue> aPrevPropertiesSeq;
|
||||
m_xPreviousParagraph->getPropertyValue("ParaInteropGrabBag") >>= aPrevPropertiesSeq;
|
||||
auto aPrevProperties = comphelper::sequenceToContainer< std::vector<beans::PropertyValue> >(aPrevPropertiesSeq);
|
||||
auto itPrevParaAutoAfter = std::find_if(aPrevProperties.begin(), aPrevProperties.end(), [](const beans::PropertyValue& rValue)
|
||||
bool bPrevParaAutoAfter = std::any_of(aPrevProperties.begin(), aPrevProperties.end(), [](const beans::PropertyValue& rValue)
|
||||
{
|
||||
return rValue.Name == "ParaBottomMarginAfterAutoSpacing";
|
||||
});
|
||||
bool bPrevParaAutoAfter = itPrevParaAutoAfter != aPrevProperties.end();
|
||||
|
||||
bool bPrevNumberingRules = false;
|
||||
uno::Reference<container::XNamed> xPreviousNumberingRules(m_xPreviousParagraph->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
|
||||
|
||||
@@ -2026,9 +2026,8 @@ void RTFDocumentImpl::resetAttributes()
|
||||
static bool lcl_containsProperty(const uno::Sequence<beans::Property>& rProperties,
|
||||
const OUString& rName)
|
||||
{
|
||||
return std::find_if(rProperties.begin(), rProperties.end(),
|
||||
[&](const beans::Property& rProperty) { return rProperty.Name == rName; })
|
||||
!= rProperties.end();
|
||||
return std::any_of(rProperties.begin(), rProperties.end(),
|
||||
[&](const beans::Property& rProperty) { return rProperty.Name == rName; });
|
||||
}
|
||||
|
||||
RTFError RTFDocumentImpl::popState()
|
||||
|
||||
@@ -523,7 +523,7 @@ void SigningTest::testOOXMLRemoveAll()
|
||||
uno::Reference<io::XInputStream> xInputStream = xStream->getInputStream();
|
||||
uno::Sequence< uno::Sequence<beans::StringPair> > aContentTypeInfo = comphelper::OFOPXMLHelper::ReadContentTypeSequence(xInputStream, mxComponentContext);
|
||||
uno::Sequence<beans::StringPair>& rOverrides = aContentTypeInfo[1];
|
||||
CPPUNIT_ASSERT_EQUAL(rOverrides.end(), std::find_if(rOverrides.begin(), rOverrides.end(), [](const beans::StringPair& rPair)
|
||||
CPPUNIT_ASSERT(std::none_of(rOverrides.begin(), rOverrides.end(), [](const beans::StringPair& rPair)
|
||||
{
|
||||
return rPair.First.startsWith("/_xmlsignatures/sig");
|
||||
}));
|
||||
|
||||
@@ -86,10 +86,10 @@ bool OOXMLSecExporter::Impl::isOOXMLBlacklist(const OUString& rStreamName)
|
||||
"/_xmlsignatures"
|
||||
};
|
||||
// Just check the prefix, as we don't care about the content type part of the stream name.
|
||||
return std::find_if(vBlacklist.begin(), vBlacklist.end(), [&](const OUStringLiteral& rLiteral)
|
||||
return std::any_of(vBlacklist.begin(), vBlacklist.end(), [&](const OUStringLiteral& rLiteral)
|
||||
{
|
||||
return rStreamName.startsWith(rLiteral);
|
||||
}) != vBlacklist.end();
|
||||
});
|
||||
}
|
||||
|
||||
bool OOXMLSecExporter::Impl::isOOXMLRelationBlacklist(const OUString& rRelationName)
|
||||
|
||||
@@ -350,7 +350,7 @@ bool XMLSignatureHelper::ReadAndVerifySignatureStorage(const uno::Reference<embe
|
||||
{
|
||||
const uno::Sequence<beans::StringPair>& rRelation = aRelationsInfo[i];
|
||||
auto aRelation = comphelper::sequenceToContainer< std::vector<beans::StringPair> >(rRelation);
|
||||
if (std::find_if(aRelation.begin(), aRelation.end(), lcl_isSignatureType) != aRelation.end())
|
||||
if (std::any_of(aRelation.begin(), aRelation.end(), lcl_isSignatureType))
|
||||
{
|
||||
std::vector<beans::StringPair>::iterator it = std::find_if(aRelation.begin(), aRelation.end(), [](const beans::StringPair& rPair) { return rPair.First == "Target"; });
|
||||
if (it != aRelation.end())
|
||||
@@ -442,7 +442,7 @@ void XMLSignatureHelper::EnsureSignaturesRelation(const css::uno::Reference<css:
|
||||
for (const uno::Sequence<beans::StringPair>& rRelation : aRelationsInfo)
|
||||
{
|
||||
auto aRelation = comphelper::sequenceToContainer< std::vector<beans::StringPair> >(rRelation);
|
||||
if (std::find_if(aRelation.begin(), aRelation.end(), lcl_isSignatureOriginType) != aRelation.end())
|
||||
if (std::any_of(aRelation.begin(), aRelation.end(), lcl_isSignatureOriginType))
|
||||
{
|
||||
bHaveRelation = true;
|
||||
break;
|
||||
@@ -465,7 +465,7 @@ void XMLSignatureHelper::EnsureSignaturesRelation(const css::uno::Reference<css:
|
||||
for (std::vector< uno::Sequence<beans::StringPair> >::iterator it = aRelationsInfo.begin(); it != aRelationsInfo.end();)
|
||||
{
|
||||
auto aRelation = comphelper::sequenceToContainer< std::vector<beans::StringPair> >(*it);
|
||||
if (std::find_if(aRelation.begin(), aRelation.end(), lcl_isSignatureOriginType) != aRelation.end())
|
||||
if (std::any_of(aRelation.begin(), aRelation.end(), lcl_isSignatureOriginType))
|
||||
it = aRelationsInfo.erase(it);
|
||||
else
|
||||
++it;
|
||||
@@ -525,18 +525,10 @@ void XMLSignatureHelper::ExportSignatureContentTypes(const css::uno::Reference<c
|
||||
// Append rels and sigs to defaults, if it's not there already.
|
||||
uno::Sequence<beans::StringPair>& rDefaults = aContentTypeInfo[0];
|
||||
auto aDefaults = comphelper::sequenceToContainer< std::vector<beans::StringPair> >(rDefaults);
|
||||
auto it = std::find_if(rDefaults.begin(), rDefaults.end(), [](const beans::StringPair& rPair)
|
||||
{
|
||||
return rPair.First == "rels";
|
||||
});
|
||||
if (it == rDefaults.end())
|
||||
if (std::none_of(rDefaults.begin(), rDefaults.end(), [](const beans::StringPair& rPair) { return rPair.First == "rels"; }))
|
||||
aDefaults.emplace_back("rels", "application/vnd.openxmlformats-package.relationships+xml");
|
||||
|
||||
it = std::find_if(rDefaults.begin(), rDefaults.end(), [](const beans::StringPair& rPair)
|
||||
{
|
||||
return rPair.First == "sigs";
|
||||
});
|
||||
if (it == rDefaults.end())
|
||||
if (std::none_of(rDefaults.begin(), rDefaults.end(), [](const beans::StringPair& rPair) { return rPair.First == "sigs"; }))
|
||||
aDefaults.emplace_back("sigs", "application/vnd.openxmlformats-package.digital-signature-origin");
|
||||
rDefaults = comphelper::containerToSequence(aDefaults);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user