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 | 880da6c7b7ea950799bb43f2bc107da4c2f07a6c (diff) |
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() ) { |