sd/qa/unit/import-tests.cxx            |    1 +
 sw/source/core/doc/docfly.cxx          |    4 ++--
 sw/source/core/doc/textboxhelper.cxx   |    2 +-
 sw/source/core/unocore/unocoll.cxx     |    2 +-
 sw/source/core/unocore/unoframe.cxx    |    2 +-
 sw/source/core/unocore/unoobj2.cxx     |    2 +-
 sw/source/core/unocore/unoportenum.cxx |    2 +-
 sw/source/filter/ww8/docxsdrexport.cxx |    2 +-
 8 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 2248aaf58a89e446a1e707254cb40905a6411305
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Fri Sep 5 15:08:21 2014 +0200

    std::set::find() is faster than plain std::find()
    
    Change-Id: I11ca9474e4b6b751f0348b78b53abaa81682eaa6

diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 2283ac4..97f8f5d 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 30604ee..d003983 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 4e303a0..09d05408 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 6eab659..4560afb 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 8ec6e71..7b33d66 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 5e02a02..efcb07a 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 b1aa910..8e855e0 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: */
commit f572a13c374435ae5f1d3f47d964e1eece20ae8e
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Fri Sep 5 14:26:33 2014 +0200

    CppunitTest_sd_import_tests: missing DoClose() call
    
    This leaked two files in /tmp during every run.
    
    Change-Id: I8dc0574c210925fa5d6704ffad9c106186a50151

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 33c5239..259004c 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -610,6 +610,7 @@ void SdFiltersTest::testCreationDate()
     sax::Converter::convertDateTime(aBuffer, aDate, 0);
     // Metadata wasn't imported, this was 0000-00-00.
     CPPUNIT_ASSERT_EQUAL(OUString("2013-11-09T10:37:56"), 
aBuffer.makeStringAndClear());
+    xDocShRef->DoClose();
 }
 
 void SdFiltersTest::testBnc887225()
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to