From abb780094d9a6b6261c4a4018d24f3853d04876d Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Mon, 13 Aug 2018 18:33:00 +0900 Subject: sw: Replace std::list with std::vector for simplicity Change-Id: I239df7b0009711eeaf025221bec9c95887681c8d Reviewed-on: https://gerrit.libreoffice.org/58918 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/inc/PostItMgr.hxx | 3 +-- sw/source/uibase/docvw/PostItMgr.cxx | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'sw') diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index e3f881e59d39..9650996c50f3 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -24,7 +24,6 @@ #include "swdllapi.h" #include -#include #include #include #include @@ -155,7 +154,7 @@ class SwPostItMgr: public SfxListener void Scroll(const long lScroll,const unsigned long aPage ); void AutoScroll(const sw::annotation::SwAnnotationWin* pPostIt,const unsigned long aPage ); bool ScrollbarHit(const unsigned long aPage,const Point &aPoint); - bool LayoutByPage( std::list &aVisiblePostItList, + bool LayoutByPage( std::vector &aVisiblePostItList, const tools::Rectangle& rBorder, long lNeededHeight); void CheckForRemovedPostIts(); diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 2365d8b026ea..0dcd8a9399ec 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -690,7 +690,7 @@ void SwPostItMgr::LayoutPostIts() // only layout if there are notes on this page if (pPage->mvSidebarItems.size()>0) { - std::list aVisiblePostItList; + std::vector aVisiblePostItList; unsigned long lNeededHeight = 0; long mlPageBorder = 0; long mlPageEnd = 0; @@ -876,8 +876,6 @@ void SwPostItMgr::LayoutPostIts() // Layout for this post it finished now visiblePostIt->GetSidebarItem().bPendingLayout = false; } - - aVisiblePostItList.clear(); } else { @@ -1118,7 +1116,7 @@ Color SwPostItMgr::GetArrowColor(sal_uInt16 aDirection,unsigned long aPage) cons } } -bool SwPostItMgr::LayoutByPage(std::list &aVisiblePostItList, const tools::Rectangle& rBorder, long lNeededHeight) +bool SwPostItMgr::LayoutByPage(std::vector &aVisiblePostItList, const tools::Rectangle& rBorder, long lNeededHeight) { /*** General layout idea:***/ // - if we have space left, we always move the current one up, -- cgit