diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-21 20:22:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-22 07:43:35 +0100 |
commit | 494b3e69fd4bef0af19627cf31da98da376019d0 (patch) | |
tree | f0c9f434cfcc5775c45c79e8dba93453ec0ac8d0 /registry/tools/fileurl.cxx | |
parent | 968b64d054eb164cee9fb92b6bf7dd93f478bf24 (diff) |
loplugin:flatten in package..reportdesign
Change-Id: I2da242fcb59709ebdd0819ec04d051d794da71e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127277
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'registry/tools/fileurl.cxx')
-rw-r--r-- | registry/tools/fileurl.cxx | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/registry/tools/fileurl.cxx b/registry/tools/fileurl.cxx index 155995115b92..ce99be5a198b 100644 --- a/registry/tools/fileurl.cxx +++ b/registry/tools/fileurl.cxx @@ -46,28 +46,27 @@ OUString convertToFileUrl(char const* filename, sal_Int32 length) } OUString uFileUrl; - if (length > 0) + if (length <= 0) + return uFileUrl; + if (filename[0] != SEPARATOR) { - if (filename[0] != SEPARATOR) + // relative path name. + OUString uWorkingDir; + if (osl_getProcessWorkingDir(&uWorkingDir.pData) != osl_Process_E_None) { - // relative path name. - OUString uWorkingDir; - if (osl_getProcessWorkingDir(&uWorkingDir.pData) != osl_Process_E_None) - { - assert(false); - } - if (FileBase::getAbsoluteFileURL(uWorkingDir, uFileName, uFileUrl) != FileBase::E_None) - { - assert(false); - } + assert(false); } - else + if (FileBase::getAbsoluteFileURL(uWorkingDir, uFileName, uFileUrl) != FileBase::E_None) { - // absolute path name. - if (FileBase::getFileURLFromSystemPath(uFileName, uFileUrl) != FileBase::E_None) - { - assert(false); - } + assert(false); + } + } + else + { + // absolute path name. + if (FileBase::getFileURLFromSystemPath(uFileName, uFileUrl) != FileBase::E_None) + { + assert(false); } } return uFileUrl; |