Kaydet (Commit) bdf13d15 authored tarafından Caolán McNamara's avatar Caolán McNamara

some small startup optimizations

üst 0dd92103
......@@ -55,13 +55,11 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
#define C2U(cChar) OUString::createFromAscii(cChar)
#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
//-----------------------------------------------------------------------------
const char* cConfigBaseURL = "/org.openoffice.";
//const char* cConfigBaseURL = "/com.sun.star.";
const char* cAccessSrvc = "com.sun.star.configuration.ConfigurationUpdateAccess";
const char* pConfigBaseURL = "/org.openoffice.";
const char* pAccessSrvc = "com.sun.star.configuration.ConfigurationUpdateAccess";
namespace
{
......@@ -152,7 +150,7 @@ Reference< XMultiServiceFactory > ConfigManager::GetConfigurationProvider()
{
xConfigurationProvider = Reference< XMultiServiceFactory >
(xMSF->createInstance(
C2U("com.sun.star.configuration.ConfigurationProvider")),
UNISTRING("com.sun.star.configuration.ConfigurationProvider")),
UNO_QUERY);
}
#ifdef DBG_UTIL
......@@ -254,17 +252,17 @@ Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem&
}
OSL_ENSURE(bFound, "AcquireTree: ConfigItem unknown!");
#endif
OUString sPath = C2U(cConfigBaseURL);
OUString sPath(OUString::createFromAscii(pConfigBaseURL));
sPath += rCfgItem.GetSubTreeName();
Sequence< Any > aArgs(2);
Any* pArgs = aArgs.getArray();
PropertyValue aPath;
aPath.Name = C2U("nodepath");
aPath.Name = UNISTRING("nodepath");
aPath.Value <<= sPath;
pArgs[0] <<= aPath;
sal_Bool bLazy = 0 != (rCfgItem.GetMode()&CONFIG_MODE_DELAYED_UPDATE);
PropertyValue aUpdate;
aUpdate.Name = C2U("lazywrite");
aUpdate.Name = UNISTRING("lazywrite");
aUpdate.Value.setValue(&bLazy, ::getBooleanCppuType());
pArgs[1] <<= aUpdate;
......@@ -277,8 +275,8 @@ Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem&
aArgs.realloc(nCount+1);
PropertyValue aAllLocale;
aAllLocale.Name = C2U("locale");
aAllLocale.Value <<= C2U("*" );
aAllLocale.Name = UNISTRING("locale");
aAllLocale.Value <<= UNISTRING("*" );
aArgs[nCount] <<= aAllLocale;
}
......@@ -289,7 +287,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem&
try
{
xIFace = xCfgProvider->createInstanceWithArguments(
C2U(cAccessSrvc),
OUString::createFromAscii(pAccessSrvc),
aArgs);
}
catch(Exception& rEx)
......@@ -367,7 +365,7 @@ ConfigManager& ConfigManager::GetConfigManager()
---------------------------------------------------------------------------*/
rtl::OUString ConfigManager::GetConfigBaseURL()
{
return C2U(cConfigBaseURL);
return OUString::createFromAscii(pConfigBaseURL);
}
/* -----------------------------25.09.00 16:34--------------------------------
......@@ -479,10 +477,10 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
}
}
OUString sPath = C2U(cConfigBaseURL);
OUString sPath = OUString::createFromAscii(pConfigBaseURL);
switch(eProp)
{
case LOCALE: sPath += C2U("Setup/L10N"); break;
case LOCALE: sPath += UNISTRING("Setup/L10N"); break;
case PRODUCTNAME:
case PRODUCTVERSION:
......@@ -491,12 +489,12 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
case PRODUCTXMLFILEFORMATVERSION:
case OPENSOURCECONTEXT:
case OOOVENDOR:
case ABOUTBOXPRODUCTVERSION: sPath += C2U("Setup/Product"); break;
case ABOUTBOXPRODUCTVERSION: sPath += UNISTRING("Setup/Product"); break;
case DEFAULTCURRENCY: sPath += C2U("Setup/L10N"); break;
case DEFAULTCURRENCY: sPath += UNISTRING("Setup/L10N"); break;
case WRITERCOMPATIBILITYVERSIONOOO11:
sPath += C2U("Office.Compatibility/WriterCompatibilityVersion"); break;
sPath += UNISTRING("Office.Compatibility/WriterCompatibilityVersion"); break;
default:
break;
}
......@@ -509,7 +507,7 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
try
{
xIFace = xCfgProvider->createInstanceWithArguments(
C2U(cAccessSrvc),
OUString::createFromAscii(pAccessSrvc),
aArgs);
}
......@@ -520,17 +518,17 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
OUString sProperty;
switch(eProp)
{
case LOCALE: sProperty = C2U("ooLocale"); break;
case PRODUCTNAME: sProperty = C2U("ooName"); break;
case PRODUCTVERSION: sProperty = C2U("ooSetupVersion"); break;
case ABOUTBOXPRODUCTVERSION: sProperty = C2U("ooSetupVersionAboutBox"); break;
case OOOVENDOR: sProperty = C2U("ooVendor"); break;
case PRODUCTEXTENSION: sProperty = C2U("ooSetupExtension"); break;
case PRODUCTXMLFILEFORMATNAME: sProperty = C2U("ooXMLFileFormatName"); break;
case PRODUCTXMLFILEFORMATVERSION: sProperty = C2U("ooXMLFileFormatVersion"); break;
case OPENSOURCECONTEXT: sProperty = C2U("ooOpenSourceContext"); break;
case DEFAULTCURRENCY: sProperty = C2U("ooSetupCurrency"); break;
case WRITERCOMPATIBILITYVERSIONOOO11: sProperty = C2U("OOo11"); break;
case LOCALE: sProperty = UNISTRING("ooLocale"); break;
case PRODUCTNAME: sProperty = UNISTRING("ooName"); break;
case PRODUCTVERSION: sProperty = UNISTRING("ooSetupVersion"); break;
case ABOUTBOXPRODUCTVERSION: sProperty = UNISTRING("ooSetupVersionAboutBox"); break;
case OOOVENDOR: sProperty = UNISTRING("ooVendor"); break;
case PRODUCTEXTENSION: sProperty = UNISTRING("ooSetupExtension"); break;
case PRODUCTXMLFILEFORMATNAME: sProperty = UNISTRING("ooXMLFileFormatName"); break;
case PRODUCTXMLFILEFORMATVERSION: sProperty = UNISTRING("ooXMLFileFormatVersion"); break;
case OPENSOURCECONTEXT: sProperty = UNISTRING("ooOpenSourceContext"); break;
case DEFAULTCURRENCY: sProperty = UNISTRING("ooSetupCurrency"); break;
case WRITERCOMPATIBILITYVERSIONOOO11: sProperty = UNISTRING("OOo11"); break;
default:
break;
}
......@@ -642,7 +640,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::GetHierarchyAccess(const OUSt
try
{
xIFace = xCfgProvider->createInstanceWithArguments(
C2U(cAccessSrvc),
OUString::createFromAscii(pAccessSrvc),
aArgs);
}
#ifdef DBG_UTIL
......@@ -665,7 +663,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::GetHierarchyAccess(const OUSt
---------------------------------------------------------------------------*/
Any ConfigManager::GetLocalProperty(const OUString& rProperty)
{
OUString sPath = C2U(cConfigBaseURL);
OUString sPath(OUString::createFromAscii(pConfigBaseURL));
sPath += rProperty;
OUString sNode, sProperty;
......@@ -697,7 +695,7 @@ Any ConfigManager::GetLocalProperty(const OUString& rProperty)
---------------------------------------------------------------------------*/
void ConfigManager::PutLocalProperty(const OUString& rProperty, const Any& rValue)
{
OUString sPath = C2U(cConfigBaseURL);
OUString sPath(OUString::createFromAscii(pConfigBaseURL));
sPath += rProperty;
OUString sNode, sProperty;
......
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