summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2023-06-21tdf#133507 sw layout: fix missing contextual spacing at section endJustin Luth
Most of the fix was included in 12f256cd1ae3e625c7b7f48987b7e843046924fa which was hunting for examples. Bad idea. Merge these two together. So this patch is just removing the document hunting aspect and enabling the fix itself. (Yeah, really bad idea.) When a paragraph style has "contextualspacing" with Spacing Above, and option "Don't add space between paragraphs of the same style, the spacing should apply after a section end. Contextual spacing was officially added to 1.3 spec in 7.0-ish timeframe: "The space between the paragraphs is zero, if all of the following conditions hold: ... The paragraphs belong to the same content area. ... Contextual spacing was actually added in LO 3.6, and it applies as expected when transitioning from one section to another. The missing case was when transitioning from a section back to the main body text. This was an implementation error. So the question is whether we add yet another compatibility flag to handle the old way of doing things, or just fix it. I'm leaning towards no compat flag because -it is a recent official addition to ODF -it is an implementation error -it currently is inconsistent - works on section start, but not end -rarely used: it is primarily an interoperability feature -rarely encountered: sections aren't really needed in LO. -no existing unit tests matched the condition. -interoperability isn't affected - section end == document end. Miklos agreed that a compat flag is warranted in this case. It is easy enough for a human to "fix" the document by removing the undesired "spacing before/after" settings. make CppunitTest_sw_odfexport2 \ CPPUNIT_TEST_NAME=tdf133507_contextualSpacingSection Change-Id: I5db903e0f1ba41aab54f881256c50d3d1927d6d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153187 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-06-21tdf#155945: do not turn another style attributes to direct formattingMike Kaganski
SwUnoCursorHelper::SetPropertyValues obtains the node's item set using SwUnoCursorHelper::GetCursorAttr, adds new items for the property values, and calls SwUnoCursorHelper::SetCursorAttr to set the updated item set to the node. This puts all the item set data as direct formatting of the node (autostyle). For complex SfxPoolItem, containing several properties, it could result in some properties having incorrect values e.g. in this sequence: 1. SwUnoCursorHelper::SetPropertyValues is called with a property sequence including "ParaStyleName" and "ParaTopMargin", represented by a complex SfxPoolItem (SvxULSpaceItem's nPropUpper). The current node uses another style, which has a non-default bottom margin; new style has 0 as bottom margin. 2. It builds a set for the union of all WhichIds corresponding to all the passed properties, which includes WIDs for paragraph style and for the respective SvxULSpaceItem. 3. It calls SwUnoCursorHelper::GetCursorAttr to fill the set with current values for these WhichIds, getting also values defined in still applied style, including an SvxULSpaceItem with both upper and lower spacing (the bottom margin value of old paragraph is stored there). 4. It sets new value of paragraph style in this item set, and then calls SwUnoCursorHelper::SetCursorAttr with the item set. Now the set contains a new value for paragraph style, *and* an old value of the paragraphs margins. This margins value is set as the paragraph's direct formatting (autostyle). 5. SwUnoCursorHelper::GetCursorAttr is called, updating the item set with new values of paragraph style and margins; the direct-formatted value for the latter is returned, still containing the values previously inherited from old style. 6. New value of top margin is set, modifying only nPropUpper member of SvxULSpaceItem, and keeping nPropLower (value for bottom margin) as it was, i.e. keeps the value incorrectly saved from old style. This happens e.g. on DOCX import. Commit db115bec9254417ef7a3faf687478fe5424ab378 (tdf#78510 sw,cui: split SvxLRSpaceItem for SwTextNode, SwTextFormatColl, 2023-02-24) has incidentally fixed handling of left and right paragraph indents, making their items independent; but top/bottom margins still need to be fixed. This change splits the properties that cause side effects (styles) from the rest; so that properties with side effects are processed first, with item sets containing only one WID for the currently processed property. This both allows to avoid the problem, and simplifies the code. Change-Id: Idd451fa1e53806cdb6b9064dec31e9171d14d5d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153384 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-21Require icu-i18n >= 66Khaled Hosny
We were requiring ICU 4.6 which was released in 2011, and ifdef'ing our way through newer ICU versions. ICU is a core dependency and it makes no sense to build LibreOffice with such ancient versions of it. This change requires ICU 66 (released in 2020), and removes all the ifdefs for older versions. There are more cleanups to do, but these will be done separately. Change-Id: I2e4f7608a08f4d531b0a4c74bbfdf91a451f833f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153387 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-21sw: Use DateTime::Sub() instead of operator-()Eike Rathke
Change-Id: I0c2ce0e3eb6eab70e694adc567b688b579bb52d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153385 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2023-06-21tdf#155951 sw: fix crash using XTextRange::getString() in selectionChanged()László Németh
XTextRange::getString() triggered selection change event, resulting infinite recursion, when getString() used in selectionChanged() of the listener. Steps to reproduce (used by the unit test, too): Add a XSelectionChangeListener to the document with a selectionChanged() calling the getString() of the selected text range. Select a word in the document editor using the Ctrl-Shift-arrow keys. Change-Id: I87a0f60cee3663f5303d6eb6980058ccdcc373e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153356 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2023-06-21CppunitTest_sw_htmlexport: avoid reqif magic in testNoLangReqIfMiklos Vajna
Set the filter options explicitly, rather than inferring it from the test name. Change-Id: I49cf0e34354178054db2daa10902917cb5d45080 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153361 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-06-21sw: Fix spell checking having no view separation in tiled modeParis Oplopoios
Turning spell checking on or off for a single view would turn it on/off for every view which is correct behavior normally but not in tiled mode because different views might want different view options Change-Id: Ib422f692e97618cfba6a7cb8b2a4f2b3f20a0ca2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153343 Tested-by: Jenkins Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
2023-06-20Remove German capitalization from some translatable stringsAdolfo Jayme Barrientos
Change-Id: I74f886c651ea7973cc60e3771f2de6eaa449fe4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153231 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2023-06-20sw floattable: fix negative vertical offset handling on page boundaryMiklos Vajna
The bugdoc has 3 floating tables, the last one was on page 1 in Word, but it was on page 2 in Writer. It seems what happens is that the vertical offset of the last table is negative, so it is moved above the paragraph before the last floating table, but once the anchor frame (last paragraph) is moved to a new page (because it doesn't fit), then its fly frame is also moved to page 2, which leads to overlapping text in the original bugdoc. Interesting this works already with 0 vertical offset, and in that case we split the last paragraph, fill the page 1 part with a fly portion and fill the page 2 part with the anchor text. Fix the problem by: - triggering a split of the frame in SwTextFrameBreak::IsBreakNow(): if the anchor frame doesn't fit (has to be moved to a next page), then split it, so only the anchor text is moved, the fly is not (so its position matches Word) - preventing the manipulation of the frame offset in SwTextFrame::AdjustFollow_(), so no content is moved from the follow to the parent, because that would mean later we move the joined frame to the next page - finally minimizing the frame height at the end of SwTextFrame::Format(), so the master still fits the current page An alternative approach would be to extend SwAnchoredObject::FindAnchorCharFrame(), which already has code to handle the case when the text frame master and the anchored object is not on the same page, but that operates on existing anchor frames, and here the original problem is that the entire anchor frame is moved to page 2, so we don't have anything left on page 1. Note that this is all specific to floating tables, I could not reproduce the same behavior with an anchored shape in Word. Change-Id: I007b57b369f5c1e98ccad77111958dfd9335f079 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153309 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-06-20sw: document SwFormatLineNumberMiklos Vajna
The primary use-case here is to have this in certain paragraph styles, so that they can request "don't count these lines", like Caption or Header. Change-Id: I2af591d2713cc23f4b634b69797f0dd61a37a2de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153298 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
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-19Fix typoAndrea Gelmini
Change-Id: I2528c5e9020594c78657ee290f8ca4589d31a2cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153257 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-06-19Restructure a bitMike Kaganski
Change-Id: I27f494e8df25163fa3044311ce7c8cfc942980e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153259 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-19sw: Test paragraph level text backgroundTomaž Vajngerl
Change-Id: Icea365ae036cae49749dd24bb8412775fafbd6c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153247 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-19tdf#103064 Don't overwrite all formatting with DF on lang changeMaxim Monastirsky
i.e. right click on the language field in the statusbar, and choose a language from the popup menu. We now start with an empty itemset and only put there the modified items. This in turn makes the spelling restating hack unnecessary, so move it near its last consumer in ResetLanguages. Change-Id: Ie0f97a7fa41dc19b5785a41ee2ef4fb9c814f74a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153252 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2023-06-19sw floattable: avoid layout loop for negative vert offset in MakePos()Miklos Vajna
The bugdoc has 2 paragraphs and a floating table between them. The floating table has a large enough negative vertical offset so it "pushes down" the paragraph that is before the table in the doc model. Our layout didn't push the first paragraph down, the second paragraph overlapped with the table and the whole layout process was just stopped by the layout loop control. What happened is that we realized that we have to push down the first paragraph, so an SwFlyPortion was created for it. Then we made an UnlockPosition() in SwTextFrame::MakePos(), so it could be calculated again. This lead to an oscillation, and the calculated vertical position of the floating table's fly changed between 964 (good) and 2990 (bad) twips. Fix the problem by limiting when SwTextFrame::MakePos() calls UnlockPosition(). The general strategy is that flys are only positioned once during a layout pass. The exception from this is when the fly moved to a new page and it's not yet positioned. So if we unlock when the fly only has the page frame top left position, then we keep the original use-case working, but fix the layout loop. Regression from commit 12a9009a1c19ee26c65fb44fc90f3432c88ab6a5 (sw floattable: fix bad position of follow fly if anchor is positioned late, 2023-03-23), where I didn't realize how dangerous UnlockPosition() is. Change-Id: I0aa0a52db712a464105e8040497fd429e0604309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153245 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-06-19Expand a macro inlineMike Kaganski
Change-Id: Icd1e63616af383c98b35d8bd70cf83b007f8473a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153242 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-19Drop code leftovers of HTML 3.2 supportMike Kaganski
The support itself was removed in commit 3f43b02433b970cd36ee4c9249e425d6b1bd9fbe (Remove HTML 3.2 export option, 2011-08-26). Change-Id: Ide699aed3078fd60490c49bb20b5fc487002726a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153241 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-19Simplify a bitMike Kaganski
No other options are possible, as implemented in GetExportMode Change-Id: I0ed00173d9a7b56bde841831c2964b2572fb1140 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153240 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-18ooxml: import and export background and fill theme colors props.Tomaž Vajngerl
This adds support to import and export background and fill theme color properties. Change-Id: I0f40615fe2d06cdcb4f2f9752602fe2ec699c7b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152835 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-17tdf#118335 notebookbar: set visible false for PrintPreview in MenuFileJustin Luth
The label for "Print Preview" comes from ContextLabel in these menus - and it displays "Close Preview" even if the print preview is not active. The PrintPreview buttons in the notebookbar ribbon itself work fine. So just hide the menu ones for now. Perhaps that is not good for accessibility, but I would imagine accessibility people would stick with the traditional menu anyway, since the notebookbar is also horrendous in many other ways for accessiblity. The user can turn this back on again if they want. Customize - Notebookbar - File Tab | File | Menu File Change-Id: I807941650295132c9e15f04094cece26246318d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153199 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-06-16tdf#132061: disable uno:PageColumnType when read-onlyJustin Luth
When the document is read-only, it should not be able to be have the column information changed, so disable that toolboxControl, just like everything else. It was set to be active in READ-ONLY mode since initial import, but no indication why it should be different from the two other page actions added at the same time. It was added as part of adding the sidebar. However, I don't see where it would be found in the sidebar. It is not in the normal menus - just in the notebookbar. Change-Id: Icf342d5ee51cf8bba296049833e0e520813efb03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153193 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-06-16sw uiconfig: add README to explain the different menusJustin Luth
Inspired by tdf#126379, where a Master Document does not use the notebookbar UI - even though it is clearly Writer. So now I finally know what sglobal is for. I had been wanting this information for some time now. So I did a bit of experimenting and verified my information. (I'm not compiling with database support, so I couldn't prove those two, but what else could they be?) Change-Id: Ie1e7615a401c0c07168219dab3e9f02f9e33e996 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153188 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-06-16tdf#155871: don't forget to close li before starting nextMike Kaganski
When closing a nested list, the previous condition failed to close the last li in case when the next item is numbered (i.e., will need another li). Indeed, if the next item is unnumbered, current last li should stay open. Change-Id: Iad7d83d50d2f02d6bd1d046804b7e23b59f9ce8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153179 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-16ofz#59859 TimeoutCaolán McNamara
an interesting finding, but we still want this fuzzer to generate documents that don't need tweaking to load in the normal office so enfore the xml detection rule Change-Id: Ie21f8f5d985b97068935fab6a6abfee8901b1b5e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153176 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-16tdf#146547 sfx2: allow read-only documents to be modifiedMichael Stahl
This is particularly useful for a Writer document that contains a section that is set to be editable in a read-only document, so that the user is warned when closing such a document without saving it. Originally this check was added in commit 27db57efc51487b3976fbf73df1868b8fb78d201 "CWS fwkbugfix05" "#i39869#: readonly docs should never become modified" but the actual problem there was that the read-only document was displayed in a wizard dialog, not in a document view, so let's instead check that the document is some kind of "internal" document. Also the dialog's Save button should do something, and since the document is read-only, a Save As dialog appears appropriate. Change-Id: I339cbe92a2c9eb74a1f5061246f921037a47f79c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153180 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-06-16tdf#125154 i18npool,sw: fix group separators in numbers in formulasMichael Stahl
Commit 776f7e7463de3e97f3056712ee567f49a314829d changed cclass_Unicode to reject group separators in numbers by default, but users are complaining that the neat "5.000" numbers in their existing documents are now considered invalid. * in SwCalc, use GROUP_SEPARATOR_IN_NUMBER * in cclass_Unicode::parseText(), reject a group separator if it is not followed by at least 3 digits With this, a number from tdf#42518 "0.19" is still considered invalid, while "5.000" is now valid again. Change-Id: If86f2ed4c27be16f866d7f4cee00789344e9ee2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153047 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-06-16tdf#155847 sw tracked table column: manage multiple changesLászló Németh
In Manage Changes dialog window, group also redlines of multiple different column changes. Follow-up to commit cc52d895314dd7b67de916bd90ccbfa098e77419 "tdf#155342 sw tracked table column: manage changes". Change-Id: I3c9e69bf554bc5b4ce9473f95fff5954228758bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153172 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.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>
2023-06-16tdf#103064 Improve comment style usage detectionMaxim Monastirsky
With this patch the "Applied Styles" filter should list also styles used in comments. Change-Id: Ifcb716cb66a0d271ca3d7ce477e6299015310ff1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153163 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2023-06-16tdf#103064 sw: enable the UI commandsMaxim Monastirsky
Change-Id: Ic3e5ab9df5386a1cad0801f7044e6148620aa3b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152643 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2023-06-16sw layout xml dump: extract SwTextFrame::dumpAsXml() from SwFrameMiklos Vajna
Ideally SwFrame should not really know anything about text frames. Change-Id: I2734e76ced3001de1fc1176d6315f8c69c02d8b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153152 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-06-16tdf#103064 sw: use the comment style by default instead of DFMaxim Monastirsky
As part of that, language changes in the document's body are no longer applied to comments, as that would be a DF. Instead, the default language of comments is controlled via the style (see tdf#153805 for the use case). Change-Id: Icfa9a7334b52fe74292e82fa8daa01a15197e384 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153158 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2023-06-16tdf#103064 sw,editeng: enable UNO API and ODF import/exportMaxim Monastirsky
Change-Id: Icf30e1f30fe6bf6a7d96d14b975954613cd68b70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153157 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2023-06-16tdf#103064 sw,editeng: make para styles work inside commentsMaxim Monastirsky
- Style objects for comments are stored in a dedicated stylesheet pool, and constantly updated from the "real" styles using modification broadcasts. In theory, it should be possible to use same objects for both Writer core and EditEngine, as they use separate item ranges. But unfortunately SwDocStyleSheetPool isn't really a styles container, but just a wrapper around Writer's core styles, with a single mxStyleSheet member that is filled each time with data from different styles (while EditEngine expects different styles to be represented by different objects). - EditEngine switched to allow duplicate listeners for styles - one per paragraph. The use case is 2 paragraphs of the same style, and then one of them is switched to another style. In that case we still need to keep listening to the former style for the other paragraph. There is probably some opportunity for optimization, but it should be good enough for now. - Copying formatted text from document's body doesn't preserve style assignment for now. The editeng RTF import should be tweaked to not insert styles into our "special" stylesheet pool (or somehow forward them to Writer's core style handling) before we can enable this part. Change-Id: Ib67c5388f9cd078c73ec0d453017f815843161ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153156 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2023-06-15tdf#155736 Modified IsInTOC() to handle IsInHeaderFooter() case.Satya
This fixes a problem of page numbers missing in the footer. The importer might start processing the footer before the TOC has finished - m_bStartTOC might be true. In this case we are not actually IsInTOC,and m_bStartTOC should be ignored and make use of IsInHeaderFooter() and m_bStartTOCHeaderFooter to confirm if the footer/header itself has TOC. Change-Id: Ieede9f8e2120556630ba57b9c748935788f3cc9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153052 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Justin Luth <jluth@mail.com>
2023-06-15tdf#103064 sw: improved notifications on style modificationMaxim Monastirsky
- More useful notification on undo - Added notifications for theme change and UNO API. Change-Id: I554dceff92f4f8a6dd5c39c6965b7de706ab6678 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153110 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2023-06-15tdf#133507 sw: hunt for documents with ULSpacing at section endJustin Luth
When a paragraph style has "contextualspacing" with Spacing Above paragraph, and option "Don't add space between paragraphs of the same style, the spacing should apply after a section end. Contextual spacing was officially added to 1.3 spec in 7.0-ish timeframe: "The space between the paragraphs is zero, if all of the following conditions hold: ... The paragraphs belong to the same content area. ... Contextual spacing was actually added in LO 3.6, and it applies as expected when transitioning from one section to another. The missing case was when transitioning from a section back to the main body text. This was an implementation error. So the question is whether we add yet another compatibility flag to handle the old way of doing things, or just fix it. I'm leaning towards no compat flag because -it is a recent official addition to ODF -it is an implementation error -it currently is inconsistent - works on section start, but not end -rarely used: it is primarily an interoperability feature -rarely encountered: sections aren't really needed in LO. -no existing unit tests matched the condition. -interoperability isn't affected - section end == document end. This patch is hunting to prove some of the above points. -shouldn't hit any DOC/DOCX/RTF files. -only expect to find ODT files related to this bug report. So, I don't think a compat flag is warranted in this case. It is easy enough for a human to "fix" the document by removing the undesired "spacing before/after" settings. make CppunitTest_sw_odfexport2 \ CPPUNIT_TEST_NAME=tdf133507_contextualSpacingSection Change-Id: Ia041741bbada8c2f4cd97aa6b7cd98d4d7ffb275 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153033 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-06-15tdf#103064 sw: add a comment styleMaxim Monastirsky
Change-Id: I96acdf3200836efe1d66e19dd85000fca9e7a6fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153109 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2023-06-15speed up startup timeNoel Grandin
by avoid conversion of static locale data from sal_Unicode to OUString data - we can declare the data as OUStringConstExpr arrays and then no conversion is necessary. Here we trigger a problem - EditDLL has static data that tends to get torn down __after__ the i18npool shared library has been removed from memory, which means it tries to access OUStringLiteral objects that no longer exists. So use vcl::DeleteOnExit to explicitly clear that on application shutdown. Change-Id: Ie4bfcef7eb4656316ea825474ac42f85844d1dcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153060 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-15tdf#155685 sw: ExtendedSelectAll with tables, group the Undo objectsMichael Stahl
Change-Id: I2fba70968c97cd9704212cd799b333d2d158a042 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153115 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-06-15tdf#155685 sw: fix another ExtendedSelectAll Redo crash w table at endMichael Stahl
This can be reproduced with a table containing in the last cell a paragraph followed by a table, then ExtendedSelectAll in the cell and delete. On Redo of the SwUndoDelete: warn:legacy.osl:326138:326138:sw/source/core/frmedt/tblsel.cxx:1775: MakeSelUnions with pStart or pEnd not in CellFrame In function: const_reference std::vector<SwTableBox *>::operator[](size_type) const [_Tp = SwTableBox *, _Allocator = std::allocator<SwTableBox *>] Error: attempt to subscript container with out-of-bounds index 0, but container only holds 0 elements. The problem is that DelTable() calls PaMCorrAbs() with a target that is outside of the outer table, so the SwEditShell::DeleteSel() rPam has one end in the last table cell and other end outside the table. Change-Id: Ia2764a4c99ba12102957153e005284a44be04fd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153114 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-06-15sw layout xml dump: show page frame of anchored objectsMiklos Vajna
It's useful to see if this is updated already or not when the object moves between pages. Change-Id: Iccad297585c04d77a95eb6cd31b65919470a97e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153102 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-06-15ODF export: simplify restart handling to skip list id where possibleMike Kaganski
This continues to minimize cases where random ids are written, helping to make the output more deterministic; it builds upon commits 8f48f91009caa86d896f247059874242ed18bf39 (ODT export: omit unreferenced <text:list xml:id="...">, 2022-03-10), and 82bbf63582bdf28e7918e58ebf6657a9144bc9f3 (tdf#155823: Improve the check if the list id is not required, 2023-06-14). The previous code used to write 'text:continue-list' when the list is restarted. It is unnecessary when there is no other condition requiring such a reference (like style change, or interleaving lists); so relax the conditions allowing to put simple 'text:continue-numbering="true"'. This also allows to simplify a bit the code around 'ShouldSkipListId'. Change-Id: Idf8be455953d08fd578266bda22f3a55d7b9ee23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153104 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-15sw floattable: fix handling of upper margin of anchor for fly intersectMiklos Vajna
The bugdoc has 2 paragraphs and a shape between them. Word has a small amount of space between the shape and the 2nd paragraph, Writer has a large amount of space between the shape and the 2nd paragraph. It seems what happens is that Writer puts both the text node's own upper spacing and the previous text node's lower spacing into the upper spacing of the text frame, so the check added in commit d07fc485d46f431405a3f6a002f951a08c559677 (tdf#116486 Consider upper margin in paragraph positioning with flys, 2018-04-10) is not entirely correct, as it deal with both upper and lower margins, but its intention was just the upper margins. Fix the problem by (indirectly) using GetUpperSpaceAmountConsideredForPrevFrame(), which allows doing the intersection for the original text node upper spacing but not for the text node lower spacing. This keeps the original bugdoc working, but fixes the unexpected vertical space for the new bugdoc. This is part of the effort so that the original bnc#816603 bugdoc's DOCX version moves an overlapping floating table from page 4 back to page 3, like Word does. testTdf122878 is modified to just make sure no overlap happens, manual testing of the bugdoc shows that our layout still matches Word. Change-Id: I4622fb77dc8a52493766e50688ec92065eac65bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153101 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-06-15tdf#155728 - A11y sidebar: fix Update issue list after fixing an issueBalazs Varga
in case of SdrObjects. Change-Id: I45608d423c0da0f1a983dcfad43562c3d7c9ee67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152953 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-06-15Fix typoAndrea Gelmini
Change-Id: Ieadd5121185e9c3a5258336e3bfece23c1efdc73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153067 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-06-14Add editengine view separation in tiled renderingParis Oplopoios
Editengine now gets the background color from the current view instead from a global variable Change-Id: I98a0fccf4d0c83f4dabf8e534a9228b8a5e271d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152996 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Paris Oplopoios <parisoplop@gmail.com> (cherry picked from commit 7baa475342b67c10537e11da37b8862648679b02) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153073 Tested-by: Jenkins
2023-06-14tdf#155690 writerfilter: fix import of bookmark in table...Michael Stahl
... at start of section. (regression from commit 2e8aad6d45c53d554ccaf26de998ede708cfc289) Change-Id: I1e0e720758b607b69645b29c46f4092264289f9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153053 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-06-14tdf#139863: Add testKhaled Hosny
Change-Id: Ia3cb97203b71204688e8911668a274ac491af2bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153045 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>