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


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.

Point and Size defined in libs-gui/tools/inc/tools/gen.hxx


---
Fix property type / default value mismatch

Fixes:
 Error: caught an exception
 message: Invalid value type for 'WindowTop'.
 Expected: long
 Found: hyper
  From File dbaccess/source/ui/querydesign/querycontroller.cxx at Line 1722
when editing a query
---
 dbaccess/source/ui/querydesign/JoinController.cxx |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx 
b/dbaccess/source/ui/querydesign/JoinController.cxx
index 77b31a8..6ac8e2e 100644
--- a/dbaccess/source/ui/querydesign/JoinController.cxx
+++ b/dbaccess/source/ui/querydesign/JoinController.cxx
@@ -402,7 +402,7 @@ void OJoinController::loadTableWindows( const ::comphelper::NamedValueCollection
 // -----------------------------------------------------------------------------
 void OJoinController::loadTableWindow( const ::comphelper::NamedValueCollection& 
i_rTableWindowSettings )
 {
-    sal_Int32 nX = -1, nY = -1, nHeight = -1, nWidth = -1;
+    long nX = -1, nY = -1, nHeight = -1, nWidth = -1;
 
     ::rtl::OUString sComposedName,sTableName,sWindowName;
     sal_Bool bShowAll = false;
-- 
1.7.2.3


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.