summaryrefslogtreecommitdiff
path: root/include/svl
AgeCommit message (Collapse)Author
22 hourscool#10630 doc electronic sign: fix no graphic selection for the signature lineMiklos Vajna
Insert a signature line in "extern" mode, the shape gets selected but there is no graphic selection at a LOK API level. This is because GetSignPDFCertificate() returned an XCertificate, which is empty in the external signing case, so we can't differentiate between no signing and external signing. Fix this by changing the return type to svl::crypto::CertificateOrName, this way SdrMarkView::SetMarkHandlesForLOKit() can annotate the signature line correctly even in the external signing case. The tracking of the signature line selection is still in the model (not in the view), that's not yet fixed here. Change-Id: I4ef9c1fa0a88af0c0fcd55156b973a3705f985c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180296 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
32 hoursconvert RES_OBJECTDYING to SfxHintNoel Grandin
and remove SwPtrMsgPoolItem, which is now unused Change-Id: Ie5bedcd9855256d3ad90189db3df1ae978977e8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180180 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
3 dayscool#10630 doc electronic sign: fix insertion of the signature lineMiklos Vajna
Have electronic signing configured in the LOK client, try to insert a signature line, you'll get a certificate picker, while we don't have a cert during esign. What's in fact needed for creating the signature line is just a name (previously extracted from the certificate), we can survive the lack of actual certificate. Fix the problem by adding a new External parameter to .uno:InsertSignatureLine to hint that the certificate chooser should not be opened, instead the editor name (used for comments already) should be used. Add a new CertificateOrName in svl/ and use that in all places where previously we wanted a certificate but in fact it's enough to have a certificate or a name to create the signature line. The name on the signature line is just visual feedback, the actual name on the crypto signature is still not based on untrusted used input. Change-Id: Ib7008112a8e28a9e7d9649745e6021dd6b6b9c39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180193 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
3 daysconvert RES_ATTRSET_CHG to SfxHintNoel Grandin
Change-Id: I45e30282fed0dbd5423c777d3dfa0aa3315619fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180029 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
5 daysFix typoAndrea Gelmini
Change-Id: I295787301985e9209e4b9397e638869bee1d4ecf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180115 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
5 daysFix typoAndrea Gelmini
Change-Id: I60c92b959f114b2cb6131fc7f271f002fd793709 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180116 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
6 daysITEM: Refactor ItemTypeArmin Le Grand (Collabora)
ItemType is useful and faster than RTTI. Until now it was implemented by a 16-bit member in the base class, plus (potentially) all constructors having to hand a value in at item construction type (of type SfxItemType) to get that member set correctly. This works, but there is no reliable way to guarantee coverage, and there have already been cases with missing SfxItemType - these fallback to '0' and thus all Items with ItemType() == 0 are assumed equal and might be static_cast'ed to the wrong classes. Note that I identified *35* Items that had no correct ItemType set/implemented actually. It also uses 16-bit per incarnated Item at runtime. I thought and realized now a more systematic approach to do that with a pure virtual function at the Item itself. That can also be secured by a clang compiler plugin in the future to keep it working. It uses one virtual function per derived class, no longer space in incarnated Items. Also the constructors will get more simple again. But the main aspect is security - we cannot afford Items potentially being held as equal if they are not. Unfortunately C++ does not offer something like a 'strict pure virtual function' that would force to be overloaded in every derivation, but the used methotology and adding a clang test is reasonably safe. Have now done the cleanup of previous method. Change-Id: I04768285f1e9b73d64b0bb87df401944b5d35678 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180017 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
8 daysRevert "convert RES_ATTRSET_CHG to SfxHint"Stephan Bergmann
This reverts commit 404fbec25740406e3b926844f3bd0f324dc38b8c. Reason for revert: It's follow-up fix bbb53997c3a6890567ee991aed8502b397dcb7a6 "fix ubsan failure" had to be reverted (because it conflicted with a revert of cc56bf56e170492e414a975ad8c07c41ed72e1a4 "convert RES_OBJECTDYING to SfxHint", which in turn is known broken and thus needed to be reverted for now), so revert this known-broken commit for now as well. Change-Id: I4e65c7113e1e5bfdb9841c98bee3712a1beb12ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179941 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
8 daysRevert "convert RES_OBJECTDYING to SfxHint"Stephan Bergmann
This reverts commit cc56bf56e170492e414a975ad8c07c41ed72e1a4. Reason for revert: It causes CppunitTest_sw_uwriter CPPUNIT_TEST_NAME=SwDocTest::test64kPageDescs to fail with > /sw/source/core/attr/format.cxx:273:29: runtime error: downcast of address 0x6140000e1840 which does not point to an object of type 'SwFormat' > 0x6140000e1840: note: object is of type 'SwModify' > 00 00 00 00 b0 e1 74 97 df 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > ^~~~~~~~~~~~~~~~~~~~~~~ > vptr for 'SwModify' > #0 0x7fdf8a31ca65 in SwFormat::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/attr/format.cxx:273:29 > #1 0x7fdf8d066efe in SwFrameFormat::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/layout/atrfrm.cxx:2766:19 > #2 0x7fdf8a2d51f2 in SwModify::CallSwClientNotify(SfxHint const&) const /sw/source/core/attr/calbck.cxx:231:18 > #3 0x7fdf8a2d2c5a in SwModify::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/attr/calbck.cxx:222:5 > #4 0x7fdf8a2d07bd in SwModify::~SwModify() /sw/source/core/attr/calbck.cxx:145:15 > #5 0x7fdf89b267c5 in sw::BroadcastingModify::~BroadcastingModify() /sw/inc/calbck.hxx:242:59 > #6 0x7fdf8a319f52 in SwFormat::~SwFormat() /sw/source/core/attr/format.cxx:208:1 > #7 0x7fdf8d064426 in SwFrameFormat::~SwFrameFormat() /sw/source/core/layout/atrfrm.cxx:2705:1 > #8 0x7fdf8d0644d8 in SwFrameFormat::~SwFrameFormat() /sw/source/core/layout/atrfrm.cxx:2677:1 > #9 0x7fdf8b42be68 in std::default_delete<SwFrameFormat>::operator()(SwFrameFormat*) const /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:95:2 > #10 0x7fdf8b454cc4 in std::__uniq_ptr_impl<SwFrameFormat, std::default_delete<SwFrameFormat> >::reset(SwFrameFormat*) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:203:4 > #11 0x7fdf8b38aa7e in std::unique_ptr<SwFrameFormat, std::default_delete<SwFrameFormat> >::reset(SwFrameFormat*) /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/unique_ptr.h:501:7 > #12 0x7fdf8b3434a6 in SwDoc::~SwDoc() /sw/source/core/doc/docnew.cxx:625:23 > #13 0x7fdf8abc1dd5 in SwDoc::release() /sw/source/core/doc/doc.cxx:136:9 > #14 0x7fdf8c2cbc16 in rtl::Reference<SwDoc>::clear() /include/rtl/ref.hxx:193:19 > #15 0x7fdf9102a534 in SwDocShell::RemoveLink() /sw/source/uibase/app/docshini.cxx:445:16 > #16 0x7fdf910295bd in SwDocShell::~SwDocShell() /sw/source/uibase/app/docshini.cxx:373:5 > #17 0x7fdf9102a728 in SwDocShell::~SwDocShell() /sw/source/uibase/app/docshini.cxx:363:1 > #18 0x7fdfda648fca in cppu::OWeakObject::release() /cppuhelper/source/weak.cxx:230:9 > #19 0x7fdf89b2801f in rtl::Reference<SwDocShell>::clear() /include/rtl/ref.hxx:193:19 > #20 0x7fdf89ac3f0c in SwDocTest::tearDown() /sw/qa/core/uwriter.cxx:1977:17 (<https://ci.libreoffice.org/job/lo_ubsan/3425/>) Change-Id: Ib4866bcfc71e2e3358a8f860cc19efa3f6349885 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179925 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
10 daysconvert RES_OBJECTDYING to SfxHintNoel Grandin
and remove SwPtrMsgPoolItem, which is now unused Change-Id: I4f5246aa03e300d78b81801c54255b3ab68ce312 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179781 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
10 daysDrop unneeded forward declarations from include/ even harderGabor Kelemen
test drive the new bin/find-unneeded-includes --fwdecl mode with iwyu 0.23 instead of 0.21, this seems to find more unneeded fw declarations Change-Id: I451e571c70eb74f46c799753e3c5a53c0110da36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179707 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
11 daysconvert RES_ATTRSET_CHG to SfxHintNoel Grandin
Change-Id: I22c4bd909010e2c5d48fcfa040e9efe2a4c7950a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179772 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
13 daysDrop unneeded forward declarations from include/Gabor Kelemen
test drive the new bin/find-unneeded-includes --fwdecl mode Change-Id: I507fa2b172ec9e348d1d91066ea241f02187b5ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179321 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-12-28move RES_FMT_CHG to SfxHintNoel Grandin
SwUpdateAttr is re-using this constant for a similar purpose, so rather give that its own constant to play with RES_UPDATEATTR_FMT_CHG. Change-Id: I5ffe2a861c44948d8c7dbdd6cf1435c913985c6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179305 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-12-24move HiddenParaPrint to SfxHintBjoern Michaelsen
Change-Id: I94ab48328de791bb9e879b489cc9cb4e140b97de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179170 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2024-12-24move RES_REMOVE_UNO_OBJECT to SfxHintNoel Grandin
Change-Id: I82936e0ddb685746a714e1929fc7682a68ef4d09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179240 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-12-13Replace workaround of resize to invalidate with an explicit SfxHintCaolán McNamara
Change-Id: Ic0c8ba5e5f65f7b1e472a667b69e737f4f1d9fbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178389 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-12-02tdf#120658 - Reworking of dialogues Organize macrosJim Raykowski
(make from 5 existing only one) Much of what makes up this patch is adapted from existing code that is used to organize and select macros and to assign macros to shortcut keys. Comments in the patch say where code is borrowed from. Known issues: + Scripting framework library rename for BeanShell, Java, and JavaScript always returns fail when there are no macro entries in the library even though it actually succeeds. The same thing happens using SvxScriptOrgDialog::renameEntry. + Deleting Basic macros from the Macro Manager dialog is not implemented yet. Change-Id: If4da04549f8b39675910cbbd1f94dd9a6b73c31a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176254 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-26Resolves tdf#163685 - Save user-defined formulaHeiko Tietze
Change-Id: I88a1c40d3e97d77c289c8b670b52dca50dea126f Co-authored-by: Rafael Lima <rafael.palma.lima@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176788 Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com> Tested-by: Jenkins
2024-11-15cool#9992 lok doc sign: add initial serialization of external signaturesMiklos Vajna
Now that the hash extract part works, the other end of this external signature support is to be able to integrate an externally generated (e.g. qualified) signature into our PDF file. The problem is that we have SignDocumentContentUsingCertificate() for non-interactive signing and we have the interactive sign dialog, but we have no way to integrate an existing PKCS#7 blob. Fix the problem by extending vcl::filter::PDFDocument::Sign(): if a signature value is provided, then integrate that, instead of calling svl::crypto::Signing::Sign() to generate a new signature. Also extend the SigningContext documentation, since now it has 3 modes (normal sign, hash extract, sign serialize). Change-Id: I113fb536b1a83b8a4869a7064bb415bca6a91ae4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176623 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-11-12cool#9992 lok doc sign, hash extract: digest for getCommandValues('Signature')Miklos Vajna
To be able to sign externally, we need a way to know what is the document hash that would be passed to NSS_CMSSignedData_SetDigestValue(), without actually performing the signing. Note that svl::crypto::SigningContext already gives us a way to expose the time that would be used for signing. Expose the hash in a similar way: the format is a SHA-256 hash in base64 form. This adapts both places dealing with time: vcl::PDFWriter::GetDateTime() and svl::crypto::Signing::Sign, to make sure they use the same time, otherwise the hash would potentially depend on two times, which would be hard to reproduce later when we serialize the signature we get. Change-Id: Ib039db4cdd043c8117215c31cb5bc83397693820 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176470 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-11-11cool#9992 lok doc sign, hash extract: time for getCommandValues('Signature')Miklos Vajna
The final goal of this API is to give time & hash information about the PDF signature, so once a 3rd-party produces the PKCS#7 signature, that can be added to the document and the actual PDF sign can be re-run with the same parameters. This commit continues the replacement of XCertificate with svl::crypto::SigningContext up to the point that the timestamp used in svl/ can be exposed on the LOK API. This is done by updating DocumentSignatureManager::add(), PDFSignatureHelper::SetX509Certificate(), vcl::filter::PDFDocument::Sign() and finally the svl::crypto::Signing ctor to work with the signing context instead of an XCertificate directly. Time reporting works now, so add a test for that. The digest part still needs doing. Change-Id: I83f1274cd420b67194b7caf12b1027e623d4f7fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176404 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-11-08cool#9992 lok doc sign, hash extract: initial getCommandValues('Signature')Miklos Vajna
The trouble with signing via ca/cert/key PEM files is that usually the CA is not trusted by the received of the signature. 3rd-party services are available to do generate trusted signatures, but then you need to share your document with them, which can be also problematic. A middle-ground here is to sign the hash of the document by a 3rd-party, something that's supported by e.g. <https://docs.eideasy.com/electronic-signatures/api-flow-with-file-hashes-pdf.html> (which itself aggregates a number of providers). As a first step, add LOK API to get what would be the signature time during signing -- but instead of actually signing, just return this information. Once the same is done with the doc hash, this is supposed to provide the same info than what the reference <https://github.com/eideasy/eideasy-external-pades-digital-signatures> app does. This is only a start: incrementally replace XCertificate with SignatureContext, which allows aborting the signing right before calling into NSS, and also later it'll allow injecting the PKCS#7 object we get from the 3rd-party. Change-Id: I108564f047fdb4fb796240c7d18a584cd9044313 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176279 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-11-06loplugin:passstuffbyref in svlNoel Grandin
Change-Id: Ibc4628941b40159aa35a0a55900efb3dd882369e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176056 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-25speedup saving large XLS file with lots of query formula(2)Noel Grandin
reduce cost of OUString construction by avoiding initialising a temporary and then overwriting it. 12s to 10s Change-Id: I889152ba71947004ca7d5c96f073182c94d95ed5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175539 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-22set stylesheet parent at creation timeNoel Grandin
avoids a bunch of broadcasting. a similar mega-master-page scenario as reported in tdf#158773 9.1 - 7.0s Some re-ordering of SVG output occurs, which means tweaking some unit tests. Change-Id: I447a4639a96c12c627a074f7e0f1ede8b3cbaf72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175299 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-21drop StyleSheetCreatedNoel Grandin
the only place that references it, effectively ignores it. I cant find anything that really uses it, as far back in the git history as commit 59bb5ba445352f88e3ac2d00a5dc3f9bb872326a Author: Vladimir Glazounov <vg@openoffice.org> Date: Wed Apr 11 18:36:28 2007 +0000 INTEGRATION: CWS hedaburemove01 (1.1.2); FILE ADDED when it was introduced. Removing this removes a bunch of expensive broadcast operations. a similar mega-master-page scenario as reported in tdf#158773 20s -> 17s Change-Id: I84ee269aa0ea96e9f77601b01d4795edd3294044 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175175 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-10-14tdf#100894 reduce time spent iterating stylesNoel Grandin
Small difference, but an easy optimisation Change-Id: Ic5aeb759fb64af378a6cfcd83977d917be1b9a8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174888 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-30SdrGrafCropItem needs its own SfxItemTypeNoel Grandin
Change-Id: I45bf4abf015dd493451f77e66dd70006867a2a6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174268 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-09-11use more concrete UNO type in svlNoel Grandin
Change-Id: I794fba1f111709e0469812d48eb81cc4dc1f11d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173195 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-06tdf#161741 undo nits: NeedsClearRedo is private + prioritize TopLevelJustin Luth
moNeedsClearRedo is an implementation detail, so there should not be public functions for it. Plus, NeedsClearRedo can be called either against the CurrentLevel stack or the TopLevel stack (whatever that implies - there is no documentation...) and since it is a delayed call that means that multiple NeedsClearRedo attempts could be made, theoretically against both stacks. My initial implementation was "last one wins", (which may very well prove to be the best one) but whatever happens, it should be clearly intentional. Based on my limited skill at code reading, it sounds like CurrentLevel might be more of an implemention detail or a temporary expansion of a ListUndoAction, so I am guessing that any request for TopLevel clearing should be given priority. For Writer, it is always clearing the TopLevel stack sw/source/core/undo/docundo.cxx: ClearRedo() return SdrUndoManager::ImplClearRedo_NoLock(TopLevel); Change-Id: I195aefb696599f018712135a2e015549d534791f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171984 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Justin Luth <jluth@mail.com>
2024-09-04use less dynamic_cast when broadcasting BulkDataHintNoel Grandin
we never read the hint id that we pass in to the constructor, so drop it Change-Id: I8ec377e51bddbc2a12a2fd226fc1a915afef59e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172862 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-04use less dynamic_cast when broadcasting SfxHint in scNoel Grandin
Change-Id: I25ee079b5b14f82012f868ae6b348fa6982571a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172853 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-09-03use less dynamic_cast when broadcasting SfxHint in swNoel Grandin
Change-Id: I308887f377b6b97b4949ab3a8815d3d423806e0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172827 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-03use less dynamic_cast when broadcasting SfxHintNoel Grandin
Change-Id: I24c947c20afeffffebe5ac794108c4ccecb680f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172828 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-27tdf#158556 prevent lambda from allocating on heapNoel Grandin
bit of a hack Change-Id: Icf60fc1bc69e8c44e5612c05469164439f14a249 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172465 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-26tdf#158556 simplify StylePool APINoel Grandin
StylePool is only used inside writer, and only in very limited ways. Rather move the logic for the limits functions inside StylePool so I can then reduce the complexity of the iterator. Change-Id: I12bc5965b74abace28ae9190b35661a34f5005be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172371 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-08-23tdf#158556 make SfxGrabBagItem hashableNoel Grandin
Change-Id: I0af373e9c5c93a82eb37437ac365677700d45853 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172311 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-08-22tdf#158556 make SfxInt16Item hashableNoel Grandin
Change-Id: Id4e6feb4d0072a204d68e5dc834c6828221ea617 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172263 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-20tdf#158556 avoid dynamic_castNoel Grandin
reduces load time by 2% Change-Id: I8b31257baacd49657cccf7cc6bd04408581803c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172102 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-16tdf#161741 tdf#161705 undo: delay ClearRedo until Undo finishesJustin Luth
I know NOTHING about the intricacies of Undo/Redo. However, this is my feeble attempt to add some sanity to it. It should not be the responsibility of the caller to know when they are allowed to call ClearRedo. This patch reverts commit 0cd000bb83719982c1fd2265ea040c82af5bf98e author Daniel Arato (NISZ) on Mon May 10 15:41:28 2021 +0200 tdf#141613 sw: avoid possible crash when undoing header creation which was not a sufficient hack. I hope this patch lays a better framework to handle future similar issues. vvv NAIVE OPTIMIST ALERT vvv mbDoing was added with commit 9cb53122e9e098bc8a6bf53c14b18415e369dd6d Author: Frank Schoenheit on Fri Oct 22 15:00:39 2010 +0200 undoapi: more I/SfxUndoManager changes in preparation of new Undo API features and has been untouched since then AFAICS, and there was never any mechanism to change mbDoing. In other words, it has been sitting there doing NOTHING. So, I am taking it over and using it how I imagine it was intended, and how it is documented. Change-Id: I7aa355cc6458ac8ba34ddb9ee73fc850dcbca702 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170793 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-08-15SfxScriptOrganizerItem should not subclass SfxStringItemNoel Grandin
it never actually uses the superclass value. It has been this way since initial import. Change-Id: I99708c3ad8f1f2727ef87af56c62165d55f348d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171904 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-15make SfxStringItem hashableNoel Grandin
which shaves some time off loading complex files. Note that this class is often used as a superclass, so I checked all of the subclasses and marked some of them as "does not support hashing" until they can be independently verified to be safe Change-Id: Id4187eda8d6145e89e17dc10c2e3113b7a93da85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171891 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-15merge CntUnencodedStringItem into SfxStringItemNoel Grandin
which simplifies the hierarhcy. We never allocate such a thing, we always allocate subclasses, and it has no real meaning by itself. Change-Id: Ie6b716c9ea6ca0efe0ae4f39ac345608c45534f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-07-31tdf#161846 use more GetItemSurrogatesForItemNoel Grandin
lots of time spent searching surrogates, and we can use GetItemSurrogatesForItem here. Also, add another SfxItemType which I missed in my earlier changes Change-Id: I9b989d75dbc3cdcdc1e97bf41836b92dd2852113 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171272 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-07-29tdf#161846 use unordered_map in SfxItemPropertyMapNoel Grandin
with large property maps, even a binary search starts showing up, but we can do a O(1) search here by using a map Change-Id: Ie7916076073e6dd393f0a1fb5a0db1b973999408 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171173 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-29use more GetItemSurrogatesForItemNoel Grandin
since it is considerably more efficient Change-Id: I224ff890f6dd52481621b46f912f1e8dbf65126c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171182 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-29tdf#161875 buffer NameOrIndex Items for fast SurrogatesArmin Le Grand (Collabora)
Problem is that collecting the Items using the ItemSets and PoolItemHolders is too expensive when used too often. For read-only access it is okay to have the Items directly registerd (for write access we *need* the ItemSets and PoolItemHolders, see iterateItemSurrogates). This is limited to Items which need to support surrogates, but can further be limited to the here critical ones - the ones derived from NameOrIndex. This is done here by checking if the Item is a NameOrIndex based one by adding a bool to the item that gets set in the NameOrIndex constructor. If needed this can be changed, e.g. by using besides the SFX_ITEMINFOFLAG_SUPPORT_SURROGATE another flag signaling this. Since only Items that are currently held by an ItemSet or a PoolItemHolder get registered it is not necessary to change the Item's RefCount in any way, doing that may lead (again, we had that with directly set Items at the Pool in the past) to long-living Items that only get cleaned-up when the pool/ document gets destructed. This buffering is now SfxItemType-based, no longer using the WhichID, so the result needs to be checked for WhichID additionally - if needed (?). All in all it's anyways a compromize, every usage of the surrogate mechanism is a 'hack' in the sense that for lazy reasons not the model data is traversed directly, but assumed that all Items set at a pool/model *are* model/document data (what is not always true). CheckNamedItem does not need to be static, changed that. Also all accesses to maRegisteredNameOrIndex *have* to work on the MasterPool instance, same as buffered ItemSets or PoolItemHolders, corrected that, too. Number of instances in the buffer need to be counted, else an instance will be removed too early: The same instance of an Item can be referenced by multiple sets/holders, so the first remove from the buffer would already remove even when the Item is referenced multiple times. Added that. Added more asserts & made sure that all constructors/ destructors of SfxItemSet do take care of registering Items for the surrogate mechanism as needed. Change-Id: Ib33e7f0bd4abd32a3bb68278f33b0abb9a4754c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171084 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-26fix in some missing SfxItemTypesNoel Grandin
Change-Id: I7dcb9768a8cd63200b8f8c50d8170e78ff5aeec2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171068 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-22Improve the perf for pool item scanning..Noel Grandin
for large complex documents with lots of shapes. When that happens, we spend a lot of time scanning the std::unordered_set inside DefaultItemInstanceManager. Since most of our items are already capable of being hashed, and thus avoiding the scanning cost, make it so we can use the HashableItemInstanceManager most of the time. Change-Id: I43f4c04e956d316c976bea67d1941529d2d91182 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170813 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Tested-by: Armin Le Grand <Armin.Le.Grand@me.com> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>