summaryrefslogtreecommitdiff
path: root/sw/source/ui/index
AgeCommit message (Collapse)AuthorFilesLines
2025-04-16Make UINames and Programmatic Names typesafeNoel Grandin2-54/+54
by wrapping up OUStrings inside some type-safe wrappers to make it obvious in the code what kind of name we are dealing with. The new classes are in sw/inc/names.hxx Note that I spun the names for table formats out into their own name class TableStyleName, becuase they are weird. Most of the time they are UINames, but not always. Change-Id: Iaf320639fd1aae8ba0f99866ff206906544c42be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178839 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-03-20tdf#165577 Fix bibliography regressionsVojtěch Doležal1-12/+11
Fix regressions introduced in b0299c4141f80dfd9989f1f376a960a9590f7a07, i.e.: 1) Do not clear bibliography type options to allow new bibliography entry creations 2) Set the short name so that it is not deleted when clicking Edit after creation Change-Id: Id3d500872cbbb578fc45cdf75f0b7f7f89144aa0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182586 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2025-02-07sw: Drop SwEntryBrowseBox_Base typedefMichael Weghorn1-14/+12
Change-Id: Ib7dee3649271ac84df62c12a0b0fb218944f8a39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181199 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2025-01-25tdf#164847 - Update menu items based on concordance file selectionAndreas Heinisch1-0/+4
Disable/enable the 'Edit' menu option based on the presence of a concordance file during the creation of an alphabetical index. Change-Id: I0a12ee21d32975b7f7962d6205986724e15145bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180734 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2025-01-21tdf#50743 tdf#37507 Improve scrolling while selectingOliver Specht1-1/+1
If the mouse leaves the document window scrolling of selections happens now in smaller steps so the user is able to stop at the intended position easier. Change-Id: Ifd21c92936021f8e2213d34446672e2a8eab568f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178724 Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Jenkins Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-01-20Make Programmatic Names typesafeNoel Grandin2-5/+7
by creating a wrapper class, to make it obvious in the code what kind of name we are dealing with. The new class is in sw/inc/names.hxx Change-Id: Ifb3e598d497f098cf1fce71b87c5e0da9f8a7151 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180406 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-12-22cid#1636856 silence Explicit null dereferencedCaolán McNamara1-0/+1
and cid#1636859 Explicit null dereferenced Change-Id: I6e618bebd0f61a1e796b367343bb98e7a01d29b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179139 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-22cid#1529286 silence Explicit null dereferencedCaolán McNamara1-0/+1
Change-Id: I03909c8ed7e9f2bf410412b02790aee0fbca6d58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179138 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-20tdf#164179 - Fix crash on BibEntry ComboBox selectVojtěch Doležal1-59/+68
One change in 7b99871635cd48c2a8a1d0afbd7afc60a45cc2ff (to ToxAuthorityField) caused crashing bug in IdentifierHdl due to it trying to call unsupported method on an input field to set its value. This patch not only fixes the crash, but also moves the volatile code into the SetFields method, which is also called in the constructor of the Dialog, meaning if similar change were made in the future, the crash would manifest immediately and hopefully not pass to production. Change-Id: I93abef0cdaa5c533523fbefd9514d1a287fd368b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178448 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-12-17Port SwCreateAuthEntryDlg_Impl to new weld::Grid APIMichael Weghorn1-36/+24
See previous commit Change-Id: I67f5ea16b5108e8359820850f0815e34db439ef1 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Mon Dec 16 11:02:00 2024 +0100 weld: Add weld::Grid to handle grid child positions for more background. Deduplicate the code a bit by introducing a `pTargetGrid` local var that points either to `m_xLeft` or `m_xRight`. This dialog can be triggered in Writer via "Insert" -> "Table of Contents and Index" -> "Bibliography Entry", then clicking the "Edit" button. Change-Id: Ib75c5f1225d9590849f1eaed083857dbe30ce551 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178634 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-17Port SwTOXWidget subclasses to new weld::Grid APIMichael Weghorn1-3/+3
See previous commit Change-Id: I67f5ea16b5108e8359820850f0815e34db439ef1 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Mon Dec 16 11:02:00 2024 +0100 weld: Add weld::Grid to handle grid child positions for more background. Change-Id: I7d6d23f0d1fec640c1de38c896f3e9b7e06ed70f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178633 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-17use more concrete UNO in swNoel Grandin1-13/+8
Change-Id: I664c7eff512625f988a2a278062719d3084845dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178645 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-12-07weld: Rename weld::Treeview selection signal/connectMichael Weghorn2-4/+4
Rename weld::TreeView member + methods to clarify that these are about selection changes: * m_aChangeHdl to m_aSelectionChangedHdl, * signal_changed to signal_selection_changed * connect_changed to connect_selection_changed In GtkInstanceTreeview, also rename the related methods calling signal_selection_changed accordingly for consistency. Change-Id: I299d7930484677395a0bdd0ff105df18688f2e04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178023 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-24Turn SW_MOD macro to a functionMike Kaganski1-2/+2
Change-Id: Ide1f6fd2fc8a80b31353a14e416505a2349cea2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177071 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-12loplugin:reftotemp in swNoel Grandin1-4/+4
Change-Id: I370d18643b0c83c60846a0b6f051440a043c647a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176486 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-12sw: use SAL_RET_MAYBENULL in GetDocShell()Xisco Fauli1-3/+6
similar to commit c796878e6af0fc7c886e813a0010d9402312eb5c Author: Xisco Fauli <xiscofauli@libreoffice.org> Date: Mon Oct 21 15:56:25 2024 +0200 tdf#163543: check GetDocShell() Change-Id: I4b489c59b7596466aea6b5c7b78248d82f193a0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175628 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2024-11-12clang-tidy: performance-unnecessary-copy-initialization in swNoel Grandin1-1/+1
Change-Id: I64342ae8c10738e276702e8ab2c0c0954be25752 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176441 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-08Refactor focus handling in `LevelHdl` and `SwTokenWindow`Darshan-upadhyay11101-13/+24
- Added a new `LevelHdlImpl` method with a `bool bGrabFocus` argument. - Refactored `LevelHdl` to call `LevelHdlImpl` with `true`. - Adjusted `SwTokenWindow::SetActiveControl` and `SwTokenWindow::SetForm` to skip `GrabFocus` when the argument is `false`. - Ensured focus behavior remains unchanged except for the initial "ActivatePage". Change-Id: If2f43e43f94c3762acd93974550ff0d2d66c6c21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174423 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit dbb054045fae8605794c17aae052a9d588fe33fc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175996 Tested-by: Jenkins
2024-11-08no need to take a copy of the getProcessComponentContext return valueNoel Grandin1-2/+2
we can just take a "const &". (found by running clang-tidy with the performance-unnecessary-copy-initialization warning) Change-Id: I20fd208c65303da78170b1ac06c638fdf3aa094b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176267 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-11-06cid#1556442 COPY_INSTEAD_OF_MOVECaolán McNamara1-1/+1
and cid#1607753 COPY_INSTEAD_OF_MOVE cid#1554790 COPY_INSTEAD_OF_MOVE cid#1556463 COPY_INSTEAD_OF_MOVE cid#1554838 COPY_INSTEAD_OF_MOVE cid#1556231 COPY_INSTEAD_OF_MOVE cid#1556878 COPY_INSTEAD_OF_MOVE cid#1554913 COPY_INSTEAD_OF_MOVE cid#1558064 COPY_INSTEAD_OF_MOVE cid#1557043 COPY_INSTEAD_OF_MOVE cid#1556985 COPY_INSTEAD_OF_MOVE cid#1556766 COPY_INSTEAD_OF_MOVE cid#1557351 COPY_INSTEAD_OF_MOVE cid#1554863 COPY_INSTEAD_OF_MOVE cid#1556764 COPY_INSTEAD_OF_MOVE cid#1556279 COPY_INSTEAD_OF_MOVE cid#1555970 COPY_INSTEAD_OF_MOVE cid#1556942 COPY_INSTEAD_OF_MOVE cid#1557964 COPY_INSTEAD_OF_MOVE cid#1555166 COPY_INSTEAD_OF_MOVE cid#1556496 COPY_INSTEAD_OF_MOVE cid#1557175 COPY_INSTEAD_OF_MOVE cid#1558054 COPY_INSTEAD_OF_MOVE cid#1557392 COPY_INSTEAD_OF_MOVE cid#1557850 COPY_INSTEAD_OF_MOVE cid#1555118 COPY_INSTEAD_OF_MOVE cid#1557131 COPY_INSTEAD_OF_MOVE cid#1556614 COPY_INSTEAD_OF_MOVE cid#1609650 COPY_INSTEAD_OF_MOVE cid#1555114 COPY_INSTEAD_OF_MOVE cid#1555241 COPY_INSTEAD_OF_MOVE cid#1555442 COPY_INSTEAD_OF_MOVE cid#1556473 COPY_INSTEAD_OF_MOVE cid#1557654 COPY_INSTEAD_OF_MOVE cid#1554689 COPY_INSTEAD_OF_MOVE cid#1556316 COPY_INSTEAD_OF_MOVE cid#1557929 COPY_INSTEAD_OF_MOVE cid#1554807 COPY_INSTEAD_OF_MOVE cid#1554858 COPY_INSTEAD_OF_MOVE cid#1555103 COPY_INSTEAD_OF_MOVE cid#1555517 COPY_INSTEAD_OF_MOVE cid#1556424 COPY_INSTEAD_OF_MOVE cid#1557252 COPY_INSTEAD_OF_MOVE cid#1557566 COPY_INSTEAD_OF_MOVE cid#1608020 COPY_INSTEAD_OF_MOVE cid#1557742 COPY_INSTEAD_OF_MOVE cid#1555884 COPY_INSTEAD_OF_MOVE cid#1554809 COPY_INSTEAD_OF_MOVE cid#1555336 COPY_INSTEAD_OF_MOVE cid#1555173 COPY_INSTEAD_OF_MOVE cid#1556067 COPY_INSTEAD_OF_MOVE cid#1557040 COPY_INSTEAD_OF_MOVE cid#1556235 COPY_INSTEAD_OF_MOVE cid#1557366 COPY_INSTEAD_OF_MOVE cid#1555910 COPY_INSTEAD_OF_MOVE cid#1556716 COPY_INSTEAD_OF_MOVE cid#1558022 COPY_INSTEAD_OF_MOVE cid#1555769 COPY_INSTEAD_OF_MOVE cid#1555940 COPY_INSTEAD_OF_MOVE cid#1557077 COPY_INSTEAD_OF_MOVE cid#1555270 COPY_INSTEAD_OF_MOVE cid#1555660 COPY_INSTEAD_OF_MOVE cid#1556302 COPY_INSTEAD_OF_MOVE cid#1555678 COPY_INSTEAD_OF_MOVE cid#1556538 COPY_INSTEAD_OF_MOVE cid#1557689 COPY_INSTEAD_OF_MOVE cid#1555009 COPY_INSTEAD_OF_MOVE cid#1555433 COPY_INSTEAD_OF_MOVE cid#1555671 COPY_INSTEAD_OF_MOVE cid#1555255 COPY_INSTEAD_OF_MOVE cid#1557681 COPY_INSTEAD_OF_MOVE cid#1557512 COPY_INSTEAD_OF_MOVE cid#1554958 COPY_INSTEAD_OF_MOVE cid#1555758 COPY_INSTEAD_OF_MOVE cid#1555597 COPY_INSTEAD_OF_MOVE cid#1558040 COPY_INSTEAD_OF_MOVE cid#1556476 COPY_INSTEAD_OF_MOVE cid#1557646 COPY_INSTEAD_OF_MOVE cid#1557950 COPY_INSTEAD_OF_MOVE cid#1557019 COPY_INSTEAD_OF_MOVE cid#1557885 COPY_INSTEAD_OF_MOVE cid#1556402 COPY_INSTEAD_OF_MOVE cid#1557906 COPY_INSTEAD_OF_MOVE cid#1556619 COPY_INSTEAD_OF_MOVE cid#1554683 COPY_INSTEAD_OF_MOVE cid#1556549 COPY_INSTEAD_OF_MOVE cid#1554747 COPY_INSTEAD_OF_MOVE cid#1554929 COPY_INSTEAD_OF_MOVE cid#1555362 COPY_INSTEAD_OF_MOVE cid#1557053 COPY_INSTEAD_OF_MOVE cid#1557891 COPY_INSTEAD_OF_MOVE cid#1555043 COPY_INSTEAD_OF_MOVE cid#1555107 COPY_INSTEAD_OF_MOVE cid#1557203 COPY_INSTEAD_OF_MOVE cid#1556728 COPY_INSTEAD_OF_MOVE cid#1557773 COPY_INSTEAD_OF_MOVE cid#1556845 COPY_INSTEAD_OF_MOVE Change-Id: I001fb67e597b096e992fd8a0cd6f3ec577767c33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176098 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-09-26tdf#148320 Toggle ToC/Index TitleSohrab Kazak1-2/+12
Implements the checkbox to toggle the title in the ToC/Index. The checkbox does not disable the text entry of the title only hard codes the title to be an empty string. Solution could use more work. Change-Id: I752953ebb6b970dd3e802d76bdc15f478b535a89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172477 Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-08-25cid#1608296 silence Overflowed integer argumentCaolán McNamara1-1/+1
and cid#1606815 Overflowed integer argument cid#1606617 Overflowed integer argument Change-Id: I4569190edd9b8d65e9b080a7ad0fac391f4a657e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172348 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-03cid#1606556 Overflowed constantCaolán McNamara1-1/+1
Change-Id: I7748094d226b8201cfbdf43d6ae7df0cd776f9e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169923 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-06-14loplugin:ostr in swNoel Grandin4-203/+203
Change-Id: Ibc8c3ce70d572e2e07ee6ae1e46996943cf90a5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168840 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-05-09WaE: C6011 Dereferencing NULL pointer warningsCaolán McNamara1-2/+3
Change-Id: I37166c03ffd0f8f76ddc03ce556b6e6341a02b48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167355 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-04-10tdf#146619 Drop unused 'using namespace' in: sw/Gabor Kelemen1-2/+0
Change-Id: I56463130ab617b0e11e237718cb8456913373818 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165696 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-04-04Resolves tdf#154209 - Fixes resize issue in Index Entry dialogHeiko Tietze1-0/+1
Change-Id: I83400b56d40f145c0e066c0c8b1783a1bae4cf28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165788 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-03-25Related tdf#160351: the field name can be shorter than two symbolsJulien Nabet1-1/+1
Change-Id: Ieb6b78b3f9802e66de642a9e708b11c55c0d9a11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165285 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-03-25tdf#160351: the field name can be shorter than two symbolsMike Kaganski1-1/+1
Change-Id: Id834ae2919661752b921510f766c9e9ff7fc16fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165282 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-27Drop std::as_const from css::uno::Sequence iterationsMike Kaganski1-1/+1
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-12tdf#158783 Correct compares of SwTOXMark ItemsArmin Le Grand (allotropia)1-17/+20
That item was never 'pooled', so operator== was not really ever used. It just compared the 'type', so pretty many instances were assumed to be equal, what is wrong. We discussed to implement it (there is quite some content), but we came to the point that it's only safe to say instances are equal when same instance -> fallback to ptr compare. This came into play since I identified/changed many (160?) places where SfxPoolItems were ptr-compared when doing that paradigm change in Items. This leads to the two methods 'areSfxPoolItemPtrsEqual' which just makes ptr compare and 'SfxPoolItem::areSame' which also will use op==. For the initial adaption I chose the wrong function adapting places where SwTOXMark were involved. Change-Id: I7df029ad4542719681b1455de17ed5990d248395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161963 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-01-11tdf#158783 sw: add some asserts for calling SelectTextAttr() ...Michael Stahl1-0/+1
... with mismatched point node and SwTextAttr. Unfortunately SwTextAttr doesn't have a member that points to the node, just half of its subclasses do... Change-Id: I78193ac47a9287f01b236b71934053299d0ffb23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161928 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-11-13tdf#135266 - Remember last used entry level depending on the index typeAndreas Heinisch1-1/+15
Change-Id: I4fe9342c28fc9135b73286e67464b16a1d910a9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159217 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2023-11-07ITEM: Get away from classic 'poolable' Item flagArmin Le Grand (allotropia)1-17/+17
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-09-13tdf#157223 get sequence name before toggling checkboxesCaolán McNamara1-2/+2
The expectation is that setting state/values on widgets from code doesn't trigger any callbacks, which are assumed to be from user interaction only. But explictly toggling on a radio implicitly toggles off the other radio, and while there is no callback from the explicit toggle on, there is from the implicit toggle off. Just move the explicit toggles to the end, after where the values are read which the callback affects. Change-Id: Icfc2c94950be671d6fc23789584b4d3c6e5395d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156898 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-09-10using decls should come after #includeNoel Grandin1-1/+1
Change-Id: I058551e87bca42adede860f6f299b0f7ae2af3b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156798 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-28Drop i18nutil::SearchOptionsMike Kaganski1-1/+0
It was mostly unused by now, only remained in a couple of function arguments, where callers actually passed SearchOptions2, and where internally it was converted back to SearchOptions2. Change-Id: Ib188ec3bf0de6d1f70a04eb90fb3a577df8b3d98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153687 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-06cid#1529285 Uninitialized pointer fieldCaolán McNamara1-4/+7
and cid#1529286 Explicit null dereferenced Change-Id: Ibe7832ddcfe0239aa71626075209ef6a052af914 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151452 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-05-05Reworked bibliography mark link target to have user-selectable typeVojtěch Doležal2-25/+42
Without this change, havign no link is not possible, if the bibliography entry has URL. This commit adds a select box for user to choose between target types (Entry URL, specific Target URL, None, bibliography table row) The main features are that it also makes it more obvious to the user and makes it possible to easily extend target types in the future. As for compatibility, files from before 7b99871635 are fully compatible without any hurdles, as missing property maps to the old behaviour. Bibliography marks saved after 7b99871635 will also revert to the old behaviour, however no actual data (such as target URLs) will be lost. Change-Id: Iad61dd8b4df337fa202f45d117313ee47ec20c05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150708 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-04-28Resolves tdf#153499 - Hide newly introduced frame labelHeiko Tietze1-0/+2
Frame content is not shown for existing entries Follow-up to 4ec75d22eb916e3809e9e92f77fd25e33f6b21ee Change-Id: Ic2b40b19424245ede326a5ef5b53f684ca8a3f94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151166 Reviewed-by: Seth Chaiklin <sdc.blanco@youmail.dk> Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-04-02Avoid conversions between OUString and OString in VCLMike Kaganski2-4/+4
Standardize on OUString, which is the main internal string class. Convert from/to OUString only when communicating with respective external APIs. Removes about 200 conversions from the code. Change-Id: I96ecee7c6fd271bb76639220e96d69d2964bed26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149930 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-18loplugin:stringadd use more O[U]StringCharNoel Grandin1-1/+1
Change-Id: I196e4539ad430a39415eff9d7170b33df7228230 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149062 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-07tdf#153396 - Bibliography marks improvementsVojtěch Doležal2-0/+36
Adds option to separate function of "URL" into (listed) "URL" and "Target URL" to allow for more flexibility (in that case if target URL is empty, bibliography mark hyperlink leads to bibliography table row if possible) When writing tests also found and fixed bug where exporting new file with anchor link bibliography mark crashes LO. Change-Id: Ic1b5c8c9590c0338dcfc4fa3a981142bddae0113 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147868 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-03-07no need to allocate these separatelyNoel Grandin2-12/+12
they are all one or two words in size Change-Id: I9a0f971d72c998c26e567c6abc2f9fe2a734207e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148338 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-20Related tdf#153090 Move dropdown next to checkboxSamuel Mehrbrodt1-2/+0
Avoid extra row just for the dropdown Change-Id: Ic75fec82875576a644ab09e1d6a4af8bed48dba5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147332 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-02-20tdf#153090 Fix widget display in non-gtk backendsSamuel Mehrbrodt1-2/+0
Two problems: * Two GtkFrames at the same position -> reorder * LO expects GtkFrame to have a label -> Remove GtkFrame Change-Id: Ice16c51facedaf449507a338e821b92ff28e44ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147331 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-02-16SfxViewShell::GetViewFrame never returns null, change to a referenceCaolán McNamara1-2/+2
various null checks can be seen to be redundant and removed Change-Id: Icf49c1de4b0302795d2769a370af3abceaad0221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147147 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-25tdf#153090 sw: add UI to SwTOXSelectTabPageMichael Stahl1-2/+74
Add a checkbox, label and a combobox, for Table of Figures/Table of Tables/Table of Objects - annoyingly the latter is sort of disjoint in the .ui file. Another annoyance is that the tab page sometimes reads its own state while initialising itself, overwriting its source. This is perhaps not ideal, but it appears to work if you don't look at it too closely. Change-Id: I3d3d79f37a75bf6570149d794a2363a53de2f59f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146143 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-12-21tdf#90641 - Insert bibliography dialog: sort entries by identifierAndreas Heinisch1-0/+2
Change-Id: I77210c1dff237deeb93df0102cd96685cb36d4f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144645 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-12-15sw: check SfxViewFrame::Current()Caolán McNamara1-4/+11
these ones looks potentially worth backporting Change-Id: I294fa029b53fa9d43cb738f07278301e2a06c210 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144245 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>