summaryrefslogtreecommitdiff
path: root/sw/Module_sw.mk
AgeCommit message (Collapse)Author
2022-10-20sw: add an initial uitest for SwContentControlDlgMiklos Vajna
And also test the inner SwContentControlListItemDlg. (cherry picked from commit b06bd8a4f837ea30d6410190c701f5b27ad9d04c) Conflicts: sw/Module_sw.mk Change-Id: Ida92223f49871900f8f6692f21d5052cdb04dd2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141544 Tested-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-10-18sw 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 (cherry picked from commit 1a94cd8257ef4c462eaaa6d49bf4f26c9ac56a5e) Conflicts: solenv/sanitizers/ui/modules/swriter.suppr sw/Module_sw.mk Change-Id: Ia35f0cc59c70910fb88719b207ef9e498d6760d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141459 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2022-08-27tdf#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> (cherry picked from commit a106d5f75acc4a955f21583f58604ea2e7b4ce1a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137606 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de> (cherry picked from commit 5d72a000a0f9d127d1263a6df628898af08f14f9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137899 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2022-07-27sw content controls, plain text: add DOCX exportMiklos Vajna
Map the PlainText UNO property to: <w:sdtPr> <w:text/> </w:sdtPr> (cherry picked from commit a6e5726f186bf9d2a0ea91169649504c7396c539) Conflicts: sw/qa/filter/ww8/ww8.cxx Change-Id: I57f365fcfb3a80acb74aa932432a8ae8f3acc92b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137493 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-31sw clearing breaks: add insert UIMiklos Vajna
Expose SwLineBreakClear in SwBreakDlg and extend SwWrtShell::InsertLineBreak() to be able to insert clearing breaks as well. (cherry picked from commit 8a7d0e8a811da83265c383630cc48af57f96dc49) Change-Id: I17a4c34cb74f1c72d8e208bace25597de0367e17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132351 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
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. (cherry picked from commit ddfafd9b67e6e61c144b29ac73bbafb413ddf03b) Conflicts: sw/Module_sw.mk sw/source/core/attr/swatrset.cxx Change-Id: I87494fd04687d31201b4ec712cb0fb1ec7362b46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132312 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2022-03-23sw 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. (cherry picked from commit 9e8712ed6f9fb5dbd971e352a5709bd45fadc74f) Change-Id: I4b987bd3e3818ee737e37ea10861f9043c25bc93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131925 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
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>