summaryrefslogtreecommitdiff
path: root/stoc/source/security/file_policy.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'stoc/source/security/file_policy.cxx')
-rw-r--r--stoc/source/security/file_policy.cxx21
1 files changed, 6 insertions, 15 deletions
diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx
index 6fada62ca405..8a388fedc2e4 100644
--- a/stoc/source/security/file_policy.cxx
+++ b/stoc/source/security/file_policy.cxx
@@ -328,16 +328,11 @@ sal_Unicode PolicyReader::get()
void PolicyReader::error( OUString const & msg )
{
- OUStringBuffer buf( 32 );
- buf.append( "error processing file \"" );
- buf.append( m_fileName );
- buf.append( "\" [line " );
- buf.append( m_linepos );
- buf.append( ", column " );
- buf.append( m_pos );
- buf.append( "] " );
- buf.append( msg );
- throw RuntimeException( buf.makeStringAndClear() );
+ throw RuntimeException(
+ "error processing file \"" + m_fileName +
+ "\" [line " + OUString::number(m_linepos) +
+ ", column " + OUString::number(m_pos) +
+ "] " + msg);
}
PolicyReader::PolicyReader( OUString const & fileName, AccessControl & ac )
@@ -349,11 +344,7 @@ PolicyReader::PolicyReader( OUString const & fileName, AccessControl & ac )
ac.checkFilePermission( m_fileName, "read" );
if (osl_File_E_None != ::osl_openFile( m_fileName.pData, &m_file, osl_File_OpenFlag_Read ))
{
- OUStringBuffer buf( 32 );
- buf.append( "cannot open file \"" );
- buf.append( m_fileName );
- buf.append( "\"!" );
- throw RuntimeException( buf.makeStringAndClear() );
+ throw RuntimeException( "cannot open file \"" + m_fileName + "\"!" );
}
}