diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2019-11-11 11:49:50 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2019-11-11 15:36:34 +0100 |
commit | ef21e0d527655761b6c307cae89ee5b370de96d4 (patch) | |
tree | bd11d446e817e6d4d3075f27f52b826ee40e5e1f /sw | |
parent | b280c02d584ad403417db0e8840f8ae6de245883 (diff) |
tdf#109219 MM: Decode all percent encodings in file names
While decoding using 'INetURLObject::DecodeMechanism::Unambiguous'
as introduced by commit 47708d533e1325032df55eb667ef0c47fa05e7e5
("tdf#109219 Allow files with spaces in name as MM data source")
makes sure that e.g. spaces in file names are properly decoded,
'INetURLObject::DecodeMechanism::WithCharset' is actually the
more correct decoding mechanism to use here, since it also decodes
some percentage encodings that 'INetURLObject::DecodeMechanism::Unambiguous'
would leave unchanged.
Using 'INetURLObject::DecodeMechanism::WithCharset' instead
e.g. makes CSV files with '%' characters in their names work
as data sources for mail merge as well.
A big thanks to Stephan Bergmann for pointing this out in
https://gerrit.libreoffice.org/#/c/82201/ .
Change-Id: Iee50584299c82d5718e3210f048ed739818bd11b
Reviewed-on: https://gerrit.libreoffice.org/82428
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/dbui/dbmgr.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index d3e29c4eaad1..8d11292d9e52 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -2719,7 +2719,7 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType type, const uno::Reference case DBConnURIType::FLAT: case DBConnURIType::DBASE: //set the filter to the file name without extension - aFilters[0] = rURL.getBase(INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::Unambiguous); + aFilters[0] = rURL.getBase(INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset); aTableFilterAny <<= aFilters; break; case DBConnURIType::MSJET: |