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

Michael Meeks michael.meeks at novell.com
Tue Oct 5 03:33:32 PDT 2010

Hi there,

On Tue, 2010-10-05 at 09:47 +0100, Caolán McNamara wrote:
> 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.

	Fair enough; so an explicit cast in the code calling the operator:

	rStrm << static_cast<sal_uInt8>(aBool) << ...;

	sort of thing ?

> 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.

	Weelll ... the operator in fact only streams 4 bytes regardless of
architecture ...

>  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.

	I guess; OTOH - do we really want to get into some monster LONG ->
sal_Int32 replacement scheme just now ? :-) I'd rather get hackers
re-focused on the higher-win tasks further up the stack really.

> 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.

	Added it to the wiki page[1] anyhow :-)



[1] - http://www.freedesktop.org/wiki/Software/LibreOffice/EasyHacks
 michael.meeks at novell.com  <><, Pseudo Engineer, itinerant idiot

More information about the LibreOffice mailing list