summaryrefslogtreecommitdiff
path: root/package/inc
AgeCommit message (Collapse)Author
2023-05-20loplugin:unusedmethodsNoel Grandin
Change-Id: Ief95f111350808f010539bb733a553007d30a9df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152006 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-25expose recovering zips for testingCaolán McNamara
Change-Id: I4709a2fb0bbb0fcc4c7d57dad53c899e7ba79cb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150971 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-03-20Missing includes (for std::exception_ptr)Stephan Bergmann
Change-Id: If93883ba9feb22e6da2d56af4ebb2f4eafe58de1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149162 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-03-08tdf#82984 tdf#94915 zip64 support (import + export)Attila Szűcs
Implemented import + export for "Zip64 Extended Information Extra Field", (in "Local file header" and "Central directory file header") and for Data descriptor. Focused only to be able to handle files with over 4GB uncompressed size, in the zip archive. The 64k filecount, and the 4GB compressed size limit is probably still present Tried to follow pkware .ZIP File Format Specification, Some cases were not clear to me and/or some zip compressing tool may not perfectly follow the standard, like 'extra field' should be 28 bytes long, but its reader now can read shorter (or longer) 'extra field'. Replaced some 32bit codes with 64bit codes, in stream handling, in deflater. Tested with an ods file that contained a content.xml that bigger then 4BG+ (import + export + reimport) on windows. I think 4GB+ files import/export would be too slow fot unittest. So, for unit test, used the small but zip64 format files, that was attached to the bugzilla tickets Note: It helps with Bug 128244 too (1 of the unittest tests it), but that ods file missing manifest.xml, so LO won't be able to import it. Change-Id: Idfeb90594388fd34ae719677f5d268ca9a484fb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147306 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2023-01-17XUnoTunnel->dynamic_cast in ZipPackageEntryNoel Grandin
Change-Id: I0c49ebcb0ed16ab5b90c0cfa1417f002b5dad7b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145632 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-17XUnoTunnel->dynamic_cast in ZipPackageNoel Grandin
Change-Id: I4ecfbb0e90cca7e81556fb27fd552669bed0405c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145631 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-21tdf#133767 new service TempFileFastServiceNoel Grandin
to use in places where we know we can use the TempFileFast mechanism. Speeds up export to EPUB from 43s to 17s on my windows machine. This is essentially a copy of OTempFileService, but it does not implement XTempFile (because these temp files have no name on Windows). Also remove a couple of calls to Flush() (which is not necessary now), and TellEnd(), which is a little slow on Windows. Change-Id: Iced300bf8121eae08c7a011d62ec68b93330d84c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141598 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-27use more string_view in packageNoel Grandin
Change-Id: Ia38b2784222701d669f244523ce9a27c4068c5ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140639 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann
...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-06-23clang-tidy modernize-pass-by-value in packageNoel Grandin
Change-Id: Id12d7b38d278c9fb18b30c6d921713a53168b048 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136337 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-02Use more appropriate return type for ThreadPool::getPreferredConcurrencyStephan Bergmann
All call sites already effectively asked for an unsigned return type, including: * The ThreadPool ctor took an nWorkers argument of type sal_Int32, but internally stores that as std::size_t mnMaxWorkers. * ZipOutputStream::reduceScheduledThreadTasksToGivenNumberOrLess apparently benefits from an unsigned nThreadTasks parameter, getting rid of various casts in its implementation that were necessary to silence signed vs. unsigned comparison warnings. The only drawback is that comphelper::ThreadPool::getPreferredConcurrency() * 4 in package/source/zippackage/ZipPackageStream.cxx would now silently wrap around instead of causing UB on overflow (which could be detected with appropriate tools). Ideally, it would use some o3tl::saturating_mul if we had that, so add a TODO comment for now. While std::thread::hardware_concurrency returns unsigned, it looked more natural to go with std::size_t here, as some call sites already used that (see above), so the implementation of ThreadPool::getPreferredConcurrency is a natural place to hide clamping std::thread::hardware_concurrency() to std::size_t (in the unlikely case that std::size_t is of smaller rank than unsigned). This required addition of o3tl::clamp_to_unsigned in o3tl/safeint.hxx. Change-Id: I0a04a8b32e63ebfeb39f924c4b38520455a6fb38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135309 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-20loplugin:passstuffbyrefNoel Grandin
Change-Id: I336fd329b577b6fa141265d8bc7ce67784bd7306 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133210 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-14loplugin:trivialdestructor (-stdlib=libc++)Stephan Bergmann
That these are only flagged when building against libc++ and not against libstdc++ is a consequence of the plugin's dependence on implementation details of the relevant classes, but so be it. Change-Id: I6b96f81939edab2b8e618aa53c9fe23492edfbbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131562 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-11new loplugin:trivialdestructorNoel Grandin
look for potentially trivial destructors that can then be elided Change-Id: I435c251bd4291b5864c20d68f88676faac7c43fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131318 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-30Recheck modules [o-r]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I6b4b05a5e59b256653c4caf5297fffd601b45083 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128845 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-01-11optimise and simplify ZipOutputEntryInThreadNoel Grandin
by just using the tempfile service as intended, we can stay on the "happy path" which means that, on Windows, if there is sufficient system RAM, the temporary file never even hits the disk. Change-Id: I3b27cf09bd40a4cfee01c23273af05860708a16f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128258 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-27use more OInterfaceContainerHelper3 in packageNoel Grandin
Change-Id: I4a9f0f4ae95ec236ef32462c1aaa8d774be15378 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125938 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-26loplugin:stringliteraldefine in packageNoel Grandin
Change-Id: I91ce2f65513ea9ae74841c6b0286c01d4e6dd82f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125812 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-15loplugin:finalclassesNoel Grandin
Change-Id: I88831f290e1923db6fb5a733746bfa3bc7fbc7e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122148 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-12flatten OZipFileAccess a littleNoel Grandin
Change-Id: Ib03dadcd69a65493ddd9c0437fc654beef039ad8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120341 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-12flatten ZipPackage a littleNoel Grandin
Change-Id: I0295bd8d72686996afb9d361db12b6014594b402 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120340 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-21pass ZipEnumeration around by valueNoel Grandin
Change-Id: I8418bd3eb6a8013f55f4283c7d96755d95a60c1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119305 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-20osl::Mutex->std::mutex in ByteGrabberNoel Grandin
Change-Id: I96ea49da6708041ac19e147f192c7e996d44b8ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119276 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-23Removed duplicated includeAndrea Gelmini
Change-Id: I5c82c0b216dd680d5cbac154a276bbd09fa32477 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117667 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2021-06-22reduce allocation in ZipContentInfo mapNoel Grandin
This is a small struct, no sense in allocating it separately Change-Id: I709daebbde648a79f175f74c207bdf4871ae6ff1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117604 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-08update PCHsLuboš Luňák
Change-Id: Ia9d04447f927e270a55500e7f35723a729bc01dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113801 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-03-09Make sal/config.h the first in pchMike Kaganski
By convention, it should be the first include in C/CXX files; so use of pch should not break that. Change-Id: Ic329c5f39e8f48ad1778724368e262e48972342b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112123 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-04update pchesCaolán McNamara
Change-Id: I3e22c2000da03f6f3345353846213203993aa865 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107192 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-19tdf#123936 Formatting files in module package with clang-formatPhilipp Hofer
Change-Id: I3ff80c6c636003d468f384e0d6fbfb5233e0b4da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105696 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-08-12SvTreeListBox can move into toolkit headers nowCaolán McNamara
Change-Id: I6b3b6ef1530a192f4b6bf87aa9688687063683ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100591 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-17package: create instances with uno constructorsNoel Grandin
See tdf#74608 for motivation. Change-Id: I17627bdd2f4f595343ad9bf524dc57cd03170b2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98921 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-14fix encrypted parallel zip saving (tdf#134332)Luboš Luňák
ZipOutputEntryBase::processDeflated() was calling isDeflaterFinished() to find out whether to finalize and dispose m_xCipherContext. With ZipOutputEntryParallel this was always true, so the context was disposed after the first call. That was originally correct, because originally processDeflated() was called just once at the very end, but 353d4528b8ad8abca9a13f3016632e42bab7afde changed to calling it several times. Change-Id: I1e4a0c887e4ba7ac7b20fa315169eaa911335fde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98625 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-07-12update pchesCaolán McNamara
Change-Id: I75602277a5a26b012a12f2c4f4b7ff5bb663b0b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98474 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-09compact namespace in packageNoel Grandin
Change-Id: I9956f715e00a0c2814b79617f37dd0c09f049ad0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93858 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-26update pchesCaolán McNamara
Change-Id: I83a61da7dda6c72552eecd377f1c3744c92a797e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92909 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-03-12Revert "loplugin:constfields in package..registry"Noel Grandin
This reverts commit 31138ff7729cbf179079a5e635d3a823e2971f08. Now that we know that making fields has negative side effects like disabling assignment operator generation. Change-Id: I3f1ae65532f441c8be5ebca5866b8a1e1c69318c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90363 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-01make update_pch also consider files in <module>/src/**/incLuboš Luňák
With --enable-pch=full there's not much difference between a "public" header in <module>/inc and a private one in <module>/src/somewhere/inc . And since the script searches recursively, this apparently helps to find even more headers for lower pch levels. Change-Id: I8483d0aa5b4fea5a59107c20a8aa5f1ef694af0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87799 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-01-26tdf#124176: Use pragma once instead of include guardsBurak Bala
Change-Id: Ib2465f040f12413560b2cec1c742cf3558461309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87404 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-01-13loplugin:finalclasses in package..sfx2Noel Grandin
Change-Id: I2908abc13f16b0011fcb326e8405080cc30df74a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86684 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-13tdf#125662: do parallel-zip in batchesDennis Francis
In this approach the input stream is read one batch (of constant size) at a time and each batch is compressed by ThreadedDeflater. After we are done with a batch, the deflated buffer is processed straightaway (directed to file backed storage). Change-Id: I2d42f86cf5898e4d746836d94bf6009a8d3b0230 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86596 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-10-18make bin/update_pch.s always include code in trivial #if'sLuboš Luňák
E.g. #ifdef LIBO_INTERNAL_ONLY is always true for code that builds with our PCHs. Change-Id: I3cf311ea3621b909105754cfea2cb0116b8b67f5 Reviewed-on: https://gerrit.libreoffice.org/80961 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-06tdf#39593 use isUnoTunnelIdArkadiy Illarionov
Adapt getUnoTunnelId methods where required: rename or make public. Change-Id: I0fd2120bf9f0ff1aa690329a65ff64a154c89315 Reviewed-on: https://gerrit.libreoffice.org/78680 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-24loplugin:returnconstval in fpicker..reportdesignNoel Grandin
Change-Id: I59c55a858b2706d1327c837abc158dceca02360e Reviewed-on: https://gerrit.libreoffice.org/78058 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-22loplugin:constmethod in packageNoel Grandin
Change-Id: I44bc86a179164e1d039dd3a5f2c8a23396d870b3 Reviewed-on: https://gerrit.libreoffice.org/77931 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-23close some more holes in structuresNoel Grandin
and improve the pahole script so I can just run it once over the whole codebase Change-Id: I7e1775974a3a61f8c0e40646158f01163ace60cc Reviewed-on: https://gerrit.libreoffice.org/76122 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-18cid#1448353 Uncaught exceptionCaolán McNamara
Change-Id: Ia967db3f73bee9167be4fd88090b27bfdbd4aca0 Reviewed-on: https://gerrit.libreoffice.org/75881 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-01Fix typoAndrea Gelmini
Change-Id: Ib7db25fd0d981270c5a990113723a01731f2f0ec Reviewed-on: https://gerrit.libreoffice.org/74935 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-05-28parallel deflate compression (one stream, multiple threads)Luboš Luňák
ZipPackageStream::saveChild() already had one threaded compression, but that still uses only one thread for one stream. Many documents contain many streams (where this is useful), but large documents often contain one huge content.xml, which then would be compressed using just one thread. But it is in fact possible to do deflate in parallel on the same data, at the cost of somewhat increased CPU usage (spread over threads). This is handled separately from the background thread path, as integrating these two approaches would probably be needlessly complex (since they both internally use ThreadPool, the tasks should often intermix and parallelize anyway). On my 4-core (8 HT threads) machine this reduces the compression time of tdf#113042 from 3s to 1s. Change-Id: Ifbc889a27966f97eb1ce2ce01c5fb0b151a1bdf8 Reviewed-on: https://gerrit.libreoffice.org/73032 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-28split out thread functionality from ZipOutputEntryLuboš Luňák
It can be easily separated out, it looked like hacked in. And I will need to do more refactoring of the class, so this shouldn't be more complex than necessary. Change-Id: I302da55409e9195274907ca4939c37fbb2427b18 Reviewed-on: https://gerrit.libreoffice.org/73031 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>