summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2012-09-11 08:48:02 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-09-12 12:49:49 +0100
commit4597483e00bffcc4e30d379dcf6fad42bc565e56 (patch)
treeb590428b0e3ae3c7056e6c18f008d7179dc5ba38 /basic
parentc414499bbd456389ac6cacf677327bff9e6b43f9 (diff)
targetted VBA re-work.
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sbunoobj.cxx26
-rw-r--r--basic/source/classes/sbxmod.cxx11
-rw-r--r--basic/source/runtime/methods.cxx42
3 files changed, 2 insertions, 77 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index c4f5fd82ead3..c79263493714 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -437,32 +437,6 @@ void implHandleWrappedTargetException( const Any& _rWrappedTargetException )
SbError nError( ERRCODE_BASIC_EXCEPTION );
::rtl::OUStringBuffer aMessageBuf;
- // Add for VBA, to get the correct error code and message.
- if ( SbiRuntime::isVBAEnabled() )
- {
- if ( aExamine >>= aBasicError )
- {
- if ( aBasicError.ErrorCode != 0 )
- {
- nError = StarBASIC::GetSfxFromVBError( (sal_uInt16) aBasicError.ErrorCode );
- if ( nError == 0 )
- {
- nError = (SbError) aBasicError.ErrorCode;
- }
- aMessageBuf.append( aBasicError.ErrorMessageArgument );
- aExamine.clear();
- }
- }
-
- IndexOutOfBoundsException aIdxOutBndsExp;
- if ( aExamine >>= aIdxOutBndsExp )
- {
- nError = SbERR_OUT_OF_RANGE;
- aExamine.clear();
- }
- }
- // End add
-
// strip any other WrappedTargetException instances, but this time preserve the error messages.
WrappedTargetException aWrapped;
sal_Int32 nLevel = 0;
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index a70a7eaa413f..f47e352183b2 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -2351,15 +2351,6 @@ public:
mpUserForm->triggerMethod( rtl::OUString("Userform_QueryClose" ),
aParams);
- xVbaMethodParameter->setVbaMethodParameter( rtl::OUString( "Cancel"), aParams[0]);
- // If we don't cancel then we want to make sure the dialog
- // really is gone to make sure when we attempt to raise it again
- // it will actually generate an initialise event
- if ( !nCancel )
- {
- removeListener(); // presumably we need to do this
- mpUserForm->ResetApiObj();
- }
return;
}
@@ -2687,7 +2678,7 @@ void SbUserFormModule::InitObject()
aArgs[ 0 ] = uno::Any();
aArgs[ 1 ] <<= m_xDialog;
aArgs[ 2 ] <<= m_xModel;
- aArgs[ 3 ] <<= sProjectName;
+ aArgs[ 3 ] <<= rtl::OUString( GetParent()->GetName() );
pDocObject = new SbUnoObject( GetName(), uno::makeAny( xVBAFactory->createInstanceWithArguments( rtl::OUString( "ooo.vba.msforms.UserForm"), aArgs ) ) );
uno::Reference< lang::XComponent > xComponent( m_xDialog, uno::UNO_QUERY_THROW );
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index e5e094a682db..1d2835b04749 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -631,36 +631,6 @@ RTLFUNC(MkDir)
{
try
{
- if ( SbiRuntime::isVBAEnabled() )
- {
- // If aPath is the folder name, not a path, then create the folder under current directory.
- INetURLObject aTryPathURL( aPath );
- ::rtl::OUString sPathURL = aTryPathURL.GetMainURL( INetURLObject::NO_DECODE );
- if ( sPathURL.isEmpty() )
- {
- File::getFileURLFromSystemPath( aPath, sPathURL );
- }
- INetURLObject aPathURL( sPathURL );
- if ( aPathURL.GetPath().isEmpty() )
- {
- ::rtl::OUString sCurDirURL;
- SbxArrayRef pPar = new SbxArray;
- SbxVariableRef pVar = new SbxVariable();
- pPar->Put( pVar, 0 );
- SbRtl_CurDir( pBasic, *pPar, sal_False );
- String aCurPath = pPar->Get(0)->GetString();
-
- File::getFileURLFromSystemPath( aCurPath, sCurDirURL );
- INetURLObject aDirURL( sCurDirURL );
- aDirURL.Append( aPath );
- ::rtl::OUString aTmpPath = aDirURL.GetMainURL( INetURLObject::NO_DECODE );
- if ( !aTmpPath.isEmpty() )
- {
- aPath = aTmpPath;
- }
- }
- }
-
xSFI->createFolder( getFullPath( aPath ) );
}
catch(const Exception & )
@@ -3287,20 +3257,10 @@ RTLFUNC(Shell)
pParamList[j] = NULL;
}
- long nResult = 0;
- // We should return the identifier of the executing process when is running VBA, because method Shell(...) returns it in Excel.
- if ( bSucc && SbiRuntime::isVBAEnabled())
- {
- oslProcessInfo aInfo;
- aInfo.Size = sizeof(oslProcessInfo);
- osl_getProcessInfo( pApp, osl_Process_IDENTIFIER, &aInfo );
- nResult = aInfo.Ident;
- }
-
if( !bSucc )
StarBASIC::Error( SbERR_FILE_NOT_FOUND );
else
- rPar.Get(0)->PutLong( nResult );
+ rPar.Get(0)->PutLong( 0 );
}
}