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 /sc | |
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 'sc')
-rw-r--r-- | sc/inc/document.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/document10.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/docsh.hxx | 2 |
4 files changed, 7 insertions, 9 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 3ed76a6b41d9..c0468c3c5967 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1863,7 +1863,7 @@ public: void CopyCellValuesFrom( const ScAddress& rTopPos, const sc::CellValues& rSrc ); - std::vector<Color> GetDocColors(); + std::set<Color> GetDocColors(); private: ScDocument(const ScDocument& r) SAL_DELETED_FUNCTION; diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx index 362acbf8ec91..977a0dba5be0 100644 --- a/sc/source/core/data/document10.cxx +++ b/sc/source/core/data/document10.cxx @@ -156,9 +156,9 @@ void ScDocument::CopyCellValuesFrom( const ScAddress& rTopPos, const sc::CellVal pTab->CopyCellValuesFrom(rTopPos.Col(), rTopPos.Row(), rSrc); } -std::vector<Color> ScDocument::GetDocColors() +std::set<Color> ScDocument::GetDocColors() { - std::vector<Color> aDocColors; + std::set<Color> aDocColors; ScDocumentPool *pPool = GetPool(); const sal_uInt16 pAttribs[] = {ATTR_BACKGROUND, ATTR_FONT_COLOR}; for (size_t i=0; i<SAL_N_ELEMENTS( pAttribs ); i++) @@ -171,10 +171,8 @@ std::vector<Color> ScDocument::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/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 29b03c3c79bb..e7cb71a76164 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -205,7 +205,7 @@ void ScDocShell::FillClass( SvGlobalName* pClassName, } } -std::vector<Color> ScDocShell::GetDocColors() +std::set<Color> ScDocShell::GetDocColors() { return aDocument.GetDocColors(); } diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index f7c2f2865e28..03e867c2eca4 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -193,7 +193,7 @@ public: sal_Int32 nFileFormat, bool bTemplate = false ) const SAL_OVERRIDE; - virtual std::vector<Color> GetDocColors() SAL_OVERRIDE; + virtual std::set<Color> GetDocColors() SAL_OVERRIDE; virtual bool InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& ) SAL_OVERRIDE; virtual bool Load( SfxMedium& rMedium ) SAL_OVERRIDE; |