Kaydet (Commit) de0c09bb authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

targeted string re-work

Change-Id: I6eb2242506ef2d230770e513579caf4455ec37d5
üst e6adc90c
......@@ -43,11 +43,11 @@ using ::rtl::OUString;
namespace syssh = SystemShell;
const OUString SXW_MIME_TYPE(RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.xml.writer"));
const OUString SXC_MIME_TYPE(RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.xml.calc"));
const OUString SXI_MIME_TYPE(RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.xml.impress"));
const OUString SXD_MIME_TYPE(RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.xml.draw"));
const OUString SXM_MIME_TYPE(RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.xml.math"));
const OUString SXW_MIME_TYPE("application/vnd.sun.xml.writer");
const OUString SXC_MIME_TYPE("application/vnd.sun.xml.calc");
const OUString SXI_MIME_TYPE("application/vnd.sun.xml.impress");
const OUString SXD_MIME_TYPE("application/vnd.sun.xml.draw");
const OUString SXM_MIME_TYPE("application/vnd.sun.xml.math");
class Test_AddToRecentDocs : public CppUnit::TestFixture
{
......@@ -63,19 +63,19 @@ public:
system("rm $HOME/.recently-used");
system("echo '<?xml version=\"1.0\"?>\n<RecentFiles>\n<RecentItem>\n<URI>file:///home/federico/gedit.txt</URI>\n<Mime-Type>text/plain</Mime-Type>\n<Timestamp>1046485966</Timestamp>\n<Groups>\n<Group>gedit</Group>\n</Groups>\n</RecentItem>\n</RecentFiles>' > $HOME/.recently-used");
rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxw"));
rtl::OUString url("file:///home_athene/test.sxw");
syssh::AddToRecentDocumentList(url, SXW_MIME_TYPE);
url = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxc"));
url = rtl::OUString("file:///home_athene/test.sxc");
syssh::AddToRecentDocumentList(url, SXC_MIME_TYPE);
url = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxi"));
url = rtl::OUString("file:///home_athene/test.sxi");
syssh::AddToRecentDocumentList(url, SXI_MIME_TYPE);
url = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxd"));
url = rtl::OUString("file:///home_athene/test.sxd");
syssh::AddToRecentDocumentList(url, SXD_MIME_TYPE);
url = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxm"));
url = rtl::OUString("file:///home_athene/test.sxm");
syssh::AddToRecentDocumentList(url, SXM_MIME_TYPE);
}
......@@ -85,7 +85,7 @@ public:
system("rm $HOME/.recently-used");
system("echo '<?xml version=\"1.0\"?>\n<RecentFiles>\n<RecentItem>\n<URI>file:///home/federico/gedit.txt</URI>\n<Mime-Type>text/plain</Mime-Type>\n<Timestamp>1046485966</Timestamp>\n<Groups>\n<Group>gedit</Group>\n</Groups>\n<RecentItem>\n<URI>file:///home/federico/gedit2.txt</URI>\n<Mime-Type>text/plain</Mime-Type>\n<Timestamp>1046485966</Timestamp>\n<Groups>\n<Group>gedit</Group>\n</Groups>\n</RecentItem>\n</RecentFiles>' > $HOME/.recently-used");
rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxw"));
rtl::OUString url("file:///home_athene/test.sxw");
syssh::AddToRecentDocumentList(url, SXW_MIME_TYPE);
}
......@@ -94,19 +94,19 @@ public:
{
int ret = system("rm $HOME/.recently-used");
rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxw"));
rtl::OUString url("file:///home_athene/test.sxw");
syssh::AddToRecentDocumentList(url, SXW_MIME_TYPE);
url = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxc"));
url = rtl::OUString("file:///home_athene/test.sxc");
syssh::AddToRecentDocumentList(url, SXC_MIME_TYPE);
url = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxi"));
url = rtl::OUString("file:///home_athene/test.sxi");
syssh::AddToRecentDocumentList(url, SXI_MIME_TYPE);
url = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxd"));
url = rtl::OUString("file:///home_athene/test.sxd");
syssh::AddToRecentDocumentList(url, SXD_MIME_TYPE);
url = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxm"));
url = rtl::OUString("file:///home_athene/test.sxm");
syssh::AddToRecentDocumentList(url, SXM_MIME_TYPE);
ret = system("ls $HOME/.recently-used");
......@@ -124,9 +124,9 @@ public:
if ((recently_used_url.getLength() > 0) &&
('/' != recently_used_url.pData->buffer[recently_used_url.getLength() - 1]))
recently_used_url += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
recently_used_url += rtl::OUString("/");
recently_used_url += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".recently-used"));
recently_used_url += rtl::OUString(".recently-used");
return recently_used_url;
}
......@@ -156,7 +156,7 @@ public:
memset(cnt_before, 0, sizeof(cnt_before));
read_recently_used(cnt_before, sizeof(cnt_before));
OUString url(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxw"));
OUString url("file:///home_athene/test.sxw");
syssh::AddToRecentDocumentList(url, SXW_MIME_TYPE);
char cnt_after[128];
......@@ -175,7 +175,7 @@ public:
sprintf(cmd, "echo '%s' > $HOME/.recently-used", xml_unknown);
system(cmd);
OUString url(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxw"));
OUString url("file:///home_athene/test.sxw");
syssh::AddToRecentDocumentList(url, SXW_MIME_TYPE);
char buffer[256];
......@@ -191,7 +191,7 @@ public:
system("rm $HOME/.recently-used");
system("touch $HOME/.recently-used");
OUString url(RTL_CONSTASCII_USTRINGPARAM("file:///home_athene/test.sxw"));
OUString url("file:///home_athene/test.sxw");
syssh::AddToRecentDocumentList(url, SXW_MIME_TYPE);
char buffer[256];
......
......@@ -119,7 +119,7 @@ static OUString xdg_user_dir_lookup (const char *type)
if (!aSecurity.getHomeDir( aHomeDirURL ) )
{
osl::FileBase::getFileURLFromSystemPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/tmp")), aDocumentsDirURL);
osl::FileBase::getFileURLFromSystemPath(rtl::OUString("/tmp"), aDocumentsDirURL);
return aDocumentsDirURL;
}
......@@ -127,12 +127,12 @@ static OUString xdg_user_dir_lookup (const char *type)
if (config_home == NULL || config_home[0] == 0)
{
aConfigFileURL = OUString(aHomeDirURL);
aConfigFileURL += OUString(RTL_CONSTASCII_USTRINGPARAM("/.config/user-dirs.dirs"));
aConfigFileURL += OUString("/.config/user-dirs.dirs");
}
else
{
aConfigFileURL = OUString::createFromAscii(config_home);
aConfigFileURL += OUString(RTL_CONSTASCII_USTRINGPARAM("/user-dirs.dirs"));
aConfigFileURL += OUString("/user-dirs.dirs");
}
if(osl_File_E_None == osl_openFile(aConfigFileURL.pData, &handle, osl_File_OpenFlag_Read))
......@@ -433,7 +433,7 @@ sal_Bool SAL_CALL isDependencySatisfied( GConfClient* pClient, const Configurati
g_get_real_name(), osl_getThreadTextEncoding() ) );
if( aCompleteName != "Unknown" )
{
if( aCompleteName.trim().indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")), 0) != -1 )
if( aCompleteName.trim().indexOf(rtl::OUString(" "), 0) != -1 )
return sal_True;
}
}
......
......@@ -183,7 +183,7 @@ static rtl::OUString ImplGetLocale(int category)
// Return "en-US" for C locales
if( (locale == NULL) || ( locale[0] == 'C' && locale[1] == '\0' ) )
return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "en-US" ) );
return rtl::OUString( "en-US" );
const char *cp;
......@@ -284,7 +284,7 @@ void LocaleBackend::setPropertyValue(
{
throw css::lang::IllegalArgumentException(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
"setPropertyValue not supported"),
static_cast< cppu::OWeakObject * >(this), -1);
}
......@@ -319,7 +319,7 @@ css::uno::Any LocaleBackend::getPropertyValue(
//------------------------------------------------------------------------------
rtl::OUString SAL_CALL LocaleBackend::getBackendName(void) {
return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.LocaleBackend")) ;
return rtl::OUString("com.sun.star.comp.configuration.backend.LocaleBackend") ;
}
//------------------------------------------------------------------------------
......@@ -335,7 +335,7 @@ rtl::OUString SAL_CALL LocaleBackend::getImplementationName(void)
uno::Sequence<rtl::OUString> SAL_CALL LocaleBackend::getBackendServiceNames(void)
{
uno::Sequence<rtl::OUString> aServiceNameList(1);
aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.LocaleBackend")) ;
aServiceNameList[0] = rtl::OUString( "com.sun.star.configuration.backend.LocaleBackend") ;
return aServiceNameList ;
}
......
......@@ -217,7 +217,7 @@ void MacOSXBackend::setPropertyValue(
{
throw css::lang::IllegalArgumentException(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
"setPropertyValue not supported"),
static_cast< cppu::OWeakObject * >(this), -1);
}
......@@ -417,7 +417,7 @@ css::uno::Any MacOSXBackend::getPropertyValue(
CFStringRef rException = (CFStringRef) CFArrayGetValueAtIndex(rExceptionsList, idx);
if (idx>0)
aProxyBypassList += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(";"));
aProxyBypassList += rtl::OUString(";");
aProxyBypassList += CFStringToOUString(rException);
}
......@@ -445,7 +445,7 @@ css::uno::Any MacOSXBackend::getPropertyValue(
rtl::OUString SAL_CALL MacOSXBackend::getBackendName(void)
{
return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.MacOSXBackend"));
return rtl::OUString("com.sun.star.comp.configuration.backend.MacOSXBackend");
}
//------------------------------------------------------------------------------
......@@ -461,7 +461,7 @@ rtl::OUString SAL_CALL MacOSXBackend::getImplementationName(void)
uno::Sequence<rtl::OUString> SAL_CALL MacOSXBackend::getBackendServiceNames(void)
{
uno::Sequence<rtl::OUString> aServiceNameList(1);
aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.MacOSXBackend"));
aServiceNameList[0] = rtl::OUString( "com.sun.star.configuration.backend.MacOSXBackend");
return aServiceNameList;
}
......
......@@ -211,12 +211,12 @@ WinInetBackend::WinInetBackend()
ProxyEntry aTypeIndepProxy = FindProxyEntry( aProxyList, rtl::OUString());
ProxyEntry aHttpProxy = FindProxyEntry( aProxyList, rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( "http" ) ) );
"http" ) );
ProxyEntry aHttpsProxy = FindProxyEntry( aProxyList, rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( "https" ) ) );
"https" ) );
ProxyEntry aFtpProxy = FindProxyEntry( aProxyList, rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( "ftp" ) ) );
"ftp" ) );
if( aTypeIndepProxy.Server.getLength() )
{
......@@ -307,7 +307,7 @@ void WinInetBackend::setPropertyValue(
{
throw css::lang::IllegalArgumentException(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
"setPropertyValue not supported"),
static_cast< cppu::OWeakObject * >(this), -1);
}
......@@ -350,7 +350,7 @@ css::uno::Any WinInetBackend::getPropertyValue(
//------------------------------------------------------------------------------
rtl::OUString SAL_CALL WinInetBackend::getBackendName(void) {
return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.WinInetBackend")) ;
return rtl::OUString("com.sun.star.comp.configuration.backend.WinInetBackend") ;
}
//------------------------------------------------------------------------------
......@@ -366,7 +366,7 @@ rtl::OUString SAL_CALL WinInetBackend::getImplementationName(void)
uno::Sequence<rtl::OUString> SAL_CALL WinInetBackend::getBackendServiceNames(void)
{
uno::Sequence<rtl::OUString> aServiceNameList(1);
aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.WinInetBackend")) ;
aServiceNameList[0] = rtl::OUString( "com.sun.star.configuration.backend.WinInetBackend") ;
return aServiceNameList ;
}
......
......@@ -185,7 +185,7 @@ Any SAL_CALL CmdMailMsg::getByName( const OUString& aName )
else if( 0 == aName.compareToAscii( "attachment" ) && m_Attachments.getLength() )
return makeAny( m_Attachments );
throw NoSuchElementException( OUString(RTL_CONSTASCII_USTRINGPARAM("key not found: ")) + aName,
throw NoSuchElementException( OUString("key not found: ") + aName,
static_cast < XNameAccess * > (this) );
}
......@@ -200,22 +200,22 @@ Sequence< OUString > SAL_CALL CmdMailMsg::getElementNames( )
Sequence< OUString > aRet( 6 );
if( !m_aOriginator.isEmpty() )
aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM("from"));
aRet[nItems++] = OUString("from");
if( !m_aRecipient.isEmpty() )
aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM("to"));
aRet[nItems++] = OUString("to");
if( m_CcRecipients.getLength() )
aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM("cc"));
aRet[nItems++] = OUString("cc");
if( m_BccRecipients.getLength() )
aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM("bcc"));
aRet[nItems++] = OUString("bcc");
if( !m_aSubject.isEmpty() )
aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM("subject"));
aRet[nItems++] = OUString("subject");
if( m_Attachments.getLength() )
aRet[nItems++] = OUString(RTL_CONSTASCII_USTRINGPARAM("attachment"));
aRet[nItems++] = OUString("attachment");
aRet.realloc( nItems );
return aRet;
......
......@@ -82,7 +82,7 @@ namespace // private
Sequence< OUString > SAL_CALL ShellExec_getSupportedServiceNames()
{
Sequence< OUString > aRet(1);
aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sys.shell.SystemShellExecute"));
aRet[0] = OUString("com.sun.star.sys.shell.SystemShellExecute");
return aRet;
}
}
......@@ -113,7 +113,7 @@ ShellExec::ShellExec( const Reference< XComponentContext >& xContext ) :
if (xCurrentContext.is())
{
Any aValue = xCurrentContext->getValueByName(
OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) );
OUString( "system.desktop-environment" ) );
OUString aDesktopEnvironment;
if (aValue >>= aDesktopEnvironment)
......@@ -150,9 +150,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
if ( aURL.isEmpty() && !aCommand.isEmpty() )
{
throw RuntimeException(
(OUString(
RTL_CONSTASCII_USTRINGPARAM(
"Cannot translate URI reference to external format: "))
(OUString( "Cannot translate URI reference to external format: ")
+ aCommand),
static_cast< cppu::OWeakObject * >(this));
}
......@@ -187,29 +185,25 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
com::sun::star::uno::Reference< com::sun::star::util::XMacroExpander >
exp;
if (!(m_xContext->getValueByName(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"/singletons/com.sun.star.util.theMacroExpander")))
rtl::OUString( "/singletons/com.sun.star.util.theMacroExpander"))
>>= exp)
|| !exp.is())
{
throw SystemShellExecuteException(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"component context fails to supply singleton"
" com.sun.star.util.theMacroExpander of type"
" com.sun.star.util.XMacroExpander")),
" com.sun.star.util.XMacroExpander"),
static_cast< XSystemShellExecute * >(this), ENOENT);
}
OUString aProgramURL;
try {
aProgramURL = exp->expandMacros(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program/")));
rtl::OUString( "$BRAND_BASE_DIR/program/"));
} catch (com::sun::star::lang::IllegalArgumentException &)
{
throw SystemShellExecuteException(
OUString(RTL_CONSTASCII_USTRINGPARAM("Could not expand $BRAND_BASE_DIR path")),
OUString("Could not expand $BRAND_BASE_DIR path"),
static_cast < XSystemShellExecute * > (this), ENOENT );
}
......@@ -217,7 +211,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
if ( FileBase::E_None != FileBase::getSystemPathFromFileURL(aProgramURL, aProgram))
{
throw SystemShellExecuteException(
OUString(RTL_CONSTASCII_USTRINGPARAM("Cound not convert executable path")),
OUString("Cound not convert executable path"),
static_cast < XSystemShellExecute * > (this), ENOENT );
}
......@@ -262,9 +256,8 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
{
throw css::lang::IllegalArgumentException(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"XSystemShellExecute.execute URIS_ONLY with non-absolute"
" URI reference "))
" URI reference ")
+ aCommand),
static_cast< cppu::OWeakObject * >(this), 0);
} else {
......@@ -312,7 +305,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
OUString SAL_CALL ShellExec::getImplementationName( )
throw( RuntimeException )
{
return OUString(RTL_CONSTASCII_USTRINGPARAM( SHELLEXEC_IMPL_NAME ));
return OUString(SHELLEXEC_IMPL_NAME );
}
// -------------------------------------------------
......
......@@ -42,8 +42,8 @@
#include <unistd.h>
const rtl::OUString RECENTLY_USED_FILE_NAME(RTL_CONSTASCII_USTRINGPARAM(".recently-used"));
const rtl::OUString SLASH(RTL_CONSTASCII_USTRINGPARAM("/"));
const rtl::OUString RECENTLY_USED_FILE_NAME(".recently-used");
const rtl::OUString SLASH("/");
namespace /* private */ {
......
......@@ -85,7 +85,7 @@ namespace // private
Sequence< OUString > SAL_CALL SysShExec_getSupportedServiceNames()
{
Sequence< OUString > aRet(1);
aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sys.shell.SystemShellExecute"));
aRet[0] = OUString("com.sun.star.sys.shell.SystemShellExecute");
return aRet;
}
......@@ -202,8 +202,8 @@ namespace // private
// trying to identify a jump mark
//-----------------------------------------
const OUString JUMP_MARK_HTM(RTL_CONSTASCII_USTRINGPARAM(".htm#"));
const OUString JUMP_MARK_HTML(RTL_CONSTASCII_USTRINGPARAM(".html#"));
const OUString JUMP_MARK_HTM(".htm#");
const OUString JUMP_MARK_HTML(".html#");
const sal_Unicode HASH_MARK = (sal_Unicode)'#';
bool has_jump_mark(const OUString& system_path, sal_Int32* jmp_mark_start = NULL)
......@@ -284,13 +284,13 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
// parameter checking
if (0 == aCommand.getLength())
throw IllegalArgumentException(
OUString(RTL_CONSTASCII_USTRINGPARAM("Empty command")),
OUString("Empty command"),
static_cast< XSystemShellExecute* >( this ),
1 );
if ((nFlags & ~(NO_SYSTEM_ERROR_MESSAGE | URIS_ONLY)) != 0)
throw IllegalArgumentException(
OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid Flags specified")),
OUString("Invalid Flags specified"),
static_cast< XSystemShellExecute* >( this ),
3 );
......@@ -302,9 +302,8 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
{
throw css::lang::IllegalArgumentException(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"XSystemShellExecute.execute URIS_ONLY with"
" non-absolute URI reference "))
" non-absolute URI reference ")
+ aCommand),
static_cast< cppu::OWeakObject * >(this), 0);
}
......@@ -356,7 +355,7 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
psxErr = MapError(psxErr);
throw SystemShellExecuteException(
OUString(RTL_CONSTASCII_USTRINGPARAM("Error executing command")),
OUString("Error executing command"),
static_cast< XSystemShellExecute* >(this),
psxErr);
}
......@@ -369,7 +368,7 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
OUString SAL_CALL CSysShExec::getImplementationName( )
throw( RuntimeException )
{
return OUString(RTL_CONSTASCII_USTRINGPARAM( SYSSHEXEC_IMPL_NAME ));
return OUString(SYSSHEXEC_IMPL_NAME );
}
// -------------------------------------------------
......
......@@ -79,7 +79,7 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplN
if ( 0 == rtl_str_compare( pImplName, SYSSHEXEC_IMPL_NAME ) )
{
Sequence< OUString > aSNS( 1 );
aSNS.getArray( )[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( SYSSHEXEC_SERVICE_NAME ));
aSNS.getArray( )[0] = OUString(SYSSHEXEC_SERVICE_NAME );
Reference< XSingleComponentFactory > xFactory ( createSingleComponentFactory(
createInstance,
......
......@@ -60,14 +60,14 @@ using css::system::SimpleMailClientFlags::NO_LOGON_DIALOG;
typedef std::vector<rtl::OUString> StringList_t;
const rtl::OUString TO(RTL_CONSTASCII_USTRINGPARAM("--to"));
const rtl::OUString CC(RTL_CONSTASCII_USTRINGPARAM("--cc"));
const rtl::OUString BCC(RTL_CONSTASCII_USTRINGPARAM("--bcc"));
const rtl::OUString FROM(RTL_CONSTASCII_USTRINGPARAM("--from"));
const rtl::OUString SUBJECT(RTL_CONSTASCII_USTRINGPARAM("--subject"));
const rtl::OUString ATTACH(RTL_CONSTASCII_USTRINGPARAM("--attach"));
const rtl::OUString FLAG_MAPI_DIALOG(RTL_CONSTASCII_USTRINGPARAM("--mapi-dialog"));
const rtl::OUString FLAG_MAPI_LOGON_UI(RTL_CONSTASCII_USTRINGPARAM("--mapi-logon-ui"));
const rtl::OUString TO("--to");
const rtl::OUString CC("--cc");
const rtl::OUString BCC("--bcc");
const rtl::OUString FROM("--from");
const rtl::OUString SUBJECT("--subject");
const rtl::OUString ATTACH("--attach");
const rtl::OUString FLAG_MAPI_DIALOG("--mapi-dialog");
const rtl::OUString FLAG_MAPI_LOGON_UI("--mapi-logon-ui");
namespace /* private */
{
......@@ -106,9 +106,7 @@ namespace /* private */
if (senddocUrl.getLength() == 0)
{
senddocUrl = rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"$BRAND_BASE_DIR/program/senddoc.exe"));
senddocUrl = rtl::OUString( "$BRAND_BASE_DIR/program/senddoc.exe");
rtl::Bootstrap::expandMacros(senddocUrl); //TODO: detect failure
}
return senddocUrl;
......@@ -228,7 +226,7 @@ void CSmplMailClient::assembleCommandLine(
osl::FileBase::RC err = osl::FileBase::getSystemPathFromFileURL(attachments[i], sysPath);
if (err != osl::FileBase::E_None)
throw IllegalArgumentException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid attachment file URL")),
rtl::OUString("Invalid attachment file URL"),
static_cast<XSimpleMailClient*>(this),
1);
......@@ -254,7 +252,7 @@ void SAL_CALL CSmplMailClient::sendSimpleMailMessage(
if (!executeSenddoc(senddocParams))
throw Exception(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Send email failed")),
rtl::OUString("Send email failed"),
static_cast<XSimpleMailClient*>(this));
}
......@@ -263,7 +261,7 @@ void CSmplMailClient::validateParameter(
{
if (!xSimpleMailMessage.is())
throw IllegalArgumentException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Empty mail message reference")),
rtl::OUString("Empty mail message reference"),
static_cast<XSimpleMailClient*>(this),
1);
......@@ -272,14 +270,14 @@ void CSmplMailClient::validateParameter(
// check the flags, the allowed range is 0 - (2^n - 1)
if (aFlag < 0 || aFlag > 3)
throw IllegalArgumentException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid flag value")),
rtl::OUString("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(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No recipient specified")),
rtl::OUString("No recipient specified"),
static_cast<XSimpleMailClient*>(this),
1);
}
......
......@@ -79,7 +79,7 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplN
if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, COMP_IMPL_NAME ) ) )
{
Sequence< OUString > aSNS( 1 );
aSNS.getArray( )[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( COMP_SERVICE_NAME ));
aSNS.getArray( )[0] = OUString(COMP_SERVICE_NAME );
Reference< XSingleServiceFactory > xFactory ( createOneInstanceFactory(
reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
......
......@@ -48,7 +48,7 @@ namespace // private
Sequence< OUString > SAL_CALL Component_getSupportedServiceNames()
{
Sequence< OUString > aRet(1);
aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sys.shell.SimpleSystemMail"));
aRet[0] = OUString("com.sun.star.sys.shell.SimpleSystemMail");
return aRet;
}
......@@ -83,7 +83,7 @@ Reference<XSimpleMailClient> SAL_CALL CSmplMailSuppl::querySimpleMailClient()
OUString SAL_CALL CSmplMailSuppl::getImplementationName()
throw(RuntimeException)
{
return OUString(RTL_CONSTASCII_USTRINGPARAM(COMP_IMPL_NAME));
return OUString(COMP_IMPL_NAME);
}
sal_Bool SAL_CALL CSmplMailSuppl::supportsService(const OUString& ServiceName)
......
......@@ -93,7 +93,7 @@ int SAL_CALL main(int, char*, char* )
//-------------------------------------------------
// Get global factory for uno services.
OUString rdbName = OUString( RTL_CONSTASCII_USTRINGPARAM( RDB_SYSPATH ) );
OUString rdbName = OUString( RDB_SYSPATH );
Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) );
// Print a message if an error occurred.
......@@ -112,7 +112,7 @@ int SAL_CALL main(int, char*, char* )
try
{
Reference< XProxySettings > xProxySettings(
g_xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SystemProxySettings")) ), UNO_QUERY );
g_xFactory->createInstance( OUString("com.sun.star.system.SystemProxySettings") ), UNO_QUERY );
if ( !xProxySettings.is() )
{
......@@ -139,7 +139,7 @@ int SAL_CALL main(int, char*, char* )
printf( "Test of SystemProxySettings successful\n" );
xProxySettings = Reference< XProxySettings >(
g_xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SOProxySettings")) ), UNO_QUERY );
g_xFactory->createInstance( OUString("com.sun.star.system.SOProxySettings") ), UNO_QUERY );
if ( !xProxySettings.is() )
{
......
......@@ -88,7 +88,7 @@ int SAL_CALL main(int , char*, char* )
//-------------------------------------------------
// Get global factory for uno services.
OUString rdbName = OUString( RTL_CONSTASCII_USTRINGPARAM( RDB_SYSPATH ) );
OUString rdbName = OUString( RDB_SYSPATH );
Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) );
// Print a message if an error occurred.
......@@ -107,7 +107,7 @@ int SAL_CALL main(int , char*, char* )
try
{
Reference< XSimpleMailClientSupplier > xSmplMailClientSuppl(
g_xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SimpleSystemMail")) ), UNO_QUERY );
g_xFactory->createInstance( OUString("com.sun.star.system.SimpleSystemMail") ), UNO_QUERY );
if ( !xSmplMailClientSuppl.is() )
{
......@@ -125,30 +125,30 @@ int SAL_CALL main(int , char*, char* )
if ( xSmplMailMsg.is( ) )
{
xSmplMailMsg->setRecipient( OUString(RTL_CONSTASCII_USTRINGPARAM("tino.rachui@germany.sun.com")) );
xSmplMailMsg->setOriginator( OUString(RTL_CONSTASCII_USTRINGPARAM("tino.rachui@germany.sun.com")) );
xSmplMailMsg->setRecipient( OUString("tino.rachui@germany.sun.com") );
xSmplMailMsg->setOriginator( OUString("tino.rachui@germany.sun.com") );
Sequence< OUString > ccRecips( 1 );
ccRecips[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("tino.rachui@germany.sun.com"));
ccRecips[0] = OUString("tino.rachui@germany.sun.com");
xSmplMailMsg->setCcRecipient( ccRecips );
Sequence< OUString > bccRecips( 1 );
bccRecips[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("tino.rachui@germany.sun.com"));
bccRecips[0] = OUString("tino.rachui@germany.sun.com");
xSmplMailMsg->setBccRecipient( bccRecips );
xSmplMailMsg->setSubject( OUString(RTL_CONSTASCII_USTRINGPARAM("Mapi Test")) );
xSmplMailMsg->setSubject( OUString("Mapi Test") );
Sequence< OUString > attachements( 2 );
OUString aFile(RTL_CONSTASCII_USTRINGPARAM("D:\\Projects\\gsl\\shell\\wntmsci7\\bin\\testprx.exe"));
OUString aFile("D:\\Projects\\gsl\\shell\\wntmsci7\\bin\\testprx.exe");
OUString aFileURL;
osl::FileBase::getFileURLFromSystemPath( aFile, aFileURL );
attachements[0] = aFileURL;
aFile = OUString(RTL_CONSTASCII_USTRINGPARAM("D:\\Projects\\gsl\\shell\\wntmsci7\\bin\\testsyssh.exe"));
aFile = OUString("D:\\Projects\\gsl\\shell\\wntmsci7\\bin\\testsyssh.exe");
osl::FileBase::getFileURLFromSystemPath( aFile, aFileURL );
attachements[1] = aFile;
......
......@@ -98,7 +98,7 @@ int SAL_CALL main(int nArgc, char* Argv[], char* )
return 0;
// Get global factory for uno services.
OUString rdbName = OUString( RTL_CONSTASCII_USTRINGPARAM( RDB_SYSPATH ) );
OUString rdbName = OUString( RDB_SYSPATH );
Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) );
// Print a message if an error occurred.
......@@ -115,7 +115,7 @@ int SAL_CALL main(int nArgc, char* Argv[], char* )
//-------------------------------------------------
Reference< XSystemShellExecute > xSysShExec(
g_xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.system.SystemShellExecute")) ), UNO_QUERY );
g_xFactory->createInstance( OUString("com.sun.star.system.SystemShellExecute") ), UNO_QUERY );
if ( !xSysShExec.is() )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment