diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-05 15:08:21 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-05 15:26:18 +0200 |
commit | 2248aaf58a89e446a1e707254cb40905a6411305 (patch) | |
tree | 706dc111e3455adaf0457a6812c8573123c7ca1f | |
parent | f572a13c374435ae5f1d3f47d964e1eece20ae8e (diff) |
std::set::find() is faster than plain std::find()
Change-Id: I11ca9474e4b6b751f0348b78b53abaa81682eaa6
-rw-r--r-- | sw/source/core/doc/docfly.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/textboxhelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unocoll.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj2.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoportenum.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxsdrexport.cxx | 2 |
7 files changed, 8 insertions, 8 deletions
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 2283ac43d837..97f8f5dac583 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -87,7 +87,7 @@ sal_uInt16 SwDoc::GetFlyCount( FlyCntType eType, bool bIgnoreTextBoxes ) const { const SwFrmFmt* pFlyFmt = rFmts[ i ]; - if (bIgnoreTextBoxes && std::find(aTextBoxes.begin(), aTextBoxes.end(), pFlyFmt) != aTextBoxes.end()) + if (bIgnoreTextBoxes && aTextBoxes.find(pFlyFmt) != aTextBoxes.end()) continue; if( RES_FLYFRMFMT == pFlyFmt->Which() @@ -139,7 +139,7 @@ SwFrmFmt* SwDoc::GetFlyNum( sal_uInt16 nIdx, FlyCntType eType, bool bIgnoreTextB { SwFrmFmt* pFlyFmt = rFmts[ i ]; - if (bIgnoreTextBoxes && std::find(aTextBoxes.begin(), aTextBoxes.end(), pFlyFmt) != aTextBoxes.end()) + if (bIgnoreTextBoxes && aTextBoxes.find(pFlyFmt) != aTextBoxes.end()) continue; if( RES_FLYFRMFMT == pFlyFmt->Which() diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index 30604ee1d00c..d00398333812 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -150,7 +150,7 @@ std::map<SwFrmFmt*, SwFrmFmt*> SwTextBoxHelper::findShapes(const SwDoc* pDoc) bool lcl_isTextBox(SdrObject* pSdrObject, std::set<const SwFrmFmt*>& rTextBoxes) { SwVirtFlyDrawObj* pObject = PTR_CAST(SwVirtFlyDrawObj, pSdrObject); - return pObject && std::find(rTextBoxes.begin(), rTextBoxes.end(), pObject->GetFmt()) != rTextBoxes.end(); + return pObject && rTextBoxes.find(pObject->GetFmt()) != rTextBoxes.end(); } sal_Int32 SwTextBoxHelper::getCount(SdrPage* pPage, std::set<const SwFrmFmt*>& rTextBoxes) diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 4e303a06d64b..09d054089d03 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -1094,7 +1094,7 @@ SwXFrameEnumeration<T>::SwXFrameEnumeration(const SwDoc* const pDoc) { // #i104937# pFmt = (*pFmts)[i]; - if(pFmt->Which() != RES_FLYFRMFMT || std::find(aTextBoxes.begin(), aTextBoxes.end(), pFmt) != aTextBoxes.end()) + if(pFmt->Which() != RES_FLYFRMFMT || aTextBoxes.find(pFmt) != aTextBoxes.end()) continue; const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); if(!pIdx || !pIdx->GetNodes().IsDocNodes()) diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 6eab6597e37d..4560afba8d80 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1713,7 +1713,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: // Don't set an explicit ZOrder on TextBoxes. std::set<const SwFrmFmt*> aTextBoxes = SwTextBoxHelper::findTextBoxes(pDoc); - if( nZOrder >= 0 && std::find(aTextBoxes.begin(), aTextBoxes.end(), pFmt) == aTextBoxes.end()) + if( nZOrder >= 0 && aTextBoxes.find(pFmt) == aTextBoxes.end()) { SdrObject* pObject = GetOrCreateSdrObject( (SwFlyFrmFmt&)*pFmt ); diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 8ec6e7174c0a..7b33d66b13da 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -191,7 +191,7 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt(); // Filter out textboxes, which are not interesting at an UNO level. - if (std::find(aTextBoxes.begin(), aTextBoxes.end(), &rFmt) != aTextBoxes.end()) + if (aTextBoxes.find(&rFmt) != aTextBoxes.end()) continue; if ( rFmt.GetAnchor().GetAnchorId() == nChkType ) diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 5e02a0200b1e..efcb07a5418e 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -873,7 +873,7 @@ lcl_ExportHints( break; // Robust #i81708 content in covered cells // Do not expose inline anchored textboxes. - if (std::find(rTextBoxes.begin(), rTextBoxes.end(), pAttr->GetFlyCnt().GetFrmFmt()) != rTextBoxes.end()) + if (rTextBoxes.find(pAttr->GetFlyCnt().GetFrmFmt()) != rTextBoxes.end()) break; pUnoCrsr->Exchange(); diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index b1aa91070b7a..8e855e0575ba 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -1693,7 +1693,7 @@ bool DocxSdrExport::checkFrameBtlr(SwNode* pStartNode, sax_fastparser::FastAttri bool DocxSdrExport::isTextBox(const SwFrmFmt& rFrmFmt) { - return std::find(m_pImpl->m_aTextBoxes.begin(), m_pImpl->m_aTextBoxes.end(), &rFrmFmt) != m_pImpl->m_aTextBoxes.end(); + return m_pImpl->m_aTextBoxes.find(&rFrmFmt) != m_pImpl->m_aTextBoxes.end(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |