TINYINT set as signed in formcontrolfactory.cxx

Alex Thurgood alex.thurgood at gmail.com
Sat Jan 19 00:52:08 PST 2013


On 01/19/2013 04:40 AM, Lionel Elie Mamane wrote:

> 
> It sets it as *un*signed.
> 

Aarghh, yes, that's what I meant to write in my brain, and my fingers
typed otherwise.

> It is exactly the opposite of the capabilities of LibreOffice's
> internal system with 8-bit integers (most notably the "Any" type; see
> http://lists.freedesktop.org/archives/libreoffice/2012-December/043160.html )

Yes, I saw that thread, and the difficulties it can cause. The general
feeling was not to type it more strictly, then ?

> 
> In MySQL, any integer type can be signed or unsigned. Most database
> engines don't allow that choice (they simply use signed, except
> tinyint in Microsoft SQL Server which is always unsigned). See the
> first/best answer at
> http://stackoverflow.com/questions/2991405/what-is-the-difference-between-tinyint-smallint-mediumint-bigint-and-int-in-s
> 

Will check that out to further my understanding.


> 
> The central question is: what are the consequences of this code? If it

I seem to recall that using TINYINT as a boolean field caused a problem
because OOo with the tristate nature of its boolean form control (and I
presume LO, but haven't checked recently) set the default value to -127,
or 0 or 127 - very strange, at least, it seemed that way to me.


> Err... But this will not cover unsigned (32 bit) integer, and neither
> will it cover any BIGINT :-(
> 
> Pff... This could become a mess to handle.

Oh, yet another can of worms.

> Controls where? In a Form? Isn't it the default font of the underlying
> Writer document?
> 

Well that is what I thought, but I was only asking because on the users
list, someone wanted to reset the default font for all controls and
found that there was no way to do so, even if the default was reset in
the document. This led me to think that the default font properties were
stored elsewhere, and I indeed found a reference in formcontrol.cxx, but
had no idea what it meant. That's when I came across the tinyint question.

Apologies for mixing up two things in the same thread. Off to test the
tinyint thing.


Alex






More information about the LibreOffice mailing list