summaryrefslogtreecommitdiff
path: root/stoc/source/security/file_policy.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-30 11:22:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-01 10:23:58 +0000
commitbbd34216dca07bb37b9188147c42e64bbf875d54 (patch)
tree72e5b3db79e7857983c77b58637ff2c519c5c7e6 /stoc/source/security/file_policy.cxx
parent2562ad74d1945322e9fdf8af5fc0b1f17e854c9b (diff)
improve exception messages in stoc
Change-Id: I43716332ab916e5ec7b8ab7a4d14895d060a9bd4 Reviewed-on: https://gerrit.libreoffice.org/33692 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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 + "\"!" );
}
}