Tag: cws_src680_sqlite User: aklitzing Date: 2006/08/18 12:02:48 Modified: dba/connectivity/source/drivers/sqlite3/sqResultSetMetaData.cxx dba/connectivity/source/drivers/sqlite3/sqResultSetMetaData.hxx
Log: * Changed to human-readable code * Error message improved * Stupid code removed File Changes: Directory: /dba/connectivity/source/drivers/sqlite3/ ==================================================== File [changed]: sqResultSetMetaData.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/sqlite3/sqResultSetMetaData.cxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +8 -17 -------------------- --- sqResultSetMetaData.cxx 16 Aug 2006 14:57:13 -0000 1.1.2.1 +++ sqResultSetMetaData.cxx 18 Aug 2006 19:02:45 -0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: sqResultSetMetaData.cxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: aklitzing $ $Date: 2006/08/16 14:57:13 $ + * last change: $Author: aklitzing $ $Date: 2006/08/18 19:02:45 $ * * Original contributor: André Klitzing * @@ -48,13 +48,11 @@ { } // ------------------------------------------------------------------------- -// ------------------------------------------------------------------------- sal_Int32 SAL_CALL OResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException) { return 50; //!< \todo needs to be improved! } // ------------------------------------------------------------------------- - sal_Int32 SAL_CALL OResultSetMetaData::getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException) { int sqType = m_pQuery->getType(column-1); @@ -69,8 +67,8 @@ else if(sqType == SQLITE_NULL) return com::sun::star::sdbc::DataType::SQLNULL; else - throw SQLException(::rtl::OUString::createFromAscii("Unknown ColumnType"), - *this, ::rtl::OUString::createFromAscii("unkown error"), 1, Any()); + throw SQLException(::rtl::OUString::createFromAscii("An unkown error occured"), + *this, ::rtl::OUString::createFromAscii("Unknown ColumnType"), -1, Any()); } // ------------------------------------------------------------------------- @@ -131,9 +129,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isAutoIncrement( sal_Int32 column ) throw(SQLException, RuntimeException) { - return 0; - // I know this is ugly... it will be removed if the new interface to getColumnMetadata() is ready! - //m_pQuery->getColumnMetadata(column, &tmp_c, &tmp_cj, &tmp_i, &tmp_ij, &ret); + return sal_False; } // ------------------------------------------------------------------------- @@ -148,7 +144,7 @@ return 0; } // ----------------------------------------------------------------------------- -sal_Int32 SAL_CALL OResultSetMetaData::getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) +sal_Int32 SAL_CALL OResultSetMetaData::getScale( sal_Int32 column ) throw(SQLException, RuntimeException) { return 0; } @@ -156,12 +152,7 @@ sal_Int32 SAL_CALL OResultSetMetaData::isNullable( sal_Int32 column ) throw(SQLException, RuntimeException) { - // I know this is ugly... it will be removed if the new interface to getColumnMetadata() is ready! - const char* tmp_c; - int tmp_i; - int ret; - m_pQuery->getColumnMetadata(column, &tmp_c, &tmp_c, &ret, &tmp_i, &tmp_i); - return ret; + return 0; } // ------------------------------------------------------------------------- File [changed]: sqResultSetMetaData.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/sqlite3/sqResultSetMetaData.hxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +27 -24 --------------------- --- sqResultSetMetaData.hxx 16 Aug 2006 14:57:14 -0000 1.1.2.1 +++ sqResultSetMetaData.hxx 18 Aug 2006 19:02:45 -0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: sqResultSetMetaData.hxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: aklitzing $ $Date: 2006/08/16 14:57:14 $ + * last change: $Author: aklitzing $ $Date: 2006/08/18 19:02:45 $ * * Original contributor: André Klitzing * @@ -51,6 +51,9 @@ { namespace sqlite3 { + using ::com::sun::star::sdbc::SQLException; + using ::com::sun::star::uno::RuntimeException; + //************************************************************** //************ Class: ResultSetMetaData //************************************************************** @@ -68,27 +71,27 @@ inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw() { return this; } - virtual sal_Int32 SAL_CALL getColumnCount( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getColumnCount( ) throw(SQLException, RuntimeException); + virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual ::rtl::OUString SAL_CALL getColumnLabel( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual ::rtl::OUString SAL_CALL getColumnName( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual ::rtl::OUString SAL_CALL getSchemaName( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual ::rtl::OUString SAL_CALL getTableName( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual ::rtl::OUString SAL_CALL getCatalogName( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual ::rtl::OUString SAL_CALL getColumnTypeName( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) throw(SQLException, RuntimeException); + virtual ::rtl::OUString SAL_CALL getColumnServiceName( sal_Int32 column ) throw(SQLException, RuntimeException); }; } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
