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-07 09:56:28 +0100 |
commit | a5af7a56cce03626b8438ac21fc302a11d722ddb (patch) | |
tree | 66b43ecdac900d8848c1b9987303a090af7ba359 | |
parent | fdc14139b235b3695a67e073a20e65392ebf1f2f (diff) |
fix VBA mode MkDir when passed folder is not a full path
Change-Id: I7fd804999f1b96e6aab112445edcd9dcf7753c24
-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() ) { |