diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2022-06-18 15:14:33 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2022-06-19 20:42:43 +0200 |
commit | 2a38c834c8b7712421f1125aa0e382de70767b55 (patch) | |
tree | 47d8aaa66e42516390a3a5aa5efe4fca66183ac9 /ucb | |
parent | 6cbe52d4e90a21495ea20a82e31afb2b19d13377 (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
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/gio/gio_content.cxx | 10 |
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 44037217882b..fc31965a990f 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())); |