summaryrefslogtreecommitdiff
path: root/ucb/source
AgeCommit message (Collapse)AuthorFilesLines
2023-04-09new loplugin:unnecessarygetstrNoel Grandin1-4/+2
which prevents constructing unnecessary temporaries via getStr() Change-Id: I9ca70893a10e954b5ee0e6ad6098660ee24c2bef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150170 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-09use more OUStringToOStringNoel Grandin2-11/+11
which makes it easier to pass around string_view in a few places. Change-Id: Icbbb7f56494986582f1c3272404775bd98031240 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150129 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-03Optimize a bitMike Kaganski1-5/+5
Change-Id: I5a2c37e4ff1e19cfbc29e1e61b025f44d067b95a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149893 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-30loplugin:stringadd in ucbNoel Grandin11-61/+28
when applying my upcoming patch to also consider O[U]StringBuffer Change-Id: I2445a69dc46314c73f54c190a0c498c0309be06b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149750 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-18loplugin:stringadd use more O[U]StringCharNoel Grandin1-12/+6
Change-Id: I196e4539ad430a39415eff9d7170b33df7228230 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149062 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-10improve loplugin:unnecessarylockingNoel Grandin1-2/+0
to find more locking we can remove Change-Id: Ief7bc5ec2a1ff31f22a0ad366910b7fcc4725818 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148599 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-06clang-tidy dead-storeNoel Grandin1-3/+0
Change-Id: I842114880c43dfcc342b6255b7d17befb905bccb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148345 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-24tdf#153642 ucb: fix broken save with cached DAVOptionsLászló Németh1-0/+5
Trying to save a document within the lifetime of the cached connection, e.g. re-save within a few seconds after the first and successful save failed with an error message in the case of Vibe 4.0.6 WebDAV server. Waiting 5-10 seconds after the last try was the only workaround to re-save the document. Details: aDAVOptionsException in Content::getPropertyValues() removed the isClass1 bit of the cached DAVOptions of the same TargetURL (note: of the folder of the WebDAV document). This disabled the DAV detection part of Content::getResourceType(), and later the correct HTTP redirect for the DAV connection. Fix this by keeping the cached bit in that case, too, when the added connection has a different lifetime, than the cached one. Follow-up to commit 30ca48f4dc0e65a3798e6b21574bc80f6d4953fa "tdf#152493 ucb WebDAV: fix upload using HTTP 1.0 fallback". Change-Id: I5d4578232581a4df654f76198fdddf096cba5267 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147570 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2023-02-17osl::Mutex->std::mutex in SortedDynamicResultSetListenerNoel Grandin2-4/+4
Change-Id: I70b20a616cb84c5c066431be50359def5d041b3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147188 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-17osl::Mutex->std::mutex in SortedDynamicResultSetNoel Grandin2-31/+19
Change-Id: I21b98831645e2d7942bdf630225c136f9af3dca3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147189 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-16osl::Mutex->std::mutex in TaskManagerNoel Grandin2-34/+46
Change-Id: I1ab5183cff5eaed9e3c0821115c7f89850d3b482 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147160 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-16osl::Mutex->std::mutex in ResultSetDataSupplierNoel Grandin2-22/+43
Change-Id: I75cbf133e2e632c41759515fdf8894faed599c8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147159 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-16osl::Mutex->std::mutex in ucb::ucp::ext::DataSupplierNoel Grandin2-8/+9
Change-Id: Id195c7cb676d4c7e0741adeb31f4b1a9854e8230 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147100 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-15no need to use unique_ptr for OMultiTypeInterfaceContainerHelperVar4Noel Grandin4-69/+37
it has an empty size of two words, so it saves very little memory to use unique_ptr. Change-Id: I2958a83c41929dec3d33db27f084dafec385d74d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147014 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-14no need to use unique_ptr for OInterfaceContainerHelper4Noel Grandin6-55/+26
it has an empty size of one pointer, so it saves no memory to use unique_ptr. Need to fix the const-ness of some methods in OInterfaceContainerHelper4 Change-Id: I0c0c28a228ccfe0e97174fbc83555059fc351b3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147007 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-14osl::Mutex->std::mutex in SortedResultSetNoel Grandin2-101/+75
Change-Id: Id55c139cfcc55e18811fd79e402a78b123f37394 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147015 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-14fix locking in PersistentPropertySetNoel Grandin2-21/+15
after commit 756185b5795c95180d32d02abfbd65951779b40e Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Mon Feb 13 09:06:02 2023 +0200 osl::Mutex->std::mutex in PersistentPropertySet Change-Id: Ie52432ea1566b840bd88692f00f4753eea7896f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146998 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-13osl::Mutex->std::mutex in ContentResultSetWrapperNoel Grandin6-594/+519
Change-Id: I8d015bf1435c6b3becd40ffd9056b9906a6dd19b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146938 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-13osl::Mutex->std::mutex in DynamicResultSetWrapperNoel Grandin4-39/+33
Change-Id: I218460fac22e65f583a545d41720b0301b67c502 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146937 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-13Fix the buildStephan Bergmann1-2/+2
...after 756185b5795c95180d32d02abfbd65951779b40e "osl::Mutex->std::mutex in PersistentPropertySet" caused > ucb/source/core/ucbstore.cxx:1913:75: error: too few arguments to function call, expected 2, have 1 > m_pPropertyChangeListeners->getContainer( rEvent.PropertyName ); > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ > include/comphelper/multiinterfacecontainer4.hxx:71:50: note: 'getContainer' declared here > inline OInterfaceContainerHelper4<listener>* getContainer(std::unique_lock<std::mutex>& rGuard, > ^ > ucb/source/core/ucbstore.cxx:1921:66: error: too few arguments to function call, expected 2, have 1 > m_pPropertyChangeListeners->getContainer( OUString() ); > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ > include/comphelper/multiinterfacecontainer4.hxx:71:50: note: 'getContainer' declared here > inline OInterfaceContainerHelper4<listener>* getContainer(std::unique_lock<std::mutex>& rGuard, ^ Change-Id: Ie13c7bf17d066607ec7095b3e45ab7d6ecea1cb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146940 Tested-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-13osl::Mutex->std::mutex in DynamicResultSetWrapperListenerNoel Grandin2-5/+5
Change-Id: Ie8673462fac30132f4e6b3cf7792d8554bf4f14a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146901 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-13osl::Mutex->std::mutex in PropertySetRegistryNoel Grandin2-142/+146
Change-Id: I08a059998cb13f12ad6183ee54754525386dfcd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146853 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-13osl::Mutex->std::mutex in PersistentPropertySetNoel Grandin2-58/+74
Change-Id: If88ac207083a928e2315e2ec1c7ac40951fb2a6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146851 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-13Fix/simplify some vnd.sun.star.expand: handlingMike Kaganski1-8/+3
The vnd.sun.star.expand: payload must be URL-decoded prior to passing it to expandMacros; the protocol must be checked case-insensitively. Use startsWithIgnoreAsciiCase for that. Change-Id: I2be993a0400a27cb7dc57207cd0824b4505afd2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146855 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-30tdf#152493 ucb WebDAV: fix upload using HTTP 1.0 fallbackLászló Németh2-0/+25
Fix broken libcurl upload to Vibe 4.0.6 WebDAV server using HTTP 1.0 fallback. Regression from commit 023ebf17898db4bca63129f079fd90b5cf76c1a9 "ucb: remove --with-webdav=neon" (Neon had no such upload problem). HTTP 1.0 fallback found by Pál Zoltán Kochis. Fallback for CURLE_UNSUPPORTED_PROTOCOL suggested by Michael Stahl. Thanks for their and Attila Bakos' help. Michael Stahl's comment: "'HTTP/0.9' in the [curl] error message is very misleading: it simply means that a header was expected but there was no header, so what is received is interpreted as body. Note: the HTTP/1.0 works because it does not use the 'Expect: 100-continue' so there should be no intermediate 100 Continue response from the server at all - instead libcurl directly sends the XML document for the PROPFIND and the server sends the response, and the problem does not occur." Co-authored-by: Michael Stahl <michael.stahl@allotropia.de> Change-Id: I8bd79154de14b6425e0324f4d8f6e64512c08264 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146067 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2023-01-28LOK: Allow image upload from WOPI-like host with self-signed certAndras Timar1-0/+9
Change-Id: I28a7de489b06fd5a993b82bb39274eb6f0c373ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146298 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2023-01-19tdf#153039 ucb: webdav-curl: fix POST, which was actually doing PUTMichael Stahl1-5/+7
The problem is that first CURLOPT_POST was set and later CURLOPT_UPLOAD, which overrides the HTTP method to PUT. Move this out to the 4 functions that need it. Change-Id: Ibd555dcc00a03baa1bb300a9ab9905f383179c67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145786 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-01-15Merge SvXMLAttributeList to comphelper::AttributeListMike Kaganski1-5/+5
And simplify the latter, to always use "CDATA" type (as the former did). "CDATA" was used in all cases but one, where an empty string was used. Change-Id: I1b3bfae40e29628e4094d9a6e58a69a66865874c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145526 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-13XUnoTunnel->dynamic_cast in comphelper::ByteReader and comphelper::ByteWriterNoel Grandin2-12/+1
Change-Id: I1f8c864a939dff1252ba15f517f63b62d1a1e1fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145393 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-09use std::this_thread::sleep_for instead of osl equivalentArnaud VERSINI1-4/+3
Change-Id: I5b4edc5417e5bb5e082688df616e1d5735717d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142357 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-05Revert all the recent loplugin:unocast changesStephan Bergmann3-20/+2
...as obsoleted by ef533553559fe09b4afab651fc692885d1acf4ed "Rudimentary support for dynamic_cast on UNO proxy objects". This reverts all of: 4cfcc9ac37b90ce64c8402a41eb4638adb185b5c "loplugin:unocast (framework::Desktop)" 03efbf72f4ddf7a84aa8aabef348331bd4b75e8a "loplugin:unocast (vclcanvas::TextLayout)" 80099fdd51a69eaa6c36ca88ef772810e4a777fa "loplugin:unocast (SalGtkXWindow)" cc147f576d8687fb79c77d47d41dc4ba1678a469 "loplugin:unocast (sdext::presenter::CachablePresenterView)" 40db42be1d8fd0f9c6c8c5ba3767ddb9ee2034c2 "loplugin:unocast (vclcanvas::CanvasFont)" 2d1e7995eae29e2826449eb5179f5fae181794a5 "loplugin:unocast (CairoColorSpace)" 4c0bbe4bd97636207cf71a6aa120c67698891da9 "loplugin:unocast (canvas::ParametricPolyPolygon)" 89803666621c07d1b1ac9d3bd883f0ca192a91a0 "loplugin:unocast (vclcanas::CanvasBitmap)" d5e0c2c8db71878d21c2a7255af08cf5f9a6dd04 "loplugin:unocast (sfx2::DigitalSignatures)" c0c4519e0d5b555f59bbc04cc616454edfd1f4ce "loplugin:unocast (VCLXAccessibleComponent)" feb8b833a6245d42400f42a0bc789dc84594ee6f "loplugin:unocast (VCLXDialog)" 1fa58cc6cc9c3849753342a5d9a6ddfa461b5e66 "loplugin:unocast (VCLXMultiPage)" f481f036deb1b1b46f3038074c4659f3a91b9c6c "loplugin:unocast (DocumentSettingsSerializer)" 73df933f5fa5932f94e5a1b338a3eda00a9ce354 "loplugin:unocast (css::embed::EmbeddedUpdate)" 420165ab0ef03c0467f9d17f504de2d2fc78f0e6 "loplugin:unocast (canvas::tools' StandardColorSpace, StandardNoAlphaColorSpace)" 9abe8ee067e6c00f19d8a13346d53c4641c27166 "loplugin:unocast (MutableTreeNode)" 9f3022ceb036f23b4b0994c3e2fbd1001bff225a "loplugin:unocast (VCLXTabPage)" 1be70dda02c12a60778b7607cff2520ae1aa611e "loplugin:unocast (vcl::unotools::VclCanvasBitmap)" d6a70bb641b96e8e5616448c2378131ed62658b4 "loplugin:unocast (basegfx::unotools::UnoPolyPolygon)" 5a14f009e6782c077463c8cbb8e9cea3d7950107 "loplugin:unocast (xmlsecurity::Certificate)" 99009c9535dfa3e0d838989ccc7d84bfa2320ff4 "loplugin:unocast (sd::Annotation)" 0c7585c5fa78887e5459885ed744e8044fd76137 "loplugin:unocast (sd::TextApiObject)" 24e14afd1bfcaed6c200ab081973fba7e47267ca "loplugin:unocast (SignatureVerifierImpl)" 1a7ad0c10d286ce9ae2700ceb2fd50eed1fb43a4 "loplugin:unocast (pcr::PropertyEventTranslation)" a97e2d2702d9a6f37775ccee2c08c4f3b2479c4b "loplugin:unocast (RangePageBreaks)" 19dfdf86ad1f5b08041d8b7a9f196caf881231ab "iloplugin:unocast (pcr::OFormattedNumericControl)" f9785ea595fd8e911f6370e836fa579225b9e571 "loplugin:unocast (frm::OInterfaceContainer)" 5e5f40a4a92a31b0932c690219d002fcf18598cf "loplugin:unocast (ScVbaShapes)" 27b35b2c215b4832d4378ec3a7ecbba926552d06 "loplugin:unocast (ScVbaShapeRange)" cb3108f860065928552a86cf8acc4b3a95718ecf "cid#1517812 Dereference null return value" feba0ddb1521d1142560fe54b7d7696ee910237f "loplugin:unocast (weld::TransportAsXWindow)" 4d6c23216559eb48f9943bb49d6e475a6d64ba15 "loplugin:unocast (oox::ForumlaImExportBase)" 4844c096a8ab6a9a620c410a0949d4499f12a504 "loplugin:unocast (cairocanvas::SurfaceProvider)" 9a0b523e0a84d403b9092176ccec4b3e3efe42d0 "loplugin:unocast (cairocanvas::CanvasBitmap)" 8a5648d8e59b4b007dbbf3824777c19a21efc61e "loplugin:unocast (cairocanvas::TextLayout)" 28c27a0623bc78a0590858f97d03b620985bc84c "loplugin:unocast (cairocanvas::CanvasFont)" 53bc223cb3288e32a417696ee61c29e5f01f209d "loplugin:unocast (cairocanvas::RepaintTarget)" 5f70b0b9f6bc4ab145ddbd9155590ed4a3b1b9ec "loplugin:unocast (SvXMLImport)" 068187a898cdd2e26e9b16c348ecc1ed2dee3f29 "loplugin:unocast (VCLXWindow)" 88b4f966202717cd4ad38a30a8eda22c3e69ed35 "loplugin:unocast (sfx2::sidebar::SidebarController)" f1b7a69b280aefe2f1b3b0f32193494fd765f2bd "loplugin:unocast (SvxLineStyleToolBoxControl)" ba76f0ba7e8de4d2953739c952004b7d9af47197 "loplugin:unocast (i18npool::Calendar_gregorian)" 840154daf934d8df52ead1cb7acd798c4d30f007 "loplugin:unocast (framework::AddonsToolBarWrapper)" b0e9c4c5f063cefa9557810e3349bdb9c7493091 "loplugin:unocast (GrammarCheckingIterator)" 8ee6cfc9655ce9de4617cea1a0d9cb9d7a4fbfac "loplugin:unocast (ucb::ucp::ext::Content)" 5b8cd77c112bc8c0e92b8fec215c3c8e802bbc0a "loplugin:unocast (basic::SfxScriptLibraryContainer)" 9e73ff9fce12e102bb3c3cea8d8bb96c88f2c9ad "loplugin:unocast (sdext::presenter::PresenterNotesView)" a98acca8fbc38d3fd5600ae5056a8e42b6d8a40d "loplugin:unocast (SelectionChangeHandler)" c0b59ad6e35b0cb0dea0821e95f95569739078c1 "Consistently use comphelper::getSomethingImpl<I>(aIdentifier, this)" 276e3ccbdd3259ec3daf8a1a98fa7f406b14e21c "loplugin:unocast (vclcanvas::RepaintTarget)" Change-Id: I37c73e3422a5154bf6cb647640d2d3f23db8bc34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145063 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-19loplugin:implinheritancehelper in ucbNoel Grandin4-102/+9
use more ImplInheritanceHelper to reduce boilerplate Change-Id: I3ecc79ac5a1ae7a005845a7f1460e3b5037e6d53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144442 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-14loplugin:unocast (ucb::ucp::ext::Content)Stephan Bergmann3-2/+20
(See the upcoming commit introducing that loplugin:unocast on why such dynamic_casts from UNO types are dangerous.) Change-Id: If35b179b83383d8252a356c5bf43ae6ebb1d63f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144148 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-07loplugin:singlevalfieldsNoel Grandin2-6/+3
Change-Id: Ic7dd2cb433add02ecc72eee0c85dd7f0efe1d47b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143771 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-01loplugin:unusedfields make some fields privateNoel Grandin2-3/+1
Change-Id: Ia30e3b7f10ae11c7a74e6860ac0a6115caaa439f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143529 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-11Drop counterproductive top-level constsStephan Bergmann1-2/+2
...that were apparently left by accident by b4b4c129e9f00189978cd7b71fd74d0dca4c9ebc "clang-tidy modernize-pass-by-value in ucb", thwarting the use of std::move here. (I came across this code with an upcoming loplugin:constmove that flags suspicious uses of std::move involving const-qualified types.) Change-Id: I95867aea623913ed37d57cb7d9593654ec57487d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142564 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-10-26ucb: FTP UCP: report CURLE_URL_MALFORMAT as IllegalIdentifierExceptionMichael Stahl1-0/+15
With curl 7.86, the test JunitTest_ucb_complex starts to fail: .ftp://noname:nopasswd@*nohost.invalid now executing open com.sun.star.ucb.InteractiveAugmentedIOException: at com.sun.proxy.$Proxy15.execute(Unknown Source) at complex.ucb.UCB.executeCommand(UCB.java:63) at complex.ucb.UCB.checkWrongFtpConnection(UCB.java:119) because curl_easy_perform() now returns CURLE_URL_MALFORMAT where previously it was CURLE_COULDNT_RESOLVE_HOST. Map this to an exception the test expects. Change-Id: Ifdb672946726ddb4cb4d9426b7e70eefac63f040 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141877 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-10-18tdf#105609: Support DateModified for updated tdoc stream contentsStephan Bergmann9-1/+90
...so that the Python script provider, based on those DateModified values, will reload a script embedded in a document after that script has (programmatically) been modified. As long as a stream content in a tdoc document has not been modified, it will report a default-initialized (all zero) DateModified. Only when the stream has been modified will that be changed to the current date. While that might not be the most beautiful implementation, it at least gets the job done of fixing tdf#105609 "Python script provider does not reload modified embedded scripts". (The DateModified values cannot be stored directly in the tdoc_ucp::Content instances, as those are thrown away and recreated on demand. So they needed to be stored more persistently at the tdoc_ucp::OfficeDocumentsManager.) Change-Id: Iee809960e1a1bc40961f0df2b3729e58b75e6028 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141491 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-10-11Deduplicate O(U)StringConcatenationMike Kaganski2-2/+2
And use an overloaded helper function with a better (?) unified name to show that the result is not an O(U)String. Change-Id: I8956338b05d02bf46a6185828130ea8ef145d46b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141203 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-09-28use more string_view in ucbNoel Grandin13-59/+65
Change-Id: Id1d35aca0c8f62b3eb03eca9850a3f3c9799df98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140706 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-14cid#1500603 Resource leakCaolán McNamara1-4/+5
don't mix std::unique_ptr and rtl::Reference I don't know why mess around with osl_atomic_increment/osl_atomic_decrement, but at least sync with the pattern in use at ucb/source/ucp/tdoc/tdoc_storage.cxx StorageElementFactory::createStorage Change-Id: I25fc57d8e886bab3990a63543212efa67ac9772f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139811 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-09-13cid#1509290, cid#1509240: Silence "Use of 32-bit time_t (Y2K38_SAFETY)" for nowStephan Bergmann1-0/+2
We'll eventually need to do something about the 32 bit TimeValue::Seconds, but as it is unsigned we should be fine for another 80 years (until "06:28:15 UTC on Sunday, 7 February 2106", according to <https://en.wikipedia.org/wiki/Year_2038_problem#Solutions>). Change-Id: I74e680be0b2f0ef8cd84d6bc0faef436efc8d3cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139859 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann14-14/+14
...so that its TOOLS_WARN_EXCEPTION can be used in comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it, rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The comphelper module is sufficiently low-level for this immediate use case, so use that at least for now; o3tl might be even more suitable but doesn't have a Library until now. Also, for the immediate use case it would have sufficed to only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION, TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of include/tools/diagnose_ex.h into an additional new include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move the complete include file as is.) Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-18loplugin:moveitNoel Grandin4-5/+5
Change-Id: I34de7408553e4ca702cab9aa611c03dc60b9b6a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138472 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-15tdf#149921 ucb: webdav-curl: WNT: certificate revocation checkMichael Stahl1-1/+10
- don't require it to be successful. Trying to connect to a server with self-signed CA results in: warn:ucb.ucp.webdav.curl:6796:6568:ucb/source/ucp/webdav-curl/CurlSession.cxx:946: curl_easy_perform failed: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate. Apparently schannel wants to check by default (called with SCH_CRED_REVOCATION_CHECK_CHAIN) that all the certificates aren't revoked, but the self-signed CA doesn't specify how to check. Set it to only check revocation when the way to do so actually works, via CURLSSLOPT_REVOKE_BEST_EFFORT, which sets these flags: SCH_CRED_IGNORE_NO_REVOCATION_CHECK | SCH_CRED_IGNORE_REVOCATION_OFFLINE | SCH_CRED_REVOCATION_CHECK_CHAIN Change-Id: I6d77ca23fe2012d8a5d65000b14775070b5c9a0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138204 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-08-04cid#1507745 return localNoel Grandin1-2/+2
regression from commit b4b4c129e9f00189978cd7b71fd74d0dca4c9ebc Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Mon Aug 1 09:09:05 2022 +0200 clang-tidy modernize-pass-by-value in ucb Change-Id: Ie5d7d78ebde6fdee1234a0da496ff9692ee3c2c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137796 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-01clang-tidy modernize-pass-by-value in ucbNoel Grandin83-216/+269
Change-Id: I641d05e360c3208845a2fa6721ac8ba1ad0f3309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137667 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-20elide some makeStringAndClear() callsNoel Grandin4-4/+4
Change-Id: Id1657c6b9399780c81e8fbf0ff0a71371a66600f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136185 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-19tdf#128196: filenames containing # get truncated when saving to GVFSJulien Nabet1-2/+8
+ 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>
2022-06-10new loplugin:moveitNoel Grandin1-1/+1
look for local variables that can be std::move'd to parameters off by default, since it doesn't do proper data flow analysis Change-Id: I3403a0fcffd165bdea6a772528bc53995c5fdb40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>