PLEASE NOTE - I've hardly tested this patch, because I've trashed my devel directory and as you can see from my other mails, I'm having great difficulty getting a working --with-java setup again :-) Oh well ...
But, having dug as deep as I can, these two functions seem to be mere shims to call the equivalent java functions, and seem to have been added either for code that is now obsolete, or (more likely) in readiness for future use. Either way, I can't find anywhere they are actually used. Is anyone willing to do a quick test and push? I'm emailing it now because I've been sitting on it a couple of days and don't want to lose it by accident as I try and get a new working directory :-) Cheers, Wol
>From 983fe7249a994e881714943446b03a12e008a7b8 Mon Sep 17 00:00:00 2001 From: Wol <anth...@youngman.org.uk> Date: Wed, 1 Dec 2010 18:20:58 +0000 Subject: [PATCH] Remove get/setNanos --- connectivity/source/drivers/jdbc/Timestamp.cxx | 25 +++++++---------------- connectivity/source/inc/java/sql/Timestamp.hxx | 8 ++---- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/connectivity/source/drivers/jdbc/Timestamp.cxx b/connectivity/source/drivers/jdbc/Timestamp.cxx index 6474e9c..0eee1d5 100644 --- a/connectivity/source/drivers/jdbc/Timestamp.cxx +++ b/connectivity/source/drivers/jdbc/Timestamp.cxx @@ -46,13 +46,13 @@ java_sql_Date::java_sql_Date( const ::com::sun::star::util::Date& _rOut ) : java if( !t.pEnv ) return; jvalue args[1]; - // Parameter konvertieren + // Convert parameters ::rtl::OUString sDateStr; sDateStr = ::dbtools::DBTypeConversion::toDateString(_rOut); args[0].l = convertwchar_tToJavaString(t.pEnv,sDateStr); // Java-Call fuer den Konstruktor absetzen - // temporaere Variable initialisieren + // initialise temporary variables static const char * cSignature = "(Ljava/lang/String;)Ljava/sql/Date;"; jobject tempObj; static jmethodID mID(NULL); @@ -111,13 +111,13 @@ java_sql_Time::java_sql_Time( const ::com::sun::star::util::Time& _rOut ): java_ if( !t.pEnv ) return; jvalue args[1]; - // Parameter konvertieren + // Convert parameters ::rtl::OUString sDateStr; sDateStr = ::dbtools::DBTypeConversion::toTimeString(_rOut); args[0].l = convertwchar_tToJavaString(t.pEnv,sDateStr); // Java-Call fuer den Konstruktor absetzen - // temporaere Variable initialisieren + // intialise temporary variables static const char * cSignature = "(Ljava/lang/String;)Ljava/sql/Time;"; jobject tempObj; static jmethodID mID(NULL); @@ -147,6 +147,7 @@ jclass java_sql_Timestamp::getMyClass() const { return st_getMyClass(); } + jclass java_sql_Timestamp::st_getMyClass() { // die Klasse muss nur einmal geholt werden, daher statisch @@ -154,6 +155,7 @@ jclass java_sql_Timestamp::st_getMyClass() theClass = findMyClass("java/sql/Timestamp"); return theClass; } + java_sql_Timestamp::java_sql_Timestamp(const ::com::sun::star::util::DateTime& _rOut) :java_util_Date( NULL, (jobject)NULL ) { @@ -161,14 +163,14 @@ java_sql_Timestamp::java_sql_Timestamp(const ::com::sun::star::util::DateTime& _ if( !t.pEnv ) return; jvalue args[1]; - // Parameter konvertieren + // Convert parameters ::rtl::OUString sDateStr; sDateStr = ::dbtools::DBTypeConversion::toDateTimeString(_rOut); args[0].l = convertwchar_tToJavaString(t.pEnv,sDateStr); // Java-Call fuer den Konstruktor absetzen - // temporaere Variable initialisieren + // initialise temporary variables static const char * cSignature = "(Ljava/lang/String;)Ljava/sql/Timestamp;"; jobject tempObj; static jmethodID mID(NULL); @@ -181,17 +183,6 @@ java_sql_Timestamp::java_sql_Timestamp(const ::com::sun::star::util::DateTime& _ // und aufraeumen } -sal_Int32 java_sql_Timestamp::getNanos() -{ - static jmethodID mID(NULL); - return callIntMethod("getNanos",mID); -} - -void java_sql_Timestamp::setNanos( sal_Int32 _par0 ) -{ - static jmethodID mID(NULL); - callVoidMethodWithIntArg("setNanos",mID,_par0); -} // ----------------------------------------------------------------------------- java_sql_Timestamp::operator ::com::sun::star::util::DateTime() { diff --git a/connectivity/source/inc/java/sql/Timestamp.hxx b/connectivity/source/inc/java/sql/Timestamp.hxx index ce3908f..b9780c3 100644 --- a/connectivity/source/inc/java/sql/Timestamp.hxx +++ b/connectivity/source/inc/java/sql/Timestamp.hxx @@ -42,7 +42,7 @@ namespace connectivity class java_sql_Date : public java_util_Date { protected: - // statische Daten fuer die Klasse + // static data for the class static jclass theClass; public: virtual jclass getMyClass() const; @@ -63,7 +63,7 @@ namespace connectivity class java_sql_Time : public java_util_Date { protected: - // statische Daten fuer die Klasse + // static data for the class static jclass theClass; public: virtual jclass getMyClass() const; @@ -81,7 +81,7 @@ namespace connectivity class java_sql_Timestamp : public java_util_Date { protected: - // statische Daten fuer die Klasse + // static data for the class static jclass theClass; public: virtual jclass getMyClass() const; @@ -91,8 +91,6 @@ namespace connectivity java_sql_Timestamp( const ::com::sun::star::util::DateTime& _rOut); operator ::com::sun::star::util::DateTime(); - sal_Int32 getNanos(); - void setNanos(sal_Int32 n); static jclass st_getMyClass(); }; } -- 1.7.2.2
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice