summaryrefslogtreecommitdiff
path: root/sw/inc
AgeCommit message (Collapse)Author
32 hourstdf#109272 sw: add form filling testcaseMiklos Vajna
Open the document, press tab to switch to a field, start typing, nothing shows up. Looking at the doc model dump, it turns out we inserted characters between the field start and the field separator dummy characters, instead of the field separator and the field end ones, which is quite bad. Turns out that in the meantime commit c80606bb23fd42e41710d70a96b7ffaf948384a6 (tdf#109272: make sure that Delete / Backspace move cursor correctly, 2024-01-18) fixed this, kind of by accident: the comment says the motivation there was change tracking. Add a testcase to to make sure this now continues to work. Change-Id: I1a300d8064f7c2a30aafeefc6cb5612bfcd9a06a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165368 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2 daystry to use more reliable mechanism in AddLinkTargetNoel Grandin
The commit that introduces this code says commit 89ffe6149a0e14bcde89d7981362aa1556849ab0 Author: Tünde Tóth <tundeth@gmail.com> Date: Wed Sep 18 10:13:50 2019 +0200 tdf#127605 DOCX export: fix internal hyperlinks to image target jumping to the paragraph anchored by the image as a workaround. But using the SwNodeIndex ring to do this only works by accident, there is no guarantee that the SwNodeIndex is organised in any way at all. Change-Id: I9f886522ddf83b6799da9dd3d1f27e4b6c44bdc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165264 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2 dayssw: document SwFormatFillOrderMiklos Vajna
Something to be mostly ignored, I guess. Change-Id: Iab7dc0f79d4cccb6d6b2a25e42d9fd1eb7e2b8dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165300 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
7 daystdf#158556 speed up SwNodes::RemoveNodeNoel Grandin
Change-Id: I49daf93793c67da6261081fce92e1fed1a71248b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165139 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
7 daysfix some typos in sw::RingNoel Grandin
introduced by commit d150ace12b6d8fbb30664d1de1001622720bd53b Author: Bjoern Michaelsen <bjoern.michaelsen@canonical.com> Date: Fri Dec 5 03:54:55 2014 +0100 stick to code conventions for new code Change-Id: I97b257b85fba5734c6f5dedb141c448e6d30ee46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165058 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
8 daystdf#158556 speedup docx loadNoel Grandin
Avoid O(n^2) loop in SwXFrame::setPropertyValue, we even have an index to search for this stuff Reduces load time from 325s to 172s Change-Id: I6c6c03206ef81be1d7d7702a4313acd23d75442d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165044 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
9 daystdf#158885 cui offapi sw xmloff: fix hyphenation at stem boundaryLászló Németh
Add new hyphenation option "Compound characters at line end", equivalent of libhyphen's COMPOUNDLEFTHYPHENMIN, to limit bad pattern based hyphenation of compound words using morphological analysis of Hunspell. * Add checkbox to Text Flow in paragraph formatting dialog window * Store property in paragraph model: css::style::ParagraphProperties::ParaHyphenationCompoundMinLeadingChars * Add ODF import/export (loext:hyphenation-compound-remain-char-count) * Add ODF unit tests Note: slower Hunspell based hyphenation is used only if ParaHyphenationCompoundMinLeadingChars >= 3 (we assume that libhyphen hyphenation patterns cover the smaller distances correctly). Hunpell based hyphenation doesn't introduce new hyphenation breaks, only detects the stem boundaries from the libhyphen based hyphenation breaks. Follow-up to commit c899d3608d30f3ab4c2bc193c1fcd765221614a4 "tdf#158885 sw: don't hyphenate right after a stem boundary", replacing hyphenation zone dependence with the new "Compound characters at line end". Note: preset COMPOUNDLEFTHYPHENMIN values aren't loaded yet from hyphenation dictionaries. Note: the suffix of the last stem of the compound is always hyphenated, i.e. the distance limits only hyphenation inside the stem, not inside its suffix or at the end of the stem before the suffix. Change-Id: I46a0288929a66f7453e3ff97fbc5a0c6a01f038f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164983 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
9 daysremove dead code in SwFEShell::GetConnectableFrameFormatsNoel Grandin
ever since commit 22fdd136fd549d69030ae375f56539540a291950 Author: Jens-Heiner Rechtien <hr@openoffice.org> Date: Thu Sep 27 07:51:18 2007 +0000 INTEGRATION: CWS swwarnings (1.35.128); FILE MERGED 2007/08/20 15:32:01 tl 1.35.128.5: RESYNC: (1.38-1.40); FILE MERGED Change-Id: I141257483abf25c4af4a457bb4c181c38ebc788d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165032 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
10 dayssw: document SwCursorMiklos Vajna
Not to be confused with SwShellCursor, which is only the UI cursor, while this is more general. Change-Id: I2b83dbaa48c9e94db45e997b2b8fef23e3840800 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164989 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
12 daysloplugin:unusedfieldsNoel Grandin
Change-Id: I91ec189ea1f389a978ef56339bbf6b43cbec6798 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164929 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-13reduce symbol visibility in swNoel Grandin
Change-Id: Ib3edefc365d3c605c3024e160572fa4030100ef1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164724 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-12sw: extend the SwFormatChg documentation a littleMiklos Vajna
It's not directly SwFormatChg that describes the change of a format, it's sw::LegacyModifyHint that has pointers to the old and new pool items, which can be SwFormatChg / RES_FMT_CHG. Change-Id: I997d63ea380fbd8cc6434982d348edad2e4bb44b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164698 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-03-11tdf#157664 Drop operator != where respective operator == is definedTuukka Orava
Change-Id: Id0313cbaf399af94df7ced18a8ad55deec53be33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164638 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-11Use weak reference to SfxObjectShell in SfxEventHint to avoid use-after-freeMike Kaganski
The events may be processed after the shell has been destroyed. This is happening reliably after commit e2bfc34d146806a8f96be0cd2323d716f12cba4e (Reimplement OleComponentNative_Impl to use IGlobalInterfaceTable, 2024-03-11) when controlling LibreOffice from external Java scripts; but obviously, it could happen before as well. Now SotObject inherits from cppu::OWeakObject, instead of SvRefBase. Change-Id: I73a3531499a3068c801c98f40de39bdf8ad90b2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164458 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-07Revert hyperlinkInfoAtPositon changes.Gökay Şatır
Revert "Implement hyperlinkInfoAtPosition for Impress." This reverts commit 876543305c78cb596720da087454a5c54e5feb06. Revert "Readonly Hyperlink Info - normalize the clicked coordinates." This reverts commit 322669725b771f5fa2b3c10c5fb73238ca3713f6. Revert "Implement hyperlinkInfoAtPosition function for Calc." This reverts commit be01dd78c47b51b19603a6259504e29b11979b0b. Revert "Implement hyperlinkInfoAtPosition for Writer." This reverts commit 6773c8929690f557d29bc282dd8f5c4381da3484. Revert "In readonly mode, we restrict many events like click." This reverts commit a4f3b97e506f38e0c43d6fbf1192cc523750a9fd. (cherry picked from commit c3f1d63178d6aaa0888085c7b641eb6d49a18276) Conflicts: sc/source/ui/unoobj/docuno.cxx sd/source/ui/unoidl/unomodel.cxx sw/source/uibase/uno/unotxdoc.cxx Change-Id: Ie821a4bca6e6b4649cea17748c44af105cd45d30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164481 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-03-06Fix buildMike Kaganski
... after commit fcd4222d36e1864452163e5c94976eea353bbaf0 (sw: SelectAll of section with RES_PAGEDESC corner-case, 2024-03-06). uiwriter.o : error LNK2019: unresolved external symbol "public: class SwFrameFormat const * __cdecl SwFEShell::SelFlyGrabCursor(void)" (?SelFlyGrabCursor@SwFEShell@@QEAAPEBVSwFrameFormat@@XZ) referenced in function "public: void __cdecl testPasteTableAtFlyAnchor::TestBody(void)" (?TestBody@testPasteTableAtFlyAnchor@@QEAAXXZ) C:\lo\build\workdir\LinkTarget\CppunitTest\test_sw_uiwriter.dll : fatal error LNK1120: 1 unresolved externals Change-Id: Ic82d2543bbe1349c6f20f9c64d083f47428e31a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164386 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-06tdf#126464 Remove "Numbering on/off" UNO commandAhmedHamed
Removed code where uno:NumberOrNoNumber or FN_NUM_OR_NONUM is mentioned Didn't remove NumOrNoNum function as it is used in other places Change-Id: I7809974796580e4d43ad203817d4225301c30536 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164175 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-03-05make more symbols private in writerNoel Grandin
Change-Id: I2c4745910fc3654f2021e77f9fa590d3da3464ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163749 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-04tdf#132599 cui offapi sw xmloff: implement hyphenate-keepLászló Németh
Both parts of a hyphenated word shall lie within a single page with ODF paragraph setting fo:hyphenation-keep="page". The implementation follows the default page layout of MSO 2016 and newer by shifting the bottom hyphenated line to the next page (and to the next column, see last note). Note: this is a MSO DOCX interoperability feature, used also in DTP software, XSL and CSS. * Add checkbox/combobox to Text Flow in paragraph dialog * Store property in paragraph model (com::sun::star::style::ParagraphProperties::ParaHyphenationKeep) * Add ODF import/export * Add ODF unit tests New constants of com::sun::star::text::ParagraphHyphenationKeepType, containing ODF AUTO and PAGE (borrowed from XSL), and for the planned extension ParaHyphenationKeepType of ParagraphProperties: – COLUMN (standard XSL value, defined in https://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#hyphenation-keep) – SPREAD and ALWAYS (CSS 4 values of hyphenate-limit-last, equivalent of hyphenation-keep, defined in https://www.w3.org/TR/css-text-4/#hyphenate-line-limits). Note: the implementation truncates only a single hyphenated line, like MSO does: the pages can end in hyphenated lines (i.e. in the case of consecutive hyphenated lines), but less often, than before. Clean-up hyphenation dialog by collecting "Don't hyphenate" options at the end of the hyphenation settings, and negating them (similar to MSO and DTP), adding also the new option "Hyphenate across column and page": [x] Hyphenate words in CAPS [x] Hyphenate last word [x] Hyphenate across column and page Note: ODF fo:hyphenation-keep has got only "auto" and "page" attributes, while XSL defines also "column". Because of the interoperability with MSO and DTP, fo:hyphenation-keep="page" is interpreted as XSL "column", avoiding hyphenation at the end of column, not only at the end of page. Change-Id: I5c6b7adc0671a5a790568e7bf1d33256e607f85f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164158 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2024-03-04sw: for Undo, add FLY_AT_PAGE in GetFlysAnchoredAt()Michael Stahl
SwUndoInserts::IsCreateUndoForNewFly() now returns true for these, so they get Undo objects on Paste, which is of course wrong. (regression from commit 359e5af31c330a137fed6ba3140b77cd759c28bb) Change-Id: Id5abb38c662a9c55826cde6d8b151613c852de72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164221 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-02-28tdf#139004 Prevent crash when deleting footnote stylesMatt K
The problem was that a pointer was assumed valid, but was not, so now we check the value of the pointer before using it. Works now to delete footnote style. Also, change assert to variable check to ensure the proper method is only called when it is supposed to be, and to prevent a failing assert. We add a new Destr method on SwFormat so that it can be called from the SwTextFormatColl context and thus avoid the assert. Change-Id: Ia4b8029fb89e627cd685b3317606e2b9d60cf248 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162965 Tested-by: Jenkins Reviewed-by: Matt K <mattkse@gmail.com>
2024-02-28tdf#151710 Enable enclosing of selected text with charactersYiğit Akçay
This patch implements a new setting in Tools -> Options -> Writer -> Formatting Aids -> Autocomplete -> Enclose with characters. When this option is enabled (default), selected text is enclosed with parentheses, square brackets, curly braces or quotation marks, depending on which character is pressed. For example, if the selected text is "abcd", the option is enabled and the button for the character '(' is hit, the text is replaced with "(abcd)". Change-Id: Ibc5b7be3cc96f00217dd068971e7c07e68439700 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162583 Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Tested-by: Jenkins
2024-02-27sw: document SwFormatEditInReadonlyMiklos Vajna
What it is, which item set can contain it, where is the UI. Change-Id: I470b057418c551da78b174dd02a22206a18dd03f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163999 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-02-24tdf#147731 sw: fix memory leak in SwDoc::CopyPageDesc()Michael Stahl
Commit 963de9feb37105560fde14b44d992e47f341bb5b "sw: fix issue with copying stashed frame format" fixed the actual bug here, but introduced a new memory leak. This causes an assert in CppunitTest_uiwriter3: cppunittester: svl/source/items/itempool.cxx:779: void SfxItemPool::Remove(const SfxPoolItem&): Assertion `rItem.GetRefCount() && "RefCount == 0, Remove impossible"' failed. The assert happens only when this is backported to the libreoffice-7-6 branch, because commit ab7c81f55621d7b0d1468c63305163016dd78837 "ITEM: Get away from classic 'poolable' Item flag" removed the assert. The problem is that a SwFormatFrameSize inside a footer SwFrameFormat is leaked 4 times, because 4 SwFrameFormats are leaked; the leak is that SwDoc::CopyPageDesc() creates a new pNewFormat, passed it to StashFrameFormat(), which copies it but doesn't free it. There is also a usage of std::shared_ptr here that is very questionable; SwFrameFormat should never be shared between different SwPageDesc. (regression from commit b802ab694a8a7357d4657f3e11b571144fa7c7bf) Change-Id: I44133bc5e6789a51ce064f1aa5ea8b325224365b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163854 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-02-23sw doc model xml dump: extract SwTableBox::dumpAsXml() from SwStartNodeMiklos Vajna
Ideally each class should just dump itself. Change-Id: I8b7251553d12673258ae885436c56e342b3ddf8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163801 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-02-22UBSan RTTI fixesNoel Grandin
after I missed a bunch of stuff when testing UBSan with commit 3ba92b5f1eaf7d4447a0943ea260db515ca799dc hide more symbols Change-Id: Id3cb0b70b9fa24c7e3fba7fd565eb658dafa00f8 Change-Id: I369587ed3e14e50ca272037b9d950b62841695d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163703 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-19hide more symbolsNoel Grandin
using the bin/find-can-be-private-symbols.py script to find classes with large numbers of exported symbols that can hidden. before exported = 58104 imported = 30810 unused_exports = 35433 after exported = 55094 imported = 31073 unused_exports = 32423 Change-Id: Idd0a70ee3740afd5ca1a86771e0e2ff8090d102d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163456 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-17Remove more unneeded const_castMike Kaganski
Change-Id: If62cf2011ae63501cdf5e87a6ee7402aa74b2b3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163525 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-17Generalize search algorithms in sorted_vectorMike Kaganski
This allows to simplify the code somewhat, and also to relax requirements to the arguments, e.g. allowing to pass const objects to search in vector containing non-const objects. Change-Id: Id34911a8694bbdec275d22b51ca4a0845c9fa4c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163519 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-16cool#8270 sw lok: fix bad statusbar pagenum string on async binding updateMiklos Vajna
This is similar to commit 51d8a2ef54751403fa707816e27ddb4e7faa8231 (cool#7492 sfx2 lok: fix bad view id / statusbar string on async binding update, 2024-01-08), but here the problem was that the async job tried to get the current view from the model, which is not correct. Fix the buggy page number string in the status bar by requesting callers of SwViewShell::GetFirstLastVisPageNumbers() to provide the view, given that SwViewShell itself doesn't have access to SwView, only the SwWrtShell subclass would have that. Change-Id: I7e10c05d2429ea2771d6c3e46ac9ce77c0eb2bbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163474 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-02-16Deduplicate and unify SwNodes::Go(Next|Prev)(Section)Mike Kaganski
The "Next" methods are made static, just as "Prev" ones. Overloads taking SwNodeIndex and SwPosition are implemented using a common implementation function, to avoid code duplication. Change-Id: I4035188b5c29d19824cd6d031e05d668d5cf1e86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163443 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-15tdf#159565: make sure to handle leading hidden section correctlyMike Kaganski
Change-Id: I41c7d2b6e765f03c72a968fd05e8de7047f1ce41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163371 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-14tdf#159565 prerequisite: make hidden sections have zero-height framesMike Kaganski
As mentioned in commit bb733957dd39e6f0b9d80bb59eb0177188794797 (tdf#114973 sw: enable SelectAll with hidden para at start/end, 2023-01-27), the hidden sections didn't have frames. That prevented correct handling of the case when such a frame was in the beginning of the document. This change re-implements the hidden section to use 0-height frames, like hidden paragraphs, as a pre-requisite for a follow-up change. Some layout breakages noticed while working on this are unit-tested now. This change needed to handle the case when the first section is hidden, and then goes a page break with page style. In this case, the page style must apply to the very first page of the document. Implementing this now, when the frame that defines the page style is not the first in the document, I accidentally fixed also the previously broken case when the first paragraph was hidden. Now the page style defined in the second paragraph's page break will apply correctly. This change makes hidden sections break outer section's frames. This means that when text borders are shown, there will be an artifact in the place of the hidden sections (a horizontal line breaking outer frame). I suppose it's not a problem, actually helping to see the layout better, so in line with the "show text borders" helper functionality. If this proves to be problematic, this can be handled specially in a follow-up. Change-Id: I14ebf0559b463186aba28902cd10c5cc978ba456 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163151 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-12tdf#159662 Add table alignment and left/right spacing to sidebar in WriterOliver Specht
Change-Id: I12d898f21ca8c7d581aaa1c587c5b6434a35f516 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162769 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-02-12Resolves tdf#158531 - Connector lines for Keep Ratio settingHeiko Tietze
Icons taken from https://thenounproject.com/icon/lock-89649/ and https://thenounproject.com/icon/unlock-89647/ (licensed PD) Change-Id: I7efd25e83726ced7dee4f876cf4bb4c8f54408df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160460 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-02-12ITEM: ItemPool Rework (I)Armin Le Grand (allotropia)
Driving forward the Item reworks I now take the ItemPool in focus: It now does not hold any items anymore and should be renamed to something like ItemInfoProvider/ItemHelper, since it's main purpose is to provide the Defaults for the Item functionality. There is that SfxItemInfo, only a struct and bundling SlotID and ItemFlags. There are also the DefaultItems, just handled as ptrs in an array. It is/was always error-prone to keep these in sync. Remember that it's also necessary for the order to not only being sorted but being increments of one with no gaps allowed in the WhichIDs to which the Items are bound. I now bundled that to a new class ItemInfo that joins WhichID, SlotID, ItemFlags and the default Item. This is a pure virtual base class, it comes in three derivations: (1) ItemInfoStatic: This is supposed to be global static and hosts the Item in a std::unique_ptr to ensure cleanup. It is designed to be constructed once during runtime and being shared globally. It allows the ItemPtr to be nullptr to mark as non-static (if initial static is not possible for some reason) but still offers the needed data. Most cases (95%+) are of that case. The contained Item is owned by that instance. The flag isStaticDefault() is set at the Item. (2) ItemInfoDynamic: This is supposed to be used for cases where the Item cannot be static: Mainly for SfxSetItem (that needs a Pool itself in the contained SfxItemSet, so lifetime is bound to that Pool), but other cases showed up in the transition. These instances live while the Pool lives and get destructed when the Pool goes down. Also uses std::unique_ptr for the Item instance for as much automated cleanup as possible, the contained Item is owned by that instance, the instance by the Pool. The flag isDynamicDefault() is set at the Item. (3) ItemInfoUser: This is used for UserDefaults that can be set for every ItemInfo entry to 'overshadow' the default from the 'outside'. It uses a regular Item and the central access methods implCreateItemEntry/ implCleanupItemEntry to manage the Item instance, thus works like a SfxPoolItemHolder. The Item instance can be globally shared and re-used even when the Pool goes down. Instances belong to the Pool and are cleaned up when the Pool goes down. This Item does not need any further flag to be set. The ItemInfos are organized using a class called ItemInfoPackage: This bundles groups of ItemInfoStatic to functional instances. There are derivations/ implementations of this e.g. for Writer ItemPool bundling all the needed defaults for Writer, similar for draw/impress, Calc and other usages. These ItemInfoPackage can be 'registered' at an ItemPool using it's method registerItemInfoPackage. This does all the needed stuff to setup that group of ItemInfos at the Pool (It even sets internal vars First/LastWhich, that info can just be derived from the buildup ItemInfo Ptrs). The ItemInfoPackage has methods 'size()' and 'getItemInfo(index) to allow looping over it and deliver the infos the Pool needs. The (forced, pure virtual) overloads of getItemInfo in the specific implementations check for the ItemPtr being nullptr and create a exclusive incarnation of ItemInfoDynamic for the Pool if needed, returning that. The Pool owns the ItemInfoDynamic incarnations and uses the ItemInfoStatic directly. On shutdown it cleans up the ItemInfoDynamic as needed. The ItemInfoUser is used by the Pool when a UserDefault is set/used: for SetUserDefaultItem, GetUserDefaultItem, ResetUserDefaultItem. It is not held in a 2nd list, but directly in the list of ItemInfo'ptrs: To keep track of this an unordered_map is used that helds the original ItemInfo associated with the WhichID. That way no two lookups (as before) are needed to get the current Pool's default for any WhichID. The derivations of ItemInfoPackage are encapsulated and just allow access to an ItemInfoPackage& with a single method as return value. All use a static local instance of a std::array<ItemInfoStatic, FIXED_SIZE> which constructs all ItemInfoStatic and the static Item instances - if already possible. Sometimes it is necessary to overload the constructor to set some static instances for Items later than the lib init. These are also just marked with nullptr as Item instance. Some need to overload getItemInfo to complete instances of ItemInfoStatic, if needed, or create and deliver instances of ItemInfoDynamic. The registerItemInfoPackage also offers a optional lambda callback: there were two cases where local data from the Pool was needed to incarnate the item - just add that to the call to registerItemInfoPackage if needed, see examples in the adapted code. For the re-use of Items this means that now in SfxItemSet/SfxPoolItemHolder *true* static Items can and will be used without RefCount directly and globally. This is also the case for dynamic Items, with the exception of differing Pools for SfxSetItems which cannot be done. Future: That design is already prepared to allow solving that Pool-chaining problem: currently there are master/sub-pools and all accesses have to traverse that structure before even doing anything. For the future the idea is more to 'compose' a Pool by registering ItemInfoPackages, e.g. for Writer pool you may start with SfxItemPool, register the writer-specific ItemInfoPackage, then the one for DrawingLayer (if needed) and the one for EditEngine. It should also be possible to get to smaller granularities of that packages. Ideas for new ones will emerge. We might also think about composing Pools which can e.g. run Writer and Chart, so allowing to use Chart *without* OLE stuff in Writer - just ideas... More changes: - Adapted all stuff, cleaned up old stuff/ definitions - Removed FreezeIdRanges, that can be done once per Pool on-demand (and cannot be forgotten to be called) - Merged XOutdevItemPool with SdrItemPool and offered a ItemInfoPackage which joins both needed sets of Items - All the cleanup hassle with Pools and defaults cleaned up - Adapted all access methods of the pool to use that new stuff. Pool chaining currently stays, but I use a central method 'getTargetPool' instead of recursive calling to get the correct Pool for the action Change-Id: I2b8d3d4c3cc80b1d0d0b3c0f4bd90d7656b4bab7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163157 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-02-10tdf#159372 svx: Add goto dialogAkshayWarrier
Adds a goto page/slide dialog for Impress and Draw similar to Writer. To avoid duplicating code and ui, the dialog is created in svx/ and used in other modules. The old goto dialog in Writer has now been replaced with this dialog. Change-Id: I28f819f0d0734fb2bb08a7b99a628217ef66dba9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162913 Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2024-02-09Writer: Improve redline communication with libreofficeKit.Gökay Şatır
When changes are tracked and user adds / removes a comment, we need a better communication. This PR improves the communication and sends the layout status of comments. Still there are things to do, like (while tracking is on): * We need to communicate when a change in comment is approved / rejected. * When user performs an undo on the removed comment. Signed-off-by: Gökay Şatır <gokay.satir@collabora.com> Change-Id: Ia3ea4b44c116cc571337e57960aa4f12f934701c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162756 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163155
2024-02-07tdf#158279 TOC links lost when converting .doc to HTMLNoel Grandin
regression from commit 8ce36e943f0e50970925b2dd77729ef6036b4a49 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Sun May 26 15:15:41 2019 +0200 move some searching inside IDocumentMarkAccess where I called the wrong method from inside Writer::FindPos_Bkmk The code was then removed in commit 7bad1516c5f2a85b5bae3f49261ac2494cbb7162 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Wed Jul 17 05:41:08 2019 +0200 loplugin:unusedmethods Change-Id: I3f1e14a1e3ae2dd134738363e6b2679d2a2f418a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163095 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-06sw: document connection between SwTextBlocks and autotextMiklos Vajna
See e.g. commit 87670fa998a26ab059e40bbe8f5e0acf0ad6ea04 (DOCX autotext import: speed up handling of large amount of blocks, 2019-03-14). Change-Id: I3798f55c19de6c35fcf515b3a5c785da55f0d884 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163038 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-01-31make date-form-field dialog asyncNoel Grandin
Change-Id: Ia43217c3218344bacde823aa52dc0776de822d60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162807 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-31make change-db dialog asyncNoel Grandin
Change-Id: I3310592cb2e7922f86ead8a6e19792e5852a4ca1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162806 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-31make drop-down-form-field dialog asyncNoel Grandin
Change-Id: Ic3c6111878271f31a07fab835501cd92cbca7950 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-30make set-row-height dialog asyncNoel Grandin
Change-Id: I03e27c09da4f8b58468d4e551413946f03b25f1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162761 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-30convert insert-footnote dialog to asyncNoel Grandin
Change-Id: Iea3cb8fe1486c229b5441574b1de9b81758bc251 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162760 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-30make sorting dialog asyncNoel Grandin
Change-Id: I9773ec07e13144662a06307452b17f9e96527e89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162759 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-30make auto-format dialog asyncNoel Grandin
Change-Id: Ibef42bed3448e466877608c165131a806068f5b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162758 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-30make glossary dialog asyncNoel Grandin
Change-Id: I7ed5da9e06656bc658728b8e61b02f767ddd6bb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162750 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-30convert table width dialog to asyncNoel Grandin
Change-Id: Id8fe4f8f0e3138b714aeb938f887483dab1214a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162739 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-28tdf#36310 Insert cross reference from Navigator by DnDJim Raykowski
This enhancement provides the ability to insert cross-references by drag and drop from the Navigator. It replaces the 'drag mode' way of inserting a hyperlink, section link, and section copy with a popup menu on drop that shows insert-as kinds available for the dragged content type. There is an oddity with X11 that on drop the mouse pointer does not change from a drag pointer to a menu item select pointer for approximately 5 seconds and during that time the popup menu items can't be selected. Change-Id: Id72cbdbd81106fc0e70784fcba7f1dd3a43ad81e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161575 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>