summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2017-07-19 11:01:47 +0000
committerTamás Bunth <btomi96@gmail.com>2017-07-19 14:10:17 +0200
commit831153d465b7091f2021f94bb10e725e0c48c684 (patch)
treebc7b1ef998fd5790d6bccbd7fb9c2a7f9dc8f0b9
parent5734c6fee6a959b86b5e7f9c391ae3bee6009a08 (diff)
vbaapi: File dialog produces path
instead of file url Change-Id: I6f4cab23edd1fabe93290a26adc5fb77f2a55e8b Reviewed-on: https://gerrit.libreoffice.org/40170 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
-rw-r--r--sc/source/ui/vba/vbafiledialog.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/sc/source/ui/vba/vbafiledialog.cxx b/sc/source/ui/vba/vbafiledialog.cxx
index 1129953dff02..f9a95cebdb87 100644
--- a/sc/source/ui/vba/vbafiledialog.cxx
+++ b/sc/source/ui/vba/vbafiledialog.cxx
@@ -19,6 +19,8 @@
#include "vbafiledialog.hxx"
+#include <osl/file.hxx>
+
#include <ooo/vba/office/MsoFileDialogType.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
@@ -84,8 +86,11 @@ sal_Int32 ScVbaFileDialog::Show()
break;
}
- for( auto& sPath : xFilePicker->getSelectedFiles() )
+ for( auto& sURL : xFilePicker->getSelectedFiles() )
{
+ OUString sPath;
+ osl::FileBase::getSystemPathFromFileURL(sURL, sPath);
+
sSelectedPaths.push_back(sPath);
}
}
@@ -103,10 +108,15 @@ sal_Int32 ScVbaFileDialog::Show()
break;
}
- OUString sPath = xFolderPicker->getDirectory();
+ OUString sURL = xFolderPicker->getDirectory();
+
+ if(!sURL.isEmpty())
+ {
+ OUString sPath;
+ osl::FileBase::getSystemPathFromFileURL(sURL, sPath);
- if(!sPath.isEmpty())
sSelectedPaths.push_back(sPath);
+ }
}
break;