summaryrefslogtreecommitdiff
path: root/sw/Module_sw.mk
AgeCommit message (Collapse)Author
2024-06-28tdf#92029: sw_autocorrect: Add unittestXisco Fauli
Change-Id: I7ac855ac826353869c3a905ea70448d0c8dc1b76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169711 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-05-14tdf#144576 Copy a table from Writer to plain text editor as a MatrixAdam Seskunas
sw ascii filter - check for table nodes, output them seperately with formating to be displayed as a matrix when copy/pasted to a text file sw qa filter ascii - add new test suite along with test to check for correct output Change-Id: I8ca31bced3860e8e9752db8530ea6caaf31f2e5e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164833 Reviewed-by: Hossein <hossein@libreoffice.org> Tested-by: Jenkins
2024-05-02tdf#160833 DOCX import: use the DoNotMirrorRtlDrawObjs compat flagMiklos Vajna
The bugdoc has a shape which should be on the right page margin, but it was on the left page margin. Use the new compat flag to have a layout that matches Word. This way we don't need to unmap the tweaked position at export time (a limitation that the DOC filter has). Change-Id: I38dfae370f275d9f0897198e7b0569f2d91dd352 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166993 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-04-18move writerfilter inside swNoel Grandin
writerfilter wants to convert incoming RTF and OOXML files into writer's document model. But it currently has to do so by manipulating the limited subset that we expose through the UNO API. This is both slower and less accurate than having access to the full document model. So move it inside, and then we can strip out various hacks, and optimise imports. Change-Id: Ie1114d28130ef5f9a786531bc552cb8ee7768015 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165953 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-19CppunitTest_sw_tiledrendering2: extract one test from the old, large suiteMiklos Vajna
Not a split, to avoid too many conflicts while cherry-picking, but at least create a new suite where next tests can be added without too much build time after source code edits. Change-Id: I0fb95e91ca9289aad25f72b0faa5f8eca3c6c06a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163582 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2024-01-20tdf#153909 docx import: wrap through shapes shouldn't FollowTextFlowJustin Luth
This resolves a NISZ 6.4.0 regression from commit 27d04f6dbf38aa28fb7215590d578c4567db5770 tdf#119038 DOCX: fix FollowTextFlow handling MSO is all over the place in how they implement layoutInCell (aka FollowTextFlow in LO). There are lots of compat15 differences for this, but I don't notice compat coming into play with this bug. For reference, see commit e993638d5ecd33783f2eebdccfa87a81e5a8a2c5 Author: Miklos Vajna on Mon Jan 24 12:53:25 2022 +0100 DOCX import: fix <wp:anchor layoutInCell="1"> with <wp:wrapNone> I'm sure this is the WRONG code spot for handling FollowTextFlow, but anywhere else and we lose the "it came from a vml shape" limiting information, so I'm not going to try to relocate this code. Inline (as-character) shapes ignore layoutInCell, so the type of anchor (floating or inline) shouldn't matter and therefore doesn't need to be part of the if () clause. The header can be special (in compat14 it means everything is wrap through), but at least in this case it is not limited to IsInHeaderHeader. Using a non-header as the unit test. make CppunitTest_sw_ooxmlexport21 \ CPPUNIT_TEST_NAME=testTdf153909_followTextFlow The first patchset contains a list of all of the unit tests that were impacted by this patch: nothing interesting. Change-Id: I0c4c7924833550533ad1b0b7609840a666d4d589 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162324 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-12-21tdf#158785 partial revert "enable hyperlink to be detectedJustin Luth
... at the end of text" This reverts lpranam's 7.2.0 regressive commit 3233db0913193855285e1f56492d4617368441b6. The character after a hyperlink should not offer to CTRL-click or jump to the hyperlink target. make CppunitTest_sw_uiwriter9 CPPUNIT_TEST_NAME=testTdf158785 Change-Id: I3f5398cc3a4f29ddf1c50764c311046713d39439 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161042 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-12-19tdf#158583 tdf#158586 RTF writerfilter: only startRun for real frameJustin Luth
This fixes a LO 7.6.4 regression of a lost page break, as well as another example where part of the paragraph moves to next page, from mstahl's commit 4e2f2489c4c7436f8b3a21a530bc625cbef4e365 It seems likely that the run should only be checked when we know that there is a real frame here, which essentially becomes a run for most purposes (except perhaps for page breaks - as seen for DOCX). This code block was introduced with commit 0d9132c5046e15540abc20e45d64080708626441 Author: Miklos Vajna on Sat Mar 24 13:04:54 2012 +0100 fdo#47036 fix RTF import of shapes inside text frames at the start of the doc and in the other block of touched code, it did test inFrame. The unit test works when compiling right after the regression, but has broken because of tdf#153194. Since this will get backported way back and all over, it is a good time to introduce rtfexport8. make CppunitTest_sw_rtfexport8 CPPUNIT_TEST_NAME=testTdf158586_0 make CppunitTest_sw_rtfexport8 CPPUNIT_TEST_NAME=testTdf158586_1 Change-Id: Ib4b75efb8422d96e693da337cbef97520e975f3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160655 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-11-28sw: move header/footer tests to own class in core testsTomaž Vajngerl
In addition add some more basic header/footer tests. This makes refactoring of header and footer OOXML import much easier. Change-Id: I5b3b3714656ba2f7b1dda8d8f067c3bfe68857a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159946 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-11-25tdf#156243 Fix off-by-one bug for autocorrectMatt K
This change removes the "-1" from the code that applies the autocorrection so that the entire string to be autocorrected is replaced, instead of leaving off the last character. Also, the starting character of the string is preserved (i.e. non-bold if changing to bold) by adding 1 to the start position; this is for the case when the user cancels the autocorrect dialog. Change-Id: Ibe500a1ba0ca5b12ec9c918b51353074b8dd12ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154685 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-31CppunitTest_sw_ooxmlexport5: split into twoXisco Fauli
It already has 105 tests Change-Id: I06bd3740f5b3f368017fefd06fda099891834114 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158668 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-08-23tdf#155510 ODT import: ignore props of covered table cells, unless in comp modeMiklos Vajna
The problem was that the A5 cell on page 2 used to have a solid background, but this was lost after commit 1001dbaef4dec2b51c25ed8343bab6910f1219e1 (ODT import: handle style name of covered cells, 2021-03-19). Covered cell formatting was interesting for cell borders, in Word compat mode the covered cell can have its own border style, so e.g. there is left border on a vertically merged cell till its center, but not after its center. Fix the problem by limiting the import of covered cell formatting to the case when the TABLE_ROW_KEEP compat flag is on, to keep both native ODT and ODT-from-Word documents happy. If there is a need, some smarter way of merging properties could be implemented in the future. Change-Id: Icc1e6f48d9f5a0379d9a9052a1f5b9ae3f294477 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155957 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-06-08sw: remove char color GrabBag and fix export, fix tint/shade calc.Tomaž Vajngerl
Don't store values from grab bag when exporting character theme colors and tint/shade values. The values could be wrong now and aren't needed anyway as we support the values in the model. Add proper export support for char color theme information with correct conversion of values into tint/shade values in 0-255 inverted interval. This also fixes the import of tint/shade values whcih calculation was slightly off. We divided by 256 instead of 255, which introduced an error. In addition introduce ThemeColorUsage enum, which marks if the theme color type has a specific "usage" - text or background. This is determined on import if the theme type is background{1,2} or text{1,2}. This is then taken into account on export, so the exact type is preserved. Change-Id: I0022a159397fd0c3d39a118a7149bb2488dfc149 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152705 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-04-11CppunitTest_sw_ooxmlexport10: split in twoXisco Fauli
it already has 104 tests Change-Id: Ib3b4bf342af73aaf3c925d79bd0a06cee4853c93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150234 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-03-24CppunitTest_sw_rtfexport: split in twoXisco Fauli
it already has 109 tests Change-Id: I1e7adf3fa9c1cdb22fb1402306c2f9478d94038c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149546 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-03-09CppunitTest_sw_layoutwriter: split in twoXisco Fauli
it already has 110 tests Change-Id: I4f218c873b5771e46cd2037249f0bb9db5f6b808 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148554 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-03-01CppunitTest_sw_rtfexport5: split in twoXisco Fauli
it already has 121 tests Change-Id: I7d7726b9f1c65d3f719517ab1a568cd888b2833b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148042 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-03-01sw floattable: teach the UI about SwFormatFlySplitMiklos Vajna
- in SwFramePage, add a new m_xFlySplitCB and bind it to the flysplit from the UI description - map RES_FLY_SPLIT from the doc model to this new weld::CheckButton - disable the widget for anchor types other than to-para, also completely hide it, unless a frame contains a single table, which simplifies Word filters - add UITest for this Change-Id: I9ef44b5c66679b04c4818dc343870b92f1b6386d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148030 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-02-17sw floattable: add ImportFloatingTableAsSplitFly expert settingMiklos Vajna
Mapping DOCX floating tables to Writer split flys is still disabled by default, but now the environment variable affects the DOCX import instead of affecting the Writer item pool's default. This allows mixing ImportFloatingTableAsSplitFly=true and =false tests in the same suite, so the sw/CppunitTest_sw_core_layout_flycnt.mk boilerplate can be dropped. It also allows overwriting this default from an xcu file (expert config, or the XCU file in online.git) for testing / demo purposes. Also extend the layout representation comment / doc a bit. Change-Id: I239e9c6e9d9c8748ed0846ae336c9c818d59f180 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147191 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-02-13sw floattable: handle table-in-fly in SwFrame::GetNextFlyLeaf()Miklos Vajna
Trying to lay out a split fly that contains a table resulted in a stack overflow. The reason for this was that SwObjectFormatter::FormatObjsAtFrame_() has a loop that will format all objects of the current fly frame, but we managed to anchor the follow fly into itself. Fix the problem by improving SwFrame::GetNextFlyLeaf(), somewhat based on how SwFrame::GetNextSctLeaf() has special cases for tables. This way once we split the fly frame, we'll try to move the follow anchor frame to the next page's body frame, and not to a child of the follow fly itself. Also add a first floattable testcase, we can already assert that the table is split correctly. Do this in a separate suite for now, since the pool's default SwFormatFlySplit is only created once, so SwFormatFlySplit::SetForce(false) doesn't have the wanted effect. The anchor's text is still on both pages, should be on page 2 only. Change-Id: Ie2ce75dbace5d9716008351aedb6a8989036badb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146854 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-01-25tdf#66580 added hybrid PDF test casesTomaž Vajngerl
Change-Id: I2a58e6cd5b40266b3c55729febb7006c7a7b4170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146068 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-01-09sw, .uno:InsertSection: add a new Content parameter and accept HTML thereMiklos Vajna
When Zotero uses refmarks to represent citations, then a section is used for the bibliography. While it was possible to insert refmarks with a given name & content, inserting a section with a provided HTML content was not possible. A section (and not a refmark) is needed for the bibliography, as a refmark is a text attribute, so it must start and end in the same paragraph. Fix this by adding a new, optional Content parameter to .uno:InsertSection, which allows providing multi-paragraph, formatted text. This is somewhat similar to what commit fa82e151d80d15eeb6dfae434f1dbb3b68907188 (sw, .uno:InsertBookmark: add a new BookmarkText parameter and accept HTML there, 2022-12-06) did for the bookmark case. Change-Id: I0ccbc8a765fed4e019783d0b743c1cd2d0596093 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145188 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-12-25sw: support for reading back theme color from OOXMLTomaž Vajngerl
OOXML supports theme colors and tint/shade value that additionally changed the theme color. Read back which theme color + tint/shade value was applied in the resulting color and add this attributes as properties to be used by writer. In sidebar theme panel the changing the theme colors now doesn't takes this into account and changes the colors correctly. Change-Id: I3a2d49d485fd37a1611483ee0bb5e6034ac5f88e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143697 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-12-05Revert: "split sw_filters unit test"Xisco Fauli
This commit reverts 1c2ea35b983c1159fe4633e449f8302ac9a7a024 it shouldn't be needed anymore after cdac145768488dc11b32b744bc753ab16aa08c6e "reduce cost of SwpHints::Check" Change-Id: I32a1d963f7bf90838c68db3bfefc8c8750e94128 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143417 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-10-17sw content controls: add rendering for the aliasMiklos Vajna
- add a new SwFrameMenuButtonBase subclass to show the title/alias of the content control under the cursor, if it's non-empty - hide it when leaving the content control - set its label to the alias from SwContentControl - set the position similar to footer frame menu buttons, at the first text portion of the content control - make the label clickable and bind the handler to the content control properties dialog Change-Id: Ia35f0cc59c70910fb88719b207ef9e498d6760d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141441 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-09-20split the mailmerge unit testNoel Grandin
since it is substantially longer running than the next longest test Change-Id: Iec8f1e2f3d98a1c290c1a66620443c79dda9c237 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-11[COVER] add first set of ODF feature test filesThorsten Behrens
For providing coverage data of features in the LibreOffice code base, here's a set of files with orthogonal, high-level ODF features like bold & italic text, an image, a table in several variants etc. Use `make coverage` or `make sw.coverage` to generate coverage data for the entire code base, or subsets thereof. Change-Id: If27f720e8728788c421e16a3abbc1cf39521a2fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139765 Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-09-08sw: add an initial uitest for SwContentControlDlgMiklos Vajna
And also test the inner SwContentControlListItemDlg. Change-Id: Ida92223f49871900f8f6692f21d5052cdb04dd2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139633 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-09-05sw XHTML import: fix lost empty paragraphsMiklos Vajna
Plain HTML import ignores empty paragraph, because browsers ignore such paragraphs as well. This has the benefit of layout compatibility, but it breaks the semantics of documents when roundtripping them from Writer's document model to XHTML and back. Fix the problem by disabling this tweak for XHTML: the idea is that when it comes to paragraph / line breaks, XHTML is meant to preserve the semantics of the original document model, even if that results in slight differences in HTML rendering. So in case Writer/ODT doesn't collapse multiple line breaks and browsers/HTML does that, we apply workarounds in the HTML case, but not in the XHTML case. Change-Id: I55de8880503ee2d48fbd7a6af3891f2754f0d172 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139439 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-08-30Split CppunitTest_sw_uiwriter3 into a uiwriter3 and a uiwriter8Miklos Vajna
My build with 16G ram now regularly fails with: g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.opensuse.org/> for instructions. make[1]: *** [solenv/gbuild/LinkTarget.mk:337: workdir/CxxObject/sw/qa/extras/uiwriter/uiwriter3.o] Error 4 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:289: build] Error 2 Change-Id: Ia758f2e905a13369a9eef7eece4104bb9ea76303 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139025 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-08-11tdf#148360 doc import: add NO_NUMBERING_SHOW_FOLLOWBY(true)Justin Luth
Change-Id: I2bc595e13fd13f29b4bf22f71c6c6bb4b4483731 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138148 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2022-08-02sw: make shift-doubleclick on graphics open the graphic dialogMiklos Vajna
Double-clicking on images without modifier keys or with ctrl triggered the graphic dialog. However, shift-doubleclick did not. One drawback of this behavior is that extensions can catch the .uno:GraphicDialog command for plain or ctrl double-click, but they can't customize the behavior for shift double-click. Another problem was that if you had a text selection and you shift-clicked (single click) on an image, then no image selection was created. (While this works in Word.) Fix the problem by extending the code handling mouse button events in Writer in case the button type is left, the only modifier is shift and we get one or two clicks: - if the position points to an object that should be selected, then shift-click now selects that object - if the user shift-double-clicks on an image, then we open the graphic dialog This improves consistency, as double-click with no/ctrl/shift modifiers now all dispatch .uno:GraphicDialog. Do the double-click tweak only for graphics, other shape types can be added in the future if needed. Change-Id: I2edc70a399a9d2662b476a1bbc4c5f087ce8e59c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137696 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-08-01Add infrastructure and basic tests including slight UI interactionColomban Wendling
This introduces a couple helper base classes for implementing accessibility tests more easily, and includes a few tests as examples, including basic document layout check and minimal UI interaction through menus. Change-Id: I8961af8be1e7d52dc55fe27c758806d9b4c3c5d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137337 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-08-01tdf#150197 sw: convert pre-defined num styles to ListFormatJustin Luth
Early in 7.x, allotropia introduced a generic list format string instead of prefix/suffix. Convert the pre-defined numbering formats to use that syntax as well. The problem was that ms export wasn't able to handle the old way of doing things any more. For example, if a user added numbering via the numbering style "Numbering 123", then on export the numbering string was lost. Change-Id: I11cd00280da2b464a9b00a5f0a8d72080f14e44c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137632 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Justin Luth <jluth@mail.com>
2022-06-08DOC import: allow negative page border distancesMiklos Vajna
In case the margin (distance between body frame and page frame) is smaller than the border spacing (distance between border and page frame), then we can map that to a negative border distance during the import of DOCX files since commit 1f127a2b9e1c1daab0972f98fc8708ecb7afa299 (sw layout: allow negative page border distances, 2022-06-07), but DOC import had the same problem. The above commit intentionally kept the default behavior of BorderDistanceFromWord() unchanged to avoid side effects in other clients of that function (not DOCX import), but means that DOC import was still broken. Given that it turns out there are only 2 callers of BorderDistanceFromWord(), fix the problem by allowing negative border distances unconditionally: this simplifies code & SetBorderDistance() in the DOC import will now get the correct border distance out of the box. DOC export works out of the box without any additional work. Change-Id: I6bf15b3c73823c9265218b7b3a7b869e131818db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135484 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-18uitest: sw: move field dialog tests to their own placeXisco Fauli
Change-Id: I9b4b462af85cea7e2427b4025a268dcc200fff51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133130 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-03-30sw: fix crash in SwAttrSet::CopyToModify()Miklos Vajna
Regression from commit 938a4d6624a78f3e272b3c4c07f314cb0c6db723 (tdf#128375 sw: fix copying RES_PARATR_LIST_AUTOFMT to different SwDoc, 2019-11-01), the problem is that we may get an autofmt pool item which is set, but its style handle is empty. Assume that this is the same case as having no autofmt at all. Change-Id: I87494fd04687d31201b4ec712cb0fb1ec7362b46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132301 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-24sw clearing breaks: add insert UIMiklos Vajna
Expose SwLineBreakClear in SwBreakDlg and extend SwWrtShell::InsertLineBreak() to be able to insert clearing breaks as well. Change-Id: I17a4c34cb74f1c72d8e208bace25597de0367e17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132024 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-17sw image dialog: fix fallback width/height for images with relative sizesMiklos Vajna
Make sure that we work with the up to date layout size of the image in the dialog, otherwise 80% shows up as 237%. Also fix SfxMacroTabPage::FillItemSet() to not put anything to the output item set when the macro table is empty, this way clicking OK in the image dialog results in an unmodified document when the user doesn't change anything. Change-Id: I4b987bd3e3818ee737e37ea10861f9043c25bc93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131714 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-15sw: split CppunitTest_sw_uiwriter into uiwriter and uiwriter7Xisco Fauli
Similar to a2a2e07996a0e49164663eaec5d79481bf7bb3e0 "sw: split CppunitTest_sw_uiwriter2 into uiwriter2 and uiwriter5" it already had 117 tests Change-Id: I6bcdcd672c655b853f8f366db3b78d3da49f9078 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131635 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-03-02sw: split CppunitTest_sw_uiwriter4 into uiwriter4 and uiwriter6Xisco Fauli
Similar to a2a2e07996a0e49164663eaec5d79481bf7bb3e0 < sw: split CppunitTest_sw_uiwriter2 into uiwriter2 and uiwriter5 > it already had 126 tests Change-Id: Ia98a97ca621289c6b089f570bff3a1330a08efa8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130883 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-03-02sw: split CppunitTest_sw_uiwriter2 into uiwriter2 and uiwriter5Miklos Vajna
My build with 16G ram now regularly fails with: g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.opensuse.org/> for instructions. make[1]: *** [solenv/gbuild/LinkTarget.mk:341: workdir/CxxObject/sw/qa/extras/uiwriter/uiwriter3.o] Error 4 make[1]: *** Deleting file 'workdir/CxxObject/sw/qa/extras/uiwriter/uiwriter3.o' make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:299: build] Error 2 And it seems uiwriter2 is the larger uiwriter suite in sw, so split that into 2. Change-Id: Iba029af2f5bb3f1196707bc13b5e32fefa7e58c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130842 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2022-02-17svtools: fix lost replacement non-rendered graphic when updating it failsMiklos Vajna
This is similar to commit 8780fa41dcd164af244742461f4e57a4bcf4c7a4 (svtools: fix lost replacement grpahic when updating it via OLE fails, 2018-10-30), but that case was when we already had an old mpImpl->pGraphic, the updated failed and then we already lost the old one but didn't have a new one. Here what happened is that in case tools -> update -> update-all was used for an OLE object which had bad native data but a good preview, then the result was bad preview, depending on if you first scrolled to the OLE object to trigger rendering (good) or not (bad). The reason for this is that scrolling to the object calls GetGraphic(), which sets mpImpl->pGraphic using GetReplacement(bUpdate=false), which works, but svt::EmbeddedObjectRef::UpdateReplacement() calls GetReplacement(bUpdate=true). That explains why the update breaks the preview, but not when scrolling to it first. Fix the problem by improving svt::EmbeddedObjectRef::GetReplacement(): if getting an updated graphic fails, try to get a non-updated graphic. The result is that GetGraphic() after an UpdateReplacement() not only always return a non-nullptr Graphic, but also it's no longer of type None. Change-Id: I8e5ff4aaaefdc58e032b325bb4001f2a604ccc8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130086 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
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>