diff options
author | Ursache Vladimir <ursache@collabora.co.uk> | 2015-02-14 02:46:47 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-02-14 01:51:54 +0100 |
commit | 50a36041e18dc2a595259b5414ded409687dc47b (patch) | |
tree | 2f61edb3336449a6649eb5defbd0ca50d5c966b8 /sw/source | |
parent | 1e475fef47fe6bd9dba6d830aaf0b6c12dc88881 (diff) |
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
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/app/docst.cxx | 2 |
2 files changed, 5 insertions, 7 deletions
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<Color> SwDoc::GetDocColors() +std::set<Color> SwDoc::GetDocColors() { - std::vector<Color> aDocColors; + std::set<Color> aDocColors; SwAttrPool& rPool = GetAttrPool(); const sal_uInt16 pAttribs[] = {RES_CHRATR_COLOR, RES_CHRATR_HIGHLIGHT, RES_BACKGROUND}; for (size_t i=0; i<SAL_N_ELEMENTS(pAttribs); i++) @@ -1934,10 +1934,8 @@ std::vector<Color> 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<Color> SwDocShell::GetDocColors() +std::set<Color> SwDocShell::GetDocColors() { return mpDoc->GetDocColors(); } |