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


On Sun, 2011-01-16 at 23:32 +0100, Lionel Elie Mamane wrote:
Another of those places in code the that assumes C long == 32 bit
integer. These four variables are used to give default values to
properties WindowTop, WindowLeft, WindowWidth and WindowHeight:

    nY = i_rTableWindowSettings.getOrDefault( "WindowTop", nY );
    nX = i_rTableWindowSettings.getOrDefault( "WindowLeft", nX );
    nWidth = i_rTableWindowSettings.getOrDefault( "WindowWidth", nWidth );
    nHeight = i_rTableWindowSettings.getOrDefault( "WindowHeight", nHeight );

But these properties are initialised with a "long":

            aWindowData.put( "WindowTop", (*aIter)->GetPosition().Y() );
            aWindowData.put( "WindowLeft", (*aIter)->GetPosition().X() );
            aWindowData.put( "WindowWidth", (*aIter)->GetSize().Width() );
            aWindowData.put( "WindowHeight", (*aIter)->GetSize().Height() );

GetPosition() returns a Point, and that returns "long" for X and Y.
GetSize() returns a Size, and that returns "long" for Width and Height.

Grepping for WindowTop in there, I see a LoadTableWindowData which
apparently also reads those settings from a file as well and set them.
Given that there its also sal_Int32 types, I suggest that maybe its
better to change the put to cast the input long type to a sal_Int32
instead ? 

C.


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.