[Libreoffice-commits] core.git: sal/osl
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Thu Sep 5 15:17:43 UTC 2019
sal/osl/unx/file_misc.cxx | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
New commits:
commit 8cb5c2565e87a3f1e026bdb9f9308f6ea8fd1452
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Sep 5 15:05:05 2019 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Sep 5 17:16:51 2019 +0200
Use OUString in osl_getNextDirectoryItem
Change-Id: Ifa1491a1af1d3c74d84ec4d6bec79fcf7a5d6bf4
Reviewed-on: https://gerrit.libreoffice.org/78653
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
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;
}
More information about the Libreoffice-commits
mailing list