summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-17 13:43:32 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-17 18:12:10 +0100
commit7e19e07526f8c1ca94555e3e9a2211b9555f54b2 (patch)
treef92b7b138fa70bbe5224d41402a5ba29d9155ff5 /include
parent3a8d16ba8ca7ef7349e893f2bf1c7e12d9a8d7ae (diff)
cid#1455745 Not restoring ostream format
Change-Id: Ie5b73bca282a279a0318e42499d44f19822b1554 Reviewed-on: https://gerrit.libreoffice.org/83017 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/tools/color.hxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index fa62f28f362b..cf11e0ae9df2 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -320,11 +320,14 @@ constexpr ::Color COL_AUTHOR9_LIGHT ( 255, 231, 199 );
template<typename charT, typename traits>
inline std::basic_ostream<charT, traits>& operator <<(std::basic_ostream<charT, traits>& rStream, const Color& rColor)
{
- return rStream << "c[" << std::hex << std::setfill ('0')
- << std::setw(2) << static_cast<int>(rColor.GetRed())
- << std::setw(2) << static_cast<int>(rColor.GetGreen())
- << std::setw(2) << static_cast<int>(rColor.GetBlue())
- << std::setw(2) << static_cast<int>(rColor.GetTransparency()) << "]";
+ std::ios_base::fmtflags nOrigFlags = rStream.flags();
+ rStream << "c[" << std::hex << std::setfill ('0')
+ << std::setw(2) << static_cast<int>(rColor.GetRed())
+ << std::setw(2) << static_cast<int>(rColor.GetGreen())
+ << std::setw(2) << static_cast<int>(rColor.GetBlue())
+ << std::setw(2) << static_cast<int>(rColor.GetTransparency()) << "]";
+ rStream.setf(nOrigFlags);
+ return rStream;
}
#endif