diff options
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.cxx | 26 | ||||
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.hxx | 2 |
2 files changed, 24 insertions, 4 deletions
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index b7efa8071116..dd4d4d32195a 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -22,7 +22,7 @@ #include <svtools/PlaceEditDialog.hxx> #include <tools/debug.hxx> #include <ucbhelper/commandenvironment.hxx> -#include <svl/fstathelper.hxx> +#include <unotools/ucbhelper.hxx> #include <vcl/errinf.hxx> #include <officecfg/Office/Common.hxx> @@ -1140,12 +1140,32 @@ std::vector<OUString> RemoteFilesDialog::GetPathList() const bool RemoteFilesDialog::ContentIsFolder( const OUString& rURL ) { - return FStatHelper::IsFolder(rURL); + try + { + ::ucbhelper::Content content(rURL, + ::utl::UCBContentHelper::getDefaultCommandEnvironment(), + m_xContext); + return content.isFolder(); + } + catch (css::uno::Exception const&) + { + return false; + } } bool RemoteFilesDialog::ContentIsDocument( const OUString& rURL ) { - return FStatHelper::IsDocument(rURL); + try + { + ::ucbhelper::Content content(rURL, + ::utl::UCBContentHelper::getDefaultCommandEnvironment(), + m_xContext); + return content.isDocument(); + } + catch (css::uno::Exception const&) + { + return false; + } } sal_Int32 RemoteFilesDialog::getAvailableWidth() diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index 93a8e363f5b4..3dfb4e1dc9aa 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -68,7 +68,7 @@ public: virtual const OUString& GetPath() override; virtual std::vector<OUString> GetPathList() const override; virtual bool ContentIsFolder( const OUString& rURL ) override; - static bool ContentIsDocument(const OUString& rURL); + bool ContentIsDocument(const OUString& rURL); virtual OUString getCurrentFileText() const override; virtual void setCurrentFileText( const OUString& rText, bool bSelectAll = false ) override; |