Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

While trying to find out where the default font for form controls was
set, I came across this in the file formcontrolfactory.cxx, which has
left me a bit puzzled :


sal_Int32 nDataType = DataType::OTHER;
            OSL_VERIFY( _rxDatabaseField->getPropertyValue(
FM_PROP_FIELDTYPE ) >>= nDataType );

            if  (   xModelPSI->hasPropertyByName( FM_PROP_VALUEMIN )
                &&  xModelPSI->hasPropertyByName( FM_PROP_VALUEMAX )
                )
            {
                sal_Int32 nMinValue = -1000000000, nMaxValue = 1000000000;
                switch ( nDataType )
                {
                    case DataType::TINYINT  : nMinValue = 0; nMaxValue =
255; break;
                    case DataType::SMALLINT : nMinValue = -32768;
nMaxValue = 32767; break;
                    case DataType::INTEGER  : nMinValue = 0x80000000;
nMaxValue = 0x7FFFFFFF; break;
                        // double and singles are ignored
                }

In particular, the line :

case DataType::TINYINT  : nMinValue = 0; nMaxValue = 255; break

sets TINYINT as signed. This surely must lead to strange results for
TINYINT fields where the default is often -127 to +128, e.g. mysql.

Am I barking up the wrong tree here, and if so, can someone please
enlighten me ?

Oh, and if anyone happens to know where the Default font for form
controls is defined, I would be most obliged ;-)


Alex



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.