summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog
AgeCommit message (Collapse)Author
2024-07-11Don't save bullet changes when dialog was cancelledSamuel Mehrbrodt
Change-Id: Ia2a7feb2f47a59f7c693e2023f9c2c8b3b934f81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170336 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Tested-by: Jenkins
2024-07-11Fix to temporary variable nameHeiko Tietze
Change-Id: I87be9a7b5cd2627844ab7b5f0c838eddbeb01b05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170319 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins
2024-07-09loplugin:unusedenumconstantsNoel Grandin
Change-Id: Ifd22f5cc618137d715f78f0a04550256987752ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170186 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-05fill in more SfxItemType valuesNoel Grandin
found by doing some git grepping, we should now have values for all items in the hierarchy Change-Id: I397ca7e8f53f53737201385c4c8029b436895c1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170016 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-02Related tdf#161796 - Label change on gtk3 together with iconHeiko Tietze
Sequence matters Change-Id: I0a591cc1ec8c3c506ece47dc89f368096f6c8e51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169850 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-07-01Remove duplicated includeAndrea Gelmini
Change-Id: I9042bd1573e97164233ae9289193301ed01fc3c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169783 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-07-01Resolves tdf#161796 - Add a donate button to the start centerHeiko Tietze
Set Common::Misc::ShowDonation to false in order to get the legacy Extensions button Icon by Muhammad Haq on freeicons.io (slightly modified) Change-Id: I83d10d7230722d38914934d59d70ece471e62599 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169628 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-07-01tdf#158416: restore infobar text coloursStéphane Guillou
...which were lost with de1b926fa294273caefb29a507e117b8487e882b. rMessageColor is put back into the switch, but uses the settings' warning and error colours introduced by d7fd378b533c42f51d1d363f5da30b1fa1281f67 where applicable. Colours were checked for sufficient contrast in https://gerrit.libreoffice.org/c/core/+/47825 Change-Id: Iba42020b665e35c34f09b3788bcc973b0f8531d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168761 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-06-18loplugin:ostr in variousNoel Grandin
Change-Id: I7aa8ed716998a185996482dc561219b398a1c919 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169080 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-06-18Add SfxItemType to SfxPoolItemOliver Specht
The SfxPoolItem has a new member SfxItemType m_eItemType to compare types based on enums instead of typeinfo() which consumes a lot of time e.g. while AutoFormat is running Change-Id: I033ce67bc9a28ee4790f162380314de85fb4154e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166452 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-06-07replace fpicker-related Help::GetHelpText with core-side translationsCaolán McNamara
Change-Id: I109554a3282c4c919cfbf859918cf0f9d75cc967 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168509 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-06-06the remaining Help::GetHelpText calls don't want their parent as fallbackCaolán McNamara
so we can drop the hierarchical search these probably do nothing in the absence of the classic help. fpicker case might benefit from moving some a11y translations out of help into core. Change-Id: I01b8d0c7cc1a1b3697d3332e330c6b4654e76af1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168507 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-06-06sfx2: more diverse colors from string hash creationTomaž Vajngerl
Change-Id: I3aa1ddefd26435cd20ec17ec7750073ac1407dc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166945 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins
2024-05-29Resolves tdf#160937 - Improve dialog size for document propertiesHeiko Tietze
linefragment.ui and documentinfopage.ui modified to keep the usual dialog dimension Change-Id: I1777e4094e584d676a48855717827aaed413e251 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168139 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-05-27Related tdf#158839: pw and GPG encryption, add comments and TODOsMoritz Duge
Change-Id: I53dbc43dcd5dbf594b7cd562bfff0bd3bdcb8ec7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168000 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-05-22tdf#161209 - Reverts WhatsNew/Welcome dialogHeiko Tietze
dd889b290304b73f96a9a8e6e0f144d3aa2ba7e1 Change-Id: Idf0594c546e4d9ca263272ed1534b27948e8e930 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167956 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins
2024-05-15Drop unnecessary ConfigurationAccessGabor Kelemen
Change-Id: I8ae3273ab048df66fa6a7006cb00af7a4958e337 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167569 Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Jenkins
2024-05-11replace createFromAscii with OUString literals in OConfigurationNodeNoel Grandin
Change-Id: I19017bc993f0adafdae32313e0e01e69e1bbe80b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167517 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-11replace createFromAscii with OUString literals in OConfigurationNodeNoel Grandin
Change-Id: I6029cd4c894c6ab079cc508ba15df41ec5d4f8db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167516 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-05-10loplugin:ostr in sfx2Noel Grandin
Change-Id: I6306260d03c1208ec250c2f9a3860fa569f6d9c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167448 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-06tdf#160961: hide open remote file button from startcenter if theBalazs Varga
.uno:OpenRemote command is not available (e.g disabled in a config file). We also hide the Open remote file (and other) buttons in the Menubar if they are settled to disable. Change-Id: Ieb45c63b5d6aaf81d0eb7fa8947a9e109bee86f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167040 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Tested-by: Jenkins
2024-05-01WaE: C6011 Dereferencing NULL pointer warningsCaolán McNamara
Change-Id: Ic2231df89b900c17beac4627e3573b45aef0bc26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166954 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-04-29call SfxViewShell::Current() just onceCaolán McNamara
Change-Id: Iea3777cfb86c64c01cf1029ff3ba6a834d8c3619 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166706 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-04-22use more OUString literalNoel Grandin
convert some functions which merely create an OUString on the fly from a char literal to 'constexpr OUString' literals Change-Id: I617490baf2d976291b324cc991b59cd18f4b242c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166392 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-17sw lok: .uno:SetDocumentProperties: add file size parameterPranam Lashkari
problem: in LOK/online to support async save, files in jails may have different extensions (ie: .upload, .uploading) this caused problem to detect files as original file name may not exist. As result property like file size were always set to 0 Change-Id: I552aef203297470d01032659a266210970129e66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165769 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit aa4e10efc6e9ac92b0c652f238526aacbe2096c6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166171 Tested-by: Jenkins
2024-04-04Remove duplicate code.Moritz Duge
Change-Id: Ia32b0525ecdf5944c2ebd3045dc3d536941ed394 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165763 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-04-04-Werror=maybe-uninitializedStephan Bergmann
...as reported at least with some recent GCC 14 trunk. Lets assume that those calls to GetWindowPos are never meant to fail. (If it turns out that they can fail after all, the code would presumably need some modifications to mitigate the uninitialized reads from nL/nP.) Change-Id: I7695d3e54de2bf5d1e91b32cfdc84e994ccdd57d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165783 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-04-02tdf#146619 Drop unused 'using namespace' in: sfx2/Gabor Kelemen
Change-Id: I3748612644c9c4eb88d7fb6e2d512954de9c1002 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165538 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-27Resolves tdf#159573 and tdf#137931 - WhatsNew or Welcome dialogHeiko Tietze
To test the new dialog, change org.openoffice.Setup > Product > ooSetupLastVersion to some lesser value for the WhatsNew dialog or clear the entry for the Welcome version. Change-Id: Iec6de50edba0e5430e82f1db85e61d1e4501771d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163739 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-03-26tdf#160184 ask user if they want to trust an untrusted certificatePatrick Luby
gpgme contexts uses the "auto" trust model by default which only allows encrypting with keys that have their trust level set to "Ultimate". The gpg command, however, gives the user the option to encrypt with a certificate that has a lower trust level so emulate that bahavior by asking the user if they want to trust the certificate for just this operation only. Also, abort saving if no certificates are selected which is an indication that the user cancelled the Select Certificate dialog. Change-Id: I20951b1e31b2dcf8adb82243742f8c00fbaca8c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165260 Tested-by: Jenkins Reviewed-by: Patrick Luby <guibomacdev@gmail.com> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-03-23Harmonization of warning and error colorsHeiko Tietze
* hard-coded colors from infobar moved to settings * weld::LabelType::Warning and ::Error uses these colors * gtk3 native configuration removed Change-Id: Ia80584e9267b8385f7f6b25322f5a85a2570af68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165161 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-03-21ITEM: Remove InvalidateAllItems()Armin Le Grand (allotropia)
I checked if this is used, but it can be replaced using Clear() -> all. This prevents that the whole array of Items in an ItemSet gets set to INVALID_POOL_ITEM. I also checked if INVALID_POOL_ITEM/IsInvalidItem is needed at all representing SfxItemState::DONTCARE but it is and still will need to be set for individual Items. At last checked if SfxItemState::UNKNOWN and ::DISABLED really need to be separate states, but indeed there are some rare cases that need that. To make things more consistent I also renamed SfxItemState::DONTCARE to SfxItemState::INVALID to better match Set/IsInvalid calls at ItemSet. The build showed a missing UT and led to a problem due to the hand-made ItemSet-like SearchAttrItemList. The state 'invalid' seems to be used as 'unused' marker. It should be changed to use SfxPoolItemHolder and not need that. For now, set by using an own loop to set to that state. Change-Id: Ifc51aad60570569a1e37d3084a5e307eed47d06c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165035 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-03-12lok: use locale units in dialogs and sidebarJaume Pujantell
When oepning tha same doucment with different locales, the dailogs and sidebar show units (cm/inch) of the first locale (or the locale used in preloading, en-US) for all the views. This patch changes the units used according to the LOK locale. Change-Id: I3d515873bde661f2d9048bbc405843e83134cca7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164589 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 3ca938a25439d6f23bbd6830a96e5180ff94f757) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164619 Tested-by: Jenkins
2024-03-06Resolves tdf#159486 - Larger hitbox for close button on infobarHeiko Tietze
Change-Id: I83582c0c1ec7dd5e8f82bdf327e68ce88122ad03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164450 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-02-21Allow Document properties tab custom properties for LOKMéven Car
Change-Id: I4860f9bad69b3db0eef7b0e98159ca2b336b4f60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163611 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit f8f89de7a49db563b870dbaada6f010f2f75254f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163619 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-18ITEM: Rename for more control over SlotID usagesArmin Le Grand (allotropia)
Change-Id: I51585f1c15984a066262023184f668662853d20f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163556 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-01-27ITEM: Cleanup some Pool stuff with DefaultsArmin Le Grand (allotropia)
Sorted out some methods at ItemPool which process Defaults to make more clear what is going on and what which method is doing. Change-Id: I2568d3e03d0a56a14b6fe4e04521e1a8e22c000b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162643 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-01-27Drop std::as_const from css::uno::Sequence iterationsMike Kaganski
Obsoleted by commit 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and commit fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[] in internal code, 2021-11-05). Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-10tdf#158992 Only show style spotlight for styles that are usedJim Raykowski
in order to reduce visual clutter Change-Id: I23ab3119fcb1dde0079db4cebb9fc4460ccb76bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161847 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2024-01-04Resolves tdf#158810 - Hide recent actions while in template modeHeiko Tietze
Change-Id: I7291cc7a634a0507bb240bf417d346e7a50f3c6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161587 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-12-28Added boolean op's to SfxPoolItemHolderArmin Le Grand (allotropia)
...and adapted code to make use of it. This makes checking if the SfxPoolItemHolder instance contains an Item or not simpler and thus more readable, no need to access the Item* every time using getItem() - is okay, but not intuitive. Change-Id: I8042267cce670aca2641a91cd36285058f17ffbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161380 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-12-21Remove DeleteItemOnIdlexArmin Le Grand (allotropia)
There are some CrashReports in 7.6 which have DeleteItemOnIdle on the stack, but there is nothing reproducable. So I took a look... I first thought it's a MCGR regression, due to classes on the stack. But the Item involved is just random, can happen with any Item. Then I thought it may have to do with ITEM refactorings, but it happens with DeleteItemOnIdle involved, so also not the case. I already saw DeleteItemOnIdle when doing these and qualified as 'hack' in the way. already It is only on Windows and DeleteItemOnIdle is involved. This again (took a deeper look now) is an old hack to keep an SfxPoolItem 'alive' for some 'time'. For that, it triggers an async reschedule which then deletes the Item when being called. If the Item will be used after that is pure coincidence - seems to work in most cases. It seems as if for Windows the timing slightly changed for some scenarios, so a reschedule is too early. This can happen with this hack anytime. DeleteItemOnIdle is used in scenarios where SfxPoolItem* is e.g. returned, but is *not* anchored, so e.g. not member of an SfxItemSet. Or in short: Lifetime is not safe. DeleteItemOnIdle exists since 1st import, but was changed to AsyncEvent ca. 4 months ago (see 57145acf9ec47c23e307b7a5c0029d21d937cc35), so that may have caused it. It is possible that these errors happen on Windows since then. Before something more complicated was used to delete it late, but surely also not really safe. Due to ITEM refactor I have the knowledge/tooling to solve this. It will not be a 1-5 lines fix, but it is a hack and in the way for further ITEM refactor anyways. What we have nowadays is a SfxPoolItemHolder -> it's like an SfxItemSet for a single Item. It safely holds/ controls the lifetime of an SfxPoolItem. It is already used in quite some places. It helps to solve many hacks, also the ones putting Items directly to the Pool - due to there never was an alternative for that. In principle the ItemPool/ItemSet/Item paradigm was never complete without SfxPoolItemHolder. Thus I started to fix that (and remove that hack for good, sooo many changes over the years, sigh), but as said is not straightforward. Will have to change retvals of involved stuff to SfxPoolItemHolder - it's just two pointers and designed to be copied (one is a Pool, needed to cleanup when destructing). CopyConstruct/destroy just counts the RefCnt up/down, so cheap. 1st version compiling, let's check on gerrit... Corrected one error in QueryState for securitypage, also added some security features/asserts. Change-Id: Ida49fd35ca88ead84b11d93e18b978cb9e395090 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161083 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-12-19cid#1545222 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1545241 COPY_INSTEAD_OF_MOVE cid#1545303 COPY_INSTEAD_OF_MOVE cid#1545315 COPY_INSTEAD_OF_MOVE cid#1545319 COPY_INSTEAD_OF_MOVE cid#1545322 COPY_INSTEAD_OF_MOVE Change-Id: I284ba6e395f72abd7939667a8367ac99ab64194d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160955 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-10cid#1546298 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1546297 COPY_INSTEAD_OF_MOVE Change-Id: I8fbb2bb1692cc822a79652312c6268379226a9c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160517 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-19c++20: use std::erase(_if) instead of std::remove(_if)+erase (part 10)Julien Nabet
Change-Id: I7681a3ed5af058cf4356509d54a2195e6d4833e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159641 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-15tdf#157518: enforce password policy on sfx2/ui/password.uiSarper Akdemir
Change-Id: I115b5b05ed82f2f900bcd70ec4f52c7f749544e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159443 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2023-11-15tdf#157518: add password strength bar to sfx2/ui/password.uiSarper Akdemir
Change-Id: I181b71c6072a61651b33835f76e8deebb5f8d58a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159371 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2023-11-12Get the current view with SfxViewFrame::Current().Gökay Şatır
It was getting a null ptr for some reason. Signed-off-by: Gökay Şatır <gokaysatir@collabora.com> Change-Id: Ib3e285dc86cd3918b631b6993e9afb221994bfab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158727 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 6c7fd1dc50cbc3f8e61c741367223a4b4aefc98b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159337 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-07ITEM: Get away from classic 'poolable' Item flagArmin Le Grand (allotropia)
To understand this, some look back in history will be needed to see why it is as it is today. In some (reworked) comments 'poolable' is described as flag to hold Items in the ItemPool, also always having only one incarnation of each possible Item. This is not the original intention, but a side-effect. The reason is what the binary format in the office did: To save a document, the Objects & the Pool were saved, *not* individual Items *together* with the objects. The Pool was completely (binary) saved (and loaded) in one run. Temporary IDs were used to represent at the objects in file which Items were referenced. This *required* to have only one incarnation per item to have a minimal binary file size, thus this high effort was put into this. At doc load, the pool was loaded, all Items were set to RefCount 5000, the references from the objects were restored and then for each Item the RefCount was lowered by 5000 again and - if being zero - deleted. Items for UI were marked 'non-poolable' to *not* safe them with the document, so poolable was a flag to decide if that Info/Item was to be saved with the document - or more direct: if it is Model Data. Items are small, so if we prefer runtime it is okay to no longer being strict with this, anyways does not happen often and has only marginal memory effects - compared to runtime effects/savings. Other problems which this caused: One example is that objects in the UNDO stack were still in the pool, so e.g. deleted pictures were saved with the document despite no longer being used (!). That is the reason we have an UndoItemPool and a method MigrateItemPool to move stuff to that Pool when objects go to the UNDO stack - all of this is also no longer needed. Cleaning this up means to ideally have all items in the SfxItemSet, no longer at the Pool. The Pool should be reduced to a 'Default-Item- Holder' and a 'Slot-to-whichId-mapper'. This needs thorough cleanups/removals, but will be worth it because that massive simplification(s) will increase safety an runtime and make migrating to the goal of completely type-based ItemSet stuff easier for the future. Hopefully only view code in the office working with items will have to be changed for this. In this 1st step I already found that some 'compromizes' will be needed: - There are still Items that have to be at the pool to make the Surrogate-stuff working. This gives back all Items in a Pool of a type and is used in ca. 80 cases. Each one looks at these Items *without* context (e.g. a SfxItemSet at an Object would be a context), so if e.g. a dialog is open that temporarily uses Items of that type you would also get these - without knowing about it... To make that work there is still a mechanism to have Items at the Pool, but now just *registering* (and un-reg) them without any sort/search/ remove needs. Also only for Items that need that, so I evaluated the GetItemSurrogates calls and added some asserts when GetItemSurrogates tries to access an unregistered item type which needs to be added. - Another caveat is that there are about 250 places that directly put Items to the Pool (not all remove these, that is done at pool deletion, so some kind of silent 'garbage-collection' is in place). To have an overview I renamed the accessing methods to separate them from the same functionality at the SfxItemSet, which had the same names. An implementation does still add these directly to the pool, there is no way to cleanup those usages for now. In principle all these should be changed to hold the data at an SfxItemSet. I am still hunting problems. But you can build the office, all apps work (including chart) and you can do speed comparisons already. There are test throwing errors, so I hunt these now. It is hard to give an estimation about how much more changes/corrections will be needed. Completed adaptions to new registered Items at Pool, that reduces the failing tests. Still many that I need to hunt. Added stuff to work around that 'compromize' in ScDocumentPool: It overloads ::PutImpl of the pool to implement special handling for a single Item in SC, the ScPatternAttr. In former code that method was used from SfxItemSet and ::PutImpl at the pool directly, so it was only used in one place. I am not sure if it was used from the SfxItemSet functionality, but better offer it for now. To not waste too much runtime the callbacks depend on the boolean 'NewItemCallback' at the SfxPoolItem, it gets set for that single Item in SC and only then the callbacks trigger. I hope to get rid of those again, e.g. newItem_UseDirect is only needed since we have no 'real' StaticPoolDefaults currently - another thing that needs to be cleaned up in a next step. Since usages of impl(Create|Cleanup)ItemEntry and Direct(Put|Remove)ItemInPoolImpl got more and more similar I decided to unify that: move impl(Create|Cleanup)ItemEntry to tooling, make it globally available in svl and use it also directly for Direct(Put|Remove)ItemInPoolImpl. This slightly increases the failing tests again, but only since in Direct(Put|Remove)ItemInPoolImpl that fallback (e.g. tryToGetEqualItem) was used before, thus this is the same class of errors (SfxPoolItem ptr-compare) as the others which I will need to find anyways. Also fixed some missing stuff. Have now idenified and redirected all SfxPoolItem ptr-compares to be able to debug these - one cause for the remaining errors is probably that before with bPoolable those often were sufficient, but are no longer. Used the [loplugin:itemcompare] and a local clang build to do so, see https://gerrit.libreoffice.org/c/core/+/157172 Stabilized Direct(Put|Remove)ItemInPoolImpl forwards, added parameter to implCreateItemEntry to signal that it gets called from DirectPool stuff - currently needed. Hopefully when getting rid of that DirectPool stuff we can remove that again Added two more debug functionalities: - Added a SerialNumber to allow targeted debugging for deterministic cases - Added registering & listing of still-allocated SfxPoolItems at office shutdown Found PtrComp error in thints.cxx - POC, thanks to areSfxPoolItemPtrsEqual. Will hopefully help more with other tests Found some wrong asserts/warnings where I was too careful and not finding something/succeeding is OK, fixes some UnitTests for SC For SC I now just tried to replace all areSfxPoolItemPtrsEqual with the full-ptr-content compare SfxPoolItem::areSame. I also needed to experiment/adapt the newItem_Callback solution but got it working. Did that replacement now for SW too, found some places where the direct ptr compare is OK. Continued for the rest of occurrences, now all 160 places evaluated. Also done some cleanups. Massive cleanups of stuff no longer needed with this paradigm change. Also decided to keep tryToGetEqualItem/ITEM_CLASSIC_MODE for now. It is used for *one* Item (ScPatternAttr/ATTR_PATTERN) in SC that already needs many exceptions. Also useful for testing if errors come up on this change to test if it is related to this. Added forwarding of target Pool for ::Clone in SvxSetItem and SvxSetItem, simplified SfxStateCache::SetState_Impl and returned to simple ptr compares in SfxPoolItem::areSame to not do the test in areSfxPoolItemPtrsEqual. Debugged through UITest_calc_tests9 and found that in tdf133629 where BoxStyle is applied to fully selected empty calc the Item- reuse fallback has to be used not only for ATTR_PATTERN, see comment @implCreateItemEntry. Maybe more... Problem with test_tdf156611_insert_hyperlink_like_excel. Found that in ScEditShell::GetFirstURLFieldFromCell the correct SvxURLField is found and returned as ptr, but it's usage crashes. That is due to the SfxItemSet aEditSet used there gets destroyed at function return what again deletes the SvxFieldItem that is holding the SvxURLField that gets returned. This shows a more general problem: There is no 'SfxPoolItemHolder' that safely holds a single SfxPoolItem - like a SfxItemSet for a single Item (if Items would be shared_ptrs, that would be a safe return value). That will be needed in the future, but for now use another solution: Since I see no reason why EE_FEATURE_FIELD should not be shareable I wil change this for ow in the SfxItemInfo for EditCharAttribField. That way the Item returned will be shared (RefCnt > 1) and thus not be deleted. I changed the return value for GetURLField() and GetFirstURLFieldFromCell() in ScEditShell: At least for GetFirstURLFieldFromCell the return type/value was not safe: The SvxFieldItem accessed there and held in the local temporary SfxItemSet may be deleted with it, so return value can be corrupted/deleted. To avoid that, return a Clone of SvxFieldData as a unique_ptr. With all that UnitTest debugging and hunting and to get the paradigm change working to no longer rely on shared/pooled items I lost a little bit focus on speed, so I made an optimization round for the two central methods implCreateItemEntry/implCleanupItemEntry to get back to the speed improvements that I detected when starting this change. It was mainly lost due to that 'strange' chained pool stuff we have, so I added to detect the target pool (the one at which the WhichID is registered) directly and only once. Next thing to cleanup will/should be the pool and it's concept, all this is not needed and really costs runtime. Since implCreateItemEntry/implCleanupItemEntry are executed millions of times, each cycle counts here. Had an error in the last changes: pool::*_Impl methods use index instead of WhichID - most of them. Another bad trap, I really need to cleanup pool stuff next. Change-Id: I6295f332325b33268ec396ed46f8d0a1026e2d69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157559 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-11-03tdf#140314:Use hub.libreoffice.org URL with params in ExtensionsVenetia Furtado
Change-Id: Iccf76581de8dc44fe80aa818e9fb81c2cdf0967b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155571 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>