diff options
author | Jean-Noël Rouvignac <jn.rouvignac@gmail.com> | 2013-02-01 09:33:19 +0100 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-02-14 13:20:14 +0000 |
commit | 77fd448d0990adc79406e13a127b2b1834984b71 (patch) | |
tree | 3b8d1b23e7029dedcb97eb1d38ba83c91dfdac51 | |
parent | 5502501a8848c771aff5a77448a02451e22398a4 (diff) |
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 <tml@iki.fi>
Tested-by: Tor Lillqvist <tml@iki.fi>
92 files changed, 1015 insertions, 1112 deletions
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 // <b>TABLE_SCHEM</b> 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() diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index bf433d9d2d97..78463c94cb51 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -1397,8 +1397,8 @@ void SfxAcceleratorConfigPage::StartFileDialog( WinBits nBits, const String& rTi m_pFileDlg = new sfx2::FileDialogHelper( nDialogType, 0 ); m_pFileDlg->SetTitle( rTitle ); - m_pFileDlg->AddFilter( aFilterAllStr, DEFINE_CONST_UNICODE( FILEDIALOG_FILTER_ALL ) ); - m_pFileDlg->AddFilter( aFilterCfgStr, DEFINE_CONST_UNICODE( "*.cfg" ) ); + m_pFileDlg->AddFilter( aFilterAllStr, OUString(FILEDIALOG_FILTER_ALL) ); + m_pFileDlg->AddFilter( aFilterCfgStr, OUString("*.cfg") ); Link aDlgClosedLink = bSave ? LINK( this, SfxAcceleratorConfigPage, SaveHdl ) : LINK( this, SfxAcceleratorConfigPage, LoadHdl ); diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index f7ed15fb5470..b594b2e4d866 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -968,7 +968,7 @@ void TPGalleryThemeProperties::FillFilterList() #if defined(WNT) if ( aExtensions.Len() > 240 ) - aExtensions = DEFINE_CONST_UNICODE( "*.*" ); + aExtensions = "*.*"; #endif pFilterEntry = new FilterEntry; diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx index d26f4de54b6b..f01e3e835583 100644 --- a/desktop/source/app/check_ext_deps.cxx +++ b/desktop/source/app/check_ext_deps.cxx @@ -59,8 +59,6 @@ using rtl::OUString; using namespace desktop; using namespace com::sun::star; -#define UNISTRING(s) OUString(s) - namespace { //For use with XExtensionManager.synchronize @@ -219,14 +217,14 @@ static const char aAccessSrvc[] = "com.sun.star.configuration.ConfigurationUpdat static sal_Int16 impl_showExtensionDialog( uno::Reference< uno::XComponentContext > &xContext ) { - rtl::OUString sServiceName = UNISTRING("com.sun.star.deployment.ui.UpdateRequiredDialog"); + rtl::OUString sServiceName = "com.sun.star.deployment.ui.UpdateRequiredDialog"; uno::Reference< uno::XInterface > xService; sal_Int16 nRet = 0; uno::Reference< lang::XMultiComponentFactory > xServiceManager( xContext->getServiceManager() ); if( !xServiceManager.is() ) throw uno::RuntimeException( - UNISTRING( "impl_showExtensionDialog(): unable to obtain service manager from component context" ), uno::Reference< uno::XInterface > () ); + "impl_showExtensionDialog(): unable to obtain service manager from component context", uno::Reference< uno::XInterface > () ); xService = xServiceManager->createInstanceWithContext( sServiceName, xContext ); uno::Reference< ui::dialogs::XExecutableDialog > xExecuteable( xService, uno::UNO_QUERY ); @@ -346,8 +344,8 @@ static void impl_setNeedsCompatCheck() static bool impl_needsCompatCheck() { bool bNeedsCheck = false; - rtl::OUString aLastCheckBuildID; - rtl::OUString aCurrentBuildID( UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}" ) ); + OUString aLastCheckBuildID; + OUString aCurrentBuildID( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}" ); rtl::Bootstrap::expandMacros( aCurrentBuildID ); try { diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx index ad2b3acb3e75..ad57db85fa1b 100644 --- a/extensions/source/update/check/download.cxx +++ b/extensions/source/update/check/download.cxx @@ -41,8 +41,6 @@ namespace container = com::sun::star::container ; namespace lang = com::sun::star::lang ; namespace uno = com::sun::star::uno ; -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - struct OutData { @@ -188,37 +186,37 @@ Download::getProxyForURL(const rtl::OUString& rURL, rtl::OString& rHost, sal_Int com::sun::star::configuration::theDefaultProvider::get( m_xContext ) ); beans::PropertyValue aProperty; - aProperty.Name = UNISTRING( "nodepath" ); - aProperty.Value = uno::makeAny( UNISTRING("org.openoffice.Inet/Settings") ); + aProperty.Name = "nodepath"; + aProperty.Value = uno::makeAny( OUString("org.openoffice.Inet/Settings") ); uno::Sequence< uno::Any > aArgumentList( 1 ); aArgumentList[0] = uno::makeAny( aProperty ); uno::Reference< container::XNameAccess > xNameAccess( xConfigProvider->createInstanceWithArguments( - UNISTRING("com.sun.star.configuration.ConfigurationAccess"), aArgumentList ), + "com.sun.star.configuration.ConfigurationAccess", aArgumentList ), uno::UNO_QUERY_THROW ); - OSL_ASSERT(xNameAccess->hasByName(UNISTRING("ooInetProxyType"))); - uno::Any aValue = xNameAccess->getByName(UNISTRING("ooInetProxyType")); + OSL_ASSERT(xNameAccess->hasByName("ooInetProxyType")); + uno::Any aValue = xNameAccess->getByName("ooInetProxyType"); sal_Int32 nProxyType = aValue.get< sal_Int32 >(); if( 0 != nProxyType ) // type 0 means "direct connection to the internet { if( rURL.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("http:")) ) { - rHost = getStringValue(xNameAccess, UNISTRING("ooInetHTTPProxyName")); - rPort = getInt32Value(xNameAccess, UNISTRING("ooInetHTTPProxyPort")); + rHost = getStringValue(xNameAccess, "ooInetHTTPProxyName"); + rPort = getInt32Value(xNameAccess, "ooInetHTTPProxyPort"); } else if( rURL.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("https:")) ) { - rHost = getStringValue(xNameAccess, UNISTRING("ooInetHTTPSProxyName")); - rPort = getInt32Value(xNameAccess, UNISTRING("ooInetHTTPSProxyPort")); + rHost = getStringValue(xNameAccess, "ooInetHTTPSProxyName"); + rPort = getInt32Value(xNameAccess, "ooInetHTTPSProxyPort"); } else if( rURL.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("ftp:")) ) { - rHost = getStringValue(xNameAccess, UNISTRING("ooInetFTPProxyName")); - rPort = getInt32Value(xNameAccess, UNISTRING("ooInetFTPProxyPort")); + rHost = getStringValue(xNameAccess, "ooInetFTPProxyName"); + rPort = getInt32Value(xNameAccess, "ooInetFTPProxyPort"); } } } diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index 540b98ee8045..cea6ec74fa7a 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -62,16 +62,14 @@ namespace c3s = com::sun::star::system ; namespace task = com::sun::star::task ; namespace uno = com::sun::star::uno ; -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - -#define PROPERTY_TITLE UNISTRING("BubbleHeading") -#define PROPERTY_TEXT UNISTRING("BubbleText") -#define PROPERTY_IMAGE UNISTRING("BubbleImageURL") -#define PROPERTY_SHOW_BUBBLE UNISTRING("BubbleVisible") -#define PROPERTY_CLICK_HDL UNISTRING("MenuClickHDL") -#define PROPERTY_DEFAULT_TITLE UNISTRING("DefaultHeading") -#define PROPERTY_DEFAULT_TEXT UNISTRING("DefaultText") -#define PROPERTY_SHOW_MENUICON UNISTRING("MenuIconVisible") +#define PROPERTY_TITLE "BubbleHeading" +#define PROPERTY_TEXT "BubbleText" +#define PROPERTY_IMAGE "BubbleImageURL" +#define PROPERTY_SHOW_BUBBLE "BubbleVisible" +#define PROPERTY_CLICK_HDL "MenuClickHDL" +#define PROPERTY_DEFAULT_TITLE "DefaultHeading" +#define PROPERTY_DEFAULT_TEXT "DefaultText" +#define PROPERTY_SHOW_MENUICON "MenuIconVisible" extern "C" bool SAL_CALL WNT_hasInternetConnection(); //------------------------------------------------------------------------------ @@ -103,7 +101,7 @@ namespace static inline rtl::OUString getBuildId() { - rtl::OUString aPathVal(UNISTRING("${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}")); + OUString aPathVal("${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}"); rtl::Bootstrap::expandMacros(aPathVal); return aPathVal; } @@ -111,7 +109,7 @@ static inline rtl::OUString getBuildId() //------------------------------------------------------------------------------ static inline rtl::OUString getBaseInstallation() { - rtl::OUString aPathVal(UNISTRING("$BRAND_BASE_DIR")); + rtl::OUString aPathVal("$BRAND_BASE_DIR"); rtl::Bootstrap::expandMacros(aPathVal); return aPathVal; } @@ -136,7 +134,7 @@ rtl::OUString getImageFromFileName(const rtl::OUString& aFile) if ( lastIndex > 0 ) { aUnpackPath = aUnpackPath.copy( 0, lastIndex+1 ); - aUnpackPath += UNISTRING( "unpack_update" ); + aUnpackPath += "unpack_update"; } oslFileHandle hOut = NULL; @@ -208,16 +206,16 @@ static uno::Reference< beans::XPropertySet > createMenuBarUI( { if( !xContext.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheckJob: empty component context" ), uno::Reference< uno::XInterface > () ); + "UpdateCheckJob: empty component context", uno::Reference< uno::XInterface > () ); uno::Reference< lang::XMultiComponentFactory > xServiceManager(xContext->getServiceManager()); if( !xServiceManager.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheckJob: unable to obtain service manager from component context" ), uno::Reference< uno::XInterface > () ); + "UpdateCheckJob: unable to obtain service manager from component context", uno::Reference< uno::XInterface > () ); uno::Reference< beans::XPropertySet > xMenuBarUI = uno::Reference< beans::XPropertySet > ( - xServiceManager->createInstanceWithContext( UNISTRING( "com.sun.star.setup.UpdateCheckUI" ), xContext ), + xServiceManager->createInstanceWithContext( "com.sun.star.setup.UpdateCheckUI", xContext ), uno::UNO_QUERY_THROW); xMenuBarUI->setPropertyValue( PROPERTY_CLICK_HDL, uno::makeAny( xJob ) ); @@ -716,7 +714,7 @@ ShutdownThread::run() // Tell QuickStarter not to veto .. uno::Reference< beans::XFastPropertySet > xQuickStarter( - UpdateCheck::createService(UNISTRING("com.sun.star.office.Quickstart"), m_xContext), + UpdateCheck::createService("com.sun.star.office.Quickstart", m_xContext), uno::UNO_QUERY ); @@ -924,7 +922,7 @@ UpdateCheck::install() if( !aParameter.isEmpty() ) osl::FileBase::getSystemPathFromFileURL(aParameter, aParameter); - aParameter += UNISTRING(" &"); + aParameter += " &"; #endif rtl::Reference< UpdateCheckConfig > rModel = UpdateCheckConfig::get( m_xContext ); @@ -1483,13 +1481,13 @@ bool UpdateCheck::storeReleaseNote(sal_Int8 nNum, const rtl::OUString &rURL) { osl::FileBase::RC rc; - rtl::OUString aTargetDir( UpdateCheckConfig::getAllUsersDirectory() + UNISTRING( "/sun" ) ); + rtl::OUString aTargetDir( UpdateCheckConfig::getAllUsersDirectory() + "/sun" ); rc = osl::Directory::createPath( aTargetDir ); - rtl::OUString aFileName = UNISTRING("releasenote") + + rtl::OUString aFileName = "releasenote" + rtl::OUString::valueOf( (sal_Int32) nNum ) + - UNISTRING(".url"); + ".url"; rtl::OUString aFilePath; rc = osl::FileBase::getAbsoluteFileURL( aTargetDir, aFileName, aFilePath ); @@ -1513,7 +1511,7 @@ UpdateCheck::storeReleaseNote(sal_Int8 nNum, const rtl::OUString &rURL) #ifdef WNT rc = aFile.write( aLineBuf.getStr(), aLineBuf.getLength(), nWritten ); if ( rc != osl::FileBase::E_None ) return false; - aURL = UNISTRING("URL=") + rURL; + aURL = "URL=" + rURL; #endif aLineBuf = rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ); rc = aFile.write( aLineBuf.getStr(), aLineBuf.getLength(), nWritten ); @@ -1526,18 +1524,18 @@ UpdateCheck::storeReleaseNote(sal_Int8 nNum, const rtl::OUString &rURL) //------------------------------------------------------------------------------ void UpdateCheck::showExtensionDialog() { - rtl::OUString sServiceName = UNISTRING("com.sun.star.deployment.ui.PackageManagerDialog"); - rtl::OUString sArguments = UNISTRING("SHOW_UPDATE_DIALOG"); + rtl::OUString sServiceName = "com.sun.star.deployment.ui.PackageManagerDialog"; + rtl::OUString sArguments = "SHOW_UPDATE_DIALOG"; uno::Reference< uno::XInterface > xService; if( ! m_xContext.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheck::showExtensionDialog(): empty component context" ), uno::Reference< uno::XInterface > () ); + "UpdateCheck::showExtensionDialog(): empty component context", uno::Reference< uno::XInterface > () ); uno::Reference< lang::XMultiComponentFactory > xServiceManager( m_xContext->getServiceManager() ); if( !xServiceManager.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheck::showExtensionDialog(): unable to obtain service manager from component context" ), uno::Reference< uno::XInterface > () ); + "UpdateCheck::showExtensionDialog(): unable to obtain service manager from component context", uno::Reference< uno::XInterface > () ); xService = xServiceManager->createInstanceWithContext( sServiceName, m_xContext ); uno::Reference< task::XJobExecutor > xExecuteable( xService, uno::UNO_QUERY ); @@ -1581,14 +1579,14 @@ UpdateCheck::createService(const rtl::OUString& rServiceName, { if( !xContext.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheckConfig: empty component context" ), + "UpdateCheckConfig: empty component context", uno::Reference< uno::XInterface >() ); const uno::Reference< lang::XMultiComponentFactory > xServiceManager(xContext->getServiceManager()); if( !xServiceManager.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheckConfig: unable to obtain service manager from component context" ), + "UpdateCheckConfig: unable to obtain service manager from component context", uno::Reference< uno::XInterface >() ); return xServiceManager->createInstanceWithContext(rServiceName, xContext); diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx index 9ad538be2a7f..554cf0d0e6db 100644 --- a/extensions/source/update/check/updatecheckconfig.cxx +++ b/extensions/source/update/check/updatecheckconfig.cxx @@ -45,8 +45,6 @@ namespace lang = com::sun::star::lang ; namespace util = com::sun::star::util ; namespace uno = com::sun::star::uno ; -#define UNISTRING(s) rtl::OUString(s) - #define LAST_CHECK "LastCheck" #define VERSION_FOUND "UpdateVersionFound" #define UPDATE_VERSION "UpdateVersion" @@ -64,7 +62,7 @@ namespace uno = com::sun::star::uno ; #define DOWNLOAD_DESTINATION "DownloadDestination" #define RELEASE_NOTE "ReleaseNote" -#define PROPERTY_VERSION UNISTRING("Version") +#define PROPERTY_VERSION "Version" static const sal_Char * const aUpdateEntryProperties[] = { UPDATE_VERSION, @@ -259,24 +257,24 @@ UpdateCheckConfig::get( com::sun::star::configuration::theDefaultProvider::get( xContext ) ); beans::PropertyValue aProperty; - aProperty.Name = UNISTRING( "nodepath" ); - aProperty.Value = uno::makeAny( UNISTRING("org.openoffice.Office.Jobs/Jobs/UpdateCheck/Arguments") ); + aProperty.Name = "nodepath"; + aProperty.Value = uno::makeAny( OUString("org.openoffice.Office.Jobs/Jobs/UpdateCheck/Arguments") ); uno::Sequence< uno::Any > aArgumentList( 1 ); aArgumentList[0] = uno::makeAny( aProperty ); uno::Reference< container::XNameContainer > xContainer( xConfigProvider->createInstanceWithArguments( - UNISTRING("com.sun.star.configuration.ConfigurationUpdateAccess"), aArgumentList ), + "com.sun.star.configuration.ConfigurationUpdateAccess", aArgumentList ), uno::UNO_QUERY_THROW ); - aProperty.Value = uno::makeAny( UNISTRING("/org.openoffice.Office.ExtensionManager/ExtensionUpdateData/IgnoredUpdates") ); + aProperty.Value = uno::makeAny( OUString("/org.openoffice.Office.ExtensionManager/ExtensionUpdateData/IgnoredUpdates") ); aArgumentList[0] = uno::makeAny( aProperty ); - uno::Reference< container::XNameContainer > xIgnoredExt( xConfigProvider->createInstanceWithArguments( UNISTRING("com.sun.star.configuration.ConfigurationUpdateAccess"), aArgumentList ), uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameContainer > xIgnoredExt( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", aArgumentList ), uno::UNO_QUERY_THROW ); - aProperty.Value = uno::makeAny( UNISTRING("/org.openoffice.Office.ExtensionManager/ExtensionUpdateData/AvailableUpdates") ); + aProperty.Value = uno::makeAny( OUString("/org.openoffice.Office.ExtensionManager/ExtensionUpdateData/AvailableUpdates") ); aArgumentList[0] = uno::makeAny( aProperty ); - uno::Reference< container::XNameContainer > xUpdateAvail( xConfigProvider->createInstanceWithArguments( UNISTRING("com.sun.star.configuration.ConfigurationUpdateAccess"), aArgumentList ), uno::UNO_QUERY_THROW ); + uno::Reference< container::XNameContainer > xUpdateAvail( xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", aArgumentList ), uno::UNO_QUERY_THROW ); return new UpdateCheckConfig( xContainer, xUpdateAvail, xIgnoredExt, rListener ); } @@ -287,7 +285,7 @@ bool UpdateCheckConfig::isAutoCheckEnabled() const { sal_Bool nValue = sal_False; - const_cast < UpdateCheckConfig *> (this)->getByName( UNISTRING( AUTOCHECK_ENABLED ) ) >>= nValue; + const_cast < UpdateCheckConfig *> (this)->getByName( AUTOCHECK_ENABLED ) >>= nValue; return nValue; } @@ -297,7 +295,7 @@ bool UpdateCheckConfig::isAutoDownloadEnabled() const { sal_Bool nValue = sal_False; - const_cast < UpdateCheckConfig *> (this)->getByName( UNISTRING( AUTODOWNLOAD_ENABLED ) ) >>= nValue; + const_cast < UpdateCheckConfig *> (this)->getByName( AUTODOWNLOAD_ENABLED ) >>= nValue; return nValue; } @@ -309,7 +307,7 @@ UpdateCheckConfig::getUpdateEntryVersion() const rtl::OUString aValue; // getByName is defined as non const in XNameAccess - const_cast < UpdateCheckConfig *> (this)->getByName( UNISTRING( OLD_VERSION ) ) >>= aValue; + const_cast < UpdateCheckConfig *> (this)->getByName( OLD_VERSION ) >>= aValue; return aValue; } @@ -322,7 +320,7 @@ UpdateCheckConfig::getLastChecked() const sal_Int64 nValue = 0; // getByName is defined as non const in XNameAccess - const_cast < UpdateCheckConfig *> (this)->getByName( UNISTRING( LAST_CHECK ) ) >>= nValue; + const_cast < UpdateCheckConfig *> (this)->getByName( LAST_CHECK ) >>= nValue; return nValue; } @@ -335,7 +333,7 @@ UpdateCheckConfig::getCheckInterval() const sal_Int64 nValue = 0; // getByName is defined as non const in XNameAccess - const_cast < UpdateCheckConfig *> (this)->getByName( UNISTRING( CHECK_INTERVAL ) ) >>= nValue; + const_cast < UpdateCheckConfig *> (this)->getByName( CHECK_INTERVAL ) >>= nValue; return nValue; } @@ -345,7 +343,7 @@ UpdateCheckConfig::getCheckInterval() const rtl::OUString UpdateCheckConfig::getLocalFileName() const { - rtl::OUString aName = UNISTRING(LOCAL_FILE); + rtl::OUString aName = LOCAL_FILE; rtl::OUString aRet; if( m_xContainer->hasByName(aName) ) @@ -359,8 +357,8 @@ UpdateCheckConfig::getLocalFileName() const rtl::OUString UpdateCheckConfig::getDownloadDestination() const { - rtl::OUString aName = UNISTRING(DOWNLOAD_DESTINATION); - rtl::OUString aRet; + OUString aName = DOWNLOAD_DESTINATION; + OUString aRet; const_cast <UpdateCheckConfig *> (this)->getByName(aName) >>= aRet; @@ -373,7 +371,7 @@ void UpdateCheckConfig::storeLocalFileName(const rtl::OUString& rLocalFileName, sal_Int64 nFileSize) { const sal_uInt8 nItems = 2; - const rtl::OUString aNameList[nItems] = { UNISTRING(LOCAL_FILE), UNISTRING(DOWNLOAD_SIZE) }; + const OUString aNameList[nItems] = { LOCAL_FILE, DOWNLOAD_SIZE }; const uno::Any aValueList[nItems] = { uno::makeAny(rLocalFileName), uno::makeAny(nFileSize) }; for( sal_uInt8 i=0; i < nItems; ++i ) @@ -393,7 +391,7 @@ void UpdateCheckConfig::clearLocalFileName() { const sal_uInt8 nItems = 2; - const rtl::OUString aNameList[nItems] = { UNISTRING(LOCAL_FILE), UNISTRING(DOWNLOAD_SIZE) }; + const OUString aNameList[nItems] = { LOCAL_FILE, DOWNLOAD_SIZE }; for( sal_uInt8 i=0; i < nItems; ++i ) { @@ -409,7 +407,7 @@ UpdateCheckConfig::clearLocalFileName() void UpdateCheckConfig::storeDownloadPaused(bool paused) { - replaceByName(UNISTRING(DOWNLOAD_PAUSED) , uno::makeAny(paused)); + replaceByName(DOWNLOAD_PAUSED , uno::makeAny(paused)); commitChanges(); } @@ -423,7 +421,7 @@ UpdateCheckConfig::updateLastChecked() sal_Int64 lastCheck = systime.Seconds; - replaceByName(UNISTRING(LAST_CHECK), uno::makeAny(lastCheck)); + replaceByName(LAST_CHECK, uno::makeAny(lastCheck)); } //------------------------------------------------------------------------------ @@ -498,7 +496,7 @@ uno::Sequence< rtl::OUString > UpdateCheckConfig::getServiceNames() { uno::Sequence< rtl::OUString > aServiceList(1); - aServiceList[0] = UNISTRING( "com.sun.star.setup.UpdateCheckConfig"); + aServiceList[0] = "com.sun.star.setup.UpdateCheckConfig"; return aServiceList; } @@ -507,7 +505,7 @@ UpdateCheckConfig::getServiceNames() rtl::OUString UpdateCheckConfig::getImplName() { - return UNISTRING( "vnd.sun.UpdateCheckConfig"); + return "vnd.sun.UpdateCheckConfig"; } //------------------------------------------------------------------------------ diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx index 1d33c7be2b6e..8b30e4d5d505 100644 --- a/extensions/source/update/check/updatecheckjob.cxx +++ b/extensions/source/update/check/updatecheckjob.cxx @@ -38,8 +38,6 @@ namespace lang = com::sun::star::lang ; namespace task = com::sun::star::task ; namespace uno = com::sun::star::uno ; -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - namespace { @@ -168,7 +166,7 @@ uno::Sequence< rtl::OUString > UpdateCheckJob::getServiceNames() { uno::Sequence< rtl::OUString > aServiceList(1); - aServiceList[0] = UNISTRING( "com.sun.star.setup.UpdateCheck"); + aServiceList[0] = "com.sun.star.setup.UpdateCheck"; return aServiceList; }; @@ -177,7 +175,7 @@ UpdateCheckJob::getServiceNames() rtl::OUString UpdateCheckJob::getImplName() { - return UNISTRING( "vnd.sun.UpdateCheck"); + return "vnd.sun.UpdateCheck"; } diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx index 98657d0c1216..4ed0a20f1b35 100644 --- a/extensions/source/update/check/updatehdl.cxx +++ b/extensions/source/update/check/updatehdl.cxx @@ -64,22 +64,20 @@ #include "updatehdl.hrc" #include <tools/urlobj.hxx> -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) +#define COMMAND_CLOSE "close" -#define COMMAND_CLOSE UNISTRING("close") +#define CTRL_THROBBER "throbber" +#define CTRL_PROGRESS "progress" -#define CTRL_THROBBER UNISTRING("throbber") -#define CTRL_PROGRESS UNISTRING("progress") +#define TEXT_STATUS "text_status" +#define TEXT_PERCENT "text_percent" +#define TEXT_DESCRIPTION "text_description" -#define TEXT_STATUS UNISTRING("text_status") -#define TEXT_PERCENT UNISTRING("text_percent") -#define TEXT_DESCRIPTION UNISTRING("text_description") - -#define FIXED_LINE_MODEL UNISTRING("com.sun.star.awt.UnoControlFixedLineModel") -#define FIXED_TEXT_MODEL UNISTRING("com.sun.star.awt.UnoControlFixedTextModel") -#define EDIT_FIELD_MODEL UNISTRING("com.sun.star.awt.UnoControlEditModel") -#define BUTTON_MODEL UNISTRING("com.sun.star.awt.UnoControlButtonModel") -#define GROUP_BOX_MODEL UNISTRING("com.sun.star.awt.UnoControlGroupBoxModel") +#define FIXED_LINE_MODEL "com.sun.star.awt.UnoControlFixedLineModel" +#define FIXED_TEXT_MODEL "com.sun.star.awt.UnoControlFixedTextModel" +#define EDIT_FIELD_MODEL "com.sun.star.awt.UnoControlEditModel" +#define BUTTON_MODEL "com.sun.star.awt.UnoControlButtonModel" +#define GROUP_BOX_MODEL "com.sun.star.awt.UnoControlGroupBoxModel" using namespace com::sun::star; @@ -132,7 +130,7 @@ void UpdateHandler::enableControls( short nCtrlState ) if ( ( nCurStateVal & 0x01 ) != ( nOldStateVal & 0x01 ) ) { bEnableControl = ( ( nCurStateVal & 0x01 ) == 0x01 ); - setControlProperty( msButtonIDs[i], UNISTRING("Enabled"), uno::Any( bEnableControl ) ); + setControlProperty( msButtonIDs[i], "Enabled", uno::Any( bEnableControl ) ); } } @@ -149,10 +147,10 @@ void UpdateHandler::setDownloadBtnLabel( bool bAppendDots ) rtl::OUString aLabel( msDownload ); if ( bAppendDots ) - aLabel += UNISTRING( "..." ); + aLabel += "..."; - setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], UNISTRING("Label"), uno::Any( aLabel ) ); - setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DOWNLOAD2 ) ) ); + setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "Label", uno::Any( aLabel ) ); + setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DOWNLOAD2 ) ) ); mbDownloadBtnHasDots = bAppendDots; } @@ -238,15 +236,15 @@ void UpdateHandler::setProgress( sal_Int32 nPercent ) osl::MutexGuard aGuard( maMutex ); mnPercent = nPercent; - setControlProperty( CTRL_PROGRESS, UNISTRING("ProgressValue"), uno::Any( nPercent ) ); - setControlProperty( TEXT_PERCENT, UNISTRING("Text"), uno::Any( substVariables(msPercent) ) ); + setControlProperty( CTRL_PROGRESS, "ProgressValue", uno::Any( nPercent ) ); + setControlProperty( TEXT_PERCENT, "Text", uno::Any( substVariables(msPercent) ) ); } } //-------------------------------------------------------------------- void UpdateHandler::setErrorMessage( const rtl::OUString& rErrorMsg ) { - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( rErrorMsg ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( rErrorMsg ) ); } //-------------------------------------------------------------------- @@ -434,12 +432,12 @@ void SAL_CALL UpdateHandler::handle( uno::Reference< task::XInteractionRequest > if ( !mxInteractionHdl.is() ) { if( !mxContext.is() ) - throw uno::RuntimeException( UNISTRING( "UpdateHandler:: empty component context" ), *this ); + throw uno::RuntimeException( "UpdateHandler:: empty component context", *this ); uno::Reference< lang::XMultiComponentFactory > xServiceManager(mxContext->getServiceManager()); if( !xServiceManager.is() ) - throw uno::RuntimeException( UNISTRING( "UpdateHandler: unable to obtain service manager from component context" ), *this ); + throw uno::RuntimeException( "UpdateHandler: unable to obtain service manager from component context", *this ); mxInteractionHdl.set( task::InteractionHandler::createWithParent(mxContext, 0), @@ -450,7 +448,7 @@ void SAL_CALL UpdateHandler::handle( uno::Reference< task::XInteractionRequest > beans::Optional< ::rtl::OUString > aErrorText = xStrResolver->getStringFromInformationalRequest( rRequest ); if ( aErrorText.IsPresent ) { - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( aErrorText.Value ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( aErrorText.Value ) ); uno::Sequence< uno::Reference< task::XInteractionContinuation > > xContinuations = rRequest->getContinuations(); if ( xContinuations.getLength() == 1 ) @@ -482,7 +480,7 @@ void SAL_CALL UpdateHandler::queryTermination( const lang::EventObject& ) xTopWindow->toFront(); throw frame::TerminationVetoException( - UNISTRING("The office cannot be closed while displaying a warning!"), + "The office cannot be closed while displaying a warning!", uno::Reference<XInterface>(static_cast<frame::XTerminateListener*>(this), uno::UNO_QUERY)); } else @@ -527,25 +525,25 @@ void UpdateHandler::updateState( UpdateState eState ) case UPDATESTATE_CHECKING: showControls( (1<<CANCEL_BUTTON) + (1<<THROBBER_CTRL) ); enableControls( 1<<CANCEL_BUTTON ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msChecking) ) ); - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( rtl::OUString() ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msChecking) ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( rtl::OUString() ) ); focusControl( CANCEL_BUTTON ); break; case UPDATESTATE_ERROR_CHECKING: showControls( 0 ); enableControls( 1 << CLOSE_BUTTON ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msCheckingError) ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msCheckingError) ) ); focusControl( CLOSE_BUTTON ); break; case UPDATESTATE_UPDATE_AVAIL: showControls( 0 ); enableControls( ( 1 << CLOSE_BUTTON ) + ( 1 << DOWNLOAD_BUTTON ) ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msUpdFound) ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msUpdFound) ) ); sText = substVariables(msDownloadWarning); if ( !msDescriptionMsg.isEmpty() ) - sText += UNISTRING("\n\n") + msDescriptionMsg; - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( sText ) ); + sText += "\n\n" + msDescriptionMsg; + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( sText ) ); setDownloadBtnLabel( false ); focusControl( DOWNLOAD_BUTTON ); @@ -553,12 +551,12 @@ void UpdateHandler::updateState( UpdateState eState ) case UPDATESTATE_UPDATE_NO_DOWNLOAD: showControls( 0 ); enableControls( ( 1 << CLOSE_BUTTON ) + ( 1 << DOWNLOAD_BUTTON ) ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msUpdFound) ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msUpdFound) ) ); sText = substVariables(msDownloadNotAvail); if ( !msDescriptionMsg.isEmpty() ) - sText += UNISTRING("\n\n") + msDescriptionMsg; - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( sText ) ); + sText += "\n\n" + msDescriptionMsg; + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( sText ) ); setDownloadBtnLabel( true ); focusControl( DOWNLOAD_BUTTON ); @@ -567,39 +565,39 @@ void UpdateHandler::updateState( UpdateState eState ) case UPDATESTATE_EXT_UPD_AVAIL: // will only be set, when there are no office updates avail showControls( 0 ); enableControls( 1 << CLOSE_BUTTON ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msNoUpdFound) ) ); - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( rtl::OUString() ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msNoUpdFound) ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( rtl::OUString() ) ); focusControl( CLOSE_BUTTON ); break; case UPDATESTATE_DOWNLOADING: showControls( (1<<PROGRESS_CTRL) + (1<<CANCEL_BUTTON) + (1<<PAUSE_BUTTON) + (1<<RESUME_BUTTON) ); enableControls( (1<<CLOSE_BUTTON) + (1<<CANCEL_BUTTON) + (1<<PAUSE_BUTTON) ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msDownloading) ) ); - setControlProperty( TEXT_PERCENT, UNISTRING("Text"), uno::Any( substVariables(msPercent) ) ); - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( substVariables(msDownloadWarning) ) ); - setControlProperty( CTRL_PROGRESS, UNISTRING("ProgressValue"), uno::Any( mnPercent ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msDownloading) ) ); + setControlProperty( TEXT_PERCENT, "Text", uno::Any( substVariables(msPercent) ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( substVariables(msDownloadWarning) ) ); + setControlProperty( CTRL_PROGRESS, "ProgressValue", uno::Any( mnPercent ) ); focusControl( CLOSE_BUTTON ); break; case UPDATESTATE_DOWNLOAD_PAUSED: showControls( (1<<PROGRESS_CTRL) + (1<<CANCEL_BUTTON) + (1<<PAUSE_BUTTON) + (1<<RESUME_BUTTON) ); enableControls( (1<<CLOSE_BUTTON) + (1<<CANCEL_BUTTON) + (1<<RESUME_BUTTON) ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msDownloadPause) ) ); - setControlProperty( TEXT_PERCENT, UNISTRING("Text"), uno::Any( substVariables(msPercent) ) ); - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( substVariables(msDownloadWarning) ) ); - setControlProperty( CTRL_PROGRESS, UNISTRING("ProgressValue"), uno::Any( mnPercent ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msDownloadPause) ) ); + setControlProperty( TEXT_PERCENT, "Text", uno::Any( substVariables(msPercent) ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( substVariables(msDownloadWarning) ) ); + setControlProperty( CTRL_PROGRESS, "ProgressValue", uno::Any( mnPercent ) ); focusControl( CLOSE_BUTTON ); break; case UPDATESTATE_ERROR_DOWNLOADING: showControls( (1<<PROGRESS_CTRL) + (1<<CANCEL_BUTTON) + (1<<PAUSE_BUTTON) + (1<<RESUME_BUTTON) ); enableControls( (1<<CLOSE_BUTTON) + (1<<CANCEL_BUTTON) ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msDownloadError) ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msDownloadError) ) ); focusControl( CLOSE_BUTTON ); break; case UPDATESTATE_DOWNLOAD_AVAIL: showControls( 0 ); enableControls( (1<<CLOSE_BUTTON) + (1<<INSTALL_BUTTON) ); - setControlProperty( TEXT_STATUS, UNISTRING("Text"), uno::Any( substVariables(msReady2Install) ) ); - setControlProperty( TEXT_DESCRIPTION, UNISTRING("Text"), uno::Any( substVariables(msDownloadDescr) ) ); + setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msReady2Install) ) ); + setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( substVariables(msDownloadDescr) ) ); focusControl( INSTALL_BUTTON ); break; case UPDATESTATE_AUTO_START: @@ -630,7 +628,7 @@ rtl::OUString UpdateHandler::loadString( const uno::Reference< resource::XResour sal_Int32 nResourceId ) const { rtl::OUString sString; - rtl::OUString sKey = UNISTRING( "string:" ) + rtl::OUString::valueOf( nResourceId ); + rtl::OUString sKey = "string:" + rtl::OUString::valueOf( nResourceId ); try { @@ -639,7 +637,7 @@ rtl::OUString UpdateHandler::loadString( const uno::Reference< resource::XResour catch( const uno::Exception& ) { OSL_FAIL( "UpdateHandler::loadString: caught an exception!" ); - sString = UNISTRING("Missing ") + sKey; + sString = "Missing " + sKey; } return sString; @@ -649,10 +647,10 @@ rtl::OUString UpdateHandler::substVariables( const rtl::OUString &rSource ) cons { rtl::OUString sString( rSource ); - searchAndReplaceAll( sString, UNISTRING( "%NEXTVERSION" ), msNextVersion ); - searchAndReplaceAll( sString, UNISTRING( "%DOWNLOAD_PATH" ), msDownloadPath ); - searchAndReplaceAll( sString, UNISTRING( "%FILE_NAME" ), msDownloadFile ); - searchAndReplaceAll( sString, UNISTRING( "%PERCENT" ), rtl::OUString::valueOf( mnPercent ) ); + searchAndReplaceAll( sString, "%NEXTVERSION", msNextVersion ); + searchAndReplaceAll( sString, "%DOWNLOAD_PATH", msDownloadPath ); + searchAndReplaceAll( sString, "%FILE_NAME", msDownloadFile ); + searchAndReplaceAll( sString, "%PERCENT", rtl::OUString::valueOf( mnPercent ) ); return sString; } @@ -669,7 +667,7 @@ void UpdateHandler::loadStrings() try { uno::Any aValue( mxContext->getValueByName( - UNISTRING( "/singletons/com.sun.star.resource.OfficeResourceLoader" ) ) ); + "/singletons/com.sun.star.resource.OfficeResourceLoader" ) ); OSL_VERIFY( aValue >>= xLoader ); } catch( const uno::Exception& ) @@ -683,7 +681,7 @@ void UpdateHandler::loadStrings() try { - xBundle = xLoader->loadBundle_Default( UNISTRING( "upd" ) ); + xBundle = xLoader->loadBundle_Default( "upd" ); } catch( const resource::MissingResourceException& ) { @@ -739,7 +737,7 @@ void UpdateHandler::loadStrings() for ( int i=0; i < BUTTON_COUNT; i++ ) { - msButtonIDs[ i ] = UNISTRING("BUTTON_") + rtl::OUString::valueOf( (sal_Int32) i ); + msButtonIDs[ i ] = "BUTTON_" + rtl::OUString::valueOf( (sal_Int32) i ); } } @@ -835,11 +833,11 @@ void UpdateHandler::insertControlModel( uno::Reference< awt::XControlModel > & r } // @see awt/UnoControlDialogElement.idl - xPropSet->setPropertyValue( UNISTRING("Name"), uno::Any (rControlName) ); - xPropSet->setPropertyValue( UNISTRING("PositionX"), uno::Any (rPosSize.X) ); - xPropSet->setPropertyValue( UNISTRING("PositionY"), uno::Any (rPosSize.Y) ); - xPropSet->setPropertyValue( UNISTRING("Height"), uno::Any (rPosSize.Height) ); - xPropSet->setPropertyValue( UNISTRING("Width"), uno::Any (rPosSize.Width) ); + xPropSet->setPropertyValue( "Name", uno::Any (rControlName) ); + xPropSet->setPropertyValue( "PositionX", uno::Any (rPosSize.X) ); + xPropSet->setPropertyValue( "PositionY", uno::Any (rPosSize.Y) ); + xPropSet->setPropertyValue( "Height", uno::Any (rPosSize.Height) ); + xPropSet->setPropertyValue( "Width", uno::Any (rPosSize.Width) ); // insert by Name into DialogModel container uno::Reference< container::XNameContainer > xContainer (rxDialogModel, uno::UNO_QUERY_THROW); @@ -853,25 +851,25 @@ void UpdateHandler::setFullVersion( rtl::OUString& rString ) com::sun::star::configuration::theDefaultProvider::get( mxContext ) ); beans::PropertyValue aProperty; - aProperty.Name = UNISTRING( "nodepath" ); - aProperty.Value = uno::makeAny( UNISTRING("org.openoffice.Setup/Product") ); + aProperty.Name = "nodepath"; + aProperty.Value = uno::makeAny( OUString("org.openoffice.Setup/Product") ); uno::Sequence< uno::Any > aArgumentList( 1 ); aArgumentList[0] = uno::makeAny( aProperty ); uno::Reference< uno::XInterface > xConfigAccess; - xConfigAccess = xConfigurationProvider->createInstanceWithArguments( UNISTRING("com.sun.star.configuration.ConfigurationAccess"), + xConfigAccess = xConfigurationProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aArgumentList ); uno::Reference< container::XNameAccess > xNameAccess( xConfigAccess, uno::UNO_QUERY_THROW ); rtl::OUString aProductVersion; - xNameAccess->getByName(UNISTRING("ooSetupVersion")) >>= aProductVersion; + xNameAccess->getByName("ooSetupVersion") >>= aProductVersion; sal_Int32 nVerIndex = rString.indexOf( aProductVersion ); if ( nVerIndex != -1 ) { rtl::OUString aProductFullVersion; - xNameAccess->getByName(UNISTRING("ooSetupVersionAboutBox")) >>= aProductFullVersion; + xNameAccess->getByName("ooSetupVersionAboutBox") >>= aProductFullVersion; rString = rString.replaceAt( nVerIndex, aProductVersion.getLength(), aProductFullVersion ); } } @@ -897,7 +895,7 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText ) const nWindowAttributes |= awt::VclWindowPeerAttribute::DEF_NO; aDescriptor.Type = awt::WindowClass_MODALTOP; - aDescriptor.WindowServiceName = UNISTRING( "warningbox" ); + aDescriptor.WindowServiceName = "warningbox"; aDescriptor.ParentIndex = -1; aDescriptor.Parent = xPeer; aDescriptor.Bounds = awt::Rectangle( 10, 10, 250, 150 ); @@ -946,7 +944,7 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText, nWindowAttributes |= awt::VclWindowPeerAttribute::DEF_NO; aDescriptor.Type = awt::WindowClass_MODALTOP; - aDescriptor.WindowServiceName = UNISTRING( "warningbox" ); + aDescriptor.WindowServiceName = "warningbox"; aDescriptor.ParentIndex = -1; aDescriptor.Parent = xPeer; aDescriptor.Bounds = awt::Rectangle( 10, 10, 250, 150 ); @@ -966,12 +964,12 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText, if ( xMsgBoxCtrl.is() ) { bool bIsDefault = true; - uno::Any aValue = xMsgBoxCtrl->getProperty( UNISTRING("DefaultButton") ); + uno::Any aValue = xMsgBoxCtrl->getProperty( "DefaultButton" ); aValue >>= bIsDefault; if ( bIsDefault ) - xMsgBoxCtrl->setProperty( UNISTRING("Text"), uno::Any( rBtnText_1 ) ); + xMsgBoxCtrl->setProperty( "Text", uno::Any( rBtnText_1 ) ); else - xMsgBoxCtrl->setProperty( UNISTRING("Text"), uno::Any( rBtnText_2 ) ); + xMsgBoxCtrl->setProperty( "Text", uno::Any( rBtnText_2 ) ); } } } @@ -998,8 +996,8 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText, bool UpdateHandler::showOverwriteWarning( const rtl::OUString& rFileName ) const { rtl::OUString aMsg( msReloadWarning ); - searchAndReplaceAll( aMsg, UNISTRING( "%FILENAME" ), rFileName ); - searchAndReplaceAll( aMsg, UNISTRING( "%DOWNLOAD_PATH" ), msDownloadPath ); + searchAndReplaceAll( aMsg, "%FILENAME", rFileName ); + searchAndReplaceAll( aMsg, "%DOWNLOAD_PATH", msDownloadPath ); return showWarning( aMsg, msReloadContinue, msReloadReload ); } @@ -1065,15 +1063,15 @@ void UpdateHandler::showControls( short nControls ) // Status text needs to be smaller, when there are buttons at the right side of the dialog if ( ( nControls & ( (1<<CANCEL_BUTTON) + (1<<PAUSE_BUTTON) + (1<<RESUME_BUTTON) ) ) != 0 ) - setControlProperty( TEXT_STATUS, UNISTRING("Width"), uno::Any( sal_Int32(EDIT_WIDTH - BUTTON_WIDTH - 2*INNER_BORDER - TEXT_OFFSET ) ) ); + setControlProperty( TEXT_STATUS, "Width", uno::Any( sal_Int32(EDIT_WIDTH - BUTTON_WIDTH - 2*INNER_BORDER - TEXT_OFFSET ) ) ); else - setControlProperty( TEXT_STATUS, UNISTRING("Width"), uno::Any( sal_Int32(EDIT_WIDTH - 2*TEXT_OFFSET ) ) ); + setControlProperty( TEXT_STATUS, "Width", uno::Any( sal_Int32(EDIT_WIDTH - 2*TEXT_OFFSET ) ) ); // Status text needs to be taller, when we show the progress bar if ( ( nControls & ( 1<<PROGRESS_CTRL ) ) != 0 ) - setControlProperty( TEXT_STATUS, UNISTRING("Height"), uno::Any( sal_Int32(LABEL_HEIGHT) ) ); + setControlProperty( TEXT_STATUS, "Height", uno::Any( sal_Int32(LABEL_HEIGHT) ) ); else - setControlProperty( TEXT_STATUS, UNISTRING("Height"), uno::Any( sal_Int32(BOX_HEIGHT1 - 4*TEXT_OFFSET - LABEL_HEIGHT ) ) ); + setControlProperty( TEXT_STATUS, "Height", uno::Any( sal_Int32(BOX_HEIGHT1 - 4*TEXT_OFFSET - LABEL_HEIGHT ) ) ); } //-------------------------------------------------------------------- @@ -1095,50 +1093,50 @@ void UpdateHandler::createDialog() uno::Reference< lang::XMultiComponentFactory > xFactory( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); uno::Reference< awt::XControlModel > xControlModel( xFactory->createInstanceWithContext( - UNISTRING("com.sun.star.awt.UnoControlDialogModel"), + "com.sun.star.awt.UnoControlDialogModel", mxContext), uno::UNO_QUERY_THROW ); { // @see awt/UnoControlDialogModel.idl uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY_THROW ); - xPropSet->setPropertyValue( UNISTRING("Title"), uno::Any( msDlgTitle ) ); - xPropSet->setPropertyValue( UNISTRING("Closeable"), uno::Any( true ) ); - xPropSet->setPropertyValue( UNISTRING("Enabled"), uno::Any( true ) ); - xPropSet->setPropertyValue( UNISTRING("Moveable"), uno::Any( true ) ); - xPropSet->setPropertyValue( UNISTRING("Sizeable"), uno::Any( true ) ); - xPropSet->setPropertyValue( UNISTRING("DesktopAsParent"), uno::Any( true ) ); - xPropSet->setPropertyValue( UNISTRING("PositionX"), uno::Any(sal_Int32( 100 )) ); - xPropSet->setPropertyValue( UNISTRING("PositionY"), uno::Any(sal_Int32( 100 )) ); - xPropSet->setPropertyValue( UNISTRING("Width"), uno::Any(sal_Int32( DIALOG_WIDTH )) ); - xPropSet->setPropertyValue( UNISTRING("Height"), uno::Any(sal_Int32( DIALOG_HEIGHT )) ); - xPropSet->setPropertyValue( UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DLG ) ) ); + xPropSet->setPropertyValue( "Title", uno::Any( msDlgTitle ) ); + xPropSet->setPropertyValue( "Closeable", uno::Any( true ) ); + xPropSet->setPropertyValue( "Enabled", uno::Any( true ) ); + xPropSet->setPropertyValue( "Moveable", uno::Any( true ) ); + xPropSet->setPropertyValue( "Sizeable", uno::Any( true ) ); + xPropSet->setPropertyValue( "DesktopAsParent", uno::Any( true ) ); + xPropSet->setPropertyValue( "PositionX", uno::Any(sal_Int32( 100 )) ); + xPropSet->setPropertyValue( "PositionY", uno::Any(sal_Int32( 100 )) ); + xPropSet->setPropertyValue( "Width", uno::Any(sal_Int32( DIALOG_WIDTH )) ); + xPropSet->setPropertyValue( "Height", uno::Any(sal_Int32( DIALOG_HEIGHT )) ); + xPropSet->setPropertyValue( "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DLG ) ) ); } { // Label (fixed text) <status> uno::Sequence< beans::NamedValue > aProps(1); - setProperty( aProps, 0, UNISTRING("Label"), uno::Any( msStatusFL ) ); + setProperty( aProps, 0, "Label", uno::Any( msStatusFL ) ); - insertControlModel( xControlModel, FIXED_TEXT_MODEL, UNISTRING( "fixedLineStatus" ), + insertControlModel( xControlModel, FIXED_TEXT_MODEL, "fixedLineStatus", awt::Rectangle( DIALOG_BORDER+1, DIALOG_BORDER, EDIT_WIDTH-2, LABEL_HEIGHT ), aProps ); } { // box around <status> text uno::Sequence< beans::NamedValue > aProps; - insertControlModel( xControlModel, GROUP_BOX_MODEL, UNISTRING( "StatusBox" ), + insertControlModel( xControlModel, GROUP_BOX_MODEL, "StatusBox", awt::Rectangle( DIALOG_BORDER, DIALOG_BORDER + LABEL_HEIGHT, EDIT_WIDTH, BOX_HEIGHT1 - LABEL_HEIGHT ), aProps ); } { // Text (multiline edit) <status> uno::Sequence< beans::NamedValue > aProps(7); - setProperty( aProps, 0, UNISTRING("Text"), uno::Any( substVariables(msChecking) ) ); - setProperty( aProps, 1, UNISTRING("Border"), uno::Any( sal_Int16( 0 ) ) ); - setProperty( aProps, 2, UNISTRING("PaintTransparent"), uno::Any( true ) ); - setProperty( aProps, 3, UNISTRING("MultiLine"), uno::Any( true ) ); - setProperty( aProps, 4, UNISTRING("ReadOnly"), uno::Any( true ) ); - setProperty( aProps, 5, UNISTRING("AutoVScroll"), uno::Any( true ) ); - setProperty( aProps, 6, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_STATUS ) ) ); + setProperty( aProps, 0, "Text", uno::Any( substVariables(msChecking) ) ); + setProperty( aProps, 1, "Border", uno::Any( sal_Int16( 0 ) ) ); + setProperty( aProps, 2, "PaintTransparent", uno::Any( true ) ); + setProperty( aProps, 3, "MultiLine", uno::Any( true ) ); + setProperty( aProps, 4, "ReadOnly", uno::Any( true ) ); + setProperty( aProps, 5, "AutoVScroll", uno::Any( true ) ); + setProperty( aProps, 6, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_STATUS ) ) ); insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_STATUS, awt::Rectangle( DIALOG_BORDER + TEXT_OFFSET, @@ -1150,10 +1148,10 @@ void UpdateHandler::createDialog() { // Text (edit) <percent> uno::Sequence< beans::NamedValue > aProps(4); - setProperty( aProps, 0, UNISTRING("Text"), uno::Any( msPercent ) ); - setProperty( aProps, 1, UNISTRING("Border"), uno::Any( sal_Int16( 0 ) ) ); - setProperty( aProps, 2, UNISTRING("PaintTransparent"), uno::Any( true ) ); - setProperty( aProps, 3, UNISTRING("ReadOnly"), uno::Any( true ) ); + setProperty( aProps, 0, "Text", uno::Any( msPercent ) ); + setProperty( aProps, 1, "Border", uno::Any( sal_Int16( 0 ) ) ); + setProperty( aProps, 2, "PaintTransparent", uno::Any( true ) ); + setProperty( aProps, 3, "ReadOnly", uno::Any( true ) ); insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_PERCENT, awt::Rectangle( PROGRESS_X_POS + PROGRESS_WIDTH + DIALOG_BORDER, @@ -1165,11 +1163,11 @@ void UpdateHandler::createDialog() { // pause button uno::Sequence< beans::NamedValue > aProps(5); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); - setProperty( aProps, 3, UNISTRING("Label"), uno::Any( msPauseBtn ) ); - setProperty( aProps, 4, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_PAUSE ) ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); + setProperty( aProps, 3, "Label", uno::Any( msPauseBtn ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_PAUSE ) ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[PAUSE_BUTTON], awt::Rectangle( BOX1_BTN_X, BOX1_BTN_Y, BUTTON_WIDTH, BUTTON_HEIGHT ), @@ -1178,11 +1176,11 @@ void UpdateHandler::createDialog() { // resume button uno::Sequence< beans::NamedValue > aProps(5); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); - setProperty( aProps, 3, UNISTRING("Label"), uno::Any( msResumeBtn ) ); - setProperty( aProps, 4, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_RESUME ) ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); + setProperty( aProps, 3, "Label", uno::Any( msResumeBtn ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_RESUME ) ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[RESUME_BUTTON], awt::Rectangle( BOX1_BTN_X, @@ -1194,11 +1192,11 @@ void UpdateHandler::createDialog() { // abort button uno::Sequence< beans::NamedValue > aProps(5); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); - setProperty( aProps, 3, UNISTRING("Label"), uno::Any( msCancelBtn ) ); - setProperty( aProps, 4, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_CANCEL ) ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); + setProperty( aProps, 3, "Label", uno::Any( msCancelBtn ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_CANCEL ) ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[CANCEL_BUTTON], awt::Rectangle( BOX1_BTN_X, @@ -1210,29 +1208,29 @@ void UpdateHandler::createDialog() { // Label (FixedText) <description> uno::Sequence< beans::NamedValue > aProps(1); - setProperty( aProps, 0, UNISTRING("Label"), uno::Any( msDescription ) ); + setProperty( aProps, 0, "Label", uno::Any( msDescription ) ); - insertControlModel( xControlModel, FIXED_TEXT_MODEL, UNISTRING( "fixedTextDescription" ), + insertControlModel( xControlModel, FIXED_TEXT_MODEL, "fixedTextDescription", awt::Rectangle( DIALOG_BORDER+1, LABEL_Y_POS, EDIT_WIDTH-2, LABEL_HEIGHT ), aProps ); } { // box around <description> text uno::Sequence< beans::NamedValue > aProps; - insertControlModel( xControlModel, GROUP_BOX_MODEL, UNISTRING( "DescriptionBox" ), + insertControlModel( xControlModel, GROUP_BOX_MODEL, "DescriptionBox", awt::Rectangle( DIALOG_BORDER, EDIT2_Y_POS, EDIT_WIDTH, BOX_HEIGHT2 ), aProps ); } { // Text (MultiLineEdit) <description> uno::Sequence< beans::NamedValue > aProps(7); - setProperty( aProps, 0, UNISTRING("Text"), uno::Any( rtl::OUString() ) ); - setProperty( aProps, 1, UNISTRING("Border"), uno::Any( sal_Int16( 0 ) ) ); - setProperty( aProps, 2, UNISTRING("PaintTransparent"), uno::Any( true ) ); - setProperty( aProps, 3, UNISTRING("MultiLine"), uno::Any( true ) ); - setProperty( aProps, 4, UNISTRING("ReadOnly"), uno::Any( true ) ); - setProperty( aProps, 5, UNISTRING("AutoVScroll"), uno::Any( true ) ); - setProperty( aProps, 6, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DESCRIPTION ) ) ); + setProperty( aProps, 0, "Text", uno::Any( rtl::OUString() ) ); + setProperty( aProps, 1, "Border", uno::Any( sal_Int16( 0 ) ) ); + setProperty( aProps, 2, "PaintTransparent", uno::Any( true ) ); + setProperty( aProps, 3, "MultiLine", uno::Any( true ) ); + setProperty( aProps, 4, "ReadOnly", uno::Any( true ) ); + setProperty( aProps, 5, "AutoVScroll", uno::Any( true ) ); + setProperty( aProps, 6, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DESCRIPTION ) ) ); insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_DESCRIPTION, awt::Rectangle( DIALOG_BORDER + TEXT_OFFSET, @@ -1244,25 +1242,25 @@ void UpdateHandler::createDialog() { // @see awt/UnoControlFixedLineModel.idl uno::Sequence< beans::NamedValue > aProps(1); - setProperty( aProps, 0, UNISTRING("Orientation"), uno::Any( sal_Int32( 0 ) ) ); + setProperty( aProps, 0, "Orientation", uno::Any( sal_Int32( 0 ) ) ); - insertControlModel( xControlModel, FIXED_LINE_MODEL, UNISTRING("fixedLine"), + insertControlModel( xControlModel, FIXED_LINE_MODEL, "fixedLine", awt::Rectangle( 0, BUTTON_BAR_Y_POS, DIALOG_WIDTH, 5 ), aProps ); } { // close button // @see awt/UnoControlButtonModel.idl uno::Sequence< beans::NamedValue > aProps(5); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); // [property] short PushButtonType // with own "ButtonActionListener" - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); // with default ActionListener => endDialog(). - // setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_CANCEL) ) ); + // setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_CANCEL) ) ); // [property] string Label // only if PushButtonType_STANDARD - setProperty( aProps, 3, UNISTRING("Label"), uno::Any( msClose ) ); - setProperty( aProps, 4, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_CLOSE ) ) ); + setProperty( aProps, 3, "Label", uno::Any( msClose ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_CLOSE ) ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[ CLOSE_BUTTON ], awt::Rectangle( CLOSE_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), @@ -1271,11 +1269,11 @@ void UpdateHandler::createDialog() { // install button uno::Sequence< beans::NamedValue > aProps(5); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); - setProperty( aProps, 3, UNISTRING("Label"), uno::Any( msInstall ) ); - setProperty( aProps, 4, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_INSTALL ) ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); + setProperty( aProps, 3, "Label", uno::Any( msInstall ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_INSTALL ) ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[INSTALL_BUTTON], awt::Rectangle( INSTALL_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), @@ -1284,11 +1282,11 @@ void UpdateHandler::createDialog() { // download button uno::Sequence< beans::NamedValue > aProps(5); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); - setProperty( aProps, 3, UNISTRING("Label"), uno::Any( msDownload ) ); - setProperty( aProps, 4, UNISTRING("HelpURL"), uno::makeAny( UNISTRING( INET_HID_SCHEME ) + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DOWNLOAD ) ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) ); + setProperty( aProps, 3, "Label", uno::Any( msDownload ) ); + setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + rtl::OUString::createFromAscii( HID_CHECK_FOR_UPD_DOWNLOAD ) ) ); insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[DOWNLOAD_BUTTON], awt::Rectangle( DOWNLOAD_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), @@ -1297,9 +1295,9 @@ void UpdateHandler::createDialog() { // help button uno::Sequence< beans::NamedValue > aProps(3); - setProperty( aProps, 0, UNISTRING("DefaultButton"), uno::Any( false ) ); - setProperty( aProps, 1, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 2, UNISTRING("PushButtonType"), uno::Any( sal_Int16(awt::PushButtonType_HELP) ) ); + setProperty( aProps, 0, "DefaultButton", uno::Any( false ) ); + setProperty( aProps, 1, "Enabled", uno::Any( true ) ); + setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_HELP) ) ); insertControlModel( xControlModel, BUTTON_MODEL, msButtonIDs[HELP_BUTTON], awt::Rectangle( DIALOG_BORDER, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), @@ -1308,24 +1306,24 @@ void UpdateHandler::createDialog() { // @see awt/UnoControlThrobberModel.idl uno::Sequence< beans::NamedValue > aProps; - insertControlModel( xControlModel, UNISTRING("com.sun.star.awt.SpinningProgressControlModel"), CTRL_THROBBER, + insertControlModel( xControlModel, "com.sun.star.awt.SpinningProgressControlModel", CTRL_THROBBER, awt::Rectangle( THROBBER_X_POS, THROBBER_Y_POS, THROBBER_WIDTH, THROBBER_HEIGHT), aProps ); } { // @see awt/UnoControlProgressBarModel.idl uno::Sequence< beans::NamedValue > aProps(4); - setProperty( aProps, 0, UNISTRING("Enabled"), uno::Any( true ) ); - setProperty( aProps, 1, UNISTRING("ProgressValue"), uno::Any( sal_Int32( 0 ) ) ); - setProperty( aProps, 2, UNISTRING("ProgressValueMax"), uno::Any( sal_Int32( 100 ) ) ); - setProperty( aProps, 3, UNISTRING("ProgressValueMin"), uno::Any( sal_Int32( 0 ) ) ); + setProperty( aProps, 0, "Enabled", uno::Any( true ) ); + setProperty( aProps, 1, "ProgressValue", uno::Any( sal_Int32( 0 ) ) ); + setProperty( aProps, 2, "ProgressValueMax", uno::Any( sal_Int32( 100 ) ) ); + setProperty( aProps, 3, "ProgressValueMin", uno::Any( sal_Int32( 0 ) ) ); - insertControlModel( xControlModel, UNISTRING("com.sun.star.awt.UnoControlProgressBarModel"), CTRL_PROGRESS, + insertControlModel( xControlModel, "com.sun.star.awt.UnoControlProgressBarModel", CTRL_PROGRESS, awt::Rectangle( PROGRESS_X_POS, PROGRESS_Y_POS, PROGRESS_WIDTH, PROGRESS_HEIGHT ), aProps); } uno::Reference< awt::XControl > xControl( - xFactory->createInstanceWithContext( UNISTRING("com.sun.star.awt.UnoControlDialog"), mxContext), + xFactory->createInstanceWithContext( "com.sun.star.awt.UnoControlDialog", mxContext), uno::UNO_QUERY_THROW ); xControl->setModel( xControlModel ); diff --git a/extensions/source/update/check/updateprotocol.cxx b/extensions/source/update/check/updateprotocol.cxx index 906cad094d70..48730b6b76e7 100644 --- a/extensions/source/update/check/updateprotocol.cxx +++ b/extensions/source/update/check/updateprotocol.cxx @@ -42,8 +42,6 @@ namespace uno = css::uno ; namespace task = css::task ; namespace xml = css::xml ; -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - //------------------------------------------------------------------------------ static bool @@ -52,17 +50,17 @@ getBootstrapData( ::rtl::OUString & rGitID, ::rtl::OUString & rInstallSetID) { - rGitID = UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}" ); + rGitID = "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":buildid}"; rtl::Bootstrap::expandMacros( rGitID ); if ( rGitID.isEmpty() ) return false; - rInstallSetID = UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateID}" ); + rInstallSetID = "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateID}"; rtl::Bootstrap::expandMacros( rInstallSetID ); if ( rInstallSetID.isEmpty() ) return false; - rtl::OUString aValue( UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateURL}" ) ); + OUString aValue( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateURL}" ); rtl::Bootstrap::expandMacros( aValue ); if( !aValue.isEmpty() ) @@ -89,8 +87,8 @@ checkForUpdates( ::rtl::OUString myArch; ::rtl::OUString myOS; - rtl::Bootstrap::get(UNISTRING("_OS"), myOS); - rtl::Bootstrap::get(UNISTRING("_ARCH"), myArch); + rtl::Bootstrap::get("_OS", myOS); + rtl::Bootstrap::get("_ARCH", myArch); uno::Sequence< ::rtl::OUString > aRepositoryList; ::rtl::OUString aGitID; @@ -118,14 +116,14 @@ checkForUpdates( { if( !rxContext.is() ) throw uno::RuntimeException( - UNISTRING( "checkForUpdates: empty component context" ), uno::Reference< uno::XInterface >() ); + "checkForUpdates: empty component context", uno::Reference< uno::XInterface >() ); OSL_ASSERT( rxContext->getServiceManager().is() ); // XPath implementation uno::Reference< xml::xpath::XXPathAPI > xXPath = xml::xpath::XPathAPI::create(rxContext); - xXPath->registerNS( UNISTRING("inst"), UNISTRING("http://update.libreoffice.org/description") ); + xXPath->registerNS( "inst", "http://update.libreoffice.org/description" ); if( rxInteractionHandler.is() ) rUpdateInfoProvider->setInteractionHandler(rxInteractionHandler); @@ -159,7 +157,7 @@ checkForUpdates( uno::Reference< xml::dom::XNodeList > xNodeList; try { xNodeList = xXPath->selectNodeList(xNode, aXPathExpression - + UNISTRING("/inst:update/attribute::src")); + + "/inst:update/attribute::src"); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -172,7 +170,7 @@ checkForUpdates( if( xNode2.is() ) { uno::Reference< xml::dom::XElement > xParent(xNode2->getParentNode(), uno::UNO_QUERY_THROW); - rtl::OUString aType = xParent->getAttribute(UNISTRING("type")); + rtl::OUString aType = xParent->getAttribute("type"); bool bIsDirect = ( sal_False == aType.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("text/html")) ); o_rUpdateInfo.Sources.push_back( DownloadSource(bIsDirect, xNode2->getNodeValue()) ); @@ -182,7 +180,7 @@ checkForUpdates( uno::Reference< xml::dom::XNode > xNode2; try { xNode2 = xXPath->selectSingleNode(xNode, aXPathExpression - + UNISTRING("/inst:version/text()")); + + "/inst:version/text()"); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -192,7 +190,7 @@ checkForUpdates( try { xNode2 = xXPath->selectSingleNode(xNode, aXPathExpression - + UNISTRING("/inst:buildid/text()")); + + "/inst:buildid/text()"); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -205,7 +203,7 @@ checkForUpdates( // Release Notes try { xNodeList = xXPath->selectNodeList(xNode, aXPathExpression - + UNISTRING("/inst:relnote")); + + "/inst:relnote"); } catch (const css::xml::xpath::XPathException &) { // ignore } @@ -215,15 +213,15 @@ checkForUpdates( uno::Reference< xml::dom::XElement > xRelNote(xNodeList->item(i), uno::UNO_QUERY); if( xRelNote.is() ) { - sal_Int32 pos = xRelNote->getAttribute(UNISTRING("pos")).toInt32(); + sal_Int32 pos = xRelNote->getAttribute("pos").toInt32(); - ReleaseNote aRelNote((sal_uInt8) pos, xRelNote->getAttribute(UNISTRING("src"))); + ReleaseNote aRelNote((sal_uInt8) pos, xRelNote->getAttribute("src")); - if( xRelNote->hasAttribute(UNISTRING("src2")) ) + if( xRelNote->hasAttribute("src2") ) { - pos = xRelNote->getAttribute(UNISTRING("pos2")).toInt32(); + pos = xRelNote->getAttribute("pos2").toInt32(); aRelNote.Pos2 = (sal_Int8) pos; - aRelNote.URL2 = xRelNote->getAttribute(UNISTRING("src2")); + aRelNote.URL2 = xRelNote->getAttribute("src2"); } o_rUpdateInfo.ReleaseNotes.push_back(aRelNote); @@ -272,7 +270,7 @@ bool checkForExtensionUpdates( const uno::Reference< uno::XComponentContext > & try { uno::Any aValue( rxContext->getValueByName( - UNISTRING( "/singletons/com.sun.star.deployment.PackageInformationProvider" ) ) ); + "/singletons/com.sun.star.deployment.PackageInformationProvider" ) ); OSL_VERIFY( aValue >>= xInfoProvider ); } catch( const uno::Exception& ) @@ -298,7 +296,7 @@ bool checkForPendingUpdates( const uno::Reference< uno::XComponentContext > & rx try { uno::Any aValue( rxContext->getValueByName( - UNISTRING( "/singletons/com.sun.star.deployment.PackageInformationProvider" ) ) ); + "/singletons/com.sun.star.deployment.PackageInformationProvider" ) ); OSL_VERIFY( aValue >>= xInfoProvider ); } catch( const uno::Exception& ) diff --git a/extensions/source/update/check/updateprotocoltest.cxx b/extensions/source/update/check/updateprotocoltest.cxx index 69113b9a98c3..e88367cc44f8 100644 --- a/extensions/source/update/check/updateprotocoltest.cxx +++ b/extensions/source/update/check/updateprotocoltest.cxx @@ -27,8 +27,6 @@ #include <osl/process.h> #include <stdio.h> -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - namespace task = ::com::sun::star::task; namespace uno = ::com::sun::star::uno; diff --git a/extensions/source/update/feed/test/updatefeedtest.cxx b/extensions/source/update/feed/test/updatefeedtest.cxx index c2bedb087a2b..fdea48d79433 100644 --- a/extensions/source/update/feed/test/updatefeedtest.cxx +++ b/extensions/source/update/feed/test/updatefeedtest.cxx @@ -37,8 +37,6 @@ namespace lang = ::com::sun::star::lang; namespace uno = ::com::sun::star::uno; namespace xml = ::com::sun::star::xml; -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - // ----------------------------------------------------------------------- SAL_IMPLEMENT_MAIN() @@ -65,9 +63,9 @@ SAL_IMPLEMENT_MAIN() uno::Sequence< rtl::OUString > theURLs(1); osl_getCommandArg( 0, &theURLs[0].pData ); - // theURLs[0] = UNISTRING( "http://localhost/~olli/atomfeed.xml" ); + // theURLs[0] = "http://localhost/~olli/atomfeed.xml"; - rtl::OUString aExtension = UNISTRING( "MyExtension" ); + rtl::OUString aExtension = "MyExtension"; try { diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx index 7c514fd8d097..045ac07b2571 100644 --- a/extensions/source/update/feed/updatefeed.cxx +++ b/extensions/source/update/feed/updatefeed.cxx @@ -64,7 +64,6 @@ namespace uno = com::sun::star::uno ; namespace xml = com::sun::star::xml ; namespace sdbc = com::sun::star::sdbc ; -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) //------------------------------------------------------------------------------ @@ -255,14 +254,14 @@ public: uno::Reference< xml::dom::XNode > xAtomEntryNode( m_xNodeList->item(m_nCount++) ); uno::Reference< xml::dom::XNode > xSummaryNode( - m_xUpdateInformationProvider->getChildNode( xAtomEntryNode, UNISTRING( "summary/text()" ) ) + m_xUpdateInformationProvider->getChildNode( xAtomEntryNode, "summary/text()" ) ); if( xSummaryNode.is() ) aEntry.Description = xSummaryNode->getNodeValue(); uno::Reference< xml::dom::XNode > xContentNode( - m_xUpdateInformationProvider->getChildNode( xAtomEntryNode, UNISTRING( "content" ) ) ); + m_xUpdateInformationProvider->getChildNode( xAtomEntryNode, "content" ) ); if( xContentNode.is() ) aEntry.UpdateDocument = m_xUpdateInformationProvider->getDocumentRoot(xContentNode); @@ -272,14 +271,14 @@ public: // action has been aborted catch( ucb::CommandAbortedException const & e) - { throw lang::WrappedTargetException( UNISTRING( "Command aborted" ), *this, uno::makeAny(e) ); } + { throw lang::WrappedTargetException( "Command aborted", *this, uno::makeAny(e) ); } // let runtime exception pass catch( uno::RuntimeException const & ) { throw; } // document not accessible catch( uno::Exception const & e) - { throw lang::WrappedTargetException( UNISTRING( "Document not accessible" ), *this, uno::makeAny(e) ); } + { throw lang::WrappedTargetException( "Document not accessible", *this, uno::makeAny(e) ); } } private: @@ -333,20 +332,19 @@ UpdateInformationProvider::UpdateInformationProvider( rtl::OUString name; getConfigurationItem( xConfigurationProvider, - UNISTRING("org.openoffice.Setup/Product"), - UNISTRING("ooName")) >>= name; + "org.openoffice.Setup/Product", + "ooName") >>= name; buf.append(name); buf.append(sal_Unicode(' ')); rtl::OUString version; getConfigurationItem( xConfigurationProvider, - UNISTRING("org.openoffice.Setup/Product"), - UNISTRING("ooSetupVersion")) >>= version; + "org.openoffice.Setup/Product", + "ooSetupVersion") >>= version; buf.append(version); rtl::OUString edition( - UNISTRING( "${${BRAND_BASE_DIR}/program/edition/edition.ini:" - "EDITIONNAME}")); + "EDITIONNAME}"); rtl::Bootstrap::expandMacros(edition); if (!edition.isEmpty()) { buf.append(sal_Unicode(' ')); @@ -355,15 +353,15 @@ UpdateInformationProvider::UpdateInformationProvider( rtl::OUString extension; getConfigurationItem( xConfigurationProvider, - UNISTRING("org.openoffice.Setup/Product"), - UNISTRING("ooSetupExtension")) >>= extension; + "org.openoffice.Setup/Product", + "ooSetupExtension") >>= extension; if (!extension.isEmpty()) { buf.append(sal_Unicode(' ')); buf.append(extension); } rtl::OUString product(buf.makeStringAndClear()); - rtl::OUString aUserAgent( UNISTRING( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateUserAgent}" ) ); + rtl::OUString aUserAgent( "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version") ":UpdateUserAgent}" ); rtl::Bootstrap::expandMacros( aUserAgent ); for (sal_Int32 i = 0;;) { @@ -377,12 +375,12 @@ UpdateInformationProvider::UpdateInformationProvider( i += product.getLength(); } - m_aRequestHeaderList[0].Name = UNISTRING("Accept-Language"); - m_aRequestHeaderList[0].Value = getConfigurationItem( xConfigurationProvider, UNISTRING("org.openoffice.Setup/L10N"), UNISTRING("ooLocale") ); + m_aRequestHeaderList[0].Name = "Accept-Language"; + m_aRequestHeaderList[0].Value = getConfigurationItem( xConfigurationProvider, "org.openoffice.Setup/L10N", "ooLocale" ); if( !aUserAgent.isEmpty() ) { m_aRequestHeaderList.realloc(2); - m_aRequestHeaderList[1].Name = UNISTRING("User-Agent"); + m_aRequestHeaderList[1].Name = "User-Agent"; m_aRequestHeaderList[1].Value = uno::makeAny(aUserAgent); } } @@ -399,7 +397,7 @@ UpdateInformationProvider::createInstance(const uno::Reference<uno::XComponentCo uno::Reference< xml::xpath::XXPathAPI > xXPath = xml::xpath::XPathAPI::create( xContext ); - xXPath->registerNS( UNISTRING("atom"), UNISTRING("http://www.w3.org/2005/Atom") ); + xXPath->registerNS( "atom", "http://www.w3.org/2005/Atom" ); return *new UpdateInformationProvider(xContext, xUniversalContentBroker, xDocumentBuilder, xXPath); } @@ -416,7 +414,7 @@ uno::Any UpdateInformationProvider::getConfigurationItem(uno::Reference<lang::XMultiServiceFactory> const & configurationProvider, rtl::OUString const & node, rtl::OUString const & item) { beans::NamedValue aProperty; - aProperty.Name = UNISTRING("nodepath"); + aProperty.Name = "nodepath"; aProperty.Value = uno::makeAny(node); uno::Sequence< uno::Any > aArgumentList( 1 ); @@ -424,7 +422,7 @@ UpdateInformationProvider::getConfigurationItem(uno::Reference<lang::XMultiServi uno::Reference< container::XNameAccess > xNameAccess( configurationProvider->createInstanceWithArguments( - UNISTRING("com.sun.star.configuration.ConfigurationAccess"), + "com.sun.star.configuration.ConfigurationAccess", aArgumentList ), uno::UNO_QUERY_THROW); @@ -453,7 +451,7 @@ UpdateInformationProvider::load(const rtl::OUString& rURL) if( !xId.is() ) throw uno::RuntimeException( - UNISTRING( "unable to obtain universal content id" ), *this); + "unable to obtain universal content id", *this); uno::Reference< ucb::XCommandProcessor > xCommandProcessor(m_xUniversalContentBroker->queryContent(xId), uno::UNO_QUERY_THROW); rtl::Reference< ActiveDataSink > aSink(new ActiveDataSink()); @@ -462,7 +460,7 @@ UpdateInformationProvider::load(const rtl::OUString& rURL) // instances phone home & clog up servers uno::Sequence< beans::NamedValue > aProps( 1 ); aProps[ 0 ] = beans::NamedValue( - UNISTRING("KeepAlive"), uno::makeAny(sal_False)); + "KeepAlive", uno::makeAny(sal_False)); ucb::OpenCommandArgument3 aOpenArgument; aOpenArgument.Mode = ucb::OpenMode::DOCUMENT; @@ -471,7 +469,7 @@ UpdateInformationProvider::load(const rtl::OUString& rURL) aOpenArgument.OpeningFlags = aProps; ucb::Command aCommand; - aCommand.Name = UNISTRING("open"); + aCommand.Name = "open"; aCommand.Argument = uno::makeAny(aOpenArgument); sal_Int32 nCommandId = xCommandProcessor->createCommandIdentifier(); @@ -513,10 +511,10 @@ UpdateInformationProvider::getDocumentRoot(const uno::Reference< xml::dom::XNode uno::Reference< xml::dom::XElement > xElement(rxNode, uno::UNO_QUERY_THROW); // load the document referenced in 'src' attribute .. - if( xElement->hasAttribute( UNISTRING("src") ) ) + if( xElement->hasAttribute( "src" ) ) { uno::Reference< xml::dom::XDocument > xUpdateXML = - m_xDocumentBuilder->parse(load(xElement->getAttribute( UNISTRING("src") ))); + m_xDocumentBuilder->parse(load(xElement->getAttribute( "src" ))); OSL_ASSERT( xUpdateXML.is() ); @@ -556,7 +554,7 @@ UpdateInformationProvider::getChildNode(const uno::Reference< xml::dom::XNode >& { OSL_ASSERT(m_xXPathAPI.is()); try { - return m_xXPathAPI->selectSingleNode(rxNode, UNISTRING( "./atom:" ) + rName); + return m_xXPathAPI->selectSingleNode(rxNode, "./atom:" + rName); } catch (const xml::xpath::XPathException &) { // ignore return 0; @@ -593,9 +591,9 @@ UpdateInformationProvider::getUpdateInformationEnumeration( rtl::OUString aXPathExpression; if( !extensionId.isEmpty() ) - aXPathExpression = UNISTRING("//atom:entry/atom:category[@term=\'") + extensionId + UNISTRING("\']/.."); + aXPathExpression = "//atom:entry/atom:category[@term=\'" + extensionId + "\']/.."; else - aXPathExpression = UNISTRING("//atom:entry"); + aXPathExpression = "//atom:entry"; uno::Reference< xml::dom::XNodeList > xNodeList; try { @@ -740,7 +738,7 @@ uno::Sequence< rtl::OUString > UpdateInformationProvider::getServiceNames() { uno::Sequence< rtl::OUString > aServiceList(1); - aServiceList[0] = UNISTRING( "com.sun.star.deployment.UpdateInformationProvider"); + aServiceList[0] = "com.sun.star.deployment.UpdateInformationProvider"; return aServiceList; }; @@ -749,7 +747,7 @@ UpdateInformationProvider::getServiceNames() rtl::OUString UpdateInformationProvider::getImplName() { - return UNISTRING( "vnd.sun.UpdateInformationProvider"); + return OUString("vnd.sun.UpdateInformationProvider"); } //------------------------------------------------------------------------------ diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx index 441a57eca717..f5565f38742a 100644 --- a/extensions/source/update/ui/updatecheckui.cxx +++ b/extensions/source/update/ui/updatecheckui.cxx @@ -51,8 +51,6 @@ #include "updatecheckui.hrc" -#define UNISTRING(s) rtl::OUString(s) - #define MSG_ERR_NO_WEBBROWSER_FOUND (RID_SFX_APP_START + 7) #define PROPERTY_TITLE RTL_CONSTASCII_STRINGPARAM("BubbleHeading") @@ -69,7 +67,7 @@ using namespace ::com::sun::star; static uno::Sequence< rtl::OUString > getServiceNames() { uno::Sequence< rtl::OUString > aServiceList(1); - aServiceList[0] = UNISTRING( "com.sun.star.setup.UpdateCheckUI"); + aServiceList[0] = "com.sun.star.setup.UpdateCheckUI"; return aServiceList; } @@ -77,7 +75,7 @@ static uno::Sequence< rtl::OUString > getServiceNames() static rtl::OUString getImplementationName() { - return UNISTRING( "vnd.sun.UpdateCheckUI"); + return "vnd.sun.UpdateCheckUI"; } //------------------------------------------------------------------------------ @@ -244,7 +242,7 @@ UpdateCheckUI::getGlobalEventBroadcaster() const throw (uno::RuntimeException) { if( !m_xContext.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheckUI: empty component context" ), + "UpdateCheckUI: empty component context", uno::Reference< uno::XInterface >() ); return uno::Reference<document::XEventBroadcaster> ( @@ -308,7 +306,7 @@ Image UpdateCheckUI::GetBubbleImage( ::rtl::OUString &rURL ) if( !xContext.is() ) throw uno::RuntimeException( - UNISTRING( "UpdateCheckUI: unable to obtain service manager from component context" ), + "UpdateCheckUI: unable to obtain service manager from component context", uno::Reference< uno::XInterface >() ); try diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index 5aedf0d7b05b..700b2cd05e0f 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -65,7 +65,6 @@ #include <map> #include <string.h> -#define USTR(x) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) #define OASIS_STR "urn:oasis:names:tc:opendocument:xmlns:" using namespace ::com::sun::star; @@ -506,10 +505,10 @@ struct AnnotatingVisitor // should the optimizeGradientStops method decide that // this is a three-color gradient, it prolly wanted us // to take axial instead - xAttrs->AddAttribute( USTR("draw:style"), + xAttrs->AddAttribute( "draw:style", rState.maFillGradient.maStops.size() == 3 ? - USTR("axial") : - USTR("linear") ); + OUString("axial") : + OUString("linear") ); } else { @@ -1354,7 +1353,7 @@ struct ShapeWritingVisitor } case XML_PATH: { - rtl::OUString sPath = xElem->hasAttribute("d") ? xElem->getAttribute("d") : USTR(""); + rtl::OUString sPath = xElem->hasAttribute("d") ? xElem->getAttribute("d") : ""; basegfx::B2DPolyPolygon aPoly; basegfx::tools::importFromSvgD(aPoly, sPath); @@ -1469,7 +1468,7 @@ struct ShapeWritingVisitor } } - rtl::OUString sValue = xElem->hasAttribute("href") ? xElem->getAttribute("href") : USTR(""); + rtl::OUString sValue = xElem->hasAttribute("href") ? xElem->getAttribute("href") : ""; rtl::OString aValueUtf8( sValue.getStr(), sValue.getLength(), RTL_TEXTENCODING_UTF8 ); std::string sLinkValue; parseXlinkHref(aValueUtf8.getStr(), sLinkValue); @@ -1943,20 +1942,20 @@ sal_Bool SVGReader::parseAndConvert() rtl::Reference<SvXMLAttributeList> xAttrs( new SvXMLAttributeList() ); uno::Reference<xml::sax::XAttributeList> xUnoAttrs( xAttrs.get() ); - xAttrs->AddAttribute( "xmlns:office", USTR( OASIS_STR "office:1.0" )); - xAttrs->AddAttribute( "xmlns:style", USTR( OASIS_STR "style:1.0" )); - xAttrs->AddAttribute( "xmlns:text", USTR( OASIS_STR "text:1.0" )); - xAttrs->AddAttribute( "xmlns:svg", USTR( OASIS_STR "svg-compatible:1.0" )); - xAttrs->AddAttribute( "xmlns:table", USTR( OASIS_STR "table:1.0" )); - xAttrs->AddAttribute( "xmlns:draw", USTR( OASIS_STR "drawing:1.0" )); - xAttrs->AddAttribute( "xmlns:fo", USTR( OASIS_STR "xsl-fo-compatible:1.0" )); + xAttrs->AddAttribute( "xmlns:office", OASIS_STR "office:1.0" ); + xAttrs->AddAttribute( "xmlns:style", OASIS_STR "style:1.0" ); + xAttrs->AddAttribute( "xmlns:text", OASIS_STR "text:1.0" ); + xAttrs->AddAttribute( "xmlns:svg", OASIS_STR "svg-compatible:1.0" ); + xAttrs->AddAttribute( "xmlns:table", OASIS_STR "table:1.0" ); + xAttrs->AddAttribute( "xmlns:draw", OASIS_STR "drawing:1.0" ); + xAttrs->AddAttribute( "xmlns:fo", OASIS_STR "xsl-fo-compatible:1.0" ); xAttrs->AddAttribute( "xmlns:xlink", "http://www.w3.org/1999/xlink"); xAttrs->AddAttribute( "xmlns:dc", "http://purl.org/dc/elements/1.1/"); - xAttrs->AddAttribute( "xmlns:number", USTR( OASIS_STR "datastyle:1.0" )); - xAttrs->AddAttribute( "xmlns:presentation", USTR( OASIS_STR "presentation:1.0" )); + xAttrs->AddAttribute( "xmlns:number", OASIS_STR "datastyle:1.0" ); + xAttrs->AddAttribute( "xmlns:presentation", OASIS_STR "presentation:1.0" ); xAttrs->AddAttribute( "xmlns:math", "http://www.w3.org/1998/Math/MathML"); - xAttrs->AddAttribute( "xmlns:form", USTR( OASIS_STR "form:1.0" )); - xAttrs->AddAttribute( "xmlns:script", USTR( OASIS_STR "script:1.0" )); + xAttrs->AddAttribute( "xmlns:form", OASIS_STR "form:1.0" ); + xAttrs->AddAttribute( "xmlns:script", OASIS_STR "script:1.0" ); xAttrs->AddAttribute( "xmlns:dom", "http://www.w3.org/2001/xml-events"); xAttrs->AddAttribute( "xmlns:xforms", "http://www.w3.org/2002/xforms"); xAttrs->AddAttribute( "xmlns:xsd", "http://www.w3.org/2001/XMLSchema"); @@ -2037,10 +2036,8 @@ sal_Bool SVGReader::parseAndConvert() xAttrs->AddAttribute( "fo:margin-right", "0mm"); xAttrs->AddAttribute( "fo:page-width", rtl::OUString::valueOf(fViewPortWidth)+"mm"); xAttrs->AddAttribute( "fo:page-height", rtl::OUString::valueOf(fViewPortHeight)+"mm"); - xAttrs->AddAttribute( USTR("style:print-orientation"), - fViewPortWidth > fViewPortHeight ? - USTR("landscape") : - USTR("portrait")); + xAttrs->AddAttribute( "style:print-orientation", + fViewPortWidth > fViewPortHeight ? OUString("landscape") : OUString("portrait") ); m_xDocumentHandler->startElement( "style:page-layout-properties", xUnoAttrs ); m_xDocumentHandler->endElement( "style:page-layout-properties" ); m_xDocumentHandler->endElement( "style:page-layout" ); diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 02c278403547..9aff26e458b0 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -105,8 +105,8 @@ using namespace ExtendedFilePickerElementIds; using namespace CommonFilePickerElementIds; using namespace InternalFilePickerElementIds; -#define IODLG_CONFIGNAME String(RTL_CONSTASCII_USTRINGPARAM("FileDialog")) -#define IMPGRF_CONFIGNAME String(RTL_CONSTASCII_USTRINGPARAM("ImportGraphicDialog")) +#define IODLG_CONFIGNAME OUString("FileDialog") +#define IMPGRF_CONFIGNAME OUString("ImportGraphicDialog") #define GET_DECODED_NAME(aObj) \ aObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ) diff --git a/framework/source/dispatch/oxt_handler.cxx b/framework/source/dispatch/oxt_handler.cxx index b8885ca2d8fc..52ff88e6f165 100644 --- a/framework/source/dispatch/oxt_handler.cxx +++ b/framework/source/dispatch/oxt_handler.cxx @@ -34,8 +34,6 @@ namespace framework{ -#define UNISTRING(s) rtl::OUString(s) - //***************************************************************************************************************** // XInterface, XTypeProvider, XServiceInfo //***************************************************************************************************************** @@ -141,7 +139,7 @@ void SAL_CALL Oxt_Handler::dispatchWithNotification( const css::util::URL& aURL, // SAFE { ResetableGuard aLock( m_aLock ); - rtl::OUString sServiceName = UNISTRING( "com.sun.star.deployment.ui.PackageManagerDialog" ); + rtl::OUString sServiceName = "com.sun.star.deployment.ui.PackageManagerDialog"; css::uno::Sequence< css::uno::Any > lParams(1); lParams[0] <<= aURL.Main; @@ -205,7 +203,7 @@ void SAL_CALL Oxt_Handler::dispatch( const css::util::URL& ::rtl::OUString sURL = aDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_URL(), ::rtl::OUString() ); long nLength = sURL.getLength(); - if ( ( nLength > 4 ) && sURL.matchIgnoreAsciiCase( UNISTRING(".oxt"), nLength-4 ) ) + if ( ( nLength > 4 ) && sURL.matchIgnoreAsciiCase( ".oxt", nLength-4 ) ) { // "IsSoundFile" idffer between different "wav" and "au" file versions ... // couldn't return this information ... because: He use the OS to detect it! diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index 5db956ddcd22..6bbdb003c06f 100644 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -51,13 +51,11 @@ #define STRPOS_NOTFOUND (sal_Int32)-1 -#define ASCII_STR( val ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( val )) - #define SEARCHPATH_DELIMITER ';' // Variable start/end characters -#define SIGN_STARTVARIABLE ASCII_STR("$(") -#define SIGN_ENDVARIABLE ASCII_STR(")") +#define SIGN_STARTVARIABLE "$(" +#define SIGN_ENDVARIABLE ")" // Length of SUBSTITUTE_... to replace it with real values. #define REPLACELENGTH_INST 7 diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx index 6e282a73793a..7f03b21dde1a 100644 --- a/pyuno/source/module/pyuno_runtime.cxx +++ b/pyuno/source/module/pyuno_runtime.cxx @@ -69,7 +69,6 @@ using com::sun::star::beans::Introspection; namespace pyuno { -#define USTR_ASCII(x) OUString( x ) static PyTypeObject RuntimeImpl_Type = { @@ -184,7 +183,7 @@ static void readLoggingConfig( sal_Int32 *pLevel, FILE **ppFile ) rtl::Bootstrap bootstrapHandle( fileName ); OUString str; - if( bootstrapHandle.getFrom( USTR_ASCII( "PYUNO_LOGLEVEL" ), str ) ) + if( bootstrapHandle.getFrom( "PYUNO_LOGLEVEL", str ) ) { if ( str == "NONE" ) *pLevel = LogLevel::NONE; @@ -201,7 +200,7 @@ static void readLoggingConfig( sal_Int32 *pLevel, FILE **ppFile ) if( *pLevel > LogLevel::NONE ) { *ppFile = stdout; - if( bootstrapHandle.getFrom( USTR_ASCII( "PYUNO_LOGTARGET" ), str ) ) + if( bootstrapHandle.getFrom( "PYUNO_LOGTARGET", str ) ) { if ( str == "stdout" ) *ppFile = stdout; @@ -767,7 +766,7 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con else { throw RuntimeException( - USTR_ASCII( "struct or exception wrapper does not support XMaterialHolder" ), + "struct or exception wrapper does not support XMaterialHolder", Reference< XInterface > () ); } } @@ -785,7 +784,7 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con if (!my_mh.is ()) { throw RuntimeException( - USTR_ASCII( "struct wrapper does not support XMaterialHolder" ), + "struct wrapper does not support XMaterialHolder", Reference< XInterface > () ); } else diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx index d30e07dd0f83..d03368ab136f 100644 --- a/pyuno/source/module/pyuno_type.cxx +++ b/pyuno/source/module/pyuno_type.cxx @@ -37,7 +37,6 @@ using com::sun::star::uno::XInterface; using com::sun::star::uno::Reference; using com::sun::star::uno::TypeDescription; -#define USTR_ASCII(x) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) namespace pyuno { const char *typeClassToString( TypeClass t ) @@ -142,14 +141,14 @@ sal_Unicode PyChar2Unicode( PyObject *obj ) throw ( RuntimeException ) if( ! PyUnicode_Check( value.get() ) ) { throw RuntimeException( - USTR_ASCII( "attribute value of uno.Char is not a unicode string" ), + "attribute value of uno.Char is not a unicode string", Reference< XInterface > () ); } if( PyUnicode_GetSize( value.get() ) < 1 ) { throw RuntimeException( - USTR_ASCII( "uno.Char contains an empty unicode string" ), + "uno.Char contains an empty unicode string", Reference< XInterface > () ); } @@ -165,7 +164,7 @@ Any PyEnum2Enum( PyObject *obj ) throw ( RuntimeException ) if( !PyStr_Check( typeName.get() ) || ! PyStr_Check( value.get() ) ) { throw RuntimeException( - USTR_ASCII( "attributes typeName and/or value of uno.Enum are not strings" ), + "attributes typeName and/or value of uno.Enum are not strings", Reference< XInterface > () ); } @@ -221,7 +220,7 @@ Type PyType2Type( PyObject * o ) throw(RuntimeException ) if( !PyStr_Check( pyName.get() ) ) { throw RuntimeException( - USTR_ASCII( "type object does not have typeName property" ), + "type object does not have typeName property", Reference< XInterface > () ); } diff --git a/sdext/source/pdfimport/inc/pdfihelper.hxx b/sdext/source/pdfimport/inc/pdfihelper.hxx index 3749b6cdfa76..2db7b555b4cd 100644 --- a/sdext/source/pdfimport/inc/pdfihelper.hxx +++ b/sdext/source/pdfimport/inc/pdfihelper.hxx @@ -191,8 +191,6 @@ namespace pdfi com::sun::star::task::XInteractionHandler > const & handler); } -#define USTR(x) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx index 4a8e6a9d985f..8f4c16c22a5a 100644 --- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx +++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx @@ -75,10 +75,10 @@ void DrawXmlEmitter::visit( HyperlinkElement& elem, const std::list< Element* >: const char* pType = dynamic_cast<DrawElement*>(elem.Children.front()) ? "draw:a" : "text:a"; PropertyMap aProps; - aProps[ USTR( "xlink:type" ) ] = USTR( "simple" ); - aProps[ USTR( "xlink:href" ) ] = elem.URI; - aProps[ USTR( "office:target-frame-name" ) ] = USTR( "_blank" ); - aProps[ USTR( "xlink:show" ) ] = USTR( "new" ); + aProps[ "xlink:type" ] = "simple"; + aProps[ "xlink:href" ] = elem.URI; + aProps[ "office:target-frame-name" ] = "_blank"; + aProps[ "xlink:show" ] = "new"; m_rEmitContext.rEmitter.beginTag( pType, aProps ); std::list< Element* >::iterator this_it = elem.Children.begin(); @@ -134,7 +134,7 @@ void DrawXmlEmitter::visit( TextElement& elem, const std::list< Element* >::cons rtl::OUString strToken= str.copy(i,1) ; if( strSpace.equals(strToken) || strNbSpace.equals(strToken)) { - aProps[ USTR( "text:c" ) ] = USTR( "1" ); + aProps[ "text:c" ] = "1"; m_rEmitContext.rEmitter.beginTag( "text:s", aProps ); m_rEmitContext.rEmitter.endTag( "text:s"); } @@ -167,7 +167,7 @@ void DrawXmlEmitter::visit( ParagraphElement& elem, const std::list< Element* >: PropertyMap aProps; if( elem.StyleId != -1 ) { - aProps[ USTR( "text:style-name" ) ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); + aProps[ "text:style-name" ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); } const char* pTagType = "text:p"; if( elem.Type == elem.Headline ) @@ -192,17 +192,17 @@ void DrawXmlEmitter::fillFrameProps( DrawElement& rElem, { double rel_x = rElem.x, rel_y = rElem.y; - rProps[ USTR( "draw:z-index" ) ] = rtl::OUString::valueOf( rElem.ZOrder ); - rProps[ USTR( "draw:style-name" )] = rEmitContext.rStyles.getStyleName( rElem.StyleId ); - rProps[ USTR( "svg:width" ) ] = convertPixelToUnitString( rElem.w ); - rProps[ USTR( "svg:height" ) ] = convertPixelToUnitString( rElem.h ); + rProps[ "draw:z-index" ] = rtl::OUString::valueOf( rElem.ZOrder ); + rProps[ "draw:style-name"] = rEmitContext.rStyles.getStyleName( rElem.StyleId ); + rProps[ "svg:width" ] = convertPixelToUnitString( rElem.w ); + rProps[ "svg:height" ] = convertPixelToUnitString( rElem.h ); const GraphicsContext& rGC = rEmitContext.rProcessor.getGraphicsContext( rElem.GCId ); if( rGC.Transformation.isIdentity() || bWasTransformed ) { - rProps[ USTR( "svg:x" ) ] = convertPixelToUnitString( rel_x ); - rProps[ USTR( "svg:y" ) ] = convertPixelToUnitString( rel_y ); + rProps[ "svg:x" ] = convertPixelToUnitString( rel_x ); + rProps[ "svg:y" ] = convertPixelToUnitString( rel_y ); } else { @@ -245,7 +245,7 @@ void DrawXmlEmitter::fillFrameProps( DrawElement& rElem, aBuf.append( convertPixelToUnitString( rel_y ) ); aBuf.appendAscii( " )" ); - rProps[ USTR( "draw:transform" ) ] = aBuf.makeStringAndClear(); + rProps[ "draw:transform" ] = aBuf.makeStringAndClear(); } } @@ -335,8 +335,8 @@ void DrawXmlEmitter::visit( PolyPolyElement& elem, const std::list< Element* >:: aBuf.append( convPx2mmPrec2(elem.w)*100.0 ); aBuf.append( sal_Unicode(' ') ); aBuf.append( convPx2mmPrec2(elem.h)*100.0 ); - aProps[ USTR( "svg:viewBox" ) ] = aBuf.makeStringAndClear(); - aProps[ USTR( "svg:d" ) ] = basegfx::tools::exportToSvgD( elem.PolyPoly ); + aProps[ "svg:viewBox" ] = aBuf.makeStringAndClear(); + aProps[ "svg:d" ] = basegfx::tools::exportToSvgD( elem.PolyPoly ); m_rEmitContext.rEmitter.beginTag( "draw:path", aProps ); m_rEmitContext.rEmitter.endTag( "draw:path" ); @@ -355,7 +355,7 @@ void DrawXmlEmitter::visit( ImageElement& elem, const std::list< Element* >::con void DrawXmlEmitter::visit( PageElement& elem, const std::list< Element* >::const_iterator& ) { PropertyMap aPageProps; - aPageProps[ USTR( "draw:master-page-name" ) ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); + aPageProps[ "draw:master-page-name" ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); m_rEmitContext.rEmitter.beginTag("draw:page", aPageProps); @@ -772,8 +772,8 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< Element* > // xxx TODO copied from DrawElement const GraphicsContext& rGC = m_rProcessor.getGraphicsContext(elem.GCId ); PropertyMap aProps; - aProps[ USTR( "style:family" ) ] = USTR( "graphic" ); - aProps[ USTR( "style:parent-style-name") ] = USTR( "standard" ); + aProps[ "style:family" ] = "graphic"; + aProps[ "style:parent-style-name" ] = "standard"; // generate standard graphic style if necessary m_rStyleContainer.getStandardStyleId( "graphic" ); @@ -782,8 +782,8 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< Element* > // TODO(F3): proper dash emulation if( elem.Action & PATH_STROKE ) { - aGCProps[ USTR("draw:stroke") ] = rGC.DashArray.empty() ? USTR("solid") : USTR("dash"); - aGCProps[ USTR("svg:stroke-color") ] = getColorString( rGC.LineColor ); + aGCProps[ "draw:stroke" ] = rGC.DashArray.empty() ? OUString("solid") : OUString("dash"); + aGCProps[ "svg:stroke-color" ] = getColorString( rGC.LineColor ); if( rGC.LineWidth != 0.0 ) { ::basegfx::B2DVector aVec(rGC.LineWidth,0); @@ -792,23 +792,23 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< Element* > aVec.setX ( convPx2mmPrec2( aVec.getX() )*100.0 ); aVec.setY ( convPx2mmPrec2( aVec.getY() )*100.0 ); - aGCProps[ USTR("svg:stroke-width") ] = rtl::OUString::valueOf( aVec.getLength() ); + aGCProps[ "svg:stroke-width" ] = rtl::OUString::valueOf( aVec.getLength() ); } } else { - aGCProps[ USTR("draw:stroke") ] = USTR("none"); + aGCProps[ "draw:stroke" ] = "none"; } // TODO(F1): check whether stuff could be emulated by gradient/bitmap/hatch if( elem.Action & (PATH_FILL | PATH_EOFILL) ) { - aGCProps[ USTR("draw:fill") ] = USTR("solid"); - aGCProps[ USTR("draw:fill-color") ] = getColorString( rGC.FillColor ); + aGCProps[ "draw:fill" ] = "solid"; + aGCProps[ "draw:fill-color" ] = getColorString( rGC.FillColor ); } else { - aGCProps[ USTR("draw:fill") ] = USTR("none"); + aGCProps[ "draw:fill" ] = "none"; } StyleContainer::Style aStyle( "style:style", aProps ); @@ -826,51 +826,51 @@ void DrawXmlFinalizer::visit( TextElement& elem, const std::list< Element* >::co { const FontAttributes& rFont = m_rProcessor.getFont( elem.FontId ); PropertyMap aProps; - aProps[ USTR( "style:family" ) ] = USTR( "text" ); + aProps[ "style:family" ] = "text"; PropertyMap aFontProps; // family name - aFontProps[ USTR( "fo:font-family" ) ] = rFont.familyName; - aFontProps[ USTR( "style:font-family-complex" ) ] = rFont.familyName; + aFontProps[ "fo:font-family" ] = rFont.familyName; + aFontProps[ "style:font-family-complex" ] = rFont.familyName; // bold if( rFont.isBold ) { - aFontProps[ USTR( "fo:font-weight" ) ] = USTR( "bold" ); - aFontProps[ USTR( "fo:font-weight-asian" ) ] = USTR( "bold" ); - aFontProps[ USTR( "style:font-weight-complex" ) ] = USTR( "bold" ); + aFontProps[ "fo:font-weight" ] = "bold"; + aFontProps[ "fo:font-weight-asian" ] = "bold"; + aFontProps[ "style:font-weight-complex" ] = "bold"; } // italic if( rFont.isItalic ) { - aFontProps[ USTR( "fo:font-style" ) ] = USTR( "italic" ); - aFontProps[ USTR( "fo:font-style-asian" ) ] = USTR( "italic" ); - aFontProps[ USTR( "style:font-style-complex" ) ] = USTR( "italic" ); + aFontProps[ "fo:font-style" ] = "italic"; + aFontProps[ "fo:font-style-asian" ] = "italic"; + aFontProps[ "style:font-style-complex" ] = "italic"; } // underline if( rFont.isUnderline ) { - aFontProps[ USTR( "style:text-underline-style" ) ] = USTR( "solid" ); - aFontProps[ USTR( "style:text-underline-width" ) ] = USTR( "auto" ); - aFontProps[ USTR( "style:text-underline-color" ) ] = USTR( "font-color" ); + aFontProps[ "style:text-underline-style" ] = "solid"; + aFontProps[ "style:text-underline-width" ] = "auto"; + aFontProps[ "style:text-underline-color" ] = "font-color"; } // outline if( rFont.isOutline ) { - aFontProps[ USTR( "style:text-outline" ) ] = USTR( "true" ); + aFontProps[ "style:text-outline" ] = "true"; } // size rtl::OUStringBuffer aBuf( 32 ); aBuf.append( rFont.size*72/PDFI_OUTDEV_RESOLUTION ); aBuf.appendAscii( "pt" ); rtl::OUString aFSize = aBuf.makeStringAndClear(); - aFontProps[ USTR( "fo:font-size" ) ] = aFSize; - aFontProps[ USTR( "style:font-size-asian" ) ] = aFSize; - aFontProps[ USTR( "style:font-size-complex" ) ] = aFSize; + aFontProps[ "fo:font-size" ] = aFSize; + aFontProps[ "style:font-size-asian" ] = aFSize; + aFontProps[ "style:font-size-complex" ] = aFSize; // color const GraphicsContext& rGC = m_rProcessor.getGraphicsContext( elem.GCId ); - aFontProps[ USTR( "fo:color" ) ] = getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor ); + aFontProps[ "fo:color" ] = getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor ); StyleContainer::Style aStyle( "style:style", aProps ); StyleContainer::Style aSubStyle( "style:text-properties", aFontProps ); @@ -882,17 +882,17 @@ void DrawXmlFinalizer::visit( ParagraphElement& elem, const std::list< Element* { PropertyMap aProps; - aProps[ USTR( "style:family" ) ] = USTR( "paragraph" ); + aProps[ "style:family" ] = "paragraph"; // generate standard paragraph style if necessary m_rStyleContainer.getStandardStyleId( "paragraph" ); PropertyMap aParProps; - aParProps[ USTR("fo:text-align")] = USTR("start"); + aParProps[ "fo:text-align"] = "start"; if (elem.bRtl) - aParProps[ USTR("style:writing-mode")] = USTR("rl-tb"); + aParProps[ "style:writing-mode"] = "rl-tb"; else - aParProps[ USTR("style:writing-mode")] = USTR("lr-tb"); + aParProps[ "style:writing-mode"] = "lr-tb"; StyleContainer::Style aStyle( "style:style", aProps ); StyleContainer::Style aSubStyle( "style:paragraph-properties", aParProps ); @@ -906,32 +906,32 @@ void DrawXmlFinalizer::visit( ParagraphElement& elem, const std::list< Element* void DrawXmlFinalizer::visit( FrameElement& elem, const std::list< Element* >::const_iterator&) { PropertyMap aProps; - aProps[ USTR( "style:family" ) ] = USTR( "graphic" ); - aProps[ USTR( "style:parent-style-name") ] = USTR( "standard" ); + aProps[ "style:family" ] = "graphic"; + aProps[ "style:parent-style-name" ] = "standard"; // generate standard graphic style if necessary m_rStyleContainer.getStandardStyleId( "graphic" ); PropertyMap aGCProps; - aGCProps[ USTR("draw:stroke") ] = USTR("none"); - aGCProps[ USTR("draw:fill") ] = USTR("none"); - aGCProps[ USTR("draw:auto-grow-height") ] = USTR("true"); - aGCProps[ USTR("draw:auto-grow-width") ] = USTR("true"); - aGCProps[ USTR("draw:textarea-horizontal-align") ] = USTR("left"); - aGCProps[ USTR("draw:textarea-vertical-align") ] = USTR("top"); - aGCProps[ USTR("fo:min-height")] = USTR("0cm"); - aGCProps[ USTR("fo:min-width")] = USTR("0cm"); - aGCProps[ USTR("fo:padding-top") ] = USTR("0cm"); - aGCProps[ USTR("fo:padding-left") ] = USTR("0cm"); - aGCProps[ USTR("fo:padding-right") ] = USTR("0cm"); - aGCProps[ USTR("fo:padding-bottom") ] = USTR("0cm"); + aGCProps[ "draw:stroke" ] = "none"; + aGCProps[ "draw:fill" ] = "none"; + aGCProps[ "draw:auto-grow-height" ] = "true"; + aGCProps[ "draw:auto-grow-width" ] = "true"; + aGCProps[ "draw:textarea-horizontal-align" ] = "left"; + aGCProps[ "draw:textarea-vertical-align" ] = "top"; + aGCProps[ "fo:min-height"] = "0cm"; + aGCProps[ "fo:min-width"] = "0cm"; + aGCProps[ "fo:padding-top" ] = "0cm"; + aGCProps[ "fo:padding-left" ] = "0cm"; + aGCProps[ "fo:padding-right" ] = "0cm"; + aGCProps[ "fo:padding-bottom" ] = "0cm"; // remark: vertical mirroring is done in current OOO by // mirroring horzontally and rotating 180 degrees // this is quaint, but unfortunately it seems // mirror=vertical is defined but not implemented in current code if( elem.MirrorVertical ) - aGCProps[ USTR("style:mirror") ] = USTR("horizontal"); + aGCProps[ "style:mirror" ] = "horizontal"; StyleContainer::Style aStyle( "style:style", aProps ); StyleContainer::Style aSubStyle( "style:graphic-properties", aGCProps ); @@ -1015,14 +1015,14 @@ void DrawXmlFinalizer::visit( PageElement& elem, const std::list< Element* >::co PropertyMap aPageProps; PropertyMap aPageLayoutProps; rtl::OUStringBuffer aBuf( 64 ); - aPageLayoutProps[ USTR( "fo:margin-top" ) ] = unitMMString( top_margin ); - aPageLayoutProps[ USTR( "fo:margin-bottom" ) ] = unitMMString( bottom_margin ); - aPageLayoutProps[ USTR( "fo:margin-left" ) ] = unitMMString( left_margin ); - aPageLayoutProps[ USTR( "fo:margin-right" ) ] = unitMMString( right_margin ); - aPageLayoutProps[ USTR( "fo:page-width" ) ] = unitMMString( page_width ); - aPageLayoutProps[ USTR( "fo:page-height" ) ] = unitMMString( page_height ); - aPageLayoutProps[ USTR( "style:print-orientation" ) ]= elem.w < elem.h ? USTR( "portrait" ) : USTR( "landscape" ); - aPageLayoutProps[ USTR( "style:writing-mode" ) ]= USTR( "lr-tb" ); + aPageLayoutProps[ "fo:margin-top" ] = unitMMString( top_margin ); + aPageLayoutProps[ "fo:margin-bottom" ] = unitMMString( bottom_margin ); + aPageLayoutProps[ "fo:margin-left" ] = unitMMString( left_margin ); + aPageLayoutProps[ "fo:margin-right" ] = unitMMString( right_margin ); + aPageLayoutProps[ "fo:page-width" ] = unitMMString( page_width ); + aPageLayoutProps[ "fo:page-height" ] = unitMMString( page_height ); + aPageLayoutProps[ "style:print-orientation" ]= elem.w < elem.h ? OUString("portrait") : OUString("landscape"); + aPageLayoutProps[ "style:writing-mode" ]= "lr-tb"; StyleContainer::Style aStyle( "style:page-layout", aPageProps); StyleContainer::Style aSubStyle( "style:page-layout-properties", aPageLayoutProps); @@ -1031,7 +1031,7 @@ void DrawXmlFinalizer::visit( PageElement& elem, const std::list< Element* >::co // create master page rtl::OUString aMasterPageLayoutName = m_rStyleContainer.getStyleName( nPageStyle ); - aPageProps[ USTR( "style:page-layout-name" ) ] = aMasterPageLayoutName; + aPageProps[ "style:page-layout-name" ] = aMasterPageLayoutName; StyleContainer::Style aMPStyle( "style:master-page", aPageProps); diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx index 01585e556b99..0e9955f10192 100644 --- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx +++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx @@ -80,7 +80,7 @@ namespace pdfi m_bMirrorMapperTried(false) { FontAttributes aDefFont; - aDefFont.familyName = USTR("Helvetica"); + aDefFont.familyName = "Helvetica"; aDefFont.isBold = false; aDefFont.isItalic = false; aDefFont.size = 10*PDFI_OUTDEV_RESOLUTION/72; @@ -824,26 +824,26 @@ void PDFIProcessor::emit( XmlEmitter& rEmitter, PropertyMap aProps; // document prolog #define OASIS_STR "urn:oasis:names:tc:opendocument:xmlns:" - aProps[ USTR( "xmlns:office" ) ] = USTR( OASIS_STR "office:1.0" ); - aProps[ USTR( "xmlns:style" ) ] = USTR( OASIS_STR "style:1.0" ); - aProps[ USTR( "xmlns:text" ) ] = USTR( OASIS_STR "text:1.0" ); - aProps[ USTR( "xmlns:svg" ) ] = USTR( OASIS_STR "svg-compatible:1.0" ); - aProps[ USTR( "xmlns:table" ) ] = USTR( OASIS_STR "table:1.0" ); - aProps[ USTR( "xmlns:draw" ) ] = USTR( OASIS_STR "drawing:1.0" ); - aProps[ USTR( "xmlns:fo" ) ] = USTR( OASIS_STR "xsl-fo-compatible:1.0" ); - aProps[ USTR( "xmlns:xlink" )] = USTR( "http://www.w3.org/1999/xlink" ); - aProps[ USTR( "xmlns:dc" )] = USTR( "http://purl.org/dc/elements/1.1/" ); - aProps[ USTR( "xmlns:number" )] = USTR( OASIS_STR "datastyle:1.0" ); - aProps[ USTR( "xmlns:presentation" )] = USTR( OASIS_STR "presentation:1.0" ); - aProps[ USTR( "xmlns:math" )] = USTR( "http://www.w3.org/1998/Math/MathML" ); - aProps[ USTR( "xmlns:form" )] = USTR( OASIS_STR "form:1.0" ); - aProps[ USTR( "xmlns:script" )] = USTR( OASIS_STR "script:1.0" ); - aProps[ USTR( "xmlns:dom" )] = USTR( "http://www.w3.org/2001/xml-events" ); - aProps[ USTR( "xmlns:xforms" )] = USTR( "http://www.w3.org/2002/xforms" ); - aProps[ USTR( "xmlns:xsd" )] = USTR( "http://www.w3.org/2001/XMLSchema" ); - aProps[ USTR( "xmlns:xsi" )] = USTR( "http://www.w3.org/2001/XMLSchema-instance" ); - aProps[ USTR( "office:version" ) ] = USTR( "1.0" ); - aProps[ USTR( "office:version" ) ] = USTR( "1.0" ); + aProps[ "xmlns:office" ] = OASIS_STR "office:1.0" ; + aProps[ "xmlns:style" ] = OASIS_STR "style:1.0" ; + aProps[ "xmlns:text" ] = OASIS_STR "text:1.0" ; + aProps[ "xmlns:svg" ] = OASIS_STR "svg-compatible:1.0" ; + aProps[ "xmlns:table" ] = OASIS_STR "table:1.0" ; + aProps[ "xmlns:draw" ] = OASIS_STR "drawing:1.0" ; + aProps[ "xmlns:fo" ] = OASIS_STR "xsl-fo-compatible:1.0" ; + aProps[ "xmlns:xlink"] = "http://www.w3.org/1999/xlink"; + aProps[ "xmlns:dc"] = "http://purl.org/dc/elements/1.1/"; + aProps[ "xmlns:number"] = OASIS_STR "datastyle:1.0" ; + aProps[ "xmlns:presentation"] = OASIS_STR "presentation:1.0" ; + aProps[ "xmlns:math"] = "http://www.w3.org/1998/Math/MathML"; + aProps[ "xmlns:form"] = OASIS_STR "form:1.0" ; + aProps[ "xmlns:script"] = OASIS_STR "script:1.0" ; + aProps[ "xmlns:dom"] = "http://www.w3.org/2001/xml-events"; + aProps[ "xmlns:xforms"] = "http://www.w3.org/2002/xforms"; + aProps[ "xmlns:xsd"] = "http://www.w3.org/2001/XMLSchema"; + aProps[ "xmlns:xsi"] = "http://www.w3.org/2001/XMLSchema-instance"; + aProps[ "office:version" ] = "1.0"; + aProps[ "office:version" ] = "1.0"; aContext.rEmitter.beginTag( "office:document", aProps ); diff --git a/sdext/source/pdfimport/tree/style.cxx b/sdext/source/pdfimport/tree/style.cxx index 1028eb902533..772e81f35690 100644 --- a/sdext/source/pdfimport/tree/style.cxx +++ b/sdext/source/pdfimport/tree/style.cxx @@ -31,8 +31,6 @@ using namespace pdfi; using ::rtl::OUString; using ::rtl::OUStringBuffer; -#define USTR(x) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( x ) ) - StyleContainer::StyleContainer() : m_nNextId( 1 ) { @@ -80,8 +78,8 @@ sal_Int32 StyleContainer::impl_getStyleId( const Style& rStyle, bool bSubStyle ) sal_Int32 StyleContainer::getStandardStyleId( const rtl::OString& rName ) { PropertyMap aProps; - aProps[ USTR( "style:family" ) ] = rtl::OStringToOUString( rName, RTL_TEXTENCODING_UTF8 ); - aProps[ USTR( "style:name" ) ] = USTR( "standard" ); + aProps[ "style:family" ] = rtl::OStringToOUString( rName, RTL_TEXTENCODING_UTF8 ); + aProps[ "style:name" ] = "standard"; Style aStyle( "style:style", aProps ); return getStyleId( aStyle ); @@ -157,12 +155,12 @@ OUString StyleContainer::getStyleName( sal_Int32 nStyle ) const { const HashedStyle& rStyle = style_it->second; - PropertyMap::const_iterator name_it = rStyle.Properties.find( USTR("style:name") ); + PropertyMap::const_iterator name_it = rStyle.Properties.find( "style:name" ); if( name_it != rStyle.Properties.end() ) aRet.append( name_it->second ); else { - PropertyMap::const_iterator fam_it = rStyle.Properties.find( USTR("style:family" ) ); + PropertyMap::const_iterator fam_it = rStyle.Properties.find( "style:family" ); OUString aStyleName; if( fam_it != rStyle.Properties.end() ) { @@ -194,7 +192,7 @@ void StyleContainer::impl_emitStyle( sal_Int32 nStyleId, const HashedStyle& rStyle = it->second; PropertyMap aProps( rStyle.Properties ); if( !rStyle.IsSubStyle ) - aProps[ USTR( "style:name" ) ] = getStyleName( nStyleId ); + aProps[ "style:name" ] = getStyleName( nStyleId ); rContext.rEmitter.beginTag( rStyle.Name.getStr(), aProps ); for( unsigned int n = 0; n < rStyle.SubStyles.size(); ++n ) diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx index 1804d4c07caf..6f7fe57b326b 100644 --- a/sdext/source/pdfimport/tree/writertreevisiting.cxx +++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx @@ -41,10 +41,10 @@ void WriterXmlEmitter::visit( HyperlinkElement& elem, const std::list< Element* const char* pType = dynamic_cast<DrawElement*>(elem.Children.front()) ? "draw:a" : "text:a"; PropertyMap aProps; - aProps[ USTR( "xlink:type" ) ] = USTR( "simple" ); - aProps[ USTR( "xlink:href" ) ] = elem.URI; - aProps[ USTR( "office:target-frame-name" ) ] = USTR( "_blank" ); - aProps[ USTR( "xlink:show" ) ] = USTR( "new" ); + aProps[ "xlink:type" ] = "simple"; + aProps[ "xlink:href" ] = elem.URI; + aProps[ "office:target-frame-name" ] = "_blank"; + aProps[ "xlink:show" ] = "new"; m_rEmitContext.rEmitter.beginTag( pType, aProps ); std::list< Element* >::iterator this_it = elem.Children.begin(); @@ -85,7 +85,7 @@ void WriterXmlEmitter::visit( ParagraphElement& elem, const std::list< Element* PropertyMap aProps; if( elem.StyleId != -1 ) { - aProps[ USTR( "text:style-name" ) ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); + aProps[ "text:style-name" ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); } const char* pTagType = "text:p"; if( elem.Type == elem.Headline ) @@ -120,23 +120,23 @@ void WriterXmlEmitter::fillFrameProps( DrawElement& rElem, { if( dynamic_cast<ParagraphElement*>(pAnchor) ) { - rProps[ USTR( "text:anchor-type" ) ] = - rElem.isCharacter ? USTR( "character" ) : USTR( "paragraph" ); + rProps[ "text:anchor-type" ] = + rElem.isCharacter ? "character" : "paragraph"; } else { PageElement* pPage = dynamic_cast<PageElement*>(pAnchor); - rProps[ USTR( "text:anchor-type" ) ] = USTR( "page" ); - rProps[ USTR( "text:anchor-page-number" ) ] = rtl::OUString::valueOf(pPage->PageNumber); + rProps[ "text:anchor-type" ] = "page"; + rProps[ "text:anchor-page-number" ] = rtl::OUString::valueOf(pPage->PageNumber); } rel_x -= pAnchor->x; rel_y -= pAnchor->y; } - rProps[ USTR( "draw:z-index" ) ] = rtl::OUString::valueOf( rElem.ZOrder ); - rProps[ USTR( "draw:style-name" )] = rEmitContext.rStyles.getStyleName( rElem.StyleId ); - rProps[ USTR( "svg:width" ) ] = convertPixelToUnitString( rElem.w ); - rProps[ USTR( "svg:height" ) ] = convertPixelToUnitString( rElem.h ); + rProps[ "draw:z-index" ] = rtl::OUString::valueOf( rElem.ZOrder ); + rProps[ "draw:style-name"] = rEmitContext.rStyles.getStyleName( rElem.StyleId ); + rProps[ "svg:width" ] = convertPixelToUnitString( rElem.w ); + rProps[ "svg:height" ] = convertPixelToUnitString( rElem.h ); const GraphicsContext& rGC = rEmitContext.rProcessor.getGraphicsContext( rElem.GCId ); @@ -144,8 +144,8 @@ void WriterXmlEmitter::fillFrameProps( DrawElement& rElem, { if( !rElem.isCharacter ) { - rProps[ USTR( "svg:x" ) ] = convertPixelToUnitString( rel_x ); - rProps[ USTR( "svg:y" ) ] = convertPixelToUnitString( rel_y ); + rProps[ "svg:x" ] = convertPixelToUnitString( rel_x ); + rProps[ "svg:y" ] = convertPixelToUnitString( rel_y ); } } else @@ -187,7 +187,7 @@ void WriterXmlEmitter::fillFrameProps( DrawElement& rElem, aBuf.appendAscii( " )" ); } - rProps[ USTR( "draw:transform" ) ] = aBuf.makeStringAndClear(); + rProps[ "draw:transform" ] = aBuf.makeStringAndClear(); } } @@ -274,8 +274,8 @@ void WriterXmlEmitter::visit( PolyPolyElement& elem, const std::list< Element* > aBuf.append( convPx2mmPrec2(elem.w)*100.0 ); aBuf.append( sal_Unicode(' ') ); aBuf.append( convPx2mmPrec2(elem.h)*100.0 ); - aProps[ USTR( "svg:viewBox" ) ] = aBuf.makeStringAndClear(); - aProps[ USTR( "svg:d" ) ] = basegfx::tools::exportToSvgD( elem.PolyPoly ); + aProps[ "svg:viewBox" ] = aBuf.makeStringAndClear(); + aProps[ "svg:d" ] = basegfx::tools::exportToSvgD( elem.PolyPoly ); m_rEmitContext.rEmitter.beginTag( "draw:path", aProps ); m_rEmitContext.rEmitter.endTag( "draw:path" ); @@ -839,15 +839,15 @@ void WriterXmlFinalizer::visit( PolyPolyElement& elem, const std::list< Element* // xxx TODO copied from DrawElement const GraphicsContext& rGC = m_rProcessor.getGraphicsContext(elem.GCId ); PropertyMap aProps; - aProps[ USTR( "style:family" ) ] = USTR( "graphic" ); + aProps[ "style:family" ] = "graphic"; PropertyMap aGCProps; // TODO(F3): proper dash emulation if( elem.Action & PATH_STROKE ) { - aGCProps[ USTR("draw:stroke") ] = rGC.DashArray.empty() ? USTR("solid") : USTR("dash"); - aGCProps[ USTR("svg:stroke-color") ] = getColorString( rGC.LineColor ); + aGCProps[ "draw:stroke" ] = rGC.DashArray.empty() ? OUString("solid") : OUString("dash"); + aGCProps[ "svg:stroke-color" ] = getColorString( rGC.LineColor ); if( rGC.LineWidth != 0.0 ) { ::basegfx::B2DVector aVec(rGC.LineWidth,0); @@ -856,23 +856,23 @@ void WriterXmlFinalizer::visit( PolyPolyElement& elem, const std::list< Element* aVec.setX ( convPx2mmPrec2( aVec.getX() )*100.0 ); aVec.setY ( convPx2mmPrec2( aVec.getY() )*100.0 ); - aGCProps[ USTR("svg:stroke-width") ] = rtl::OUString::valueOf( aVec.getLength() ); + aGCProps[ "svg:stroke-width" ] = rtl::OUString::valueOf( aVec.getLength() ); } } else { - aGCProps[ USTR("draw:stroke") ] = USTR("none"); + aGCProps[ "draw:stroke" ] = "none"; } // TODO(F1): check whether stuff could be emulated by gradient/bitmap/hatch if( elem.Action & (PATH_FILL | PATH_EOFILL) ) { - aGCProps[ USTR("draw:fill") ] = USTR("solid"); - aGCProps[ USTR("draw:fill-color") ] = getColorString( rGC.FillColor ); + aGCProps[ "draw:fill" ] = "solid"; + aGCProps[ "draw:fill-color" ] = getColorString( rGC.FillColor ); } else { - aGCProps[ USTR("draw:fill") ] = USTR("none"); + aGCProps[ "draw:fill" ] = "none"; } StyleContainer::Style aStyle( "style:style", aProps ); @@ -890,49 +890,49 @@ void WriterXmlFinalizer::visit( TextElement& elem, const std::list< Element* >:: { const FontAttributes& rFont = m_rProcessor.getFont( elem.FontId ); PropertyMap aProps; - aProps[ USTR( "style:family" ) ] = USTR( "text" ); + aProps[ "style:family" ] = "text"; PropertyMap aFontProps; // family name - aFontProps[ USTR( "fo:font-family" ) ] = rFont.familyName; + aFontProps[ "fo:font-family" ] = rFont.familyName; // bold if( rFont.isBold ) { - aFontProps[ USTR( "fo:font-weight" ) ] = USTR( "bold" ); - aFontProps[ USTR( "fo:font-weight-asian" ) ] = USTR( "bold" ); - aFontProps[ USTR( "fo:font-weight-complex" ) ] = USTR( "bold" ); + aFontProps[ "fo:font-weight" ] = "bold"; + aFontProps[ "fo:font-weight-asian" ] = "bold"; + aFontProps[ "fo:font-weight-complex" ] = "bold"; } // italic if( rFont.isItalic ) { - aFontProps[ USTR( "fo:font-style" ) ] = USTR( "italic" ); - aFontProps[ USTR( "fo:font-style-asian" ) ] = USTR( "italic" ); - aFontProps[ USTR( "fo:font-style-complex" ) ] = USTR( "italic" ); + aFontProps[ "fo:font-style" ] = "italic"; + aFontProps[ "fo:font-style-asian" ] = "italic"; + aFontProps[ "fo:font-style-complex" ] = "italic"; } // underline if( rFont.isUnderline ) { - aFontProps[ USTR( "style:text-underline-style" ) ] = USTR( "solid" ); - aFontProps[ USTR( "style:text-underline-width" ) ] = USTR( "auto" ); - aFontProps[ USTR( "style:text-underline-color" ) ] = USTR( "font-color" ); + aFontProps[ "style:text-underline-style" ] = "solid"; + aFontProps[ "style:text-underline-width" ] = "auto"; + aFontProps[ "style:text-underline-color" ] = "font-color"; } // outline if( rFont.isOutline ) { - aFontProps[ USTR( "style:text-outline" ) ] = USTR( "true" ); + aFontProps[ "style:text-outline" ] = "true"; } // size rtl::OUStringBuffer aBuf( 32 ); aBuf.append( rFont.size*72/PDFI_OUTDEV_RESOLUTION ); aBuf.appendAscii( "pt" ); rtl::OUString aFSize = aBuf.makeStringAndClear(); - aFontProps[ USTR( "fo:font-size" ) ] = aFSize; - aFontProps[ USTR( "style:font-size-asian" ) ] = aFSize; - aFontProps[ USTR( "style:font-size-complex" ) ] = aFSize; + aFontProps[ "fo:font-size" ] = aFSize; + aFontProps[ "style:font-size-asian" ] = aFSize; + aFontProps[ "style:font-size-complex" ] = aFSize; // color const GraphicsContext& rGC = m_rProcessor.getGraphicsContext( elem.GCId ); - aFontProps[ USTR( "fo:color" ) ] = getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor ); + aFontProps[ "fo:color" ] = getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor ); StyleContainer::Style aStyle( "style:style", aProps ); StyleContainer::Style aSubStyle( "style:text-properties", aFontProps ); @@ -969,7 +969,7 @@ void WriterXmlFinalizer::visit( ParagraphElement& elem, const std::list< Element (pPage && fabs( elem.x+elem.w/2 - (pPage->x + pPage->w/2) ) < delta) ) { bIsCenter = true; - aParaProps[ USTR( "fo:text-align" ) ] = USTR( "center" ); + aParaProps[ "fo:text-align" ] = "center"; } } if( ! bIsCenter && elem.x > p_x + p_w/10 ) @@ -978,7 +978,7 @@ void WriterXmlFinalizer::visit( ParagraphElement& elem, const std::list< Element rtl::OUStringBuffer aBuf( 32 ); aBuf.append( convPx2mm( elem.x - p_x ) ); aBuf.appendAscii( "mm" ); - aParaProps[ USTR( "fo:margin-left" ) ] = aBuf.makeStringAndClear(); + aParaProps[ "fo:margin-left" ] = aBuf.makeStringAndClear(); } // check whether to leave some space to next paragraph @@ -994,7 +994,7 @@ void WriterXmlFinalizer::visit( ParagraphElement& elem, const std::list< Element rtl::OUStringBuffer aBuf( 32 ); aBuf.append( convPx2mm( pNextPara->y - (elem.y+elem.h) ) ); aBuf.appendAscii( "mm" ); - aParaProps[ USTR( "fo:margin-bottom" ) ] = aBuf.makeStringAndClear(); + aParaProps[ "fo:margin-bottom" ] = aBuf.makeStringAndClear(); } } } @@ -1002,7 +1002,7 @@ void WriterXmlFinalizer::visit( ParagraphElement& elem, const std::list< Element if( ! aParaProps.empty() ) { PropertyMap aProps; - aProps[ USTR( "style:family" ) ] = USTR( "paragraph" ); + aProps[ "style:family" ] = "paragraph"; StyleContainer::Style aStyle( "style:style", aProps ); StyleContainer::Style aSubStyle( "style:paragraph-properties", aParaProps ); aStyle.SubStyles.push_back( &aSubStyle ); @@ -1015,12 +1015,12 @@ void WriterXmlFinalizer::visit( ParagraphElement& elem, const std::list< Element void WriterXmlFinalizer::visit( FrameElement& elem, const std::list< Element* >::const_iterator&) { PropertyMap aProps; - aProps[ USTR( "style:family" ) ] = USTR( "graphic" ); + aProps[ "style:family" ] = "graphic"; PropertyMap aGCProps; - aGCProps[ USTR("draw:stroke") ] = USTR("none"); - aGCProps[ USTR("draw:fill") ] = USTR("none"); + aGCProps[ "draw:stroke" ] = "none"; + aGCProps[ "draw:fill" ] = "none"; StyleContainer::Style aStyle( "style:style", aProps ); StyleContainer::Style aSubStyle( "style:graphic-properties", aGCProps ); @@ -1046,8 +1046,8 @@ void WriterXmlFinalizer::setFirstOnPage( ParagraphElement& rElem, aProps = *pProps; } - aProps[ USTR( "style:family" ) ] = USTR( "paragraph" ); - aProps[ USTR( "style:master-page-name" ) ] = rMasterPageName; + aProps[ "style:family" ] = "paragraph"; + aProps[ "style:master-page-name" ] = rMasterPageName; if( rElem.StyleId != -1 ) rElem.StyleId = rStyles.setProperties( rElem.StyleId, aProps ); @@ -1146,15 +1146,15 @@ void WriterXmlFinalizer::visit( PageElement& elem, const std::list< Element* >:: PropertyMap aPageProps; PropertyMap aPageLayoutProps; rtl::OUStringBuffer aBuf( 64 ); - aPageLayoutProps[ USTR( "fo:page-width" ) ] = unitMMString( page_width ); - aPageLayoutProps[ USTR( "fo:page-height" ) ] = unitMMString( page_height ); - aPageLayoutProps[ USTR( "style:print-orientation" ) ] - = elem.w < elem.h ? USTR( "portrait" ) : USTR( "landscape" ); - aPageLayoutProps[ USTR( "fo:margin-top" ) ] = unitMMString( top_margin ); - aPageLayoutProps[ USTR( "fo:margin-bottom" ) ] = unitMMString( bottom_margin ); - aPageLayoutProps[ USTR( "fo:margin-left" ) ] = unitMMString( left_margin ); - aPageLayoutProps[ USTR( "fo:margin-right" ) ] = unitMMString( right_margin ); - aPageLayoutProps[ USTR( "style:writing-mode" ) ]= USTR( "lr-tb" ); + aPageLayoutProps[ "fo:page-width" ] = unitMMString( page_width ); + aPageLayoutProps[ "fo:page-height" ] = unitMMString( page_height ); + aPageLayoutProps[ "style:print-orientation" ] + = elem.w < elem.h ? OUString("portrait") : OUString("landscape"); + aPageLayoutProps[ "fo:margin-top" ] = unitMMString( top_margin ); + aPageLayoutProps[ "fo:margin-bottom" ] = unitMMString( bottom_margin ); + aPageLayoutProps[ "fo:margin-left" ] = unitMMString( left_margin ); + aPageLayoutProps[ "fo:margin-right" ] = unitMMString( right_margin ); + aPageLayoutProps[ "style:writing-mode" ]= "lr-tb"; StyleContainer::Style aStyle( "style:page-layout", aPageProps); StyleContainer::Style aSubStyle( "style:page-layout-properties", aPageLayoutProps); @@ -1163,7 +1163,7 @@ void WriterXmlFinalizer::visit( PageElement& elem, const std::list< Element* >:: // create master page rtl::OUString aMasterPageLayoutName = m_rStyleContainer.getStyleName( nPageStyle ); - aPageProps[ USTR( "style:page-layout-name" ) ] = aMasterPageLayoutName; + aPageProps[ "style:page-layout-name" ] = aMasterPageLayoutName; StyleContainer::Style aMPStyle( "style:master-page", aPageProps ); StyleContainer::Style aHeaderStyle( "style:header", PropertyMap() ); StyleContainer::Style aFooterStyle( "style:footer", PropertyMap() ); diff --git a/sfx2/inc/sfx2/sfxuno.hxx b/sfx2/inc/sfx2/sfxuno.hxx index 103806456caf..f622116aaf53 100644 --- a/sfx2/inc/sfx2/sfxuno.hxx +++ b/sfx2/inc/sfx2/sfxuno.hxx @@ -103,11 +103,6 @@ bool GetEncryptionData_Impl( const SfxItemSet* pSet, ::com::sun::star::uno::Sequ #define S2U(STRING) ::rtl::OStringToOUString(STRING, RTL_TEXTENCODING_UTF8) #define U2S(STRING) ::rtl::OUStringToOString(STRING, RTL_TEXTENCODING_UTF8) -// Macro to define const unicode a'la "..." -// It's better then "OUString::createFromAscii(...)" !!! -#define DEFINE_CONST_UNICODE(CONSTASCII) UniString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII)) -#define DEFINE_CONST_OUSTRING(CONSTASCII) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII)) - //________________________________________________________________________________________________________________________ // macros for declaration and definition of uno-services //________________________________________________________________________________________________________________________ diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index 2c47a9d20e1d..2e0018eed17e 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -181,7 +181,7 @@ SfxApplication::SfxApplication() { RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxApplication::SfxApplication" ); - SetName( DEFINE_CONST_UNICODE("StarOffice") ); + SetName( OUString("StarOffice") ); SvtViewOptions::AcquireOptions(); pAppData_Impl = new SfxAppData_Impl( this ); diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 2f28591e51e2..060ecf5227b6 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -189,7 +189,7 @@ String ImplDdeService::Topics() pShell = SfxObjectShell::GetNext( *pShell, &aType ); } if( sRet.Len() ) - sRet += DEFINE_CONST_UNICODE("\r\n"); + sRet += "\r\n"; return sRet; } @@ -203,7 +203,7 @@ class SfxDdeTriggerTopic_Impl : public DdeTopic { public: SfxDdeTriggerTopic_Impl() - : DdeTopic( DEFINE_CONST_UNICODE("TRIGGER") ) + : DdeTopic( "TRIGGER" ) {} virtual sal_Bool Execute( const String* ); @@ -307,8 +307,8 @@ long SfxApplication::DdeExecute { // Print or Open-Event? ApplicationEvent aAppEvent; - if ( SfxAppEvent_Impl( aAppEvent, rCmd, DEFINE_CONST_UNICODE("Print"), ApplicationEvent::TYPE_PRINT ) || - SfxAppEvent_Impl( aAppEvent, rCmd, DEFINE_CONST_UNICODE("Open"), ApplicationEvent::TYPE_OPEN ) ) + if ( SfxAppEvent_Impl( aAppEvent, rCmd, "Print", ApplicationEvent::TYPE_PRINT ) || + SfxAppEvent_Impl( aAppEvent, rCmd, "Open", ApplicationEvent::TYPE_OPEN ) ) GetpApp()->AppEvent( aAppEvent ); else { @@ -538,7 +538,7 @@ sal_Bool SfxApplication::InitializeDde() // Config path as a topic becauseof multiple starts INetURLObject aOfficeLockFile( SvtPathOptions().GetUserConfigPath() ); - aOfficeLockFile.insertName( DEFINE_CONST_UNICODE( "soffice.lck" ) ); + aOfficeLockFile.insertName( "soffice.lck" ); String aService( SfxDdeServiceName_Impl( aOfficeLockFile.GetMainURL(INetURLObject::DECODE_TO_IURI) ) ); aService.ToUpperAscii(); diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index fb553a6dad9e..a134957d1304 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -158,13 +158,13 @@ std::vector<sal_uInt16>* SfxApplication::GetDisabledSlotList_Impl() { // Is there a slot file? INetURLObject aUserObj( SvtPathOptions().GetUserConfigPath() ); - aUserObj.insertName( DEFINE_CONST_UNICODE( "slots.cfg" ) ); + aUserObj.insertName( "slots.cfg" ); SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aUserObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READ ); if ( !pStream || pStream->GetError() == ERRCODE_IO_NOTEXISTS ) { delete pStream; INetURLObject aObj( SvtPathOptions().GetConfigPath() ); - aObj.insertName( DEFINE_CONST_UNICODE( "slots.cfg" ) ); + aObj.insertName( "slots.cfg" ); pStream = ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READ ); } diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 5b9e5bef742c..1c07078f5976 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -428,7 +428,7 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String TransformItems( SID_OPENDOC, *pNew, aArgs ); sal_Int32 nLength = aArgs.getLength(); aArgs.realloc( nLength + 1 ); - aArgs[nLength].Name = DEFINE_CONST_UNICODE("Title"); + aArgs[nLength].Name = "Title"; aArgs[nLength].Value <<= ::rtl::OUString( xDoc->GetTitle( SFX_TITLE_DETECT ) ); xModel->attachResource( ::rtl::OUString(), aArgs ); delete pNew; @@ -554,8 +554,8 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq ) SfxCallMode eMode = SFX_CALLMODE_SYNCHRON; const SfxPoolItem *pRet=0; - SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE("private:user") ); - SfxStringItem aTarget( SID_TARGETNAME, DEFINE_CONST_UNICODE("_default") ); + SfxStringItem aReferer( SID_REFERER, "private:user" ); + SfxStringItem aTarget( SID_TARGETNAME, "_default" ); if ( aTemplateFileName.Len() ) { DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Illegal URL!" ); @@ -567,7 +567,7 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq ) } else { - SfxStringItem aName( SID_FILE_NAME, DEFINE_CONST_UNICODE("private:factory") ); + SfxStringItem aName( SID_FILE_NAME, "private:factory" ); pRet = GetDispatcher_Impl()->Execute( SID_OPENDOC, eMode, &aName, &aTarget, &aReferer, 0L ); } diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 646291d1b5a1..d7aeafaf5a8b 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -334,7 +334,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) } SfxStringItem aNameItem( SID_FILE_NAME, rtl::OUString("vnd.sun.star.cmd:logout") ); - SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE( "private/user" ) ); + SfxStringItem aReferer( SID_REFERER, "private/user" ); pAppData_Impl->pAppDispat->Execute( SID_OPENDOC, SFX_CALLMODE_SLOT, &aNameItem, &aReferer, 0L ); return; } diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index fb16aad45268..189bb9447f91 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -925,8 +925,8 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else { // transform parameter "OptionsPageURL" of slot "OptionsTreeDialog" - String sSlotName( DEFINE_CONST_UNICODE( "OptionsTreeDialog" ) ); - String sPropName( DEFINE_CONST_UNICODE( "OptionsPageURL" ) ); + String sSlotName( "OptionsTreeDialog" ); + String sPropName( "OptionsPageURL" ); if ( sSlotName.EqualsAscii( pSlot->pUnoName ) ) { for ( sal_uInt16 n = 0; n < nCount; ++n ) diff --git a/sfx2/source/appl/helpinterceptor.cxx b/sfx2/source/appl/helpinterceptor.cxx index 16f1c7ea0113..cac32bf9f5c7 100644 --- a/sfx2/source/appl/helpinterceptor.cxx +++ b/sfx2/source/appl/helpinterceptor.cxx @@ -224,7 +224,7 @@ Sequence< ::rtl::OUString > SAL_CALL HelpInterceptor_Impl::getInterceptedURLs() { Sequence< ::rtl::OUString > aURLList( 1 ); - aURLList[0] = DEFINE_CONST_UNICODE("vnd.sun.star.help://*"); + aURLList[0] = "vnd.sun.star.help://*"; return aURLList; } @@ -234,8 +234,8 @@ Sequence< ::rtl::OUString > SAL_CALL HelpInterceptor_Impl::getInterceptedURLs() void SAL_CALL HelpInterceptor_Impl::dispatch( const URL& aURL, const Sequence< ::com::sun::star::beans::PropertyValue >& ) throw( RuntimeException ) { - sal_Bool bBack = ( String( DEFINE_CONST_UNICODE(".uno:Backward") ) == String( aURL.Complete ) ); - if ( bBack || String( DEFINE_CONST_UNICODE(".uno:Forward") ) == String( aURL.Complete ) ) + sal_Bool bBack = ( String( ".uno:Backward" ) == String( aURL.Complete ) ); + if ( bBack || String( ".uno:Forward" ) == String( aURL.Complete ) ) { if ( m_pHistory ) { diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 34a53e7b1949..1bf812bb29e6 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -143,24 +143,24 @@ using namespace ::comphelper; #define TBI_SELECTIONMODE 1010 #define TBI_ONSTARTUP 1011 -#define CONFIGNAME_HELPWIN DEFINE_CONST_UNICODE("OfficeHelp") -#define CONFIGNAME_INDEXWIN DEFINE_CONST_UNICODE("OfficeHelpIndex") -#define CONFIGNAME_SEARCHPAGE DEFINE_CONST_UNICODE("OfficeHelpSearch") -#define IMAGE_URL DEFINE_CONST_UNICODE("private:factory/") - -#define PROPERTY_KEYWORDLIST DEFINE_CONST_OUSTRING("KeywordList") -#define PROPERTY_KEYWORDREF DEFINE_CONST_OUSTRING("KeywordRef") -#define PROPERTY_ANCHORREF DEFINE_CONST_OUSTRING("KeywordAnchorForRef") -#define PROPERTY_TITLEREF DEFINE_CONST_OUSTRING("KeywordTitleForRef") -#define PROPERTY_TITLE DEFINE_CONST_OUSTRING("Title") -#define HELP_URL DEFINE_CONST_OUSTRING("vnd.sun.star.help://") -#define HELP_SEARCH_TAG DEFINE_CONST_OUSTRING("/?Query=") -#define USERITEM_NAME DEFINE_CONST_OUSTRING("UserItem") - -#define PACKAGE_SETUP DEFINE_CONST_OUSTRING("/org.openoffice.Setup") -#define PATH_OFFICE_FACTORIES DEFINE_CONST_OUSTRING("Office/Factories/") -#define KEY_HELP_ON_OPEN DEFINE_CONST_OUSTRING("ooSetupFactoryHelpOnOpen") -#define KEY_UI_NAME DEFINE_CONST_OUSTRING("ooSetupFactoryUIName") +#define CONFIGNAME_HELPWIN "OfficeHelp" +#define CONFIGNAME_INDEXWIN "OfficeHelpIndex" +#define CONFIGNAME_SEARCHPAGE "OfficeHelpSearch" +#define IMAGE_URL "private:factory/" + +#define PROPERTY_KEYWORDLIST "KeywordList" +#define PROPERTY_KEYWORDREF "KeywordRef" +#define PROPERTY_ANCHORREF "KeywordAnchorForRef" +#define PROPERTY_TITLEREF "KeywordTitleForRef" +#define PROPERTY_TITLE "Title" +#define HELP_URL "vnd.sun.star.help://" +#define HELP_SEARCH_TAG "/?Query=" +#define USERITEM_NAME "UserItem" + +#define PACKAGE_SETUP "/org.openoffice.Setup" +#define PATH_OFFICE_FACTORIES "Office/Factories/" +#define KEY_HELP_ON_OPEN "ooSetupFactoryHelpOnOpen" +#define KEY_UI_NAME "ooSetupFactoryUIName" #define PARSE_URL( aURL ) \ Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); \ @@ -311,7 +311,7 @@ ContentListBox_Impl::~ContentListBox_Impl() void ContentListBox_Impl::InitRoot() { - String aHelpTreeviewURL( DEFINE_CONST_UNICODE("vnd.sun.star.hier://com.sun.star.help.TreeView/") ); + String aHelpTreeviewURL( "vnd.sun.star.hier://com.sun.star.help.TreeView/" ); ::com::sun::star::uno::Sequence< ::rtl::OUString > aList = SfxContentHelper::GetHelpTreeViewContents( aHelpTreeviewURL ); @@ -1511,7 +1511,7 @@ void SfxHelpWindow_Impl::loadHelpContent(const ::rtl::OUString& sHelpURL, sal_Bo { try { - Reference< XComponent > xContent = xLoader->loadComponentFromURL(sHelpURL, DEFINE_CONST_UNICODE("_self"), 0, Sequence< PropertyValue >()); + Reference< XComponent > xContent = xLoader->loadComponentFromURL(sHelpURL, "_self", 0, Sequence< PropertyValue >()); if (xContent.is()) { bSuccess = sal_True; @@ -2019,7 +2019,7 @@ long TextWin_Impl::Notify( NotifyEvent& rNEvt ) // remove docking area acceptor from layoutmanager, so it will not layout anything further .-) static void lcl_disableLayoutOfFrame(const Reference< XFrame >& xFrame) { - static const ::rtl::OUString PROP_LAYOUT_MANAGER(DEFINE_CONST_UNICODE("LayoutManager")); + static const ::rtl::OUString PROP_LAYOUT_MANAGER("LayoutManager"); Reference< XPropertySet > xPropSet(xFrame, UNO_QUERY_THROW); xPropSet->setPropertyValue(PROP_LAYOUT_MANAGER, makeAny(Reference< XLayoutManager >())); @@ -2051,9 +2051,9 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) : sfx2::AddToTaskPaneList( &aToolBox ); xFrame = Reference < XFrame > ( ::comphelper::getProcessServiceFactory()->createInstance( - DEFINE_CONST_UNICODE("com.sun.star.frame.Frame") ), UNO_QUERY ); + "com.sun.star.frame.Frame" ), UNO_QUERY ); xFrame->initialize( VCLUnoHelper::GetInterface ( pTextWin ) ); - xFrame->setName( DEFINE_CONST_UNICODE("OFFICE_HELP") ); + xFrame->setName( "OFFICE_HELP" ); lcl_disableLayoutOfFrame(xFrame); aToolBox.SetHelpId( HID_HELP_TOOLBOX ); @@ -2235,7 +2235,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox( bool bOnlyText ) aOnStartupCB.SaveValue(); // calculate and set optimal width of the onstartup checkbox - String sCBText( DEFINE_CONST_UNICODE( "XXX" ) ); + String sCBText( "XXX" ); sCBText += aOnStartupCB.GetText(); long nTextWidth = aOnStartupCB.GetTextWidth( sCBText ); Size aSize = aOnStartupCB.GetSizePixel(); @@ -2350,10 +2350,10 @@ IMPL_LINK_NOARG(SfxHelpTextWindow_Impl, SelectHdl) // create descriptor, set string and find all words Reference < XSearchDescriptor > xSrchDesc = xSearchable->createSearchDescriptor(); Reference < XPropertySet > xPropSet( xSrchDesc, UNO_QUERY ); - xPropSet->setPropertyValue( DEFINE_CONST_OUSTRING("SearchRegularExpression"), + xPropSet->setPropertyValue( "SearchRegularExpression", makeAny( sal_Bool( sal_True ) ) ); if ( bIsFullWordSearch ) - xPropSet->setPropertyValue( DEFINE_CONST_OUSTRING("SearchWords"), + xPropSet->setPropertyValue( "SearchWords", makeAny( sal_Bool( sal_True ) ) ); String sSearchString = sfx2::PrepareSearchString( aSearchText, GetBreakIterator(), false ); @@ -2412,9 +2412,9 @@ IMPL_LINK( SfxHelpTextWindow_Impl, FindHdl, sfx2::SearchDialog*, pDlg ) // create descriptor, set string and find all words Reference < XSearchDescriptor > xSrchDesc = xSearchable->createSearchDescriptor(); Reference < XPropertySet > xPropSet( xSrchDesc, UNO_QUERY ); - xPropSet->setPropertyValue( DEFINE_CONST_OUSTRING("SearchWords"), makeAny( sal_Bool( pDlg->IsOnlyWholeWords() != false ) ) ); - xPropSet->setPropertyValue( DEFINE_CONST_OUSTRING("SearchCaseSensitive"), makeAny( sal_Bool( pDlg->IsMarchCase() != false ) ) ); - xPropSet->setPropertyValue( DEFINE_CONST_OUSTRING("SearchBackwards"), makeAny( sal_Bool( pDlg->IsSearchBackwards() != false ) ) ); + xPropSet->setPropertyValue( "SearchWords", makeAny( sal_Bool( pDlg->IsOnlyWholeWords() != false ) ) ); + xPropSet->setPropertyValue( "SearchCaseSensitive", makeAny( sal_Bool( pDlg->IsMarchCase() != false ) ) ); + xPropSet->setPropertyValue( "SearchBackwards", makeAny( sal_Bool( pDlg->IsSearchBackwards() != false ) ) ); xSrchDesc->setSearchString( sSearchText ); Reference< XInterface > xSelection; Reference< XTextRange > xCursor = getCursor(); @@ -2585,7 +2585,7 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) aMenu.SetHelpId( TBI_SELECTIONMODE, HID_HELP_TEXT_SELECTION_MODE ); Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); URL aURL; - aURL.Complete = DEFINE_CONST_UNICODE(".uno:SelectTextMode"); + aURL.Complete = ".uno:SelectTextMode"; PARSE_URL( aURL ); Reference < XDispatch > xDisp = xProv.is() ? xProv->queryDispatch( aURL, rtl::OUString(), 0 ) : Reference < XDispatch >(); @@ -2734,18 +2734,18 @@ void SfxHelpTextWindow_Impl::SetPageStyleHeaderOff() const Reference < XText > xText = xRange->getText(); Reference < XPropertySet > xProps( xText->createTextCursorByRange( xRange ), UNO_QUERY ); ::rtl::OUString sStyleName; - if ( xProps->getPropertyValue( DEFINE_CONST_OUSTRING("PageStyleName") ) >>= sStyleName ) + if ( xProps->getPropertyValue( "PageStyleName" ) >>= sStyleName ) { Reference < XStyleFamiliesSupplier > xStyles( xController->getModel(), UNO_QUERY ); Reference < XNameContainer > xContainer; - if ( xStyles->getStyleFamilies()->getByName( DEFINE_CONST_OUSTRING("PageStyles") ) + if ( xStyles->getStyleFamilies()->getByName( "PageStyles" ) >>= xContainer ) { Reference < XStyle > xStyle; if ( xContainer->getByName( sStyleName ) >>= xStyle ) { Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY ); - xPropSet->setPropertyValue( DEFINE_CONST_OUSTRING("HeaderIsOn"), + xPropSet->setPropertyValue( "HeaderIsOn", makeAny( sal_Bool( sal_False ) ) ); Reference< XModifiable > xReset(xStyles, UNO_QUERY); @@ -2796,7 +2796,7 @@ void SfxHelpTextWindow_Impl::DoSearch() if ( !pSrchDlg ) { // create the search dialog - pSrchDlg = new sfx2::SearchDialog( pTextWin, DEFINE_CONST_UNICODE("HelpSearchDialog") ); + pSrchDlg = new sfx2::SearchDialog( pTextWin, "HelpSearchDialog" ); // set handler pSrchDlg->SetFindHdl( LINK( this, SfxHelpTextWindow_Impl, FindHdl ) ); pSrchDlg->SetCloseHdl( LINK( this, SfxHelpTextWindow_Impl, CloseHdl ) ); @@ -3015,7 +3015,7 @@ void SfxHelpWindow_Impl::SaveConfig() void SfxHelpWindow_Impl::ShowStartPage() { ::rtl::OUString sHelpURL = SfxHelpWindow_Impl::buildHelpURL(pIndexWin->GetFactory(), - DEFINE_CONST_UNICODE("/start"), + "/start", ::rtl::OUString(), sal_True); loadHelpContent(sHelpURL); @@ -3080,12 +3080,10 @@ IMPL_LINK_NOARG(SfxHelpWindow_Impl, OpenHdl) IMPL_LINK( SfxHelpWindow_Impl, SelectFactoryHdl, SfxHelpIndexWindow_Impl* , pWin ) { - if ( sTitle.Len() == 0 ) + if ( sTitle.isEmpty() ) sTitle = GetParent()->GetText(); - String aNewTitle = sTitle; - aNewTitle += DEFINE_CONST_UNICODE(" - "); - aNewTitle += pIndexWin->GetActiveFactoryTitle(); + OUString aNewTitle = sTitle + " - " + pIndexWin->GetActiveFactoryTitle(); Reference< XTitle > xTitle(xFrame, UNO_QUERY); if (xTitle.is ()) @@ -3135,11 +3133,11 @@ void SfxHelpWindow_Impl::openDone(const ::rtl::OUString& sURL , Reference < XPropertySet > xViewProps = xSettings->getViewSettings(); Reference< XPropertySetInfo > xInfo = xViewProps->getPropertySetInfo(); Any aBoolAny = makeAny( sal_Bool( sal_True ) ); - xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("PreventHelpTips"), aBoolAny ); - xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("ShowGraphics"), aBoolAny ); - xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("ShowTables"), aBoolAny ); - xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("HelpURL"), makeAny( DEFINE_CONST_OUSTRING("HID:SFX2_HID_HELP_ONHELP") ) ); - ::rtl::OUString sProperty( DEFINE_CONST_OUSTRING("IsExecuteHyperlinks") ); + xViewProps->setPropertyValue( "PreventHelpTips", aBoolAny ); + xViewProps->setPropertyValue( "ShowGraphics", aBoolAny ); + xViewProps->setPropertyValue( "ShowTables", aBoolAny ); + xViewProps->setPropertyValue( "HelpURL", makeAny( OUString("HID:SFX2_HID_HELP_ONHELP") ) ); + OUString sProperty( "IsExecuteHyperlinks" ); if ( xInfo->hasPropertyByName( sProperty ) ) xViewProps->setPropertyValue( sProperty, aBoolAny ); xController->restoreViewData(pHelpInterceptor->GetViewData()); @@ -3289,9 +3287,9 @@ void SfxHelpWindow_Impl::DoAction( sal_uInt16 nActionId ) case TBI_FORWARD : { URL aURL; - aURL.Complete = DEFINE_CONST_UNICODE(".uno:Backward"); + aURL.Complete = ".uno:Backward"; if ( TBI_FORWARD == nActionId ) - aURL.Complete = DEFINE_CONST_UNICODE(".uno:Forward"); + aURL.Complete = ".uno:Forward"; PARSE_URL( aURL ); pHelpInterceptor->dispatch( aURL, Sequence < PropertyValue >() ); break; @@ -3313,15 +3311,15 @@ void SfxHelpWindow_Impl::DoAction( sal_uInt16 nActionId ) { URL aURL; if ( TBI_PRINT == nActionId ) - aURL.Complete = DEFINE_CONST_UNICODE(".uno:Print"); + aURL.Complete = ".uno:Print"; else if ( TBI_SOURCEVIEW == nActionId ) - aURL.Complete = DEFINE_CONST_UNICODE(".uno:SourceView"); + aURL.Complete = ".uno:SourceView"; else if ( TBI_COPY == nActionId ) - aURL.Complete = DEFINE_CONST_UNICODE(".uno:Copy"); + aURL.Complete = ".uno:Copy"; else if ( TBI_SELECTIONMODE == nActionId ) - aURL.Complete = DEFINE_CONST_UNICODE(".uno:SelectTextMode"); + aURL.Complete = ".uno:SelectTextMode"; else - aURL.Complete = DEFINE_CONST_UNICODE(".uno:SearchDialog"); + aURL.Complete = ".uno:SearchDialog"; PARSE_URL( aURL ); Reference < XDispatch > xDisp = xProv->queryDispatch( aURL, String(), 0 ); if ( xDisp.is() ) diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index cd69921be5b2..a43477762a67 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -524,7 +524,7 @@ friend class SfxHelpIndexWindow_Impl; sal_Bool bIndex; sal_Bool bGrabFocusToToolBox; Point aWinPos; - String sTitle; + OUString sTitle; String sKeyword; virtual void Resize(); diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 5d92a18b7f85..5a995ecd2807 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -327,7 +327,7 @@ String SfxHelp_Impl::GetHelpText( const OUString& aCommandURL, const String& rMo // create help url String aHelpURL = SfxHelp::CreateHelpURL( aCommandURL, rModule ); // added 'active' parameter - aHelpURL.Insert( String( DEFINE_CONST_UNICODE("&Active=true") ), aHelpURL.SearchBackward( '#' ) ); + aHelpURL.Insert( String( "&Active=true" ), aHelpURL.SearchBackward( '#' ) ); // load help string return SfxContentHelper::GetActiveHelpString( aHelpURL ); } @@ -390,21 +390,21 @@ OUString getDefaultModule_Impl() OUString sDefaultModule; SvtModuleOptions aModOpt; if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) ) - sDefaultModule = DEFINE_CONST_UNICODE("swriter"); + sDefaultModule = "swriter"; else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) ) - sDefaultModule = DEFINE_CONST_UNICODE("scalc"); + sDefaultModule = "scalc"; else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) ) - sDefaultModule = DEFINE_CONST_UNICODE("simpress"); + sDefaultModule = "simpress"; else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) ) - sDefaultModule = DEFINE_CONST_UNICODE("sdraw"); + sDefaultModule = "sdraw"; else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SMATH ) ) - sDefaultModule = DEFINE_CONST_UNICODE("smath"); + sDefaultModule = "smath"; else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SCHART ) ) - sDefaultModule = DEFINE_CONST_UNICODE("schart"); + sDefaultModule = "schart"; else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SBASIC ) ) - sDefaultModule = DEFINE_CONST_UNICODE("sbasic"); + sDefaultModule = "sbasic"; else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SDATABASE ) ) - sDefaultModule = DEFINE_CONST_UNICODE("sdatabase"); + sDefaultModule = "sdatabase"; else { SAL_WARN( "sfx2.appl", "getDefaultModule_Impl(): no module installed" ); @@ -565,7 +565,7 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask , Reference< XPropertySet > xProps(xHelpTask, UNO_QUERY); if (xProps.is()) xProps->setPropertyValue( - DEFINE_CONST_UNICODE("Title"), + "Title", makeAny(SfxResId(STR_HELP_WINDOW_TITLE).toString())); pHelpWindow->setContainerWindow( xParentWindow ); @@ -615,13 +615,13 @@ OUString SfxHelp::GetHelpText( const OUString& aCommandURL, const Window* pWindo // add some debug information? if ( bIsDebug ) { - sHelpText += DEFINE_CONST_UNICODE("\n-------------\n"); + sHelpText += "\n-------------\n"; sHelpText += String( sModuleName ); - sHelpText += DEFINE_CONST_UNICODE(": "); + sHelpText += ": "; sHelpText += aCommandURL; if ( !aNewHelpId.isEmpty() ) { - sHelpText += DEFINE_CONST_UNICODE(" - "); + sHelpText += " - "; sHelpText += String(OStringToOUString(aNewHelpId, RTL_TEXTENCODING_UTF8)); } } diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index d62d5490217b..6597d3404bfd 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -313,8 +313,8 @@ void SfxPickList::ExecuteEntry( sal_uInt32 nIndex ) { SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, SFX_APP()->GetPool() ); aReq.AppendItem( SfxStringItem( SID_FILE_NAME, pPick->aName )); - aReq.AppendItem( SfxStringItem( SID_REFERER, DEFINE_CONST_UNICODE( SFX_REFERER_USER ) ) ); - aReq.AppendItem( SfxStringItem( SID_TARGETNAME, DEFINE_CONST_UNICODE("_default") ) ); + aReq.AppendItem( SfxStringItem( SID_REFERER, SFX_REFERER_USER ) ); + aReq.AppendItem( SfxStringItem( SID_TARGETNAME, "_default" ) ); String aFilter( pPick->aFilter ); aGuard.clear(); diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index 796ae0158c0f..049823b7f2da 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -506,7 +506,7 @@ sal_Bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter ) { #ifdef DBG_UTIL // Start Setup - InfoBox( NULL, DEFINE_CONST_UNICODE("Here should the Setup now be starting!") ).Execute(); + InfoBox( NULL, "Here should the Setup now be starting!" ).Execute(); #endif // Installation must still give feedback if it worked or not, // then the Filterflag be deleted @@ -607,7 +607,7 @@ const SfxFilter* SfxFilterMatcher::GetFilterForProps( const com::sun::star::uno: ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory(); ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery > xTypeCFG; if( xServiceManager.is() == sal_True ) - xTypeCFG = ::com::sun::star::uno::Reference < com::sun::star::container::XContainerQuery >( xServiceManager->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.document.TypeDetection" ) ), ::com::sun::star::uno::UNO_QUERY ); + xTypeCFG = ::com::sun::star::uno::Reference < com::sun::star::container::XContainerQuery >( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), ::com::sun::star::uno::UNO_QUERY ); if ( xTypeCFG.is() ) { // make query for all types matching the properties @@ -790,8 +790,8 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const String& rName, Sf ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xTypeCFG ; if( xServiceManager.is() == sal_True ) { - xFilterCFG = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >( xServiceManager->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.document.FilterFactory" ) ), ::com::sun::star::uno::UNO_QUERY ); - xTypeCFG = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >( xServiceManager->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.document.TypeDetection" ) ), ::com::sun::star::uno::UNO_QUERY ); + xFilterCFG = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.FilterFactory" ), ::com::sun::star::uno::UNO_QUERY ); + xTypeCFG = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), ::com::sun::star::uno::UNO_QUERY ); } if( xFilterCFG.is() && xTypeCFG.is() ) @@ -832,8 +832,8 @@ IMPL_STATIC_LINK( SfxFilterMatcher, MaybeFileHdl_Impl, String*, pString ) { const SfxFilter* pFilter = pThis->GetFilter4Extension( *pString, SFX_FILTER_IMPORT ); if (pFilter && !pFilter->GetWildcard().Matches( String() ) && - !pFilter->GetWildcard().Matches(DEFINE_CONST_UNICODE("*.*")) && - !pFilter->GetWildcard().Matches(rtl::OUString('*')) + !pFilter->GetWildcard().Matches(OUString("*.*")) && + !pFilter->GetWildcard().Matches(OUString('*')) ) { return sal_True; @@ -1027,7 +1027,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl( { ::com::sun::star::uno::Sequence< ::rtl::OUString > lExtensions; lTypeProperties[nTypeProperty].Value >>= lExtensions; - sExtension = implc_convertStringlistToString( lExtensions, ';', DEFINE_CONST_UNICODE("*.") ); + sExtension = implc_convertStringlistToString( lExtensions, ';', "*." ); } } else if ( lTypeProperties[nTypeProperty].Name == "URLPattern" ) @@ -1058,7 +1058,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl( // register SfxFilter // first erase module name from old filter names! // e.g: "scalc: DIF" => "DIF" - sal_Int32 nStartRealName = sFilterName.indexOf( DEFINE_CONST_UNICODE(": "), 0 ); + sal_Int32 nStartRealName = sFilterName.indexOf( ": ", 0 ); if( nStartRealName != -1 ) { OSL_FAIL("Old format, not supported!"); @@ -1125,8 +1125,8 @@ void SfxFilterContainer::ReadFilters_Impl( sal_Bool bUpdate ) ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > xTypeCFG ; if( xServiceManager.is() == sal_True ) { - xFilterCFG = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >( xServiceManager->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.document.FilterFactory" ) ), ::com::sun::star::uno::UNO_QUERY ); - xTypeCFG = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >( xServiceManager->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.document.TypeDetection" ) ), ::com::sun::star::uno::UNO_QUERY ); + xFilterCFG = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.FilterFactory" ), ::com::sun::star::uno::UNO_QUERY ); + xTypeCFG = ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >( xServiceManager->createInstance( "com.sun.star.document.TypeDetection" ), ::com::sun::star::uno::UNO_QUERY ); } if( diff --git a/sfx2/source/bastyp/fltlst.cxx b/sfx2/source/bastyp/fltlst.cxx index 2cc0b74f3741..4af81852e72f 100644 --- a/sfx2/source/bastyp/fltlst.cxx +++ b/sfx2/source/bastyp/fltlst.cxx @@ -92,7 +92,7 @@ SfxFilterListener::SfxFilterListener() uno::Reference< lang::XMultiServiceFactory > xSmgr = ::comphelper::getProcessServiceFactory(); if( xSmgr.is() == sal_True ) { - uno::Reference< util::XRefreshable > xNotifier( xSmgr->createInstance( DEFINE_CONST_OUSTRING("com.sun.star.document.FilterConfigRefresh") ), uno::UNO_QUERY ); + uno::Reference< util::XRefreshable > xNotifier( xSmgr->createInstance( "com.sun.star.document.FilterConfigRefresh" ), uno::UNO_QUERY ); if( xNotifier.is() == sal_True ) { m_xFilterCache = xNotifier; diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index 66be8a6cf101..a71fa4adeee2 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -268,7 +268,7 @@ sal_Bool SfxHTMLParser::FinishFileDownload( String& rStr ) void SfxHTMLParser::GetScriptType_Impl( SvKeyValueIterator *pHTTPHeader ) { - aScriptType = DEFINE_CONST_UNICODE(SVX_MACRO_LANGUAGE_JAVASCRIPT); + aScriptType = SVX_MACRO_LANGUAGE_JAVASCRIPT; eScriptType = JAVASCRIPT; if( pHTTPHeader ) { @@ -299,7 +299,7 @@ void SfxHTMLParser::GetScriptType_Impl( SvKeyValueIterator *pHTTPHeader ) if( aTmp.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_LG_starbasic ) ) { eScriptType = STARBASIC; - aScriptType = DEFINE_CONST_UNICODE(SVX_MACRO_LANGUAGE_STARBASIC); + aScriptType = SVX_MACRO_LANGUAGE_STARBASIC; } if( !aTmp.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_LG_javascript ) ) { diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 09d7c5f503a4..8dcb7a455aa6 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -1941,7 +1941,7 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, SfxPoolItem* &rpState ) return SFX_ITEM_DISABLED; ::com::sun::star::util::URL aURL; - ::rtl::OUString aCmd( DEFINE_CONST_UNICODE(".uno:")); + OUString aCmd( ".uno:" ); aURL.Protocol = aCmd; aURL.Path = ::rtl::OUString::createFromAscii(pSlot->GetUnoName()); aCmd += aURL.Path; diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx index 9e253f0fa3cf..caf46f7c893d 100644 --- a/sfx2/source/control/objface.cxx +++ b/sfx2/source/control/objface.cxx @@ -422,7 +422,7 @@ SfxObjectUI_Impl* CreateObjectBarUI_Impl( sal_uInt16 nPos, const ResId& rResId, if( ! aResId.GetResMgr() ) aResId.SetResMgr( SfxApplication::GetOrCreate()->GetOffResManager_Impl() ); if ( !aResId.GetResMgr() || !aResId.GetResMgr()->IsAvailable(aResId) ) - pUI->pName = new String (DEFINE_CONST_UNICODE("NoName")); + pUI->pName = new String ("NoName"); else pUI->pName = new String(aResId.toString()); } diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx index fb9488d33f66..d52995479406 100644 --- a/sfx2/source/control/statcach.cxx +++ b/sfx2/source/control/statcach.cxx @@ -182,7 +182,7 @@ void BindDispatch_Impl::Dispatch( uno::Sequence < beans::PropertyValue > aProps, { sal_Int32 nLength = aProps.getLength(); aProps.realloc(nLength+1); - aProps[nLength].Name = DEFINE_CONST_UNICODE("SynchronMode"); + aProps[nLength].Name = "SynchronMode"; aProps[nLength].Value <<= bForceSynchron ; xDisp->dispatch( aURL, aProps ); } @@ -270,7 +270,7 @@ const SfxSlotServer* SfxStateCache::GetSlotServer( SfxDispatcher &rDispat , cons // create the dispatch URL from the slot data ::com::sun::star::util::URL aURL; - ::rtl::OUString aCmd = DEFINE_CONST_UNICODE(".uno:"); + OUString aCmd = ".uno:"; aURL.Protocol = aCmd; aURL.Path = ::rtl::OUString::createFromAscii( pSlot->GetUnoName() ); aCmd += aURL.Path; diff --git a/sfx2/source/dialog/alienwarn.cxx b/sfx2/source/dialog/alienwarn.cxx index 1756d3a9113f..99275f4d50b6 100644 --- a/sfx2/source/dialog/alienwarn.cxx +++ b/sfx2/source/dialog/alienwarn.cxx @@ -49,13 +49,13 @@ SfxAlienWarningDialog::SfxAlienWarningDialog( Window* pParent, const String& _rF m_aQueryImage.SetImage( QueryBox::GetStandardImage() ); // replace formatname (text) - String sInfoText = m_aInfoText.GetText(); - sInfoText.SearchAndReplaceAll( DEFINE_CONST_UNICODE("%FORMATNAME"), _rFormatName ); + OUString sInfoText = m_aInfoText.GetText(); + sInfoText = sInfoText.replaceAll( "%FORMATNAME", _rFormatName ); m_aInfoText.SetText( sInfoText ); // replace formatname (button) sInfoText = m_aKeepCurrentBtn.GetText(); - sInfoText.SearchAndReplaceAll( DEFINE_CONST_UNICODE("%FORMATNAME"), _rFormatName ); + sInfoText = sInfoText.replaceAll( "%FORMATNAME", _rFormatName ); m_aKeepCurrentBtn.SetText( sInfoText ); // load value of "warning on" checkbox from save options diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 9655c32219fe..894072f6e87a 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -160,7 +160,7 @@ String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes, sal_Bool bSmartE rLocaleWrapper.getNumDecimalSep()[0] ); aSizeStr += aUnitStr; - aSizeStr += DEFINE_CONST_UNICODE(" ("); + aSizeStr += " ("; aSizeStr += rLocaleWrapper.getNum( nSize2, 0 ); aSizeStr += ' '; aSizeStr += SfxResId(STR_BYTES).toString(); @@ -169,7 +169,7 @@ String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes, sal_Bool bSmartE else if ( bGB && bSmartExtraBytes ) { nSize1 = nSize / nMega; - aSizeStr = DEFINE_CONST_UNICODE(" ("); + aSizeStr = " ("; aSizeStr += rLocaleWrapper.getNum( nSize1, 0 ); aSizeStr += aUnitStr; aSizeStr += ')'; @@ -182,7 +182,7 @@ String ConvertDateTime_Impl( const String& rName, { Date aD(uDT.Day, uDT.Month, uDT.Year); Time aT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.HundredthSeconds); - const String pDelim ( DEFINE_CONST_UNICODE( ", ")); + const String pDelim ( ", " ); String aStr( rWrapper.getDate( aD ) ); aStr += pDelim; aStr += rWrapper.getTime( aT, sal_True, sal_False ); diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index c8cb078ee409..e0a16237a788 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -1198,7 +1198,7 @@ void SfxDockingWindow::FillInfo(SfxChildWinInfo& rInfo) const pImp->aWinState = GetFloatingWindow()->GetWindowState(); rInfo.aWinState = pImp->aWinState; - rInfo.aExtraString = DEFINE_CONST_UNICODE("AL:("); + rInfo.aExtraString = "AL:("; rInfo.aExtraString += String::CreateFromInt32((sal_uInt16) GetAlignment()); rInfo.aExtraString += ','; rInfo.aExtraString += String::CreateFromInt32 ((sal_uInt16) pImp->GetLastAlignment()); diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index ae44fac5b8fa..d20e542b7ae0 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -111,9 +111,9 @@ using namespace ::cppu; //----------------------------------------------------------------------------- -#define IODLG_CONFIGNAME String(DEFINE_CONST_UNICODE("FilePicker_Save")) -#define IMPGRF_CONFIGNAME String(DEFINE_CONST_UNICODE("FilePicker_Graph")) -#define USERITEM_NAME ::rtl::OUString("UserItem" ) +#define IODLG_CONFIGNAME OUString("FilePicker_Save") +#define IMPGRF_CONFIGNAME OUString("FilePicker_Graph") +#define USERITEM_NAME OUString("UserItem") //----------------------------------------------------------------------------- @@ -425,7 +425,7 @@ sal_Bool FileDialogHelper_Impl::CheckFilterOptionsCapability( const SfxFilter* _ sal_Int32 nPropertyCount = aProps.getLength(); for( sal_Int32 nProperty=0; nProperty < nPropertyCount; ++nProperty ) { - if( aProps[nProperty].Name.equals( DEFINE_CONST_OUSTRING( "UIComponent") ) ) + if( aProps[nProperty].Name == "UIComponent" ) { aProps[nProperty].Value >>= aServiceName; if( !aServiceName.isEmpty() ) @@ -846,7 +846,7 @@ static bool lcl_isSystemFilePicker( const uno::Reference< XFilePicker >& _rxFP ) uno::Reference< XServiceInfo > xSI( _rxFP, UNO_QUERY ); if ( !xSI.is() ) return true; - return xSI->supportsService( DEFINE_CONST_OUSTRING( "com.sun.star.ui.dialogs.SystemFilePicker" ) ); + return xSI->supportsService( "com.sun.star.ui.dialogs.SystemFilePicker" ); } catch( const Exception& ) { @@ -985,7 +985,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( if( xFactory.is() ) { mxFilterCFG = uno::Reference< XNameAccess >( - xFactory->createInstance( DEFINE_CONST_OUSTRING( "com.sun.star.document.FilterFactory" ) ), + xFactory->createInstance( "com.sun.star.document.FilterFactory" ), UNO_QUERY ); } @@ -1001,7 +1001,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( if ( mbExport && !mxFilterCFG.is() && xFactory.is() ) { mxFilterCFG = uno::Reference< XNameAccess >( - xFactory->createInstance( DEFINE_CONST_OUSTRING( "com.sun.star.document.FilterFactory" ) ), + xFactory->createInstance( "com.sun.star.document.FilterFactory" ), UNO_QUERY ); } break; @@ -1894,7 +1894,7 @@ void FileDialogHelper_Impl::addGraphicFilter() #if defined(WNT) if ( aExtensions.Len() > 240 ) - aExtensions = DEFINE_CONST_UNICODE( FILEDIALOG_FILTER_ALL ); + aExtensions = FILEDIALOG_FILTER_ALL; #endif sal_Bool bIsInOpenMode = isInOpenMode(); @@ -1957,7 +1957,7 @@ void FileDialogHelper_Impl::saveConfig() if ( mbHasPreview ) { SvtViewOptions aDlgOpt( E_DIALOG, IMPGRF_CONFIGNAME ); - String aUserData = DEFINE_CONST_UNICODE( GRF_CONFIG_STR ); + String aUserData = OUString(GRF_CONFIG_STR); try { @@ -1984,7 +1984,7 @@ void FileDialogHelper_Impl::saveConfig() { sal_Bool bWriteConfig = sal_False; SvtViewOptions aDlgOpt( E_DIALOG, IODLG_CONFIGNAME ); - String aUserData = DEFINE_CONST_UNICODE( STD_CONFIG_STR ); + String aUserData = OUString(STD_CONFIG_STR); if ( aDlgOpt.Exists() ) { @@ -2144,7 +2144,7 @@ void FileDialogHelper_Impl::loadConfig() } if ( ! aUserData.Len() ) - aUserData = DEFINE_CONST_UNICODE( STD_CONFIG_STR ); + aUserData = STD_CONFIG_STR; if ( maPath.isEmpty() ) displayFolder( getInitPath( aUserData, 1 ) ); @@ -2757,16 +2757,16 @@ ErrCode RequestPassword(const SfxFilter* pCurrentFilter, rtl::OUString& aURL, Sf // ------------------------------------------------------------------------ String EncodeSpaces_Impl( const String& rSource ) { - String sRet( rSource ); - sRet.SearchAndReplaceAll( DEFINE_CONST_UNICODE( " " ), DEFINE_CONST_UNICODE( "%20" ) ); + OUString sRet( rSource ); + sRet = sRet.replaceAll( " ", "%20" ); return sRet; } // ------------------------------------------------------------------------ String DecodeSpaces_Impl( const String& rSource ) { - String sRet( rSource ); - sRet.SearchAndReplaceAll( DEFINE_CONST_UNICODE( "%20" ), DEFINE_CONST_UNICODE( " " ) ); + OUString sRet( rSource ); + sRet = sRet.replaceAll( "%20", " " ); return sRet; } diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index 8b841ff8739b..46700f1c1f46 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -232,7 +232,7 @@ namespace sfx2 //================================================================ // get the list describing the order of all global classes Sequence< ::rtl::OUString > aGlobalClasses; - _rFilterClassification.getNodeValue( DEFINE_CONST_OUSTRING( "GlobalFilters/Order" ) ) >>= aGlobalClasses; + _rFilterClassification.getNodeValue( "GlobalFilters/Order" ) >>= aGlobalClasses; const ::rtl::OUString* pNames = aGlobalClasses.getConstArray(); const ::rtl::OUString* pNamesEnd = pNames + aGlobalClasses.getLength(); @@ -258,7 +258,7 @@ namespace sfx2 //================================================================ // go for all the single class entries OConfigurationNode aFilterClassesNode = - _rFilterClassification.openNode( DEFINE_CONST_OUSTRING( "GlobalFilters/Classes" ) ); + _rFilterClassification.openNode( "GlobalFilters/Classes" ); Sequence< ::rtl::OUString > aFilterClasses = aFilterClassesNode.getNodeNames(); ::std::for_each( aFilterClasses.getConstArray(), @@ -300,7 +300,7 @@ namespace sfx2 // the node for the local classes OConfigurationNode aFilterClassesNode = - _rFilterClassification.openNode( DEFINE_CONST_OUSTRING( "LocalFilters/Classes" ) ); + _rFilterClassification.openNode( "LocalFilters/Classes" ); Sequence< ::rtl::OUString > aFilterClasses = aFilterClassesNode.getNodeNames(); ::std::for_each( @@ -317,7 +317,7 @@ namespace sfx2 // open our config node OConfigurationTreeRoot aFilterClassification = OConfigurationTreeRoot::createWithComponentContext( ::comphelper::getProcessComponentContext(), - DEFINE_CONST_OUSTRING( "org.openoffice.Office.UI/FilterClassification" ), + "org.openoffice.Office.UI/FilterClassification", -1, OConfigurationTreeRoot::CM_READONLY ); @@ -790,7 +790,7 @@ namespace sfx2 if ( !_rFilters.empty() ) { FilterGroup& rGlobalClasses = *_rFilters.begin(); - rGlobalClasses.push_front( FilterDescriptor( sAllFilterName, DEFINE_CONST_UNICODE( FILEDIALOG_FILTER_ALL ) ) ); + rGlobalClasses.push_front( FilterDescriptor( sAllFilterName, FILEDIALOG_FILTER_ALL ) ); } } } @@ -989,11 +989,11 @@ namespace sfx2 std::vector< ExportFilter > aFilterGroup; Reference< XFilterGroupManager > xFilterGroupManager( _rxFilterManager, UNO_QUERY ); ::rtl::OUString sTypeName; - const ::rtl::OUString sWriterHTMLType( DEFINE_CONST_OUSTRING("generic_HTML") ); - const ::rtl::OUString sGraphicHTMLType( DEFINE_CONST_OUSTRING("graphic_HTML") ); - const ::rtl::OUString sXHTMLType( DEFINE_CONST_OUSTRING("XHTML_File") ); - const ::rtl::OUString sPDFType( DEFINE_CONST_OUSTRING("pdf_Portable_Document_Format") ); - const ::rtl::OUString sFlashType( DEFINE_CONST_OUSTRING("graphic_SWF") ); + const ::rtl::OUString sWriterHTMLType( "generic_HTML" ); + const ::rtl::OUString sGraphicHTMLType( "graphic_HTML" ); + const ::rtl::OUString sXHTMLType( "XHTML_File" ); + const ::rtl::OUString sPDFType( "pdf_Portable_Document_Format" ); + const ::rtl::OUString sFlashType( "graphic_SWF" ); for ( const SfxFilter* pFilter = _rFilterMatcher.First(); pFilter; pFilter = _rFilterMatcher.Next() ) { diff --git a/sfx2/source/dialog/partwnd.cxx b/sfx2/source/dialog/partwnd.cxx index 2d0013b09cf5..b63e28a53006 100644 --- a/sfx2/source/dialog/partwnd.cxx +++ b/sfx2/source/dialog/partwnd.cxx @@ -107,7 +107,7 @@ SfxPartDockWnd_Impl::SfxPartDockWnd_Impl { ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame( ::comphelper::getProcessServiceFactory()->createInstance( - DEFINE_CONST_UNICODE("com.sun.star.frame.Frame") ), ::com::sun::star::uno::UNO_QUERY ); + "com.sun.star.frame.Frame" ), ::com::sun::star::uno::UNO_QUERY ); xFrame->initialize( VCLUnoHelper::GetInterface ( this ) ); ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPropSet( diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx index 4f6fe256d60c..0cf9690d9896 100644 --- a/sfx2/source/dialog/srchdlg.cxx +++ b/sfx2/source/dialog/srchdlg.cxx @@ -34,7 +34,6 @@ using namespace ::com::sun::star::uno; namespace sfx2 { -#define USERITEM_NAME DEFINE_CONST_OUSTRING("UserItem") #define MAX_SAVE_COUNT (sal_uInt16)10 // ============================================================================ @@ -84,7 +83,7 @@ void SearchDialog::LoadConfig() if ( aViewOpt.Exists() ) { m_sWinState = rtl::OUStringToOString(aViewOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US); - Any aUserItem = aViewOpt.GetUserItem( USERITEM_NAME ); + Any aUserItem = aViewOpt.GetUserItem( "UserItem" ); ::rtl::OUString aTemp; if ( aUserItem >>= aTemp ) { @@ -129,7 +128,7 @@ void SearchDialog::SaveConfig() sUserData += String::CreateFromInt32( m_aBackwardsBox.IsChecked() ? 1 : 0 ); Any aUserItem = makeAny( ::rtl::OUString( sUserData ) ); - aViewOpt.SetUserItem( USERITEM_NAME, aUserItem ); + aViewOpt.SetUserItem( "UserItem", aUserItem ); } IMPL_LINK_NOARG(SearchDialog, FindHdl) diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index c5f2870eb67b..404f0c9bc442 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -1872,7 +1872,7 @@ sal_Int32 SfxCommonTemplateDialog_Impl::LoadFactoryStyleFilter( SfxObjectShell* ::comphelper::SequenceAsHashMap aFactoryProps( xModuleManager->getByName( getModuleIdentifier( xModuleManager, i_pObjSh ) ) ); sal_Int32 nDefault = -1; - nFilter = aFactoryProps.getUnpackedValueOrDefault( DEFINE_CONST_UNICODE("ooSetupFactoryStyleFilter"), nDefault ); + nFilter = aFactoryProps.getUnpackedValueOrDefault( "ooSetupFactoryStyleFilter", nDefault ); return nFilter; } @@ -1883,7 +1883,7 @@ void SfxCommonTemplateDialog_Impl::SaveFactoryStyleFilter( SfxObjectShell* i_pOb { OSL_ENSURE( i_pObjSh, "SfxCommonTemplateDialog_Impl::LoadFactoryStyleFilter(): no ObjectShell" ); Sequence< PropertyValue > lProps(1); - lProps[0].Name = DEFINE_CONST_UNICODE("ooSetupFactoryStyleFilter"); + lProps[0].Name = "ooSetupFactoryStyleFilter"; lProps[0].Value = makeAny( i_nFilter );; xModuleManager->replaceByName( getModuleIdentifier( xModuleManager, i_pObjSh ), makeAny( lProps ) ); } diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 9aa0901c0b77..25db61b2d705 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -138,7 +138,7 @@ SfxVersionInfo::SfxVersionInfo() static String ConvertDateTime_Impl(const DateTime& rTime, const LocaleDataWrapper& rWrapper) { - const String pDelim ( DEFINE_CONST_UNICODE( ", ")); + const String pDelim (", "); String aStr(rWrapper.getDate(rTime)); aStr += pDelim; aStr += rWrapper.getTime(rTime, sal_True, sal_False); @@ -292,8 +292,8 @@ void SfxVersionDialog::Open_Impl() SvTreeListEntry *pEntry = aVersionBox.FirstSelected(); sal_uIntPtr nPos = aVersionBox.GetModel()->GetRelPos( pEntry ); SfxInt16Item aItem( SID_VERSION, (short)nPos+1 ); - SfxStringItem aTarget( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") ); - SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE("private:user") ); + SfxStringItem aTarget( SID_TARGETNAME, "_blank" ); + SfxStringItem aReferer( SID_REFERER, "private:user" ); SfxStringItem aFile( SID_FILE_NAME, pObjShell->GetMedium()->GetName() ); uno::Sequence< beans::NamedValue > aEncryptionData; diff --git a/sfx2/source/doc/QuerySaveDocument.cxx b/sfx2/source/doc/QuerySaveDocument.cxx index 49448eb5fe9e..7b24f7d55e15 100644 --- a/sfx2/source/doc/QuerySaveDocument.cxx +++ b/sfx2/source/doc/QuerySaveDocument.cxx @@ -32,9 +32,8 @@ short ExecuteQuerySaveDocument(Window* _pParent,const String& _rTitle) { // don't block Desktop::terminate() if there's no user to ask return RET_NO; } - String aText( SfxResId(STR_QUERY_SAVE_DOCUMENT).toString() ); - aText.SearchAndReplace( DEFINE_CONST_UNICODE( "$(DOC)" ), - _rTitle ); + OUString aText( SfxResId(STR_QUERY_SAVE_DOCUMENT).toString() ); + aText = aText.replaceFirst( "$(DOC)", _rTitle ); QueryBox aQBox( _pParent, WB_YES_NO_CANCEL | WB_DEF_YES, aText ); aQBox.SetText(SfxResId(STR_QUERY_SAVE_DOCUMENT_TITLE).toString()); // Window title aQBox.SetButtonText( BUTTONID_NO, SfxResId(STR_NOSAVEANDCLOSE).toString() ); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 907e0134d938..5cab6ced56d3 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -1348,7 +1348,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( sal_Bool bCreateTempIf util::RevisionTag& rTag = pImp->aVersions[nVersion]; { // Open SubStorage for all versions - uno::Reference < embed::XStorage > xSub = pImp->xStorage->openStorageElement( DEFINE_CONST_UNICODE( "Versions" ), + uno::Reference < embed::XStorage > xSub = pImp->xStorage->openStorageElement( "Versions", embed::ElementModes::READ ); DBG_ASSERT( xSub.is(), "Version list, but no Versions!" ); @@ -2173,7 +2173,7 @@ void SfxMedium::DoBackup_Impl() // save as ".bak" file INetURLObject aDest( aBakDir ); aDest.insertName( aSource.getName() ); - aDest.setExtension( DEFINE_CONST_UNICODE( "bak" ) ); + aDest.setExtension( "bak" ); String aFileName = aDest.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ); // create a content for the source file @@ -3162,8 +3162,7 @@ sal_uInt16 SfxMedium::AddVersion_Impl( util::RevisionTag& rRevision ) if ( aLongs[nKey] > ( sal_uIntPtr ) nKey+1 ) break; - String aRevName = DEFINE_CONST_UNICODE( "Version" ); - aRevName += String::CreateFromInt32( nKey + 1 ); + OUString aRevName = "Version" + OUString::number( nKey + 1 ); pImp->aVersions.realloc( nLength+1 ); rRevision.Identifier = aRevName; pImp->aVersions[nLength] = rRevision; diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx index f7d47e839573..1028f85a5a92 100644 --- a/sfx2/source/doc/docfilt.cxx +++ b/sfx2/source/doc/docfilt.cxx @@ -63,13 +63,13 @@ SfxFilter::SfxFilter( const String &rName, String aShort, aLong; String aRet; sal_uInt16 nMaxLength = USHRT_MAX; - String aTest; + OUString aTest; sal_uInt16 nPos = 0; while( ( aRet = aExts.GetToken( nPos++, ';' ) ).Len() ) { aTest = aRet; - aTest.SearchAndReplace( DEFINE_CONST_UNICODE( "*." ), String() ); - if( aTest.Len() <= nMaxLength ) + aTest = aTest.replaceFirst( "*." , "" ); + if( aTest.getLength() <= nMaxLength ) { if( aShort.Len() ) aShort += ';'; aShort += aRet; diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index e7edadcaa681..7190f73591f5 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -747,7 +747,7 @@ void SfxObjectShell::SetTitle String X(const String &rRet) { if ( !rRet.Len() ) - return DEFINE_CONST_UNICODE( "-empty-" ); + return String( "-empty-" ); return rRet; } #else @@ -817,7 +817,7 @@ String SfxObjectShell::GetTitle { static sal_Bool bRecur = sal_False; if ( bRecur ) - return DEFINE_CONST_UNICODE( "-not available-" ); + return String( "-not available-" ); bRecur = sal_True; String aTitle; @@ -909,7 +909,7 @@ String SfxObjectShell::GetTitle String aComplete( aURL.GetMainURL( INetURLObject::NO_DECODE ) ); if( aComplete.Len() > nMaxLength ) { - String aRet( DEFINE_CONST_UNICODE( "..." ) ); + String aRet( "..." ); aRet += aComplete.Copy( aComplete.Len() - nMaxLength + 3, nMaxLength - 3 ); return X( aRet ); } diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index afb115bc3bc6..73611c25d5c4 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -486,8 +486,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) } else { - aURL = DEFINE_CONST_UNICODE( "private:factory/" ); - aURL += rtl::OUString::createFromAscii( GetFactory().GetShortName() ); + aURL = "private:factory/" + OUString::createFromAscii( GetFactory().GetShortName() ); aTitle = GetTitle(); } diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 1a03a3bd0ad7..2fa99cbe058a 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -500,7 +500,7 @@ sal_Bool SfxObjectShell::DoInitNew( SfxMedium* pMed ) TransformItems( SID_OPENDOC, *pSet, aArgs ); sal_Int32 nLength = aArgs.getLength(); aArgs.realloc( nLength + 1 ); - aArgs[nLength].Name = DEFINE_CONST_UNICODE("Title"); + aArgs[nLength].Name = "Title"; aArgs[nLength].Value <<= ::rtl::OUString( GetTitle( SFX_TITLE_DETECT ) ); xModel->attachResource( ::rtl::OUString(), aArgs ); impl_addToModelCollection(xModel); @@ -2142,7 +2142,7 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert ) uno::Reference< lang::XMultiServiceFactory > xMan = ::comphelper::getProcessServiceFactory(); uno::Reference < lang::XMultiServiceFactory > xFilterFact ( - xMan->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.document.FilterFactory" ) ), uno::UNO_QUERY ); + xMan->createInstance( "com.sun.star.document.FilterFactory" ), uno::UNO_QUERY ); uno::Sequence < beans::PropertyValue > aProps; uno::Reference < container::XNameAccess > xFilters ( xFilterFact, uno::UNO_QUERY ); @@ -2254,7 +2254,7 @@ sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium ) { uno::Reference< lang::XMultiServiceFactory > xMan = ::comphelper::getProcessServiceFactory(); uno::Reference < lang::XMultiServiceFactory > xFilterFact ( - xMan->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.document.FilterFactory" ) ), uno::UNO_QUERY ); + xMan->createInstance( "com.sun.star.document.FilterFactory" ), uno::UNO_QUERY ); uno::Sequence < beans::PropertyValue > aProps; uno::Reference < container::XNameAccess > xFilters ( xFilterFact, uno::UNO_QUERY ); diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index fdc01f6fe892..77f89faed106 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -274,31 +274,31 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() thro uno::Sequence< beans::PropertyValue > aPrinter(8); - aPrinter.getArray()[7].Name = DEFINE_CONST_UNICODE( "CanSetPaperSize" ); + aPrinter.getArray()[7].Name = "CanSetPaperSize"; aPrinter.getArray()[7].Value <<= ( pPrinter->HasSupport( SUPPORT_SET_PAPERSIZE ) ); - aPrinter.getArray()[6].Name = DEFINE_CONST_UNICODE( "CanSetPaperFormat" ); + aPrinter.getArray()[6].Name = "CanSetPaperFormat"; aPrinter.getArray()[6].Value <<= ( pPrinter->HasSupport( SUPPORT_SET_PAPER ) ); - aPrinter.getArray()[5].Name = DEFINE_CONST_UNICODE( "CanSetPaperOrientation" ); + aPrinter.getArray()[5].Name = "CanSetPaperOrientation"; aPrinter.getArray()[5].Value <<= ( pPrinter->HasSupport( SUPPORT_SET_ORIENTATION ) ); - aPrinter.getArray()[4].Name = DEFINE_CONST_UNICODE( "IsBusy" ); + aPrinter.getArray()[4].Name = "IsBusy"; aPrinter.getArray()[4].Value <<= ( pPrinter->IsPrinting() ); - aPrinter.getArray()[3].Name = DEFINE_CONST_UNICODE( "PaperSize" ); + aPrinter.getArray()[3].Name = "PaperSize"; awt::Size aSize = impl_Size_Object2Struct(pPrinter->GetPaperSize() ); aPrinter.getArray()[3].Value <<= aSize; - aPrinter.getArray()[2].Name = DEFINE_CONST_UNICODE( "PaperFormat" ); + aPrinter.getArray()[2].Name = "PaperFormat"; view::PaperFormat eFormat = convertToPaperFormat(pPrinter->GetPaper()); aPrinter.getArray()[2].Value <<= eFormat; - aPrinter.getArray()[1].Name = DEFINE_CONST_UNICODE( "PaperOrientation" ); + aPrinter.getArray()[1].Name = "PaperOrientation"; view::PaperOrientation eOrient = (view::PaperOrientation)pPrinter->GetOrientation(); aPrinter.getArray()[1].Value <<= eOrient; - aPrinter.getArray()[0].Name = DEFINE_CONST_UNICODE( "Name" ); + aPrinter.getArray()[0].Name = "Name"; String sStringTemp = pPrinter->GetName() ; aPrinter.getArray()[0].Value <<= ::rtl::OUString( sStringTemp ); diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 8bb8035f018b..d78cbafc2295 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -760,7 +760,7 @@ void SfxTemplateManagerDlg::OnTemplateImport () // add "All" filter aFileDlg.AddFilter( String(SfxResId( STR_SFX_FILTERNAME_ALL) ), - DEFINE_CONST_UNICODE(FILEDIALOG_FILTER_ALL) ); + OUString(FILEDIALOG_FILTER_ALL) ); // add template filter OUString sFilterExt; diff --git a/sfx2/source/explorer/nochaos.cxx b/sfx2/source/explorer/nochaos.cxx index dc450c558830..82de6fc93941 100644 --- a/sfx2/source/explorer/nochaos.cxx +++ b/sfx2/source/explorer/nochaos.cxx @@ -100,7 +100,7 @@ CntItemPool* CntItemPool::_pThePool = NULL; //------------------------------------------------------------------------- CntItemPool::CntItemPool() -: SfxItemPool( DEFINE_CONST_UNICODE("chaos"), WID_CHAOS_START, WID_CHAOS_START, NULL ), +: SfxItemPool( "chaos", WID_CHAOS_START, WID_CHAOS_START, NULL ), _nRefs( 0 ) { SetFileFormatVersion( SOFFICE_FILEFORMAT_50 ); diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx index f406c189aa25..b085e37740c5 100644 --- a/sfx2/source/menu/mnumgr.cxx +++ b/sfx2/source/menu/mnumgr.cxx @@ -237,8 +237,7 @@ IMPL_LINK( SfxMenuManager, Select, Menu *, pSelMenu ) const SfxSlot* pSlot = SfxSlotPool::GetSlotPool( pBindings->GetDispatcher()->GetFrame() ).GetSlot( nId ); if ( pSlot && pSlot->pUnoName ) { - aCommand = DEFINE_CONST_UNICODE(".uno:"); - aCommand += rtl::OUString::createFromAscii( pSlot->GetUnoName() ); + aCommand = ".uno:" + OUString::createFromAscii( pSlot->GetUnoName() ); } } diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index d2c2ac8d6e0e..86beded199c0 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -1470,8 +1470,7 @@ sal_Bool Impl_ExistURLInMenu( const PopupMenu *pMenu , if (!bValidFallback) { - *pFallback = DEFINE_CONST_UNICODE("private:factory/"); - *pFallback += String(SvtModuleOptions().GetDefaultModuleName()); + *pFallback = "private:factory/" + SvtModuleOptions().GetDefaultModuleName(); } return sal_False; diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index 8d2a58218553..5b8bf1a7ff0a 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -469,10 +469,10 @@ void SfxFrame::GetTargetList( TargetList& rList ) const { // An empty string for 'No Target' rList.push_back( new String() ); - rList.push_back( new String( DEFINE_CONST_UNICODE( "_top" ) ) ); - rList.push_back( new String( DEFINE_CONST_UNICODE( "_parent" ) ) ); - rList.push_back( new String( DEFINE_CONST_UNICODE( "_blank" ) ) ); - rList.push_back( new String( DEFINE_CONST_UNICODE( "_self" ) ) ); + rList.push_back( new String( "_top" ) ); + rList.push_back( new String( "_parent" ) ); + rList.push_back( new String( "_blank" ) ); + rList.push_back( new String( "_self" ) ); } SfxViewFrame* pView = GetCurrentViewFrame(); diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index 3b4c060de69f..99ee9b5ce7df 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -229,7 +229,7 @@ Reference < XFrame > SfxFrame::CreateBlankFrame() try { Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() ); - xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW ); + xFrame.set( xDesktop->findFrame( "_blank", 0 ), UNO_SET_THROW ); } catch( const Exception& ) { diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 5cdfe81dccbe..5658727c572e 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1888,7 +1888,7 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell } if ( !xFrame.is() ) - xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW ); + xFrame.set( xDesktop->findFrame( "_blank", 0 ), UNO_SET_THROW ); bOwnFrame = true; } @@ -3104,7 +3104,7 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq ) if (!SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SDATABASE)) return; Reference < XFrame > xFrame = GetFrame().GetTopFrame().GetFrameInterface(); - Reference < XFrame > xBeamer( xFrame->findFrame( DEFINE_CONST_UNICODE("_beamer"), FrameSearchFlag::CHILDREN ) ); + Reference < XFrame > xBeamer( xFrame->findFrame( "_beamer", FrameSearchFlag::CHILDREN ) ); sal_Bool bShow = sal_False; sal_Bool bHasChild = xBeamer.is(); bShow = pShowItem ? pShowItem->GetValue() : !bHasChild; @@ -3207,7 +3207,7 @@ void SfxViewFrame::ChildWindowState( SfxItemSet& rState ) else if ( nSID == SID_BROWSER ) { Reference < XFrame > xFrame = GetFrame().GetTopFrame().GetFrameInterface()-> - findFrame( DEFINE_CONST_UNICODE("_beamer"), FrameSearchFlag::CHILDREN ); + findFrame( "_beamer", FrameSearchFlag::CHILDREN ); if ( !xFrame.is() ) rState.DisableItem( nSID ); else if ( KnowsChildWindow(nSID) ) diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 6a0a9faf4b43..9255a3a14a01 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -659,7 +659,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) // no help button in dialogs if called from the help window // (pressing help button would exchange the current page inside the help // document that is going to be printed!) - String aHelpFilterName( DEFINE_CONST_UNICODE("writer_web_HTML_help") ); + String aHelpFilterName( "writer_web_HTML_help" ); SfxMedium* pMedium = GetViewFrame()->GetObjectShell()->GetMedium(); const SfxFilter* pFilter = pMedium ? pMedium->GetFilter() : NULL; sal_Bool bPrintOnHelp = ( pFilter && pFilter->GetFilterName() == aHelpFilterName ); diff --git a/svtools/source/config/test/test.cxx b/svtools/source/config/test/test.cxx index 9fe702abe8fb..7312a5f37eb5 100644 --- a/svtools/source/config/test/test.cxx +++ b/svtools/source/config/test/test.cxx @@ -58,8 +58,6 @@ using namespace ::com::sun::star::lang ; using namespace ::com::sun::star::beans ; using namespace ::com::sun::star::registry ; -#define ASCII( STEXT ) OUString( RTL_CONSTASCII_USTRINGPARAM( STEXT )) - class TestApplication : public Application { //************************************************************************************************************* @@ -141,18 +139,18 @@ void TestApplication::impl_testDynamicMenuOptions() if( lNewMenu.getLength() < 1 ) { - aCFG.AppendItem( E_NEWMENU, ASCII("private:factory/swriter"), ASCII("new writer"), ASCII("icon_writer"), ASCII("_blank") ); - aCFG.AppendItem( E_NEWMENU, ASCII("private:factory/scalc" ), ASCII("new calc" ), ASCII("icon_calc" ), ASCII("_blank") ); - aCFG.AppendItem( E_NEWMENU, ASCII("private:factory/sdraw" ), ASCII("new draw" ), ASCII("icon_draw" ), ASCII("_blank") ); + aCFG.AppendItem( E_NEWMENU, "private:factory/swriter", "new writer", "icon_writer", "_blank"; + aCFG.AppendItem( E_NEWMENU, "private:factory/scalc", "new calc", "icon_calc", "_blank"; + aCFG.AppendItem( E_NEWMENU, "private:factory/sdraw", "new draw", "icon_draw", "_blank"; lNewMenu = aCFG.GetMenu( E_NEWMENU ); } if( lWizardMenu.getLength() < 1 ) { - aCFG.AppendItem( E_WIZARDMENU, ASCII("file://a"), ASCII("system file"), ASCII("icon_file"), ASCII("_self") ); - aCFG.AppendItem( E_WIZARDMENU, ASCII("ftp://b" ), ASCII("ftp host" ), ASCII("icon_ftp" ), ASCII("_self") ); - aCFG.AppendItem( E_WIZARDMENU, ASCII("http://c"), ASCII("www" ), ASCII("icon_www" ), ASCII("_self") ); + aCFG.AppendItem( E_WIZARDMENU, "file://a", "system file", "icon_file", "_self"; + aCFG.AppendItem( E_WIZARDMENU, "ftp://b", "ftp host", "icon_ftp", "_self"; + aCFG.AppendItem( E_WIZARDMENU, "http://c", "www", "icon_www", "_self"; lWizardMenu = aCFG.GetMenu( E_WIZARDMENU ); } diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index 676593564425..f8547c2c12b8 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -104,12 +104,11 @@ using namespace svtools; #define ICON_POS_MYDOCS 2 #define ICON_POS_SAMPLES 3 -#define ASCII_STR(s) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(s) ) -#define VIEWSETTING_NEWFROMTEMPLATE ASCII_STR("NewFromTemplate") -#define VIEWSETTING_SELECTEDGROUP ASCII_STR("SelectedGroup") -#define VIEWSETTING_SELECTEDVIEW ASCII_STR("SelectedView") -#define VIEWSETTING_SPLITRATIO ASCII_STR("SplitRatio") -#define VIEWSETTING_LASTFOLDER ASCII_STR("LastFolder") +#define VIEWSETTING_NEWFROMTEMPLATE "NewFromTemplate" +#define VIEWSETTING_SELECTEDGROUP "SelectedGroup" +#define VIEWSETTING_SELECTEDVIEW "SelectedView" +#define VIEWSETTING_SPLITRATIO "SplitRatio" +#define VIEWSETTING_LASTFOLDER "LastFolder" struct FolderHistory { @@ -156,10 +155,10 @@ SvtIconWindow_Impl::SvtIconWindow_Impl( Window* pParent ) : aDummyHeaderBar( this ), aIconCtrl( this, WB_ICON | WB_NOCOLUMNHEADER | WB_HIGHLIGHTFRAME | /*!WB_NOSELECTION |*/ WB_NODRAGSELECTION | WB_TABSTOP | WB_CLIPCHILDREN ), - aNewDocumentRootURL( ASCII_STR("private:newdoc") ), + aNewDocumentRootURL( "private:newdoc" ), aMyDocumentsRootURL( SvtPathOptions().GetWorkPath() ), aSamplesFolderRootURL( SvtPathOptions(). - SubstituteVariable( String( ASCII_STR("$(insturl)/share/samples/$(vlang)") ) ) ), + SubstituteVariable( String( "$(insturl)/share/samples/$(vlang)" ) ) ), nMaxTextLength( 0 ) { @@ -461,8 +460,8 @@ Sequence< ::rtl::OUString > SvtFileViewWindow_Impl::GetNewDocContents() const ::rtl::OUString aTargetFrame; sal_uInt32 i, nCount = aDynamicMenuEntries.getLength(); - ::rtl::OUString sSeparator( ASCII_STR("private:separator") ); - ::rtl::OUString sSlotURL( ASCII_STR("slot:5500") ); + ::rtl::OUString sSeparator( "private:separator" ); + ::rtl::OUString sSlotURL( "slot:5500" ); for ( i = 0; i < nCount; ++i ) { @@ -471,7 +470,7 @@ Sequence< ::rtl::OUString > SvtFileViewWindow_Impl::GetNewDocContents() const continue; if( aURL == sSeparator ) { - String aSeparator( ASCII_STR( aSeparatorStr ) ); + String aSeparator( aSeparatorStr ); ::rtl::OUString* pSeparator = new ::rtl::OUString( aSeparator ); aNewDocs.push_back( pSeparator ); } @@ -610,7 +609,7 @@ SvtFrameWindow_Impl::SvtFrameWindow_Impl( Window* pParent ) : pEditWin = new ODocumentInfoPreview( this ,WB_LEFT | WB_VSCROLL | WB_READONLY | WB_BORDER | WB_3DLOOK); pTextWin = new Window( this ); xFrame = Reference < XFrame > ( ::comphelper::getProcessServiceFactory()-> - createInstance( ASCII_STR("com.sun.star.frame.Frame") ), UNO_QUERY ); + createInstance( "com.sun.star.frame.Frame" ), UNO_QUERY ); xWindow = VCLUnoHelper::GetInterface( pTextWin ); xFrame->initialize( xWindow ); @@ -710,14 +709,14 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B String aTarget; Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); if ( bPreview ) - aTarget = ASCII_STR("_self"); + aTarget = "_self"; else { // can be removed if the database application change its URL String sServiceScheme( RTL_CONSTASCII_USTRINGPARAM( "service:" ) ); if ( rURL.Match( sServiceScheme ) != sServiceScheme.Len() ) // service URL has no default target - aTarget = ASCII_STR("_default"); + aTarget = "_default"; xProv = Reference < XDispatchProvider >( Desktop::create(::comphelper::getProcessComponentContext() ), UNO_QUERY_THROW ); } @@ -740,11 +739,11 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B { sal_Bool b = sal_True; Sequence < PropertyValue > aArgs( 4 ); - aArgs[0].Name = ASCII_STR("Preview"); + aArgs[0].Name = "Preview"; aArgs[0].Value.setValue( &b, ::getBooleanCppuType() ); - aArgs[1].Name = ASCII_STR("ReadOnly"); + aArgs[1].Name = "ReadOnly"; aArgs[1].Value.setValue( &b, ::getBooleanCppuType() ); - aArgs[2].Name = ASCII_STR("AsTemplate"); // prevents getting an empty URL with getURL()! + aArgs[2].Name = "AsTemplate"; // prevents getting an empty URL with getURL()! uno::Reference < task::XInteractionHandler2 > xInteractionHandler( task::InteractionHandler::createWithParent(::comphelper::getProcessComponentContext(), 0) ); @@ -778,7 +777,7 @@ void SvtFrameWindow_Impl::OpenFile( const String& rURL, sal_Bool bPreview, sal_B else if ( bIsTemplate ) { Sequence < PropertyValue > aArgs( 1 ); - aArgs[0].Name = ASCII_STR("AsTemplate"); + aArgs[0].Name = "AsTemplate"; aArgs[0].Value <<= bAsTemplate; xDisp->dispatch( aURL, aArgs ); m_aOpenURL = rtl::OUString(); @@ -975,14 +974,14 @@ void SvtTemplateWindow::PrintFile( const String& rURL ) { // open the file readonly and hidden Sequence < PropertyValue > aArgs( 2 ); - aArgs[0].Name = ASCII_STR("ReadOnly"); + aArgs[0].Name = "ReadOnly"; aArgs[0].Value <<= sal_True; - aArgs[1].Name = ASCII_STR("Hidden"); + aArgs[1].Name = "Hidden"; aArgs[1].Value <<= sal_True; Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() ); Reference < XModel > xModel( xDesktop->loadComponentFromURL( - rURL, ASCII_STR("_blank"), 0, aArgs ), UNO_QUERY ); + rURL, "_blank", 0, aArgs ), UNO_QUERY ); if ( xModel.is() ) { // print @@ -1570,7 +1569,7 @@ IMPL_LINK_NOARG(SvtDocumentTemplateDialog , DoubleClickHdl_Impl) IMPL_LINK_NOARG(SvtDocumentTemplateDialog , NewFolderHdl_Impl) { String aNewTitle( pImpl->aTitle ); - aNewTitle += String( ASCII_STR(" - ") ); + aNewTitle += String( " - " ); aNewTitle += pImpl->pWin->GetFolderTitle(); SetText( aNewTitle ); @@ -1623,7 +1622,7 @@ IMPL_LINK_NOARG(SvtDocumentTemplateDialog , OrganizerHdl_Impl) xFrame = Reference < XFrame >( xDesktop, UNO_QUERY ); com::sun::star::util::URL aTargetURL; - aTargetURL.Complete = ASCII_STR("slot:5540"); + aTargetURL.Complete = "slot:5540"; Reference< com::sun::star::util::XURLTransformer > xTrans( com::sun::star::util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); xTrans->parseStrict( aTargetURL ); @@ -1636,8 +1635,8 @@ IMPL_LINK_NOARG(SvtDocumentTemplateDialog , OrganizerHdl_Impl) { Sequence<PropertyValue> aArgs(1); PropertyValue* pArg = aArgs.getArray(); - pArg[0].Name = ASCII_STR("Referer"); - pArg[0].Value <<= ASCII_STR("private:user"); + pArg[0].Name = "Referer"; + pArg[0].Value <<= OUString("private:user"); xDisp->dispatch( aTargetURL, aArgs ); } diff --git a/svtools/source/control/collatorres.cxx b/svtools/source/control/collatorres.cxx index 2088391a904e..91e7d2c3f2e9 100644 --- a/svtools/source/control/collatorres.cxx +++ b/svtools/source/control/collatorres.cxx @@ -66,21 +66,20 @@ CollatorResource::CollatorResource() { mp_Data = new CollatorResourceData[COLLATOR_RESOURCE_COUNT]; - #define ASCSTR(str) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(str)) #define RESSTR(rid) SvtResId(rid).toString() - mp_Data[0] = CollatorResourceData (ASCSTR("alphanumeric"), RESSTR(STR_SVT_COLLATE_ALPHANUMERIC)); - mp_Data[1] = CollatorResourceData (ASCSTR("charset"), RESSTR(STR_SVT_COLLATE_CHARSET)); - mp_Data[2] = CollatorResourceData (ASCSTR("dict"), RESSTR(STR_SVT_COLLATE_DICTIONARY)); - mp_Data[3] = CollatorResourceData (ASCSTR("normal"), RESSTR(STR_SVT_COLLATE_NORMAL)); - mp_Data[4] = CollatorResourceData (ASCSTR("pinyin"), RESSTR(STR_SVT_COLLATE_PINYIN)); - mp_Data[5] = CollatorResourceData (ASCSTR("radical"), RESSTR(STR_SVT_COLLATE_RADICAL)); - mp_Data[6] = CollatorResourceData (ASCSTR("stroke"), RESSTR(STR_SVT_COLLATE_STROKE)); - mp_Data[7] = CollatorResourceData (ASCSTR("unicode"), RESSTR(STR_SVT_COLLATE_UNICODE)); - mp_Data[8] = CollatorResourceData (ASCSTR("zhuyin"), RESSTR(STR_SVT_COLLATE_ZHUYIN)); - mp_Data[9] = CollatorResourceData (ASCSTR("phonebook"), RESSTR(STR_SVT_COLLATE_PHONEBOOK)); - mp_Data[10] = CollatorResourceData (ASCSTR("phonetic (alphanumeric first)"), RESSTR(STR_SVT_COLLATE_PHONETIC_F)); - mp_Data[11] = CollatorResourceData (ASCSTR("phonetic (alphanumeric last)"), RESSTR(STR_SVT_COLLATE_PHONETIC_L)); + mp_Data[0] = CollatorResourceData ("alphanumeric", RESSTR(STR_SVT_COLLATE_ALPHANUMERIC)); + mp_Data[1] = CollatorResourceData ("charset", RESSTR(STR_SVT_COLLATE_CHARSET)); + mp_Data[2] = CollatorResourceData ("dict", RESSTR(STR_SVT_COLLATE_DICTIONARY)); + mp_Data[3] = CollatorResourceData ("normal", RESSTR(STR_SVT_COLLATE_NORMAL)); + mp_Data[4] = CollatorResourceData ("pinyin", RESSTR(STR_SVT_COLLATE_PINYIN)); + mp_Data[5] = CollatorResourceData ("radical", RESSTR(STR_SVT_COLLATE_RADICAL)); + mp_Data[6] = CollatorResourceData ("stroke", RESSTR(STR_SVT_COLLATE_STROKE)); + mp_Data[7] = CollatorResourceData ("unicode", RESSTR(STR_SVT_COLLATE_UNICODE)); + mp_Data[8] = CollatorResourceData ("zhuyin", RESSTR(STR_SVT_COLLATE_ZHUYIN)); + mp_Data[9] = CollatorResourceData ("phonebook", RESSTR(STR_SVT_COLLATE_PHONEBOOK)); + mp_Data[10] = CollatorResourceData ("phonetic (alphanumeric first)", RESSTR(STR_SVT_COLLATE_PHONETIC_F)); + mp_Data[11] = CollatorResourceData ("phonetic (alphanumeric last)", RESSTR(STR_SVT_COLLATE_PHONETIC_L)); } CollatorResource::~CollatorResource() diff --git a/svtools/source/control/indexentryres.cxx b/svtools/source/control/indexentryres.cxx index 3de91419a88f..0a495447a29d 100644 --- a/svtools/source/control/indexentryres.cxx +++ b/svtools/source/control/indexentryres.cxx @@ -66,32 +66,31 @@ IndexEntryResource::IndexEntryResource() { mp_Data = new IndexEntryResourceData[INDEXENTRY_RESOURCE_COUNT]; - #define ASCSTR(str) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(str)) #define RESSTR(rid) SvtResId(rid).toString() mp_Data[STR_SVT_INDEXENTRY_ALPHANUMERIC - STR_SVT_INDEXENTRY_START] = - IndexEntryResourceData (ASCSTR("alphanumeric"), RESSTR(STR_SVT_INDEXENTRY_ALPHANUMERIC)); + IndexEntryResourceData ("alphanumeric", RESSTR(STR_SVT_INDEXENTRY_ALPHANUMERIC)); mp_Data[STR_SVT_INDEXENTRY_DICTIONARY - STR_SVT_INDEXENTRY_START] = - IndexEntryResourceData (ASCSTR("dict"), RESSTR(STR_SVT_INDEXENTRY_DICTIONARY)); + IndexEntryResourceData ("dict", RESSTR(STR_SVT_INDEXENTRY_DICTIONARY)); mp_Data[STR_SVT_INDEXENTRY_PINYIN - STR_SVT_INDEXENTRY_START] = - IndexEntryResourceData (ASCSTR("pinyin"), RESSTR(STR_SVT_INDEXENTRY_PINYIN)); + IndexEntryResourceData ("pinyin", RESSTR(STR_SVT_INDEXENTRY_PINYIN)); mp_Data[STR_SVT_INDEXENTRY_PINYIN - STR_SVT_INDEXENTRY_START] = - IndexEntryResourceData (ASCSTR("radical"), RESSTR(STR_SVT_INDEXENTRY_RADICAL)); + IndexEntryResourceData ("radical", RESSTR(STR_SVT_INDEXENTRY_RADICAL)); mp_Data[STR_SVT_INDEXENTRY_STROKE - STR_SVT_INDEXENTRY_START] = - IndexEntryResourceData (ASCSTR("stroke"), RESSTR(STR_SVT_INDEXENTRY_STROKE)); + IndexEntryResourceData ("stroke", RESSTR(STR_SVT_INDEXENTRY_STROKE)); mp_Data[STR_SVT_INDEXENTRY_STROKE - STR_SVT_INDEXENTRY_START] = - IndexEntryResourceData (ASCSTR("zhuyin"), RESSTR(STR_SVT_INDEXENTRY_ZHUYIN)); + IndexEntryResourceData ("zhuyin", RESSTR(STR_SVT_INDEXENTRY_ZHUYIN)); mp_Data[STR_SVT_INDEXENTRY_ZHUYIN - STR_SVT_INDEXENTRY_START] = - IndexEntryResourceData (ASCSTR("phonetic (alphanumeric first) (grouped by syllable)"), + IndexEntryResourceData ("phonetic (alphanumeric first) (grouped by syllable)", RESSTR(STR_SVT_INDEXENTRY_PHONETIC_FS)); mp_Data[STR_SVT_INDEXENTRY_PHONETIC_FS - STR_SVT_INDEXENTRY_START] = - IndexEntryResourceData (ASCSTR("phonetic (alphanumeric first) (grouped by consonant)"), + IndexEntryResourceData ("phonetic (alphanumeric first) (grouped by consonant)", RESSTR(STR_SVT_INDEXENTRY_PHONETIC_FC)); mp_Data[STR_SVT_INDEXENTRY_PHONETIC_FC - STR_SVT_INDEXENTRY_START] = - IndexEntryResourceData (ASCSTR("phonetic (alphanumeric last) (grouped by syllable)"), + IndexEntryResourceData ("phonetic (alphanumeric last) (grouped by syllable)", RESSTR(STR_SVT_INDEXENTRY_PHONETIC_LS)); mp_Data[STR_SVT_INDEXENTRY_PHONETIC_LS - STR_SVT_INDEXENTRY_START] = - IndexEntryResourceData (ASCSTR("phonetic (alphanumeric last) (grouped by consonant)"), + IndexEntryResourceData ("phonetic (alphanumeric last) (grouped by consonant)", RESSTR(STR_SVT_INDEXENTRY_PHONETIC_LC)); } diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx index 2a3f71492dcc..749bc20c01a7 100644 --- a/svtools/source/misc/imagemgr.cxx +++ b/svtools/source/misc/imagemgr.cxx @@ -46,7 +46,6 @@ #define NO_INDEX ((sal_uInt16)0xFFFF) #define CONTENT_HELPER ::utl::UCBContentHelper -#define ASCII_STRING(s) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(s) ) struct SvtExtensionResIdMapping_Impl { @@ -308,11 +307,11 @@ static sal_Bool GetVolumeProperties_Impl( ::ucbhelper::Content& rContent, svtool try { - bRet = ( ( rContent.getPropertyValue( ASCII_STRING("IsVolume") ) >>= rVolumeInfo.m_bIsVolume ) && - ( rContent.getPropertyValue( ASCII_STRING("IsRemote") ) >>= rVolumeInfo.m_bIsRemote ) && - ( rContent.getPropertyValue( ASCII_STRING("IsRemoveable") ) >>= rVolumeInfo.m_bIsRemoveable ) && - ( rContent.getPropertyValue( ASCII_STRING("IsFloppy") ) >>= rVolumeInfo.m_bIsFloppy ) && - ( rContent.getPropertyValue( ASCII_STRING("IsCompactDisc") ) >>= rVolumeInfo.m_bIsCompactDisc ) ); + bRet = ( ( rContent.getPropertyValue( "IsVolume" ) >>= rVolumeInfo.m_bIsVolume ) && + ( rContent.getPropertyValue( "IsRemote" ) >>= rVolumeInfo.m_bIsRemote ) && + ( rContent.getPropertyValue( "IsRemoveable" ) >>= rVolumeInfo.m_bIsRemoveable ) && + ( rContent.getPropertyValue( "IsFloppy" ) >>= rVolumeInfo.m_bIsFloppy ) && + ( rContent.getPropertyValue( "IsCompactDisc" ) >>= rVolumeInfo.m_bIsCompactDisc ) ); } catch( const ::com::sun::star::uno::RuntimeException& ) { diff --git a/svx/source/dialog/dlgunit.hxx b/svx/source/dialog/dlgunit.hxx index 4d2aa68b25c4..2956faf4f45a 100644 --- a/svx/source/dialog/dlgunit.hxx +++ b/svx/source/dialog/dlgunit.hxx @@ -22,19 +22,19 @@ #include <svx/svdtrans.hxx> -inline String GetUnitString( long nVal_100, FieldUnit eFieldUnit, sal_Unicode cSep ) +inline OUString GetUnitString( long nVal_100, FieldUnit eFieldUnit, sal_Unicode cSep ) { - String aVal = rtl::OUString::valueOf(static_cast<sal_Int64>( - MetricField::ConvertValue(nVal_100, 2, MAP_100TH_MM, eFieldUnit))); + OUStringBuffer aVal = OUString::number( + MetricField::ConvertValue(nVal_100, 2, MAP_100TH_MM, eFieldUnit)); - while( aVal.Len() < 3 ) - aVal.Insert( sal_Unicode('0'), 0 ); + while( aVal.getLength() < 3 ) + aVal.insert( 0, "0" ); - aVal.Insert( cSep, aVal.Len() - 2 ); - aVal += sal_Unicode(' '); - aVal += SdrFormatter::GetUnitStr( eFieldUnit ); + aVal.insert( aVal.getLength() - 2, cSep ); + aVal.append(" "); + aVal.append(SdrFormatter::GetUnitStr( eFieldUnit )); - return aVal; + return aVal.makeStringAndClear(); } #endif // _SVX_DLG_DLGUNIT_HXX diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index ddf0f3bb5d8c..9ffe510ffdd2 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -57,17 +57,17 @@ #include "dlgunit.hxx" #define SELF_TARGET "_self" -#define IMAP_ALL_FILTER "<Alle>" -#define IMAP_CERN_FILTER "MAP - CERN" -#define IMAP_NCSA_FILTER "MAP - NCSA" -#define IMAP_BINARY_FILTER "SIP - StarView ImageMap" -#define IMAP_ALL_TYPE "*.*" -#define IMAP_BINARY_TYPE "*.sip" -#define IMAP_CERN_TYPE "*.map" -#define IMAP_NCSA_TYPE "*.map" -#define IMAP_BINARY_EXT "sip" -#define IMAP_CERN_EXT "map" -#define IMAP_NCSA_EXT "map" +#define IMAP_ALL_FILTER OUString("<Alle>") +#define IMAP_CERN_FILTER OUString("MAP - CERN") +#define IMAP_NCSA_FILTER OUString("MAP - NCSA") +#define IMAP_BINARY_FILTER OUString("SIP - StarView ImageMap") +#define IMAP_ALL_TYPE OUString("*.*") +#define IMAP_BINARY_TYPE OUString("*.sip") +#define IMAP_CERN_TYPE OUString("*.map") +#define IMAP_NCSA_TYPE OUString("*.map") +#define IMAP_BINARY_EXT OUString("sip") +#define IMAP_CERN_EXT OUString("map") +#define IMAP_NCSA_EXT OUString("map") /******************************************************************************/ @@ -166,8 +166,8 @@ SvxIMapDlg::SvxIMapDlg( SfxBindings *_pBindings, SfxChildWindow *pCW, SetMinOutputSizePixel( aLastSize = GetOutputSizePixel() ); aStbStatus.InsertItem( 1, 130, SIB_LEFT | SIB_IN | SIB_AUTOSIZE ); - aStbStatus.InsertItem( 2, 10 + GetTextWidth( DEFINE_CONST_UNICODE( " 9999,99 cm / 9999,99 cm ") ), SIB_CENTER | SIB_IN ); - aStbStatus.InsertItem( 3, 10 + GetTextWidth( DEFINE_CONST_UNICODE( " 9999,99 cm x 9999,99 cm ") ), SIB_CENTER | SIB_IN ); + aStbStatus.InsertItem( 2, 10 + GetTextWidth( OUString(" 9999,99 cm / 9999,99 cm ") ), SIB_CENTER | SIB_IN ); + aStbStatus.InsertItem( 3, 10 + GetTextWidth( OUString(" 9999,99 cm x 9999,99 cm ") ), SIB_CENTER | SIB_IN ); aFtURL.Disable(); maURLBox.Disable(); @@ -474,12 +474,12 @@ void SvxIMapDlg::DoOpen() com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); ImageMap aLoadIMap; - const String aFilter( DEFINE_CONST_UNICODE( IMAP_ALL_FILTER ) ); + const String aFilter( IMAP_ALL_FILTER ); - aDlg.AddFilter( aFilter, DEFINE_CONST_UNICODE( IMAP_ALL_TYPE ) ); - aDlg.AddFilter( DEFINE_CONST_UNICODE( IMAP_CERN_FILTER ), DEFINE_CONST_UNICODE( IMAP_CERN_TYPE ) ); - aDlg.AddFilter( DEFINE_CONST_UNICODE( IMAP_NCSA_FILTER ), DEFINE_CONST_UNICODE( IMAP_NCSA_TYPE ) ); - aDlg.AddFilter( DEFINE_CONST_UNICODE( IMAP_BINARY_FILTER ), DEFINE_CONST_UNICODE( IMAP_BINARY_TYPE ) ); + aDlg.AddFilter( aFilter, IMAP_ALL_TYPE ); + aDlg.AddFilter( IMAP_CERN_FILTER, IMAP_CERN_TYPE ); + aDlg.AddFilter( IMAP_NCSA_FILTER, IMAP_NCSA_TYPE ); + aDlg.AddFilter( IMAP_BINARY_FILTER, IMAP_BINARY_TYPE ); aDlg.SetCurrentFilter( aFilter ); aDlg.SetDisplayDirectory( SvtPathOptions().GetWorkPath() ); @@ -514,16 +514,16 @@ sal_Bool SvxIMapDlg::DoSave() ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 ); - const String aBinFilter( DEFINE_CONST_UNICODE( IMAP_BINARY_FILTER ) ); - const String aCERNFilter( DEFINE_CONST_UNICODE( IMAP_CERN_FILTER ) ); - const String aNCSAFilter( DEFINE_CONST_UNICODE( IMAP_NCSA_FILTER ) ); + const String aBinFilter( IMAP_BINARY_FILTER ); + const String aCERNFilter( IMAP_CERN_FILTER ); + const String aNCSAFilter( IMAP_NCSA_FILTER ); SdrModel* pModel = pIMapWnd->GetSdrModel(); const sal_Bool bChanged = pModel->IsChanged(); sal_Bool bRet = false; - aDlg.AddFilter( aCERNFilter, DEFINE_CONST_UNICODE( IMAP_CERN_TYPE ) ); - aDlg.AddFilter( aNCSAFilter, DEFINE_CONST_UNICODE( IMAP_NCSA_TYPE ) ); - aDlg.AddFilter( aBinFilter, DEFINE_CONST_UNICODE( IMAP_BINARY_TYPE ) ); + aDlg.AddFilter( aCERNFilter, IMAP_CERN_TYPE ); + aDlg.AddFilter( aNCSAFilter, IMAP_NCSA_TYPE ); + aDlg.AddFilter( aBinFilter, IMAP_BINARY_TYPE ); aDlg.SetCurrentFilter( aCERNFilter ); aDlg.SetDisplayDirectory( SvtPathOptions().GetWorkPath() ); @@ -537,17 +537,17 @@ sal_Bool SvxIMapDlg::DoSave() if ( aFilter == aBinFilter ) { nFormat = IMAP_FORMAT_BIN; - aExt = DEFINE_CONST_UNICODE( IMAP_BINARY_EXT ); + aExt = IMAP_BINARY_EXT; } else if ( aFilter == aCERNFilter ) { nFormat = IMAP_FORMAT_CERN; - aExt = DEFINE_CONST_UNICODE( IMAP_CERN_EXT ); + aExt = IMAP_CERN_EXT; } else if ( aFilter == aNCSAFilter ) { nFormat = IMAP_FORMAT_NCSA; - aExt = DEFINE_CONST_UNICODE( IMAP_NCSA_EXT ); + aExt = IMAP_NCSA_EXT; } else { @@ -597,7 +597,7 @@ IMPL_LINK( SvxIMapDlg, InfoHdl, IMapWindow*, pWnd ) aEdtText.SetText( rInfo.aMarkAltText ); if ( !rInfo.aMarkTarget.Len() ) - maCbbTarget.SetText( DEFINE_CONST_UNICODE( SELF_TARGET ) ); + maCbbTarget.SetText( SELF_TARGET ); else maCbbTarget.SetText( rInfo.aMarkTarget ); } @@ -643,7 +643,7 @@ IMPL_LINK( SvxIMapDlg, InfoHdl, IMapWindow*, pWnd ) aEdtText.SetText( rInfo.aMarkAltText ); if ( !rInfo.aMarkTarget.Len() ) - maCbbTarget.SetText( DEFINE_CONST_UNICODE( SELF_TARGET ) ); + maCbbTarget.SetText( SELF_TARGET ); else maCbbTarget.SetText( rInfo.aMarkTarget ); } @@ -653,15 +653,13 @@ IMPL_LINK( SvxIMapDlg, InfoHdl, IMapWindow*, pWnd ) IMPL_LINK( SvxIMapDlg, MousePosHdl, IMapWindow*, pWnd ) { - String aStr; const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit(); const Point& rMousePos = pWnd->GetMousePos(); const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() ); const sal_Unicode cSep = rLocaleWrapper.getNumDecimalSep()[0]; - aStr.Assign( GetUnitString( rMousePos.X(), eFieldUnit, cSep ) ); - aStr.Append( DEFINE_CONST_UNICODE( " / " ) ); - aStr.Append( GetUnitString( rMousePos.Y(), eFieldUnit, cSep ) ); + OUString aStr = GetUnitString( rMousePos.X(), eFieldUnit, cSep ) + + " / " + GetUnitString( rMousePos.Y(), eFieldUnit, cSep ); aStbStatus.SetItemText( 2, aStr ); @@ -670,15 +668,13 @@ IMPL_LINK( SvxIMapDlg, MousePosHdl, IMapWindow*, pWnd ) IMPL_LINK( SvxIMapDlg, GraphSizeHdl, IMapWindow*, pWnd ) { - String aStr; const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit(); const Size& rSize = pWnd->GetGraphicSize(); const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() ); const sal_Unicode cSep = rLocaleWrapper.getNumDecimalSep()[0]; - aStr.Assign( GetUnitString( rSize.Width(), eFieldUnit, cSep ) ); - aStr.Append( DEFINE_CONST_UNICODE( " x " ) ); - aStr.Append( GetUnitString( rSize.Height(), eFieldUnit, cSep ) ); + OUString aStr = GetUnitString( rSize.Width(), eFieldUnit, cSep ) + + " x " + GetUnitString( rSize.Height(), eFieldUnit, cSep ); aStbStatus.SetItemText( 3, aStr ); @@ -717,7 +713,7 @@ IMPL_LINK_NOARG(SvxIMapDlg, URLLoseFocusHdl) aNewInfo.aMarkAltText = aEdtText.GetText(); if ( !aTargetText.Len() ) - aNewInfo.aMarkTarget = DEFINE_CONST_UNICODE( SELF_TARGET ); + aNewInfo.aMarkTarget = SELF_TARGET; else aNewInfo.aMarkTarget = aTargetText; diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index 3d6b18bfd280..f38c616b7cb2 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -66,15 +66,15 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::dom::events; using namespace ::svx; -#define CFGNAME_DATANAVIGATOR DEFINE_CONST_UNICODE("DataNavigator") -#define CFGNAME_SHOWDETAILS DEFINE_CONST_UNICODE("ShowDetails") -#define MSG_VARIABLE DEFINE_CONST_UNICODE("%1") -#define MODELNAME DEFINE_CONST_UNICODE("$MODELNAME") -#define INSTANCENAME DEFINE_CONST_UNICODE("$INSTANCENAME") -#define ELEMENTNAME DEFINE_CONST_UNICODE("$ELEMENTNAME") -#define ATTRIBUTENAME DEFINE_CONST_UNICODE("$ATTRIBUTENAME") -#define SUBMISSIONNAME DEFINE_CONST_UNICODE("$SUBMISSIONNAME") -#define BINDINGNAME DEFINE_CONST_UNICODE("$BINDINGNAME") +#define CFGNAME_DATANAVIGATOR "DataNavigator" +#define CFGNAME_SHOWDETAILS "ShowDetails" +#define MSG_VARIABLE "%1" +#define MODELNAME "$MODELNAME" +#define INSTANCENAME "$INSTANCENAME" +#define ELEMENTNAME "$ELEMENTNAME" +#define ATTRIBUTENAME "$ATTRIBUTENAME" +#define SUBMISSIONNAME "$SUBMISSIONNAME" +#define BINDINGNAME "$BINDINGNAME" //............................................................................ namespace svxform @@ -1103,10 +1103,10 @@ namespace svxform css::xml::dom::NodeType eChildType = pNode->m_xNode->getNodeType(); bool bIsElement = ( eChildType == css::xml::dom::NodeType_ELEMENT_NODE ); sal_uInt16 nResId = bIsElement ? RID_QRY_REMOVE_ELEMENT : RID_QRY_REMOVE_ATTRIBUTE; - String sVar = bIsElement ? ELEMENTNAME : ATTRIBUTENAME; + OUString sVar = bIsElement ? OUString(ELEMENTNAME) : OUString(ATTRIBUTENAME); QueryBox aQBox( this, SVX_RES( nResId ) ); - String sMessText = aQBox.GetMessText(); - sMessText.SearchAndReplace( + OUString sMessText = aQBox.GetMessText(); + sMessText = sMessText.replaceFirst( sVar, m_xUIHelper->getNodeDisplayName( pNode->m_xNode, sal_False ) ); aQBox.SetMessText( sMessText ); if ( aQBox.Execute() == RET_YES ) @@ -1135,9 +1135,9 @@ namespace svxform DBG_ASSERT( pNode->m_xPropSet.is(), "XFormsPage::RemoveEntry(): no propset" ); bool bSubmission = ( DGTSubmission == m_eGroup ); sal_uInt16 nResId = bSubmission ? RID_QRY_REMOVE_SUBMISSION : RID_QRY_REMOVE_BINDING; - rtl::OUString sProperty = bSubmission ? PN_SUBMISSION_ID : PN_BINDING_ID; - String sSearch = bSubmission ? SUBMISSIONNAME : BINDINGNAME; - rtl::OUString sName; + OUString sProperty = bSubmission ? OUString(PN_SUBMISSION_ID) : OUString(PN_BINDING_ID); + OUString sSearch = bSubmission ? OUString(SUBMISSIONNAME) : OUString(BINDINGNAME); + OUString sName; try { pNode->m_xPropSet->getPropertyValue( sProperty ) >>= sName; @@ -1667,8 +1667,8 @@ namespace svxform { // error: model name already exists ErrorBox aErrBox( this, SVX_RES( RID_ERR_DOUBLE_MODELNAME ) ); - String sMessText = aErrBox.GetMessText(); - sMessText.SearchAndReplace( MSG_VARIABLE, sNewName ); + OUString sMessText = aErrBox.GetMessText(); + sMessText = sMessText.replaceFirst( MSG_VARIABLE, sNewName ); aErrBox.SetMessText( sMessText ); aErrBox.Execute(); bShowDialog = true; @@ -1766,8 +1766,8 @@ namespace svxform case MID_MODELS_REMOVE : { QueryBox aQBox( this, SVX_RES( RID_QRY_REMOVE_MODEL ) ); - String sText = aQBox.GetMessText(); - sText.SearchAndReplace( MODELNAME, sSelectedModel ); + OUString sText = aQBox.GetMessText(); + sText = sText.replaceFirst( MODELNAME, sSelectedModel ); aQBox.SetMessText( sText ); if ( aQBox.Execute() == RET_YES ) { @@ -1871,8 +1871,8 @@ namespace svxform { String sInstName = pPage->GetInstanceName(); QueryBox aQBox( this, SVX_RES( RID_QRY_REMOVE_INSTANCE ) ); - String sMessText = aQBox.GetMessText(); - sMessText.SearchAndReplace( INSTANCENAME, sInstName ); + OUString sMessText = aQBox.GetMessText(); + sMessText = sMessText.replaceFirst( INSTANCENAME, sInstName ); aQBox.SetMessText( sMessText ); if ( aQBox.Execute() == RET_YES ) { @@ -2670,8 +2670,8 @@ namespace svxform { // Error and don't close the dialog ErrorBox aErrBox( this, SVX_RES( RID_ERR_INVALID_XMLNAME ) ); - String sMessText = aErrBox.GetMessText(); - sMessText.SearchAndReplace( MSG_VARIABLE, sNewName ); + OUString sMessText = aErrBox.GetMessText(); + sMessText = sMessText.replaceFirst( MSG_VARIABLE, sNewName ); aErrBox.SetMessText( sMessText ); aErrBox.Execute(); return 0; @@ -3342,8 +3342,8 @@ namespace svxform if ( !m_pConditionDlg->GetUIHelper()->isValidPrefixName( sPrefix ) ) { ErrorBox aErrBox( this, SVX_RES( RID_ERR_INVALID_XMLPREFIX ) ); - String sMessText = aErrBox.GetMessText(); - sMessText.SearchAndReplace( MSG_VARIABLE, sPrefix ); + OUString sMessText = aErrBox.GetMessText(); + sMessText = sMessText.replaceFirst( MSG_VARIABLE, sPrefix ); aErrBox.SetMessText( sMessText ); aErrBox.Execute(); return 0; @@ -3667,9 +3667,9 @@ namespace svxform css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); INetURLObject aFile( SvtPathOptions().GetWorkPath() ); - aDlg.AddFilter( m_sAllFilterName, DEFINE_CONST_UNICODE(FILEDIALOG_FILTER_ALL) ); - String sFilterName( DEFINE_CONST_UNICODE("XML") ); - aDlg.AddFilter( sFilterName, DEFINE_CONST_UNICODE("*.xml") ); + aDlg.AddFilter( m_sAllFilterName, OUString(FILEDIALOG_FILTER_ALL) ); + String sFilterName( "XML" ); + aDlg.AddFilter( sFilterName, OUString("*.xml") ); aDlg.SetCurrentFilter( sFilterName ); aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index 0251780f60b3..6ac857181a16 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -877,8 +877,8 @@ IMPL_LINK( SwTableColumnPage, AutoClickHdl, CheckBox *, pBox ) m_pTextArr[i]->SetText( sEntry ); //added by menghu for SODC_5143,12/12/2006 - String sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH); - sColumnWidth.SearchAndReplace( DEFINE_CONST_UNICODE("%1"), sIndex ); + OUString sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH); + sColumnWidth = sColumnWidth.replaceFirst( "%1", sIndex ); m_aFieldArr[i].SetAccessibleName( sColumnWidth ); } diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx index 227e858cf32f..418854443ef9 100644 --- a/unotools/source/config/defaultoptions.cxx +++ b/unotools/source/config/defaultoptions.cxx @@ -40,8 +40,6 @@ using ::rtl::OUString; // define ---------------------------------------------------------------- -#define ASCII_STR(s) OUString( RTL_CONSTASCII_USTRINGPARAM(s) ) - #define DEFAULTPATH__ADDIN 0 #define DEFAULTPATH__AUTOCORRECT 1 #define DEFAULTPATH__AUTOTEXT 2 @@ -219,7 +217,7 @@ String SvtDefaultOptions_Impl::GetDefaultPath( sal_uInt16 nId ) const // ----------------------------------------------------------------------- -SvtDefaultOptions_Impl::SvtDefaultOptions_Impl() : ConfigItem( ASCII_STR("Office.Common/Path/Default") ) +SvtDefaultOptions_Impl::SvtDefaultOptions_Impl() : ConfigItem( "Office.Common/Path/Default" ) { Sequence< OUString > aNames = GetDefaultPropertyNames(); Sequence< Any > aValues = GetProperties( aNames ); diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx index 461f6fcbb338..27e864c9fdb8 100644 --- a/unotools/source/config/viewoptions.cxx +++ b/unotools/source/config/viewoptions.cxx @@ -32,23 +32,17 @@ #include <itemholder1.hxx> -#ifdef CONST_ASCII - #error "Who define CONST_ASCII before! I use it to create const ascii strings ..." -#else - #define CONST_ASCII(SASCIIVALUE) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SASCIIVALUE)) -#endif - -#define PACKAGE_VIEWS CONST_ASCII("org.openoffice.Office.Views") - -#define LIST_DIALOGS CONST_ASCII("Dialogs" ) -#define LIST_TABDIALOGS CONST_ASCII("TabDialogs") -#define LIST_TABPAGES CONST_ASCII("TabPages" ) -#define LIST_WINDOWS CONST_ASCII("Windows" ) - -#define PROPERTY_WINDOWSTATE CONST_ASCII("WindowState") -#define PROPERTY_PAGEID CONST_ASCII("PageID" ) -#define PROPERTY_VISIBLE CONST_ASCII("Visible" ) -#define PROPERTY_USERDATA CONST_ASCII("UserData" ) +#define PACKAGE_VIEWS "org.openoffice.Office.Views" + +#define LIST_DIALOGS "Dialogs" +#define LIST_TABDIALOGS "TabDialogs" +#define LIST_TABPAGES "TabPages" +#define LIST_WINDOWS "Windows" + +#define PROPERTY_WINDOWSTATE "WindowState" +#define PROPERTY_PAGEID "PageID" +#define PROPERTY_VISIBLE "Visible" +#define PROPERTY_USERDATA "UserData" #define DEFAULT_WINDOWSTATE ::rtl::OUString() #define DEFAULT_USERDATA css::uno::Sequence< css::beans::NamedValue >() |