diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-08 15:41:15 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-04-11 06:20:10 +0000 |
commit | f3dabe7507b578484805255eae31d8a1358e605c (patch) | |
tree | 385c39e2080d74e4e82ad5d363af201c7f11d19a /basic | |
parent | 234f10eb26b70bb2ab412dd46d2763f3a7f555ff (diff) |
make GetGlobalUNOConstant and GetUNOConstant take an OUString
and eliminate converting backwards and forwards between
sal_Char*/OString/OUString
Change-Id: Iaf52ce93f0e732ab338f75d21b95ab4b020a4d6f
Reviewed-on: https://gerrit.libreoffice.org/23919
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 12 | ||||
-rw-r--r-- | basic/source/classes/sb.cxx | 5 |
2 files changed, 7 insertions, 10 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 533fb0cd78ab..4ac855666ff2 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -1458,17 +1458,17 @@ bool BasicManager::IsBasicModified() const } -bool BasicManager::GetGlobalUNOConstant( const sal_Char* _pAsciiName, uno::Any& aOut ) +bool BasicManager::GetGlobalUNOConstant( const OUString& rName, uno::Any& aOut ) { bool bRes = false; StarBASIC* pStandardLib = GetStdLib(); OSL_PRECOND( pStandardLib, "BasicManager::GetGlobalUNOConstant: no lib to read from!" ); if ( pStandardLib ) - bRes = pStandardLib->GetUNOConstant( _pAsciiName, aOut ); + bRes = pStandardLib->GetUNOConstant( rName, aOut ); return bRes; } -uno::Any BasicManager::SetGlobalUNOConstant( const sal_Char* _pAsciiName, const uno::Any& _rValue ) +uno::Any BasicManager::SetGlobalUNOConstant( const OUString& rName, const uno::Any& _rValue ) { uno::Any aOldValue; @@ -1477,14 +1477,12 @@ uno::Any BasicManager::SetGlobalUNOConstant( const sal_Char* _pAsciiName, const if ( !pStandardLib ) return aOldValue; - OUString sVarName( OUString::createFromAscii( _pAsciiName ) ); - // obtain the old value - SbxVariable* pVariable = pStandardLib->Find( sVarName, SbxCLASS_OBJECT ); + SbxVariable* pVariable = pStandardLib->Find( rName, SbxCLASS_OBJECT ); if ( pVariable ) aOldValue = sbxToUnoValue( pVariable ); - SbxObjectRef xUnoObj = GetSbUnoObject( sVarName, _rValue ); + SbxObjectRef xUnoObj = GetSbUnoObject( rName, _rValue ); xUnoObj->SetFlag( SbxFlagBits::DontStore ); pStandardLib->Insert( xUnoObj ); diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 7e4323ae5917..a470547d192a 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -1921,11 +1921,10 @@ bool StarBASIC::StoreData( SvStream& r ) const return true; } -bool StarBASIC::GetUNOConstant( const sal_Char* _pAsciiName, css::uno::Any& aOut ) +bool StarBASIC::GetUNOConstant( const OUString& rName, css::uno::Any& aOut ) { bool bRes = false; - OUString sVarName( OUString::createFromAscii( _pAsciiName ) ); - SbUnoObject* pGlobs = dynamic_cast<SbUnoObject*>( Find( sVarName, SbxCLASS_DONTCARE ) ); + SbUnoObject* pGlobs = dynamic_cast<SbUnoObject*>( Find( rName, SbxCLASS_DONTCARE ) ); if ( pGlobs ) { aOut = pGlobs->getUnoAny(); |