Kaydet (Commit) f9f9fa1e authored tarafından Chr. Rossmanith's avatar Chr. Rossmanith

RTL_CONSTASCII_(U)STRINGPARAM removed in desktop

Change-Id: I23bd979aa39a8062f65f66e701cfd8ca3a18da8c
üst ffaf6adb
......@@ -32,7 +32,6 @@
#include "com/sun/star/awt/XWindow.hpp"
#include "dp_misc_api.hxx"
#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
#define ARLEN(x) (sizeof (x) / sizeof *(x))
namespace dp_misc {
......
......@@ -1308,7 +1308,7 @@ sal_Bool ExtensionManager::synchronize(
sSynchronizingShared.SearchAndReplaceAllAscii( "%NAME", OUString("shared"));
dp_misc::ProgressLevel progressShared(xCmdEnv, sSynchronizingShared);
sal_Bool bModified = getSharedRepository()->synchronize(xAbortChannel, xCmdEnv);
progressShared.update(OUSTR("\n\n"));
progressShared.update("\n\n");
String sSynchronizingBundled(StrSyncRepository::get());
sSynchronizingBundled.SearchAndReplaceAllAscii( "%NAME", OUString("bundled"));
......
......@@ -196,23 +196,23 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
::std::vector<OUString> cmdPackages;
OptionInfo const * info_shared = getOptionInfo(
s_option_infos, OUSTR("shared") );
s_option_infos, "shared" );
OptionInfo const * info_force = getOptionInfo(
s_option_infos, OUSTR("force") );
s_option_infos, "force" );
OptionInfo const * info_verbose = getOptionInfo(
s_option_infos, OUSTR("verbose") );
s_option_infos, "verbose" );
OptionInfo const * info_log = getOptionInfo(
s_option_infos, OUSTR("log-file") );
s_option_infos, "log-file" );
OptionInfo const * info_context = getOptionInfo(
s_option_infos, OUSTR("deployment-context") );
s_option_infos, "deployment-context" );
OptionInfo const * info_help = getOptionInfo(
s_option_infos, OUSTR("help") );
s_option_infos, "help" );
OptionInfo const * info_version = getOptionInfo(
s_option_infos, OUSTR("version") );
s_option_infos, "version" );
OptionInfo const * info_bundled = getOptionInfo(
s_option_infos, OUSTR("bundled") );
s_option_infos, "bundled" );
OptionInfo const * info_suppressLicense = getOptionInfo(
s_option_infos, OUSTR("suppress-license") );
s_option_infos, "suppress-license" );
Reference<XComponentContext> xComponentContext;
......@@ -267,12 +267,12 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
{
// is option:
dp_misc::writeConsoleError(
OUSTR("\nERROR: unexpected option ") +
"\nERROR: unexpected option " +
cmdArg +
OUSTR("!\n") +
OUSTR(" Use " APP_NAME " ") +
"!\n" +
" Use " + APP_NAME + " " +
toString(info_help) +
OUSTR(" to print all options.\n"));
" to print all options.\n");
return 1;
}
else
......@@ -291,11 +291,11 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
if (repository.isEmpty())
{
if (option_shared)
repository = OUSTR("shared");
repository = "shared";
else if (option_bundled)
repository = OUSTR("bundled");
repository = "bundled";
else
repository = OUSTR("user");
repository = "user";
}
else
{
......@@ -304,31 +304,29 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
}
else if (option_shared) {
dp_misc::writeConsoleError(
OUSTR("WARNING: explicit context given! ") +
OUSTR("Ignoring option ") +
toString( info_shared ) +
OUSTR("!\n") );
OUString("WARNING: explicit context given! ") +
"Ignoring option " + toString( info_shared ) + "!\n" );
}
}
if (subCommand.equals(OUSTR("reinstall")))
if (subCommand == "reinstall")
{
//We must prevent that services and types are loaded by UNO,
//otherwise we cannot delete the registry data folder.
OUString extensionUnorc;
if (repository.equals(OUSTR("user")))
extensionUnorc = OUSTR("$UNO_USER_PACKAGES_CACHE/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc");
else if (repository.equals(OUSTR("shared")))
extensionUnorc = OUSTR("$SHARED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc");
else if (repository.equals(OUSTR("bundled")))
extensionUnorc = OUSTR("$BUNDLED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc");
if (repository == "user")
extensionUnorc = "$UNO_USER_PACKAGES_CACHE/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc";
else if (repository == "shared")
extensionUnorc = "$SHARED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc";
else if (repository == "bundled")
extensionUnorc = "$BUNDLED_EXTENSIONS_USER/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc";
else
OSL_ASSERT(0);
::rtl::Bootstrap::expandMacros(extensionUnorc);
oslFileError e = osl_removeFile(extensionUnorc.pData);
if (e != osl_File_E_None && e != osl_File_E_NOENT)
throw Exception(OUSTR("Could not delete ") + extensionUnorc, 0);
throw Exception("Could not delete " + extensionUnorc, 0);
}
xComponentContext = getUNO(
......@@ -345,7 +343,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
//Do not synchronize when command is "reinstall". This could add types and services to UNO and
//prevent the deletion of the registry data folder
//synching is done in XExtensionManager.reinstall
if (!subcmd_gui && ! subCommand.equals(OUSTR("reinstall"))
if (!subcmd_gui && ! (subCommand == "reinstall")
&& ! dp_misc::office_is_running())
dp_misc::syncRepositories(false, xCmdEnv);
......@@ -357,8 +355,8 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
if (subcmd_add)
{
beans::NamedValue nvSuppress(
OUSTR("SUPPRESS_LICENSE"), option_suppressLicense ?
makeAny(OUSTR("1")):makeAny(OUSTR("0")));
OUString("SUPPRESS_LICENSE"), option_suppressLicense ?
makeAny(OUString("1")):makeAny(OUString("0")));
xExtensionManager->addExtension(
cmdPackage, Sequence<beans::NamedValue>(&nvSuppress, 1),
repository, Reference<task::XAbortChannel>(), xCmdEnv);
......@@ -387,8 +385,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
}
}
}
else if (subCommand.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("reinstall") ))
else if ( subCommand == "reinstall" )
{
xExtensionManager->reinstallDeployedExtensions(
false, repository, Reference<task::XAbortChannel>(), xCmdEnv);
......@@ -431,7 +428,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
vec_packages.size(), false);
dp_misc::writeConsole(
OUSTR("All deployed ") + repository + OUSTR(" extensions:\n\n"));
OUString("All deployed ") + repository + " extensions:\n\n");
}
else
{
......@@ -474,7 +471,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
else
throw lang::IllegalArgumentException(
OUSTR("There is no such extension deployed: ") +
"There is no such extension deployed: " +
cmdPackages[pos],0,-1);
}
......@@ -540,24 +537,22 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
else
{
dp_misc::writeConsoleError(
OUSTR("\nERROR: unknown sub-command ") +
subCommand +
OUSTR("!\n") +
OUSTR(" Use " APP_NAME " ") +
toString(info_help) +
OUSTR(" to print all options.\n"));
"\nERROR: unknown sub-command " +
subCommand + "!\n" +
" Use " + APP_NAME + " " +
toString(info_help) + " to print all options.\n");
return 1;
}
if (option_verbose)
dp_misc::writeConsole(OUSTR("\n" APP_NAME " done.\n"));
dp_misc::writeConsole(OUString("\n") + APP_NAME + " done.\n");
//Force to release all bridges which connect us to the child processes
dp_misc::disposeBridges(xLocalComponentContext);
return 0;
}
catch (const ucb::CommandFailedException &e)
{
dp_misc::writeConsoleError(e.Message + OUSTR("\n"));
dp_misc::writeConsoleError(e.Message + "\n");
bNoOtherErrorMsg = true;
}
catch (const ucb::CommandAbortedException &)
......@@ -578,11 +573,9 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
cause = e.Message;
}
dp_misc::writeConsoleError(
OUSTR("\nERROR: ") + exc.Message + OUSTR("\n"));
dp_misc::writeConsoleError("\nERROR: " + exc.Message + "\n");
if (!cause.isEmpty())
dp_misc::writeConsoleError(
OUSTR(" Cause: ") + cause + OUSTR("\n"));
dp_misc::writeConsoleError(" Cause: " + cause + "\n");
}
catch (const LockFileException & e)
{
......@@ -593,11 +586,9 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
catch (const ::com::sun::star::uno::Exception & e ) {
Any exc( ::cppu::getCaughtException() );
dp_misc::writeConsoleError(
OUSTR("\nERROR: ") +
OUString(option_verbose ? e.Message + OUSTR("\nException details: \n") +
::comphelper::anyToString(exc) : e.Message) +
OUSTR("\n"));
dp_misc::writeConsoleError("\nERROR: " +
OUString(option_verbose ? e.Message + "\nException details: \n" +
::comphelper::anyToString(exc) : e.Message) + "\n");
}
if (!bNoOtherErrorMsg)
dp_misc::writeConsoleError("\n" APP_NAME " failed.\n");
......
......@@ -114,7 +114,7 @@ CommandEnvironmentImpl::CommandEnvironmentImpl(
m_xLogFile.set(
xComponentContext->getServiceManager()
->createInstanceWithArgumentsAndContext(
OUSTR("com.sun.star.comp.deployment.ProgressLog"),
"com.sun.star.comp.deployment.ProgressLog",
Sequence<Any>( &logfile, 1 ), xComponentContext ),
UNO_QUERY_THROW );
}
......@@ -151,7 +151,7 @@ void CommandEnvironmentImpl::printLicense(
OUString sNO = String(ResId(RID_STR_UNOPKG_ACCEPT_LIC_NO, *pResMgr));
OUString sN = String(ResId(RID_STR_UNOPKG_ACCEPT_LIC_N, *pResMgr));
OUString sNewLine(RTL_CONSTASCII_USTRINGPARAM("\n"));
OUString sNewLine("\n");
dp_misc::writeConsole(sNewLine + sNewLine + s1 + sNewLine + sNewLine);
dp_misc::writeConsole(sLicense + sNewLine + sNewLine);
......@@ -211,8 +211,8 @@ void CommandEnvironmentImpl::handle(
{
Any request( xRequest->getRequest() );
OSL_ASSERT( request.getValueTypeClass() == TypeClass_EXCEPTION );
dp_misc::TRACE(OUSTR("[unopkg_cmdenv.cxx] incoming request:\n")
+ ::comphelper::anyToString(request) + OUSTR("\n\n"));
dp_misc::TRACE("[unopkg_cmdenv.cxx] incoming request:\n"
+ ::comphelper::anyToString(request) + "\n\n");
// selections:
bool approve = false;
......@@ -238,10 +238,8 @@ void CommandEnvironmentImpl::handle(
OSL_ASSERT( xPackageType.is() );
if (xPackageType.is()) {
approve = (xPackage->isBundle() &&
xPackageType->getMediaType().matchAsciiL(
RTL_CONSTASCII_STRINGPARAM(
"application/"
"vnd.sun.star.legacy-package-bundle") ));
xPackageType->getMediaType().match(
"application/vnd.sun.star.legacy-package-bundle") );
}
}
abort = !approve;
......@@ -275,7 +273,7 @@ void CommandEnvironmentImpl::handle(
{
String sMsg(ResId(RID_STR_UNSUPPORTED_PLATFORM, *dp_gui::DeploymentGuiResMgr::get()));
sMsg.SearchAndReplaceAllAscii("%Name", platExc.package->getDisplayName());
dp_misc::writeConsole(OUSTR("\n") + sMsg + OUSTR("\n\n"));
dp_misc::writeConsole(OUString("\n") + sMsg + "\n\n");
approve = true;
}
else {
......@@ -295,8 +293,7 @@ void CommandEnvironmentImpl::handle(
if (abort && m_option_verbose && !bLicenseException)
{
OUString msg = ::comphelper::anyToString(request);
dp_misc::writeConsoleError(
OUSTR("\nERROR: ") + msg + OUSTR("\n"));
dp_misc::writeConsoleError(OUString("\nERROR: ") + msg + "\n");
}
// select:
......@@ -352,11 +349,11 @@ void CommandEnvironmentImpl::update_( Any const & Status )
}
else {
::rtl::OUStringBuffer buf;
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("WARNING: ") );
buf.appendAscii( "WARNING: " );
deployment::DeploymentException dp_exc;
if (Status >>= dp_exc) {
buf.append( dp_exc.Message );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(", Cause: ") );
buf.appendAscii( ", Cause: " );
buf.append( ::comphelper::anyToString(dp_exc.Cause) );
}
else {
......@@ -375,9 +372,9 @@ void CommandEnvironmentImpl::update_( Any const & Status )
}
if (bUseErr)
dp_misc::writeConsoleError(msg + OUSTR("\n"));
dp_misc::writeConsoleError(msg + OUString("\n"));
else
dp_misc::writeConsole(msg + OUSTR("\n"));
dp_misc::writeConsole(msg + OUString("\n"));
}
//______________________________________________________________________________
......
......@@ -334,11 +334,7 @@ IMPL_LINK( SplashScreen, AppEventListenerHdl, VclWindowEvent *, inEvent )
// Read keys from edition/edition.ini or soffice{.ini|rc}:
OUString implReadBootstrapKey( const OUString& _rKey )
{
OUString sValue(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"${.override:${BRAND_BASE_DIR}/program/edition/edition.ini:")) +
_rKey + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("}")));
OUString sValue("${.override:${BRAND_BASE_DIR}/program/edition/edition.ini:" + _rKey + "}");
rtl::Bootstrap::expandMacros(sValue);
return sValue;
}
......@@ -347,27 +343,19 @@ void SplashScreen::loadConfig()
{
_bShowLogo = implReadBootstrapKey( "Logo" ) != "0";
OUString sProgressFrameColor = implReadBootstrapKey(
OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressFrameColor" ) ) );
OUString sProgressBarColor = implReadBootstrapKey(
OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressBarColor" ) ) );
OUString sProgressTextColor = implReadBootstrapKey(
OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressTextColor" ) ) );
OUString sProgressTextBaseline = implReadBootstrapKey(
OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressTextBaseline" ) ) );
OUString sSize = implReadBootstrapKey(
OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressSize" ) ) );
OUString sPosition = implReadBootstrapKey(
OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressPosition" ) ) );
OUString sFullScreenSplash = implReadBootstrapKey(
OUString( RTL_CONSTASCII_USTRINGPARAM( "FullScreenSplash" ) ) );
OUString sNativeProgress = implReadBootstrapKey(
OUString( RTL_CONSTASCII_USTRINGPARAM( "NativeProgress" ) ) );
OUString sProgressFrameColor = implReadBootstrapKey( "ProgressFrameColor" );
OUString sProgressBarColor = implReadBootstrapKey( "ProgressBarColor" );
OUString sProgressTextColor = implReadBootstrapKey( "ProgressTextColor" );
OUString sProgressTextBaseline = implReadBootstrapKey( "ProgressTextBaseline" );
OUString sSize = implReadBootstrapKey( "ProgressSize" );
OUString sPosition = implReadBootstrapKey( "ProgressPosition" );
OUString sFullScreenSplash = implReadBootstrapKey( "FullScreenSplash" );
OUString sNativeProgress = implReadBootstrapKey( "NativeProgress" );
// Determine full screen splash mode
_bFullScreenSplash = (( !sFullScreenSplash.isEmpty() ) &&
( !sFullScreenSplash.equalsAsciiL( "0", 1 )));
( !sFullScreenSplash.equals( "0" )));
// Try to retrieve the relative values for the progress bar. The current
// schema uses the screen ratio to retrieve the associated values.
......
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