summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-24 09:35:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-24 11:27:39 +0100
commit15bc492281111997a5da556961b923bb607642b6 (patch)
treed0f60a5499e8a3eec4646cc3c71ffb48af825414 /tools
parentac5d7288ce9ec08e3bfda3c4803ce736c1527568 (diff)
tdf#146382 cant open file from Explorer-attached remote location
problem spotted by mikekaganski regression from commit 0b46361ef84a61100a0274a007062317607d097a Author: Noel Grandin <noel@peralex.com> Date: Sat Nov 20 08:03:49 2021 +0200 tdf#133835 speedup calc autofilter (4) where I changed the behaviour of parseHostOrNetBiosName from overwriting the destination buffer to appending to it. Change-Id: I1bd3c7eade035a867c026364f5e114c1e652ca32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127352 Tested-by: Gabor Kelemen <kelemeng@ubuntu.com> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/qa/cppunit/test_urlobj.cxx9
-rw-r--r--tools/source/fsys/urlobj.cxx3
2 files changed, 12 insertions, 0 deletions
diff --git a/tools/qa/cppunit/test_urlobj.cxx b/tools/qa/cppunit/test_urlobj.cxx
index a335701c5cab..ec64b5d66777 100644
--- a/tools/qa/cppunit/test_urlobj.cxx
+++ b/tools/qa/cppunit/test_urlobj.cxx
@@ -311,6 +311,14 @@ namespace tools_urlobj
obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
}
+ void testTd146382() {
+ INetURLObject obj("file://share.allotropia.de@SSL/DavWWWRoot/remote.php");
+ CPPUNIT_ASSERT(!obj.HasError());
+ CPPUNIT_ASSERT_EQUAL(
+ OUString("file://share.allotropia.de@SSL/DavWWWRoot/remote.php"),
+ obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+ }
+
// Change the following lines only, if you add, remove or rename
// member functions of the current class,
// because these macros are need by auto register mechanism.
@@ -326,6 +334,7 @@ namespace tools_urlobj
CPPUNIT_TEST( testSetName );
CPPUNIT_TEST( testSetExtension );
CPPUNIT_TEST( testChangeScheme );
+ CPPUNIT_TEST( testTd146382 );
CPPUNIT_TEST_SUITE_END( );
}; // class createPool
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 8c3d2845eab2..7b86fe0f5261 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -2880,7 +2880,10 @@ bool INetURLObject::parseHostOrNetBiosName(
}
}
if (pCanonic)
+ {
+ pCanonic->setLength(nOriginalCanonicLength);
pCanonic->append(buf);
+ }
}
else
{