summaryrefslogtreecommitdiff
path: root/sw/qa
AgeCommit message (Collapse)Author
2021-09-10uitest: sw: Close the modeless dialogs after using themXisco Fauli
Otherwise, they will remain open in the next test Change-Id: I0019a3d98b7a66d6c4ba15408047facc7093cb5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121893 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-09-10CppunitTest_sw_rtfexport5: simplify assertsXisco Fauli
Directly get the properties as Color Follow-up of 7b3a681a867eeb2d68abd4ce33b07cabfff224ef < tdf#141908: replace usage of sal_Int32 with colors > Change-Id: I23da21b88dad7758856c719ebebaef9ed6fe7ca9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121868 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-09-10tdf#126426: support for hyperlinks in TextParagraphContextVasily Melenchuk
Usually hyperlinks are processed by TextBodyContext, but for grouped shape we accidentaly gone into TextParagraphContext It has almost all possibilities to process txbxContent, but not hyperlinks. Additionally some hyperlink char attributes (color and underline) can expand to follow up ordinal text. Additional small hack applied to avoid this. Unfortunately this is not a final solution: such document fails roundtrip and hyperlinks are lost after saving to DOCX. Change-Id: Ie954f53696bd872cb1f59cb586fb55f6cd7c73bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121172 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-09-10sw layout xml dump: show SwParaPortionMiklos Vajna
Towards showing details of multi-portions, which are invisible to XmlPortionDumper, which uses SwPortionHandler, which was introduced for SwAccessiblePortionData, and is currently misused for debugging. Change-Id: Ib62df8c9338855b6f03b24ca2d83b4d0e4408761 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121861 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-09-08related to tdf#132744: clean-up unit test documentLászló Németh
commit a7b12e23bf9ac8e394405a1de5835e18e40c27c2 "tdf#132744: sw: Add unittest" added an ODT file with a – likely proprietary – photo in a *453 kB* PNG file. Replace the image with a *68 B* PNG in the test document. Change-Id: I684ed3494bf9e7c0489395309e39cd41e78384ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121785 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-09-08tdf#141908: replace usage of sal_Int32 with colorsBaran Aytas
Change-Id: I536e2c8d15db7c4973525ffc1e0abfb211228751 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121703 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2021-09-08tdf#143359 sw: track deletion of empty table rowsLászló Németh
Empty table rows were deleted immediately during change tracking, or in the case of a deleted table also with non-empty rows, accepting table deletion kept empty rows. Note: as a workaround for tracking of the empty rows, i.e. rows without text content, add a redline with invisible text ZWJ in the first cell of the empty row. See also commit a483a44ca00f43a64ae51d62b8fbb4129a413f6d "tdf#143215 DOCX import: fix tracked empty row insertion/deletion", commit b50d386dfa70f7c1d4eb1a49091ec9dd782b767b "tdf#142701 track changes: fix layout regression of image deletion" and commit 05366b8e6683363688de8708a3d88cf144c7a2bf "tdf#60382 sw offapi: add change tracking of table/row deletion". Note: switch off unnecessary redlining of tdf#132744 unit test to keep the sake of that test (i.e. cut of the selected table with empty rows). Change-Id: Ief59008e8714fb88afdfce867598e3dda21bfba5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121784 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-09-08indexing: fix correct size and pos. for shapes + more testsTomaž Vajngerl
Determining the position and size of the shapes (SdrObjects) was wrong as the assumption was the values are in Hmm but were in twips. Added some more tests that check rendering of SdrObjects. Change-Id: I6ef9287892d1774a1243118a5c97f58384bcfd68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121801 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-08indexing: rename "parent" attibute and parse the attribute backTomaž Vajngerl
Rename the attribute "parent" to "object_name" and "parent_index" and parse the "object_name" attribute for JSON and XML when used as input to SearchResultLocator. Change-Id: I46ad8d6aa14f15d1b759126af71284f7d73a7a96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121797 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-08Fix typosAndrea Gelmini
Change-Id: I42d38399726acb1d044b4b9f032de96ded00e5bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121542 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-09-08CppunitTest_sw_ooxmlexport9: 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: Ic11b52a2a54aa4865d3a9663e5aaf3ee9ac85cc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121790 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-09-08indexing: rename "type" for prargraph an object nodesTomaž Vajngerl
They are conflicting, so rename the one for paragraphs to "node_type and the one for objects to "object_type". This needs adusting all the tests. Also change the node_type from numerical value (correcponding to a enum) to string based - "writer" or "commom" values. Change-Id: I0465cd4c2c6989e436d5a675db20c87066d19208 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121743 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-08indexing: support JSON and XML as input for SearchResultLocatorTomaž Vajngerl
JSON is much easier to deal with when using REST and javascript, so support both. Change-Id: I61035452d9a7ba889ac355a42201d79b9fafec6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121742 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-03tdf#143215 sw: test tracked deletion of empty table rowsLászló Németh
Only the test document was added to the previous fix. Follow-up of commit a483a44ca00f43a64ae51d62b8fbb4129a413f6d "tdf#143215 DOCX import: fix tracked empty row insertion/deletion". Change-Id: If39da56e16e56a9322a35259f5984726abe0da40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121549 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-09-03drop SwDocTest::randomTestCaolán McNamara
it fails sometimes, we have a bug there of some kind, no one has fixed it yet in all this time and causing failures on unrelated changes isn't getting us anywhere warn:sw:7502:7502:sw/source/core/doc/DocumentRedlineManager.cxx:109: redline table corrupted: overlapping redlines cppunittester: sw/source/core/doc/DocumentRedlineManager.cxx:112: void (anonymous namespace)::lcl_CheckRedline(IDocumentRedlineAccess &): Assertion `std::is_sorted(rTable.begin(), rTable.end(), CompareSwRedlineTable())' failed. Change-Id: I90fe4b4e323a8c00285eab6739af5a6e1ece3838 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121535 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-03tdf144058 sw track changes: fix table deletion at paragraph joinLászló Németh
Tracked paragraph join by table deletion left empty table in the text after accepting the changes, caused by the non-continuous redline range over the table, related to the copying of the formatting of the first paragraph to the (wholly or partially) removed paragraphs. Fixed by skipping paragraph format copying in the case of table paragraphs. Note: this is not enough for tables with inner redlines, where tracked paragraph join with deletion of such a table still leaves an empty table at the place of the table (a problem inherited from OOo). Regression from commit 1bbbe57dfc0b43d6b5444798d77dcdf5e4e76e49 "tdf#119571 change tracking: show layout changes at paragraph join". Change-Id: Ib3ff79c766b5e6faced796b9546d332bab4e0d94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121510 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-09-03Remove some unused includesMiklos Vajna
See tdf#42949 for motivation. Change-Id: I62354cf2ae750a91b72e91ad838a40e205e7cd61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121526 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-09-02ofz#38011 save and restore m_pLastAnchorPos via UnoCursorCaolán McNamara
when we do some operations that may delete paragraphs Change-Id: I2165dd287771f06c6d0fd061dd7659b06db4bd72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121511 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-02Use utl::TempFile::EnableKillingFileMike Kaganski
Helps keep temp directory clean also on exceptions Change-Id: I81c17d90d6905653db946e68faf2a7f59c17da15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121466 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-01tdf#143574 sw: textboxes in group shapes - part 1Attila Bakos (NISZ)
Introduce SwTextBoxNode class to support grouped textboxes, fixing the crash when entering a group shape, trying to add a textbox to one of the shapes. Test of crash fix: right click on a group shape. Select the menu item "Enter group". Select one of the shapes, and right click on it, and choose "Add Text Box". Note: textboxes in Writer are linked in SwFrameFormat class. Each textbox consists of a text frame and a shape. This object pair makes it possible to have complex content inside any kind of shape (pictures, tables etc. Group shapes have only one SwFrameFormat, but can have many shapes so that means they can only have one textbox. From now, each shape could have a textbox in a group. Please note this is only a preparation for that. Filter implementation and handlers are under development. Change-Id: Iae35c118f0e67697b289c30d0fad4f5e16501c02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120452 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-09-01ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
surely a lookup of i equal to rTable.size() is bogus ==75288== Conditional jump or move depends on uninitialised value(s) ==75288== at 0x1EC68C45: DelFlyInRange(SwNodeIndex const&, SwNodeIndex const&, SwIndex const*, SwIndex const*) (docedt.cxx:246) ==75288== by 0x1EDE68D4: sw::DocumentContentOperationsManager::DeleteSection(SwNode*) (DocumentContentOperationsManager.cxx:2096) ==75288== by 0x1FC27F2C: SwHTMLParser::DeleteSection(SwStartNode*) (htmltab.cxx:4945) ==75288== by 0x1FC231EF: SwHTMLParser::BuildTable(SvxAdjust, bool, bool, bool) (htmltab.cxx:5219) ==75288== by 0x1FC24B7B: SwHTMLParser::BuildTableCaption(HTMLTable*) (htmltab.cxx:4589) ==75288== by 0x1FC23E34: SwHTMLParser::BuildTableRow(HTMLTable*, bool, SvxAdjust, short) (htmltab.cxx:4020) ==75288== by 0x1FC25B38: SwHTMLParser::BuildTableSection(HTMLTable*, bool, bool) (htmltab.cxx:4189) ==75288== by 0x1FC2237F: SwHTMLParser::BuildTable(SvxAdjust, bool, bool, bool) (htmltab.cxx:5055) ==75288== by 0x1FC24B7B: SwHTMLParser::BuildTableCaption(HTMLTable*) (htmltab.cxx:4589) ==75288== by 0x1FC23E34: SwHTMLParser::BuildTableRow(HTMLTable*, bool, SvxAdjust, short) (htmltab.cxx:4020) ==75288== by 0x1FC25B38: SwHTMLParser::BuildTableSection(HTMLTable*, bool, bool) (htmltab.cxx:4189) ==75288== by 0x1FC2237F: SwHTMLParser::BuildTable(SvxAdjust, bool, bool, bool) (htmltab.cxx:5055) ==75288== by 0x1FC24B7B: SwHTMLParser::BuildTableCaption(HTMLTable*) (htmltab.cxx:4589) ==75288== by 0x1FC23E34: SwHTMLParser::BuildTableRow(HTMLTable*, bool, SvxAdjust, short) (htmltab.cxx:4020) ==75288== by 0x1FC25B38: SwHTMLParser::BuildTableSection(HTMLTable*, bool, bool) (htmltab.cxx:4189) ==75288== by 0x1FC2237F: SwHTMLParser::BuildTable(SvxAdjust, bool, bool, bool) (htmltab.cxx:5055) ==75288== by 0x1FC24B7B: SwHTMLParser::BuildTableCaption(HTMLTable*) (htmltab.cxx:4589) ==75288== by 0x1FC23E34: SwHTMLParser::BuildTableRow(HTMLTable*, bool, SvxAdjust, short) (htmltab.cxx:4020) ==75288== by 0x1FC25BC5: SwHTMLParser::BuildTableSection(HTMLTable*, bool, bool) (htmltab.cxx:4194) ==75288== by 0x1FC2237F: SwHTMLParser::BuildTable(SvxAdjust, bool, bool, bool) (htmltab.cxx:5055) ==75288== by 0x1FC79B2C: SwHTMLParser::NextToken(HtmlTokenId) (swhtml.cxx:1787) ==75288== by 0x22060E6A: HTMLParser::Continue(HtmlTokenId) (parhtml.cxx:295) ==75288== by 0x1FC745AC: SwHTMLParser::Continue(HtmlTokenId) (swhtml.cxx:683) ==75288== by 0x22060CF5: HTMLParser::CallParser() (parhtml.cxx:279) ==75288== by 0x1FC73F7F: SwHTMLParser::CallParser() (swhtml.cxx:607) ==75288== by 0x1FC6FF90: HTMLReader::Read(SwDoc&, rtl::OUString const&, SwPaM&, rtl::OUString const&) (swhtml.cxx:238) Change-Id: I9583e5be41fe76f19c699394961ed2717a990cc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121351 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-01CppunitTest_sw_ooxmlexport7: 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: Id6b673d744d5eb1249d9466feb7a4f3758802b0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121393 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-08-31uitest: sw: move find and replace tests to their own folderXisco Fauli
No need to have sw_findSimilarity for just one test Change-Id: Ifec7ee9cbc81492dcae95f330a697e03875ac3a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121044 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-08-31tdf#143793 preemptive unit test for USE_FORMER_TEXT_WRAPPINGJustin Luth
Ensure that any efforts to sort out the back-and-forth issue of honouring wrapping in headers, footnotes, etc won't break old documents without even a whimper. Change-Id: Ic12595a8e25aff176e89adfaba51991d38db516c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121377 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-08-30Removed executable bits on docx fileAndrea Gelmini
Change-Id: I811055f7fc5b05c9123a1fca4118bd469515239b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121269 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-08-30tdf#103612 sw: fix confusing inheritance of section hidden flagMichael Stahl
SwSectionData has 3 confusing boolean members for hiding: * m_bHidden corresponds to the Hide checkbox in the UI * m_bCondHiddenFlag stores the result of evaluating the hide condition * m_bHiddenFlag is the final computed result that indicates that this section is hidden Now, the first 2 flags determine m_bHiddenFlag = true, but there's another possibility: m_bHiddenFlag is also true if there is a parent section for which m_bHiddenFlag is true (because of course this hides all section content including nested sections)... the latter situation is apparently handled in SwSectionFormat::UpdateParent(). The code in SwSection::SwSection() checks the parent's m_bHiddenFlag but then sets the child's m_bHidden, which looks very wrong, so remove this. Also adapt 2 other places that look like they should be checking a different flag. Change-Id: I58d9c878b58ad6cd878f450072178006b4c7ebb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121314 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-08-30tdf#142847 sw: fix textbox layout at wrap settingAttila Bakos (NISZ)
Setting wrap spacing of a textbox via its Wrap->Edit... dialog window, the textbox had fallen apart, if it was anchored as character. Change-Id: I6c48c7a631a93a874129f64e1bdc6b3e2051e64f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118281 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-08-30tdf#144173 sw track changes: keep format of hintsLászló Németh
When a text has multiple character formatting settings enabled and a new one is applied with tracked changes, only one of the former settings is restored upon rejecting the changes. Follow-up to commit ee3171adb24a3d720466fa43bec869910333f892 "tdf#143918 sw: fix reject of multiple changes". Change-Id: I6f3fb52dbd536efaf084b1fc5b8032658353af91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121012 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-08-27tdf#128106 sw: copy bookmarks at start if whole node is copiedMichael Stahl
The CrossRefHeadingBookmarks are always at index 0 so copy them if the selection also starts at index 0. This happens in SwDoc::SplitDoc() for the 2nd etc. chapter. Change-Id: I4765d497e65d3c8257f7eab59b8ba2088688967e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121147 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-08-27tdf#128106 sw: copy bookmarks in SwDoc::SplitDoc()Michael Stahl
Change-Id: Id35b8771b456b162ca653423d02788275a79443f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121146 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-08-27tdf#137363 DOCX filter: don't loose <w:ilvl w:val="..."> of paragraph stylesMiklos Vajna
This adds doc model, UNO API and DOCX import/export for this feature. The rest is not yet implemented (i.e. no layout, UI, etc.) An alternative would be to grab-bag the list level of paragraph styles, putting it to the doc model directly has the benefit that this is a step in the right direction. Change-Id: Idf7157e8a4177b4c2286d3cfb3d5acf2df845076 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121141 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-08-27tdf#116315: sw_uiwriter3: Add unittestXisco Fauli
Change-Id: I29aa953d8541d45b003703ba91c143fc9760ceac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121135 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-08-27tdf#143904 fix direct character formatting copied into paragraph levelBalazs Santha
Currently, Writer copied the direct character formattings, and applied them on paragraph level, when inserting a new row in a table. This bug is a regression from 498d2b82187ec3ff58f076e0d15741e64c0505ba . Explanation, why this regression happened: MSO Word uses a paragraph mark symbol (i.e the control character than can be configured to be shown), which is imported in Writer as a 0-length hint. To fasten up the import of DOCX tables, the core applies the formattings from this 0-length attribute on paragraph level, directly before inserting a new row. All in all, to solve this bug, we needed to make sure, that we only copy the formattings, if it is from a 0-length hint. Change-Id: Iba52e9318cc588feda559339e42897568d009806 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120624 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-08-27sw: remove some unused includesMiklos Vajna
See tdf#42949 for motivation. Change-Id: I7082c51ce73b69f27154fe7308df913a38973100 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121129 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-08-26tdf#125743 sw: fix rendering of graphics bullet with linked imagesMiklos Vajna
Regression from commit d72145f9307c732ced4a546ac1e5093ec7c1a982 (Move BackGraphicURL property & friends to BackGraphic + fixes, 2018-03-01), the problem was that now SvXMLImport::loadGraphicByURL() produces a Graphic that has its type set to GraphicType::Default, but when paintGraphicUsingPrimitivesHelper() consumes this graphic, it expects that the type is either a bitmap or a metafile. Fix the problem by explicitly loading the image when the default-type, origin-url-set case happens: this is rendering, so no problem to load the URL and that will give us the expected graphic type. This is also meant to keep the original problem fixed, since we only load images when painting, not during import. Change-Id: I951bc92d05bb8ec57d2ba6958c47947f8f9b5c78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121082 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-08-26tdf#135164 add unit testJustin Luth
fixed by tdf#143605, but that was a bit different, so adding a specific docx unit test. Change-Id: I9f5a6b225277f1c1fdbfed7759919b3fd6e5dea5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121008 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-08-26tdf#144089: sw: Add UItestXisco Fauli
Change-Id: I6ffa476180a58ba47268b4f4a8bc59f75738be29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121046 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-08-26CppunitTest_sw_ooxmlexport6: 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: I3f5dbe43d94eba90a44b39180239e7aed8242b05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121045 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-08-26indexing: move xml parsing into SearchResultLocatorTomaž Vajngerl
Let's keep unneeded complexity out of SwXTextDocument, so move parsing into SearchResultLocator. As a bonus we can now test parsing. Change-Id: I944bfc43e6953523eee19b26b7f483aa401809aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121032 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-26tdf#144089: Revert "tdf#137737 i18n search: don't expand start/end with ↵Xisco Fauli
regex ^ or $" This reverts commit a511bffd67a9cebfdc878766581ac08c79d7ff51. Reason for revert: See https://gerrit.libreoffice.org/c/core/+/120981 Change-Id: If8a445448976a9963f76623d3d968b8d5e3d74dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120990 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-08-25Fix typosAndrea Gelmini
Change-Id: I13c41a077cd54102010c8253dee2455f235087c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121033 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-08-25tdf#143384 DOCX import: fix SAXException at header with tableAttila Szűcs
Regression from commit d656191ec308d4280b93c7169372e543a255d108 "tdf#119952 DOCX import: fix negative page margins". Add SwXHeadFootText::CreateTextCursor(bool bIgnoreTables = false) (modeled after SwXBodyText::CreateTextCursor) to create text cursor for copying the header/footer also started with table during fly frame creation in convertoToTextFrame(). Note: add hidden property PROP_CURSOR_NOT_IGNORE_TABLES_IN_HF to use the new feature in domainmapper (followed commit af4e5ee0f93c1ff442d08caed5c875f2b2c1fd43 "tdf#97128 DOCX import: fix frame direction"). Co-authored-by: Tibor Nagy (NISZ) Change-Id: I96e2cf2dddcecd146c53c12d7fdb44fc4d90fa0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119549 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-08-25tdf#137737 i18n search: don't expand start/end with regex ^ or $Justin Luth
If the regex starts with ^, that means that it matches only at the beginning of the content. So don't expand the beginning of the content or else it won't match anymore. Similarly, $ indicates matching at the end of the content. For the unit test I just randomly guessed at SearchItem.AlgorithmType, and it kinda worked. I love black boxes... I hope I remember what i learned about TransformParameters() which was parsed in sfx2/source/appl/appuno.cxx, splitting the "variable" into Item.PropName = PropValue. That is definite black magic. Change-Id: Ie1640821a7a430e78dbe72c57a92aeaa9b5272a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120410 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-08-25tdf#143938 sw test: track format changes of the paragraphLászló Németh
Character formatting changes of the wholly selected paragraph weren't tracked before the following fix: commit 5e891c2ee82f2d7566ddb4e15b9c03cecb9fc1f8 "tdf#143939 sw: track format changes of the actual word". This is only an unit test to cover both fixed problems. Change-Id: Ia8ee15895fc309f4c57c54ac8e6b4265969b5256 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120957 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-08-24reduce cost of dynamic casting to SwFlyFrameNoel Grandin
which is often hot on doing document layout Change-Id: Ie78b6a6da4dba38b4ab682f4e1b9d86cc8171918 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120938 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-24tdf#143692 writerfilter CN: reapply lost OutlineLevelJustin Luth
The paragraph styles had already set their numbering-related properties before numbering.xml choses some styles to be assigned as Chapter Numbering. Part of this CN process in SW is to clear the inheriting styles of any inherited numbering properties (numId, listLevel, outlineLevel). So, we need to re-address outline levels after numbering has been imported, and fix up anything that has been cleared. [P.S. No need to do the same thing for listLevel yet, b/c LO does not support listLevel on paragraph styles in general.] Change-Id: Idfb4d150b94558b069dbb1a87c764460396b34d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120757 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-08-23ofz#37458 use o3tl::convertSaturate in convertEmuToHmmCaolán McNamara
Change-Id: Ic177ca6042cbedc4cbe70e1f35ac3d85c1fa2f7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120840 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-23sw: evaluate bookmark conditions differentlyMichael Stahl
Conditions may refer to database rows in mail merge, which requires a SwDBManager to evaluate. So do it in DocumentFieldsManager::UpdateExpFieldsImpl() where the similar conditions on sections and fields are evaluated. Change the meaning of the m_bHidden flag to store the result of evaluating the condition, instead of being always true when there is a condition. Change-Id: Ib8f5483e7f68fc37c650b790b70d10af3c1e6f28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120793 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-08-23tdf#143692 writerfilter: fix outlineLevel import x3Justin Luth
First, illegal values don't mean "use body level". It means "inherit the value value from the style". So just ignore illegal values. Secondly, styles without any explicit setting (a -1) where being incorrectly specified as "-1 + 1", i.e. body level(0) - meaning that inheritance was always lost. Thirdly, the body level value is necessary in order to cancel inheritance from a style. So the style must be able to set a value of 9. Change-Id: I2161085181527fb321dbcc00636513330dd8ca1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120756 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-08-23indexing: make indexing XML flat and use simple element namesTomaž Vajngerl
This changes the indexing XML to be flat-er and change the element names to just be either "paragraph" or an "object", where an "object" then has an attribute what type exactly it is. This makes converting the XML to an indexing engine accepted format easier. Change-Id: Ia8941cc9616a862c1bc980efea5ba2548217644e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120836 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>