summaryrefslogtreecommitdiff
path: root/ucb
AgeCommit message (Collapse)Author
2021-11-01ucb: webdav-curl: implement DAVResourceAccess::OPTIONS()Michael Stahl
This is just a copy of DAVResourceAccess::PROPFIND() and trivially adapting 4 lines to call DAVSession::OPTIONS() with required arguments. Change-Id: If2ac8e4a465d0f09b7cf02647ac4c8e4860c45b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123284 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: implement OPTIONS()Michael Stahl
Change-Id: I601a161c3e6c4b7e741a79bfd15510bb40b5d81c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123283 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#101094 (1) OPTIONS: New class to store retrieved OPTIONSGiuseppe Castagno
This class describes the DAV options useful to LO. Added behavioural unit tests as well. [ port of commit f950b49393ee6539f2a7b3c306aa4fc119f24a84 ] Change-Id: Idfcd66229a2bbbdf4452da731a5b921527447358 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123282 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: loplugin:unusedfields in ucb/Michael Stahl
[ replicate commit 00bb8141beee7088625992a046e94c6f8da8da83 ] Change-Id: I8144eca6b27fda799a8e875b568a3bcf6b974d96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123281 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: In case of Web site access, add Content-Type to HEAD request.Giuseppe Castagno
This remove a necessity for another HEAD request when MediaType is requested while accessing a Web site, a cleaner implementation of d61352f58a7f750d3b0b0a9c2d6498fbb7a6e10d. This behavior is active only on a standard Web site, when PROPFIND failed earlier on the program flow, without retrieving the property DAV:getcontenttype. [ port of commit 9325c18044a8adc852e2d1b42a5a479ab6195da8 ] Change-Id: Iebdae815d096be8ef45b969d7c4d84acc26694b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123280 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: loplugin:unuseddefaultparam in ucbNoel Grandin
[ port of commit 83911dd753fbfd0328bae2dfa37d19f514d4b2f9 ] Change-Id: I5a57b7af9cd231e89fc93cc1a5f277cae23a1427 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123279 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Related tdf#95217: Force HEAD method in Web access if ↵Giuseppe Castagno
PROPFIND failed [ port of commit d61352f58a7f750d3b0b0a9c2d6498fbb7a6e10d ] Change-Id: Id945be7a1f71c830f3ab15c54fbf65a32be71a2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123278 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Related tdf#95217: Http header names are case insensitiveGiuseppe Castagno
[ port of commit e973b342826e54f147251b132c3325d30749e312 ] Change-Id: I7473625894c023c526a8ffeccd7ec6d67629ff76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123277 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Related tdf#90700 Add configuration for web connection ↵Giuseppe Castagno
timeout. Currently the connection timeout is governed by operating system default. LO timeouts will be used in place of the TCP socket operating system ones, only in operating system where this is currently possible. The timeouts to use can be changed in LO configuration: 'Tools > Options > Advanced > Expert Configuration'. Propriety names are ConnectTimeout and ReadTimeout. ConnectTimeout contains the timeout (in seconds) used when making a connection (max 180 s, min 2 s, default 20 s). ReadTimeout contains the timeout (in seconds) used when reading from a socket (max 180 s, min 20 s, default 60 s). [ port of commit 14220052ef2b8675ee12aad63b0402f023d9760a omitting Session change which isn't directly possible ] Change-Id: I276851958f587346a36ee5f173b3e4fb88a944b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123276 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#95792: fix saving file the first time on some WebDAV ↵Giuseppe Castagno
servers. Some WebDAV servers don't implement section 7.3 of RFC4918: <http://tools.ietf.org/html/rfc4918#section-7.3> This lack of implementation breaks 'Save As...' functionality when the target is a WebDAV server, by not locking the URL ('reserve the name for use', in RFC4918 parlance). The server not implementing this usually answers with one of '405 Method Not Allowed', '501 Not Implemented' or '412 Precondition Failed' http error codes. The fix should manage this lack of implementation. [ port of commit 4c82edfb3a9286a0bfef3f006e468e5c331987eb ] Change-Id: I343368bb91bdffff143aa26d8449b48f3b5300d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123275 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Fix tdf#90700 Notify connect timeout early.Giuseppe Castagno
Throws exception to manage timeout early in the first connection sequence. [ port of commit 95958755cbbf8c6026b878703400d5d9ec1e6c98 ] Change-Id: Ib6d306100ab04a3a21c37108d5c88185acf2524a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123274 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Add/change some logs in WebDAV ucb.ucp layer.Michael Stahl
[ replicate commit dd9c15b36f69bec4d4fc9b0049f7e496e5eb9e9d ] Change-Id: I9eb87ea7216c83ce1ac63f65dd96ebe6760a50a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123273 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#83531 Opening WebDAV URL WebDav fails if write is ↵Giuseppe Castagno
restricted Happened because LOCK method was not allowed without credentials. [ port of commit 0326352470aee1a774bb5aa314c4f3625c1372b3 ] Change-Id: Id94b96856737e50715c2a18427ba22c3776a8da9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123272 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#82744: fix WebDAV lock/unlock behaviour - part 3Giuseppe Castagno
Changes done to the code in sfx2, ucbhelper, ucb, unotools in no particular order - add method helpers to call the ucb lock/unlock - add lock/unlock 'real' management - make DateChange property retrieval working for WebDAV as well - add check for changed content of a WebDAV file, in order to reload it correctly when 'Edit Mode' command is activated from GUI - Unlock WebDAV file while saving only if explicitly enabled Needed in order to avoid the small window of file unlocked state that opens while saving a file. When saving LO actually does as follows: - unlock the prevoius version of the file - prepares operations to save the modified version - lock the new file - save the new version - the lock method is enabled if the DAV resource supports it. In case the lock is not supported, for example example DAV with lock disabled, the lock method is disabled. Exception: when the resource is first created and the lock is not supported: a lock command is sent anyway, because if the resource is not yet present, there is no method to detect the lock/unlock availability in this case. - cppcheck:noExplicitConstructor [ port of commit b4576f3da4d90139fc5140962d13cb91dab98797 excluding the obsolete FTP scheme thing ] Change-Id: I16bb4e2fa9899fd31af7c223390f3fb213330fa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123228 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Remove redundant comparisons, copy properties unconditionallyMichael Stahl
[ replicate commit 39bbfa61653ba7c3cca0aed739559914c78edc89 ] Change-Id: I28730c1fc7f6808bf9657855cf1d65369b695c4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123227 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: tdf#82744: fix WebDAV lock/unlock behaviour - part 1Giuseppe Castagno
There are some areas in ucb outside the issue scope that should later be addressed, among them: - in ucb/webdav make flag m_bTransient working right, currently lock option for WebDAV server not supporting it is suboptimal: there are not needed lock requests; - change the method the modified file is checked against the old one, using DAV:etag instead of the DateTime; - some http status code returned by the server don't seem to be managed; - during WebDAV operation some redundant request of properties is carried out. Probably some clean up to remove these not needed transactions is to be done. Accessing only those really supported by the referenced href would be better. Changes done to the code in ucb, in no particular order - remove current WebDAV lock management - have the lock/unlock working correctly when the webdav resource is first created: in the case of creation is the first lock on the non existent resource that actually creates it - fix a problem while fetching WebDAV properties. If a single WebDAV non-cached property was requested, it would not be fetched from the server without this fix. - change the lock owner name. This should probably be different. Something to be discussed. This same string can be read by all the applications accessing the lock. Spec reference is: RFC4918 [2007]: '14.17. owner XML Element' link (as of 20150713): http://tools.ietf.org/html/rfc4918#section-14.17 - manage WebDAV locked file exception directly while locking. The ucb::InteractiveLockingLockedException is thrown directly when detected by the lock command, to avoid the user interaction activated by the cancelCommandExecution method. - terminate gracefully if WebDAV lock/unlock is not supported [ port of commit 26e6d4b05ab444e6a7529ffcac7fbe592fc94833 ] Change-Id: I0a4c926dc1e32cc620ad6e9acfc9c9c56928fa49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123226 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: remove unused LOCK() overloadMichael Stahl
Removed from neon in commit 9d7727737b067c5228f129737046f718d5965659 Change-Id: I1df14d8e05e50a6a0ce7af4f6079f11be6628903 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123225 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: NeonLockStore::stopTicker(): really avoid deadlockMichael Stahl
Follow up on 68ba2785c55eaa1ea70ce135bdad5322b0e04ed7, which missed the sad fact that m_aMutex is locked recursively. Avoid that by passing a ClearableMutexGuard to stopTicker() and unlocking that. Also lock m_aMutex in the destructor while at it. [ port of commit 13b60fd80a7adfb0ef81a818917cfec5edfc6edc ] Change-Id: I65bb4ec98f13d28089c3b2eb3300074944024188 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123181 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: NeonLockStore::stopTicker(): avoid deadlockMichael Stahl
Tor reports that NeonLockStore::stopTicker() m_pTickerThread->join() can deadlock with TickerThread running NeonLockStore::refreshLocks(). This can be avoided by copying m_pTickerThread to the stack, and releasing the m_aMutex before calling join(). [ port of commit 68ba2785c55eaa1ea70ce135bdad5322b0e04ed7 ] Change-Id: I6d2d993fd5315f27e6559a1e9034e961303fe894 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123180 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: adjust some trivialities to match...Michael Stahl
... commit 0c3500115c4fd86284a027fc32be704afcf77061 - turned out there wasn't a substantive difference to the existing code after all, except for the FTP URL scheme check, which i don't miss. Change-Id: Ie24988a4117445cf729515958dea88d17627859a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123179 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: use std::unqiue_ptr in ResultListMichael Stahl
This reimplements commit 7ff650a6fe405c98d182c6cabbb46217b56bb0c6 and commit fc90cf2af58dc8d551c39ba37d3a44597aa11e44. Change-Id: I517ce2a4eeda75c25b7a7f7debee8904b454a144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123178 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: fix exception in Content::queryInterface()Michael Stahl
This was refactored in webdav-neon by commit c2ca6fabd1afc3fc07001721c2069d3c8db7000a but it turns out that here the m_xSMgr doesn't exist anyway since commit 317b5bdadebc5560d38da4c9dd6d68c64a93b9a8 so just use m_xContext. Change-Id: I5c190d6e562ddd095fd6f8c8400ee4a7b7d5a5a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123177 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: add documentation from "rhbz#678440: Always ...Michael Stahl
... include User-Agent to avoid 403 from picky servers", commit 4d0e3127ed2def7212bc05aa860cd06704bb1efe. Change-Id: Ie20def64b7fd1a4f523db84f42d83037bbf88856 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123176 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: Adapted TickerThread to safer-to-use salhelper::ThreadStephan Bergmann
[ port of commit f7afe3b7b07800d130b4d9102f2a94ccac0ebc52 and c58882fda80b63baac3360001b0fdf251d96e0eb "fix msvc2005 build" ] Change-Id: I7173a99aaebd01535971d25350d00923c6607c5e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123175 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: add OpenCommandArg3 "KeepAlive" supportMichael Stahl
This is based on the following commits, which conflict everywhere, except the code in CurlSession.* is new. commit 09954fc863c8ee900f157cab4458e1dcf51493d3 Author: Thorsten Behrens <tbehrens@suse.com> AuthorDate: Tue Jan 17 04:59:56 2012 +0100 Fix UpdateCheck clog up server by keeping connection alive The update check protocol uses the webdav ucp, which uses neon, which in turn defaults to keeping the connection alive. this is nice for webdav, but disastrous for millions of clients phoning home to the same server. Using neon directly in updatefeed.cxx is not an option, due to the thread safety problems around that (see e.g. rhbz#544619) - so we had to extend it to accept connection options, and reuse the existing webdav provider. commit 29bd62fdc2792e215999e9dd0ec9a4bf1102201d Author: Thorsten Behrens <tbehrens@suse.com> AuthorDate: Tue Jan 17 11:41:14 2012 +0100 Switch flag sequence of OpenCommandArg3 to NamedValue. Based on feedback for 09954fc863c8ee900f157cab4458e1dcf51493d3, using the less-bulky NamedValue type instead of PropertyValue. Change-Id: I48e07dd4c3f189eb4445ed95a67011131d7b49f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123174 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: callcatcher: remove unused methodsMichael Stahl
[ replicate commit af6752b88e34df05449a4237d9be0fac509c227c ] Change-Id: I608798e95297642fe768d7ad66d524f084fa83d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123172 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: catch exception by constant referenceMichael Stahl
[ replicate commit e4ce7225dd987f9b2f250f055d9688de79931444 ] Change-Id: I9727af7b85a7f4c0a821a41856d72644b306ba29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123173 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: fix init of SimpleAuthenticationRequestMichael Stahl
The parameter was removed in c158c00489d35af7f5f9278b8ee545678d6a42e5 so "true" was erroneously passed as bCanUseSystemCredentials. Change-Id: I98d3b554a787c7200337735d5fde13b7db43a832 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123121 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: handle additional HTTP status codesMichael Stahl
Refactor a little to prevent recursive calls of ProcessRequest(), to ensure the libcurl options set by the previous call are reset before the following call. Change-Id: Iba2ff695385c554058ac5a743c204224ca09ac57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124059 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: try to prevent acquiring a lock that we already haveMichael Stahl
This was done for webdav-neon in commit b4576f3da4d90139fc5140962d13cb91dab98797 but without checking that the requested lock isn't "stronger" than the one that was already acquired. This is currently not a problem because there is only one caller of LOCK() and it passes a hard-coded ucb::Lock argument, but not sure if that would change in the future, so try to check for it. Change-Id: I7a703197208979c330212288c323877a326dd7de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123229 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: implement CurlSessionMichael Stahl
Change-Id: Ib99ccc517f36db1bf98900a79685d510f2940e5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122269 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: add CurlSession boilerplateMichael Stahl
Amazingly it even builds, with warnings. Change-Id: I1f89a8a7de0c37a8908f530d46e275282cdc33de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122047 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: implement CurlUri, partially based on SerfUriMichael Stahl
The curl_url* functions exist since 7.62.0 and CURLOPT_CURLU since 7.63.0. Change-Id: I8bc766221636eb3ff0d33ae5a90d00c1bc7ecd7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122046 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: copy SerfLockStore class to webdav-curlMichael Stahl
Change-Id: If7b12af542a369c0179ff3460f64ece61a63c1ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122891 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: webdav-curl: fix [loplugin:*]Michael Stahl
Change-Id: I357f8594a404eb17a0126359bdc5b2b4c6543de6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122045 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01ucb: copy upper level code of serf webdav ucp to webdav-curlMichael Stahl
Change-Id: Ia621e504d234d0904b40c7cd9aba49849c2ee859 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122044 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-01Prepare for removal of non-const operator[] from Sequence in ucbMike Kaganski
Change-Id: I16f3de8398323a308e20d04643a11dd9c3ec59f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124404 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-19Related: tdf#145169 missing path separator in gio create folderCaolán McNamara
Change-Id: I7fa98e05261b6c1ff7c053b5f563ea97bd67ed00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123800 Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Justin Luth <justin_luth@sil.org>
2021-10-19Related: tdf#145169 use of freed pointer in gio create folderCaolán McNamara
Change-Id: Ia5afdfb545791e143b8d34193de95e30b8f054b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123799 Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-19Related: tdf#145169 append null on unknown propertyCaolán McNamara
otherwise the next known property will appear at the skipped unknown property, resulting in "true" for IsHidden getting used as "TargetURL" Change-Id: I0797db9eab94c175b5cc32c66051a1aa35be99c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123804 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Caolán McNamara <caolanm@redhat.com>
2021-10-19related tdf#145190 gio_mount: show username when requesting passwordJustin Luth
It is always nice to know WHICH password you are being asked for. When a remote open/save service exists (without a saved password) then the password request immediately pops up and nowhere is there any indication which service / username the password is for. This still doesn't indicate which hostname/service this is for, but better than nothing at all. To avoid causing any regressions, this was done only when a username was explicitly passed along. In the case where a previous password was guessed, that is kept as _NA. [aMessage provides "Enter password for <user> on <host>" but that duplicates the label "Enter user name and password for:". So we don't seem to have much to work with here.] Change-Id: I0991c76ed1ce625ef354009fb416f1058cbeb313 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123746 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-16Simplify vector initialization in ucbJulien Nabet
Change-Id: I4b03ab81a17efc125bc5e3b159cf212198c43d22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123707 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14use std::vector::insert instead of push_backNoel Grandin
because it will pre-allocate space and often is optimised to memcpy Change-Id: I03ed7915f2762d3d27e378638052a47a28bbf096 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123588 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-14Finish merging two identical conditional branchesMike Kaganski
The code in the branches used to do different things before commit 26e6d4b05ab444e6a7529ffcac7fbe592fc94833, which technically made aProperties a copy of rProperties in both cases, only in one case there were some checks that didn't affect the end result. This was progressively cleaned up in commits e06afb0c9546ddcde1cedd75f59001396ac6fdf2 and 39bbfa61653ba7c3cca0aed739559914c78edc89, and this one drops the last redundant bit. The only question that remains is: did the initial change actually intend this result? Change-Id: Id26d50f7f7bdfed3bfb436e0c8bbbf6b3a0dbf98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123524 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski
The scenarios are: 1. Calling sequence's begin() and end() in pairs to pass to algorithms (both calls use getArray(), which does the COW checks) 2. In addition to #1, calling end() again when checking result of find algorithms, and/or begin() to calculate result's distance 3. Using non-const sequences in range-based for loops, which internally do #1 4. Assigning sequence to another sequence variable, and then modifying one of them In many cases, the sequences could be made const, or treated as const for the purposes of the algorithms (using std::as_const, std::cbegin, and std::cend). Where algorithm modifies the sequence, it was changed to only call getArray() once. For that, css::uno::toNonConstRange was introduced, which returns a struct (sublclass of std::pair) with two iterators [begin, end], that are calculated using one call to begin() and one call to getLength(). To handle #4, css::uno::Sequence::swap was introduced, that swaps the internal pointer to uno_Sequence. So when a local Sequence variable should be assigned to another variable, and the latter will be modified further, it's now possible to use swap instead, so the two sequences are kept independent. The modified places were found by temporarily removing non-const end(). Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-11In O[U]StringBuffer, make string_view params replacements for OUString onesStephan Bergmann
...for LIBO_INTERNAL_ONLY, instead of having them as additional overloads. That way, loplugin:bufferadd and loplugin:stringviewparam found many further opportunities for simplification (all addressed here). Some notes: * There is no longer an implicit conversion from O[U]String to O[U]StringBuffer (as that goes via user-defined conversions through string_view now), which was most noticeable in copy initializations like OStringBuffer buf = someStr; that had to be changed to direct initialization, OStringBuffer buf(someStr); But then again, it wasn't too many places that were affected and I think we can live with that. * I made the O[U]StringBuffer ctors taking string_view non-explicit, mainly to get them in line with their counterparts taking O[U]String. * I added an OUStringBuffer::lastIndexOf string_view overload that was missing (relative to OUStringBuffer::indexOf). * loplugin:stringconstant needed some addition to keep the compilerplugins/clang/test/stringconstant.cxx checks related to OStringBuffer::append and OStringBuffer::insert working. * loplugin:stringviewparam no longer needs the special O[U]StringBuffer-related code that had been introduced in 1250aecd71fabde4dba990bfceb61bbe8e06b8ea "loplugin:stringviewparam extend to new.." Change-Id: Ib1bb8c4632d99b744e742605a9fef6eae959fd72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122904 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-11loplugin:moveparam in ucbNoel Grandin
Change-Id: I61a7910f3ef15b251b1763b7c56848ccbb22fe91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123352 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-06loplugin:moveparam in ucbhelperNoel Grandin
Change-Id: I1b9cc0366fb8e9b2525a56816ae4f76737a31b73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123184 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-06loplugin:moveparam in connectivityNoel Grandin
Change-Id: Iaf3a64effb69fd82c6303d8fa75723ccc5ced543 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123183 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>