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 /sfx2 | |
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 'sfx2')
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 6f6963080a32..5f2ff89adc0b 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -118,10 +118,10 @@ class theCurrentComponent : public rtl::Static< WeakReference< XInterface >, the #if HAVE_FEATURE_SCRIPTING // remember all registered components for VBA compatibility, to be able to remove them on disposing the model -typedef ::std::map< XInterface*, OString > VBAConstantNameMap; +typedef ::std::map< XInterface*, OUString > VBAConstantNameMap; static VBAConstantNameMap s_aRegisteredVBAConstants; -OString lclGetVBAGlobalConstName( const Reference< XInterface >& rxComponent ) +OUString lclGetVBAGlobalConstName( const Reference< XInterface >& rxComponent ) { OSL_ENSURE( rxComponent.is(), "lclGetVBAGlobalConstName - missing component" ); @@ -134,12 +134,12 @@ OString lclGetVBAGlobalConstName( const Reference< XInterface >& rxComponent ) { OUString aConstName; xProps->getPropertyValue("VBAGlobalConstantName") >>= aConstName; - return OUStringToOString( aConstName, RTL_TEXTENCODING_ASCII_US ); + return aConstName; } catch (const uno::Exception&) // not supported { } - return OString(); + return OUString(); } #endif @@ -190,7 +190,7 @@ void SAL_CALL SfxModelListener_Impl::disposing( const css::lang::EventObject& _r if ( aIt != s_aRegisteredVBAConstants.end() ) { if ( BasicManager* pAppMgr = SfxApplication::GetBasicManager() ) - pAppMgr->SetGlobalUNOConstant( aIt->second.getStr(), Any( Reference< XInterface >() ) ); + pAppMgr->SetGlobalUNOConstant( aIt->second, Any( Reference< XInterface >() ) ); s_aRegisteredVBAConstants.erase( aIt ); } } @@ -933,20 +933,20 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp // set new current component for VBA compatibility if ( _rxComponent.is() ) { - OString aVBAConstName = lclGetVBAGlobalConstName( _rxComponent ); + OUString aVBAConstName = lclGetVBAGlobalConstName( _rxComponent ); if ( !aVBAConstName.isEmpty() ) { - pAppMgr->SetGlobalUNOConstant( aVBAConstName.getStr(), Any( _rxComponent ) ); + pAppMgr->SetGlobalUNOConstant( aVBAConstName, Any( _rxComponent ) ); s_aRegisteredVBAConstants[ _rxComponent.get() ] = aVBAConstName; } } // no new component passed -> remove last registered VBA component else if ( xOldCurrentComp.is() ) { - OString aVBAConstName = lclGetVBAGlobalConstName( xOldCurrentComp ); + OUString aVBAConstName = lclGetVBAGlobalConstName( xOldCurrentComp ); if ( !aVBAConstName.isEmpty() ) { - pAppMgr->SetGlobalUNOConstant( aVBAConstName.getStr(), Any( Reference< XInterface >() ) ); + pAppMgr->SetGlobalUNOConstant( aVBAConstName, Any( Reference< XInterface >() ) ); s_aRegisteredVBAConstants.erase( xOldCurrentComp.get() ); } } |