diff options
author | Aron Budea <aron.budea@collabora.com> | 2017-11-03 02:08:00 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-01-17 08:43:39 +0100 |
commit | 9d772cdaa8ff1a18b9acac32a0f53b1419211922 (patch) | |
tree | 5f026dd390aa5da6d0646415f5407c1b70b32003 /oox | |
parent | cd2ee5fab4a30bd56daabce03e75561541ffabb0 (diff) |
tdf#105517: overwrite existing scheme colors in vector
Theme overrides stopped working once ClrScheme::maClrScheme was
changed to vector, and colors were always appended to it.
Regression from f3121049828596b369e3ea844355d61666e49795.
Reviewed-on: https://gerrit.libreoffice.org/44242
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
(cherry picked from commit 021081823aeebcfa395662d0c04535a243977c2e)
Change-Id: Iae850dcabf57b12d8a564e84acf38d9988cfe963
Reviewed-on: https://gerrit.libreoffice.org/46845
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Tested-by: Aron Budea <aron.budea@collabora.com>
(cherry picked from commit 1006025df2b6d02ef0762dde227456717d30b1dc)
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/clrscheme.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/oox/source/drawingml/clrscheme.cxx b/oox/source/drawingml/clrscheme.cxx index 2f8e93701e97..f32c1ac0e822 100644 --- a/oox/source/drawingml/clrscheme.cxx +++ b/oox/source/drawingml/clrscheme.cxx @@ -82,7 +82,11 @@ bool ClrScheme::getColor( sal_Int32 nSchemeClrToken, sal_Int32& rColor ) const void ClrScheme::setColor( sal_Int32 nSchemeClrToken, sal_Int32 nColor ) { - maClrScheme.push_back(std::pair<sal_Int32, sal_Int32>(nSchemeClrToken, nColor)); + const auto aIter = std::find_if(maClrScheme.begin(), maClrScheme.end(), find_by_token(nSchemeClrToken) ); + if ( aIter != maClrScheme.end() ) + aIter->second = nColor; + else + maClrScheme.push_back(std::pair<sal_Int32, sal_Int32>(nSchemeClrToken, nColor)); } bool ClrScheme::getColorByIndex(size_t nIndex, sal_Int32& rColor) const |