Removed RTL_CONSTASCII_(U)STRINGPARAM in unotest

Change-Id: Iba14ed093bcb97ac1f6996e62e6191cf09574bfd
This commit is contained in:
Chr. Rossmanith 2013-03-12 14:44:42 +01:00
parent 32ac07a929
commit 413fe6c65a
7 changed files with 30 additions and 51 deletions

View File

@ -103,9 +103,9 @@ void FiltersTest::recursiveScan(filterStatus nExpected,
continue;
if (
(sURL.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("BID"), nLastSlash+1)) ||
(sURL.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("CVE"), nLastSlash+1)) ||
(sURL.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("EDB"), nLastSlash+1))
(sURL.match("BID", nLastSlash+1)) ||
(sURL.match("CVE", nLastSlash+1)) ||
(sURL.match("EDB", nLastSlash+1))
)
{
bEncrypted = true;

View File

@ -33,7 +33,7 @@ namespace detail {
bool getArgument(rtl::OUString const & name, rtl::OUString * value) {
OSL_ASSERT(value != 0);
return rtl::Bootstrap::get(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("arg-")) + name, *value);
rtl::OUString("arg-") + name, *value);
}
}

View File

@ -29,7 +29,7 @@ namespace test {
bool getTestArgument(rtl::OUString const & name, rtl::OUString * value) {
return detail::getArgument(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("testarg.")) + name, value);
rtl::OUString("testarg.") + name, value);
}
}

View File

@ -57,7 +57,7 @@ uno::Reference< com::sun::star::lang::XComponent > MacrosTest::loadFromDesktop(c
args[1].State = com::sun::star::beans::PropertyState_DIRECT_VALUE;
}
uno::Reference< com::sun::star::lang::XComponent> xComponent= xLoader->loadComponentFromURL(rURL, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_default")), 0, args);
uno::Reference< com::sun::star::lang::XComponent> xComponent= xLoader->loadComponentFromURL(rURL, rtl::OUString("_default"), 0, args);
rtl::OUString sMessage = rtl::OUString( "loading failed: " ) + rURL;
CPPUNIT_ASSERT_MESSAGE(rtl::OUStringToOString( sMessage, RTL_TEXTENCODING_UTF8 ).getStr( ), xComponent.is());
return xComponent;

View File

@ -50,45 +50,34 @@ void OfficeConnection::setUp() {
rtl::OUString argSoffice;
CPPUNIT_ASSERT(
detail::getArgument(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("soffice")),
rtl::OUString("soffice"),
&argSoffice));
if (argSoffice.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("path:"))) {
desc = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("pipe,name=")) +
uniquePipeName(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("oootest")));
rtl::OUString noquickArg(
RTL_CONSTASCII_USTRINGPARAM("--quickstart=no"));
rtl::OUString nofirstArg(
RTL_CONSTASCII_USTRINGPARAM("--nofirststartwizard"));
rtl::OUString norestoreArg(RTL_CONSTASCII_USTRINGPARAM("--norestore"));
rtl::OUString nologoArg(RTL_CONSTASCII_USTRINGPARAM("--nologo"));
if (argSoffice.match("path:")) {
desc = "pipe,name=" + uniquePipeName(rtl::OUString("oootest"));
rtl::OUString noquickArg("--quickstart=no");
rtl::OUString nofirstArg("--nofirststartwizard");
rtl::OUString norestoreArg("--norestore");
rtl::OUString nologoArg("--nologo");
// disable use of the unix standalone splash screen app for the
// tests (probably not needed in combination with --headless?)
rtl::OUString headlessArg(RTL_CONSTASCII_USTRINGPARAM("--headless"));
rtl::OUString acceptArg(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("--accept=")) + desc +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(";urp")));
rtl::OUString headlessArg("--headless");
rtl::OUString acceptArg("--accept=" + desc + ";urp");
rtl::OUString argUser;
CPPUNIT_ASSERT(
detail::getArgument(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")), &argUser));
detail::getArgument(rtl::OUString("user"), &argUser));
rtl::OUString userArg(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("-env:UserInstallation=")) +
rtl::OUString("-env:UserInstallation=") +
toAbsoluteFileUrl(argUser));
rtl::OUString jreArg(
RTL_CONSTASCII_USTRINGPARAM("-env:UNO_JAVA_JFW_ENV_JREHOME=true"));
rtl::OUString classpathArg(
RTL_CONSTASCII_USTRINGPARAM(
"-env:UNO_JAVA_JFW_ENV_CLASSPATH=true"));
"-env:UNO_JAVA_JFW_ENV_JREHOME=true");
rtl::OUString classpathArg("-env:UNO_JAVA_JFW_ENV_CLASSPATH=true");
rtl_uString * args[] = {
noquickArg.pData, nofirstArg.pData, norestoreArg.pData,
nologoArg.pData, headlessArg.pData, acceptArg.pData, userArg.pData,
jreArg.pData, classpathArg.pData };
rtl_uString ** envs = 0;
rtl::OUString argEnv;
if (detail::getArgument(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("env")), &argEnv))
if (detail::getArgument(rtl::OUString("env"), &argEnv))
{
envs = &argEnv.pData;
}
@ -99,7 +88,7 @@ void OfficeConnection::setUp() {
argSoffice.copy(RTL_CONSTASCII_LENGTH("path:"))).pData,
args, SAL_N_ELEMENTS(args), 0, 0, 0, envs, envs == 0 ? 0 : 1,
&process_));
} else if (argSoffice.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("connect:"))) {
} else if (argSoffice.match("connect:")) {
desc = argSoffice.copy(RTL_CONSTASCII_LENGTH("connect:"));
} else {
CPPUNIT_FAIL(
@ -111,11 +100,9 @@ void OfficeConnection::setUp() {
context_ =
css::uno::Reference< css::uno::XComponentContext >(
resolver->resolve(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:")) +
rtl::OUString("uno:") +
desc +
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
";urp;StarOffice.ComponentContext"))),
rtl::OUString(";urp;StarOffice.ComponentContext")),
css::uno::UNO_QUERY_THROW);
break;
} catch (css::connection::NoConnectException &) {}

