diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/doc.hxx | 2 | ||||
-rw-r--r-- | sw/inc/docsh.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/app/docst.cxx | 2 |
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(); } |