diff options
author | Noel Grandin <noel@peralex.com> | 2014-05-28 12:50:02 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-05-29 09:01:40 +0200 |
commit | ebc0a15515c2e29259a7e229cfbdfb5d26fc3006 (patch) | |
tree | 2ce9446ed312a1a7aed53183b19ecc9fefabea8a /shell | |
parent | f0ae48b684e89acd7088c31a8feff5fc03d51105 (diff) |
remove more unnecesary OUString constructor use
when throwing exceptions
Change-Id: I6edfb6b6745499f802b0e3c0e096a36fb7c32aac
Diffstat (limited to 'shell')
-rw-r--r-- | shell/source/unix/exec/shellexec.cxx | 15 | ||||
-rw-r--r-- | shell/source/win32/SysShExec.cxx | 13 | ||||
-rw-r--r-- | shell/source/win32/simplemail/smplmailclient.cxx | 10 |
3 files changed, 18 insertions, 20 deletions
diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx index 6ecad95e6c81..c56e45b02c46 100644 --- a/shell/source/unix/exec/shellexec.cxx +++ b/shell/source/unix/exec/shellexec.cxx @@ -134,8 +134,8 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar if ( aURL.isEmpty() && !aCommand.isEmpty() ) { throw RuntimeException( - (OUString( "Cannot translate URI reference to external format: ") - + aCommand), + OUString("Cannot translate URI reference to external format: ") + + aCommand, static_cast< cppu::OWeakObject * >(this)); } @@ -175,7 +175,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar } catch (com::sun::star::lang::IllegalArgumentException &) { throw SystemShellExecuteException( - OUString("Could not expand $BRAND_BASE_DIR path"), + "Could not expand $BRAND_BASE_DIR path", static_cast < XSystemShellExecute * > (this), ENOENT ); } @@ -183,7 +183,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar if ( FileBase::E_None != FileBase::getSystemPathFromFileURL(aProgramURL, aProgram)) { throw SystemShellExecuteException( - OUString("Cound not convert executable path"), + "Cound not convert executable path", static_cast < XSystemShellExecute * > (this), ENOENT ); } @@ -224,10 +224,9 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar } else if ((nFlags & css::system::SystemShellExecuteFlags::URIS_ONLY) != 0) { throw css::lang::IllegalArgumentException( - (OUString( - "XSystemShellExecute.execute URIS_ONLY with non-absolute" - " URI reference ") - + aCommand), + OUString("XSystemShellExecute.execute URIS_ONLY with non-absolute" + " URI reference ") + + aCommand, static_cast< cppu::OWeakObject * >(this), 0); } else { escapeForShell(aBuffer, OUStringToOString(aCommand, osl_getThreadTextEncoding())); diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index efeb6cc7147f..e152495d5907 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -265,13 +265,13 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa // parameter checking if (0 == aCommand.getLength()) throw IllegalArgumentException( - OUString("Empty command"), + "Empty command", static_cast< XSystemShellExecute* >( this ), 1 ); if ((nFlags & ~(NO_SYSTEM_ERROR_MESSAGE | URIS_ONLY)) != 0) throw IllegalArgumentException( - OUString("Invalid Flags specified"), + "Invalid Flags specified", static_cast< XSystemShellExecute* >( this ), 3 ); @@ -282,10 +282,9 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa if (!(uri.is() && uri->isAbsolute())) { throw css::lang::IllegalArgumentException( - (OUString( - "XSystemShellExecute.execute URIS_ONLY with" - " non-absolute URI reference ") - + aCommand), + OUString("XSystemShellExecute.execute URIS_ONLY with" + " non-absolute URI reference ") + + aCommand, static_cast< cppu::OWeakObject * >(this), 0); } } @@ -336,7 +335,7 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa psxErr = MapError(psxErr); throw SystemShellExecuteException( - OUString("Error executing command"), + "Error executing command", static_cast< XSystemShellExecute* >(this), psxErr); } diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx index 574223d8e87c..d7504c5b6bee 100644 --- a/shell/source/win32/simplemail/smplmailclient.cxx +++ b/shell/source/win32/simplemail/smplmailclient.cxx @@ -234,7 +234,7 @@ void CSmplMailClient::assembleCommandLine( osl::FileBase::RC err = osl::FileBase::getSystemPathFromFileURL(attachments[i], sysPath); if (err != osl::FileBase::E_None) throw IllegalArgumentException( - OUString("Invalid attachment file URL"), + "Invalid attachment file URL", static_cast<XSimpleMailClient*>(this), 1); @@ -260,7 +260,7 @@ void SAL_CALL CSmplMailClient::sendSimpleMailMessage( if (!executeSenddoc(senddocParams)) throw Exception( - OUString("Send email failed"), + "Send email failed", static_cast<XSimpleMailClient*>(this)); } @@ -269,7 +269,7 @@ void CSmplMailClient::validateParameter( { if (!xSimpleMailMessage.is()) throw IllegalArgumentException( - OUString("Empty mail message reference"), + "Empty mail message reference", static_cast<XSimpleMailClient*>(this), 1); @@ -278,14 +278,14 @@ void CSmplMailClient::validateParameter( // check the flags, the allowed range is 0 - (2^n - 1) if (aFlag < 0 || aFlag > 3) throw IllegalArgumentException( - OUString("Invalid flag value"), + "Invalid flag value", static_cast<XSimpleMailClient*>(this), 2); // check if a recipient is specified of the flags NO_USER_INTERFACE is specified if ((aFlag & NO_USER_INTERFACE) && !xSimpleMailMessage->getRecipient().getLength()) throw IllegalArgumentException( - OUString("No recipient specified"), + "No recipient specified", static_cast<XSimpleMailClient*>(this), 1); } |