summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorUrsache Vladimir <ursache@collabora.co.uk>2015-02-14 02:46:47 +0200
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-02-14 01:51:54 +0100
commit50a36041e18dc2a595259b5414ded409687dc47b (patch)
tree2f61edb3336449a6649eb5defbd0ca50d5c966b8 /sw
parent1e475fef47fe6bd9dba6d830aaf0b6c12dc88881 (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')
-rw-r--r--sw/inc/doc.hxx2
-rw-r--r--sw/inc/docsh.hxx2
-rw-r--r--sw/source/core/doc/docfmt.cxx10
-rw-r--r--sw/source/uibase/app/docst.cxx2
4 files changed, 7 insertions, 9 deletions
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<Color> GetDocColors();
+ std::set<Color> 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<Color> GetDocColors() SAL_OVERRIDE;
+ virtual std::set<Color> 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<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();
}