update ooo310-m15
[ooovba.git] / applied_patches / 0445-vba-fix-path-fullname.diff
blob5c2e7c6f1d7a2773e6787366abfe20ad65b325d3
1 diff --git vbahelper/source/vbahelper/vbadocumentbase.cxx vbahelper/source/vbahelper/vbadocumentbase.cxx
2 index e53279e..b8054cc 100644
3 --- vbahelper/source/vbahelper/vbadocumentbase.cxx
4 +++ vbahelper/source/vbahelper/vbadocumentbase.cxx
5 @@ -82,17 +82,22 @@ VbaDocumentBase::getName() throw (uno::RuntimeException)
6 ::rtl::OUString
7 VbaDocumentBase::getPath() throw (uno::RuntimeException)
9 - INetURLObject aURL( getModel()->getURL() );
10 - aURL.CutLastName();
11 - return aURL.GetURLPath();
12 + INetURLObject aURL( getModel()->getURL() );
13 + rtl::OUString sURL( aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
14 + sURL = sURL.copy( 0, sURL.getLength() - aURL.GetLastName().getLength() - 1 );
15 + rtl::OUString sPath;
16 + ::osl::File::getSystemPathFromFileURL( sURL, sPath );
17 + return sPath;
20 ::rtl::OUString
21 VbaDocumentBase::getFullName() throw (uno::RuntimeException)
23 - INetURLObject aURL( getModel()->getURL() );
24 - return aURL.GetURLPath();
25 + rtl::OUString sPath;
26 + ::osl::File::getSystemPathFromFileURL( getModel()->getURL(), sPath );
27 + return sPath;
30 void
31 VbaDocumentBase::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg,
32 const uno::Any &rRouteArg ) throw (uno::RuntimeException)