summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-06-27 10:24:28 +0300
committerAndras Timar <andras.timar@collabora.com>2022-07-02 16:04:21 +0200
commit0da1e66fe0010f3dfbfd9144bab9b5790429a222 (patch)
tree469c1ef2e427353bcb5b1d61d94e4a9548150478 /shell
parentc32605e54a4525c5ad80e273f17e657e9e601b13 (diff)
tdf#126263: make sure to convert system path to file URLs
Change-Id: Ia21f29e3a1eb078a7df2366399c59d46ab26ff3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136482 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136490 Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136505
Diffstat (limited to 'shell')
-rw-r--r--shell/source/win32/simplemail/smplmailclient.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx
index 1396bd150066..4b19880d6cc2 100644
--- a/shell/source/win32/simplemail/smplmailclient.cxx
+++ b/shell/source/win32/simplemail/smplmailclient.cxx
@@ -194,7 +194,11 @@ OUString CSmplMailClient::CopyAttachment(const OUString& sOrigAttachURL, OUStrin
maAttachmentFiles.back()->EnableKillingFile();
INetURLObject aFilePathObj(maAttachmentFiles.back()->GetURL());
OUString sNewAttachmentURL = aFilePathObj.GetMainURL(INetURLObject::DecodeMechanism::NONE);
- if (osl::File::copy(sOrigAttachURL, sNewAttachmentURL) == osl::FileBase::RC::E_None)
+ OUString sCorrectedOrigAttachURL(sOrigAttachURL);
+ // Make sure to convert to URL, if a system path was passed to XSimpleMailMessage
+ // Ignore conversion error, in which case sCorrectedOrigAttachURL is unchanged
+ osl::FileBase::getFileURLFromSystemPath(sCorrectedOrigAttachURL, sCorrectedOrigAttachURL);
+ if (osl::File::copy(sCorrectedOrigAttachURL, sNewAttachmentURL) == osl::FileBase::RC::E_None)
{
INetURLObject url(sOrigAttachURL, INetURLObject::EncodeMechanism::WasEncoded);
sUserVisibleName = url.getName(INetURLObject::LAST_SEGMENT, true,