summaryrefslogtreecommitdiff
path: root/xmloff/qa/unit
AgeCommit message (Collapse)Author
2023-04-12Revert "tdf#147126 sw: fix missing as_char anchoring of group textboxes"Justin Luth
This reverts commit 341e397d970d10281fbc9691874b4441a841837d. It was added for T38690 and removed for T41585 Change-Id: I39cd0711047a131a3d60106b8682097411318781 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150293 Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2023-01-17tdf#147126 sw: fix missing as_char anchoring of group textboxesAttila Bakos (NISZ)
which resulted lost (invisible) text content before implementing its support now. Cleanup to SwTextBoxHelper by removing its unneeded functions. testFDO78590 was commented out temporarily because it has a pure VML groupshape inside and it's converted to WPG during the test run resulting crash on reopening, because lack of its support in DocumentContentOperationsManager, trying to convert the content to a text frame inside a text frame. Regression from commit 2951cbdf3a6e2b62461665546b47e1d253fcb834 "tdf#143574 OOXML export/import of textboxes in group shapes". Change-Id: Ic6ce3549d390ae763044f54e991f390677704396 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129627 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143368 Tested-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-01-17xmloff: use XThemeColor in ODF, change the format for themesTomaž Vajngerl
Change the xmloff filter to use XThemeColor and the associated proprties (CharColorThemeReference and FillColorThemeReference). Change the ODF format for referencing a theme color - make it an element instead a series of attributes on the *-properties style element. Change-Id: I0fa7d8ebffecc02897b7fe9824d6f1776ef36380 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144923 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 3eb53d327fb5d9689b799ff991a6c53c05eff496) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145572 Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2022-12-21sw content controls: enhance preserve idJustin Luth
Squashed commit including NFC cleanup docxattributeoutput: use existing function to clear fd14dd0e4c6a7ea0866a686f653db90301d664b6 Follow-up to 100c914d44ae8f362924fe567d7d41d0033ae8ad which added the initial id preservation for DOCX. adding DOCX block SDT grabbaging, ODF import/export [content controls can't exist in DOC format] The ID field is CRITICAL to preserve for VBA purposes. This patch adjusts BlockSDT to also round-trip the id instead of just creating a random one. m_nRunSdtPrToken <never equals> FSNS(XML_w, XML_id) since 2021 with 5f3af56b2c0ef6c628a7cfe5ce6e86f8e1765f5f, so I removed that part of the clause. I had thought about changing the ID to use a string instead of an int, but then the integer version was adopted to fix a regression in the commit mentioned earlier. I think it is AWFUL to have a number as the identifier when it will be used in StarBASIC. The VBA guys have to deal with it, but it would be nice to do something reasonable for LO native access to content controls. However, the concern would be if we allow VBA macro content created in LO to be exported to DOCX format - that would cause problems converting from a string ID to a number ID. VBA editing already is happening to some extent, and mmeeks seems interested in enabling it. So over-all it seems best to just stick with an integer ID. I used the commits for <w:alias> and <w:tag> to compose this patch. XML_ID already existed in include/xmloff/xmltoken.hxx and "id" already exists in xmloff/source/token/tokens.txt The ID can be used in VBA to select a specific control. The id (which is a positive or negative integer in DOCX) specifies a unique control - either by passing the number as a string (of the UNSIGNED value) or by passing as a float (specified with #). For example: msgbox ActiveDocument.ContentControls(2587720202#).ID msgbox ActiveDocument.ContentControls("2587720202").ID but not as an integer since that is used for index access. dim index as integer index = 1 msgbox ActiveDocument.ContentControls(index).ID make CppunitTest_writerfilter_dmapper CPPUNIT_TEST_NAME=testSdtRunRichText make CppunitTest_sw_ooxmlexport17 CPPUNIT_TEST_NAME=testDateContentControlExport make CppunitTest_sw_core_unocore CPPUNIT_TEST_NAME=testContentControlDate make CppunitTest_xmloff_text CPPUNIT_TEST_NAME=testAliasContentControlExport make CppunitTest_xmloff_text CPPUNIT_TEST_NAME=testAliasContentControlImport Change-Id: I5c4022dc932d941fad9da6d75ce899ee1ff66ff5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142818 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144625 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2022-12-21tdf#151548 sw content controls: preserve tabIndexJustin Luth
This has to be vital to keyboard navigation. Certainly it is good to have it imported before we start to consider tab-movements for form controls. All tabIndex 1's are processed (in placement order) and then the 2's etc. 0's are to be done last. XML_TAB_INDEX already existed in include/xmloff/xmltoken.hxx and "tab-index" already exists in xmloff/source/token/tokens.txt make CppunitTest_writerfilter_dmapper CPPUNIT_TEST_NAME=testSdtRunRichText make CppunitTest_sw_ooxmlexport17 CPPUNIT_TEST_NAME=testDateContentControlExport make CppunitTest_sw_core_unocore CPPUNIT_TEST_NAME=testContentControlDate make CppunitTest_xmloff_text CPPUNIT_TEST_NAME=testAliasContentControlExport make CppunitTest_xmloff_text CPPUNIT_TEST_NAME=testAliasContentControlImport No existing unit test found containing blockSDT with tabIndex. Change-Id: I8a958844e6192b079a2b22a62dedfd8739021f4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143603 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144623 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2022-12-20tdf#151548 sw content controls: preserve lockJustin Luth
DOCX SdtControls can be locked in two ways: -Content Control cannot be deleted (sdtLocked) -Contents cannot be edited (contentLocked) or both (sdtContentLocked) make CppunitTest_writerfilter_dmapper CPPUNIT_TEST_NAME=testSdtRunRichText make CppunitTest_sw_ooxmlexport4 CPPUNIT_TEST_NAME=testSimpleSdts make CppunitTest_sw_ooxmlexport17 CPPUNIT_TEST_NAME=testDateContentControlExport make CppunitTest_sw_core_unocore CPPUNIT_TEST_NAME=testContentControlDate make CppunitTest_sw_macros_test CPPUNIT_TEST_NAME=testVba make CppunitTest_xmloff_text CPPUNIT_TEST_NAME=testAliasContentControlExport make CppunitTest_xmloff_text CPPUNIT_TEST_NAME=testAliasContentControlImport Change-Id: I5a82d9f6b5103a4902f59af66cd8a99addd4e690 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143542 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144553 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2022-11-10sw content controls: allow no list items in a dropdownMiklos Vajna
- Replace SwContentControl::HasListItems(), which assumed that the type is dropdown if we have list items. This is not valid, it's OK to have a dropdown with no list items. Add a GetDropDown() instead to check for the type, explicitly. - UNO API sets the dropdown bit when list items are set and the type is not expilcitly combo box or drop down, to keep backwards compatibility with existing documents. - No change to the edit shell, SwDropDownContentControlButton already checked if items are empty and used STR_DROP_DOWN_EMPTY_LIST in that case, but that was dead code previously. - ODT & DOCX filters are now updated, ODF has a new <loext:content-control loext:dropdown="..."> attribute to specify that the type is a dropdown, explicitly. (cherry picked from commit 56db6406b0b63a2d2d99024e7c311ebd874f3893) Conflicts: xmloff/qa/unit/text.cxx Change-Id: Id577ba9639151549a8f953aab31685a73a898504 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142544 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-10-18sw content controls, alias and tag: add ODT filterMiklos Vajna
Map the Alias/Tag UNO properties to: <loext:content-control loext:alias="..." loext:tag="..."> on export, and do the opposite on import. (cherry picked from commit 888a8c3ca70ed19309c15ff7b9f0968ece337cb5) Conflicts: xmloff/source/token/tokens.txt Change-Id: Icecbe9037ede0bf8d72d52f2db44328a8db1d83a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141500 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2022-09-23sw content controls, combo box: add ODT filterMiklos Vajna
Map the ComboBox UNO property to: <loext:content-control loext:combbobox="..."> on export, and do the opposite on import. (cherry picked from commit 21d93d8d2ffd9c5d5cfe9064590b35e0727295c9) Change-Id: I33c162ace15025c8031eb678ba5a43ac085c4b6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140430 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-08-29avmedia: implement video crop support in the ODP filterMiklos Vajna
And also import/export the video preview as well. The naming follows the style used for table shape previews. The preview is important, since the cropping is relative to the bitmap's preferred logic size. (cherry picked from commit cbc6e67d3c88fb6ae39c304604a98eaa504f19cc) Conflicts: xmloff/qa/unit/draw.cxx xmloff/source/draw/shapeexport.cxx Change-Id: I6115284c1f4cf342b3296cd0ac3beb70a809fd1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138970 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-08-28tdf#150407 do not use loext in save in ODF strictRegina Henschel
The 'bt-lr' attribute value of 'writing-mode' attribute and the 'page-content-bottom' and 'page-content-top' values of 'vertical-rel' attribute are not part of ODF 1.3. Therefore they need to be saved in 'loext' extended namespace. Error was, that this was done too, if the current ODF version is strict. That results in an invalid file in a productive build and a failed assert in SvXMLNamespaceMap::GetQNameByKey() in a debug build. Change-Id: Ie9ba99fdd02de21a2467b236409daa951933f011 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138595 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de> (cherry picked from commit 64be7052ba7e02e248412222098e07a5f4106456) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138541 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 34edaf8249107c4216fdaffe450d287a1908a0de) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138547
2022-07-27crashtest: fix crash on ODT export of forum-mso-de-84211.docxMiklos Vajna
XMLTextParagraphExport::ExportContentControl() disables the export of the <loext:list-item> XML element in autostyle mode, then it should also disable the export of the matching attributes. (cherry picked from commit 6cf1f3c09c43bd3bbcda611a9476ff5e64c5164f) Change-Id: Ia65fc8bd3398df0ab1b71973695c9bc8d10deaa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137496 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-07-27sw content controls, date: add ODT filterMiklos Vajna
Map the PlainText UNO property to: <loext:content-control loext:plain-text="..."> on export, and do the opposite on import. (cherry picked from commit 33cf26c8b6dc6cf38edf2d22cfefbd00904d9da8) Conflicts: xmloff/source/token/tokens.txt Change-Id: Icec0c35b2b9fca53104e6526c98083db52df5d42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137472 Tested-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-07-01sd theme: add ODP import/export for shape fill color effectsMiklos Vajna
Map a themed color with effects to: <style:graphic-properties draw:fill-color="..." loext:fill-theme-color="..." loext:fill-color-lum-mod="..." loext:fill-color-lum-off="..."> (cherry picked from commit 0c13e4768c3c7937c2fd71675c86ff8a0ca3fe50) Change-Id: I18d8ddf8d6050ef468a8d67a9e797a576f682e85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136730 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-07-01sd theme: add ODP import/export for shape fill colorMiklos Vajna
Refer to the 12 pre-defined colors by name + don't write the attribute for the case when there is no theme. (cherry picked from commit 1868dea877b0c956ee34e92afad59920e66cad3f) Change-Id: I37c984b3371ec878a0d733977f5c937dce27c440 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136676 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-06-29ODP import/export: refer to theme from shape text color with effectsMiklos Vajna
Handle luminance modulation and offset (i.e. lighter and darker colors). (cherry picked from commit 7d1e4d12baa85d47f5945872a3bc186dd6ce1889) Conflicts: xmloff/source/token/tokens.txt Change-Id: I536bbca1ed994e991c7ceac153d6a47cb6ef35f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136528 Tested-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-06-29ODP import/export: refer to theme from shape text colorMiklos Vajna
Refer to the 12 pre-defined colors by name + don't write the attribute for the case when there is no theme. (cherry picked from commit 91f649a119d4b7ece26f9737a38663664953a57a) Conflicts: xmloff/source/token/tokens.txt Change-Id: Ib6ab5b7b34d896a36e04309bf0cb410998acce01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136527 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-06-28ODP import: handle theme of master pagesMiklos Vajna
This is just the theme itself, we don't refer to this theme from e.g. shape text color yet. (cherry picked from commit 26c8e266e1ae267fd15878057a92340078136140) Change-Id: I0d8f4b06217fb491e47d775628fde742d8ff104d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136496 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-06-28ODP export: write the theme of a master pageMiklos Vajna
Which requires describing the schema, which is really just a new <loext:theme> element, the rest reuses the color-table markup, which wasn't used in ODF so far (but was used in our .soc files). Also make sure that we only do this in ODF extended mode (which is the default). (cherry picked from commit c95288aec4eb4d92a5ccfb9d8fc02a0185d8e8d0) Conflicts: include/xmloff/xmltoken.hxx xmloff/qa/unit/draw.cxx xmloff/source/core/xmltoken.cxx xmloff/source/token/tokens.txt Change-Id: I90eaad30f63946c441fe0c53caf6a47caf1714d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136495 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-31sw content controls, date: add current date handlingMiklos Vajna
While working on the DOCX import for dates, it turns out there is a need to store the selected date in machine-readable format as well. This is useful, because once the timestamp is formatted, the user is allowed to hand-edit the result, so otherwise the selected date would be lost. This commit adds: - doc model & UNO API - click handler (store the selected date, default to the current date in the date picker if possible) - ODT filter - DOCX export And tests for all these. (cherry picked from commit 79baafccf3d390810f516b2cf9cb3ad2b4e9e63b) Change-Id: I00f4e87ebfe0e8a19486367c32d472ccd2ff16a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135150 Tested-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-30sw content controls, date: add ODT filterMiklos Vajna
Map the Date, DateFormat and DateLanguage UNO properties to: <loext:content-control loext:date="..." loext:date-format="..." loext:date-rfc-language-tag="..."> And do the opposite on import. (cherry picked from commit b3c6511659c58bcc75a9742e0ae0cc436b6f6825) Change-Id: I16d3f755d77ed20380d877ba65dfe6d063f2bec2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135117 Tested-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-20sw content controls, picture: add ODT filterMiklos Vajna
Map Picture UNO property on content controls to: <loext:content-control loext:picture="..."> And do the opposite on import. (cherry picked from commit 81ce15c466cda946ae94f38904215f24555021ad) Change-Id: I47c3d04c505ba94da958d5d6b6b2c883236afc3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134665 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-11sw content controls, drop-down: add ODT filterMiklos Vajna
Map each list item to a dedicated XML element: <loext:list-item loext:display-text="..." loext:value="..."> And do the opposite on import. (cherry picked from commit c3f4c43694f0f9aec35193ccf40f0e7c8476fdc3) Change-Id: I59a536a8317a3bb24919107b4449f858d5f6de96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134145 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-02sw content controls, checkbox: add ODT filterMiklos Vajna
Map the 4 new UNO properties to XML attributes: - Checkbox <-> loext:checkbox="..." - Checked <-> loext:checked="..." - CheckedState <-> loext:checked-state="..." - UncheckedState <-> loext:unchecked-state="..." (cherry picked from commit c2fab664a887b16cb78570851ceffcacd26815f7) Change-Id: Ia4623004ee39c77f5f242c2d720bc188e4dd9433 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133643 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-22sw content controls: add ODT importMiklos Vajna
Map <loext:content-control loext:showing-place-holder="..."> to com.sun.star.text.ContentControl and set its ShowingPlaceHolder property based on the XML attribute. This requires moving XMLImpSpanContext_Impl to txtparai.hxx, otherwise XMLContentControlContext would have to be in txtparai.cxx, which is already large. (cherry picked from commit d1649e5d38b51cd422302e566719a2c5aff42b2f) Change-Id: I9a915868160ebcc0e98ded61bfab72f32864bd76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133316 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-22sw content controls: add ODT exportMiklos Vajna
Wrap the text portions inside the content control in a <loext:content-control> XML element. Also map the (so far) single UNO property of it to <loext:content-control loext:showing-place-holder="...">. This is just initial export for inline text content controls, more properties are to be added in follow-up commits. (cherry picked from commit cf5bbe3fce4a250ab25998053965bdc604c6114e) Conflicts: include/xmloff/xmltoken.hxx xmloff/qa/unit/text.cxx xmloff/source/core/xmltoken.cxx xmloff/source/token/tokens.txt Change-Id: I5d928255b925ed7e08fb635ba39f546e9a4879de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133315 Tested-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-29sw clearing breaks: add ODF importMiklos Vajna
Map <text:line-break loext:clear="..."/> to com.sun.star.text.LineBreak and set its Clear property based on the XML attribute. (cherry picked from commit a64eae6ae3ce47d70f7d56aabd3d4a385c69c1ca) Change-Id: I76d375de23146592c2327df16aa5066ee2a6598d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132260 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-29sw clearing breaks: add ODF exportMiklos Vajna
Write the clearing break as: <text:line-break loext:clear="..."/> (cherry picked from commit 07c2b73d16425fb6d3ea8ab9ec15c87e9548acda) Conflicts: xmloff/qa/unit/text.cxx Change-Id: Ieb517b825f2ee162bb70a453a3756ec870fa8aac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132259 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-02-25ODT import: fix MSO-style <text:list text:continue-numbering="true">Miklos Vajna
The ODF spec says that text:continue-numbering="true" should only continue the numbering in case the styles of the previous and the current list match. In contrast, Word continues the numbering even in case there is e.g. numbering, then bullets, then numbering again, in case the list styles of the two numberings are the same. Work this around at import time when the generator confirms that the document is coming from Word. At least Office 2019 and the latest renderer at office.com is affected. (I've mailed dochelp@microsoft, no answer yet.) (cherry picked from commit 1127c63470096f62394f133c61cee2e6fb7fd0c7) Change-Id: Ib63e14322e5501a6220f798abd9365d7913dab4c
2022-02-14sw ODF shape import: improve is-textbox checkMiklos Vajna
This builds on top of commit 28d67b792724a23015dec32fb0278b729f676736 (tdf#107776 sw ODF shape import: make is-textbox check more strict, 2019-08-26). Before that commit, any non-empty parent style name on a shape resulted in an sw textbox. After that commit, we filtered out Writer images by checking for the Frame parent style name. The problem with this approach is that in case two documents are to be merged together, then it's reasonable to rename the Frame style, but then the complex content inside the shape gets lost. Fix the problem by going with a middle ground: require Frame as a prefix, but allow other names as well. This gets e.g. FrameX to work without breaking the "reject Graphics" use-case. (cherry picked from commit c2726c29b233b8fa7fbd390aafe149bdf7e94b07) Conflicts: xmloff/qa/unit/draw.cxx Change-Id: Id59ed28a64a9398f2f1620f69b5f148d65e6c95a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129729 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-14tdf#62032 xmloff: list-level is positiveInteger, impl is 0-basedJustin Luth
Thanks for catching this Regina. Change-Id: Iaf6a0c9161378934818e392126a4437e55f5ddf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126743 Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit aed4c2d80c2f11b82631c097ed0b15a5cb52283d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126812
2021-10-28tdf#141301: extrusion-skew angle value -135 is not written to file...Julien Nabet
whereas it should since not default value (Regina) Hopefully in some years missing values are unlikely and bug tdf#141127 can be fixed. (Regina) I have added a unit test to Julien's patch. Change-Id: Ia2aabd8e724e3c3db9ae8a87cb27707aa7040fb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113257 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2021-10-10loplugin:moveparam in xmloffNoel Grandin
Change-Id: I46c1c8dc46cd2b8470b69506f6609f8bd7e42211 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123347 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-05drop 'using namespace std' in o* r* x*Julien Nabet
Change-Id: I15d56d133cf464a3cb6483be785b1259c7f35b43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123120 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-09-09ODT export: order <style:font-face> elements inside <office:font-face-decls>Miklos Vajna
This builds on top of commit 92471550b8c43d8ff0cef8b414884d697edf9e63 (ODF export: sort <style:font-face> elements based on the style:name attribute, 2021-03-11), the additional problem was that the style:name attribute already has number suffixes to have unique names for fonts where the style name would match. This means that even if we sort the container right before writing the elements, which font gets the number suffix depends on the insert order. Fix this by additionally sorting the font items before insertion, given that a single call-site does all the insertion, at least for Writer documents. This is required as SfxItemPool::GetItemSurrogates() exposes a container which is based on SfxPoolItemArray_Impl, which uses an o3tl::sorted_vector<> of pointers, so effectively unsorted, the order depends on the pointer address of the font items. Change-Id: I46569b40796243f7f95b92870504c2023b2ce943 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121823 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-09-03tdf#62032 ODT export: handle style:list-level="..." for para stylesMiklos Vajna
ODT import was already working. The spec also says to only take this into account when applying the style, so it seems only the UI remains for the bug to be closed, the rest is done. Change-Id: I27da4dc171b4ced75f143bbcecb3f8c748a26b02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121607 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-09-02Related: tdf#137363 ODT import: handle style:list-level="..." for para stylesMiklos Vajna
This is just the import side, the export side still needs doing. The used attribute was already part of ODF, and NumberingLevel for para styles where already imported/exported for DOCX. Change-Id: I8385ed23dc799c99e81318387236341b404d01a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121515 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-08-31tdf#126126 ODT import: improve import of cross-table commented text rangeMiklos Vajna
Regression from commit d4b473dd9ba77427b28d97847067b8877c2033d9 (office:annotation-end import, 2012-07-20), the problem was that XMLAnnotationImportContext::EndElement() assumed that we can always call gotoRange() to go from the annotation start and end points, but this is not true: an annotation may start inside a table and end outside a table, which is not a valid selection, so gotoRange() fails. Fix the regression part by just creating a text range for the anchor of the comment, so the comment is attached to the end of the range, and this way the rest of the comment & the document can be at least opened. [ It seems bookmarks behave similarly: they don't block the whole import, but don't work cross table boundaries, either. ] Change-Id: I1b5a2e2e7501ce3054379fc79d2045c3439c52e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121322 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-07-23sw bibliography, local copy: add ODF filterMiklos Vajna
Map it to <text:bibliography-mark loext:local-url="...">. Note how this can be a relative URL, while the text:url attribute is typically a http(s) URL. Change-Id: If16171c9761221841ff07824cb0466fd42911480 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119407 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-23tdf#139734: Drop redundant asserts after MacrosTest::loadFromDesktopAhmet Hakan Çelik
Change-Id: If5b2f2433b4be7b654b08815cbfb08faaac309db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112130 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-01tdf#141345 sw page gutter margin: reimplement ODF filterMiklos Vajna
See <https://issues.oasis-open.org/browse/OFFICE-4105>, the proposal is to include the gutter in the left/top/right margin to have better backwards compatibility, at the price of more complex xmloff code. This works by increasing the left/top/right margin on export (so even if gutter margin is ignored at import time, the layout will look fine, just the editing will be poor) and decreasing on import. Change-Id: I852e5c7366e8641abd61e136f9390466585953fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113464 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-03-31tdf#140343 sw page rtl gutter margin: add ODF importMiklos Vajna
See <https://issues.oasis-open.org/browse/OFFICE-4105>, the proposal is to not map this to a new attribute of the <style:page-layout-properties> XML element, rather only write writing mode on export and infer RtlGutter from that writing mode in import. This is similar to how FillBitmapOffsetX and FillBitmapOffsetY are two UNO properties, but there is a single draw:tile-repeat-offset attribute for them. This has the benefit of simpler ODF markup, at the cost of more complicated xmloff code. Change-Id: I189a7ec62d4e5624e20252b7259a36133594fe40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113405 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-03-26Extract copy&pasted namespace list to XmlTestTools::registerODFNamespaces()Miklos Vajna
Both sw/ and xmloff/ can depend on test/, so no need to duplicate this. Change-Id: I93bfdb4422bdef9f8d28bc37548130fae49829e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113107 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-25tdf#134734 xmloff: ODF import compatibility for BackgroundFullSizeMichael Stahl
This is annoyingly complex because LO 6.3 changed the way backgrounds are painted in an inconsistent way. Use the generator version to guess what the document should look like, which of course will give the wrong result if it was created before LO 6.3 and then round-tripped with LO 6.3. Since LO 7.0 at least a hard-coded draw:background-size was written. Change-Id: If9c5d2b32bfa50cbe4fb166132f7223763af850f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112770 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-03-11ODF export: sort <style:font-face> elements based on the style:name attributeMiklos Vajna
m_pFontAutoStylePool is already sorted, but sorting ignores XMLFontAutoStylePoolEntry_Impl::sName, and changing XMLFontAutoStylePoolEntryCmp_Impl would affect how find() works in XMLFontAutoStylePool::Add(), so just extend XMLFontAutoStylePool::exportXML() instead. With this, the order of <style:font-face> elements is meant to be stable in content.xml and styles.xml, helping use-cases where a document is converted to ODF multiple times and an integration test wants to assert that the output is the same. Change-Id: If0dbfa40a1b204aebe5e141fe64f71ac2ca92405 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112339 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-02-10loplugin:refcounting also check OWeakObject subclassesNoel
Change-Id: I2d89085a22d7424c6f8f7662307433ce50fc61d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-15tdf#136861 ODT export: fix writing resolved state for non-ranged commentsMiklos Vajna
It was probably not intentional to write the resolved state only in case the annotation has a name. Change-Id: Ia3a6b2320e2288528c43c832211ebfcde492881e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109354 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-10fix coverity parse errorsCaolán McNamara
Change-Id: I4884bfb67a061b865e8cf38b2fea6de0cb1bc3d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109057 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-26New loplugin:stringliteralvarStephan Bergmann
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for details. (Turned some affected variables in included files into inline variables, to avoid GCC warnings about unused variables.) Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>