summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)Author
2022-03-23forcepoint#82 back() called on empty vectorCaolán McNamara
Change-Id: I8017777a58f1fef41d1545899868e333c2184c5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131969 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-23tdf#111851: rtf import: fifty shades of greyVasily Melenchuk
Unlike in DOCX in RTF token \clshdngN can represent much more transitional cell shade values from 0 (white) to 10000 (black). So we should not match these values strictly but use ranges instead. Change-Id: I4e0066e2b79e73cf6fbc3dd773047be8dab2b907 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131931 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-22tdf#104390: rtf import: init default font for entire state stackVasily Melenchuk
If first document element is buried deep in destinations and thus deep in state stack (m_aStates) initialization of default font is very local and will be lost after closing these destinations. So let's initialize entire states stack with default font if none is provided istead of initialization just a top element. Change-Id: I966c282f43b84baece909a4c3cd359cbcd317e63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131906 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-21tdf#118047: RTF import: better deduplication for header/footerVasily Melenchuk
Here are two related fixes in one patch: 1. By default current style index is 0, not -1. Due to this we can assume usage of default "Normal" style during deduplication. Seems there is no difference in case of no style mentioning in run or mentioning "Normal" one (\s0), so value -1 looks unnesesary. 2. During header/footer "substreams" processing StyleTableEntires was not reused in new domain mapper impl instance. So deduplication did not work well. 2a. To avoid copying of whole StyleTableEntries between instances it is stored as pointer in domain mapper impl. Change-Id: Id003d35554e9b43186238920d9a6373452095121 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131899 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-21sw clearing breaks: add RTF filterMiklos Vajna
Map between SwLineBreakClear and \lbr<N>. Change-Id: Ibed94ad74157a08787212a34176590a1dc4d5547 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131886 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-21related tdf#147861: cleanup + a function provides the nameJustin Luth
This is not quite a NonFunctionalChange because it avoids adding " (fixed)" to the name. But that is what I want anyway for bug 147861, so this is an all-around good simplification. Plus, the writerfilter loop doesn't need to run if an inside clause will never be true anyway. Putting this cleanup separately helps highlight the actual fix and not clutter the real patches. Change-Id: I12f345cc92627398ad00fe32b64b98b54e5ed14b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131413 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-21tdf#131234: RTF import: extend default char props listVasily Melenchuk
There are much more character attributes should be applied wth default values if style contain them, but they were not mentioned in current run. These are obviously not a complete set yet, but most common ones are included. Change-Id: Ide52245bc98628febc2f3bd2e25166f0dcdf35cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131853 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-18tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macroSinduja Y
Change-Id: Ifed6b79a4186e3196dc1e9ac179fe8ad0ee4a342 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131655 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-03-16tdf#146851: writerfilter: do not recreate list levels on overrideVasily Melenchuk
AddLevel() can be called on w:lvl and on w:lvlOverride. But if we have level override and some extra level definition level is recreated and override information is lost. Change-Id: I6f1b9b50bdd3410b4ae2d403e760e4d6df5677d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131304 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-03-11loplugin:constparamsNoel Grandin
Change-Id: I5f184f93dbdb414514855c85c9dc1624e7ec8636 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131337 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-08sw clearing breaks: add DOCX importMiklos Vajna
Map <w:br w:clear="..."> to the com.sun.star.text.LineBreak UNO service, but keep the default clear=none case unchanged. Change-Id: I145e891c1df0bbd0fdac2c62463dc801bca827fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131167 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-07do not pass XComponentContext to officecfg::...::get() callsLuboš Luňák
It's used only for the ConfigurationWrapper singleton, so it's used only the first time and then ignored. It also causes calls to comphelper::getProcessComponentContext() for every single invocation despite the value not being needed, and the calls may not be cheap (it's ~5% CPU during ODS save because relatively frequent calls to officecfg::Office::Common::Save::ODF::DefaultVersion::get()). Change-Id: I02c17a1a9cb498aeef220ddd5a0bde5523cb0ffb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131056 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-04Removed executable bits on rtf filesAndrea Gelmini
Change-Id: I4b12bd5d399efa037bb84699572c8c9bfb07e459 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130977 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2022-03-02tdf#146171 DOCX: fix loss of change tracking, if no dateLászló Németh
was specified, or it was specified as zero date (e.g. in a LO DOCX export). DateTime attribute w:date is optional in w:ins/w:del according to the OOXML standard. Not specified w:date was imported as invalid zero date "0-00-00T00:00:00Z" resulting loss of change tracking data completely during an ODF roundtrip. Import this invalid zero date as Epoch time to avoid losing change tracking data. Change-Id: If8442db9aa5e41c470827545c36c64f598887101 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130885 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2022-03-02fail more gracefully if m_aTmpPosition is emptyCaolán McNamara
LIBREOFFICE-N4LA0OHZ Change-Id: I7f863151f753ad5605c4f1f280cfd79aa4c6bce4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130760 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-25Advanced Diagram support: cleanup/consolidate with existing codeArmin Le Grand (Allotropia)
Reorganized and streamlined, use IDiagramHelper as main interface now also for existing code. Had to adapt oox::Shape && Diagram handling since there the import gets handled very different. This ensures that a Diagram is detected at export and that the same happens for now as before Had to add a detection that resetting the GrabBag is meant to disable the Diagam functionality. That is very indirect, but has to stay for compaibility reasons for now Change-Id: I620b7d61cd84b5f9dd8ae4dc890ebf70ce779cdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130389 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-02-18Remove some unused includesMiklos Vajna
See tdf#42949 for motivation. Change-Id: Ieddb3d76a960d4b87cd2a1e89bce3fcbe0fce7e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130113 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-02-14Fix typoAndrea Gelmini
Change-Id: Ib78a5987b5fa9c7117583e24e6945b1e2c724690 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129901 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-11tdf#146917: docx import: better support for style with num resetVasily Melenchuk
When paragraph style is disabling numbering defined in parent style we should apply margin properties (like we already do in other numbering cases), but we should include only properties from styles not affected by numbering. In other words, only styles without w:numId are used. Unittest was extended to cover different combinations of this situation. Change-Id: Ic19e00fcfe16b2357cdfe763b4f969cc63122e89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129701 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-02-09Fix typoAndrea Gelmini
Change-Id: Ic5e211c4802cedde313d5e03859bb6d3b6be48ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129718 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-09(related: tdf#147206) writerfilter: fix another end in...Michael Stahl
...DomainMapper_Impl::PopFieldContext() that probably should use the m_aTextAppendStack insert position. Change-Id: I718d4b745258ca88e8ffec0bff5e5ea95037a312 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129686 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-02-09tdf#147206 writerfilter: fix end position of hyperlink in ToXMichael Stahl
(regression from commit 58a86af36295b4fc1e07c0bd38f74530a2ce0f08) Change-Id: Ied4c26255b60f4320f38432ef5e2e27882b7a135 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129681 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-02-09docx import: right margin was not respected for para with listVasily Melenchuk
If paragpraph has list defined somewhere in styles and right margin defined in current style this margin was overriden with older value from parent styles. Change-Id: Ic0a2e9a1ce5f77b9ef38c549a62f1494c050982c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129595 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-02-08Extend loplugin:stringview to O[U]StringBuffer::toStringStephan Bergmann
Change-Id: I7ad212dfff8b34d05e3b45107a1ef033a4efc454 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129651 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-08RTF paste: fix cursor creation on shapesMiklos Vajna
This went wrong in commit 232ad2f2588beff50cb5c1f3b689c581ba317583 (API CHANGE: add a "position" parameter to XParagraph/TextPortionAppend methods, 2012-11-28), the problem is that the text range is part of the shape text's node range, so we have to call createTextCursorByRange() on the shape's XText, not on the body text. Change-Id: Ifa97213659130b8c279022a6a03f920dca6061bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129603 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-02-07tdf#126287: docx import: use defered linebreakVasily Melenchuk
In some cases when we have combo linebreak, endparagraph and end section at very bottom of page, MS Word does ignores linebreak to avoid empty page with same section and lonely end paragraph mark. With defered linebreak we could simulate and ignore such linebreaks during import. Change-Id: Ie6ee4c0990ee1c2e853691a76953c83191664e43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119709 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-02-03tdf#146802 OOXML import: fix embedded VML in grouped textboxAttila Bakos (NISZ)
E.g. OLE formulas inside them broke document load. Regression from 121cbc250b36290f0f8c7265fea57256dad69553 "tdf#66039 DOCX: import textboxes (with tables, images etc.) in group shapes". Note: now embedded VML OLE is loaded in WPG shapes, thanks to that the ShapeHandler in oox/ has a stack having the start token inside for each shape. Change-Id: I973d78ed88c5c83efffd9629061e2a2c6fdd25e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128627 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-02-03tdf#147115 writerfilter: style is only default if default=trueJustin Luth
This was a dumb mistake in LO 2018 (so perhaps LO 6.2). Regression from commit 6b7f12f6108f136d60bd77e3787ef6a2632038cd Change-Id: I2adc642ffe9c2af1037fcc0a5d2b83c993511258 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129386 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2022-02-02tdf#129578 rtfimport: CJK char properties are not CSJustin Luth
This fixes a LO 6.4/6.3.0.1 regression caused by commit fd95fb975b754d71d3750e85431a4e596a40e659 which was focused on export, and not import. The code originally didn't have any mention of DBCH, so it used the default. However, in the 6.4 change, it was wrongly tied together with the Complex Script indicator. So revert that part of the change. Mark fixed the same problem in 7.1 for font size. Change-Id: I1c87ae856de93ebc693135585574f2eb144b214b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128113 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2022-01-31Related tdf#66039 DOCX WPG import: Do not put extra paragraph at the endAttila Bakos (NISZ)
Regression from 121cbc250b36290f0f8c7265fea57256dad69553 tdf#66039 DOCX: import textboxes (with tables, images etc.) in group shapes Change-Id: I16195d1d3b0955d5686fe225bbba6def2c28ef93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128043 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: Attila Bakos <bakos.attilakaroly@nisz.hu> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-01-28DOCX import: handle a subset of <w:ptab w:alignment="left">Miklos Vajna
The case when we can map it to a line break. This way the page number is visually inside the rectangle shape that is behind the field. The test intentionally uses \n as-is for line-break, because SwASCWriter::WriteStream() uses \n in the LINEEND_LF case even on Windows (and not SAL_NEWLINE_STRING), while SAL_NEWLINE_STRING is used for paragraph-break. Change-Id: Ic85e57b2391bfac73507727b17240f4d85fc2698 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129059 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-01-27Add simple unit test for recent fix to take layoutInCell into considerationTor Lillqvist
... when a graphic is in table row. The test just checks that the IsFollowingTextFlow property gets set as true, it doesn't check that the table row height actually is correct or that the result looks correct. Change-Id: Ia6feec2b2a9bbff6e130f9542c15106750ff415d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128982 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-01-26tdf#139737 sw_fieldmarkhide: writerfilter: don't copy header/footerMichael Stahl
... when inserting into an existing document. The header/footer will not be removed by SwUndoInserts::UndoImpl() and thus the extra nodes will screw up subsequent Undo actions. Inserting a header from a file is already disabled, but there is a function that copies from a preceding page style that was missing a check. This never worked and reportedly crashes since commit 4dc1615c80e8e66d339dc86fa95bbc76e884d988 Change-Id: I895d867ee9fd30a936144492f3ee1633d045fe8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128635 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-01-25Take layoutInCell into consideration when placing graphic in tableTor Lillqvist
Set our IsFollowingTextFlow property accordingly. Thanks to Miklos for doing most of the work. Change-Id: I67d214d6ed41c19dcb2f3ad2db9be94ca77c5842 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128880 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-01-24DOCX import: fix <wp:anchor layoutInCell="1"> with <wp:wrapNone>Miklos Vajna
If wrap is set to none ("in front of text"), then <wp:positionH relativeFrom="column"> ignores layoutInCell="1" in Word. But in case relativeFrom is something else (e.g. page) or wrap is not none, then the old behavior is OK. Adjust our import so that Writer's layout also allows this shape to leave the cell. Change-Id: I6ca7511d46d7a70df11a65dc67c182f4fff4ae69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128862 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-01-21DOCX import: floating table with negative top margin has to be a fly frameMiklos Vajna
The bugdoc has a large header, then part of the table goes into the whitespace of the header by specifying a negative vertical position. Keep this as a floating table as normal tables can't have negative top margins. Change-Id: I95299051f004976778765965971428d9764bef08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128724 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-01-18RTF import: handle the pictureContrast and pictureBrightness shape propsMiklos Vajna
Map it to (the UNO API of) GraphicDrawMode::Watermark, similar to what the binary import does in SvxMSDffManager::ImportGraphic() and how the drawingML import does it in oox::drawingml::GraphicProperties::pushToPropMap(). Change-Id: I8023aa8fcbd086d4c7a30729e3ca615a7356da4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128515 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-01-06tdf#66039 DOCX: import textboxes (with tables, images etc.) in group shapesAttila Bakos (NISZ)
Text boxes in group shapes were imported as shapes, losing complex text content: tables (tdf#66039), colors (tdf#73022), images (tdf#81958), lists, paragraph styles, hyperlinks (tdf#122960) and track changes. Note: a few unit tests have been deactivated temporarily. Test document "groupshape-trackedchanges.docx" of testGroupshapeTrackedchanges is imported correctly now: with track changes, and the test was modified accordingly. Follow-up to commit 2951cbdf3a6e2b62461665546b47e1d253fcb834 "tdf#143574 OOXML export/import of textboxes in group shapes". Change-Id: I6eb918dbf64393fd723fe43f798f93b5b9a12575 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125051 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-01-05tdf#146489 writerfilter: ensure only character propertiesJustin Luth
This is another RTF regression found against LO 6.0's commit fdfdea4d5af51a68f2d497cc5c3359d74c385fd5 tdf#82173 writerfilter: apply char properties to footnote The original commit in LO 6.0 intended that only character properties were used. A follow-up commit for RTF tried to ensure that these would be on the top of the stack. However, in this case, it seems like somehow the table is getting involved in putting the paragraph context on the top. (Actually, there is no GetTopContextOfType(CONTEXT_CHARACTER) at all.) In any case, aFontProperties should only contain character properties, so ensure that. The unit test shows that there is still some kind of import problem, because the footnote marker should be a large, red character, but it is just normal text. See tdf#108949. Change-Id: I1ea7256891b198046f79f0d3a36e43d6c2ae3383 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127943 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2022-01-03tdf#143574 OOXML export/import of textboxes in group shapesAttila Bakos (NISZ)
In this part, oox module has been modified in order to prepare for WPG handling during OOXML import. Note: Wpg is the drawingML equivalent of v:group, supporting text boxes in the group. 1) Added new parameter for WpgContext to support nested Wpg shapes, and WPS enabled for the WPG member shapes. 2) A bug has fixed, where group member line shape and connector shapes have wrong positions before in the group. 3) Unit tests had to be modified, and 3 of them disabled temporarily due to missing Writerfilter implementation (what will be the next commit) Now group shapes can have textboxes and the text is imported for that, but complex content is still missing (this will be fixed in writerfilter by the next commit). Known issue: WPG shapes with textboxes in floating table have issues during import at floating table conversion, so until this is not fixed this function is disabled for shapes in tables (will be fixed a follow-up commit later). Follow-up to commit 19394a924fdc486202ca27e318385287eb0df26f "tdf#143574 sw: textboxes in group shapes -- part 4". Change-Id: I71032187697807087bd8f27f7c3a7b052e174bd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124964 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-12-29be more exact about the type of pDocumentCaolán McNamara
Change-Id: Iab0d23e8ee691ac6ed3381bd7e1ee02bb59dc64f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127661 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-12-29crashtesting: set document reference only onceVasily Melenchuk
For SdtHelper we need to keep valid reference to main document (in our case first call), not to any of substreams like header, footer, etc. Change-Id: Id9d99c1a9bff9a3392eea4cc6e2abe774e5868d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127672 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-12-20Fix typosAndrea Gelmini
Change-Id: Ib75af11e67cadd3522c2c4b94b0549c8a96b8464 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127150 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-12-20tdf#104823: support for sdt plain text fieldsVasily Melenchuk
This is a squashed commit containing set of changes: * Create a input field from sdt text block. * Advanced support for reading field data from data bindings which can point to custom xml or properties xml. For this XOOXMLDocumentPropertiesImporter idl interface was extrended with extra getterrs to get properties as xml dom elements. * Support for exporting of this feature back to docx. For this some extra parameters for sdt block are kept in newly introduced grabbag for input fields. If field does not contain grabbag it being exported as before (FILLIN or whatsoever), otherwise sdt block is counstructed based on data from grabbag. * Basic support for updating custom xml values back into custom xmls with usage of xslt transformations. To achieve this extra parameters were introduced to XXSLTTransformer: now it is able to support in-memory transformation stylesheets. Some unittests were corrected: since sdt plain text edit area is a field located inside paragraph in outout corresponding sdt is also located inside paragraph (instead of Word's approach with paragraph inside sdt). Seems this is not critical. Change-Id: I1a73ef300db3619804f7adf18579bea708764c14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127015 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-12-18tdf#104823: basic support for reading field data from databindingVasily Melenchuk
Change-Id: Ie45eb18205c1c54a631303b45887e54e456b6d5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125550 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-12-16writerfilter: some param -> sprm in rtftokMiklos Vajna
The structure for these properties is to have a list like "paragraph properties", which then has keys (e.g. NS_ooxml::LN_CT_PrBase_pBdr for border), which may have sub-keys (e.g. NS_ooxml::LN_CT_PBdr_top), and finally some value. Stop calling sub-keys "parameters"; the real parameter will be some writerfilter::Value subclass. This is just meant to make the code more readable, no functional changes intended. Change-Id: Ie63b3216cafa6fcd0ad1ee8cf990cd7982ab7fb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126894 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-12-11tdf#146140 sw DOCX import: fix moveFrom regression with broken text contentLászló Németh
(Also a small clean-up: increase the character limit for tracked text moving detection: Only 2 or more (non-whitespace) character deletions are checked for it, because single characters are often typos or some control-like characters, e.g. soft hyphen, not real text movings.) Details of the regression: commit d32d9a2b3c5e3963f4a18f6c7bbf50fab2e9b2be "tdf#123460 DOCX track changes: moveFrom completely" fixed the missing redline import of the end of the moved paragraphs, but paragraph end was imported as w:del, not w:moveFrom explicitly. From commit f51fa7534421a195a58b4a737a2e836d8c25ba81 "tdf#145718 sw, DOCX import: complete tracked text moving" this resulted two deletions (a moved one and a plain one) instead of the previous single one. Moreover, exporting these double deletions at the same position to ODT, raised a back-compatibility issue with broken text content, see tdf#107292 (solved recently, but not in older LibreOffice versions). Removing the explicit w:del code path in writerfilter, it solved the regression from commit f51fa7534421a195a58b4a737a2e836d8c25ba81 "tdf#145718 sw, DOCX import: complete tracked text moving". See also commit 9e1e88ad5cf2dc0e9b188c60930445652a6c7519 "tdf#145720 DOCX export: fix loss of tracked moving". Change-Id: I15bfc83b87dd42a762ff84edf5bae765fe02a5ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126631 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-12-10Generally determine Rdb content from gb_*_set_componentfile callsStephan Bergmann
...instead of by listing the content somewhat redundantly in the Rdb_*.mk files, to avoid duplication of logic for components that are only built conditionally (and thus should only be included conditionally in the corresponding Rdb). To achieve that, add an "rdb" parameter to gb_ComponentTarget_ComponentTarget (and to the gb_*_set_componentfile macros that internally call gb_ComponentTarget_ComponentTarget), which is used to make the appropriate gb_Rdb_add_component call internally from within gb_ComponentTarget_ComponentTarget. (As a special case, gb_CppunitTest_set_componentfile shall not call gb_Rdb_add_component, as that has already been done by the corresponding gb_Library_set_componentfile call, so allow the gb_ComponentTarget_ComponentTarget "rdb" parameter to be empty to support that special case.) Most Rdb_*.mk files are thus mostly empty now. One exception is i18npool/Rdb_saxparser.mk, which duplicates some of the Rdb_services content as needed during the build in CustomTarget_i18npool/localedata. 1c9a40299d328c78c035ca63ccdf22c5c669a03b "gbuild: create services.rdb from built components" had already tried to do something similar (in addition to other things) under a new --enable-services-rdb-from-build option. However, that approach had four drawbacks that this approach here addresses (and which thus partly reverts 1c9a40299d328c78c035ca63ccdf22c5c669a03b): 1 Rdb_services shall not contain the component files of all libraries that are built. While that commit filtered out the component files that go into Rdb_ure/services (ure/Rdb_ure.mk), it failed to filter out the component files that go into others like Rdb_postgresql-sdbc (connectivity/Rdb_postgresql-sdbc.mk). 2 The code added by that commit to Makefile.gbuild codified the knowledge that there is an Rdb_services, which is brittle. 3 The code added by that commit to solenv/gbuild/Rdb.mk codified the knowledge (for gb_Rdb__URECOMPONENTS) that there is an Rdb_ure/services, which is brittle. 4 Introducing an --enable-services-rdb-from-build option needlessly provided two different ways how the content of Rdb_services is assembled. The changes done here would leave --enable-services-rdb-from-build as a misnomer, as it no longer controls how Rdb_services is assembled. I thus renamed it to --enable-customtarget-components, as that is apparently what it still does now. Change-Id: Ia5e8df4b640146c77421fcec6daa11a9cd260265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126577 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-07loplugin:unusedfieldsNoel Grandin
Change-Id: Id39c3f484a364fb5163444febe99aee79daf1a76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126418 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-03tdf#145720 DOCX export: fix loss of tracked movingLászló Németh
of documents created in MSO to keep interoperability. Export moved redlines as moveFrom/moveTo instead of del/ins elements (also for newly created tracked moving). Export "MoveBookmark" elements moveFromRangeStart, moveFromRangeEnd, moveToRangeStart, moveToRangeEnd, which imported from DOCX documents created in MSO. Without them, moveFrom/moveTo elements were imported as plain deletion or insertion in MSO. Note: MoveBookmark elements were imported and exported as collapsed plain bookmarks. Now keep their ranges, also store the information of moveFrom/moveTo for correct export. In the export filter, mandatory author and date of the tracking information restored from RedlineData of the first redline within the MoveBookmark, if it's possible. Follow-up to commit f51fa7534421a195a58b4a737a2e836d8c25ba81 "tdf#145718 sw, DOCX import: complete tracked text moving". Change-Id: I54242453a7f7d8f73ea074fc74e8e7bc86d07d01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126258 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>