From 7e19e07526f8c1ca94555e3e9a2211b9555f54b2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 17 Nov 2019 13:43:32 +0000 Subject: cid#1455745 Not restoring ostream format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie5b73bca282a279a0318e42499d44f19822b1554 Reviewed-on: https://gerrit.libreoffice.org/83017 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- include/tools/color.hxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'include/tools') 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 inline std::basic_ostream& operator <<(std::basic_ostream& rStream, const Color& rColor) { - return rStream << "c[" << std::hex << std::setfill ('0') - << std::setw(2) << static_cast(rColor.GetRed()) - << std::setw(2) << static_cast(rColor.GetGreen()) - << std::setw(2) << static_cast(rColor.GetBlue()) - << std::setw(2) << static_cast(rColor.GetTransparency()) << "]"; + std::ios_base::fmtflags nOrigFlags = rStream.flags(); + rStream << "c[" << std::hex << std::setfill ('0') + << std::setw(2) << static_cast(rColor.GetRed()) + << std::setw(2) << static_cast(rColor.GetGreen()) + << std::setw(2) << static_cast(rColor.GetBlue()) + << std::setw(2) << static_cast(rColor.GetTransparency()) << "]"; + rStream.setf(nOrigFlags); + return rStream; } #endif -- cgit