Commit Graph
1947 Commits
Author SHA1 Message Date
Caolán McNamara 397e2d5118 ofz#57529 Integer-overflow
Change-Id: I93775299aa340e2e645a04be5d0bc36a9caea103
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149773
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-03-30 22:02:08 +00:00
Stephan Bergmann 7cce1141c6 Missing includes (for std::exception_ptr)
Change-Id: If93883ba9feb22e6da2d56af4ebb2f4eafe58de1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149162
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-03-20 15:21:08 +00:00
Caolán McNamara b6d1cb8874 cid#1521901 Pointer to local outside scope
Change-Id: I38e76440606afb65a8c1ce419c446e234a513659
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148550
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-03-09 20:17:15 +00:00
Caolán McNamara 59b0f67675 ofz#56826 Heap-use-after-free
since:

commit abda72eeac
Date:   Mon Feb 20 00:32:22 2023 +0100

    tdf#82984 tdf#94915 zip64 support (import + export)

Change-Id: Iffc1c54b3ccc5464e217d7f94ecc34b57ec1afb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148526
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-03-09 10:18:42 +00:00
Andrea Gelmini 5eae429d02 Fix typo
Change-Id: I4c48c988667ffd9221a0e226ab9c35e1e857e9d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148489
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-03-09 06:20:54 +00:00
Attila Szűcs abda72eeac tdf#82984 tdf#94915 zip64 support (import + export)
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-03-08 14:53:57 +00:00
Caolán McNamara 1ec54b38f1 assert that Mutex exists at ctor time
and drop the never can be hit throw

Change-Id: I74c92f1ff50ef0f3f6f78a53057f121a3665ec3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148072
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-03-01 19:37:19 +00:00
Caolán McNamara f6633ad610 cid#1521559 pass arg as ref to prove no Dereference before null check
and

cid#1521561 Dereference before null check

and drop pointless null check

Change-Id: I2e99733eb5f1861bb02f6d8ec7a44ace4ded16cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148070
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-03-01 19:37:05 +00:00
Noel Grandin 4e0db1771a flatten OWriteStream
no need to use pimpl pattern here

Change-Id: Iebc412aaad83c2f1fc149cc320729ce25030cbc3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147949
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-28 11:48:50 +00:00
Noel Grandin 69794d012f no need to allocate OTypeCollection separately in OStorage
it is only one pointer big

Change-Id: I4af56814be106026515aee6c09caa14e0f3eb09a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147948
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-28 11:48:42 +00:00
Noel Grandin e0e310bd80 no need to allocate OTypeCollection separately in WSInternalData_Impl
it is only one pointer big

Change-Id: I291b1c0aaba2f46aebabefa0341a9e24cf20eeff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147947
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-28 10:54:02 +00:00
Noel Grandin cf4e1e0bb8 osl::Mutex->std::mutex in OHierarchyElement_Impl
Change-Id: I458cab160f337019402659b5fb738ba85f73ea1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147190
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-17 07:33:24 +00:00
Gabor Kelemen 259ae22056 Drop 'using namespace ::std' in dirs [e-p]*
Change-Id: Ibe6a2f662f5721c594d28a8e0d7340d0f3cffe95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147075
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-02-15 18:39:38 +00:00
Noel Grandin a04bf69bcc XUnoTunnel->dynamic_cast in ZipPackageEntry
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-17 19:09:51 +00:00
Noel Grandin cb004bdefb XUnoTunnel->dynamic_cast in ZipPackage
Change-Id: I4ecfbb0e90cca7e81556fb27fd552669bed0405c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145631
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-17 07:49:12 +00:00
Mike Kaganski f2f008c52a Merge SvXMLAttributeList to comphelper::AttributeList
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-15 12:32:29 +00:00
Mike Kaganski 3de6b42235 Simplify a bit
Change-Id: Ie2435701078b0e111c1b04b77c857fd1923f2d59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145430
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-13 09:22:34 +00:00
Noel Grandin 14df26ac57 XUnoTunnel->dynamic_cast in comphelper::ByteReader and comphelper::ByteWriter
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-13 06:15:21 +00:00
Arnaud VERSINI 555f433318 use std::this_thread::sleep_for instead of osl equivalent
Change-Id: I5b4edc5417e5bb5e082688df616e1d5735717d92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142357
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-09 08:37:35 +00:00
Noel Grandin a55d9d57e5 loplugin:unusedfields
Change-Id: I726b8b9dee3a424f731078cd6b10027423454bee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143086
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-22 11:04:08 +01:00
Caolán McNamara fb1bf9f1fd cid#1242675 Untrusted value as argument
Change-Id: If8ecad4501d6c555791eae0ae113a34e05f9436f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141670
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-10-27 09:47:54 +02:00
Noel Grandin 848f9b2c56 tdf#133767 new service TempFileFastService
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-10-21 12:01:05 +02:00
Noel Grandin 4b95451f85 split utl::TempFile into fast and named variants
which makes it easier to know what each variant requires
to stay on it's happy path

