diff options
author | Noel Power <noel.power@suse.com> | 2013-04-25 17:10:46 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-05-09 14:11:21 +0100 |
commit | 894a0348dc86f60b35d48e51eea9cc465750b494 (patch) | |
tree | 322bc2888e00b9cfd58d7f8c680b5da874826af6 /basic | |
parent | fix userform data aware control import (diff) | |
download | core-894a0348dc86f60b35d48e51eea9cc465750b494.tar.gz core-894a0348dc86f60b35d48e51eea9cc465750b494.zip |
fix VBA mode MkDir when passed folder is not a full path
Change-Id: I7fd804999f1b96e6aab112445edcd9dcf7753c24
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/runtime/methods.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 9e1b3baa2656..19d52a8cbc8f 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -641,6 +641,28 @@ RTLFUNC(MkDir) if (rPar.Count() == 2) { OUString aPath = rPar.Get(1)->GetOUString(); + if ( SbiRuntime::isVBAEnabled() ) + { + // In vba if the full path is not specified then + // folder is created relative to the curdir + INetURLObject aURLObj( getFullPath( aPath ) ); + if ( aURLObj.GetProtocol() != INET_PROT_FILE ) + { + SbxArrayRef pPar = new SbxArray(); + SbxVariableRef pResult = new SbxVariable(); + SbxVariableRef pParam = new SbxVariable(); + pPar->Insert( pResult, pPar->Count() ); + pPar->Insert( pParam, pPar->Count() ); + SbRtl_CurDir( pBasic, *pPar, bWrite ); + + rtl::OUString sCurPathURL; + File::getFileURLFromSystemPath( pPar->Get(0)->GetOUString(), sCurPathURL ); + + aURLObj.SetURL( sCurPathURL ); + aURLObj.Append( aPath ); + File::getSystemPathFromFileURL(aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI ),aPath ) ; + } + } if( hasUno() ) { |