[Libreoffice-commits] .: 3 commits - svtools/source unotools/source vcl/unx
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Oct 29 08:43:44 PDT 2010
svtools/source/uno/svtxgridcontrol.cxx | 2 -
unotools/source/config/configmgr.cxx | 62 +++++++++++++++------------------
vcl/unx/source/app/sm.cxx | 2 -
3 files changed, 32 insertions(+), 34 deletions(-)
New commits:
commit 94ca9e19fac016c08d2d7dff674786110adc8f0e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 29 15:08:53 2010 +0100
some small startup optimizations
diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx
index 59653b5..4fc4846 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -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;
commit fa20188e05b01877d6a52d005ec982ed4bcf008b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 29 15:01:30 2010 +0100
microopt
diff --git a/vcl/unx/source/app/sm.cxx b/vcl/unx/source/app/sm.cxx
index fe10b2f..c10e5f6 100644
--- a/vcl/unx/source/app/sm.cxx
+++ b/vcl/unx/source/app/sm.cxx
@@ -565,7 +565,7 @@ String SessionManagerClient::getExecName()
osl_getExecutableFile( &aExec.pData );
osl_getSystemPathFromFileURL( aExec.pData, &aSysExec.pData );
- int nPos = aSysExec.indexOf( rtl::OUString::createFromAscii( ".bin" ) );
+ int nPos = aSysExec.indexOf( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".bin")) );
if( nPos != -1 )
aSysExec = aSysExec.copy( 0, nPos );
return aSysExec;
commit ad6ef83a44872afeaf635d66ca0526f995b8964c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 29 11:22:37 2010 +0100
if we're not going to check for failure, make sure default is sane
diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx
index 4f21cea..bf3ec22 100644
--- a/svtools/source/uno/svtxgridcontrol.cxx
+++ b/svtools/source/uno/svtxgridcontrol.cxx
@@ -606,7 +606,7 @@ void SAL_CALL SVTXGridControl::dataChanged(const ::com::sun::star::awt::grid::G
else if(Event.valueName == rtl::OUString::createFromAscii("CellUpdated"))
{
std::vector< std::vector< Any > >& rowContent = m_pTableModel->getCellContent();
- sal_Int32 col = -1;
+ sal_Int32 col(0);
Event.oldValue>>=col;
rowContent[Event.index][col] = Event.newValue;
pTable->InvalidateDataWindow(Event.index, Event.index, false);
More information about the Libreoffice-commits
mailing list