[PATCH] Fix: change to std::dec after having used std::hex

Stephan Bergmann sbergman at redhat.com
Fri May 10 08:47:40 PDT 2013


On 05/10/2013 02:34 PM, Chris Sherlock (via Code Review) wrote:
> I have submitted a patch for review:
>
>      https://gerrit.libreoffice.org/3842
>
> To pull it, you can do:
>
>      git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/42/3842/1
>
> Fix: change to std::dec after having used std::hex
>
> The basefield flag of a stream is persistent, which I didn't realise before.
> This fixes commit 256e42646bedbeb9cba900f962f36ba4b1a1cda3
>
> Change-Id: Ic0076c63ae6236ae75dcd79d108add27391b2125
> ---
> M cppcanvas/source/mtfrenderer/emfplus.cxx
> 1 file changed, 31 insertions(+), 31 deletions(-)
>
>
>
> diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
> index c17c38e..d74eabe 100644
> --- a/cppcanvas/source/mtfrenderer/emfplus.cxx
> +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
> @@ -104,7 +104,7 @@
>               sal_Int16 data;
>               for (; i > 0; i --) {
>                   s >> data;
> -                SAL_INFO ("cppcanvas.emf", "EMF+\tdata: " << std::hex << data);
> +                SAL_INFO ("cppcanvas.emf", "EMF+\tdata: " << std::hex << data << std::dec);

...though the stream in question is a stringstream only used to build up 
the SAL_INFO output (rather than cerr, say), so in cases like the above 
it is harmless (though arguably a maintenance gotcha) if it wouldn't be 
reset back to dec at the end.

Stephan


More information about the LibreOffice mailing list