summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui
AgeCommit message (Collapse)Author
2023-12-05tdf#157729 SwNavigator: enhancement to group comments by threadsJim Raykowski
Change-Id: I64bc02e64d540a2bf602d2124deda1990dfb9f7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160011 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-12-04cid#1545597 Using invalid iteratorJulien Nabet
and : cid#1545537 Using invalid iterator cid#1545508 Using invalid iterator cid#1545494 Using invalid iterator cid#1545478 Using invalid iterator cid#1545427 Using invalid iterator cid#1545420 Using invalid iterator cid#1545400 Using invalid iterator cid#1545300 Using invalid iterator cid#1545258 Using invalid iterator cid#1545257 Using invalid iterator cid#1545200 Using invalid iterator cid#1545183 Using invalid iterator Change-Id: Ibf3a41902f34286967195c5c3b22e337a4b06809 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160322 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-29SwNavigator: Rework the SwContentTree Expand functionJim Raykowski
in effort to improve readability and operation. Change-Id: I7bfe485e24ee4cda3a3d99c522177950ad9ad399 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159887 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-11-29SwNavigator: Allow Sections, Indexes, and Headings trackingJim Raykowski
when in a table and Table tracking is off Change-Id: I0f5d069b80948aada9fee1338c29fc7809ffbe45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160056 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-11-29tdf#157681 SwNavigator: Add Protect and Hide menu items to SectionsJim Raykowski
context menu Change-Id: I6a79c06abe2cf4dd44d491046d8ee73d35dfe6ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159718 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-11-27tdf#158103 Enhancement to display Sections as an expandable/Jim Raykowski
collapsible hierarchy in the Writer Navigator Change-Id: I86bc17d11b4c5bf0ca0496e4ab62a0d77ddb625f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159812 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-11-25loplugin:fieldcast in SwOneExampleFrameNoel Grandin
Change-Id: Ic00ad388b2c18d90075db8e8d0d6b114ed13841a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159948 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-20c++20: use std::erase(_if) instead of std::remove(_if)+erase (sw)Julien Nabet
Change-Id: I67c231441b56f05da001beab5b893bc6a6a6a392 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159704 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-15avoid double map lookupNoel Grandin
Change-Id: I02018eaaf220c7835756eba6215425bac9cbc6f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159432 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-03SwNavigator: Improve field content sortingJim Raykowski
Shave some time off sorting field content entries for documents with large number of fields by eliminating a second sort and the loop used to determine if a second sort is done because a field is found in a frame. Also corrects ordering of fields in nested frames which prior to this patch are placed at the beginning of the field content entries. Change-Id: I5fbd67b6fb0ac1ef49a5df7721bb209d4cba4013 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158606 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-10-20tdf#86790: Add support for a word-style stylerefSkyler Grey
STYLEREF is a field type in Word which changes its content based on nearby paragraphs. For example, upon creating a styleref referencing "Heading 1" you will see the text of the nearest "Heading 1"-styled paragraph that is above the field. This patch implements STYLEREF in Writer as a cross-reference. By using "insert>cross-reference>styles" you'll be presented with a list of styles. Selecting one and clicking "insert" will create a field which has text from the "most relevant" instance of the style. To find the most relevant instance we first search up for paragraphs with the style, and if there are any we take the closest. If there weren't any, we search down for paragraphs with the style. This patch also updates our use of STYLEREF for chapters exported to docx by using it for all chapters not only those in headers and footers. This allows us to approximate more chapter field functionality even when moving between Writer and Word. Finally, this patch adds some tests for STYLEREF: - testTdf86790 tests that the "sample file with STYLEREF" document from tdf#86790 has the correct fields - testStyleRefSearchUp tests that the STYLEREF searches up when there are bits of text both above and below it - testStyleRefSearchDown tests that the STYLEREF searches down when there are bits of text below it only - testMarginalStyleRef tests that the STYLEREF searches from the page top when it is placed in a footer - testFootnotetyleRef tests that the STYLEREF searches from the reference mark when it is placed in a footnote Still TODO: - [ ] Update documentation - [ ] Implement reverse-searching (\l) and nondelimiter suppression (\t) - Probably these 2 will be in a followup patch Change-Id: I25dd7a6940abee5651a784b9059fe23b32547d6c Signed-off-by: Skyler Grey <skyler.grey@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157456 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-10-18use more SdrObjList::begin/end in swNoel Grandin
Change-Id: If882c1c7863618a313b2e06abacdbfa756dfff3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158114 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-17tdf#144349 related: Make master document navigator track Text contentJim Raykowski
Done, with a related patch to make the master document navigator track TOX content, to make the Navigator less likely not to have an item selected, which may be enough to resolve tdf#155741 - Allow insertion of items into master without a selected item Change-Id: I1a9d2a12a01ca2c5f3f162e8da932c04ced9a461 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157741 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-10-17tdf#144349 related: Make master document navigator track TOX contentJim Raykowski
Done, with a related patch to make the master document navigator track 'Text' content, to make the Navigator less likely not to have an item selected, which may be enough to resolve tdf#155741 - Allow insertion of items into master without a selected item Change-Id: I6df1b668c502cadbe057229e031ede9aa4f4089a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157695 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-10-16LOK: Navigator: fix expand problemsAttila Szűcs
Save/load content types' expanded status to view, and make sure it is synchronized with client. Treeviews now receive/send collapse event/status from/to client. I've rewritten the way how headings are opened by default (because synch of collapsed status broke that, as sub-headings were not expanded at core side). Change-Id: I80f5b4d99fe5224391a92c4609f94ddbcf37b8ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153771 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit b95750af717e0693a13c3ef35277779e1394e0ae) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158016 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-16LOK: fix for navigator: hide empty contentTypesAttila Szűcs
fixed that opening heading by default, first check if headings are not hidden, because it blindly opened the 1. type, but from now, that can be an other type, or nothing Change-Id: I86cac472d8cba9a46befc5a84ef073c01fa7243d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152779 Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit 61e2022110d3088bc1653713dc270beaacae4c74) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157966 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-16LOK: update navigator instantly on heading level changePranam Lashkari
problem: i.e: when you change the header level, it was not reflected instantly in navigator and required reopening it. That was due to header level change was not registed as change in LOK case Change-Id: I503eb6a3fe9d2801ea5b45b0a1096e8174360ddc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156239 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Attila Szűcs <attila.szucs@collabora.com> (cherry picked from commit 1fca94be7fafc305cf02c0134fbc2d7e5cfb2a03) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157967 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-15LOK: navigator: hide empty contentTypesAttila Szűcs
In case of LOK, do not insert empty contenttype to tree, and implement new way to find changes in contents, in hidden contentTypes, because the original checked only on the tree. Change-Id: Ib1e4da5e05b2ad4161c6a66a9c54111d558f66f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152735 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit ed3bb61461e4e394bd476b4ec57ff3025eca153f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157983 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-14LOK: Navigator: headings expanded by defaultAttila Szűcs
Called an expand_row for the first element of the contetnTree in the navigator constructor. Right now contructor is called every time when navigator is opened, it may change later. (desktop app do it only if navigator opens in a new window, not on sidebar) Change-Id: Ibe4b71e6a6ddb573269178f83c295b0c2cbd53b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151939 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit 09c40d669cac5f167fa68cb5c6ad94a6a9e2a844) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157960 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-14tdf#152029 related: Remove attention overlay on document view changeJim Raykowski
Fixes stale overlay that can happen when Navigator use causes a document view change. For example, when the Navigator is used to change a heading level or to delete a heading by key input. Change-Id: If4c0aa2e31f088a8fa12d7ed02012033c4d13509 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157892 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-10-13SwNavigator: Fix Indexes trackingJim Raykowski
Restores Indexes tracking when the document cursor is in TOX content which was lost in commit ca34204a39716ec9aa621e60ea50fb3c058c55f6. Change-Id: Ib0fed4b7a20b5d08b5c52eef28d13cf0044d87d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157693 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-10-12tdf#42787 SwNavigator: Add ability to delete SectionsJim Raykowski
Change-Id: If259772d6b84cdae48b75083c569fcf862416baf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157802 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-10-10tdf#156980 SwNavigator: Make headings delete even if they haveJim Raykowski
folded outline content Change-Id: If952d8d845c2eeec86231014b924f1632d2f5efe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157667 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-10-07Master Document Navigator: Improve sensitivity of tool box itemsJim Raykowski
Change-Id: I45f16267d7a46aacb5fb5ad4d138a63acfb687c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157579 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-10-06tdf#157584 Fix accessibility check doesn't move footnote into viewJim Raykowski
when a frame object is currently selected This patch introduces the function SwWrtShell::AssureStdMode to fix this bug and to replace duplicated code. Change-Id: I4106db983f79c92eea96a67b510393b2ac09a6d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157575 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-10-06Related: cool#7373 add an SfxHintId::ThisIsAnSfxEventHintCaolán McNamara
to avoid cost of dynamic_cast of SdrHint to SfxEventHint Change-Id: Ie0366b7d7ba828d8ffabeed4d65d7c7b275a3ed4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157633 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-09-30tdf#152029 Improve bringing sections to attentionJim Raykowski
Makes bringing nested sections to attention behave better Change-Id: I086f301b095191eac90c547b61e0cec590b03705 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157261 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-09-26tdf#152029 Fix sections not brought to attention in master documentJim Raykowski
SwSectionFormats::FindFormatByName doesn't seem to find section formats by name for sections of a document contained in a master document. This causes the document sections to not be brought to attention by hovering the mouse over the section entry in the Navigator. This patch makes the document sections be brought to attention by using an approach similiar to what is done to fill the sections entries in the Navigator content tree. Change-Id: I10e265d23a311440ac91d44b3185f807b205edb3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157231 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-09-22tdf#152029 Fix bringing a heading to attention brings a section toJim Raykowski
attention when the heading is the first content node in the section Change-Id: I37a8e03fc4aa7c59d82449d467279587c494b416 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157163 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-09-21tdf#152029 Don't include frame area top margin in the bring table toJim Raykowski
attention overlay Change-Id: I13b8c09640dfc269330a3786b6449139f5f64661 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157131 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-09-20tdf#139923 Part A: Master Navigator: Fix Insert popup menuJim Raykowski
Makes Master Navigator content tree popup menu item 'Insert' submenu items set sensitivity settings work for SalInstanceMenu. GtkInstanceMenu doesn't seem to require additional menu declarations for submenu items to be able to set sensitivity. Change-Id: Ifec28429927591f80859e3b20765c59374a64faa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156980 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-09-17tdf#152029 Don't include frame area top margin in the bring headings toJim Raykowski
attention overlay Change-Id: I1ddd842b01d2a134a281f97d9377a3d41b3ecb41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156981 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-09-17tdf#157277: fix Writer crash when hiding Sidebar + using bookmark in NavigatorJulien Nabet
Relevant part of bt (from exception thrown): 1 0x00007f00b5398a34 in SfxUnoDecks::getByName(rtl::OUString const&) (this=0x559ce97aff60, aName="NavigatorDeck") at /home/julien/lo/libreoffice/sfx2/source/sidebar/UnoDecks.cxx:45 2 0x00007f00b5398edf in non-virtual thunk to SfxUnoDecks::getByName(rtl::OUString const&) () at /home/julien/lo/libreoffice/instdir/program/libsfxlo.so 3 0x00007f008bc016a5 in SwContentTree::GotoContent(SwContent const*) (this=0x559ce849e850, pCnt=0x559ce4b8cc10) at /home/julien/lo/libreoffice/sw/source/uibase/utlui/content.cxx:5463 See full bts (initial + from exception thrown) here: https://bugs.documentfoundation.org/attachment.cgi?id=189632 Test if xDecks has "NavigatorDeck" before trying to retrieve it since it seems it's not the case when sidebar disabled. Change-Id: Ia0aa64ebf26ad06fd4fe4b14f949453ae7948456 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156978 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-09-11ITEM: Diverse further changes/cleanups/preparationArmin Le Grand (allotropia)
Added a counter for SfxItemSet usages, similar to the already added one for SfxPoolItems to allow quick info about evtl. problems/drawbacks of changes. Replaced enum SfxItemKind in favour of settable boolean flags directly at SfxPoolItem. These are organized as bitfield, do not need more space as the enum and allow to be set separately and multiple ones at the same time. Flags for PoolDefault/StaticDefault/DeleteOnIdle use this now and are quickly accessible booleans. It is not a problem that theoretically the flags for PoolDefault/StaticDefault could now both be set - this is internal to SfxItem stuff and not accessible from normal code, so can be managed. Added for debug build a bitfield boolean m_bDeleted that will be set in the SfxPoolItem destructor. Of course it's usability will depend on the freed space not yet being re-used, but will hopefully help in the debugger to detect reasons for failure (would have helped at least me before). Added for replacement of virtual method IsVoidItem() another bitfield bool m_bIsVoidItem that is set in the constructors of SfxVoidItem. Also had to add some constructors to do that which were defaulted before. This is mainly because the base class SfxPoolItem does *not* have a copy-constructor that copies the members (flags/RefCnt/WhichID) and we should keep that 'indirect reset' when Cloning. isVoidItem() is now a simple boolean member access - the bitfield does the needed masking. This spares one entry in the virtual function table of SfxPoolItem which is derived more than 500 times. Used the results of the experiment at https://gerrit.libreoffice.org/c/core/+/156774 to change some accesses to IsVoidItem() to use SfxItemState instead. This is for preparation of splitting up the two usages of SfxVoidItems, see commit text in the experiment. If this shows problems in the future those six places documented there may have to be changed back to use the new isVoidItem(), but should also check the ptr this time to be non-zero. Removed SFX_ITEMS_SPECIAL that is no more used anywhere. Change-Id: Ib687ca2362d72a4651c75aee0c67029088f68947 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156805 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-09-01remove AUTOFMT_DOCNODEBjoern Michaelsen
- remove obsolete GetInfo()s - introduce SwFormat::IsUsed() - move handling from GetInfo to SwClientNotify - make sure SwAutoFormatUsedHint is forwarded to clients where needed (e.g. SwTextFormatColl, SwDDETable, SwPageDesc, ...) Change-Id: I07d9e94ee791ca6e738b4eb3e597055ad8fbe755 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155504 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2023-08-30tdf#156978 SwNavigator: fix gtk3 crash on treeview get_sensitiveJim Raykowski
Change-Id: Ife866103b61940138cd044c666e0556760dcefa8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156272 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-08-27Fix typoAndrea Gelmini
Change-Id: Iadaed462970f7bc70769664920524ac2c193433a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156152 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-08-26tdf#156282 Make 'Fold/Unfold Including Sub Levels' menu itemsJim Raykowski
show for outline folding 'Include sub levels' mode In addition, when sub outlines are not visible in the document view, grey them out in the Navigator content tree instead of not including them. Change-Id: Icbdd254734df6c2fa95a7477a704e313b73d1cb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155881 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-08-20SwNavigator: Save some cycles by using break instead of continueJim Raykowski
When a content change is detected the Display function will clear and recreate the content tree from the content type member arrays, therefore, when a content change is detected there is no need to continue the loop here to set tree entry user data, which may have been the reason for using continue. Change-Id: Id1bc6fe6dddac54aa7299d3921c9352dc2314f79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155730 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-08-17SW: LOK: crashfix for ios navigatorAttila Szűcs
Added conditions to check if m_pNavigateByComboBox exist, because on ios, navigator does not have thit combobox. Change-Id: If5411a1687338caaa9fd76ae5471be4648ab61de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155388 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-03tdf#154210 Add help IDs for the Navigator context menuRafael Lima
This patch adds the missing HIDs for all entries in submenus of the context menu in the Navigator. The entries in the main level already work. For this patch to work, the related patch in the "help" repo needs to be accepted to create the target HIDs. Change-Id: Ic5917ce16a1430c6f7031ea6b9eb71a09f52624a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155049 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
2023-07-23tdf#156111 SwNavigator hyperlink dnd enhancementJim Raykowski
Enhancement to use the selected document text dropped on as the hyperlink name for hyperlinks created by drag-and-drop from the Navigator. Change-Id: I6c458b24574cae28ab390644b8a3e1982675c4c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154508 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-07-10tdf#146273 Do not allow non-numeric values for Navigator "Go to"Matt K
This change modifies "SwNavigationPI::EditAction" and adds a new "connect_changed" handler "PageModifiedHdl" to the spin control (needed to intercept text handling). In both functions we perform checks to ensure that only numeric values can be entered and only values within the page range of the document. This now matches the behavior of the "Go to Page" feature. To go to the first page, just enter a character input. To go to the last page, just enter a value higher than the total number of pages. Change-Id: Ia020d72f4bed5b98b668ba95888bc4bc1d65e07d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154156 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-07-04tdf#156128 Make drawing object hyperlinks created by dndJim Raykowski
from Navigator functional Change-Id: Ic12f3c43c079865e31c3bb89d9f277d3567d8c01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153887 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-07-02tdf#156112 SwNavigator: Disallow footnote and endnote dndJim Raykowski
Change-Id: I892f8a34f43629f3e76aa187299dc8c805b72545 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153855 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-06-29loplugin:unusedmethodsNoel Grandin
Change-Id: I95ab7581dec35b113cb657ce8e5ee27c89c73593 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153746 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-20tdf#122970 Fix direct cursor leaving screen trailHossein
Previously, an old method using RasterOp::Xor rendering (see tdf#38844) was used to draw the extra triangle left or right of the mouse pointer in direct cursor mode. Now, instead of drawing it manually, we change the cursor type to somewhat similar pointer type. There is no perfect match for the previous mouse pointer shape, so now instead of left triangle, PointerStyle::AutoScrollW is used. Also instead of right triangle, PointerStyle::AutoScrollE is used. Change-Id: Iadb955f9fcee0978a190e0b8920186a2579f3a4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153099 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-06-16tdf#154521 sw navigator: allow to query selected bookmark via UNOLászló Németh
If the hidden title of SwNavigatorPanel was emptied via UNO XPanel interface, store the name of the selected bookmark there. This allows to query the selected bookmark using UNO e.g. in add-ons, i.e. to disambiguate when multiple bookmarks are there on the selected text range. Note: this is a workaround because getDialog() of XPanel is not implemented for SwNavigatorPanel. Follow-up to commit c4a58634753a84b09f20f7271d6525a6656522d3 "tdf#154545 sw Navigator: select & track nested bookmarks" and commit 6eb1d540a1e599aa4fe0a321eddb9cc22e0546d3 "tdf#154521 sw Navigator: fix selection change event of bookmark". Change-Id: I94f79daf59516331155e0b36502821c769771207 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153162 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>