[Libreoffice-commits] .: 3 commits - dtrans/source sw/source ucbhelper/source
Caolán McNamara
caolan at kemper.freedesktop.org
Thu Nov 10 08:45:47 PST 2011
dtrans/source/win32/dtobj/XTDataObject.cxx | 14 +++++-----
sw/source/ui/vba/vbasystem.cxx | 38 ++++++++++++++---------------
sw/source/ui/vba/vbasystem.hxx | 6 ++--
ucbhelper/source/client/contentbroker.cxx | 2 -
4 files changed, 30 insertions(+), 30 deletions(-)
New commits:
commit 6b0de40c013d24bee3934ffc039b3b5a0c16372e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Nov 10 15:39:56 2011 +0000
WaE: initialization order
diff --git a/dtrans/source/win32/dtobj/XTDataObject.cxx b/dtrans/source/win32/dtobj/XTDataObject.cxx
index 82b18dd..8212247 100644
--- a/dtrans/source/win32/dtobj/XTDataObject.cxx
+++ b/dtrans/source/win32/dtobj/XTDataObject.cxx
@@ -83,13 +83,13 @@ public:
//------------------------------------------------------------------------
CXTDataObject::CXTDataObject( const Reference< XMultiServiceFactory >& aServiceManager,
- const Reference< XTransferable >& aXTransferable ) :
- m_nRefCnt( 0 ),
- m_SrvMgr( aServiceManager ),
- m_XTransferable( aXTransferable ),
- m_DataFormatTranslator( aServiceManager ),
- m_bFormatEtcContainerInitialized( sal_False ),
- m_FormatRegistrar( m_SrvMgr, m_DataFormatTranslator )
+ const Reference< XTransferable >& aXTransferable )
+ : m_nRefCnt( 0 )
+ , m_SrvMgr( aServiceManager )
+ , m_XTransferable( aXTransferable )
+ , m_bFormatEtcContainerInitialized( sal_False )
+ , m_DataFormatTranslator( aServiceManager )
+ , m_FormatRegistrar( m_SrvMgr, m_DataFormatTranslator )
{
}
commit 2d8e9f7ce9d99bab192f2074cb3bae50ba510af9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Nov 10 13:04:05 2011 +0000
don't make it a secret what service fails
diff --git a/ucbhelper/source/client/contentbroker.cxx b/ucbhelper/source/client/contentbroker.cxx
index 36669b0..905419f 100644
--- a/ucbhelper/source/client/contentbroker.cxx
+++ b/ucbhelper/source/client/contentbroker.cxx
@@ -301,7 +301,7 @@ bool ContentBroker_Impl::initialize()
}
}
- OSL_ENSURE( xIfc.is(), "Error creating UCB service!" );
+ OSL_ENSURE( xIfc.is(), "Error creating UCB service 'com.sun.star.ucb.UniversalContentBroker'" );
if ( !xIfc.is() )
return false;
commit bb5ef9821d744ad22d303cd14748abb1f0d17862
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Nov 10 12:27:15 2011 +0000
make sw ByteString free
diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx
index 3aa035d..4b5b5a6 100644
--- a/sw/source/ui/vba/vbasystem.cxx
+++ b/sw/source/ui/vba/vbasystem.cxx
@@ -46,37 +46,37 @@ PrivateProfileStringListener::~PrivateProfileStringListener()
{
}
-void PrivateProfileStringListener::Initialize( const rtl::OUString& rFileName, const ByteString& rGroupName, const ByteString& rKey )
+void PrivateProfileStringListener::Initialize( const rtl::OUString& rFileName, const rtl::OString& rGroupName, const rtl::OString& rKey )
{
maFileName = rFileName;
maGroupName = rGroupName;
maKey = rKey;
}
#ifdef WNT
-void lcl_getRegKeyInfo( const ByteString& sKeyInfo, HKEY& hBaseKey, ByteString& sSubKey )
+void lcl_getRegKeyInfo( const rtl::OString& sKeyInfo, HKEY& hBaseKey, rtl::OString& sSubKey )
{
- sal_Int32 nBaseKeyIndex = sKeyInfo.Search('\\');
+ sal_Int32 nBaseKeyIndex = sKeyInfo.indexOf('\\');
if( nBaseKeyIndex > 0 )
{
- ByteString sBaseKey = sKeyInfo.Copy( 0, nBaseKeyIndex );
- sSubKey = sKeyInfo.Copy( nBaseKeyIndex + 1 );
- if( sBaseKey.Equals("HKEY_CURRENT_USER") )
+ rtl::OString sBaseKey = sKeyInfo.copy( 0, nBaseKeyIndex );
+ sSubKey = sKeyInfo.copy( nBaseKeyIndex + 1 );
+ if( sBaseKey.equalsL(RTL_CONSTASCII_STRINGPARAM("HKEY_CURRENT_USER")) )
{
hBaseKey = HKEY_CURRENT_USER;
}
- else if( sBaseKey.Equals("HKEY_LOCAL_MACHINE") )
+ else if( sBaseKey.equalsL(RTL_CONSTASCII_STRINGPARAM("HKEY_LOCAL_MACHINE")) )
{
hBaseKey = HKEY_LOCAL_MACHINE;
}
- else if( sBaseKey.Equals("HKEY_CLASSES_ROOT") )
+ else if( sBaseKey.equalsL(RTL_CONSTASCII_STRINGPARAM("HKEY_CLASSES_ROOT")) )
{
hBaseKey = HKEY_CLASSES_ROOT;
}
- else if( sBaseKey.Equals("HKEY_USERS") )
+ else if( sBaseKey.equalsL(RTL_CONSTASCII_STRINGPARAM("HKEY_USERS")) )
{
hBaseKey = HKEY_USERS;
}
- else if( sBaseKey.Equals("HKEY_CURRENT_CONFIG") )
+ else if( sBaseKey.equalsL(RTL_CONSTASCII_STRINGPARAM("HKEY_CURRENT_CONFIG")) )
{
hBaseKey = HKEY_CURRENT_CONFIG;
}
@@ -100,19 +100,19 @@ uno::Any PrivateProfileStringListener::getValueEvent()
// get key/value from windows register
#ifdef WNT
HKEY hBaseKey = NULL;
- ByteString sSubKey;
+ rtl::OString sSubKey;
lcl_getRegKeyInfo( maGroupName, hBaseKey, sSubKey );
if( hBaseKey != NULL )
{
HKEY hKey = NULL;
LONG lResult;
- LPCTSTR lpSubKey = TEXT( sSubKey.GetBuffer());
+ LPCTSTR lpSubKey = TEXT( sSubKey.getStr());
TCHAR szBuffer[1024];
DWORD cbData = sizeof( szBuffer );
lResult = RegOpenKeyEx( hBaseKey, lpSubKey, 0, KEY_QUERY_VALUE, &hKey );
if( ERROR_SUCCESS == lResult )
{
- LPCTSTR lpValueName = TEXT(maKey.GetBuffer());
+ LPCTSTR lpValueName = TEXT(maKey.getStr());
lResult = RegQueryValueEx( hKey, lpValueName, NULL, NULL, (LPBYTE)szBuffer, &cbData );
RegCloseKey( hKey );
sValue = rtl::OUString::createFromAscii(szBuffer);
@@ -139,26 +139,26 @@ void PrivateProfileStringListener::setValueEvent( const css::uno::Any& value )
// set value into a file
Config aCfg( maFileName );
aCfg.SetGroup( maGroupName );
- aCfg.WriteKey( maKey, ByteString( aValue.getStr(), RTL_TEXTENCODING_DONTKNOW ) );
+ aCfg.WriteKey( maKey, rtl::OUStringToOString(aValue, RTL_TEXTENCODING_DONTKNOW) );
}
else
{
//set value into windows register
#ifdef WNT
HKEY hBaseKey = NULL;
- ByteString sSubKey;
+ rtl::OString sSubKey;
lcl_getRegKeyInfo( maGroupName, hBaseKey, sSubKey );
if( hBaseKey != NULL )
{
HKEY hKey = NULL;
LONG lResult;
- LPCTSTR lpSubKey = TEXT( sSubKey.GetBuffer());
+ LPCTSTR lpSubKey = TEXT( sSubKey.getStr());
lResult = RegCreateKeyEx( hBaseKey, lpSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL );
if( ERROR_SUCCESS == lResult )
{
LPCTSTR szValue = TEXT( rtl::OUStringToOString( aValue, RTL_TEXTENCODING_UTF8 ).getStr() );
DWORD cbData = sizeof(TCHAR) * (_tcslen(szValue) + 1);
- LPCTSTR lpValueName = TEXT(maKey.GetBuffer());
+ LPCTSTR lpValueName = TEXT(maKey.getStr());
lResult = RegSetValueEx( hKey, lpValueName, 0 /* Reserved */, REG_SZ, (LPBYTE)szValue, cbData );
RegCloseKey( hKey );
}
@@ -263,8 +263,8 @@ SwVbaSystem::PrivateProfileString( const rtl::OUString& rFilename, const rtl::OU
osl::FileBase::getFileURLFromSystemPath( rFilename, sFileUrl);
}
- ByteString aGroupName = ByteString( rSection.getStr(), RTL_TEXTENCODING_DONTKNOW);
- ByteString aKey = ByteString( rKey.getStr(), RTL_TEXTENCODING_DONTKNOW);
+ rtl::OString aGroupName(rtl::OUStringToOString(rSection, RTL_TEXTENCODING_DONTKNOW));
+ rtl::OString aKey(rtl::OUStringToOString(rKey, RTL_TEXTENCODING_DONTKNOW));
maPrivateProfileStringListener.Initialize( sFileUrl, aGroupName, aKey );
return uno::makeAny( uno::Reference< XPropValue > ( new ScVbaPropValue( &maPrivateProfileStringListener ) ) );
diff --git a/sw/source/ui/vba/vbasystem.hxx b/sw/source/ui/vba/vbasystem.hxx
index 043f35f..4d06529 100644
--- a/sw/source/ui/vba/vbasystem.hxx
+++ b/sw/source/ui/vba/vbasystem.hxx
@@ -39,12 +39,12 @@ class PrivateProfileStringListener : public PropListener
{
private:
rtl::OUString maFileName;
- ByteString maGroupName;
- ByteString maKey;
+ rtl::OString maGroupName;
+ rtl::OString maKey;
public:
PrivateProfileStringListener(){};
virtual ~PrivateProfileStringListener();
- void Initialize( const rtl::OUString& rFileName, const ByteString& rGroupName, const ByteString& rKey );
+ void Initialize( const rtl::OUString& rFileName, const rtl::OString& rGroupName, const rtl::OString& rKey );
//PropListener
virtual void setValueEvent( const css::uno::Any& value );
More information about the Libreoffice-commits
mailing list