[Libreoffice] [PATCH] Add support for bool for the operator << and >> of SvStream

Caolán McNamara caolanm at redhat.com
Tue Oct 5 01:47:30 PDT 2010

On Mon, 2010-10-04 at 08:54 -0600, Noel Power wrote:
> Hi Norbet
> On Sat, 2010-10-02 at 21:18 -0500, Norbert Thiebaud wrote:
> > [PATCH] Add support for bool for the operator << and >> of SvStream
> > 
> I just wonder did you have a specific reason for this patch. I would
> assume if someone would be reading or writing a boolean value to a
> binary stream they probably would be packing it some how in the
> structure they are writing. E.g. normally in the binary filters ( where
> SvStream is used ) boolean values are usually read & written ( packed )
> into some sort of bit field in 16 or 32 bit words. 

> Caolan what do you think?

I don't like adding another << >> SvStream operator for bool. If there
are places which would break on converting BOOL to bool because they're
getting streamed to disk via SvStreams, then I think I'd prefer to see
those specific BOOLs converted to sal_uInt8.

I see we also have a << >> SvStream operators for "long" which is
another disaster seeing as a long is either 32bits of 64bits in size
depending on platform. Anything streaming a long to disk is probably
broken and depending on a long being 32bit, or is hopefully only being
used for some temporary scratch format which could be replaced by
something platform-independent.

Here's another to-do for someone. Remove the long << >> SvStream
operators and find what's using them and lets consider if we can remove
them too as they are a ticking timebomb.


More information about the LibreOffice mailing list