From 99ab7bf20e3b40c911a89adc1040eb2572cc7293 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 10 Jan 2018 18:11:44 +0200 Subject: This is a hash: '#', this is a slash: '/' Change-Id: I3a0bd41f021547678f7e423d10c8900723006bb6 --- sfx2/source/appl/macroloader.cxx | 12 ++++++------ sfx2/source/notify/eventsupplier.cxx | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx index e8bb6baa31bb..a910138908fd 100644 --- a/sfx2/source/appl/macroloader.cxx +++ b/sfx2/source/appl/macroloader.cxx @@ -210,18 +210,18 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval, // 'macro://[docname|.]/lib.mod.proc(args)' => macro of current or qualified document // 'macro://obj.method(args)' => direct API call, execute it via App-BASIC const OUString& aMacro( rURL ); - sal_Int32 nHashPos = aMacro.indexOf( '/', 8 ); + sal_Int32 nThirdSlashPos = aMacro.indexOf( '/', 8 ); sal_Int32 nArgsPos = aMacro.indexOf( '(' ); BasicManager *pAppMgr = SfxApplication::GetBasicManager(); BasicManager *pBasMgr = nullptr; ErrCode nErr = ERRCODE_NONE; // should a macro function be executed ( no direct API call)? - if ( -1 != nHashPos && ( -1 == nArgsPos || nHashPos < nArgsPos ) ) + if ( -1 != nThirdSlashPos && ( -1 == nArgsPos || nThirdSlashPos < nArgsPos ) ) { // find BasicManager SfxObjectShell* pDoc = nullptr; - OUString aBasMgrName( INetURLObject::decode(aMacro.copy( 8, nHashPos-8 ), INetURLObject::DecodeMechanism::WithCharset) ); + OUString aBasMgrName( INetURLObject::decode(aMacro.copy( 8, nThirdSlashPos-8 ), INetURLObject::DecodeMechanism::WithCharset) ); if ( aBasMgrName.isEmpty() ) pBasMgr = pAppMgr; else if ( aBasMgrName == "." ) @@ -258,13 +258,13 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval, } // find BASIC method - OUString aQualifiedMethod( INetURLObject::decode(aMacro.copy( nHashPos+1 ), INetURLObject::DecodeMechanism::WithCharset) ); + OUString aQualifiedMethod( INetURLObject::decode(aMacro.copy( nThirdSlashPos+1 ), INetURLObject::DecodeMechanism::WithCharset) ); OUString aArgs; if ( -1 != nArgsPos ) { // remove arguments from macro name - aArgs = aQualifiedMethod.copy( nArgsPos - nHashPos - 1 ); - aQualifiedMethod = aQualifiedMethod.copy( 0, nArgsPos - nHashPos - 1 ); + aArgs = aQualifiedMethod.copy( nArgsPos - nThirdSlashPos - 1 ); + aQualifiedMethod = aQualifiedMethod.copy( 0, nArgsPos - nThirdSlashPos - 1 ); } if ( pBasMgr->HasMacro( aQualifiedMethod ) ) diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index 69076ad019d9..893a2d284455 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -429,18 +429,18 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i { if ( aMacroName.isEmpty() || aLibrary.isEmpty() ) { - sal_Int32 nHashPos = aScript.indexOf( '/', 8 ); + sal_Int32 nThirdSlashPos = aScript.indexOf( '/', 8 ); sal_Int32 nArgsPos = aScript.indexOf( '(' ); - if ( ( nHashPos != -1 ) && ( nArgsPos == -1 || nHashPos < nArgsPos ) ) + if ( ( nThirdSlashPos != -1 ) && ( nArgsPos == -1 || nThirdSlashPos < nArgsPos ) ) { - OUString aBasMgrName( INetURLObject::decode( aScript.copy( 8, nHashPos-8 ), INetURLObject::DecodeMechanism::WithCharset ) ); + OUString aBasMgrName( INetURLObject::decode( aScript.copy( 8, nThirdSlashPos-8 ), INetURLObject::DecodeMechanism::WithCharset ) ); if ( aBasMgrName == "." ) aLibrary = pDoc->GetTitle(); else aLibrary = SfxGetpApp()->GetName(); // Get the macro name - aMacroName = aScript.copy( nHashPos+1, nArgsPos - nHashPos - 1 ); + aMacroName = aScript.copy( nThirdSlashPos+1, nArgsPos - nThirdSlashPos - 1 ); } else { -- cgit