Change-Id: I3275a2543573367714bc78092e882f6535507285
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140469
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-29 09:11:18 +02:00
Noel Grandin f6bf58503d use more string_view in package
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-09-27 13:32:26 +02:00
Stephan Bergmann 91ba9654ba Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxx
...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-18 17:10:19 +02:00
Caolán McNamara 3c6f95dd32 cid#1500507 silence Resource leak
Change-Id: I738600ee653d68e80dc8a18970e759d97da08970
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138392
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-17 09:52:50 +02:00
Stephan Bergmann fd2e907e44 comphelper::ByteWriter::writeSomeBytes always writes all bytes
...so rename it to writeBytes for clarity, and drop the redundant return value.
Also clarify that it has a narrow interface and requires nBytesToWrite to be
non-negative.

Change-Id: I76dee83fecd6350f473f55dcffb950c16aa22d93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137169
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-18 13:09:51 +02:00
Noel Grandin 9ba8b37db5 use utl::TempFile directly in package
so we can
(a) control the lifetime of the temp file properly
and
(b) we don't need to use file URLs which means we stay on the
efficient path on Windows

Change-Id: I2b1eed5f5afc8f89f53bde35ebb44e9922889817
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136557
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-28 14:56:46 +02:00
Noel Grandin 74ff1a4355 clang-tidy modernize-pass-by-value in package
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-23 18:24:16 +02:00
Stephan Bergmann b4163877e7 Use more appropriate return type for ThreadPool::getPreferredConcurrency
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-06-02 17:13:17 +02:00
Noel Grandin 18321eb3f4 elide some OUString allocation
Change-Id: Idcb296980ea498373a0fb4f8c0c584eef2c5c9f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134922
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-25 19:00:44 +02:00
Noel Grandin 9c779279f5 use comphelper::ByteReader in XBufferedStream
to avoid an intermediary buffer

Change-Id: Ic59e701491ac041022ca3e328741f170bb5b7ab6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134842
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-24 16:58:14 +02:00
Noel Grandin 443799ad8c fix OWriteStream implementing XUnoTunnel
doh, forgot to return it in the queryInterface in

commit
    62531ec109
    add ByteWriter to reduce memory copying when writing data

Change-Id: I460388b55ca38962bf60ef6be6a2b108deee6d73
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134678
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-20 18:49:14 +02:00
Noel Grandin 62531ec109 add ByteWriter to reduce memory copying when writing data
similarly to ByteReader

move both of them down to comphelper, since we want to use it from
comphelper, and comphelper is "below" unotools in the module dependency
graph

Change-Id: Ic98fa2268e125fd8e4378fb899ad5f97de721713
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134645
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-19 21:04:48 +02:00
Noel Grandin 429a960e15 elide some OUString allocation
Change-Id: Iadd73477bf3b0edaa0fb7db10f9ffca88fe737e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134476
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-17 18:45:56 +02:00
Noel Grandin 22e08a3d8b tdf#121740 cache hashcode in SequenceAsHashMap
shaves 2% off load time

