From 77fd448d0990adc79406e13a127b2b1834984b71 Mon Sep 17 00:00:00 2001 From: Jean-Noël Rouvignac Date: Fri, 1 Feb 2013 09:33:19 +0100 Subject: Removed several useless macros: UNISTRING, USTR, USTR_ASCII, ASCII_STR, ASCII_STRING, CONST_ASCII, ASCSTR, ASCII, DEFINE_CONST_UNICODE, DEFINE_CONST_OUSTRING Change-Id: I96d690bf9f9b319e9eeafcf218ec5ce87f21215f Reviewed-on: https://gerrit.libreoffice.org/1954 Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist --- .../source/drivers/postgresql/pq_connection.cxx | 8 +- .../drivers/postgresql/pq_databasemetadata.cxx | 140 +++++------ .../source/drivers/postgresql/pq_driver.cxx | 1 - .../drivers/postgresql/pq_preparedstatement.cxx | 21 +- .../source/drivers/postgresql/pq_resultset.cxx | 5 +- .../drivers/postgresql/pq_sequenceresultset.cxx | 5 +- .../source/drivers/postgresql/pq_statement.cxx | 10 +- .../source/drivers/postgresql/pq_statics.cxx | 257 ++++++++++----------- .../source/drivers/postgresql/pq_tools.cxx | 7 +- .../drivers/postgresql/pq_updateableresultset.cxx | 10 +- .../source/drivers/postgresql/pq_xcolumns.cxx | 7 +- .../source/drivers/postgresql/pq_xcontainer.cxx | 4 +- .../source/drivers/postgresql/pq_xindexcolumns.cxx | 9 +- .../source/drivers/postgresql/pq_xindexes.cxx | 4 +- .../source/drivers/postgresql/pq_xkeycolumns.cxx | 11 +- 15 files changed, 234 insertions(+), 265 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx index a2c846d423c0..015fe534d8b9 100644 --- a/connectivity/source/drivers/postgresql/pq_connection.cxx +++ b/connectivity/source/drivers/postgresql/pq_connection.cxx @@ -127,8 +127,6 @@ using com::sun::star::sdbc::XDatabaseMetaData; namespace pq_sdbc_driver { -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) - // ______________________________________________________________________________ // Helper class for statement lifetime management @@ -181,7 +179,7 @@ static sal_Int32 readLogLevelFromConfiguration() rtl::Bootstrap bootstrapHandle( fileName ); OUString str; - if( bootstrapHandle.getFrom( ASCII_STR( "PQ_LOGLEVEL" ), str ) ) + if( bootstrapHandle.getFrom( "PQ_LOGLEVEL", str ) ) { if ( str == "NONE" ) loglevel = LogLevel::NONE; @@ -405,7 +403,7 @@ void Connection::setCatalog( const ::rtl::OUString& ) MutexGuard guard( m_refMutex->mutex ); if( m_settings.pConnection == 0 ) { - throw SQLException( ASCII_STR( "pq_connection: connection is closed" ), *this, + throw SQLException( "pq_connection: connection is closed", *this, OUString(), 1, Any() ); } char * p = PQdb(m_settings.pConnection ); @@ -665,7 +663,7 @@ void Connection::disposing() void Connection::checkClosed() throw ( SQLException, RuntimeException ) { if( !m_settings.pConnection ) - throw SQLException( ASCII_STR( "pq_connection: Connection already closed" ), + throw SQLException( "pq_connection: Connection already closed", *this, OUString(), 1, Any() ); } diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx index 4cc9b1578cf6..34d64a19ffbb 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx @@ -131,8 +131,6 @@ std::vector > SequenceAnyVector; -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) - #define QUOTEME(X) #X #define STRINGIFY(X) QUOTEME(X) @@ -177,7 +175,7 @@ DatabaseMetaData::DatabaseMetaData( : m_refMutex( refMutex ), m_pSettings( pSettings ), m_origin( origin ), - m_getIntSetting_stmt ( m_origin->prepareStatement(ASCII_STR( "SELECT setting FROM pg_catalog.pg_settings WHERE name=?" )) ) + m_getIntSetting_stmt ( m_origin->prepareStatement("SELECT setting FROM pg_catalog.pg_settings WHERE name=?") ) { init_getReferences_stmt(); init_getPrivs_stmt(); @@ -237,7 +235,7 @@ sal_Bool DatabaseMetaData::nullsAreSortedAtEnd( ) throw (SQLException, RuntimeE OUString DatabaseMetaData::getDatabaseProductName( ) throw (SQLException, RuntimeException) { - return ASCII_STR("PostgreSQL"); + return OUString("PostgreSQL"); } OUString DatabaseMetaData::getDatabaseProductVersion( ) throw (SQLException, RuntimeException) @@ -246,12 +244,12 @@ OUString DatabaseMetaData::getDatabaseProductVersion( ) throw (SQLException, Ru } OUString DatabaseMetaData::getDriverName( ) throw (SQLException, RuntimeException) { - return ASCII_STR( "postgresql-sdbc" ); + return OUString("postgresql-sdbc"); } OUString DatabaseMetaData::getDriverVersion( ) throw (SQLException, RuntimeException) { - return ASCII_STR( PQ_SDBC_DRIVER_VERSION ); + return OUString(PQ_SDBC_DRIVER_VERSION); } sal_Int32 DatabaseMetaData::getDriverMajorVersion( ) throw (RuntimeException) @@ -327,7 +325,7 @@ sal_Bool DatabaseMetaData::storesMixedCaseQuotedIdentifiers( ) throw (SQLExcept OUString DatabaseMetaData::getIdentifierQuoteString( ) throw (SQLException, RuntimeException) { - return ASCII_STR( "\"" ); + return OUString("\""); } OUString DatabaseMetaData::getSQLKeywords( ) throw (SQLException, RuntimeException) @@ -336,7 +334,7 @@ OUString DatabaseMetaData::getSQLKeywords( ) throw (SQLException, RuntimeExcept // In Java 2 v1.4 and as per LibreOffice SDK doc, this is all keywords that are not SQL92 // I understand this to mean "reserved keywords" only. // See http://www.postgresql.org/docs/current/static/sql-keywords-appendix.html - return ASCII_STR( + return OUString( "ANALYSE," "ANALYZE," "ARRAY," //SQL:1999 @@ -372,7 +370,7 @@ OUString DatabaseMetaData::getNumericFunctions( ) throw (SQLException, RuntimeE // Currently this is just a list of supported functions in PostgreSQL, with PostgreSQL names. // And it is my job to map from Open Group CLI names/syntax to PostgreSQL names/syntax. Where? By parsing the SQL??? // Should look at what the JDBC driver is doing. - return ASCII_STR( + return OUString( "abs," "cbrt," "ceil," @@ -408,7 +406,7 @@ OUString DatabaseMetaData::getNumericFunctions( ) throw (SQLException, RuntimeE OUString DatabaseMetaData::getStringFunctions( ) throw (SQLException, RuntimeException) { // See http://www.postgresql.org/docs/9.1/static/functions-string.html - return ASCII_STR( + return OUString( "bit_length," "char_length," "character_length," @@ -463,7 +461,7 @@ OUString DatabaseMetaData::getSystemFunctions( ) throw (SQLException, RuntimeEx { // See http://www.postgresql.org/docs/9.1/static/functions-info.html // and http://www.postgresql.org/docs/9.1/static/functions-admin.html - return ASCII_STR( + return OUString( "current_catalog," "current_database," "current_query," @@ -591,7 +589,7 @@ OUString DatabaseMetaData::getSystemFunctions( ) throw (SQLException, RuntimeEx OUString DatabaseMetaData::getTimeDateFunctions( ) throw (SQLException, RuntimeException) { // TODO - return ASCII_STR( + return OUString( "age," "age," "clock_timestamp," @@ -619,11 +617,11 @@ OUString DatabaseMetaData::getTimeDateFunctions( ) throw (SQLException, Runtime } OUString DatabaseMetaData::getSearchStringEscape( ) throw (SQLException, RuntimeException) { - return ASCII_STR( "\\" ); + return OUString("\\"); } OUString DatabaseMetaData::getExtraNameCharacters( ) throw (SQLException, RuntimeException) { - return ASCII_STR( "$" ); + return OUString("$"); } sal_Bool DatabaseMetaData::supportsAlterTableWithAddColumn( ) throw (SQLException, RuntimeException) @@ -779,28 +777,27 @@ sal_Bool DatabaseMetaData::supportsLimitedOuterJoins( ) throw (SQLException, Ru OUString DatabaseMetaData::getSchemaTerm( ) throw (SQLException, RuntimeException) { - return ASCII_STR( "SCHEMA" ); + return OUString("SCHEMA"); } OUString DatabaseMetaData::getProcedureTerm( ) throw (SQLException, RuntimeException) { - return ASCII_STR( "function" ); + return OUString("function"); } OUString DatabaseMetaData::getCatalogTerm( ) throw (SQLException, RuntimeException) { - return ASCII_STR( "DATABASE" ); + return OUString("DATABASE"); } sal_Bool DatabaseMetaData::isCatalogAtStart( ) throw (SQLException, RuntimeException) { - return sal_True; } OUString DatabaseMetaData::getCatalogSeparator( ) throw (SQLException, RuntimeException) { - return ASCII_STR( "." ); + return OUString("."); } sal_Bool DatabaseMetaData::supportsSchemasInDataManipulation( ) throw (SQLException, RuntimeException) @@ -969,7 +966,7 @@ sal_Int32 DatabaseMetaData::getMaxNameLength() throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { if ( m_pSettings->maxNameLen == 0) - m_pSettings->maxNameLen = getIntSetting( ASCII_STR("max_identifier_length") ); + m_pSettings->maxNameLen = getIntSetting( "max_identifier_length" ); OSL_ENSURE(m_pSettings->maxNameLen, "postgresql-sdbc: maxNameLen is zero"); return m_pSettings->maxNameLen; } @@ -978,7 +975,7 @@ sal_Int32 DatabaseMetaData::getMaxIndexKeys() throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { if ( m_pSettings->maxIndexKeys == 0) - m_pSettings->maxIndexKeys = getIntSetting(ASCII_STR("max_index_keys")); + m_pSettings->maxIndexKeys = getIntSetting("max_index_keys"); OSL_ENSURE(m_pSettings->maxIndexKeys, "postgresql-sdbc: maxIndexKeys is zero"); return m_pSettings->maxIndexKeys; } @@ -1199,7 +1196,6 @@ sal_Bool DatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw (SQLExc // Take "inspiration" from JDBC driver // Ah, this is used to create a XResultSet manually... Try to do it directly in SQL Reference< XPreparedStatement > statement = m_origin->prepareStatement( - ASCII_STR( "SELECT " "DISTINCT ON (pg_namespace.nspname, relname ) " // avoid duplicates (pg_settings !) "pg_namespace.nspname, relname, relkind, pg_description.description " @@ -1209,7 +1205,7 @@ sal_Bool DatabaseMetaData::dataDefinitionIgnoredInTransactions( ) throw (SQLExc "AND pg_namespace.nspname LIKE ? " "AND relname LIKE ? " // "ORDER BY pg_namespace.nspname || relname" - ) ); + ); Reference< XParameters > parameters( statement, UNO_QUERY_THROW ); parameters->setString( 1 , schemaPattern ); @@ -1310,7 +1306,7 @@ struct SortInternalSchemasLastAndPublicFirst // TABLE_SCHEM string =&gt; schema name Reference< XStatement > statement = m_origin->createStatement(); Reference< XResultSet > rs = statement->executeQuery( - ASCII_STR("SELECT nspname from pg_namespace") ); + "SELECT nspname from pg_namespace" ); // LEM TODO: look at JDBC driver and consider doing the same // in particular, excluding temporary schemas, but maybe better through pg_is_other_temp_schema(oid) OR == pg_my_temp_schema() @@ -1581,8 +1577,6 @@ static void columnMetaData2DatabaseTypeDescription( // => pg_attribute.attnotnull Reference< XPreparedStatement > statement = m_origin->prepareStatement( - ASCII_STR( - "SELECT pg_namespace.nspname, " // 1 "pg_class.relname, " // 2 "pg_attribute.attname, " // 3 @@ -1607,7 +1601,7 @@ static void columnMetaData2DatabaseTypeDescription( "AND pg_class.relname LIKE ? " "AND pg_attribute.attname LIKE ? " "ORDER BY pg_namespace.nspname, pg_class.relname, pg_attribute.attnum" - ) ); + ); Reference< XParameters > parameters( statement, UNO_QUERY_THROW ); parameters->setString( 1 , schemaPattern ); @@ -1623,8 +1617,8 @@ static void columnMetaData2DatabaseTypeDescription( columnMetaData2DatabaseTypeDescription( domainMap, rs, domainTypeStmt ); sal_uInt32 colNum(0); - OUString sSchema( ASCII_STR("#invalid#") ); - OUString sTable( ASCII_STR("#invalid#") ); + OUString sSchema( "#invalid#" ); + OUString sTable( "#invalid#" ); while( rs->next() ) { @@ -1808,7 +1802,6 @@ static void columnMetaData2DatabaseTypeDescription( } Reference< XPreparedStatement > statement = m_origin->prepareStatement( - ASCII_STR( "SELECT nmsp.nspname, " "cl.relname, " "con.conkey, " @@ -1816,7 +1809,7 @@ static void columnMetaData2DatabaseTypeDescription( "con.conrelid " "FROM pg_constraint as con,pg_class as cl, pg_namespace as nmsp " "WHERE con.connamespace = nmsp.oid AND con.conrelid = cl.oid AND con.contype = 'p' " - "AND nmsp.nspname LIKE ? AND cl.relname LIKE ?" ) ); + "AND nmsp.nspname LIKE ? AND cl.relname LIKE ?" ); Reference< XParameters > parameters( statement, UNO_QUERY_THROW ); parameters->setString( 1 , schema ); @@ -1878,10 +1871,9 @@ static void columnMetaData2DatabaseTypeDescription( row[4] >>= tableOid; row[3] >>= attnum; statement = m_origin->prepareStatement( - ASCII_STR( "SELECT att.attname FROM " "pg_attribute AS att, pg_class AS cl WHERE " - "att.attrelid = ? AND att.attnum = ?" )); + "att.attrelid = ? AND att.attnum = ?" ); parameters = Reference< XParameters >( statement, UNO_QUERY_THROW ); parameters->setString( 1 , tableOid ); @@ -2049,37 +2041,37 @@ static void columnMetaData2DatabaseTypeDescription( void DatabaseMetaData::init_getReferences_stmt () { - m_getReferences_stmt[0] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_NONE_NONE_NONE_NONE )); - m_getReferences_stmt[1] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_SOME_NONE_NONE_NONE )); - m_getReferences_stmt[2] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_NONE_SOME_NONE_NONE )); - m_getReferences_stmt[3] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_SOME_SOME_NONE_NONE )); - m_getReferences_stmt[4] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_NONE_NONE_SOME_NONE )); - m_getReferences_stmt[5] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_SOME_NONE_SOME_NONE )); - m_getReferences_stmt[6] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_NONE_SOME_SOME_NONE )); - m_getReferences_stmt[7] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_SOME_SOME_SOME_NONE )); - m_getReferences_stmt[8] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_NONE_NONE_NONE_SOME )); - m_getReferences_stmt[9] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_SOME_NONE_NONE_SOME )); - m_getReferences_stmt[10] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_NONE_SOME_NONE_SOME )); - m_getReferences_stmt[11] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_SOME_SOME_NONE_SOME )); - m_getReferences_stmt[12] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_NONE_NONE_SOME_SOME )); - m_getReferences_stmt[13] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_SOME_NONE_SOME_SOME )); - m_getReferences_stmt[14] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_NONE_SOME_SOME_SOME )); - m_getReferences_stmt[15] = m_origin->prepareStatement(ASCII_STR( SQL_GET_REFERENCES_SOME_SOME_SOME_SOME )); + m_getReferences_stmt[0] = m_origin->prepareStatement(SQL_GET_REFERENCES_NONE_NONE_NONE_NONE); + m_getReferences_stmt[1] = m_origin->prepareStatement(SQL_GET_REFERENCES_SOME_NONE_NONE_NONE); + m_getReferences_stmt[2] = m_origin->prepareStatement(SQL_GET_REFERENCES_NONE_SOME_NONE_NONE); + m_getReferences_stmt[3] = m_origin->prepareStatement(SQL_GET_REFERENCES_SOME_SOME_NONE_NONE); + m_getReferences_stmt[4] = m_origin->prepareStatement(SQL_GET_REFERENCES_NONE_NONE_SOME_NONE); + m_getReferences_stmt[5] = m_origin->prepareStatement(SQL_GET_REFERENCES_SOME_NONE_SOME_NONE); + m_getReferences_stmt[6] = m_origin->prepareStatement(SQL_GET_REFERENCES_NONE_SOME_SOME_NONE); + m_getReferences_stmt[7] = m_origin->prepareStatement(SQL_GET_REFERENCES_SOME_SOME_SOME_NONE); + m_getReferences_stmt[8] = m_origin->prepareStatement(SQL_GET_REFERENCES_NONE_NONE_NONE_SOME); + m_getReferences_stmt[9] = m_origin->prepareStatement(SQL_GET_REFERENCES_SOME_NONE_NONE_SOME); + m_getReferences_stmt[10] = m_origin->prepareStatement(SQL_GET_REFERENCES_NONE_SOME_NONE_SOME); + m_getReferences_stmt[11] = m_origin->prepareStatement(SQL_GET_REFERENCES_SOME_SOME_NONE_SOME); + m_getReferences_stmt[12] = m_origin->prepareStatement(SQL_GET_REFERENCES_NONE_NONE_SOME_SOME); + m_getReferences_stmt[13] = m_origin->prepareStatement(SQL_GET_REFERENCES_SOME_NONE_SOME_SOME); + m_getReferences_stmt[14] = m_origin->prepareStatement(SQL_GET_REFERENCES_NONE_SOME_SOME_SOME); + m_getReferences_stmt[15] = m_origin->prepareStatement(SQL_GET_REFERENCES_SOME_SOME_SOME_SOME); } void DatabaseMetaData::init_getPrivs_stmt () { rtl::OUStringBuffer sSQL(300); - sSQL.append( ASCII_STR( + sSQL.append( " SELECT dp.TABLE_CAT, dp.TABLE_SCHEM, dp.TABLE_NAME, dp.GRANTOR, pr.rolname AS GRANTEE, dp.privilege, dp.is_grantable " " FROM (" " SELECT table_catalog AS TABLE_CAT, table_schema AS TABLE_SCHEM, table_name," " grantor, grantee, privilege_type AS PRIVILEGE, is_grantable" - " FROM information_schema.table_privileges") ); + " FROM information_schema.table_privileges"); if ( PQserverVersion( m_pSettings->pConnection ) < 90200 ) // information_schema.table_privileges does not fill in default ACLs when no ACL // assume default ACL is "owner has all privileges" and add it - sSQL.append( ASCII_STR( + sSQL.append( " UNION " " SELECT current_database() AS TABLE_CAT, pn.nspname AS TABLE_SCHEM, c.relname AS TABLE_NAME," " ro.rolname AS GRANTOR, rg.rolname AS GRANTEE, p.privilege, 'YES' AS is_grantable" @@ -2092,24 +2084,24 @@ void DatabaseMetaData::init_getPrivs_stmt () " ) AS rg (oid, rolname)," " pg_catalog.pg_namespace pn" " WHERE c.relkind IN ('r', 'v') AND c.relacl IS NULL AND pg_has_role(rg.oid, c.relowner, 'USAGE')" - " AND c.relowner=ro.oid AND c.relnamespace = pn.oid") ); - sSQL.append( ASCII_STR( + " AND c.relowner=ro.oid AND c.relnamespace = pn.oid"); + sSQL.append( " ) dp," " (SELECT oid, rolname FROM pg_catalog.pg_roles UNION ALL VALUES (0, 'PUBLIC')) pr" " WHERE table_schem LIKE ? AND table_name LIKE ? AND (dp.grantee = 'PUBLIC' OR pg_has_role(pr.oid, dp.grantee, 'USAGE'))" - " ORDER BY table_schem, table_name, privilege" ) ); + " ORDER BY table_schem, table_name, privilege" ); m_getTablePrivs_stmt = m_origin->prepareStatement( sSQL.makeStringAndClear() ); - sSQL.append( ASCII_STR( + sSQL.append( " SELECT dp.TABLE_CAT, dp.TABLE_SCHEM, dp.TABLE_NAME, dp.COLUMN_NAME, dp.GRANTOR, pr.rolname AS GRANTEE, dp.PRIVILEGE, dp.IS_GRANTABLE FROM (" " SELECT table_catalog AS TABLE_CAT, table_schema AS TABLE_SCHEM, table_name, column_name," " grantor, grantee, privilege_type AS PRIVILEGE, is_grantable" - " FROM information_schema.column_privileges") ); + " FROM information_schema.column_privileges"); if ( PQserverVersion( m_pSettings->pConnection ) < 90200 ) // information_schema.table_privileges does not fill in default ACLs when no ACL // assume default ACL is "owner has all privileges" and add it - sSQL.append( ASCII_STR( + sSQL.append( " UNION " " SELECT current_database() AS TABLE_CAT, pn.nspname AS TABLE_SCHEM, c.relname AS TABLE_NAME, a.attname AS column_name," " ro.rolname AS GRANTOR, rg.rolname AS GRANTEE, p.privilege, 'YES' AS is_grantable" @@ -2122,12 +2114,12 @@ void DatabaseMetaData::init_getPrivs_stmt () " ) AS rg (oid, rolname)," " pg_catalog.pg_namespace pn" " WHERE c.relkind IN ('r', 'v') AND c.relacl IS NULL AND pg_has_role(rg.oid, c.relowner, 'USAGE')" - " AND c.relowner=ro.oid AND c.relnamespace = pn.oid AND a.attrelid = c.oid AND a.attnum > 0") ); - sSQL.append( ASCII_STR( + " AND c.relowner=ro.oid AND c.relnamespace = pn.oid AND a.attrelid = c.oid AND a.attnum > 0"); + sSQL.append( " ) dp," " (SELECT oid, rolname FROM pg_catalog.pg_roles UNION ALL VALUES (0, 'PUBLIC')) pr" " WHERE table_schem = ? AND table_name = ? AND column_name LIKE ? AND (dp.grantee = 'PUBLIC' OR pg_has_role(pr.oid, dp.grantee, 'USAGE'))" - " ORDER BY column_name, privilege" ) ); + " ORDER BY column_name, privilege" ); m_getColumnPrivs_stmt = m_origin->prepareStatement( sSQL.makeStringAndClear() ); } @@ -2327,12 +2319,12 @@ static void pgTypeInfo2ResultSet( // in postgresql the upper limit is optional, no limit means unlimited // length (=1GB). precision = 0x40000000; // about 1 GB, see character type docs in postgresql - row[CREATE_PARAMS] <<= ASCII_STR( "length" ); + row[CREATE_PARAMS] <<= OUString("length"); } else if( dataType == com::sun::star::sdbc::DataType::NUMERIC ) { precision = 1000; - row[CREATE_PARAMS] <<= ASCII_STR( "length, scale" ); + row[CREATE_PARAMS] <<= OUString("length, scale"); } row[TYPE_NAME] <<= xRow->getString(1); @@ -2344,15 +2336,15 @@ static void pgTypeInfo2ResultSet( row[NULLABLE] <<= OUString::valueOf(nullable); row[CASE_SENSITIVE] <<= OUString::valueOf((sal_Int32)1); row[SEARCHABLE] <<= OUString::valueOf( calcSearchable( dataType ) ); - row[UNSIGNED_ATTRIBUTE] <<= ASCII_STR( "0" ); // + row[UNSIGNED_ATTRIBUTE] <<= OUString("0"); // if( com::sun::star::sdbc::DataType::INTEGER == dataType || com::sun::star::sdbc::DataType::BIGINT == dataType ) - row[AUTO_INCREMENT] <<= ASCII_STR( "1" ); // TODO + row[AUTO_INCREMENT] <<= OUString("1"); // TODO else - row[AUTO_INCREMENT] <<= ASCII_STR( "0" ); // TODO - row[MINIMUM_SCALE] <<= ASCII_STR( "0" ); // TODO: what is this ? + row[AUTO_INCREMENT] <<= OUString("0"); // TODO + row[MINIMUM_SCALE] <<= OUString("0"); // TODO: what is this ? row[MAXIMUM_SCALE] <<= OUString::valueOf( getMaxScale( dataType ) ); - row[NUM_PREC_RADIX] <<= ASCII_STR( "10" ); // TODO: what is this ? + row[NUM_PREC_RADIX] <<= OUString("10"); // TODO: what is this ? (void)FIXED_PREC_SCALE; vec.push_back( row ); } @@ -2374,7 +2366,6 @@ static void pgTypeInfo2ResultSet( Reference< XStatement > statement = m_origin->createStatement(); Reference< XResultSet > rs = statement->executeQuery( - ASCII_STR( "SELECT pg_type.typname AS typname," //1 "pg_type.typtype AS typtype," //2 "pg_type.typlen AS typlen," //3 @@ -2383,21 +2374,20 @@ static void pgTypeInfo2ResultSet( "FROM pg_type " "WHERE pg_type.typtype = 'b' " "OR pg_type.typtype = 'p'" - ) ); + ); SequenceAnyVector vec; pgTypeInfo2ResultSet( vec, rs ); // check for domain types rs = statement->executeQuery( - ASCII_STR( "SELECT t1.typname as typname," "t2.typtype AS typtype," "t2.typlen AS typlen," "t2.typnotnull AS typnotnull," "t2.typname as realtypname " "FROM pg_type as t1 LEFT JOIN pg_type AS t2 ON t1.typbasetype=t2.oid " - "WHERE t1.typtype = 'd'" ) ); + "WHERE t1.typtype = 'd'" ); pgTypeInfo2ResultSet( vec, rs ); std::sort( vec.begin(), vec.end(), TypeInfoByDataTypeSorter() ); @@ -2485,7 +2475,6 @@ static sal_Int32 seqContains( const Sequence< sal_Int32 > &seq, sal_Int32 value static const sal_Int32 R_COLUMN_NAME = 8; Reference< XPreparedStatement > stmt = m_origin->prepareStatement( - ASCII_STR( "SELECT nspname, " // 1 "pg_class.relname, " // 2 "class2.relname, " // 3 @@ -2496,7 +2485,7 @@ static sal_Int32 seqContains( const Sequence< sal_Int32 > &seq, sal_Int32 value "FROM pg_index INNER JOIN pg_class ON indrelid = pg_class.oid " "INNER JOIN pg_namespace ON pg_class.relnamespace = pg_namespace.oid " "INNER JOIN pg_class as class2 ON pg_index.indexrelid = class2.oid " - "WHERE nspname = ? AND pg_class.relname = ?" ) ); + "WHERE nspname = ? AND pg_class.relname = ?" ); Reference< XParameters > param ( stmt, UNO_QUERY_THROW ); param->setString( 1, schema ); @@ -2509,12 +2498,11 @@ static sal_Int32 seqContains( const Sequence< sal_Int32 > &seq, sal_Int32 value { Sequence< sal_Int32 > columns = parseIntArray( xRow->getString(C_COLUMNS) ); Reference< XPreparedStatement > columnsStmt = m_origin->prepareStatement( - ASCII_STR( "SELECT attnum, attname " "FROM pg_attribute " " INNER JOIN pg_class ON attrelid = pg_class.oid " " INNER JOIN pg_namespace ON pg_class.relnamespace=pg_namespace.oid " - " WHERE pg_namespace.nspname=? AND pg_class.relname=?" ) ); + " WHERE pg_namespace.nspname=? AND pg_class.relname=?" ); Reference< XParameters > paramColumn ( columnsStmt, UNO_QUERY_THROW ); OUString currentSchema = xRow->getString( C_SCHEMA ); OUString currentTable = xRow->getString( C_TABLENAME ); diff --git a/connectivity/source/drivers/postgresql/pq_driver.cxx b/connectivity/source/drivers/postgresql/pq_driver.cxx index 78289f3fdff1..10bdfe44b8bd 100644 --- a/connectivity/source/drivers/postgresql/pq_driver.cxx +++ b/connectivity/source/drivers/postgresql/pq_driver.cxx @@ -95,7 +95,6 @@ using com::sun::star::sdbcx::XTablesSupplier; namespace pq_sdbc_driver { -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) OUString DriverGetImplementationName() { diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx index ecd333f834bb..3cc66654e686 100644 --- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx +++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx @@ -116,7 +116,6 @@ using com::sun::star::beans::XPropertySet; using com::sun::star::beans::XMultiPropertySet; using com::sun::star::beans::XFastPropertySet; -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) namespace pq_sdbc_driver { static ::cppu::IPropertyArrayHelper & getPreparedStatementPropertyArrayHelper() @@ -258,7 +257,7 @@ void PreparedStatement::checkClosed() throw (SQLException, RuntimeException ) { if( ! m_pSettings || ! m_pSettings->pConnection ) throw SQLException( - ASCII_STR("pq_driver: PreparedStatement or connection has already been closed !" ), + "pq_driver: PreparedStatement or connection has already been closed !", *this, OUString(),1,Any()); } @@ -612,7 +611,7 @@ void PreparedStatement::setBytes( if( ! escapedString ) { throw SQLException( - ASCII_STR("pq_preparedstatement.setBytes: Error during converting bytesequence to an SQL conform string" ), + "pq_preparedstatement.setBytes: Error during converting bytesequence to an SQL conform string", *this, OUString(), 1, Any() ); } buf.append( (const sal_Char *)escapedString, len -1 ); @@ -649,7 +648,7 @@ void PreparedStatement::setBinaryStream( { (void) parameterIndex; (void)x; (void) length; throw SQLException( - ASCII_STR( "pq_preparedstatement: setBinaryStream not implemented" ), + "pq_preparedstatement: setBinaryStream not implemented", *this, OUString(), 1, Any () ); } @@ -661,7 +660,7 @@ void PreparedStatement::setCharacterStream( { (void) parameterIndex; (void)x; (void) length; throw SQLException( - ASCII_STR( "pq_preparedstatement: setCharacterStream not implemented" ), + "pq_preparedstatement: setCharacterStream not implemented", *this, OUString(), 1, Any () ); } @@ -671,7 +670,7 @@ void PreparedStatement::setObject( sal_Int32 parameterIndex, const Any& x ) if( ! implSetObject( this, parameterIndex, x )) { OUStringBuffer buf; - buf.append( ASCII_STR("pq_preparedstatement::setObject: can't convert value of type " ) ); + buf.append( "pq_preparedstatement::setObject: can't convert value of type " ); buf.append( x.getValueTypeName() ); throw SQLException( buf.makeStringAndClear(), *this, OUString(), 1, Any () ); } @@ -706,9 +705,9 @@ void PreparedStatement::setObjectWithInfo( else { OUStringBuffer buf; - buf.append( ASCII_STR("pq_preparedstatement::setObjectWithInfo: can't convert value of type " ) ); + buf.append( "pq_preparedstatement::setObjectWithInfo: can't convert value of type " ); buf.append( x.getValueTypeName() ); - buf.append( ASCII_STR(" to type DECIMAL or NUMERIC" ) ); + buf.append( " to type DECIMAL or NUMERIC" ); throw SQLException( buf.makeStringAndClear(), *this, OUString(), 1, Any () ); } } @@ -726,7 +725,7 @@ void PreparedStatement::setRef( { (void) parameterIndex; (void)x; throw SQLException( - ASCII_STR( "pq_preparedstatement: setRef not implemented" ), + "pq_preparedstatement: setRef not implemented", *this, OUString(), 1, Any () ); } @@ -737,7 +736,7 @@ void PreparedStatement::setBlob( { (void) parameterIndex; (void)x; throw SQLException( - ASCII_STR( "pq_preparedstatement: setBlob not implemented" ), + "pq_preparedstatement: setBlob not implemented", *this, OUString(), 1, Any () ); } @@ -748,7 +747,7 @@ void PreparedStatement::setClob( { (void) parameterIndex; (void)x; throw SQLException( - ASCII_STR( "pq_preparedstatement: setClob not implemented" ), + "pq_preparedstatement: setClob not implemented", *this, OUString(), 1, Any () ); } diff --git a/connectivity/source/drivers/postgresql/pq_resultset.cxx b/connectivity/source/drivers/postgresql/pq_resultset.cxx index 3fbc6d47337d..f80be22611e5 100644 --- a/connectivity/source/drivers/postgresql/pq_resultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_resultset.cxx @@ -80,20 +80,19 @@ using com::sun::star::sdbc::XResultSetMetaData; namespace pq_sdbc_driver { -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) void ResultSet::checkClosed() throw ( com::sun::star::sdbc::SQLException, com::sun::star::uno::RuntimeException ) { if( ! m_result ) { - throw SQLException( ASCII_STR( "pq_resultset: already closed" ), + throw SQLException( "pq_resultset: already closed", *this, OUString(), 1, Any() ); } if( ! m_ppSettings || ! *m_ppSettings || ! (*m_ppSettings)->pConnection ) { - throw SQLException( ASCII_STR( "pq_resultset: statement has been closed already" ), + throw SQLException( "pq_resultset: statement has been closed already", *this, OUString(), 1, Any() ); } diff --git a/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx b/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx index 7f778258f4a7..f9fb5f1f949f 100644 --- a/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx @@ -70,7 +70,6 @@ using com::sun::star::uno::Any; namespace pq_sdbc_driver { -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) void SequenceResultSet::checkClosed() throw ( com::sun::star::sdbc::SQLException, @@ -121,11 +120,11 @@ Reference< XResultSetMetaData > SAL_CALL SequenceResultSet::getMetaData( ) { // Oh no, not again throw ::com::sun::star::sdbc::SQLException( - ASCII_STR( "pq_sequenceresultset: no meta supported " ), *this, + "pq_sequenceresultset: no meta supported ", *this, // I did not find "IM001" in a specific standard, // but it seems to be used by other systems (such as ODBC) // and some parts of LibreOffice special-case it. - OUString( ASCII_STR("IM001") ), 1, Any() ); + OUString( "IM001" ), 1, Any() ); } return m_meta; } diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx index 7304b153bbe8..f5cdbe6af389 100644 --- a/connectivity/source/drivers/postgresql/pq_statement.cxx +++ b/connectivity/source/drivers/postgresql/pq_statement.cxx @@ -132,7 +132,6 @@ using com::sun::star::container::XEnumerationAccess; using com::sun::star::container::XEnumeration; using com::sun::star::container::XIndexAccess; -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) namespace pq_sdbc_driver { static ::cppu::IPropertyArrayHelper & getStatementPropertyArrayHelper() @@ -208,7 +207,7 @@ void Statement::checkClosed() throw (SQLException, RuntimeException ) { if( ! m_pSettings || ! m_pSettings->pConnection ) throw SQLException( - ASCII_STR("pq_driver: Statement or connection has already been closed !" ), + "pq_driver: Statement or connection has already been closed !", *this, OUString(),1,Any()); } @@ -707,13 +706,12 @@ static Sequence< OUString > getPrimaryKeyColumnNames( // retrieve the primary key ... Reference< XPreparedStatement > stmt = connection->prepareStatement( - ASCII_STR( "SELECT conkey " // 7 "FROM pg_constraint INNER JOIN pg_class ON conrelid = pg_class.oid " "INNER JOIN pg_namespace ON pg_class.relnamespace = pg_namespace.oid " "LEFT JOIN pg_class AS class2 ON confrelid = class2.oid " "LEFT JOIN pg_namespace AS nmsp2 ON class2.relnamespace=nmsp2.oid " - "WHERE pg_class.relname = ? AND pg_namespace.nspname = ? AND pg_constraint.contype='p'" ) ); + "WHERE pg_class.relname = ? AND pg_namespace.nspname = ? AND pg_constraint.contype='p'" ); DisposeGuard guard( stmt ); Reference< XParameters > paras( stmt, UNO_QUERY ); paras->setString( 1 , tableName ); @@ -735,7 +733,7 @@ static void getAutoValues( const OUString & tableName ) { Reference< XPreparedStatement > stmt = connection->prepareStatement( - ASCII_STR("SELECT pg_attribute.attname, pg_attrdef.adsrc " + "SELECT pg_attribute.attname, pg_attrdef.adsrc " "FROM pg_class, pg_namespace, pg_attribute " "LEFT JOIN pg_attrdef ON pg_attribute.attrelid = pg_attrdef.adrelid AND " "pg_attribute.attnum = pg_attrdef.adnum " @@ -746,7 +744,7 @@ static void getAutoValues( // Most probably gives problems if tableName contains '%' "pg_class.relname LIKE ? AND " "pg_attrdef.adsrc != ''" - ) ); + ); DisposeGuard guard( stmt ); Reference< XParameters > paras( stmt, UNO_QUERY ); paras->setString( 1 , schemaName ); diff --git a/connectivity/source/drivers/postgresql/pq_statics.cxx b/connectivity/source/drivers/postgresql/pq_statics.cxx index 639643afefb6..07bff82827c9 100644 --- a/connectivity/source/drivers/postgresql/pq_statics.cxx +++ b/connectivity/source/drivers/postgresql/pq_statics.cxx @@ -90,7 +90,6 @@ struct DefColumnMetaData sal_Bool isSigned; }; -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) struct BaseTypeDef { const char * typeName; sal_Int32 value; }; static Sequence< OUString > createStringSequence( const char * names[] ) @@ -154,71 +153,71 @@ Statics & getStatics() if( ! p ) { static Statics statics ; - statics.SYSTEM_TABLE = ASCII_STR( "SYSTEM TABLE" ); - statics.TABLE = ASCII_STR( "TABLE" ); - statics.VIEW = ASCII_STR( "VIEW" ); - statics.UNKNOWN = ASCII_STR( "UNKNOWN" ); - statics.YES = ASCII_STR( "YES" ); - statics.NO = ASCII_STR( "NO" ); - statics.NO_NULLS = ASCII_STR( "NO_NULLS" ); - statics.NULABLE = ASCII_STR( "NULABLE" ); - statics.NULLABLE_UNKNOWN = ASCII_STR( "NULLABLE_UNKNOWN" ); - statics.cPERCENT = ASCII_STR( "%" ); - - statics.TYPE = ASCII_STR( "Type" ); - statics.TYPE_NAME = ASCII_STR( "TypeName" ); - statics.NAME = ASCII_STR( "Name" ); - statics.SCHEMA_NAME = ASCII_STR( "SchemaName" ); - statics.CATALOG_NAME = ASCII_STR( "CatalogName" ); - statics.DESCRIPTION = ASCII_STR( "Description" ); - statics.PRIVILEGES = ASCII_STR( "Privileges" ); - - statics.DEFAULT_VALUE = ASCII_STR( "DefaultValue" ); - statics.IS_AUTO_INCREMENT = ASCII_STR( "IsAutoIncrement" ); - statics.IS_CURRENCY = ASCII_STR( "IsCurrency" ); - statics.IS_NULLABLE = ASCII_STR( "IsNullable" ); - statics.IS_ROW_VERSISON = ASCII_STR( "IsRowVersion" ); - statics.PRECISION = ASCII_STR( "Precision" ); - statics.SCALE = ASCII_STR( "Scale" ); - - statics.cPERCENT = ASCII_STR( "%" ); - statics.BEGIN = ASCII_STR( "BEGIN" ); - statics.COMMIT = ASCII_STR( "COMMIT" ); - statics.ROLLBACK = ASCII_STR( "ROLLBACK" ); - - statics.KEY = ASCII_STR( "Key" ); - statics.REFERENCED_TABLE = ASCII_STR( "ReferencedTable" ); - statics.UPDATE_RULE = ASCII_STR( "UpdateRule" ); - statics.DELETE_RULE = ASCII_STR( "DeleteRule" ); - statics.PRIVATE_COLUMNS = ASCII_STR( "PrivateColumns" ); - statics.PRIVATE_FOREIGN_COLUMNS = ASCII_STR( "PrivateForeignColumns" ); - - statics.KEY_COLUMN = ASCII_STR( "KeyColumn" ); - statics.RELATED_COLUMN = ASCII_STR( "RelatedColumn" ); - statics.PASSWORD = ASCII_STR( "Password" ); - statics.USER = ASCII_STR( "User" ); - - statics.CURSOR_NAME = ASCII_STR( "CursorName" ); - statics.ESCAPE_PROCESSING = ASCII_STR( "EscapeProcessing" ); - statics.FETCH_DIRECTION = ASCII_STR( "FetchDirection" ); - statics.FETCH_SIZE = ASCII_STR( "FetchSize" ); - statics.IS_BOOKMARKABLE = ASCII_STR( "IsBookmarkable" ); - statics.RESULT_SET_CONCURRENCY = ASCII_STR( "ResultSetConcurrency" ); - statics.RESULT_SET_TYPE = ASCII_STR( "ResultSetType" ); - - statics.COMMAND = ASCII_STR( "Command" ); - statics.CHECK_OPTION = ASCII_STR( "CheckOption" ); - - statics.TRUE = ASCII_STR( "t" ); - statics.FALSE = ASCII_STR( "f" ); - statics.IS_PRIMARY_KEY_INDEX = ASCII_STR( "IsPrimaryKeyIndex" ); - statics.IS_CLUSTERED = ASCII_STR( "IsClustered" ); - statics.IS_UNIQUE = ASCII_STR( "IsUnique" ); - statics.IS_ASCENDING = ASCII_STR( "IsAscending" ); - statics.PRIVATE_COLUMN_INDEXES = ASCII_STR( "PrivateColumnIndexes" ); - statics.HELP_TEXT = ASCII_STR( "HelpText" ); - - statics.CATALOG = ASCII_STR( "Catalog" ); + statics.SYSTEM_TABLE = "SYSTEM TABLE"; + statics.TABLE = "TABLE"; + statics.VIEW = "VIEW"; + statics.UNKNOWN = "UNKNOWN"; + statics.YES = "YES"; + statics.NO = "NO"; + statics.NO_NULLS = "NO_NULLS"; + statics.NULABLE = "NULABLE"; + statics.NULLABLE_UNKNOWN = "NULLABLE_UNKNOWN"; + statics.cPERCENT = "%"; + + statics.TYPE = "Type"; + statics.TYPE_NAME = "TypeName"; + statics.NAME = "Name"; + statics.SCHEMA_NAME = "SchemaName"; + statics.CATALOG_NAME = "CatalogName"; + statics.DESCRIPTION = "Description"; + statics.PRIVILEGES = "Privileges"; + + statics.DEFAULT_VALUE = "DefaultValue"; + statics.IS_AUTO_INCREMENT = "IsAutoIncrement"; + statics.IS_CURRENCY = "IsCurrency"; + statics.IS_NULLABLE = "IsNullable"; + statics.IS_ROW_VERSISON = "IsRowVersion"; + statics.PRECISION = "Precision"; + statics.SCALE = "Scale"; + + statics.cPERCENT = "%"; + statics.BEGIN = "BEGIN"; + statics.COMMIT = "COMMIT"; + statics.ROLLBACK = "ROLLBACK"; + + statics.KEY = "Key"; + statics.REFERENCED_TABLE = "ReferencedTable"; + statics.UPDATE_RULE = "UpdateRule"; + statics.DELETE_RULE = "DeleteRule"; + statics.PRIVATE_COLUMNS = "PrivateColumns"; + statics.PRIVATE_FOREIGN_COLUMNS = "PrivateForeignColumns"; + + statics.KEY_COLUMN = "KeyColumn"; + statics.RELATED_COLUMN = "RelatedColumn"; + statics.PASSWORD = "Password"; + statics.USER = "User"; + + statics.CURSOR_NAME = "CursorName"; + statics.ESCAPE_PROCESSING = "EscapeProcessing"; + statics.FETCH_DIRECTION = "FetchDirection"; + statics.FETCH_SIZE = "FetchSize"; + statics.IS_BOOKMARKABLE = "IsBookmarkable"; + statics.RESULT_SET_CONCURRENCY = "ResultSetConcurrency"; + statics.RESULT_SET_TYPE = "ResultSetType"; + + statics.COMMAND = "Command"; + statics.CHECK_OPTION = "CheckOption"; + + statics.TRUE = "t"; + statics.FALSE = "f"; + statics.IS_PRIMARY_KEY_INDEX = "IsPrimaryKeyIndex"; + statics.IS_CLUSTERED = "IsClustered"; + statics.IS_UNIQUE = "IsUnique"; + statics.IS_ASCENDING = "IsAscending"; + statics.PRIVATE_COLUMN_INDEXES = "PrivateColumnIndexes"; + statics.HELP_TEXT = "HelpText"; + + statics.CATALOG = "Catalog"; Type tString = getCppuType( (rtl::OUString *) 0 ); Type tInt = getCppuType( (sal_Int32 * ) 0 ); @@ -227,9 +226,9 @@ Statics & getStatics() // Table props set ImplementationStatics &ist = statics.refl.table; - ist.implName = ASCII_STR( "org.openoffice.comp.pq.sdbcx.Table" ); + ist.implName = "org.openoffice.comp.pq.sdbcx.Table"; ist.serviceNames = Sequence< OUString > ( 1 ); - ist.serviceNames[0] = ASCII_STR( "com.sun.star.sdbcx.Table" ); + ist.serviceNames[0] = "com.sun.star.sdbcx.Table"; PropertyDef tableDef[] = { PropertyDef( statics.CATALOG_NAME , tString ), @@ -243,10 +242,10 @@ Statics & getStatics() tableDef, sizeof(tableDef)/sizeof(PropertyDef), READONLY ); statics.refl.tableDescriptor.implName = - ASCII_STR( "org.openoffice.comp.pq.sdbcx.TableDescriptor" ); + "org.openoffice.comp.pq.sdbcx.TableDescriptor"; statics.refl.tableDescriptor.serviceNames = Sequence< OUString > (1); statics.refl.tableDescriptor.serviceNames[0] = - ASCII_STR( "com.sun.star.sdbcx.TableDescriptor" ); + "com.sun.star.sdbcx.TableDescriptor"; PropertyDef tableDescDef[] = { PropertyDef( statics.CATALOG_NAME , tString ), @@ -259,9 +258,9 @@ Statics & getStatics() tableDescDef, sizeof(tableDescDef)/sizeof(PropertyDef), 0 ); // Column props set - statics.refl.column.implName = ASCII_STR( "org.openoffice.comp.pq.sdbcx.Column" ); + statics.refl.column.implName = "org.openoffice.comp.pq.sdbcx.Column"; statics.refl.column.serviceNames = Sequence< OUString > ( 1 ); - statics.refl.column.serviceNames[0] = ASCII_STR( "com.sun.star.sdbcx.Column" ); + statics.refl.column.serviceNames[0] = "com.sun.star.sdbcx.Column"; PropertyDefEx columnDef[] = { PropertyDefEx( statics.CATALOG_NAME , tString, READONLY ), @@ -282,10 +281,10 @@ Statics & getStatics() columnDef, sizeof(columnDef)/sizeof(PropertyDefEx) ); statics.refl.columnDescriptor.implName = - ASCII_STR( "org.openoffice.comp.pq.sdbcx.ColumnDescriptor" ); + "org.openoffice.comp.pq.sdbcx.ColumnDescriptor"; statics.refl.columnDescriptor.serviceNames = Sequence< OUString > ( 1 ); statics.refl.columnDescriptor.serviceNames[0] = - ASCII_STR( "com.sun.star.sdbcx.ColumnDescriptor" ); + "com.sun.star.sdbcx.ColumnDescriptor"; PropertyDef columnDescDef[] = { PropertyDef( statics.CATALOG_NAME , tString ), @@ -307,9 +306,9 @@ Statics & getStatics() columnDescDef, sizeof(columnDescDef)/sizeof(PropertyDef), 0 ); // Key properties - statics.refl.key.implName = ASCII_STR( "org.openoffice.comp.pq.sdbcx.Key" ); + statics.refl.key.implName = "org.openoffice.comp.pq.sdbcx.Key"; statics.refl.key.serviceNames = Sequence< OUString > ( 1 ); - statics.refl.key.serviceNames[0] = ASCII_STR( "com.sun.star.sdbcx.Key" ); + statics.refl.key.serviceNames[0] = "com.sun.star.sdbcx.Key"; PropertyDef keyDef[] = { PropertyDef( statics.DELETE_RULE, tInt ), @@ -326,10 +325,10 @@ Statics & getStatics() // Key properties statics.refl.keyDescriptor.implName = - ASCII_STR( "org.openoffice.comp.pq.sdbcx.KeyDescriptor" ); + "org.openoffice.comp.pq.sdbcx.KeyDescriptor"; statics.refl.keyDescriptor.serviceNames = Sequence< OUString > ( 1 ); statics.refl.keyDescriptor.serviceNames[0] = - ASCII_STR( "com.sun.star.sdbcx.KeyDescriptor" ); + "com.sun.star.sdbcx.KeyDescriptor"; PropertyDef keyDescDef[] = { PropertyDef( statics.DELETE_RULE, tInt ), @@ -344,9 +343,9 @@ Statics & getStatics() // KeyColumn props set - statics.refl.keycolumn.implName = ASCII_STR( "org.openoffice.comp.pq.sdbcx.KeyColumn" ); + statics.refl.keycolumn.implName = "org.openoffice.comp.pq.sdbcx.KeyColumn"; statics.refl.keycolumn.serviceNames = Sequence< OUString > ( 1 ); - statics.refl.keycolumn.serviceNames[0] = ASCII_STR( "com.sun.star.sdbcx.KeyColumn" ); + statics.refl.keycolumn.serviceNames[0] = "com.sun.star.sdbcx.KeyColumn"; PropertyDef keycolumnDef[] = { PropertyDef( statics.CATALOG_NAME , tString ), @@ -368,10 +367,10 @@ Statics & getStatics() // KeyColumn props set statics.refl.keycolumnDescriptor.implName = - ASCII_STR( "org.openoffice.comp.pq.sdbcx.KeyColumnDescriptor" ); + "org.openoffice.comp.pq.sdbcx.KeyColumnDescriptor"; statics.refl.keycolumnDescriptor.serviceNames = Sequence< OUString > ( 1 ); statics.refl.keycolumnDescriptor.serviceNames[0] = - ASCII_STR( "com.sun.star.sdbcx.KeyColumnDescriptor" ); + "com.sun.star.sdbcx.KeyColumnDescriptor"; PropertyDef keycolumnDescDef[] = { PropertyDef( statics.NAME , tString ), @@ -381,9 +380,9 @@ Statics & getStatics() keycolumnDescDef, sizeof(keycolumnDescDef)/sizeof(PropertyDef), 0 ); // view props set - statics.refl.view.implName = ASCII_STR( "org.openoffice.comp.pq.sdbcx.View"); + statics.refl.view.implName = "org.openoffice.comp.pq.sdbcx.View"; statics.refl.view.serviceNames = Sequence< OUString > ( 1 ); - statics.refl.view.serviceNames[0] = ASCII_STR( "com.sun.star.sdbcx.View" ); + statics.refl.view.serviceNames[0] = "com.sun.star.sdbcx.View"; PropertyDef viewDef[] = { PropertyDef( statics.CATALOG_NAME , tString ), @@ -396,15 +395,15 @@ Statics & getStatics() viewDef, sizeof(viewDef)/sizeof(PropertyDef), READONLY ); // view props set - statics.refl.viewDescriptor.implName = ASCII_STR( "org.openoffice.comp.pq.sdbcx.ViewDescriptor"); + statics.refl.viewDescriptor.implName = "org.openoffice.comp.pq.sdbcx.ViewDescriptor"; statics.refl.viewDescriptor.serviceNames = Sequence< OUString > ( 1 ); - statics.refl.viewDescriptor.serviceNames[0] = ASCII_STR( "com.sun.star.sdbcx.ViewDescriptor" ); + statics.refl.viewDescriptor.serviceNames[0] = "com.sun.star.sdbcx.ViewDescriptor"; statics.refl.viewDescriptor.pProps = createPropertyArrayHelper( viewDef, sizeof(viewDef)/sizeof(PropertyDef), 0 ); // reuse view, as it is identical // user props set - statics.refl.user.implName = ASCII_STR( "org.openoffice.comp.pq.sdbcx.User"); + statics.refl.user.implName = "org.openoffice.comp.pq.sdbcx.User"; statics.refl.user.serviceNames = Sequence< OUString > ( 1 ); - statics.refl.user.serviceNames[0] = ASCII_STR( "com.sun.star.sdbcx.User" ); + statics.refl.user.serviceNames[0] = "com.sun.star.sdbcx.User"; PropertyDef userDefRO[] = { PropertyDef( statics.NAME , tString ) @@ -414,10 +413,10 @@ Statics & getStatics() // user props set statics.refl.userDescriptor.implName = - ASCII_STR( "org.openoffice.comp.pq.sdbcx.UserDescriptor"); + "org.openoffice.comp.pq.sdbcx.UserDescriptor"; statics.refl.userDescriptor.serviceNames = Sequence< OUString > ( 1 ); statics.refl.userDescriptor.serviceNames[0] = - ASCII_STR( "com.sun.star.sdbcx.UserDescriptor" ); + "com.sun.star.sdbcx.UserDescriptor"; PropertyDef userDefWR[] = { PropertyDef( statics.NAME , tString ), @@ -427,9 +426,9 @@ Statics & getStatics() userDefWR, sizeof(userDefWR)/sizeof(PropertyDef), 0 ); // index props set - statics.refl.index.implName = ASCII_STR( "org.openoffice.comp.pq.sdbcx.Index"); + statics.refl.index.implName = "org.openoffice.comp.pq.sdbcx.Index"; statics.refl.index.serviceNames = Sequence< OUString > ( 1 ); - statics.refl.index.serviceNames[0] = ASCII_STR( "com.sun.star.sdbcx.Index" ); + statics.refl.index.serviceNames[0] = "com.sun.star.sdbcx.Index"; PropertyDef indexDef[] = { PropertyDef( statics.CATALOG , tString ), @@ -444,17 +443,17 @@ Statics & getStatics() // index props set statics.refl.indexDescriptor.implName = - ASCII_STR( "org.openoffice.comp.pq.sdbcx.IndexDescriptor"); + "org.openoffice.comp.pq.sdbcx.IndexDescriptor"; statics.refl.indexDescriptor.serviceNames = Sequence< OUString > ( 1 ); statics.refl.indexDescriptor.serviceNames[0] = - ASCII_STR( "com.sun.star.sdbcx.IndexDescriptor" ); + "com.sun.star.sdbcx.IndexDescriptor"; statics.refl.indexDescriptor.pProps = createPropertyArrayHelper( indexDef, sizeof(indexDef)/sizeof(PropertyDef), 0 ); // indexColumn props set - statics.refl.indexColumn.implName = ASCII_STR( "org.openoffice.comp.pq.sdbcx.IndexColumn"); + statics.refl.indexColumn.implName = "org.openoffice.comp.pq.sdbcx.IndexColumn"; statics.refl.indexColumn.serviceNames = Sequence< OUString > ( 1 ); - statics.refl.indexColumn.serviceNames[0] = ASCII_STR("com.sun.star.sdbcx.IndexColumn"); + statics.refl.indexColumn.serviceNames[0] = "com.sun.star.sdbcx.IndexColumn"; PropertyDef indexColumnDef[] = { PropertyDef( statics.CATALOG_NAME , tString ), @@ -476,10 +475,10 @@ Statics & getStatics() // indexColumn props set statics.refl.indexColumnDescriptor.implName = - ASCII_STR( "org.openoffice.comp.pq.sdbcx.IndexColumnDescriptor"); + "org.openoffice.comp.pq.sdbcx.IndexColumnDescriptor"; statics.refl.indexColumnDescriptor.serviceNames = Sequence< OUString > ( 1 ); statics.refl.indexColumnDescriptor.serviceNames[0] = - ASCII_STR("com.sun.star.sdbcx.IndexColumnDescriptor"); + "com.sun.star.sdbcx.IndexColumnDescriptor"; PropertyDef indexColumnDescDef[] = { PropertyDef( statics.IS_ASCENDING, tBool ), @@ -489,9 +488,9 @@ Statics & getStatics() indexColumnDescDef, sizeof(indexColumnDescDef)/sizeof(PropertyDef), 0 ); // resultset - statics.refl.resultSet.implName = ASCII_STR( "org.openoffice.comp.pq.ResultSet"); + statics.refl.resultSet.implName = "org.openoffice.comp.pq.ResultSet"; statics.refl.resultSet.serviceNames = Sequence< OUString > ( 1 ); - statics.refl.resultSet.serviceNames[0] = ASCII_STR( "com.sun.star.sdbc.ResultSet" ); + statics.refl.resultSet.serviceNames[0] = "com.sun.star.sdbc.ResultSet"; statics.refl.resultSet.types = UpdateableResultSet::getStaticTypes( false /* updateable */ ); PropertyDef resultSet[] = { @@ -507,45 +506,45 @@ Statics & getStatics() resultSet, sizeof(resultSet)/sizeof(PropertyDef), 0 ); // updateableResultset - statics.refl.updateableResultSet.implName = ASCII_STR( "org.openoffice.comp.pq.UpdateableResultSet"); + statics.refl.updateableResultSet.implName = "org.openoffice.comp.pq.UpdateableResultSet"; statics.refl.updateableResultSet.serviceNames = Sequence< OUString > ( 1 ); - statics.refl.updateableResultSet.serviceNames[0] = ASCII_STR( "com.sun.star.sdbc.ResultSet" ); + statics.refl.updateableResultSet.serviceNames[0] = "com.sun.star.sdbc.ResultSet"; statics.refl.updateableResultSet.types = UpdateableResultSet::getStaticTypes( true /* updateable */ ); statics.refl.updateableResultSet.pProps = createPropertyArrayHelper( resultSet, sizeof(resultSet)/sizeof(PropertyDef), 0 ); // databasemetadata statics.tablesRowNames = Sequence< OUString > ( 5 ); - statics.tablesRowNames[TABLE_INDEX_CATALOG] = ASCII_STR( "TABLE_CAT" ); - statics.tablesRowNames[TABLE_INDEX_SCHEMA] = ASCII_STR( "TABLE_SCHEM" ); - statics.tablesRowNames[TABLE_INDEX_NAME] = ASCII_STR( "TABLE_NAME" ); - statics.tablesRowNames[TABLE_INDEX_TYPE] = ASCII_STR( "TABLE_TYPE" ); - statics.tablesRowNames[TABLE_INDEX_REMARKS] = ASCII_STR( "REMARKS" ); + statics.tablesRowNames[TABLE_INDEX_CATALOG] = "TABLE_CAT"; + statics.tablesRowNames[TABLE_INDEX_SCHEMA] = "TABLE_SCHEM"; + statics.tablesRowNames[TABLE_INDEX_NAME] = "TABLE_NAME"; + statics.tablesRowNames[TABLE_INDEX_TYPE] = "TABLE_TYPE"; + statics.tablesRowNames[TABLE_INDEX_REMARKS] = "REMARKS"; statics.primaryKeyNames = Sequence< OUString > ( 6 ); - statics.primaryKeyNames[0] = ASCII_STR( "TABLE_CAT" ); - statics.primaryKeyNames[1] = ASCII_STR( "TABLE_SCHEM" ); - statics.primaryKeyNames[2] = ASCII_STR( "TABLE_NAME" ); - statics.primaryKeyNames[3] = ASCII_STR( "COLUMN_NAME" ); - statics.primaryKeyNames[4] = ASCII_STR( "KEY_SEQ" ); - statics.primaryKeyNames[5] = ASCII_STR( "PK_NAME" ); - - statics.SELECT = ASCII_STR( "SELECT" ); - statics.UPDATE = ASCII_STR( "UPDATE" ); - statics.INSERT = ASCII_STR( "INSERT" ); - statics.DELETE = ASCII_STR( "DELETE" ); - statics.RULE = ASCII_STR( "RULE" ); - statics.REFERENCES = ASCII_STR( "REFERENCES" ); - statics.TRIGGER = ASCII_STR( "TRIGGER" ); - statics.EXECUTE = ASCII_STR( "EXECUTE" ); - statics.USAGE = ASCII_STR( "USAGE" ); - statics.CREATE = ASCII_STR( "CREATE" ); - statics.TEMPORARY = ASCII_STR( "TEMPORARY" ); - statics.INDEX = ASCII_STR( "Index" ); - statics.INDEX_COLUMN = ASCII_STR( "IndexColumn" ); + statics.primaryKeyNames[0] = "TABLE_CAT"; + statics.primaryKeyNames[1] = "TABLE_SCHEM"; + statics.primaryKeyNames[2] = "TABLE_NAME"; + statics.primaryKeyNames[3] = "COLUMN_NAME"; + statics.primaryKeyNames[4] = "KEY_SEQ"; + statics.primaryKeyNames[5] = "PK_NAME"; + + statics.SELECT = "SELECT"; + statics.UPDATE = "UPDATE"; + statics.INSERT = "INSERT"; + statics.DELETE = "DELETE"; + statics.RULE = "RULE"; + statics.REFERENCES = "REFERENCES"; + statics.TRIGGER = "TRIGGER"; + statics.EXECUTE = "EXECUTE"; + statics.USAGE = "USAGE"; + statics.CREATE = "CREATE"; + statics.TEMPORARY = "TEMPORARY"; + statics.INDEX = "Index"; + statics.INDEX_COLUMN = "IndexColumn"; statics.schemaNames = Sequence< OUString > ( 1 ); - statics.schemaNames[0] = ASCII_STR( "TABLE_SCHEM" ); + statics.schemaNames[0] = "TABLE_SCHEM"; statics.tableTypeData = Sequence< Sequence< Any > >( 2 ); @@ -559,7 +558,7 @@ Statics & getStatics() statics.tableTypeData[1][0] <<= statics.SYSTEM_TABLE; statics.tableTypeNames = Sequence< OUString > ( 1 ); - statics.tableTypeNames[0] = ASCII_STR( "TABLE_TYPE" ); + statics.tableTypeNames[0] = "TABLE_TYPE"; static const char *tablePrivilegesNames[] = { diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index 84d97417ab54..7e6340f9a711 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -106,7 +106,6 @@ using com::sun::star::container::XEnumerationAccess; namespace pq_sdbc_driver { -#define ASCII_STR(x) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) rtl::OUString date2String( const com::sun::star::util::Date & x ) { @@ -381,7 +380,7 @@ Reference< XConnection > extractConnectionFromStatement( const Reference< XInter ret = myowner->getConnection(); if( ! ret.is() ) throw SQLException( - ASCII_STR( "PQSDBC: Couldn't retrieve connection from statement" ), + "PQSDBC: Couldn't retrieve connection from statement", Reference< XInterface > () , rtl::OUString(), 0 , com::sun::star::uno::Any() ); } @@ -842,11 +841,11 @@ void fillAttnum2attnameMap( const rtl::OUString &table ) { Reference< XPreparedStatement > prep = conn->prepareStatement( - ASCII_STR( "SELECT attname,attnum " + "SELECT attname,attnum " "FROM pg_attribute " "INNER JOIN pg_class ON attrelid = pg_class.oid " "INNER JOIN pg_namespace ON pg_class.relnamespace = pg_namespace.oid " - "WHERE relname=? AND nspname=?" ) ); + "WHERE relname=? AND nspname=?" ); Reference< XParameters > paras( prep, UNO_QUERY_THROW ); paras->setString( 1 , table ); diff --git a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx index 3db0337c7498..ac8b50dba318 100644 --- a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx @@ -100,8 +100,6 @@ using com::sun::star::beans::XFastPropertySet; using com::sun::star::beans::XPropertySet; using com::sun::star::beans::XMultiPropertySet; -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) - namespace pq_sdbc_driver { @@ -237,7 +235,7 @@ void UpdateableResultSet::insertRow( ) throw (SQLException, RuntimeException) } if( ! m_insertRow ) throw SQLException( - ASCII_STR("pq_resultset.insertRow: moveToInsertRow has not been called !" ), + "pq_resultset.insertRow: moveToInsertRow has not been called !", *this, OUString(), 1, Any() ); OUStringBuffer buf( 128 ); @@ -331,7 +329,7 @@ void UpdateableResultSet::updateRow( ) throw (SQLException, RuntimeException) } if( m_insertRow ) throw SQLException( - ASCII_STR("pq_resultset.updateRow: moveToCurrentRow has not been called !" ), + "pq_resultset.updateRow: moveToCurrentRow has not been called !", *this, OUString(), 1, Any() ); OUStringBuffer buf( 128 ); @@ -380,7 +378,7 @@ void UpdateableResultSet::deleteRow( ) throw (SQLException, RuntimeException) } if( m_insertRow ) throw SQLException( - ASCII_STR("pq_resultset.deleteRow: deleteRow cannot be called when on insert row !" ), + "pq_resultset.deleteRow: deleteRow cannot be called when on insert row !", *this, OUString(), 1, Any() ); if( m_row < 0 || m_row >= m_rowCount ) @@ -529,7 +527,7 @@ void UpdateableResultSet::updateBytes( sal_Int32 columnIndex, const ::com::sun:: if( ! escapedString ) { throw SQLException( - ASCII_STR("pq_preparedstatement.setBytes: Error during converting bytesequence to an SQL conform string" ), + "pq_preparedstatement.setBytes: Error during converting bytesequence to an SQL conform string", *this, OUString(), 1, Any() ); } // buf.append( (const sal_Char *)escapedString, len -1 ); diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx index e0bd4adfec72..acde1ad88e34 100644 --- a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx +++ b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx @@ -103,7 +103,6 @@ using com::sun::star::sdbc::SQLException; namespace pq_sdbc_driver { -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) static Any isCurrency( const rtl::OUString & typeName ) { @@ -142,7 +141,7 @@ Columns::Columns( ConnectionSettings *pSettings, const rtl::OUString &schemaName, const rtl::OUString &tableName) - : Container( refMutex, origin, pSettings, ASCII_STR( "COLUMN" ) ), + : Container( refMutex, origin, pSettings, "COLUMN" ), m_schemaName( schemaName ), m_tableName( tableName ) {} @@ -421,7 +420,7 @@ void alterColumnByDescriptor( if( pastTypeName != futureTypeName ) { throw RuntimeException( - ASCII_STR( "Can't modify column types, drop the column and create a new one" ), + "Can't modify column types, drop the column and create a new one", Reference< XInterface > () ); } @@ -599,7 +598,7 @@ ColumnDescriptors::ColumnDescriptors( const ::rtl::Reference< RefCountedMutex > & refMutex, const ::com::sun::star::uno::Reference< com::sun::star::sdbc::XConnection > & origin, ConnectionSettings *pSettings ) - : Container( refMutex, origin, pSettings, ASCII_STR( "COLUMN-DESCRIPTOR" ) ) + : Container( refMutex, origin, pSettings, "COLUMN-DESCRIPTOR" ) {} diff --git a/connectivity/source/drivers/postgresql/pq_xcontainer.cxx b/connectivity/source/drivers/postgresql/pq_xcontainer.cxx index a93a6c51b1b8..c88bdeb2079b 100644 --- a/connectivity/source/drivers/postgresql/pq_xcontainer.cxx +++ b/connectivity/source/drivers/postgresql/pq_xcontainer.cxx @@ -103,8 +103,6 @@ using com::sun::star::sdbcx::XDataDescriptorFactory; namespace pq_sdbc_driver { -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) - class ReplacedBroadcaster : public EventBroadcastHelper { @@ -296,7 +294,7 @@ com::sun::star::uno::Any ContainerEnumeration::nextElement() if( ! hasMoreElements() ) { throw NoSuchElementException( - ASCII_STR( "NoSuchElementException during enumeration" ), *this ); + "NoSuchElementException during enumeration", *this ); } m_index ++; return m_vec[m_index]; diff --git a/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx index 403b9206f5e2..8f8e68df6683 100644 --- a/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx +++ b/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx @@ -102,7 +102,6 @@ using com::sun::star::sdbc::SQLException; namespace pq_sdbc_driver { -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) IndexColumns::IndexColumns( const ::rtl::Reference< RefCountedMutex > & refMutex, @@ -112,7 +111,7 @@ IndexColumns::IndexColumns( const rtl::OUString &tableName, const rtl::OUString &indexName, const com::sun::star::uno::Sequence< rtl::OUString > &columns ) - : Container( refMutex, origin, pSettings, ASCII_STR( "INDEX_COLUMN" ) ), + : Container( refMutex, origin, pSettings, "INDEX_COLUMN" ), m_schemaName( schemaName ), m_tableName( tableName ), m_indexName( indexName ), @@ -195,7 +194,7 @@ void IndexColumns::appendByDescriptor( { OUString name = extractStringProperty( future, getStatics().NAME ); throw com::sun::star::sdbc::SQLException( - ASCII_STR( "SDBC-POSTGRESQL: IndexesColumns.appendByDescriptor not yet implemented" ), + "SDBC-POSTGRESQL: IndexesColumns.appendByDescriptor not yet implemented", *this, OUString(), 1, Any() ); // osl::MutexGuard guard( m_refMutex->mutex ); // Statics & st = getStatics(); @@ -213,7 +212,7 @@ void IndexColumns::dropByName( const ::rtl::OUString& elementName ) { (void) elementName; throw com::sun::star::sdbc::SQLException( - ASCII_STR( "SDBC-POSTGRESQL: IndexesColumns.dropByName not yet implemented" ), + "SDBC-POSTGRESQL: IndexesColumns.dropByName not yet implemented", *this, OUString(), 1, Any() ); // String2IntMap::const_iterator ii = m_name2index.find( elementName ); // if( ii == m_name2index.end() ) @@ -239,7 +238,7 @@ void IndexColumns::dropByIndex( sal_Int32 index ) { (void) index; throw com::sun::star::sdbc::SQLException( - ASCII_STR( "SDBC-POSTGRESQL: IndexesColumns.dropByIndex not yet implemented" ), + "SDBC-POSTGRESQL: IndexesColumns.dropByIndex not yet implemented", *this, OUString(), 1, Any() ); // osl::MutexGuard guard( m_refMutex->mutex ); // if( index < 0 || index >= m_values.getLength() ) diff --git a/connectivity/source/drivers/postgresql/pq_xindexes.cxx b/connectivity/source/drivers/postgresql/pq_xindexes.cxx index 523bc65d255c..96a1079d4f52 100644 --- a/connectivity/source/drivers/postgresql/pq_xindexes.cxx +++ b/connectivity/source/drivers/postgresql/pq_xindexes.cxx @@ -103,7 +103,6 @@ using com::sun::star::sdbc::XDatabaseMetaData; namespace pq_sdbc_driver { -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) Indexes::Indexes( const ::rtl::Reference< RefCountedMutex > & refMutex, @@ -143,7 +142,6 @@ void Indexes::refresh() // see XDatabaseMetaData::getIndexInfo() Reference< XPreparedStatement > stmt = m_origin->prepareStatement( - ASCII_STR( "SELECT nspname, " // 1 "pg_class.relname, " // 2 "class2.relname, " // 3 @@ -154,7 +152,7 @@ void Indexes::refresh() "FROM pg_index INNER JOIN pg_class ON indrelid = pg_class.oid " "INNER JOIN pg_namespace ON pg_class.relnamespace = pg_namespace.oid " "INNER JOIN pg_class as class2 ON pg_index.indexrelid = class2.oid " - "WHERE nspname = ? AND pg_class.relname = ?" ) ); + "WHERE nspname = ? AND pg_class.relname = ?" ); Reference< XParameters > params( stmt, UNO_QUERY); params->setString( 1, m_schemaName ); diff --git a/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx b/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx index bbee0fa3b1c6..c6db5f5e2c47 100644 --- a/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx +++ b/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx @@ -100,7 +100,6 @@ using com::sun::star::sdbc::SQLException; namespace pq_sdbc_driver { -#define ASCII_STR(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) KeyColumns::KeyColumns( const ::rtl::Reference< RefCountedMutex > & refMutex, @@ -110,7 +109,7 @@ KeyColumns::KeyColumns( const rtl::OUString &tableName, const Sequence< rtl::OUString > &columnNames, const Sequence< rtl::OUString > &foreignColumnNames ) - : Container( refMutex, origin, pSettings, ASCII_STR( "KEY_COLUMN" ) ), + : Container( refMutex, origin, pSettings, "KEY_COLUMN" ), m_schemaName( schemaName ), m_tableName( tableName ), m_columnNames( columnNames ), @@ -242,7 +241,7 @@ void KeyColumns::refresh() // if( pastTypeName != futureTypeName ) // { // throw RuntimeException( -// ASCII_STR( "Can't modify column types, drop the column and create a new one" ), +// "Can't modify column types, drop the column and create a new one", // Reference< XInterface > () ); // } @@ -318,7 +317,7 @@ void KeyColumns::appendByDescriptor( { (void) future; throw com::sun::star::sdbc::SQLException( - ASCII_STR( "KeyColumns::appendByDescriptor not implemented yet" ), + "KeyColumns::appendByDescriptor not implemented yet", *this, OUString(), 1, Any() ); // osl::MutexGuard guard( m_refMutex->mutex ); @@ -338,7 +337,7 @@ void KeyColumns::dropByIndex( sal_Int32 index ) { (void) index; throw com::sun::star::sdbc::SQLException( - ASCII_STR( "KeyColumns::dropByIndex not implemented yet" ), + "KeyColumns::dropByIndex not implemented yet", *this, OUString(), 1, Any() ); // osl::MutexGuard guard( m_refMutex->mutex ); // if( index < 0 || index >= m_values.getLength() ) @@ -399,7 +398,7 @@ KeyColumnDescriptors::KeyColumnDescriptors( const ::rtl::Reference< RefCountedMutex > & refMutex, const ::com::sun::star::uno::Reference< com::sun::star::sdbc::XConnection > & origin, ConnectionSettings *pSettings ) - : Container( refMutex, origin, pSettings, ASCII_STR( "KEY_COLUMN" ) ) + : Container( refMutex, origin, pSettings, "KEY_COLUMN" ) {} Reference< ::com::sun::star::beans::XPropertySet > KeyColumnDescriptors::createDataDescriptor() -- cgit