Kaydet (Commit) 52bbd9cc authored tarafından Noel Grandin's avatar Noel Grandin

remove unnecessary RTL_CONSTASCII_STRINGPARAM in appendAscii calls

Convert code like:
    aStrBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "ln(x)" ));
to:
    aStrBuf.append( "ln(x)" );
which compiles down to the same code.

Change-Id: I24c7cb45ceb32fd7cd6ec7ed203c2a5d746f1c5c
üst 3af99e4d
......@@ -148,7 +148,7 @@ OUString LogarithmicRegressionCurveCalculator::ImplGetRepresentation(
aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fSlope ));
aBuf.append( UC_SPACE );
}
aBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "ln(x)" ));
aBuf.append( "ln(x)" );
bHaveSlope = true;
}
......@@ -163,7 +163,7 @@ OUString LogarithmicRegressionCurveCalculator::ImplGetRepresentation(
}
else if( m_fIntercept > 0.0 )
{
aBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " + " ));
aBuf.append( " + " );
aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fIntercept ));
}
}
......
......@@ -153,7 +153,7 @@ OUString PotentialRegressionCurveCalculator::ImplGetRepresentation(
}
if( m_fSlope != 0.0 )
{
aBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "x^" ));
aBuf.append( "x^" );
aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fSlope ));
}
}
......
......@@ -378,12 +378,9 @@ SAL_IMPLEMENT_MAIN()
if (option_info == 0)
{
OUStringBuffer buf;
buf.appendAscii(
RTL_CONSTASCII_STRINGPARAM("unknown option ") );
buf.append("unknown option ");
buf.append( cmd_arg );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(
"! Use climaker --help "
"to print all options.") );
buf.append( "! Use climaker --help to print all options." );
throw RuntimeException(
buf.makeStringAndClear(),
css::uno::Reference< XInterface >() );
......
......@@ -43,7 +43,7 @@ static inline ::System::String ^ to_cts_name(
OUString const & uno_name )
{
OUStringBuffer buf( 7 + uno_name.getLength() );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("unoidl.") );
buf.append( "unoidl." );
buf.append( uno_name );
return ustring_to_String( buf.makeStringAndClear() );
}
......
......@@ -444,9 +444,7 @@ typelib_TypeDescriptionReference* mapCliType(System::Type^ cliType)
if (retVal == NULL)
{
OUStringBuffer buf( 128 );
buf.appendAscii(
RTL_CONSTASCII_STRINGPARAM("[cli_uno bridge] mapCliType():"
"could not map type: ") );
buf.append( "[cli_uno bridge] mapCliType():could not map type: " );
buf.append(mapCliString(cliType->FullName));
throw BridgeRuntimeError( buf.makeStringAndClear() );
}
......@@ -978,9 +976,9 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
default:
{
OUStringBuffer buf( 128 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("[map_to_uno():") );
buf.append( "[map_to_uno():" );
buf.append(value_td.getTypeName());
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("] unsupported value type of any!") );
buf.append( "] unsupported value type of any!" );
throw BridgeRuntimeError( buf.makeStringAndClear() );
}
}
......@@ -991,12 +989,11 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
if (assign)
uno_any_construct( pAny, 0, 0, 0 ); // restore some valid any
OUStringBuffer buf( 256 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("[map_to_uno():Any") );
buf.append( "[map_to_uno():Any" );
buf.append(value_td.getTypeName());
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("]The Any type "));
buf.append( "]The Any type ");
buf.append(value_td.getTypeName());
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(" does not correspont "
"to its value type: ") );
buf.append( " does not correspond to its value type: " );
if(aAny.Value != nullptr)
{
css::uno::Type td(mapCliType(aAny.Value->GetType()), SAL_NO_ACQUIRE);
......@@ -1093,7 +1090,7 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
else
{
OUStringBuffer buf(512);
buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("[map_to_uno(): Member: "));
buf.append("[map_to_uno(): Member: ");
buf.append(comp_td->ppMemberNames[nPos]);
throw BridgeRuntimeError(buf.makeStringAndClear());
}
......@@ -1191,13 +1188,13 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
{
bException= true;
OUStringBuffer buf(512);
buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("[map_to_uno():"));
buf.append("[map_to_uno():");
if (cliType)
{
buf.append(mapCliString(cliType->FullName));
buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("."));
buf.append(".");
buf.append(comp_td->ppMemberNames[nPos]);
buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(" "));
buf.append(" ");
}
buf.append(e.m_message);
throw BridgeRuntimeError(buf.makeStringAndClear());
......@@ -1206,14 +1203,14 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
{
bException= true;
OUStringBuffer buf( 256 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("[map_to_uno():") );
buf.append( "[map_to_uno():" );
if (cliType)
{
buf.append(mapCliString(cliType->FullName));
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("."));
buf.append( "." );
buf.append(comp_td->ppMemberNames[nPos]);
}
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("] Value has not the required type."));
buf.append( "] Value has not the required type." );
throw BridgeRuntimeError(buf.makeStringAndClear());
}
catch (...)
......@@ -1379,9 +1376,9 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
default:
{
OUStringBuffer buf( 128 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("[map_to_uno():") );
buf.append( "[map_to_uno():" );
buf.append( *reinterpret_cast< OUString const * >( &type->pTypeName ) );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("] unsupported sequence element type: ") );
buf.append( "] unsupported sequence element type: " );
buf.append( *reinterpret_cast< OUString const * >( &element_type->pTypeName ) );
throw BridgeRuntimeError( buf.makeStringAndClear() );
}
......@@ -1390,9 +1387,9 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
catch (BridgeRuntimeError& e)
{
OUStringBuffer buf( 128 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("[map_to_uno():") );
buf.append( "[map_to_uno():" );
buf.append( *reinterpret_cast< OUString const * >( &type->pTypeName ));
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("] conversion failed\n "));
buf.append( "] conversion failed\n ");
buf.append(e.m_message);
throw BridgeRuntimeError(buf.makeStringAndClear());
}
......@@ -1400,9 +1397,9 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
{
// Ok, checked
OUStringBuffer buf( 128 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("[map_to_uno():") );
buf.append( "[map_to_uno():" );
buf.append( *reinterpret_cast< OUString const * >( &type->pTypeName) );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("] could not convert sequence element type: ") );
buf.append( "] could not convert sequence element type: " );
buf.append( *reinterpret_cast< OUString const * >( &element_type->pTypeName ) );
throw BridgeRuntimeError( buf.makeStringAndClear() );
}
......@@ -1448,9 +1445,9 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
{
//ToDo check
OUStringBuffer buf( 128 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("[map_to_uno():") );
buf.append( "[map_to_uno():" );
buf.append( *reinterpret_cast< OUString const * >( &type->pTypeName ) );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("] unsupported type!") );
buf.append( "] unsupported type!" );
throw BridgeRuntimeError( buf.makeStringAndClear() );
}
}
......@@ -1460,16 +1457,15 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
{
//ToDo check
OUStringBuffer buf( 128 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("[map_to_uno():") );
buf.append( "[map_to_uno():" );
buf.append( *reinterpret_cast< OUString const * >( &type->pTypeName ) );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("] could not convert type!") );
buf.append( "] could not convert type!" );
throw BridgeRuntimeError( buf.makeStringAndClear() );
}
catch (System::NullReferenceException ^ e)
{
OUStringBuffer buf(512);
buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(
"[map_to_uno()] Illegal null reference passed!\n"));
buf.append( "[map_to_uno()] Illegal null reference passed!\n" );
buf.append(mapCliString(e->StackTrace));
throw BridgeRuntimeError( buf.makeStringAndClear() );
}
......@@ -1955,9 +1951,9 @@ void Bridge::map_to_cli(
default:
{
OUStringBuffer buf( 128 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("[map_to_cli():") );
buf.append( "[map_to_cli():" );
buf.append( *reinterpret_cast< OUString const * >( &type->pTypeName ) );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("] unsupported element type: ") );
buf.append( "] unsupported element type: " );
buf.append( *reinterpret_cast< OUString const * >( &element_type->pTypeName ) );
throw BridgeRuntimeError( buf.makeStringAndClear() );
}
......@@ -1981,9 +1977,9 @@ void Bridge::map_to_cli(
{
//ToDo check this exception. The String is probably crippled
OUStringBuffer buf( 128 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("[map_to_cli():") );
buf.append( "[map_to_cli():" );
buf.append( *reinterpret_cast< OUString const * >( &type->pTypeName ) );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("] unsupported type!") );
buf.append( "] unsupported type!" );
throw BridgeRuntimeError( buf.makeStringAndClear() );
}
} //switch
......
......@@ -80,8 +80,7 @@ UnoInterfaceInfo::UnoInterfaceInfo(Bridge const * bridge, uno_Interface* unoI,
if( ! bComplete)
{
OUStringBuffer buf( 128 );
buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(
"cannot make type complete: ") );
buf.append( "cannot make type complete: " );
buf.append( *reinterpret_cast< OUString const * >(
& m_typeDesc->aBase.pTypeName));
throw BridgeRuntimeError(buf.makeStringAndClear());
......@@ -198,11 +197,11 @@ void UnoInterfaceProxy::addUnoInterface(uno_Interface* pUnoI,
// add to the string that contains all interface names
_numInterfaces ++;
OUStringBuffer buf(512);
buf.appendAscii("\t");
buf.append("\t");
buf.append( OUString::valueOf((sal_Int32)_numInterfaces));
buf.appendAscii(". ");
buf.append(". ");
buf.append(mapCliString(sInterfaceName));
buf.appendAscii("\n");
buf.append("\n");
OUString _sNewInterface = buf.makeStringAndClear();
rtl_uString * __pin * pp_sInterfaces = & _sInterfaces;
rtl_uString_newConcat( pp_sInterfaces, * pp_sInterfaces,
......@@ -551,12 +550,10 @@ srrm::IMessage^ UnoInterfaceProxy::Invoke(srrm::IMessage^ callmsg)
// ToDo check if the message of the exception is not crippled
// the thing that should not be... no method info found!
OUStringBuffer buf( 64 );
buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(
"[cli_uno bridge]calling undeclared function on "
"interface ") );
buf.append( "[cli_uno bridge]calling undeclared function on interface " );
buf.append( *reinterpret_cast< OUString const * >(
& ((typelib_TypeDescription *)info->m_typeDesc)->pTypeName));
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(": ") );
buf.append( ": " );
buf.append( usMethodName );
throw BridgeRuntimeError( buf.makeStringAndClear() );
}
......@@ -762,11 +759,9 @@ void CliProxy::makeMethodInfos()
catch (System::InvalidCastException^ )
{
OUStringBuffer buf( 128 );
buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(
"[cli_uno bridge] preparing proxy for "
"cli interface: ") );
buf.append( "[cli_uno bridge] preparing proxy for cli interface: " );
buf.append(mapCliString(m_type->ToString() ));
buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(" \nfailed!"));
buf.append( " \nfailed!" );
throw BridgeRuntimeError( buf.makeStringAndClear() );
}
}
......@@ -840,9 +835,8 @@ sr::MethodInfo^ CliProxy::getMethodInfo(int nUnoFunctionPos,
if (indexCliMethod == -1)
{
OUStringBuffer buf(256);
buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(
"[cli_uno bridge] CliProxy::getMethodInfo():"
"cli object does not implement interface method: "));
buf.append( "[cli_uno bridge] CliProxy::getMethodInfo():"
"cli object does not implement interface method: " );
buf.append(usMethodName);
throw BridgeRuntimeError(buf.makeStringAndClear());
}
......
......@@ -230,9 +230,8 @@ void Bridge::call_cli(
catch (System::Exception^ e)
{
OUStringBuffer buf( 128 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(
"Unexspected exception during invocation of cli object. "
"Original message is: \n") );
buf.append( "Unexpected exception during invocation of cli object. "
"Original message is: \n" );
buf.append(mapCliString(e->Message));
throw BridgeRuntimeError( buf.makeStringAndClear() );
}
......
......@@ -116,11 +116,11 @@ void Array::checkRange( sal_Int32 index, sal_Int32 count )
if( index >= 1 && index -1 + count <= m_data.getLength() )
return;
OUStringBuffer buf;
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Array::getArrayAtIndex(): allowed range for index + count " ) );
buf.append( "Array::getArrayAtIndex(): allowed range for index + count " );
buf.append( m_data.getLength() );
buf.appendAscii( ", got " );
buf.append( ", got " );
buf.append( index );
buf.appendAscii( " + " );
buf.append( " + " );
buf.append( count );
throw SQLException( buf.makeStringAndClear() , *this, OUString(), 1, Any());
......
......@@ -1431,7 +1431,7 @@ static void columnMetaData2DatabaseTypeDescription(
Reference< XRow > row( rs, UNO_QUERY_THROW );
int domains = 0;
OUStringBuffer queryBuf(128);
queryBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "SELECT oid,typtype,typname FROM pg_TYPE WHERE " ) );
queryBuf.append( "SELECT oid,typtype,typname FROM pg_TYPE WHERE " );
while( rs->next() )
{
if( row->getString( 9 ) == "d" && oidMap.find( row->getInt( 12 ) ) == oidMap.end() )
......
......@@ -749,12 +749,12 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert(
if( nLastOid && lastTableInserted.getLength() )
{
OUStringBuffer buf( 128 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "SELECT * FROM " ) );
buf.append( "SELECT * FROM " );
if( schemaName.getLength() )
bufferQuoteQualifiedIdentifier(buf, schemaName, tableName, pConnectionSettings );
else
bufferQuoteIdentifier( buf, lastTableInserted, pConnectionSettings );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " WHERE oid = " ) );
buf.append( " WHERE oid = " );
buf.append( nLastOid , 10 );
query = buf.makeStringAndClear();
}
......@@ -786,9 +786,9 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert(
if( keyColumnNames.getLength() )
{
OUStringBuffer buf( 128 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "SELECT * FROM " ) );
buf.append( "SELECT * FROM " );
bufferQuoteQualifiedIdentifier(buf, schemaName, tableName, pConnectionSettings );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " WHERE " ) );
buf.append( " WHERE " );
bool additionalCondition = false;
String2StringMap autoValues;
for( int i = 0 ; i < keyColumnNames.getLength() ; i ++ )
......@@ -829,7 +829,7 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert(
{
// retrieve current sequence value:
OUStringBuffer myBuf(128 );
myBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "SELECT currval(" ) );
myBuf.append( "SELECT currval(" );
myBuf.appendAscii( &(j->second.getStr()[8]));
value = querySingleValue( connection, myBuf.makeStringAndClear() );
}
......@@ -846,9 +846,9 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert(
}
if( additionalCondition )
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " AND " ) );
buf.append( " AND " );
bufferQuoteIdentifier( buf, keyColumnNames[i], pConnectionSettings );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " = " ) );
buf.append( " = " );
buf.append( value );
additionalCondition = true;
}
......
......@@ -87,7 +87,7 @@ OUString concatQualified( const OUString & a, const OUString &b)
{
OUStringBuffer buf( a.getLength() + 2 + b.getLength() );
buf.append( a );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "." ) );
buf.append( "." );
buf.append( b );
return buf.makeStringAndClear();
}
......@@ -130,9 +130,9 @@ void bufferEscapeConstant( OUStringBuffer & buf, const OUString & value, Connect
static inline void ibufferQuoteConstant( OUStringBuffer & buf, const OUString & value, ConnectionSettings *settings )
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "'" ) );
buf.append( "'" );
bufferEscapeConstant( buf, value, settings );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "'" ) );
buf.append( "'" );
}
void bufferQuoteConstant( OUStringBuffer & buf, const OUString & value, ConnectionSettings *settings )
......@@ -149,7 +149,7 @@ void bufferQuoteAnyConstant( OUStringBuffer & buf, const Any &val, ConnectionSet
bufferQuoteConstant( buf, str, settings );
}
else
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "NULL" ) );
buf.append( "NULL" );
}
static inline void ibufferQuoteIdentifier( OUStringBuffer & buf, const OUString &toQuote, ConnectionSettings *settings )
......@@ -182,7 +182,7 @@ void bufferQuoteQualifiedIdentifier(
OUStringBuffer & buf, const OUString &schema, const OUString &table, ConnectionSettings *settings )
{
ibufferQuoteIdentifier(buf, schema, settings);
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "." ) );
buf.append( "." );
ibufferQuoteIdentifier(buf, table, settings);
}
......@@ -194,9 +194,9 @@ void bufferQuoteQualifiedIdentifier(
ConnectionSettings *settings)
{
ibufferQuoteIdentifier(buf, schema, settings);
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "." ) );
buf.append( "." );
ibufferQuoteIdentifier(buf, table, settings);
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "." ) );
buf.append( "." );
ibufferQuoteIdentifier(buf, col, settings);
}
......@@ -575,28 +575,28 @@ OUString array2String( const com::sun::star::uno::Sequence< Any > &seq )
{
OUStringBuffer buf(128);
int len = seq.getLength();
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "{" ) );
buf.append( "{" );
for( int i = 0 ; i < len ; i ++ )
{
OUString element;
seq[i] >>= element;
if( i > 0 )
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(",") );
buf.append( "," );
int strLength = element.getLength();
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\"") );
buf.append( "\"" );
for( int j = 0 ; j < strLength ; j ++ )
{
sal_Unicode c = element[j];
if( c == '\\' || c == '"' || c == '{' || c == '}' )
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\\" ) );
buf.append( "\\" );
}
buf.append( c );
}
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\"" ) );
buf.append( "\"" );
}
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "}" ) );
buf.append( "}" );
return buf.makeStringAndClear();
}
......@@ -932,19 +932,19 @@ OUString sqltype2string( const Reference< XPropertySet > & desc )
case com::sun::star::sdbc::DataType::VARCHAR:
case com::sun::star::sdbc::DataType::CHAR:
{
typeName.appendAscii( RTL_CONSTASCII_STRINGPARAM( "(" ) );
typeName.append( "(" );
typeName.append( precision );
typeName.appendAscii( RTL_CONSTASCII_STRINGPARAM( ")" ) );
typeName.append( ")" );
break;
}
case com::sun::star::sdbc::DataType::DECIMAL:
case com::sun::star::sdbc::DataType::NUMERIC:
{
typeName.appendAscii( RTL_CONSTASCII_STRINGPARAM( "(" ) );
typeName.append( "(" );
typeName.append( precision );
typeName.appendAscii( RTL_CONSTASCII_STRINGPARAM( "," ) );
typeName.append( "," );
typeName.append( extractIntProperty( desc, getStatics().SCALE ) );
typeName.appendAscii( RTL_CONSTASCII_STRINGPARAM( ")" ) );
typeName.append( ")" );
break;
}
default:
......@@ -961,23 +961,23 @@ static void keyType2String( OUStringBuffer & buf, sal_Int32 keyType )
{
if( com::sun::star::sdbc::KeyRule::CASCADE == keyType )
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "CASCADE " ) );
buf.append( "CASCADE " );
}
else if( com::sun::star::sdbc::KeyRule::RESTRICT == keyType )
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "RESTRICT " ) );
buf.append( "RESTRICT " );
}
else if( com::sun::star::sdbc::KeyRule::SET_DEFAULT == keyType )
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "SET DEFAULT " ) );
buf.append( "SET DEFAULT " );
}
else if( com::sun::star::sdbc::KeyRule::SET_NULL == keyType )
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "SET NULL " ) );
buf.append( "SET NULL " );
}
else //if( com::sun::star::sdbc::KeyRule::NO_ACTION == keyType )
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "NO ACTION " ) );
buf.append( "NO ACTION " );
}
}
......@@ -992,16 +992,16 @@ void bufferKey2TableConstraint(
bool foreign = false;
if( type == com::sun::star::sdbcx::KeyType::UNIQUE )
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "UNIQUE( " ) );
buf.append( "UNIQUE( " );
}
else if( type == com::sun::star::sdbcx::KeyType::PRIMARY )
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "PRIMARY KEY( " ) );
buf.append( "PRIMARY KEY( " );
}
else if( type == com::sun::star::sdbcx::KeyType::FOREIGN )
{
foreign = true;
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "FOREIGN KEY( " ) );
buf.append( "FOREIGN KEY( " );
}
Reference< XColumnsSupplier > columns( key, UNO_QUERY );
......@@ -1020,18 +1020,18 @@ void bufferKey2TableConstraint(
}
else
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( ", " ) );
buf.append( ", " );
}
Reference< XPropertySet > keyColumn( colEnum->nextElement(), UNO_QUERY_THROW );
bufferQuoteIdentifier(buf, extractStringProperty( keyColumn, st.NAME ), settings );
}
}
}
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( ") " ));
buf.append( ") " );
if( foreign )
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "REFERENCES " ) );
buf.append( "REFERENCES " );
OUString schema;
OUString tableName;
splitConcatenatedIdentifier( referencedTable, &schema, &tableName );
......@@ -1041,7 +1041,7 @@ void bufferKey2TableConstraint(
Reference< XEnumerationAccess > colEnumAccess( columns->getColumns(), UNO_QUERY);
if( colEnumAccess.is() )
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " (" ) );
buf.append( " (" );
Reference< XEnumeration > colEnum(colEnumAccess->createEnumeration());
bool first = true;
while(colEnum.is() && colEnum->hasMoreElements() )
......@@ -1052,19 +1052,19 @@ void bufferKey2TableConstraint(
}
else
{
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( ", " ) );
buf.append( ", " );
}
Reference< XPropertySet > keyColumn( colEnum->nextElement(), UNO_QUERY_THROW );
bufferQuoteIdentifier(
buf, extractStringProperty( keyColumn, st.RELATED_COLUMN ), settings );
}
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( ") " ) );
buf.append( ") " );
}
}
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "ON DELETE " ) );
buf.append( "ON DELETE " );
keyType2String( buf, deleteRule );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " ON UPDATE " ) );
buf.append( " ON UPDATE " );
keyType2String( buf, updateRule );
}
......
......@@ -189,14 +189,14 @@ OUString UpdateableResultSet::buildWhereClause()
if( m_primaryKey.getLength() )
{
OUStringBuffer buf( 128 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " WHERE " ) );
buf.append( " WHERE " );
for( int i = 0 ; i < m_primaryKey.getLength() ; i ++ )
{
if( i > 0 )
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " AND " ) );
buf.append( " AND " );
sal_Int32 index = findColumn( m_primaryKey[i] );
bufferQuoteIdentifier( buf, m_primaryKey[i], *m_ppSettings );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " = " ) );
buf.append( " = " );
bufferQuoteConstant( buf, getString( index ), *m_ppSettings );
}
ret = buf.makeStringAndClear();
......@@ -218,9 +218,9 @@ void UpdateableResultSet::insertRow( ) throw (SQLException, RuntimeException)
*this, OUString(), 1, Any() );
OUStringBuffer buf( 128 );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "INSERT INTO " ) );
buf.append( "INSERT INTO " );
bufferQuoteQualifiedIdentifier( buf, m_schema, m_table, *m_ppSettings );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " ( " ) );
buf.append( " ( " );
int columns = 0;
for( UpdateableFieldVector::size_type i = 0 ; i < m_updateableField.size() ; i++ )
......@@ -228,12 +228,12 @@ void UpdateableResultSet::insertRow( ) throw (SQLException, RuntimeException)
if( m_updateableField[i].isTouched )
{
if( columns > 0 )
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( ", " ) );
buf.append( ", " );
columns ++;
bufferQuoteIdentifier( buf, m_columnNames[i], *m_ppSettings);
}
}
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " ) VALUES ( " ) );
buf.append( " ) VALUES ( " );
columns = 0;
for( UpdateableFieldVector::size_type i = 0 ; i < m_updateableField.size() ; i ++ )
......@@ -241,7 +241,7 @@ void UpdateableResultSet::insertRow( ) throw (SQLException, RuntimeException)
if( m_updateableField[i].isTouched )
{
if( columns > 0 )
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " , " ) );
buf.append( " , " );
columns ++;
bufferQuoteAnyConstant( buf, m_updateableField[i].value, *m_ppSettings );
......@@ -252,7 +252,7 @@ void UpdateableResultSet::insertRow( ) throw (SQLException, RuntimeException)
}
}
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " )" ) );
buf.append( " )" );