lotuswordpro/source/filter/lwpdoc.cxx | 14 +++++++------- lotuswordpro/source/filter/lwplayout.cxx | 7 ++++--- lotuswordpro/source/filter/lwppara.cxx | 4 ++-- lotuswordpro/source/filter/lwppara1.cxx | 4 ++-- lotuswordpro/source/filter/lwprowlayout.cxx | 6 +++--- lotuswordpro/source/filter/lwpstory.cxx | 10 +++++----- lotuswordpro/source/filter/lwptablelayout.cxx | 14 +++++++------- 7 files changed, 30 insertions(+), 29 deletions(-)
New commits: commit 3bcef77383d07d86a13bc097894b3044cae4f57f Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Fri Jan 31 20:49:52 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Feb 1 07:07:48 2020 +0100 std:set->o3tl::sorted_vector which is always a better choice when dealing with pointers, for 2 reasons: way more cache dense, and we very often iterate pointers roughly in-order, which means very little sorting needs to be done Change-Id: Ib38f56018b2fc16414c9af910421cc45f069e1f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87782 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx index a5ef2a7f4203..96f4c2f1bbfd 100644 --- a/lotuswordpro/source/filter/lwpdoc.cxx +++ b/lotuswordpro/source/filter/lwpdoc.cxx @@ -68,7 +68,7 @@ #include "lwpverdocument.hxx" #include <xfilter/xfstylemanager.hxx> #include <osl/thread.h> -#include <set> +#include <o3tl/sorted_vector.hxx> LwpDocument::LwpDocument(LwpObjectHeader const & objHdr, LwpSvStream* pStrm) : LwpDLNFPVList(objHdr, pStrm) @@ -287,7 +287,7 @@ void LwpDocument::RegisterStylesInPara() if (xContent.is()) { rtl::Reference<LwpStory> xStory(dynamic_cast<LwpStory*>(xContent->GetChildHead().obj(VO_STORY).get())); - std::set<LwpStory*> aSeen; + o3tl::sorted_vector<LwpStory*> aSeen; while (xStory.is()) { aSeen.insert(xStory.get()); @@ -314,7 +314,7 @@ void LwpDocument::RegisterBulletStyles() return; LwpSilverBullet* pBullet = dynamic_cast<LwpSilverBullet*> (pBulletHead->GetHeadID().obj().get()); - std::set<LwpSilverBullet*> aSeen; + o3tl::sorted_vector<LwpSilverBullet*> aSeen; while (pBullet) { aSeen.insert(pBullet); @@ -562,7 +562,7 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents() { LwpDocument* pDivision = GetLastDivision(); - std::set<LwpDocument*> aSeen; + o3tl::sorted_vector<LwpDocument*> aSeen; while (pDivision && pDivision != this) { aSeen.insert(pDivision); @@ -628,7 +628,7 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents() LwpDocument* LwpDocument::GetRootDocument() { LwpDocument* pRoot = this; - std::set<LwpDocument*> aSeen; + o3tl::sorted_vector<LwpDocument*> aSeen; while (pRoot) { aSeen.insert(pRoot); @@ -651,7 +651,7 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents() return this; LwpDocument* pDivision = GetFirstDivision(); - std::set<LwpDocument*> aSeen; + o3tl::sorted_vector<LwpDocument*> aSeen; while (pDivision) { aSeen.insert(pDivision); @@ -671,7 +671,7 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents() { LwpDocument* pRoot = GetRootDocument(); LwpDocument *pLastDoc = pRoot ? pRoot->GetLastDivisionWithContents() : nullptr; - std::set<LwpDocument*> aSeen; + o3tl::sorted_vector<LwpDocument*> aSeen; while (pLastDoc) { aSeen.insert(pLastDoc); diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index a393d50b4535..4c41574180a2 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -73,6 +73,7 @@ #include "lwpgrfobj.hxx" #include <osl/thread.h> #include <sal/log.hxx> +#include <o3tl/sorted_vector.hxx> LwpVirtualLayout::LwpVirtualLayout(LwpObjectHeader const &objHdr, LwpSvStream* pStrm) : LwpDLNFPVList(objHdr, pStrm) @@ -500,7 +501,7 @@ void LwpHeadLayout::RegisterStyle() { //Register all children styles rtl::Reference<LwpVirtualLayout> xLayout(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get())); - std::set<LwpVirtualLayout*> aSeen; + o3tl::sorted_vector<LwpVirtualLayout*> aSeen; while (xLayout.is()) { aSeen.insert(xLayout.get()); @@ -522,7 +523,7 @@ void LwpHeadLayout::RegisterStyle() rtl::Reference<LwpVirtualLayout> LwpHeadLayout::FindEnSuperTableLayout() { rtl::Reference<LwpVirtualLayout> xLayout(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get())); - std::set<LwpVirtualLayout*> aSeen; + o3tl::sorted_vector<LwpVirtualLayout*> aSeen; while (xLayout.get()) { aSeen.insert(xLayout.get()); @@ -1376,7 +1377,7 @@ bool LwpMiddleLayout::IsProtected() rtl::Reference<LwpVirtualLayout> LwpMiddleLayout::GetWaterMarkLayout() { rtl::Reference<LwpVirtualLayout> xLay(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get())); - std::set<LwpVirtualLayout*> aSeen; + o3tl::sorted_vector<LwpVirtualLayout*> aSeen; while (xLay.is()) { aSeen.insert(xLay.get()); diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx index 5b92281b0560..b60f34354141 100644 --- a/lotuswordpro/source/filter/lwppara.cxx +++ b/lotuswordpro/source/filter/lwppara.cxx @@ -96,7 +96,7 @@ #include <lwpdropcapmgr.hxx> #include "lwptable.hxx" #include <memory> -#include <set> +#include <o3tl/sorted_vector.hxx> LwpPara::LwpPara(LwpObjectHeader const & objHdr, LwpSvStream* pStrm) : LwpDLVList(objHdr, pStrm) @@ -511,7 +511,7 @@ void LwpPara::RegisterStyle() } bool bHeading = pNumbering->IsHeading(); - std::set<LwpPara*> aSeen; + o3tl::sorted_vector<LwpPara*> aSeen; while(true) { aSeen.insert(pPara); diff --git a/lotuswordpro/source/filter/lwppara1.cxx b/lotuswordpro/source/filter/lwppara1.cxx index 7fb671cc4ccb..4ae2320c9ab6 100644 --- a/lotuswordpro/source/filter/lwppara1.cxx +++ b/lotuswordpro/source/filter/lwppara1.cxx @@ -102,7 +102,7 @@ #include "lwpcelllayout.hxx" #include "lwpframelayout.hxx" -#include <set> +#include <o3tl/sorted_vector.hxx> // boost::polymorphic_downcast checks and reports (using assert), if the // cast is incorrect (in debug builds). @@ -168,7 +168,7 @@ LwpPara* LwpPara::GetParent() if (level != 1) { pPara = dynamic_cast<LwpPara*>(GetPrevious().obj().get()); - std::set<LwpPara*> aSeen; + o3tl::sorted_vector<LwpPara*> aSeen; while (pPara) { aSeen.insert(pPara); diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx b/lotuswordpro/source/filter/lwprowlayout.cxx index 287f8de65434..38dc355afd1a 100644 --- a/lotuswordpro/source/filter/lwprowlayout.cxx +++ b/lotuswordpro/source/filter/lwprowlayout.cxx @@ -68,7 +68,7 @@ #include <xfilter/xftable.hxx> #include <xfilter/xfcell.hxx> #include <xfilter/xfcellstyle.hxx> -#include <set> +#include <o3tl/sorted_vector.hxx> LwpRowLayout::LwpRowLayout(LwpObjectHeader const &objHdr, LwpSvStream* pStrm) : LwpVirtualLayout(objHdr, pStrm) @@ -96,7 +96,7 @@ void LwpRowLayout::SetRowMap() LwpObjectID *pCellID= &GetChildHead(); LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); - std::set<LwpCellLayout*> aSeen; + o3tl::sorted_vector<LwpCellLayout*> aSeen; while(pCellLayout) { aSeen.insert(pCellLayout); @@ -140,7 +140,7 @@ void LwpRowLayout::RegisterStyle() LwpObjectID *pCellID= &GetChildHead(); LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(pCellID->obj().get()); - std::set<LwpCellLayout*> aSeen; + o3tl::sorted_vector<LwpCellLayout*> aSeen; while (pCellLayout) { aSeen.insert(pCellLayout); diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx index 2474dc03202a..8409e9d87411 100644 --- a/lotuswordpro/source/filter/lwpstory.cxx +++ b/lotuswordpro/source/filter/lwpstory.cxx @@ -69,7 +69,7 @@ #include <rtl/ustrbuf.hxx> #include <algorithm> -#include <set> +#include <o3tl/sorted_vector.hxx> LwpStory::LwpStory(LwpObjectHeader const &objHdr, LwpSvStream* pStrm) @@ -104,7 +104,7 @@ void LwpStory::XFConvert(XFContentContainer* pCont) //process para list XFContentContainer* pParaCont = pCont; rtl::Reference<LwpPara> xPara(dynamic_cast<LwpPara*>(GetFirstPara().obj().get())); - std::set<LwpPara*> aConverted; + o3tl::sorted_vector<LwpPara*> aConverted; while (xPara.is()) { xPara->SetFoundry(m_pFoundry); @@ -139,7 +139,7 @@ void LwpStory::XFConvert(XFContentContainer* pCont) void LwpStory::RegisterStyle() { rtl::Reference<LwpPara> xPara(dynamic_cast<LwpPara*>(GetFirstPara().obj().get())); - std::set<LwpPara*> aSeen; + o3tl::sorted_vector<LwpPara*> aSeen; while (xPara.is()) { aSeen.insert(xPara.get()); @@ -322,7 +322,7 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont) while (xLayout.is()) { rtl::Reference<LwpVirtualLayout> xFrameLayout(dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get())); - std::set<LwpVirtualLayout*> aSeen; + o3tl::sorted_vector<LwpVirtualLayout*> aSeen; while (xFrameLayout.is()) { aSeen.insert(xFrameLayout.get()); @@ -349,7 +349,7 @@ void LwpStory::XFConvertFrameInFrame(XFContentContainer* pCont) while (xLayout.get()) { rtl::Reference<LwpVirtualLayout> xFrameLayout(dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get())); - std::set<LwpVirtualLayout*> aSeen; + o3tl::sorted_vector<LwpVirtualLayout*> aSeen; while (xFrameLayout.is()) { aSeen.insert(xFrameLayout.get()); diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx index 448599e5b2c5..0698b1b56a7e 100644 --- a/lotuswordpro/source/filter/lwptablelayout.cxx +++ b/lotuswordpro/source/filter/lwptablelayout.cxx @@ -82,7 +82,7 @@ #include "lwpframelayout.hxx" #include <xfilter/xfparastyle.hxx> #include <memory> -#include <set> +#include <o3tl/sorted_vector.hxx> #include <sal/log.hxx> LwpSuperTableLayout::LwpSuperTableLayout(LwpObjectHeader const &objHdr, LwpSvStream* pStrm) @@ -232,7 +232,7 @@ double LwpSuperTableLayout::GetTableWidth() LwpObjectID *pColumnID = &pTableLayout->GetColumnLayoutHead(); LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj().get()); double dColumnWidth = dDefaultWidth; - std::set<LwpColumnLayout*> aSeen; + o3tl::sorted_vector<LwpColumnLayout*> aSeen; while (pColumnLayout) { aSeen.insert(pColumnLayout); @@ -452,7 +452,7 @@ void LwpTableLayout::TraverseTable() // set value LwpObjectID* pRowID = &GetChildHead(); LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get()); - std::set<LwpRowLayout*> aSeen; + o3tl::sorted_vector<LwpRowLayout*> aSeen; while (pRowLayout) { aSeen.insert(pRowLayout); @@ -571,7 +571,7 @@ void LwpTableLayout::RegisterColumns() // NOTICE: all default columns are regarded as justifiable columns LwpObjectID* pColumnID = &GetColumnLayoutHead(); LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(pColumnID->obj().get()); - std::set<LwpColumnLayout*> aSeen; + o3tl::sorted_vector<LwpColumnLayout*> aSeen; while (pColumnLayout) { aSeen.insert(pColumnLayout); @@ -1117,7 +1117,7 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID) LwpTableRange* pTableRange = pHolder ? dynamic_cast<LwpTableRange*>(pHolder->GetHeadID().obj().get()) : nullptr; //Look up the table - std::set<LwpTableRange*> aTableSeen; + o3tl::sorted_vector<LwpTableRange*> aTableSeen; while (pTableRange) { aTableSeen.insert(pTableRange); @@ -1146,7 +1146,7 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID) LwpRowList* pRowList = dynamic_cast<LwpRowList*>(aRowListID.obj().get()); //loop the rowlist - std::set<LwpRowList*> aOuterSeen; + o3tl::sorted_vector<LwpRowList*> aOuterSeen; while (pRowList) { aOuterSeen.insert(pRowList); @@ -1154,7 +1154,7 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID) { LwpCellList* pCellList = dynamic_cast<LwpCellList*>(pRowList->GetChildHeadID().obj().get()); //loop the cellList - std::set<LwpCellList*> aSeen; + o3tl::sorted_vector<LwpCellList*> aSeen; while (pCellList) { aSeen.insert(pCellList); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits