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

RTL_CONSTASCII_(U)STRINGPARAM removed in desktop/source/deployment/manager

removed OUSTR() as well and replaced .equals() with ==

Change-Id: I3cbf3654f64bbc906352efc34d1458b00db3ddef
üst d1bab2c2
......@@ -35,8 +35,6 @@ namespace task = com::sun::star::task;
namespace ucb = com::sun::star::ucb;
namespace uno = com::sun::star::uno;
#define OUSTR(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
using ::com::sun::star::uno::Reference;
using ::rtl::OUString;
......@@ -195,8 +193,8 @@ void LicenseCommandEnv::handle(
if (request >>= licExc)
{
if (m_bSuppressLicense
|| m_repository.equals(OUSTR("bundled"))
|| licExc.AcceptBy.equals(OUSTR("admin")))
|| m_repository == "bundled"
|| licExc.AcceptBy == "admin")
{
//always approve in bundled case, because we do not support
//showing licenses anyway.
......
......@@ -53,7 +53,6 @@ namespace css_ucb = com::sun::star::ucb ;
namespace uno = com::sun::star::uno ;
namespace xml = com::sun::star::xml ;
#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
namespace dp_info {
......@@ -142,15 +141,15 @@ rtl::OUString SAL_CALL
PackageInformationProvider::getPackageLocation( const rtl::OUString& _sExtensionId )
throw ( uno::RuntimeException )
{
rtl::OUString aLocationURL = getPackageLocation( UNISTRING("user"), _sExtensionId );
rtl::OUString aLocationURL = getPackageLocation( rtl::OUString("user"), _sExtensionId );
if ( aLocationURL.isEmpty() )
{
aLocationURL = getPackageLocation( UNISTRING("shared"), _sExtensionId );
aLocationURL = getPackageLocation( rtl::OUString("shared"), _sExtensionId );
}
if ( aLocationURL.isEmpty() )
{
aLocationURL = getPackageLocation( UNISTRING("bundled"), _sExtensionId );
aLocationURL = getPackageLocation( rtl::OUString("bundled"), _sExtensionId );
}
if ( !aLocationURL.isEmpty() )
{
......@@ -237,7 +236,7 @@ PackageInformationProvider::isUpdateAvailable( const rtl::OUString& _sExtensionI
if (extensions[2].is() )
sVersionBundled = extensions[2]->getVersion();
bool bSharedReadOnly = extMgr->isReadOnlyRepository(OUSTR("shared"));
bool bSharedReadOnly = extMgr->isReadOnlyRepository("shared");
dp_misc::UPDATE_SOURCE sourceUser = dp_misc::isUpdateUserExtension(
bSharedReadOnly, sVersionUser, sVersionShared, sVersionBundled, sOnlineVersion);
......
......@@ -268,7 +268,7 @@ inline void PackageManagerImpl::check()
::osl::MutexGuard guard( getMutex() );
if (rBHelper.bInDispose || rBHelper.bDisposed)
throw css::lang::DisposedException(
OUSTR("PackageManager instance has already been disposed!"),
"PackageManager instance has already been disposed!",
static_cast< ::cppu::OWeakObject * >(this) );
}
......
......@@ -95,7 +95,7 @@ inline void PackageManagerFactoryImpl::check()
if (rBHelper.bInDispose || rBHelper.bDisposed)
{
throw lang::DisposedException(
OUSTR("PackageManagerFactory instance has already been disposed!"),
"PackageManagerFactory instance has already been disposed!",
static_cast<OWeakObject *>(this) );
}
}
......@@ -149,9 +149,9 @@ PackageManagerFactoryImpl::getPackageManager( OUString const & context )
m_xSharedMgr = xRet;
else if ( context == "bundled" )
m_xBundledMgr = xRet;
else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("tmp") ))
else if ( context == "tmp" )
m_xTmpMgr = xRet;
else if (context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bak") ))
else if ( context == "bak" )
m_xBakMgr = xRet;
}
else
......
......@@ -32,7 +32,6 @@ namespace lang = com::sun::star::lang;
namespace ucb = com::sun::star::ucb;
namespace uno = com::sun::star::uno;
#define OUSTR(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
using ::com::sun::star::uno::Reference;
using ::rtl::OUString;
......@@ -49,7 +48,7 @@ ExtensionProperties::ExtensionProperties(
Reference<uno::XComponentContext> const & xContext) :
m_xCmdEnv(xCmdEnv), m_xContext(xContext)
{
m_propFileUrl = urlExtension + OUSTR("properties");
m_propFileUrl = urlExtension + "properties";
::std::list< ::std::pair< OUString, OUString> > props;
if (! dp_misc::create_ucb_content(NULL, m_propFileUrl, 0, false))
......@@ -61,7 +60,7 @@ ExtensionProperties::ExtensionProperties(
typedef ::std::list< ::std::pair< OUString, OUString> >::const_iterator CI;
for (CI i = props.begin(); i != props.end(); ++i)
{
if (i->first.equals(OUSTR(PROP_SUPPRESS_LICENSE)))
if (i->first == PROP_SUPPRESS_LICENSE)
m_prop_suppress_license = i->second;
}
}
......@@ -74,39 +73,34 @@ ExtensionProperties::ExtensionProperties(
Reference<uno::XComponentContext> const & xContext) :
m_xCmdEnv(xCmdEnv), m_xContext(xContext)
{
m_propFileUrl = urlExtension + OUSTR("properties");
m_propFileUrl = urlExtension + "properties";
for (sal_Int32 i = 0; i < properties.getLength(); i++)
{
css::beans::NamedValue const & v = properties[i];
if (v.Name.equals(OUSTR(PROP_SUPPRESS_LICENSE)))
if (v.Name == PROP_SUPPRESS_LICENSE)
{
m_prop_suppress_license = getPropertyValue(v);
}
else if (v.Name.equals(OUSTR(PROP_EXTENSION_UPDATE)))
else if (v.Name == PROP_EXTENSION_UPDATE)
{
m_prop_extension_update = getPropertyValue(v);
}
else
{
throw lang::IllegalArgumentException(
OUSTR("Extension Manager: unknown property"), 0, -1);
"Extension Manager: unknown property", 0, -1);
}
}
}
OUString ExtensionProperties::getPropertyValue(css::beans::NamedValue const & v)
{
OUString value(OUSTR("0"));
if (v.Value >>= value)
{
if (value.equals(OUSTR("1")))
value = OUSTR("1");
}
else
OUString value("0");
if (! (v.Value >>= value) )
{
throw lang::IllegalArgumentException(
OUSTR("Extension Manager: wrong property value"), 0, -1);
"Extension Manager: wrong property value", 0, -1);
}
return value;
}
......@@ -117,8 +111,8 @@ void ExtensionProperties::write()
if (m_prop_suppress_license)
{
buf.append(OUSTR(PROP_SUPPRESS_LICENSE));
buf.append(OUSTR("="));
buf.append(PROP_SUPPRESS_LICENSE);
buf.append("=");
buf.append(*m_prop_suppress_license);
}
......@@ -137,7 +131,7 @@ bool ExtensionProperties::isSuppressedLicense()
bool ret = false;
if (m_prop_suppress_license)
{
if (m_prop_suppress_license->equals(OUSTR("1")))
if (*m_prop_suppress_license == "1")
ret = true;
}
return ret;
......@@ -148,7 +142,7 @@ bool ExtensionProperties::isExtensionUpdate()
bool ret = false;
if (m_prop_extension_update)
{
if (m_prop_extension_update->equals(OUSTR("1")))
if (*m_prop_extension_update == "1")
ret = true;
}
return ret;
......
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