From 50a36041e18dc2a595259b5414ded409687dc47b Mon Sep 17 00:00:00 2001 From: Ursache Vladimir Date: Sat, 14 Feb 2015 02:46:47 +0200 Subject: related tdf#89004 move to std:set instead of std::vector Conflicts: sc/source/core/data/document10.cxx sw/source/core/doc/docfmt.cxx Change-Id: I1312f476607ea3a78b162a7e59323b0a142f6629 --- sw/inc/doc.hxx | 2 +- sw/inc/docsh.hxx | 2 +- sw/source/core/doc/docfmt.cxx | 10 ++++------ sw/source/uibase/app/docst.cxx | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) (limited to 'sw') diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 1fe0fd95dd2c..e030ff9ad36e 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1668,7 +1668,7 @@ public: */ void dumpAsXml( xmlTextWriterPtr writer = NULL ) const; - std::vector GetDocColors(); + std::set GetDocColors(); private: // Copies master header to left / first one, if necessary - used by ChgPageDesc(). diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 780883b3b6ad..9b917728bc53 100644 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -249,7 +249,7 @@ public: sal_Int32 nFileFormat, bool bTemplate = false ) const SAL_OVERRIDE; - virtual std::vector GetDocColors() SAL_OVERRIDE; + virtual std::set GetDocColors() SAL_OVERRIDE; virtual void LoadStyles( SfxObjectShell& rSource ) SAL_OVERRIDE; diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index bed21c6a8b91..131ea4e1d971 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1919,9 +1919,9 @@ void SwDoc::RenameFmt(SwFmt & rFmt, const OUString & sNewName, BroadcastStyleOperation(sNewName, eFamily, SFX_STYLESHEET_MODIFIED); } -std::vector SwDoc::GetDocColors() +std::set SwDoc::GetDocColors() { - std::vector aDocColors; + std::set aDocColors; SwAttrPool& rPool = GetAttrPool(); const sal_uInt16 pAttribs[] = {RES_CHRATR_COLOR, RES_CHRATR_HIGHLIGHT, RES_BACKGROUND}; for (size_t i=0; i SwDoc::GetDocColors() if (pItem == 0) continue; Color aColor( pItem->GetValue() ); - if (COL_AUTO == aColor.GetColor()) - continue; - if (std::find(aDocColors.begin(), aDocColors.end(), aColor) == aDocColors.end()) - aDocColors.push_back(aColor); + if (COL_AUTO != aColor.GetColor()) + aDocColors.insert(aColor); } } return aDocColors; diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 1d5a1b507633..8eafb05fd063 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -1225,7 +1225,7 @@ sal_uInt16 SwDocShell::MakeByExample( const OUString &rName, sal_uInt16 nFamily, return nFamily; } -std::vector SwDocShell::GetDocColors() +std::set SwDocShell::GetDocColors() { return mpDoc->GetDocColors(); } -- cgit