Kaydet (Commit) 3472541a authored tarafından Marcos Paulo de Souza's avatar Marcos Paulo de Souza Kaydeden (comit) Luboš Luňák

Remove RTL_* from uui

Change-Id: I411133e81a9b548aaef2333c705c1376f45304d7
Signed-off-by: 's avatarMarcos Paulo de Souza <marcos.souza.org@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/1294Reviewed-by: 's avatarLuboš Luňák <l.lunak@suse.cz>
Tested-by: 's avatarLuboš Luňák <l.lunak@suse.cz>
üst e6ba54ce
......@@ -125,8 +125,7 @@ executeLoginDialog(
}
catch (std::bad_alloc const &)
{
throw uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
throw uno::RuntimeException(OUString("out of memory"),
uno::Reference< uno::XInterface >());
}
}
......@@ -439,8 +438,7 @@ executeMasterPasswordDialog(
}
catch (std::bad_alloc const &)
{
throw uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
throw uno::RuntimeException(OUString("out of memory"),
uno::Reference< uno::XInterface >());
}
......@@ -560,8 +558,7 @@ executePasswordDialog(
}
catch (std::bad_alloc const &)
{
throw uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
throw uno::RuntimeException(OUString("out of memory"),
uno::Reference< uno::XInterface>());
}
}
......
......@@ -51,9 +51,9 @@ executeErrorDialog(
{
SolarMutexGuard aGuard;
rtl::OUStringBuffer aText(rContext);
OUStringBuffer aText(rContext);
if (!rContext.isEmpty() && !rMessage.isEmpty())
aText.appendAscii(RTL_CONSTASCII_STRINGPARAM(":\n"));
aText.appendAscii(":\n");
//TODO! must be internationalized
aText.append(rMessage);
......@@ -99,8 +99,7 @@ executeErrorDialog(
}
catch (std::bad_alloc const &)
{
throw uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
throw uno::RuntimeException(OUString("out of memory"),
uno::Reference< uno::XInterface >());
}
......
......@@ -80,20 +80,13 @@ getResourceNameRequestArgument(uno::Sequence< uno::Any > const & rArguments,
rtl::OUString * pValue)
SAL_THROW(())
{
if (!getStringRequestArgument(rArguments,
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"Uri")),
pValue))
if (!getStringRequestArgument(rArguments, "Uri", pValue))
return false;
// Use the resource name only for file URLs, to avoid confusion:
//TODO! work with ucp locality concept instead of hardcoded "file"?
if (pValue
&& pValue->matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(
"file:")))
getStringRequestArgument(rArguments,
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"ResourceName")),
pValue);
&& pValue->matchIgnoreAsciiCaseAsciiL("file:", pValue->getLength()))
getStringRequestArgument(rArguments, "ResourceName", pValue);
return true;
}
......@@ -194,14 +187,10 @@ UUIInteractionHelper::handleInteractiveIOException(
{
case ucb::IOErrorCode_CANT_CREATE:
{
rtl::OUString aArgFolder;
if (getStringRequestArgument(
aRequestArguments,
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"Folder")),
&aArgFolder))
OUString aArgFolder;
if (getStringRequestArgument(aRequestArguments, "Folder", &aArgFolder))
{
rtl::OUString aArgUri;
OUString aArgUri;
if (getResourceNameRequestArgument(aRequestArguments,
&aArgUri))
{
......@@ -227,18 +216,10 @@ UUIInteractionHelper::handleInteractiveIOException(
if (getResourceNameRequestArgument(aRequestArguments,
&aArgUri))
{
rtl::OUString aResourceType;
getStringRequestArgument(
aRequestArguments,
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"ResourceType")),
&aResourceType);
OUString aResourceType;
getStringRequestArgument(aRequestArguments, "ResourceType", &aResourceType);
bool bRemovable = false;
getBoolRequestArgument(aRequestArguments,
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"Removable")),
&bRemovable);
getBoolRequestArgument(aRequestArguments, "Removable", &bRemovable);
nErrorCode = aResourceType == "volume"
? (bRemovable
? ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE
......@@ -257,15 +238,8 @@ UUIInteractionHelper::handleInteractiveIOException(
{
rtl::OUString aArgVolume;
rtl::OUString aArgOtherVolume;
if (getStringRequestArgument(
aRequestArguments,
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"Volume")),
&aArgVolume)
&& getStringRequestArgument(
aRequestArguments,
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"OtherVolume")),
if (getStringRequestArgument(aRequestArguments, "Volume", &aArgVolume)
&& getStringRequestArgument(aRequestArguments, "OtherVolume",
&aArgOtherVolume))
{
nErrorCode = aErrorCode[aIoException.Code][1];
......@@ -285,11 +259,8 @@ UUIInteractionHelper::handleInteractiveIOException(
&aArgUri))
{
rtl::OUString aResourceType;
getStringRequestArgument(
aRequestArguments,
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"ResourceType")),
&aResourceType);
getStringRequestArgument(aRequestArguments, "ResourceType",
&aResourceType);
nErrorCode = aResourceType == "volume"
? ERRCODE_UUI_IO_NOTEXISTS_VOLUME
: (aResourceType == "folder"
......
......@@ -140,8 +140,7 @@ handleLockedDocumentRequest_(
}
catch (std::bad_alloc const &)
{
throw uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
throw uno::RuntimeException(OUString("out of memory"),
uno::Reference< uno::XInterface >());
}
}
......@@ -178,8 +177,7 @@ handleChangedByOthersRequest_(
}
catch (std::bad_alloc const &)
{
throw uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
throw uno::RuntimeException(OUString("out of memory"),
uno::Reference< uno::XInterface >());
}
}
......@@ -216,8 +214,7 @@ handleLockFileIgnoreRequest_(
}
catch (std::bad_alloc const &)
{
throw uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
throw uno::RuntimeException(OUString("out of memory"),
uno::Reference< uno::XInterface >());
}
}
......
......@@ -403,7 +403,7 @@ bool UUIInteractionHelper::handleTypedHandlerImplementations( Reference< XIntera
// the base registration node for "typed" interaction handlers
const ::utl::OConfigurationTreeRoot aConfigRoot( ::utl::OConfigurationTreeRoot::createWithServiceFactory(
m_xServiceFactory,
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Interaction/InteractionHandlers" ) ),
OUString( "/org.openoffice.Interaction/InteractionHandlers" ),
-1,
::utl::OConfigurationTreeRoot::CM_READONLY
) );
......@@ -904,8 +904,7 @@ UUIInteractionHelper::handleRequest_impl(
}
catch (std::bad_alloc const &)
{
throw uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
throw uno::RuntimeException(OUString("out of memory"),
uno::Reference< uno::XInterface >());
}
catch( const uno::RuntimeException& )
......@@ -935,31 +934,23 @@ UUIInteractionHelper::getInteractionHandlerList(
uno::Sequence< uno::Any > aArguments( 1 );
beans::PropertyValue aProperty;
aProperty.Name
= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
aProperty.Name = OUString( "nodepath" );
aProperty.Value <<= aFullPath.makeStringAndClear();
aArguments[ 0 ] <<= aProperty;
uno::Reference< uno::XInterface > xInterface(
xConfigProv->createInstanceWithArguments(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.ConfigurationAccess" ) ),
aArguments ) );
"com.sun.star.configuration.ConfigurationAccess" , aArguments ) );
if ( !xInterface.is() )
throw uno::RuntimeException(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"unable to instanciate config access")),
throw uno::RuntimeException(OUString("unable to instanciate config access"),
uno::Reference< uno::XInterface >());
uno::Reference< container::XNameAccess > xNameAccess(
xInterface, uno::UNO_QUERY );
if ( !xNameAccess.is() )
throw uno::RuntimeException(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"config access does not implement XNameAccess")),
throw uno::RuntimeException(OUString(
"config access does not implement XNameAccess"),
uno::Reference< uno::XInterface >());
uno::Sequence< rtl::OUString > aElems = xNameAccess->getElementNames();
......@@ -972,10 +963,8 @@ UUIInteractionHelper::getInteractionHandlerList(
xHierNameAccess( xInterface, uno::UNO_QUERY );
if ( !xHierNameAccess.is() )
throw uno::RuntimeException(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"config access does not implement XHierarchicalNameAccess")),
throw uno::RuntimeException(OUString(
"config access does not implement XHierarchicalNameAccess"),
uno::Reference< uno::XInterface >());
// Iterate over children.
......@@ -1214,16 +1203,16 @@ UUIInteractionHelper::handleGenericErrorRequest(
boost::scoped_ptr< ResMgr > xManager(
ResMgr::CreateResMgr( "uui" ) );
rtl::OUString aTitle( utl::ConfigManager::getProductName() );
OUString aTitle( utl::ConfigManager::getProductName() );
::rtl::OUString aErrTitle
OUString aErrTitle
= ResId( nError == ERRCODE_SFX_BROKENSIGNATURE
? STR_WARNING_BROKENSIGNATURE_TITLE
: STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE,
*xManager.get() ).toString();
if ( !aTitle.isEmpty() && !aErrTitle.isEmpty() )
aTitle += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " - " ) );
aTitle += " - " ;
aTitle += aErrTitle;
executeMessageBox(
......@@ -1417,9 +1406,9 @@ UUIInteractionHelper::handleBrokenPackageRequest(
else
return;
rtl::OUString title(
OUString title(
utl::ConfigManager::getProductName() +
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ) ) +
OUString( " " ) +
utl::ConfigManager::getProductVersion() );
switch (
......
......@@ -125,17 +125,14 @@ UUIInteractionHandler::handle(
char const UUIInteractionHandler::m_aImplementationName[]
= "com.sun.star.comp.uui.UUIInteractionHandler";
uno::Sequence< rtl::OUString >
uno::Sequence< OUString >
UUIInteractionHandler::getSupportedServiceNames_static()
{
uno::Sequence< rtl::OUString > aNames(3);
aNames[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.task.InteractionHandler"));
uno::Sequence< OUString > aNames(3);
aNames[0] = "com.sun.star.task.InteractionHandler";
// added to indicate support for configuration.backend.MergeRecoveryRequest
aNames[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.backend.InteractionHandler"));
aNames[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.uui.InteractionHandler"));
aNames[1] = "com.sun.star.configuration.backend.InteractionHandler";
aNames[2] = "com.sun.star.uui.InteractionHandler";
// for backwards compatibility
return aNames;
}
......@@ -152,9 +149,7 @@ UUIInteractionHandler::createInstance(
}
catch (std::bad_alloc const &)
{
throw uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
0);
throw uno::RuntimeException(OUString("out of memory"), 0);
}
}
......
......@@ -46,8 +46,6 @@ namespace container = ::com::sun::star::container;
using namespace com::sun::star::system;
#define DEFINE_CONST_UNICODE( CONSTASCII ) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CONSTASCII ) )
namespace uui
{
......@@ -78,18 +76,18 @@ NewerVersionWarningDialog::~NewerVersionWarningDialog()
IMPL_LINK_NOARG(NewerVersionWarningDialog, UpdateHdl)
{
// detect execute path
::rtl::OUString sProgramPath;
OUString sProgramPath;
osl_getExecutableFile( &sProgramPath.pData );
sal_uInt32 nLastIndex = sProgramPath.lastIndexOf( '/' );
if ( nLastIndex > 0 )
sProgramPath = sProgramPath.copy( 0, nLastIndex + 1 );
// read keys from soffice.ini (sofficerc)
::rtl::OUString sIniFileName = sProgramPath;
sIniFileName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SAL_CONFIGFILE( "version" ) ) );
OUString sIniFileName = sProgramPath;
sIniFileName += OUString( SAL_CONFIGFILE( "version" ) );
::rtl::Bootstrap aIniFile( sIniFileName );
::rtl::OUString sNotifyURL;
aIniFile.getFrom( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ODFNotifyURL" ) ), sNotifyURL );
OUString sNotifyURL;
aIniFile.getFrom( OUString( "ODFNotifyURL" ), sNotifyURL );
try
{
......@@ -112,16 +110,16 @@ IMPL_LINK_NOARG(NewerVersionWarningDialog, UpdateHdl)
aContext.createComponent( "com.sun.star.setup.UpdateCheckConfig" ), uno::UNO_QUERY_THROW );
sal_Bool bUpdateCheckEnabled = sal_False;
OSL_VERIFY( xUpdateConfig->getByName( DEFINE_CONST_UNICODE( "AutoCheckEnabled" ) ) >>= bUpdateCheckEnabled );
OSL_VERIFY( xUpdateConfig->getByName( OUString( "AutoCheckEnabled" ) ) >>= bUpdateCheckEnabled );
// TODO: do we need to respect the bUpdateCheckEnabled flag? Finally, its meaning is "are automatic
// updates enabled", but this here is not an automatic update, but one triggered explicitly by the user.
uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
aContext.getUNOContext(),
DEFINE_CONST_UNICODE("org.openoffice.Office.Addons/"),
DEFINE_CONST_UNICODE("AddonUI/OfficeHelp/UpdateCheckJob"),
DEFINE_CONST_UNICODE("URL"),
"org.openoffice.Office.Addons/",
"AddonUI/OfficeHelp/UpdateCheckJob",
"URL",
::comphelper::ConfigurationHelper::E_READONLY );
util::URL aURL;
if ( aVal >>= aURL.Complete )
......
......@@ -329,22 +329,20 @@ PasswordContainerInteractionHandler::getSupportedServiceNames()
//=========================================================================
// static
rtl::OUString
OUString
PasswordContainerInteractionHandler::getImplementationName_Static()
{
return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.comp.uui.PasswordContainerInteractionHandler" ) );
return OUString( "com.sun.star.comp.uui.PasswordContainerInteractionHandler" );
}
//=========================================================================
// static
uno::Sequence< rtl::OUString >
uno::Sequence< OUString >
PasswordContainerInteractionHandler::getSupportedServiceNames_Static()
{
uno::Sequence< rtl::OUString > aSNS( 1 );
aSNS.getArray()[ 0 ]
= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.task.PasswordContainerInteractionHandler" ) );
uno::Sequence< OUString > aSNS( 1 );
aSNS.getArray()[ 0 ] = OUString(
"com.sun.star.task.PasswordContainerInteractionHandler" );
return aSNS;
}
......
......@@ -82,12 +82,11 @@ UUIInteractionRequestStringResolver::getStringFromInformationalRequest(
char const UUIInteractionRequestStringResolver::m_aImplementationName[]
= "com.sun.star.comp.uui.UUIInteractionRequestStringResolver";
star::uno::Sequence< rtl::OUString >
star::uno::Sequence< OUString >
UUIInteractionRequestStringResolver::getSupportedServiceNames_static()
{
star::uno::Sequence< rtl::OUString > aNames(1);
aNames[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.task.InteractionRequestStringResolver"));
star::uno::Sequence< OUString > aNames(1);
aNames[0] = "com.sun.star.task.InteractionRequestStringResolver";
return aNames;
}
......@@ -103,9 +102,7 @@ UUIInteractionRequestStringResolver::createInstance(
}
catch (std::bad_alloc const &)
{
throw star::uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
0);
throw star::uno::RuntimeException(OUString("out of memory"), 0);
}
}
......
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