summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2022-06-18 15:14:33 +0200
committerAndras Timar <andras.timar@collabora.com>2022-06-24 13:42:28 +0200
commit8bd75c9d3320f042466218798f8eb9942ab76a7c (patch)
tree87ea413ad01b4029265fff4d0eaf44f43e1f7330 /ucb
parent57137a8e80a769a79b5f9974ddc7d39324b6102e (diff)
tdf#128196: filenames containing # get truncated when saving to GVFS
+ replace getLength() by a call to isEmpty() since we're here Change-Id: I77a318ea3e8ceeeddd6c64cee25aa6700cb3457b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136084 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> (cherry picked from commit 2a38c834c8b7712421f1125aa0e382de70767b55) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136122 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/gio/gio_content.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx
index 52509a361163..ac88a85cc1dd 100644
--- a/ucb/source/ucp/gio/gio_content.cxx
+++ b/ucb/source/ucp/gio/gio_content.cxx
@@ -19,6 +19,7 @@
#include <sal/config.h>
+#include <rtl/uri.hxx>
#include <utility>
#include <string.h>
@@ -1090,8 +1091,13 @@ void Content::transfer( const css::ucb::TransferInfo& aTransferInfo, const css::
if (!sDest.endsWith("/")) {
sDest += "/";
}
- if (aTransferInfo.NewTitle.getLength())
- sDest += aTransferInfo.NewTitle;
+ if (!aTransferInfo.NewTitle.isEmpty())
+ {
+ sDest += rtl::Uri::encode( aTransferInfo.NewTitle,
+ rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 );
+ }
else
sDest += OUString::createFromAscii(g_file_get_basename(getGFile()));