Change-Id: I5bd4eabf61205df21a27d2822acd2676a7732a3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134315
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-14 19:14:19 +02:00
Noel Grandin 8eabb8839d reserve space in map in ZipFile::readCEN
Change-Id: I4d7764f00b7d05ba5d43a3fb35596f5ec4653da3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134302
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-14 14:44:02 +02:00
Noel Grandin 3322e500f4 avoid some OUString construction on some hot paths
Change-Id: I098b017d22b7a4502998a0901ddcfca08a57ee43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134115
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-11 09:24:42 +02:00
Noel Grandin 240a345bc3 tdf#121740 reduce cost of OStorage_Impl::GetElementNames
which shows up on the profile

Change-Id: I7e4ef9d71d06562dc1c574fe41d616947e3d67e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133926
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-06 14:22:15 +02:00
Stephan Bergmann 8342e4a5c7 Just use Any ctor instead of makeAny in package
Change-Id: I527024f34b88ec764488a3766872f1941f8dbb4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133794
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-04 09:59:24 +02:00
Noel Grandin 5200a73627 use more string_view in various
found by examining uses of OUString::copy() for likely places

Change-Id: I6ff20e7b273ad6005410b82719183c1122f8c018
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133617
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-01 08:30:18 +02:00
Stephan Bergmann bdff0bb77b Use o3tl::make_unsigned in some places
...where a signed and an unsigned value are compared, and the signed value has
just been proven to be non-negative here

Change-Id: I9665e6c2c4c5557f2d4cf1bb646f9fffc7bd7d30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133442
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-26 17:04:01 +02:00
Noel Grandin 9f958c076a loplugin:passstuffbyref
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-04-20 15:24:34 +02:00
Noel Grandin fdfd517a6f loplugin:stringviewparam whitelist some more functions
for which we have o3tl:: equivalents

Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-13 08:38:53 +02:00
Noel Grandin ddff74993f no need to have duplicate m_bIsRoot fields
Change-Id: I4f8777462d0bb8cb9f1a6065a548a794d842d815
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131678
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-17 08:17:50 +01:00
Noel Grandin 9a9bb1f212 no need to have duplicate m_nStorageType fields
Change-Id: I65bfce88e2bb1d32ec6c292e7e5f020904405bed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131677
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-17 08:17:36 +01:00
Noel Grandin 17d2cf3076 flatten OStorage a little
Change-Id: I4a380d036c3e94f2df41d2c583d51f574d2c161d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131675
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-17 07:34:53 +01:00
Stephan Bergmann 83dd8deed7 loplugin:trivialdestructor (-stdlib=libc++)
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-14 22:30:44 +01:00
Noel Grandin 7002caa97e new loplugin:trivialdestructor
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-03-11 09:06:06 +01:00
Caolán McNamara 3c06623733 cid#1500664 Dereference before null check
this looks sensible at:

commit e7c7d6f0e9
Author: Kurt Zenker <kz@openoffice.org>
Date:   Thu Sep 11 09:16:30 2003 +0000

    INTEGRATION: CWS mav05 (1.1.2); FILE ADDED

as:

if ( (*pElementIter)->m_bIsStorage )
{
    OSL_ENSURE( (*pElementIter)->m_pStorage && (*pElementIter)->m_pStorage->m_xPackageFolder.is(),
                "An inserted storage is incomplete!\n" );
    if ( !(*pElementIter)->m_pStorage || !(*pElementIter)->m_pStorage->m_xPackageFolder.is() )
        throw uno::RuntimeException(); // TODO

    xNewElement = uno::Reference< lang::XUnoTunnel >( (*pElementIter)->m_pStorage->m_xPackageFolder,
                                                        uno::UNO_QUERY );
    (*pElementIter)->m_pStorage->Commit();
}

and then didn't after:

commit 8c64f087f8
Author: Rüdiger Timm <rt@openoffice.org>
Date:   Thu Oct 30 08:48:27 2003 +0000

    INTEGRATION: CWS mav08 (1.2.10); FILE MERGED
    2003/10/15 08:07:55 mav 1.2.10.2: #i21121# substorages implement transacted mode
    2003/10/13 14:26:33 mav 1.2.10.1: #i21121# Transacted mode for storages

Change-Id: Ib05359b282d078cd40b41ed8f2fe9242235c9c83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130417
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-23 12:16:00 +01:00