summaryrefslogtreecommitdiff
path: root/package
AgeCommit message (Collapse)AuthorFilesLines
2020-05-23package: OFFICE-3940 ODF 1.3 import of OpenPGP encryptionMichael Stahl1-13/+18
This was supposed to be implemented by commit a7bf6488ebb544e1efaed0a1e53073df9cc2064d "ODF1.3: import new OpenPGP encryption markup" but it turns out that the ODF 1.3 cs01 schema differs from the implementation: in ODF 1.3 cs01 we have <manifest:encrypted-key> <manifest:encryption-method .../> <manifest:keyinfo> <manifest:PGPData> </manifest:PGPData> </manifest:keyinfo> <manifest:CipherData> </manifest:CipherData> </manifest:encrypted-key> whereas the implementation expects <manifest:keyinfo> <manifest:encrypted-key> <manifest:encryption-method .../> <manifest:PGPData> </manifest:PGPData> <manifest:CipherData> </manifest:CipherData> </manifest:encrypted-key> </manifest:keyinfo> Ideally the inner manifest:keyinfo should be manifest:KeyInfo but not sure if that really matters. Change-Id: I407321c857e7b3ed9f4d04568ca2ea116764b3da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94309 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 4f1b0f7d5235140611305b784b58f95fc5b8bd81) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94586 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-05-15Remove some redundantly user-declared copy ctors and assignment opsStephan Bergmann1-6/+0
...that trigger -Werror,-Wdeprecated-copy ("definition of implicit copy {constructor, assignment operator} for ... is deprecated beause it has a user-declared copy {assignment operator, constructor}") new in recent Clang 10 trunk (and which apparently warns about more cases then its GCC counterpart, for which we already adapted the code in the past, see e.g. the various "-Werror=deprecated-copy (GCC trunk towards GCC 9)" commits) Change-Id: Ie37bd820e6c0c05c74e1a862bb1d4ead5fb7cc9c Reviewed-on: https://gerrit.libreoffice.org/83698 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93694 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-10tdf#93389: keep encryption information for autorecovered MS formatsMike Kaganski3-5/+8
The autorecovery data is stored in ODF, regardless of the original document format. When restoring, type detection generates ODF data, which is stored in the media descriptor attached to document, even after real filter was restored (see AutoRecovery::implts_openDocs). If real filter is not ODF, then at the save time, it doesn't find necessary information in encryption data, and makes not encrypted package. This patch adds both MS binary data, and OOXML data, to existing ODF data for recovered password-protected documents (regardless of their real filter). TODO: only add required information to encryption data: pass real filter name to DocPasswordHelper::requestAndVerifyDocPassword from AutoRecovery::implts_openDocs. Change-Id: I4749c5ec028ca61bddf7cd77bc5969a97b1de199 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86201 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit dd198398b6e5c84ab1255a90ef96e6445b66a64f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86353 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-10-26size some stringbuffer to prevent re-allocNoel Grandin1-1/+1
I started with 32 and kept doubling the size until the site did not need re-alloc, but clamped it at 512 (e.g. in emfio/). Change-Id: Ib7caf35a1b7e42b0e4ed8aa812493449e3eefc8f Reviewed-on: https://gerrit.libreoffice.org/81540 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-18make bin/update_pch.s always include code in trivial #if'sLuboš Luňák2-2/+15
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-10-17Rename OUStringLiteral1 to OUStringCharStephan Bergmann2-3/+3
It started out as a wrapper around character literals, but has by now become a wrapper around arbitrary single characters. Besides updating the documentation, this change is a mechanical for i in $(git grep -Fl OUStringLiteral1); do sed -i -e s/OUStringLiteral1/OUStringChar/g "$i"; done Change-Id: I1b9eaa4b3fbc9025ce4a4bffea3db1c16188b76f Reviewed-on: https://gerrit.libreoffice.org/80892 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-15new loplugin:bufferaddNoel Grandin1-3/+1
look for OUStringBuffer append sequences that can be turned into creating an OUString with + operations Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6 Reviewed-on: https://gerrit.libreoffice.org/80809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-14loplugin:stringadd look for unnecessary temporariesNoel Grandin1-2/+2
which defeat the *StringConcat optimisation. Also make StringConcat conversions treat a nullptr as an empty string, to match the O*String(char*) constructors. Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b Reviewed-on: https://gerrit.libreoffice.org/80724 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-01loplugin:stringadd in package..saxNoel Grandin4-15/+7
Change-Id: I1f8b626ae99bca6e31e7c4aa9c8a1fc016b76e5c Reviewed-on: https://gerrit.libreoffice.org/79890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-26add property name when throwing css::uno::UnknownPropertyExceptionNoel Grandin6-17/+17
Change-Id: I17f06c9415b9d43b6d8896360e07216c2856367a Reviewed-on: https://gerrit.libreoffice.org/79627 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-23do not require $(SRCDIR) in every gb_Library_set_precompiled_headerLuboš Luňák2-2/+2
Change-Id: I7b3a22584bb2e4d501f509ffcd80929feed23a4c Reviewed-on: https://gerrit.libreoffice.org/79360 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-10Fix typosAndrea Gelmini2-24/+24
Change-Id: Ibc1b7393a8e65bf23c78fdb9da78c6b73b544cf3 Reviewed-on: https://gerrit.libreoffice.org/78793 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-06tdf#39593 use isUnoTunnelIdArkadiy Illarionov7-17/+18
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 Grandin2-2/+2
Change-Id: I59c55a858b2706d1327c837abc158dceca02360e Reviewed-on: https://gerrit.libreoffice.org/78058 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-22Simplify Sequence iterations in packageArkadiy Illarionov8-546/+441
Use range-based loops, STL and comphelper functions Change-Id: Ibd836b9b2df2f30b42f2d7a621188d78f5b53196 Reviewed-on: https://gerrit.libreoffice.org/77246 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-08-22oox: typos, comments, formattingAshod Nakashian1-5/+4
Change-Id: I6bb138be2a8da91a85248e85d408f54a9b885f9b Reviewed-on: https://gerrit.libreoffice.org/77686 Tested-by: Jenkins Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2019-08-22loplugin:constmethod in packageNoel Grandin11-14/+14
Change-Id: I44bc86a179164e1d039dd3a5f2c8a23396d870b3 Reviewed-on: https://gerrit.libreoffice.org/77931 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-22Deduplicate some codeMike Kaganski1-25/+16
Change-Id: I2cdc9f1416a9089e91f30cebe071a4855edc4536 Reviewed-on: https://gerrit.libreoffice.org/77892 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-08-20loplugin:constvars in package..scNoel Grandin1-8/+8
Change-Id: Ibaa9ebd6440d9229ba313f4c130f5752d432b338 Reviewed-on: https://gerrit.libreoffice.org/77792 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-12Fix typosAndrea Gelmini1-1/+1
Change-Id: Ibd0e9ca0dbef5cf998d9d73cbd8a59708175e252 Reviewed-on: https://gerrit.libreoffice.org/77306 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): packageStephan Bergmann8-8/+8
Change-Id: I98b112820d4254dae92a6152dcec7506518c924b Reviewed-on: https://gerrit.libreoffice.org/76660 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-26Fix typoAndrea Gelmini1-1/+1
"noncommited" Change-Id: Ia22431edf221d3824d84512f0e77dbb1758f35cd Reviewed-on: https://gerrit.libreoffice.org/75982 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-23Fix typosAndrea Gelmini2-3/+3
Change-Id: Iea3bd498b1c8934f37085bdf6df71b073e4a871c Reviewed-on: https://gerrit.libreoffice.org/76203 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-07-23close some more holes in structuresNoel Grandin2-4/+4
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-20loplugin:referencecasting in oox..pyunoNoel Grandin2-10/+5
Change-Id: Ie920c154aef3074016704c632b15d99110b219aa Reviewed-on: https://gerrit.libreoffice.org/75974 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-18cid#1448353 Uncaught exceptionCaolán McNamara2-2/+2
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-16cid#1448443 Uninitialized pointer fieldCaolán McNamara1-0/+1
Change-Id: I664c9c6e1479466bfe5a1af35a554aaa15fac2ea Reviewed-on: https://gerrit.libreoffice.org/75695 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-01Fix typoAndrea Gelmini1-1/+1
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-06-25improve loplugin:simplifyconstructNoel Grandin1-3/+2
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-20Demote from std::unique_lock to std::scoped_lock where applicableStephan Bergmann1-1/+1
Change-Id: I53a019f05978bab62ad0da3d0eb08f37f8ec1e18 Reviewed-on: https://gerrit.libreoffice.org/74414 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-20Fix typoAndrea Gelmini1-1/+1
Change-Id: Ib804fd330ffae4b0e6c33c1247265955a3be9f2e Reviewed-on: https://gerrit.libreoffice.org/74389 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-06-15loplugin:logexceptionnicely in package..reportdesignNoel Grandin6-426/+416
Change-Id: Ib5438d346fa95299848aaf2144e54f5551c0a906 Reviewed-on: https://gerrit.libreoffice.org/74100 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-10bail out immediately if saving part of a zip package failsLuboš Luňák1-13/+17
There's no point in continuing to write other parts if the final result will be a failure anyway. Moreover this avoids an assert in ZipOutputStream::writeLOC() if writing of the previous part resulted in an error (e.g. ZipException because of broken zip CRC for the stream) that skipped calling ZipOutputStream::rawCloseEntry(). Change-Id: I5095b97a31cac9befcab5e82bd8cda2dfa53c7f7 Reviewed-on: https://gerrit.libreoffice.org/73646 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-28parallel deflate compression (one stream, multiple threads)Luboš Luňák6-60/+477
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ňák6-151/+165
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>
2019-05-28try harder not to deflate small streams in a threadLuboš Luňák2-2/+21
E.g. with the bugdoc from tdf#93553, most of the streams to save are actually small, they just do not provide XSeekable. Since it seems all the streams are already fully available by the time the zip packaging is done, fallback to XInputStream::available() to find out if the stream is small. With this, the zipping part of saving tdf#93553 is now down from ~1.5s to ~0.5s. This presumably also makes the hack for tdf#93553 unnecessary. Change-Id: Id9bb7d835400d6d8f147f5c11ade684a549aba53 Reviewed-on: https://gerrit.libreoffice.org/73030 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-21remove code confusion about threads vs thread tasksLuboš Luňák4-28/+30
A threadpool controls a number of threads that execute a number of thread *tasks* from a queue. The API even says they are tasks. So it's damn confusing when ZipPackageStream::saveChild() claims to limit the number of threads to 4x the maximum number of threads. It limits the number of queued thread tasks. Change-Id: I317497f27a82d92a7c8566b14aaeae73a4ffef1f Reviewed-on: https://gerrit.libreoffice.org/72677 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-19tdf#125339 Base, Table is deleted after accessing the tableNoel Grandin2-212/+218
regression from commit 306758ab3e06f7c730bb1625c2f3fcce7a912fa3 Date: Fri Apr 5 15:40:27 2019 +0200 tdf#117066 Saving ODT document with ~1500 bookmarks is slow, part 5 Before the above commit, we could have multiple child items with the same name. Restore that behaviour, while keeping the fast lookup, by using a std::unordered_map<OUString, std::vector<... Also remove name from SotElement_Impl so there is no chance of the name in the key of the map, and the name in the element getting out of sync. Change-Id: I65c294ddc409d9b8a7006e4f4338c9a2a4446a92 Reviewed-on: https://gerrit.libreoffice.org/72544 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-17Use hasElements to check Sequence emptiness in [l-r]*Arkadiy Illarionov10-39/+39
Similar to clang-tidy readability-container-size-empty Change-Id: Idd67f332b04857a39df26bad1733aae21236f105 Reviewed-on: https://gerrit.libreoffice.org/71764 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-05-12regenerate PCH headersLuboš Luňák2-6/+6
Change-Id: I4894023e42cbfa32916ee3ddfb2cfb5426cfc69f Reviewed-on: https://gerrit.libreoffice.org/72195 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-10an is used before a vowel soundCaolán McNamara1-1/+1
not before vowels with a consonant sound so its a url not an url Change-Id: Ic27ff3bee67469284d460c31ced6f63cb3633db2 Reviewed-on: https://gerrit.libreoffice.org/72062 Reviewed-by: Jens Carl <j.carl43@gmx.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-09regenerate PCH headers for the 4 new levelsLuboš Luňák2-39/+49
Plus some build fixes triggered by this. Change-Id: I59b21def706598ceffd45ae5b1f0262ec9c1ad50 Reviewed-on: https://gerrit.libreoffice.org/71581 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-04-19optimise find/insert patternNoel Grandin1-2/+1
if we're doing a find/insert on a set or a map, it is better to just do a conditional insert/emplace operation than triggering two lookups. Change-Id: I80da5097f5a89fe30fa348ce5b6e747c34287a8d Reviewed-on: https://gerrit.libreoffice.org/70937 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-13loplugin:sequentialassign in oox..reportdesignNoel Grandin4-18/+6
Change-Id: I59ef0a6da411b8af8bdf8d8efb1d733db7475d9c Reviewed-on: https://gerrit.libreoffice.org/70707 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-09Fix typosAndrea Gelmini1-3/+3
Change-Id: Idc6d5fcc91f74d1450ef44634274651074f768c0 Reviewed-on: https://gerrit.libreoffice.org/70437 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-04-08tdf#117066 Saving ODT document with ~1500 bookmarks is slow, part 5Noel Grandin2-80/+96
Individually, these don't make much difference, but they add up to a halving the time to save on my machine. OStorageImpl is spending time iterating over its m_aChildrenVector to find stuff by name, so just use a std::unordered_map. Also return iterator from FindElement, so we can avoid searching the map twice. This was probably the biggest win. Change-Id: I30776bad5377d14144fc7a47e86527e2cdb62a83 Reviewed-on: https://gerrit.libreoffice.org/70313 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-08tdf#117066 Saving ODT document with ~1500 bookmarks is slow, part 3Noel Grandin2-5/+6
Individually, these don't make much difference, but they add up to a halving the time to save on my machine. ManifestImport::characters was spending time adding data to an OUString, so convert that to an OUStringBuffer. Change-Id: I267e701f4e7998044763f44199b1fe8a37325b68 Reviewed-on: https://gerrit.libreoffice.org/70311 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-08Use osl_atomic_increment/osl_atomic_decrement to change m_refCountMike Kaganski4-4/+5
Change-Id: Ia24441d3671102fdeeb797547396c25ee2a6ffd3 Reviewed-on: https://gerrit.libreoffice.org/70382 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-07Don't use resettable/clearable guard where plain guard is enoughMike Kaganski4-308/+328
Also use scope where possible. This allows to limit guard scope at language level; visualises the scope clearly; and helps avoiding errors like fixed in commit 61e4437c857854b331fa01da6f39b2b3b58a800b. Change-Id: Ifeca96e2df8e8a0897770d9546b2536806275f41 Reviewed-on: https://gerrit.libreoffice.org/70376 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-31tdf#120703 PVS: remove redundant static castsMike Kaganski2-15/+9
V572 It is odd that the object which was created using 'new' operator is immediately cast to another type. Change-Id: I54976062dc3f62eaaa79f89eff54454f0b24ac2c Reviewed-on: https://gerrit.libreoffice.org/69989 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>