summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-09-05 15:05:05 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-09-05 17:16:51 +0200
commit8cb5c2565e87a3f1e026bdb9f9308f6ea8fd1452 (patch)
treef9fcc13fe88be8ce8a40f7cf2a7de5b0e8e917b8 /sal
parentec56174b0c83411b762b0992565e58c1ec4fc3f3 (diff)
Use OUString in osl_getNextDirectoryItem
Change-Id: Ifa1491a1af1d3c74d84ec4d6bec79fcf7a5d6bf4 Reviewed-on: https://gerrit.libreoffice.org/78653 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/file_misc.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 878d966b34d0..518a1b407a31 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -296,8 +296,8 @@ oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory pDirectory,
SAL_WARN_IF(!pItem, "sal.file", "pItem is nullptr");
DirectoryImpl* pDirImpl = static_cast<DirectoryImpl*>(pDirectory);
- rtl_uString* ustrFileName = nullptr;
- rtl_uString* ustrFilePath = nullptr;
+ OUString ustrFileName;
+ OUString ustrFilePath;
struct dirent* pEntry;
if ((pDirectory == nullptr) || (pItem == nullptr))
@@ -331,12 +331,11 @@ oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory pDirectory,
#endif
/* convert file name to unicode */
- rtl_string2UString(&ustrFileName, filename, strlen(filename),
+ rtl_string2UString(&ustrFileName.pData, filename, strlen(filename),
osl_getThreadTextEncoding(), OSTRING_TO_OUSTRING_CVTFLAGS);
- assert(ustrFileName);
+ assert(ustrFileName.pData);
- osl_systemPathMakeAbsolutePath(pDirImpl->ustrPath.pData, ustrFileName, &ustrFilePath);
- rtl_uString_release(ustrFileName);
+ osl::systemPathMakeAbsolutePath(pDirImpl->ustrPath, ustrFileName, ustrFilePath);
DirectoryItem_Impl* pImpl = static_cast< DirectoryItem_Impl* >(*pItem);
if (pImpl)
@@ -345,12 +344,11 @@ oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory pDirectory,
pImpl = nullptr;
}
#ifdef _DIRENT_HAVE_D_TYPE
- pImpl = new DirectoryItem_Impl(ustrFilePath, pEntry->d_type);
+ pImpl = new DirectoryItem_Impl(ustrFilePath.pData, pEntry->d_type);
#else
- pImpl = new DirectoryItem_Impl(ustrFilePath);
+ pImpl = new DirectoryItem_Impl(ustrFilePath.pData);
#endif /* _DIRENT_HAVE_D_TYPE */
*pItem = pImpl;
- rtl_uString_release(ustrFilePath);
return osl_File_E_None;
}