diff options
author | Noel Grandin <noel@peralex.com> | 2013-11-19 17:06:06 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-20 10:07:32 +0200 |
commit | 52bbd9cc00b5a1e15e4f96b5c5fa5e75855692c1 (patch) | |
tree | 72d0d1d16806f1c785a4f79ea2c0cdfe54bb8101 /stoc/source/security | |
parent | 3af99e4d59d89c343965a928681a30f36b1007d2 (diff) |
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
Diffstat (limited to 'stoc/source/security')
-rw-r--r-- | stoc/source/security/access_controller.cxx | 14 | ||||
-rw-r--r-- | stoc/source/security/file_policy.cxx | 16 | ||||
-rw-r--r-- | stoc/source/security/permissions.cxx | 35 |
3 files changed, 30 insertions, 35 deletions
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx index 5f59ed156526..ee218a8e5eb8 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -562,14 +562,13 @@ static void dumpPermissions( OUStringBuffer buf( 48 ); if (!userId.isEmpty()) { - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("> dumping permissions of user \"") ); + buf.append( "> dumping permissions of user \"" ); buf.append( userId ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\":") ); + buf.append( "\":" ); } else { - buf.appendAscii( - RTL_CONSTASCII_STRINGPARAM("> dumping default permissions:") ); + buf.append( "> dumping default permissions:" ); } OString str( OUStringToOString( buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US ) ); OSL_TRACE( "%s", str.getStr() ); @@ -715,9 +714,9 @@ PermissionCollection AccessController::getEffectivePermissions( } #ifdef __DIAGNOSE OUStringBuffer buf( 48 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("> info: recurring call of user \"") ); + buf.append( "> info: recurring call of user \"" ); buf.append( userId ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"") ); + buf.append( "\"" ); OString str( OUStringToOString( buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US ) ); OSL_TRACE( "%s", str.getStr() ); @@ -807,8 +806,7 @@ PermissionCollection AccessController::getEffectivePermissions( { clearPostPoned(); // safety: exception could have happened before checking postponed? OUStringBuffer buf( 64 ); - buf.appendAscii( - RTL_CONSTASCII_STRINGPARAM("deployment error (AccessControlException occurred): ") ); + buf.append( "deployment error (AccessControlException occurred): " ); buf.append( exc.Message ); throw DeploymentException( buf.makeStringAndClear(), exc.Context ); } diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx index 46ba89f2b205..36bb86641757 100644 --- a/stoc/source/security/file_policy.cxx +++ b/stoc/source/security/file_policy.cxx @@ -207,9 +207,9 @@ void PolicyReader::assureToken( sal_Unicode token ) if (c == token) return; OUStringBuffer buf( 16 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("expected >") ); + buf.append( "expected >" ); buf.append( c ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("<!") ); + buf.append( "<!" ); error( buf.makeStringAndClear() ); } //__________________________________________________________________________________________________ @@ -368,13 +368,13 @@ void PolicyReader::error( OUString const & msg ) SAL_THROW( (RuntimeException) ) { OUStringBuffer buf( 32 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("error processing file \"") ); + buf.append( "error processing file \"" ); buf.append( m_fileName ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" [line ") ); + buf.append( "\" [line " ); buf.append( m_linepos ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(", column ") ); + buf.append( ", column " ); buf.append( m_pos ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("] ") ); + buf.append( "] " ); buf.append( msg ); throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() ); } @@ -390,9 +390,9 @@ PolicyReader::PolicyReader( OUString const & fileName, AccessControl & ac ) if (osl_File_E_None != ::osl_openFile( m_fileName.pData, &m_file, osl_File_OpenFlag_Read )) { OUStringBuffer buf( 32 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("cannot open file \"") ); + buf.append( "cannot open file \"" ); buf.append( m_fileName ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"!") ); + buf.append( "\"!" ); throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() ); } } diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx index 34bb834ef339..448db7ea9f75 100644 --- a/stoc/source/security/permissions.cxx +++ b/stoc/source/security/permissions.cxx @@ -70,7 +70,7 @@ static inline sal_Int32 makeMask( if (! strings[ nPos ]) { OUStringBuffer buf( 48 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("### ignoring unknown socket action: ") ); + buf.append( "### ignoring unknown socket action: " ); buf.append( item ); OString str( OUStringToOString( buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US ) ); @@ -243,8 +243,7 @@ OUString SocketPermission::toString() const SAL_THROW(()) { OUStringBuffer buf( 48 ); // host - buf.appendAscii( - RTL_CONSTASCII_STRINGPARAM("com.sun.star.connection.SocketPermission (host=\"") ); + buf.append( "com.sun.star.connection.SocketPermission (host=\"" ); buf.append( m_host ); if (m_resolvedHost) { @@ -266,9 +265,9 @@ OUString SocketPermission::toString() const SAL_THROW(()) } } // actions - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\", actions=\"") ); + buf.append( "\", actions=\"" ); buf.append( makeStrings( m_actions, s_actions ) ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\")") ); + buf.append( "\")" ); return buf.makeStringAndClear(); } @@ -327,14 +326,14 @@ FilePermission::FilePermission( { OUStringBuffer buf( 64 ); buf.append( getWorkingDir() ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("/*") ); + buf.append( "/*" ); m_url = buf.makeStringAndClear(); } else if ( m_url == "-" ) { OUStringBuffer buf( 64 ); buf.append( getWorkingDir() ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("/-") ); + buf.append( "/-" ); m_url = buf.makeStringAndClear(); } else if (!m_url.startsWith("file:///")) @@ -420,12 +419,12 @@ OUString FilePermission::toString() const SAL_THROW(()) { OUStringBuffer buf( 48 ); // url - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("com.sun.star.io.FilePermission (url=\"") ); + buf.append( "com.sun.star.io.FilePermission (url=\"" ); buf.append( m_url ); // actions - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\", actions=\"") ); + buf.append( "\", actions=\"" ); buf.append( makeStrings( m_actions, s_actions ) ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\")") ); + buf.append( "\")" ); return buf.makeStringAndClear(); } @@ -462,10 +461,9 @@ bool RuntimePermission::implies( Permission const & perm ) const SAL_THROW(()) OUString RuntimePermission::toString() const SAL_THROW(()) { OUStringBuffer buf( 48 ); - buf.appendAscii( - RTL_CONSTASCII_STRINGPARAM("com.sun.star.security.RuntimePermission (name=\"") ); + buf.append( "com.sun.star.security.RuntimePermission (name=\"" ); buf.append( m_name ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\")") ); + buf.append( "\")" ); return buf.makeStringAndClear(); } @@ -519,8 +517,7 @@ PermissionCollection::PermissionCollection( else { OUStringBuffer buf( 48 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( - "checking for unsupported permission type: ") ); + buf.append( "checking for unsupported permission type: " ); buf.append( perm_type.getTypeName() ); throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() ); @@ -560,9 +557,9 @@ static void demanded_diag( SAL_THROW(()) { OUStringBuffer buf( 48 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("demanding ") ); + buf.append( "demanding " ); buf.append( perm.toString() ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(" => ok.") ); + buf.append( " => ok." ); OString str( OUStringToOString( buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US ) ); OSL_TRACE( "%s", str.getStr() ); @@ -574,7 +571,7 @@ static void throwAccessControlException( SAL_THROW( (security::AccessControlException) ) { OUStringBuffer buf( 48 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("access denied: ") ); + buf.append( "access denied: " ); buf.append( perm.toString() ); throw security::AccessControlException( buf.makeStringAndClear(), Reference< XInterface >(), demanded_perm ); @@ -642,7 +639,7 @@ void PermissionCollection::checkPermission( Any const & perm ) const else { OUStringBuffer buf( 48 ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("checking for unsupported permission type: ") ); + buf.append( "checking for unsupported permission type: " ); buf.append( demanded_type.getTypeName() ); throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface >() ); |