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


On Mon, Jun 01, 2015 at 09:19:40AM +0200, Stephan Bergmann wrote:
On 05/30/2015 10:30 PM, Lionel Elie Mamane wrote:
         virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob > SAL_CALL 
getClob( sal_Int32 columnIndex ) throw(::com::su
         virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray > SAL_CALL 
getArray( sal_Int32 columnIndex ) throw(::com::
         // ::com::sun::star::sdbc::XResultSet
-        virtual sal_Bool SAL_CALL next(  ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);
-        virtual sal_Bool SAL_CALL isBeforeFirst(  ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);
-        virtual sal_Bool SAL_CALL isAfterLast(  ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);
-        virtual sal_Bool SAL_CALL isFirst(  ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);
-        virtual sal_Bool SAL_CALL isLast(  ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);
+        virtual bool SAL_CALL next(  ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);
+        virtual bool SAL_CALL isBeforeFirst(  ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);
+        virtual bool SAL_CALL isAfterLast(  ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);
+        virtual bool SAL_CALL isFirst(  ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);
+        virtual bool SAL_CALL isLast(  ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);


Which changed dbaccess/source/core/api/CacheSet.hxx to bool return
types. But these are (copies of) the com::sun::star::sdbc::XResultSet
interface, so shouldn't those have stayed sal_Bool?

The functions are apparently copied from XResultSet (incl. presumably
unnecessary virtual and SAL_CALL, even), but technically they are unrelated.
That means there is no technical reason to make them use the inferior
sal_Bool instead of bool (and loplugin:salbool should warn about such
unnecessary uses of sal_Bool).

Well, OTOH your tinderbox complains that a bool is compared to a
sal_Bool, and for functions that are copied from XResultSet putting
explicit casts is unnatural. In essence, the "cache" objects presents
the same API as the object it caches, but it just happens that all
users of the cache know they are dealing with a cache, so they don't
use the abstract base (interface) class (css::sdbc::XResultSet), but
use the "Cache" object class directly.

I think I prefer to add the inheritance from the
"css::sdbc::XResultSet" interface class, so that the things I just
explained are visible to the tools.

-- 
Lionel

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.