summaryrefslogtreecommitdiff
path: root/sw/Module_sw.mk
AgeCommit message (Collapse)Author
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-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-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-05sw: fix assert fail with ShowRedlineChanges=false and para formatMiklos Vajna
It fails like this: loolforkit: sw/source/core/layout/wsfrm.cxx:4551: void UnHide(SwRootFrame&): Assertion `rLayout.GetCurrShell()->ActionPend()' failed. #4 0x00007f98e9f8c198 in UnHide(SwRootFrame&) (rLayout=...) at sw/source/core/layout/wsfrm.cxx:4551 #5 0x00007f98e9f8c839 in SwRootFrame::SetHideRedlines(bool) (this=0x7f98c40f7bd0, bHideRedlines=false) at sw/source/core/layout/wsfrm.cxx:4664 #6 0x00007f98e9b18afd in sw::DocumentRedlineManager::SetRedlineFlags(RedlineFlags) (this=0x80a4120, eMode=49) at sw/source/core/doc/DocumentRedlineManager.cxx:1097 #7 0x00007f98e9cfa503 in SwEditShell::SetAttrSet(SfxItemSet const&, SetAttrMode, SwPaM*, bool) (this=0x8885840, rSet= SfxItemSet of pool 0x808fd10 with parent 0x0 and Which ranges: [(63, 64), (120, 120)] = {...}, nFlags=SetAttrMode::DEFAULT, pPaM=0x0, bParagraphSetting=true) at sw/source/core/edit/edatmisc.cxx:187 #8 0x00007f98ea995f07 in SwTextShell::ExecParaAttr(SfxRequest&) (this=0x8bd0820, rReq=...) at sw/source/uibase/shells/txtattr.cxx:451 Fix it the same way commit dd489bc01adc22fc5015ea56b61d66104af184a8 (tdf#125754 sw_redlinehide: avoid recursive layout in SetHideRedlines(), 2019-06-19) did: make sure that SetHideRedlines() is called before EndAllAction(). Change-Id: I6304abec2e2e2967a8369b0219492bebcd606d03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120069 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-06-09tdf#137469 Prepare tests for encoded text filterOleg Shchelykalnov
Change-Id: Ifba71748cc389544bfb64e225a7020de8261967b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105621 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-06-07sw_uiwriter: split uiwriter into 2Xisco Fauli
it already has 230 tests Change-Id: Id06ffb791cf65342676e6d7076105773c8137685 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116784 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-06-03indexing: start of Indexing Export impl. based on (X)HTML exportTomaž Vajngerl
This adds a indexing output/export to HTML code, which will output a xml document that will be used for indexing of the document. It is based on HTML to reuse the traversal through the doc. model. It is enabled by setting the "IndexingOutput" export parameter. This commit only adds in the groundwork, but the output is still more or less the same as html and the follow up commits will add more indexing specific changes. The only change is to use "indexing" as the top level element and the document is a valid xml (has the xml header). Also add basic test that the indexing output/export works and can be parsed as an xml with "indexing" top level element. Change-Id: I153b1a70da7cbcf0d33b8610d962e6b7ae23ad23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116631 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-03sw_rtfexport: use a template for makefilesXisco Fauli
in order to remove duplicated code Change-Id: Ic1e7d331b14f74051ed23bf6c7e64016eca61206 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116651 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-06-03sw_ww8export: use a template for makefilesXisco Fauli
in order to remove duplicates code Change-Id: Ie107d953d2e7ab4624edccd58fd8637349b9e098 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116649 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-05-21tdf#138556 Don’t add Open Values to stock chart types 1 and 3Aritz Erkiaga
A new function was defined, XdataInterpreter::getChartTypeSpecificData. Being 100% chart-type-agnostic when retrieving chart data is impossible; candlestick charts can have different numbers of sequences per series, and this information is not present in any other chart type. Change-Id: I0f54b09202c42667331b083d54d90e4ceee81083 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113075 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-15sw: split CppunitTest_sw_layoutwriter into 2Xisco Fauli
It already has 2 cxx files Change-Id: I74aeea953568b82aff3130b20547a7c207783431 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115628 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-05-13sw_uiwriter: Use a template in makefiles to reduce duplicated codeXisco Fauli
Change-Id: I2aa29480766f943ad24d97635c50eb8b49ca8795 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115536 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-04-28sw bibliography, refer to a page: add insert/delete UIMiklos Vajna
If the toggle button's activate state changes, adapt the sensitivity of the next spinbutton, this way a new page number can be added and an old one can be deleted. Change-Id: I97067182e8cd42a02b164ac941598bada2630e07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114750 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-21sw bibliography, refer to a page: edit the page number of individual entriesMiklos Vajna
Usually it's handy that editing a bibliography entry field updates all other fields referring to the same source. But avoid doing this in case only the page number changes, that's typically specific to that field. Change-Id: I2b2608c6c4fdb859c430294eaecdadfeb1c802a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114380 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-03-17tdf#52065 sw: revert tdf#45908: Cleaning up the tabs too earlyJustin Luth
... can cause loops from LO 3.5 commit 36c905d8c2874f6f984d5fbbc07784ec20c43524 The PostFormat for Center and Decimal tabstops is critical since the space they take up is unknown until the following text is evaluated. The search position in these two cases is invalid until the text position is calculated by PostFormat. PostFormat normally returns FALSE, so in almost all cases the rest of NewTabPortion completes. The function only returned early if the start of the tabstop was beyond the right margin. I assume the original intent was to avoid potentially unnecessary processing. However, returning early can cause looping, which the LO 3.5 commit "fixed" by removing everything. Well, just remove the early return and both problems are solved. Change-Id: I4afc4cce8249f90097bc1f263df1a39bc219098d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112559 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-02-18sw bibliography: make URLs in the bibliography table clickableMiklos Vajna
- Don't reuse the <text:index-entry-link-start> / <text:index-entry-link-end> mechianism from <text:table-of-content-entry-template>, because <text:bibliography-entry-template> doesn't allow this - Use STR_POOLCHR_INET_NORMAL as a char style, so the URL looks clickable - Allow absolute URLs for ToxAuthorityField::AUTH_FIELD_URL (other URLs like ToC are always relative) - Track the new text added by FillText() between the StartNewLink() and CloseLink() to figure out what is the URL to be launched on click Change-Id: I126fa06aecfff783e62b65a548228ff781b62c5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111117 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-02-11sw tooltip on bibliography fields: add the actual tooltip functionalityMiklos Vajna
- Similar to e.g. SwMacroField::GetMacro(), add a new SwAuthorityField::GetAuthority() that returns a string which is similar to the one-liner text node in the bibliography table for a given bibliography reference. - Base this on the recently added SwAuthorityFieldType::CreateTOXInternational() and SwTOXAuthority::GetText() to share code with sw::ToxTextGenerator::GenerateText() and SwTOXBaseSection::Update(). - Finally extend SwEditWin::RequestHelp() to actually provide the tooltip on mouse hover. Change-Id: I33a58076c6d141566298259e7e4681541fac1055 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110765 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-19add --disable-librelogo to disable LibreLogo at build timeMichael Stahl
Annoyingly the packinfo_*.txt don't support conditionals but we can work-around that with a little duplication. Change-Id: Id00a6831effcc63a917fc21d2cd201474fdb559d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109569 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-01-18uitest: sw: test load styles from templateXisco Fauli
Also add a new module for sidebar tests Change-Id: Iba823907f2a71d590152c17855355ed5a0a44326 Change-Id: I41a023468a90ca7d79822b6a1c78bf24ee971bc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109566 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-12-31SwFlyFrame: Modify no moreBjoern Michaelsen
Also, make the uitest output a bit more explicit. Change-Id: I41fa08a6fc02d95ad3337129eb93f8a569cf3cbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108491 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2020-12-19sw: split CppunitTest_sw_uiwriter into 3Michael Stahl
It already has 3 cxx files, and takes by far the longest to run. The split isn't ideal at 241/71/162 but still an improvement. Change-Id: I59215475724cbf0e38b890d7be6d60a23dccf0a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108030 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-12-16tdf#138892 writerfilter: cancel style list if bNoNumberingJustin Luth
This fixes 6.1 regression e24e2d2fb02239753c1520a0458b44683ea4cc2e. Starting in 7.0 (tdf#131321), paragraph styles kept their numbering property. But even before that, non-paragraphs marked by bNoNumbering we having their direct numbering removed, and then finishParagraph applied para-style numbering since there was no direct numbering. So, we need to pass the bNoNumbering to finishParagraph so that it can cancel out a style-assigned numbering. Change-Id: I0c24af4e9bd0ea3712179a47ed3550f91c8f44b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107738 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2020-11-17uitest: move findBar tests to their own folderXisco Fauli
Change-Id: I083b5c63a1c96e36d958e3071d9a7b2be14373bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105973 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-11-06DOCX import: fix assertion failure when redline ends right before a ToCMiklos Vajna
This was always a problem, but now more visible since commit 8b3c861c46ae12d21b7b3a550e2daa21d2006b77 (tdf#89991 DOCX: import Show changes from older formats, 2019-06-13), as it now affects more documents: tracked changes can be hidden by the time the initial layout is created. With that aside, the immediate problem is an assertion failure in InsertCnt_(), because it assumes that an end node for a section has to have a matching pActualSection, created by start node of the same section. This will fail in case the start node is hidden, but not the end node. The deeper problem is that redlines are not supposed to cross section boundaries: if e.g. multiple cells are selected in a table and the user deletes while tracking changes, then the UI creates multiple redlines instead. The problem here is similar: a delete redline ends right before the section start, so when SwNodes::InsertTextSection() inserts a section node, the end of that redline is automatically moved to the start of the section content (its index increases, the actual SwNode doesn't change). Fix the problem by explicitly checking for a redline end at ToX start and moving it back to the end of last content node. This matches the doc model produced by the WW8 import. Change-Id: Ic7b279185a20d2a32abd054d3fc6be530ddde12a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105412 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-10-29tdf#137105: sw: add first UItest for styles inspectorXisco Fauli
Change-Id: If704e26f3dcfa818c805ceac3a03b6c2483867c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104974 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-10-25uitest: sw: table -> sw_tableXisco Fauli
Change-Id: I99026f6579bb48171cfafdad16c3c6d969c77fd5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104727 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-10-23uitest: move navigator tests to their own folderXisco Fauli
Change-Id: Iacc2e21fde8fc126752d0b1fa14cd1f962930d4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104723 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-09-30sw: fix heap-use-after-free in the UnoActionContext dtorMiklos Vajna
When lockControllers() is followed by close() + dispose(), but no match unlock first: ==8514==ERROR: AddressSanitizer: heap-use-after-free on address 0x6190002d1b58 at pc 0x7f48b13f5b85 bp 0x7fff557d98c0 sp 0x7fff557d98b8 ... #3 0x7f48b138beca in SwDoc::getIDocumentLayoutAccess() /sw/source/core/doc/doc.cxx:412:12 #4 0x7f48b58db224 in UnoActionContext::~UnoActionContext() /sw/source/core/unocore/unoobj2.cxx:200:49 ... #15 0x7f48b841c484 in SwXTextDocument::~SwXTextDocument() /sw/source/uibase/uno/unotxdoc.cxx:439:1 freed by thread T0 here: #1 0x7f48b1388a26 in SwDoc::release() /sw/source/core/doc/doc.cxx:118:9 ... #17 0x7f48d15a40e5 in SfxBaseModel::dispose() /sfx2/source/doc/sfxbasemodel.cxx:755:13 #18 0x7f48b8429a48 in SwXTextDocument::dispose() /sw/source/uibase/uno/unotxdoc.cxx:586:19 Change-Id: I39bf65e43c12ce5ee49bdedeb1673b934ca21106 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103709 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-09-30tdf#60145 sw: fix UTF-8 encoding without BOM is not detectedTomofumi Yagi
Writer can now detect Unicode type even if importing text file does not have a BOM. Change-Id: I70fa4145672d855f9ef9df040a930ff5d1564905 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102884 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-09-10Disambiguate UITest_sc_options and UITest_sw_optionsStephan Bergmann
...that were added with the same name UITest_options in 107af098311beafaadb343c5a3634389f56006a0 "uitest for bug tdf#117458" and ec914194382654aa4b0ad9973acc0eed15a4ab43 "add uitest for bug tdf#78133", respectively Change-Id: I31a967d2ce14f86d91951a836b694f360802c5a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102391 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-09sw: rename CppunitTest_sw_updateall_object_replacements to sw_uibase_uiviewMiklos Vajna
All these new test suites are named in a way, so that in case the fix is in sw/source/foo/bar/, then the matching test suite is sw_foo_bar. Rename to this schema, so next time a bug is fixed in that directory, we don't need to add a new suite. Change-Id: I968711754cb587cc2f97fff6431be416b477728f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102274 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-09-08tdf#135149 sw: fix deleting textbox of as-char shapesMiklos Vajna
Regression from 7596e26fd259ce5445212949403e7cd32303b2bd (Add SwTextBoxHelper::findShapes, 2014-06-24), the problem was that in case the shape is as-char anchored, then DeleteSelection() returns false, and so the textboxes of the deleted shapes are not deleted. There is no real reason why deletion should be conditional on the DeleteSelection() result, so just move it outside that block, so textboxes are always deleted. Change-Id: Ib3bd444e9e96f9de0f68a9162ab39255ec5a6807 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102198 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-08-28Add unit test for c123bfff501229f398a1b679fc7434b82d53685cTor Lillqvist
Change-Id: Ic616ec9f39b65f8e8ec840a48e3b5801b31cf5da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101530 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-18tdf#135016 DOCX export: fix unexpected error on save with undo/redoMiklos Vajna
Regression from commit d379d18666aa42031359ca8eb34b0021960347ae (oox: import WPS shape with text as shape with textbox, 2014-06-18), then problem was that when undo restored text deleted by cut, we ended up with an SwXShape that had no frame format. Fix the problem by deleting the cached old UNO wrapper after changing the association between a textbox's shape and text frame. An alternative would be to handle errors better when the TextBox UNO property is not of type bool, but that would still lead to silent data loss, so don't fix the problem that way. Change-Id: Id45ad292befc746e7c49a3b827c91efd069d29df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100876 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-31sw: introduce a Library_swqahelperMiklos Vajna
So it is no longer necessary to define all SwModelTestBase functions inline. Change-Id: Ia1055ff967b3614102275ec92607c85ec063fce7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99820 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-27tdf#134610 sw: fix incorrect position of math object from DOCXMiklos Vajna
Regression from commit a2f85c062aafb3fd9dfb1c6c6e87e1e73e7545a3 (tdf#130362 sw: fix anchoring of inline math objects, 2020-02-04), the problem was that the SwFlyFrameAttrMgr ctor wanted to set the anchor type to at-char, and then later DocumentContentOperationsManager::InsertEmbObject() wanted to undo that for math objects, but this did not play nicely with objects imported from DOCX. So don't set and clear the anchor type, rather set it conditionally in the first place. This allows setting the anchor type in writerfilter/ before insertion, and then all of 1) docx import (depends) 2) insert of Math objects (as-char) 3) insert of images (at-char) are working. Change-Id: I94d82c12f30d069426db1bab70c456cadf1c91ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99559 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-07-22sw: find & replace: fix soft hyphen cleaningMiklos Vajna
If there is a formatted soft hyphen after the search string, then replace skipped the replacement, even if there was a match. Do the same for comments & footnotes, though the primary reported problem was just soft hyphens. (The same happened when manually doing find & replace using the Ctrl-H dialog.) Change-Id: I8437e84dea99ceef98d515beef5893cf954e674f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99236 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-06-23tdf#119081 sw: fix RTF paste into outer table cellMiklos Vajna
Regression from commit ed654c4aa7f9f10fcb16127349009bc0c38b12e8 (Revert "fdo#43869 use the old rtf importer for paste", 2012-11-30), the direct problem is that SwXText::insertTextPortion() is now used by writerfilter, so in case it's not as good as the internal API used by the old RTF filter, we have a problem. This function calls SwXCell::CreateCursor(), which calls SwXCell::createTextCursor(), which uses Move() to go to the first content node in the cell, but that means we end up at the inner cell's XText for an outer cell. So later when we want to go to the end of the outer cell, we can't, as that would be a different XText and we throw an exception. Fix the problem by instead using createTextCursorByRange(), which immediately positions the cursor at the insert position, so the XText will be correct. FWIW, the ODF import at SwXMLImport::setTextInsertMode() also uses createTextCursorByRange() to handle this situation. Change-Id: I1db13b860bc60771d98c2b4099be73f4bf41c375 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96901 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-26tdf#130456 sw: enable semi-transparent text for char style dialogMiklos Vajna
The code is shared, so this fixed the para style dialog as well. Change-Id: I742231bf76c562b3255700fc4eeb4c870c3deb6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94805 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-05-25Revert "tdf#104017 DOC export: be less aggressive with merging page styles"Justin Luth
This reverts LO 6.3.4 commit 5d1709a7c4184eb31cfc4c2d3acadff3a4a68189, which tdf#133334 shows is wrong. How this made it past QA is a mystery to me. There should be lots of examples. Change-Id: I17be6e4bab44057f4535d4728825e12d068b65d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94782 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-28tdf#131729 sw: handle no drawing objects when calculating overlap of objectsMiklos Vajna
Regression from commit d37096f59e7e0286e55008153591a60bab92b9e8 (Related: tdf#124600 sw anchored object allow overlap: add layout, 2019-09-19), we assumed that the anchor frame always has draw objects, but that may not be the case. That happens when dragging a to-character anchored object around, before the object is added to its anchor. Change-Id: I1271a6e498553838c3851864b7965a1ba28de663 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92989 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-22sw: prefer ODF over RTF when pasting from WriterMiklos Vajna
Regression from commit e9e6d4b058e13165f3dde1ca7822eec97dfe8aa7 (tdf#116685: Make the RICHTEXT take precedence over EMBED_SOURCE., 2019-09-26), the problem was that now we always prefer RTF over ODF when pasting into Writer. The commit made sense for Calc->Writer paste, but it causes formatting loss for Writer -> Writer paste. The exact use-case was copy&paste of numberings where the pasted content got paragraph indent as direct formatting, so shift-tab at the paragraph start changed only the bullet type, not the indentation -- but it's easy to imagine several other cases where a roundtrip via ODF provides better results than RTF. Fix the problem by leaving the above commit in place, but extending SwTransferable::Paste() so that it prefers ODF over RTF in case of a Writer->Writer paste (and leaves the non-Writer -> Writer paste behavior unchanged to avoid the unwanted OLE objects). Change-Id: Ida745bba65c5a210021cea0d267c02900fc6398a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92705 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-04-07tdf#131490 sw btlr: fix handling of vertical textMiklos Vajna
Latin text goes from l->r, then t->b. If we rotate to the right, then we get t->b, then r->l. Vertical text in vcl's Font means the individual glyphs are painted in a way that looks "non-rotated" in the tbrl case. btlr is not symmetric to this: if you rotate to the left, then Latin and vertical text is handled the same way, i.e. there is no compensation at a glyph level. This means that as far as vcl is concerned, the Font's vertical flag has to be true in the tbrl case, but no in the btlr one. Fix SwFont::SetVertical() to do this, which means that rotating at a character level or using the btlr text direction will result in the same rendering for a one-liner text. Regression from commit 89e5b431d468745da3a1eff14d48296107b9101b (sw btlr writing mode: implement DOC filter, 2019-03-28). Change-Id: I2619c77a3b2597dbf9feab6c7042e8d8c7454197 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91780 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-03-20Extract testDisposedByDesktopTerminate from CppunitTest_sw_apitestsStephan Bergmann
It is not guaranteed that SwXTextTable runs last during CppunitTest_sw_apitests, and e.g. building with --enable-lto on Linux caused SwXTextField to be run after SwXTextTable. But then testDisposedByDesktopTerminate had already shut down all the relevant global state, so the SwXTextField tests would fail. TerminateTest is a faithful copy of the original SwXTextTable testDisposedByDesktopTerminate behavior, but I do not know how much of that (if anything at all) is actually test-worthy. (For example, parts of TerminateTest::init may not be relevant, or the original SwXTextTable testDisposedByDesktopTerminate may even only have been there to clean up after other tests and not to actually test anything by itself, cf. 20ed81fd42cf8079c11c2b18973b9504a679e49c "Make individual tests clean up after themselves".) Change-Id: Ib95b7fa6888f55a27236a779c453a6d04122a527 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90774 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-25tdf#91219 sw: don't allow anchoring a shape+textbox into itselfMiklos Vajna
We already have code that detects this in the simple fly frame case, extend that to cover the "paired fly frame + draw shape" case as well. Change-Id: I4b3c1d600407436b239fee311ae6bfe837804241 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89381 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-17Drop needless junit and python make conditionalsJan-Marek Glogowski
JunitTest and PythonTest modules check for these themself. Change-Id: Ia453bc99571738b01cc8f161f346cb6c37b2e429 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88832 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-02-14sw: fix handling of table vs fly overlaps in the AddVerticalFlyOffsets caseMiklos Vajna
When a table overlaps with a fly frame, Writer creates a fly portion inside the relevant cell frame (increasing its height), and Word shifts the table down. Both are valid approaches, but the rendering result is different in case the table has a border. So keep the default unchanged, but in case the AddVerticalFlyOffsets compat flag (set by the Word importers) is set, avoid the overlap the Word way. Note that the table frame uses the full width (available in the body) even for e.g. 50% width tables, so check for the overlap using the print area, which does not always overlap. Finally, don't always require a valid frame area definition from the fly frame: - the mentioned i#46807 bugdoc currently doesn't need that check - the fly frame area definition becomes valid only after already positioning the table, leading to an overlap Keep that check for the non-compat case, though. Change-Id: I9202050befebf2efdbb5395ded6fcb52b378d8e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88724 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-02-04tdf#130362 sw: fix anchoring of inline math objectsMiklos Vajna
Regression from a7528cd6f17ea5c5b29e7d607e54c62de0d9e7db (sw: insert image: set anchor to at-char by default, 2019-11-18), that defaulted to at-char anchoring for charts and images. What was not considered is that math objects had a previous as-char default (not to-para), and that is supposed to be unchanged. Change-Id: I2a91af6425035b48a0e47ad9b10939945855cd16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87976 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-01-27tdf#130179 sw comments on frames: limit insert UI for at-char and ...Miklos Vajna
... as-char anchor types SwWrtShell::InsertPostIt() only sets the comment anchor for those types, and we would crash without an anchor. Change-Id: I7d2f5d3d8f8e11c46db060c17587e97ecb786ad2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87542 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-12-28acc. check: introduce AccessibilityCheckTest + document testTomaž Vajngerl
This adds AccessibilityCheckTest to test that AccessibilityCheck returns correct issues for documents. This in addition adds 2 tests for document title and document/style language. Change-Id: I71f3b0de0af7a08507f2b90b46847010948bc8cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85856 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>