[Libreoffice] [LibreOffice] [Patch] Fix for i#108228: Bool has negative sign when used in Writer formula expression

Michael Meeks michael.meeks at novell.com
Wed Dec 8 03:20:06 PST 2010


Hi Mattias,

On Wed, 2010-12-08 at 21:35 +1100, Mattias Johnsson wrote:
> Fix for http://qa.openoffice.org/issues/show_bug.cgi?id=108228.

	Wow - this is an excellent analysis :-) though I'm hoping someone else
will review the patch.

> // The numeric values of TRUE and FALSE
> enum SbxBOOL { SbxFALSE = 0, SbxTRUE = -1 };
> 
> Bizarre, although I have very vague memories of Visual Basic defining
> -1 to be true. Is that the reason ?

	Possibly this is down to someone using a signed single bit field
somewhere in the deep past ;-)

	typedef struct {
		int foo : 1;
	} Foo;

	'foo' can only be either 0 or -1 - you get just a sign bit.

	Having said that, this really doesn't seem ideal. I wonder what the
compatibility impact of changing it would be [ a chestnut for Noel to
consider I suspect ].

	Anyhow - great work ! :-) 

	Thanks,

		Michael.

-- 
 michael.meeks at novell.com  <><, Pseudo Engineer, itinerant idiot




More information about the LibreOffice mailing list