View File

@ -34,9 +34,7 @@ rtl::OUString toAbsoluteFileUrl(rtl::OUString const & relativePathname) {
oslProcessError e1 = osl_getProcessWorkingDir(&cwd.pData);
if (e1 != osl_Process_E_None) {
throw css::uno::RuntimeException(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"osl_getProcessWorkingDir failed with ")) +
(rtl::OUString("osl_getProcessWorkingDir failed with ") +
OUString::number(e1)),
css::uno::Reference< css::uno::XInterface >());
}
@ -45,11 +43,9 @@ rtl::OUString toAbsoluteFileUrl(rtl::OUString const & relativePathname) {
relativePathname, url);
if (e2 != osl::FileBase::E_None) {
throw css::uno::RuntimeException(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"osl::FileBase::getFileURLFromSystemPath(")) +
(rtl::OUString("osl::FileBase::getFileURLFromSystemPath(") +
relativePathname +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(") failed with ")) +
rtl::OUString(") failed with ") +
OUString::number(e2)),
css::uno::Reference< css::uno::XInterface >());
}
@ -57,11 +53,9 @@ rtl::OUString toAbsoluteFileUrl(rtl::OUString const & relativePathname) {
e2 = osl::FileBase::getAbsoluteFileURL(cwd, url, absUrl);
if (e2 != osl::FileBase::E_None) {
throw css::uno::RuntimeException(
(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"osl::FileBase::getAbsoluteFileURL(")) +
cwd + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(", ")) + url +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(") failed with ")) +
(rtl::OUString("osl::FileBase::getAbsoluteFileURL(") +
cwd + rtl::OUString(", ") + url +
rtl::OUString(") failed with ") +
OUString::number(e2)),
css::uno::Reference< css::uno::XInterface >());
}

View File

@ -68,9 +68,7 @@ bool Prot::protect(
context,
CppUnit::Message(
convert(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"An uncaught exception of type "))
rtl::OUString("An uncaught exception of type ")
+ a.getValueTypeName()),
convert(e.Message)));
}