summaryrefslogtreecommitdiff
path: root/sw/qa/extras
AgeCommit message (Collapse)Author
2021-11-15tdf#145091 DOCX: don't export obsolete table row change dataLászló Németh
Rejection of table deletion or accepting table insertion imported from a DOCX document kept row changes in DOCX export. Use SwExtraRedlineTable/SwTableRowRedline data only if it's not obsolete. Follow-up of commit 05366b8e6683363688de8708a3d88cf144c7a2bf "tdf#60382 sw offapi: add change tracking of table/row deletion". Change-Id: I247e13e86c0115604079e4852aa8663f1bfead91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125114 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-13Use o3tl::convertMike Kaganski
Change-Id: I78db3001d602ec1a0847785b3c127b9d345f5af7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125173 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-12sw, out of order undo: allow multiple actions from other viewsMiklos Vajna
Previously we assumed that the action to be executed is always exactly the top of the undo stack minus 1 element. Extend this, so that in case an other view appends two or more elements to the undo stack, we still find our undo action. Obviously only do this if all those undo actions are independent from us. This requires replacing the swap in svl/ with a move-out + move a range down + move in construct. Change-Id: Ic12d32d6eb5e77618d99eddb4fa096802f32d655 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125076 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-12tdf#145584: sw_uiwriter3: Add unittestXisco Fauli
Change-Id: I2713a6563542307e8103a88301bb623bd8da11d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125079 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-11-12Use more o3tl::convert in scMike Kaganski
Change-Id: I624b6c570eff8b6cdc83ffcb2d0dbadf848715b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120330 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-11ooxmlexport test: fix ?: identical valuesDr. David Alan Gilbert
cppcheck spotted a pair of: CPPUNIT_ASSERT_EQUAL(sal_Int32(mbExported ? 11331 : 11331), xChildGroup->getPosition().Y); where the ?: has the same values; from https://gerrit.libreoffice.org/c/core/+/115668 squash the ?: Change-Id: I3c1756bd63699408f722824684d71b74c6ea9b7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125017 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-11-11sw, out of order undo: allow a subset of a non-empty redo listMiklos Vajna
Specifically, we used to not allow out of order undo at all if the redo list was non-empty. This relaxes that condition a bit. Out of order undo is OK with a non-empty redo list, in case all undo actions in the redo list are either 1) owned by the current view or 2) independent from the undo action to be executed I.e. if view1 has lots of type undo actions and an view2 adds a single type undo action on top of it, then allow view 1 to execute multiple of its typing undo actions, not just a single one. Change-Id: I2f5d9404a9994ed74b65233d2a315976c27b28b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125023 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-10sw: allow undo of typing in 2 views independent from each otherMiklos Vajna
Undoing out of order is dangerous by default, so limit this to a very specific case as a start, that allows growing in follow-up commits. For now, allow out of order undo if: 1) redo stack is empty 2) we're in LOK mode (different views represent different users) 3) we undo a single action (count is 1) 4) the top undo action doesn't belong to the current view 5) the top and the previous undo actions are independent Which only requires that SwUndoInsert::UndoImpl() is independent for two different paragraphs, which seems to be the case. Independent undo actions opt in for this, currently the only such allowed undo action is SwUndoInsert ("typing"), which adds characters to a single text node. Even those are only considered independent if they operate on different text nodes. On the positive side, this allows out of order undo in the frequent case where two users collaborate on a long document and they just type some new content into the document at different paragraphs. Change-Id: Ibb4551e8f7046b4947491b8bf751eaa0cbb2d060 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124949 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-10CppunitTest_sw_ooxmlexport14: avoid DECLARE_OOXMLEXPORT_EXPORTONLY_TEST()Miklos Vajna
See commit a226cec52e536c46e03f57a5f1f7931abbeb0cdd (CppunitTest_sw_rtfimport: convert one testcase to use CPPUNIT_TEST_FIXTURE(), 2019-11-05) for motivation. Change-Id: I7b592b1438d92aa597db1f21294308703c93c6a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124935 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-09tdf#145089 DOCX export: fix track changes of table row insertionLászló Németh
Newly inserted table rows lost their change tracking during DOCX import, i.e. rejection didn't remove the rows. Note: start to clean-up DOCX export and SwTableLine::IsDeleted(), preparing the fix for tdf#145091. Follow-up to commit dbc82c02eb24ec1c97c6ee32069771d8deb394f9 "tdf#143358 sw: track insertion of empty table rows". Change-Id: Ib90b745632ec4aeb30651fbff209ecef69657f4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124922 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-09tdf#124904 sw: don't show deletions in referenced textLászló Németh
In fields, strikethrough/underline formatting of track changes is not available. If the referenced text of the fields contained partial deletions, the field showed them as normal text, e.g. mixing up the text of a heading with its removed typos. Now these deleted parts are removed, except in the following case: if the referenced text was completely removed, show the whole deleted text in the reference field, adding strikethrough to its tooltip text to help the review process. Note: this allows to handle both use cases, i.e. when only a small part of a heading was modified (e.g. removing typos), and 2) removing whole chapters with headings, where the fields in the deleted text are more readable with the text of the deleted headings, showing the original text content. See also commit daf2a7d957c829c551754871a3545495c0f76bc0 "tdf#61154 sw Table of Contents: remove tracked deletion". Change-Id: I98bd8ded1591ae3c84957998e65f3cccac2a7884 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124843 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-05tdf#93747: sw_uiwriter2: Add unittestXisco Fauli
Change-Id: I622cb779549dea729dbe7c8474b5f25034b97278 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124761 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-11-05tdf#144668: docx export: simpler way to create lvlText in numberingsVasily Melenchuk
Oldr approach with populating ListLabelString with some predefined values and than replacing them by placeholders is not so good. It can lead to collisions if we use numbers in format string. Anow with support of list strings in core we do not need this: it is enougth to replace LO placeholders %1%, %2%, ... by MS binary placeholders \0, \1, ... Additionally added support for list level initialization in DOC import: that case was still setting just prefix/suffix leaving list level uninitialized. Change-Id: Ia85551f46b4e229dea93c663459ec1a8715c8a23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124326 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-11-04sw: Wrong ZOrder after import for images anchored to non-1nd pageTomaž Vajngerl
Importing a document that has images anchored to the non-1st page, can result in images having the wrong the wrong Z index (ZOrder). If there are overlapping objects in the document, this can become a problem. The issue is with the call to SwRootFrame::RemoveMasterObjs, which removed the "master objects" - SwFlyDrawObj* castable objects. Normally the SwFlyDrawObj* objects on the page are wrapped and replaced by SwVirtFlyDrawObj*, but when the call to the RemoveMasterObjs was made, this hasn't happen yet to all the objects (objects that were not on the 1st page). The fix is to move the RemoveMasterObjs call to a different place, where we processed all the pages, so we can safely remove the remaining master objects on the page. Change-Id: I7d2f31614d269c22a82e7e5dea960f3d0844a5d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124597 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-11-04prelim tdf#136472: adjust implementation specific unit testsJustin Luth
Using a "First Page" style before a "Default Page Style" in order to apply a different header to the first page is an implementation specific detail. As of LO 4.0/4.1, we have the ability to set a different first-header (different even-odd were already available). So remove any dependency on "First Page". 4-inheritFirstHeader.docx: just test the actual layout 8-n777337.docx: margins must match both page styles. -First and Standard are defined from the same settings 8-n779642.docx: reverting the patch breaks unit test: GOOD 8-n780843.docx: export of footer works now - so test that. -PROOF: CONTINUOUS BREAK - SHOULDN"T SHOW FIRST PAGE - so turn off. 9-headerfooter-link-to-prev.docx: a real thorn test. -happy it still passes after making this logical-seeming change. 15-tdf135216_evenOddFooter.odt: is first of odd in ODT. -when first is shared, it still works to check first. Change-Id: Ice54ef9626f851f9154f3c274ffbe39455538589 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124591 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-11-03tdf#145311 sw track changes: fix moving over empty list itemLászló Németh
which was changed to tracked insertion. Follow-up to commit 4c982dbafdac900e233d7b68d95c9c99244defc1 "tdf#145225 sw track changes: fix bad insert at moving". Change-Id: If3d70da71188e95b5aeea9b72e7c9de22d7c7150 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124645 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-03tdf#141908: CppUnittests: replace usage of sal_Int32 with colorsRishav Chattopadhya
Change-Id: Idb078379c4388d7dd9525500e18064f2f873e6ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124091 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-11-03tdf#145361: sw_xhtmlexport: Add unittestXisco Fauli
Change-Id: I4bbbdfa71f69ae2659922dce4b7445bcadc7d73a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124636 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-11-03CppunitTest_sw_ooxmlexport13: avoid DECLARE_OOXMLEXPORT_EXPORTONLY_TEST()Miklos Vajna
See commit a226cec52e536c46e03f57a5f1f7931abbeb0cdd (CppunitTest_sw_rtfimport: convert one testcase to use CPPUNIT_TEST_FIXTURE(), 2019-11-05) for motivation. Change-Id: I08a4ba4a1219b90a3652ae63c1e3a11dd9fa1208 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124614 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-03prelim tdf#136472: remove implementation specific unit testsJustin Luth
These test documentations are completely pointless. They test something implementation specific without anything to actually test for accuracy. 4-test_segfault_while_save.docx: pseudo-preventative test. 8-fdo49940.docx: an empty page with no header/footer enabled. Who cares if it is called Default style or First Page. Change-Id: I4a9a6fcfe3621eaa745470487b32b2cbd66f0973 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124590 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-11-02tdf#141908 replace usage of sal_Int32 with colors in htmlexportHenrik Palomäki
Change-Id: I0403ccdb875f5372a13ebdc0fdf0f4ed396af773 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124436 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-11-02tdf#139336 sw: fix extra pages of multicolumn sections with footnotesAttila Szűcs
Adding footnotes to multicolumn sections resulted page-long section layout, not regarding to the amount of its text content. E.g. a page with n multicolumn sections and footnotes could load as n (mostly empty) pages. The problem is related to the footnotes showed under columns of sections, which can be ambiguous at different column number of the different sections on the same page. As a workaround for interoperability, show footnotes per pages to remove the extra pages, e.g. allowing to show the separated sections on a single page, like MSO does. Note: a compatibility option will be added to avoid regressions. Note: This fix doesn't change multicolumn page styles or not evenly distributed multicolumn sections or footnotes not collected at the end of the sections. Test: choose Edit Section... in local menu of the sections of the unit test document. In Options..., see checkbox "Evenly distribute contents to all columns" on page Columns, and Footnotes/"Collect at end of text" on page Footnotes/Endnotes. To see the result of the new settings, save and reload the document. Note: DOCX format doesn't support "Collect at end of text", only OpenDocument. Note: In MSO, it's possible to set multimulticolumn footnotes separately from section column number. It's column number can be 1–4, or "auto", which uses the column number of the first section of the page. See also tdf#138508 (Single column footnotes on multi-column pages). Change-Id: I6a3534ac043971479275a3e8bb0713bd3d8ceaa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121822 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-02tdf#145317 sw ms export: handle First Page with a first headerJustin Luth
partial revert of LO 5.2.4's tdf#101814. Just because the page style has a first doesn't mean that it should not check if it is also a first-follow that could be merged into a single ww8section. In this case, the follow page-style's H/F definitions were lost, because only the First Page style was considered. No existing unit tests matched these conditions. I did test bug 101814's CAFCA - Modèle feuille A4 - v2015-2.odt and it still shows the same H/F. Change-Id: I7389f8d85ba24a3f9c6487efe4acd27d96b0869c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124213 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-10-31Prepare for removal of non-const operator[] from Sequence in swMike Kaganski
Change-Id: Ie9530262e4addec01091cc1147e68be5b5a782f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124398 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-29tdf#141193 Added support for bar codes in qrcode dialog box[API Change].homeboy445
Change-Id: I6b79ece1d5419ef92b76755d3bd921a64d6e38fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113989 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-10-29tdf#140798, tdf#143815, tdf#141659: fix fly content hint handlingBjoern Michaelsen
Also revert most of the test changes in 188ec34cf157ffee8c63f03f420ca9daafb5ff29, except in mailmerge, where 3bc8f90e9693f710f12632f69b9348c1c833c906 seems to have done some research and the old state wasnt particulary well-justified. In testSmartArtAnchoredInline the order of elements has changed. This exposes a bug in SwFEShell::Paste, which stops copying SpzFrameFormats (aka FlyFrameFormats and DrawFrameFormats) after having copied the first FlyFrameFormat, claiming other Flys will have been copied via FlyInFly. If there are DrawFrameFormats behind the FlyFrameFormats, they will be forgotten. So instead: - first copy the DrawFrameFormats - then copy the first FlyFrameFormat to not forget any Draw Formats. Also, give the format copying its own function, at 100 lines its annoying enough all by itself. Change-Id: I301e27ff94fb82cf0502457630acdcbfa342a566 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124162 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-10-27sw: run uiwriter tests on macOS tooXisco Fauli
meanwhile, fix the following warning: - sw/qa/extras/uiwriter/uiwriter2.cxx:3744:22: error: unused variable 'pTextDoc' [-Werror,-Wunused-variable] Change-Id: I81befe70f48b49f92ea787ab59098525b4cc4471 Change-Id: Ic6ac9b6eaa0ae7a351320540522093ad1dfcba94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124279 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-10-27tdf#131771: sw: Move UItest to CppUnittestXisco Fauli
Change-Id: Ic24218bee76ed9b8df3169bd8e2ede6a91689770 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124252 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-10-27tdf#143244: sw: move UItest to CppUnittestXisco Fauli
Change-Id: If1a897270f2fc43cdd5b2a4560bc5d1ce4fdba35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124247 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-10-27tdf#136715: move UItest to CppUnittestXisco Fauli
Change-Id: I322b2cc0bae0889e5f3aaaf0542320c9dda82079 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124243 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-10-26tdf#145225 sw track changes: fix bad insert at movingLászló Németh
Moving up a list item over a tracked paragraph insertion changed non-tracked text to tracked insertion. Manual test: - Create a 3-element list; - switch on Record Changes and Show Changes; - at the end of the list item 2, press Enter to insert a new list item, and type some text: Item 1 Item 2[ New item] Item 3 where parenthesis shows the boundaries of the tracked insertion; - move up the last list item over list item 2 (the unmodified paragraph text with a tracked paragraph insertion at the end). Paragraph text before the tracked paragraph insertion changed to tracked insertion joining its tracked insertion with the moved list item, resulting only 2 tracked changes: Item 1 [Item 3 Item 2 New item] [Item 3] instead of the requested 3 changes: Item 1 [Item 3] Item 2[ New item] [Item 3] Change-Id: I4716b2d244b57cf86d7d14d972452191549f5fea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124144 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-10-24change some LOK internal updates to be pull model instead of pushLuboš Luňák
Some LOK messages may get called very often, such as updates about cursor position. And since only the last one matters, they get generated every time, which costs some time, and then later except for one they get all discard again from CallbackFlushHandler queue, which again costs time. Change the model to instead only set an 'updated' flag, and CallbackFlushHandler will request the actual message payload only before flushing. This commit changes LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR and LOK_CALLBACK_INVALIDATE_VIEW_CURSOR to work this way. Change-Id: I376be63176c0b4b5cb492fbf529c21ed01b35481 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124083 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-23tdf#131025 ODF import: recognize SV_COUNTRY_LANGUAGE_OFFSETJustin Luth
File import was making an exception for "float value 0" if the accompanying text had no resemblance to the value 0, but that only applied to GENERAL number format. It should apply to any language's default number format. REGRESSION warning: as we can see, this has been handled inconsistently in the past. But from the coding exception to overcome losing text to a zero (and the huge number of duplicate bugs) the best choice seems to be ignore the spec that says that a number value overrides the text value - at least in the case where the number value is zero. Change-Id: I701e72c6a5dad42c7799ab501255a4859adf61d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124080 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2021-10-22properly flush LOK invalidations in testsLuboš Luňák
This should be done always before doing something with a flag related to the invalidations. Use an idle timer for simplicity, tests already usually process to idle. Change-Id: I979900da28061cc690ecbcce023dbb769239f205 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124003 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-22revert unittests to use plain text-based LibreOfficeKitCallbackLuboš Luňák
At least for now it seems that the more complex SfxLokCallbackInterface is just an unnecessary complication for unit tests. The performance doesn't matter, and handling all the specialized callbacks makes things more complicated. In the future it'd be also useful to make the tests (optionally?) use also CallbackFlushHandler as the provider of the messages, in order to test CallbackFlushHandler more thoroughly, so perhaps in the end it makes more sense to keep unit tests using the plain text interface. This reverts unittest-related parts of 3b729db05553c1a6d461fb41c89 and adds a smaller wrapper callback class that converts messages from SfxLokCallbackInterface to LibreOfficeKitCallback format. Change-Id: I6c14f0be4ed7b777444b131140be54188d309cca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124000 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-21Typo: pragraph->paragraphJulien Nabet
Change-Id: I8363b3f9f4f11e3f7447e8bc0853fa4928f8550c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124030 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-21introduce SwNodeOffset strong typedefNoel Grandin
for indexing into node children. Replaces various usage of sal_uLong, tools::Long, sal_uInt32 with an underlying type of sal_Int32. Also add a NODE_OFFSET_MAX constant to replace usage of ULONG_MAX Change-Id: I2f466922e1ebc19029bb2883d2b29aa4c0614170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123892 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-20svx: Don't end text edit mode for all viewsTomaž Vajngerl
This allows multiple views to not disturb each other editing inside a impress document. With the ending of text edit for all views still enabled, one view can cancel other views text editing just by moving or resizing a unrelated shape in the document. To make this possible we also need a view-local undo manager for the text edit mode, which is independent of the document undo manager. When the text edit mode ends, all the changes will be added as one change to the document undo stack. This prevents any conflicts in the undo stack that could be made when 2 views are editing the same document at the same time. This also adds the test for the new use case and changes the existing tests to reflect the change. Change-Id: I04edb4f91d7e111a490c946f7121cbca75f818d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123220 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-10-20tdf#145233 sw track changes: show moved text in green colorLászló Németh
and with double strikethrough or underlines during change tracking to speed up reviewing, e.g. re-ordered list elements or changed paragraph or sentence order is more visible this way. Note: skip terminating white spaces of the changes during recognition of the text movement, as a workaround for a typical difference resulted by e.g. Writer UX: selecting a sentence or a word, and moving it with the mouse, Writer removes a space at the deletion to avoid double spaces, also inserts a space at the insertion point automatically. Because the result can be different (space before and space after the moved text), compare the changes without terminating spaces. See also commit bcdebc832b272662d28035007a4796e42d1305ae "tdf#104797 DOCX change tracking: handle moveFrom and moveTo". Change-Id: If2a16f1f43315ecab659b24425692ac14bcda619 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123814 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-10-20CppunitTest_sw_ooxmlexport12: avoid DECLARE_OOXMLEXPORT_EXPORTONLY_TEST()Miklos Vajna
See commit a226cec52e536c46e03f57a5f1f7931abbeb0cdd (CppunitTest_sw_rtfimport: convert one testcase to use CPPUNIT_TEST_FIXTURE(), 2019-11-05) for motivation. Change-Id: I329f90a6e0dfffe1d8a5d4f80b8cfa1f21e8d919 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123832 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-15delay, collect and compress LOK invalidations for Writer viewsLuboš Luňák
Due the to way views are updated on any document change, invalidations are at least O(n^2), and since LOK may use a number of views and for each view the entire document is considered to be the view area, this can lead to a huge number of invalidations that are mostly the same repeated rectangles. Change-Id: I63682958d2fc388344641dcd19fa1d2b39054b51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123617 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-15do not use text-based LOK callback internallyLuboš Luňák
CallbackFlushHandler post-processes LOK messages, but for things like dropping useless invalidations it needs to know the rectangle or the view id, and since the only data it gets are string messages, it needs to convert those back to binary form. Which is slow with large numbers of messages. Add internal LOK callback variant that allows also passing specific data in the original binary form. And then use directly the binary data in CallbackFlushHandler. Change-Id: I8dd30d2ff9c09feadebc31a44d8e6a8ccc306504 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123589 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-15tdf#145068 sw change tracking: highlight numbering of changed list itemsLászló Németh
Highlight the numbering of the changed list item, not the next one. Tracked movement of the list items is more visible this way. Follow-up to commit commit 173b7fcaae86980809889db30ddb82f8ba883103 "tdf#42748 show changes of list numbers and bullets". Change-Id: I4c029f708eb10808f72d44892b986a8fade47f42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123592 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-10-14tdf#144840: sw_uiwriter3: Add unittestXisco Fauli
Change-Id: I6c43d5c4dbcebf9bd61ba66b37f9c872d0ea7cc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123594 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-10-14tdf#138873: sw_uiwriter: Add unittestXisco Fauli
Change-Id: Iebce7142f51e5a80fc1ea5e78481efeab3709c09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123595 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-10-14tdf#134426 tdf#138873 sw: Revert "tdf#79717 ...Justin Luth
...save/restore character format on selection overwrite" which might also fix tdf#144638 as well. This reverts LO 6.3 commit 6abed0ea006f3616e40faf2ae782cf64f8ac2914. This 6.3 fix for bug 79717 has caused too many other problems that are not being looked at, so it should just be reverted. It is spamming document with direct formatting which is a terrible thing to have happen by accident. It completely wrecks the proper use of styles. Also revert asscoiated follow-up commits: Revert "tdf#79717 save/restore character style on selection overwrite" This reverts commit 04bd1925706360414438b814046b543c5e317d0a. Revert "tdf#79717: sw_uiwriter: Add unittest" This reverts commit b05955b480fe4d32852e7be8a118d46ca7e6dbfa. These effectively revert 12eac5bcbc9b71bf00cb88b918988826229cca35 but its unit test is left intact. Change-Id: Ideced4d38bfdf4c82f1744534afbaad29689fded Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123566 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14sw: remove another unused documentXisco Fauli
this was added in dc83c34989b366a9740da062e7d7bdca73fd9890 < tdf#124770 sw layout: handle Word's take on italic formatting vs text break > but never used Change-Id: Icf97e7fc9554c0762a91e7eab0841449cdc7fd02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123564 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski
The scenarios are: 1. Calling sequence's begin() and end() in pairs to pass to algorithms (both calls use getArray(), which does the COW checks) 2. In addition to #1, calling end() again when checking result of find algorithms, and/or begin() to calculate result's distance 3. Using non-const sequences in range-based for loops, which internally do #1 4. Assigning sequence to another sequence variable, and then modifying one of them In many cases, the sequences could be made const, or treated as const for the purposes of the algorithms (using std::as_const, std::cbegin, and std::cend). Where algorithm modifies the sequence, it was changed to only call getArray() once. For that, css::uno::toNonConstRange was introduced, which returns a struct (sublclass of std::pair) with two iterators [begin, end], that are calculated using one call to begin() and one call to getLength(). To handle #4, css::uno::Sequence::swap was introduced, that swaps the internal pointer to uno_Sequence. So when a local Sequence variable should be assigned to another variable, and the latter will be modified further, it's now possible to use swap instead, so the two sequences are kept independent. The modified places were found by temporarily removing non-const end(). Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-13sw: remove unused documentXisco Fauli
it was added in 2211a67cc5e577f8abdcc96c9c63865be5fb988d < Rewrite import and export of custom dashes in ooxml filter (fix) > The test was later removed in f3d6c44c9cb533fe4f1cd28fc95adc36cac4bfd5 < tdf#108064 OOXML export: keep preset dashes with any line width > and it fails if it's reintroduced. No explanation why it was removed though, sigh. Change-Id: Ie7409f64d4f8912634d3871c75d16448de0f5211 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123561 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>