summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2022-04-01tdf#147485 sw: fix group shape crash using std::shared_ptrAttila Bakos (NISZ)
for SwFrameFormat::m_pOtherTextBoxeFormats. Before there was broken manual handling of this member, resulting random crashes. Details: Writer textboxes are textframe + shape pairs. Accordingly the shape has a draw format, the frame has a fly format. In case of group shapes the paired structure doesn't work, because there is one shape format and many fly formats. To handle this there is a class (SwTextBoxNode) which has a small frame format table inside. This cache gives the possibility to handle each frame shape pairs inside the group depending on what SdrObject owns that textbox. However there is another place where these formats stored, namely the SpzFrameFormatTable in SwDoc. The only problem is that, when a flyframe removed, it has to be deleted from both tables, but if the DelLayoutFormat() is called, that will call the ~FrameFormat(), and if the format already deleted from the SwTextBoxNode, there will be double deleting for the same address, which caused the crash. To avoid this the following is present: When fly deletion occurs, first the format is deleted from the doc, then via the ~SwFrameFomat() will be deleted from the TextBoxNode. If the deleted format is a drawing, the whole node will be destructed via the shared_ptr. Hopefully that will be fine, without any leak. Change-Id: I007724695bc035998cb35efeefecd308aae36e85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132308 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2022-03-31tdf#130318 - Use the actual cursor position to create ToC "for chapter"Andreas Heinisch
Use the actual cursor position to create ToC "for chapter" beginning at the current level. Change-Id: I92e7c440005d52c517efa7e64a61c58da9db3197 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125727 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-03-31sw fly frames: add Tooltip uno propertyMiklos Vajna
This is somewhat similar to commit 1acf8e3cfaf1ef92008e39514a32ace0d036e552 (sw fields: add Title uno property, 2022-03-24), except that this is for images, and images already had a Title, which is persisted to ODT. So add a new Tooltip property which has priority over the tooltip generated for URLs, in case the tooltip is non-empty. This helps in case the URL is long / non-readable / confusing and a more helpful popup text can be provided instead. Change-Id: Ife34dab5e4490eb1682c55fb7c01f7509d0057fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132361 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-31tdf#148273 docx import: fix section break format leak to bulletsSarper Akdemir
Fixes RES_PARATR_LIST_AUTOFMT leaking into the next section. Achieves this by resetting list related attributes on the cursor's text node in DomainMapper_Impl::RemoveLastParagraph() after the deletion of the paragraph. Change-Id: Ib4d09c5f190b8b8fd3bdc119ddd57d91f353de2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132324 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-31add some documentation wrt kashidasCaolán McNamara
that seems to match what we are currently doing in writer Change-Id: Iecc371deb88dc417fd86d5a6497dbf1dee53f72d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132360 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-31tdf#148061: Crash when opening report from tdf#148042 (DBG_UTIL only)Julien Nabet
Change-Id: I30dd54547b1f93e55270d7c029168aff3d0e92bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132339 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-31typo: charters->charactersCaolán McNamara
Change-Id: I48993192ec00aaf1d85cf65b6a12aacdcee67176 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132359 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-31sw content controls: add UNO API to insert thisMiklos Vajna
This only allows the default richText type, the others are not yet handled. Change-Id: I39f73ccd9e2c1f0db5735cf97301b01482063d1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132350 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-31tdf#116358: rtf import: "keep with next" also affects table rowsVasily Melenchuk
Like in DOCX for RTF there is exactly same behavior for paragraphs inside cells. They do affect table breaking over the pages. So: 1) Enable "TableRowKeep" doc setting for RTF documents. 2) Do not ignore \keepn token for paragraphs in tables. Change-Id: I11e45ca9114c792b8cdbeb77dd51359717129651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132305 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-30Missing test dependenciesStephan Bergmann
> warn:vcl.builder:2475462:2475462:vcl/source/window/builder.cxx:479: DBG_UNHANDLED_EXCEPTION in VclBuilder > when: Unable to read .ui file exception: com.sun.star.container.NoSuchElementException message: "file:///.../instdir/share/config/soffice.cfg/svt/ui/editcontrol.ui at xmlreader/source/xmlreader.cxx:66" and > warn:vcl.builder:2507015:2507015:vcl/source/window/builder.cxx:479: DBG_UNHANDLED_EXCEPTION in VclBuilder > when: Unable to read .ui file exception: com.sun.star.container.NoSuchElementException message: "file:///.../instdir/share/config/soffice.cfg/sfx/ui/tabbar.ui at xmlreader/source/xmlreader.cxx:66" when building CppunitTest_sw_layoutwriter from scratch Change-Id: I043db8e1b25a8b990bcad542dcbe533a57654c05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132323 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-30unroll this typical writer-style multi condition if statementCaolán McNamara
no logic change intended Change-Id: Iebb8df604aa69829536e3cab10b33056e4cdf78e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132331 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-30Avoid float-cast-overflowStephan Bergmann
> sw/source/filter/html/parcss1.hxx:163:35: runtime error: -1.0458e+22 is outside the range of representable values of type 'int' > #0 in CSS1Expression::GetSLength() const at sw/source/filter/html/parcss1.hxx:163:35 > #1 in ParseCSS1_text_indent(CSS1Expression const*, SfxItemSet&, SvxCSS1PropertyInfo&, SvxCSS1Parser const&) at sw/source/filter/html/svxcss1.cxx:1955:45 during recently introduced testForcepoint94::TestBody in CppunitTest_sw_layoutwriter, where sw/qa/extras/layout/data/forcepoint94.html contains "text-indent: -18446744073709551616.0cm" Change-Id: I1070f07ea0304a3813ab9a58441c9d7e45f79ffd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132322 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.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. Change-Id: I87494fd04687d31201b4ec712cb0fb1ec7362b46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132301 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-30sw content controls: add document modelMiklos Vajna
This is meant to represent inline structured document tags (<w:sdt> elements in DOCX) or content controls (as Word users know this). Don't confuse this with block-level, cell-level or table-level content controls, which are not covered here. You may wonder why fields or fieldmarks can't be used to represent this. The problems are: - a fieldmark can contain a paragraph break, inline content controls can't - content controls must be a well-formed XML element, while fieldmarks can start/end at random document model positions - fieldmarks are supposed to have a field command and a result result (with a separator between the two), but content controls don't have a field command - mapping to a field has the problem that Writer fields can only have a single text portion / run, but content controls can have multiple ones So model content controls with a meta-like text attribute which covers all these cases. SwContentControl is mostly empty as a start, it can track more data in follow-up commits. SwTextContentControl and SwFormatContentControl are the matching text attr and pool item subclasses. Change-Id: I1e57f7756cf87041975371483ec4fc8abf875dfe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132291 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-30CppunitTest_sw_ooxmlexport6: avoid mustTestImportOf()Miklos Vajna
Can use CPPUNIT_TEST_FIXTURE() instead. See commit a226cec52e536c46e03f57a5f1f7931abbeb0cdd (CppunitTest_sw_rtfimport: convert one testcase to use CPPUNIT_TEST_FIXTURE(), 2019-11-05) for motivation. Change-Id: I8ee8a13a0aafda32176b109c1f27622974e9cf12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132284 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-29tdf#148240: Make Outline-Folding non-experimentalJulien Nabet
Change-Id: I8de81ec13228d0742a3b12af97edb1b97643a790 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132243 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-03-29tdf#73499 DOCX import: fix grouped linked textboxAttila Bakos (NISZ)
Only ungrouped text boxes were imported correctly. Grouped textboxes lost their linking, resulting broken layout. Now the linking is fixed for DrawingML. Note: in old MSO versions, linking needed grouping. To import these DOC documents correctly, convert them to DOCX/DrawingML in MSO before opening them in Writer. Change-Id: Ib5a8744d783a9c95c42447d204e17891b3aea7bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130950 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-03-29sw: replace usage of sal_Int32 with ColorXisco Fauli
after 49a40e3ed200e7c6d728f36d0b4be22dd85c51be "tdf#135923 DOCX shape import: set text color" Change-Id: Ic96233555d8d79645ff3d5ff3711fa428b05c98b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132271 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-03-29tdf#135923 DOCX shape import: set text colorTünde Tóth
to the character color of the shape if it is not comes from direct formatting. Change-Id: I3f0a3e952b5449a6d92c5bb273d353a561f3e3dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130922 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-03-29loplugin:unusedfieldsNoel Grandin
Change-Id: Iaf3a0a42e94994eab25f5e9ef8c111362e86fb02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132262 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-29sw doc model xml dump: don't warn on SwFormatMetaMiklos Vajna
No need to dump it for now, just silence the warning. Change-Id: I3f09f6198732aacfd7173f8f81f9df220bb59bff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132257 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-29cid#1503287 silence Unchecked dynamic_castCaolán McNamara
Change-Id: Id7c6c1ecbfc88c97d5211826fa2d831344dc795c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132245 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-29cid#1503286 Unchecked return valueCaolán McNamara
Change-Id: I701039be73405e354fc64bd6a81999aff44e9e0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132244 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-29sw: document AbstractSwBreakDlgMiklos Vajna
AbstractSwBreakDlg is implemented by AbstractSwBreakDlg_Impl, which wraps an SwBreakDlg, a bit complex at first. Change-Id: I366bb16b13a6343a45d5538f79ddff729fe31acf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132241 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-28-Werror,-Wunused-but-set-variableStephan Bergmann
...which was apparently meant as a "Possible debugger breakpoint" in DBG_UTIL-only sw_DebugRedline. The obvious fix is to mark nDummy as volatile, but increment of a volatile variable is deprecated, so replace those with reads of the variable, but which triggered false loplugin:casttovoid so fix that too. Change-Id: I07376e665caa4fd9befaba06d261a50df7a63a10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132237 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-28-Werror,-Wunused-but-set-variableStephan Bergmann
...since db51589575d37ca608067ad9904dcc6a09651e8c "Convert SVARRAY SORT into STL set" Change-Id: I50384d67252965beb46a9dad5a30df835188f3a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132238 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-28sw: use getProperty<Color> when possibleXisco Fauli
Change-Id: I50339493b0034667e9cd317940102b13066f901c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132203 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-03-28forcepoint#94 fix crash on layout of specific htmlCaolán McNamara
Change-Id: I1874a431d5af9d56248a695e08a2f95b5292ba9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132153 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-28tdf#148228 sw: fix Undo of tracked table deletion in Hide Changes modeLászló Németh
In Hide Changes mode, tables didn't reappear during Undo of their tracked deletion, only by saving and reloading the document. Follow-up to commit 0c6221e1545e7b96d9df23cdc24302c28ae935b8 "tdf#148227 sw: fix Undo of tracked row deletion in Hide Changes mode". Change-Id: Ifdc25ab4ae0be25a0c7559ee05b6af2e4f1aa8cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132169 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-03-28tdf#148235 Restore toolbar item to switch XForm to design modeMichael Weghorn
commit 45b6f096e7ae86d0692ecdfd5b7069622d8a6efa Date: Sun Oct 28 17:02:34 2018 +0100 sw toolbars sync context toolbars between different apps had replaced the "Form Design" toolbar item to switch a complete XForm to design mode with an entry that switches the form controls to design mode instead. (The former one is labelled "Design Mode On/Off", the latter one just "Design Mode" in the English UI.) This meant that the XForm could no longer be switched to design mode from there, unless the toolbar was manually customized to add the entry back. This brings the previous toolbar item back. It also removes the one to switch the form controls to design mode again, since that one is already contained in the "Form Controls" toolbar, where it fits better. (And having two different toolbar items with almost identical labels but different functionality would probably be rather confusing.) Change-Id: Ia4c98dfa6ad8372eba08a9f08920153133a7f88d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132207 Reviewed-by: Andreas Kainz <kainz.a@gmail.com> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2022-03-28lok: compatibility with older copy-paste tablesSzymon Kłos
Change: commit 41b99644e8913dd4797775f4931382e93fa12a00 Author: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Date: Mon Sep 27 11:59:54 2021 +0200 tdf#48622 Add new border line width defaults introduced regression in the HTML export used in lok. It changed expected value of border thickness what caused export of many empty additional table rows. Change-Id: I35045ad4673609b0f092477b4c7f71b057f18774 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131702 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132200 Tested-by: Jenkins
2022-03-28Recheck sw/ cxx files with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I8a8df68946297fad517b753d73e4373203a45ed6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132150 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-28tdf#146523 Fix editable protected drop-down fieldsHossein
Previously, drop-down fields from a protected section in a Writer document could be edited by double-clicking on them. This patch adds a check to see if the appropriate section is protected or not. This check is done before allowing LibreOffice to open a popup window titled "Drop-down Form Field" for editing the list of possible values. Also, with this patch, menu item "Form > Control Properties..." will no longer do anything for the fields in a protected section. Change-Id: I02a23818bd315abd61118f199c72ac28b7ed1ab4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128256 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-03-28sw clearing breaks: add layout support for the left and right casesMiklos Vajna
This means that the vertical position calculated in SwTextFly now depend son the horizontal position of the break portion, so it doesn't make sense to cache it. Change-Id: I4e30bb12d9ba117d3af065881a65a1c2001e1164 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132162 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-28sw: WW8PLCFpcd, WW8PLCFpcd_Iter, WW8PLCFspecial and WW8PLCFxMiklos Vajna
See tdf#94879 for motivation. Change-Id: I6c65fc584292f95bbf7ab24c5d94a41c2fa7576a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132161 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-03-28tdf#148227 sw: fix Undo of tracked row deletion in Hide Changes modeLászló Németh
In Hide Changes mode, table rows didn't reappear during Undo of tracked deletion of table rows, only by saving and reloading the document. Follow-up to commit a74c51025fa4519caaf461492e4ed8e68bd34885 "tdf#146962 sw: hide deleted row at deletion in Hide Changes" and commit 794fd10af7361d5a64a0f8bfbe5c8b5f308617a5 "tdf#147347 sw: hide deleted table at deletion in Hide Changes". Change-Id: I7ffe8a3687d1d385a549f7d438f7058d829ffd8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132123 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-03-27Fix typosAndrea Gelmini
Change-Id: I003bd994be4a6a089dfacca1558e84324bf7fc1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132145 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2022-03-27forcepoint#92 fix crash on layout of specific docCaolán McNamara
Change-Id: Id40d25d05d10d641d071cddd2e1c84594ac777a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132142 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-27move DeleteListener contraptions to toplevel writer includesCaolán McNamara
Change-Id: Ifa1e75b62da4174f27fca52eb86559cd6a381513 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132141 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-26tdf#148111: docx std fields: use placeholder text for empty dataVasily Melenchuk
It is quite unexpected Word behavior: if data source for sdt field exists but contains empty string it is not used. Placeholder is inserted instead. In general behavior is more complex: logic of replacement is defined by <w:showingPlcHdr> property and results can vary (see testcase). But LO does not support this property correctly yet. Change-Id: I2ec8efe05f79a01af5d74d21bfcd05f3b19e3970 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132096 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-03-26forcepoint#91 fix crash on layout of specific htmlCaolán McNamara
Change-Id: I145649e18f382c67ea34290f44fa219b7926127f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132129 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-25tdf#142447 related: SwNavigator: Copy outlinesJim Raykowski
Change-Id: Ibfc173ab6db3d9cbb1e8c59b515c40f1846f1e42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129542 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2022-03-25forcepoint#90 fix crash on layout of specific rtfCaolán McNamara
Change-Id: I17c227ab278ed5a2cc60449d1d005212f00ded89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132128 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-25forcepoint#89 don't remove page with footnote continuation frameCaolán McNamara
in browse/html/web mode Change-Id: Ic821dd7f2cc1f47305b5fe2ced16d5168aedc0b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132122 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-25add support to explicitly test swriter/sweb layoutCaolán McNamara
Change-Id: Ib47526d35428a95b081c88011d733397339f288d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132121 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-25loplugin:unusedfieldsNoel Grandin
Change-Id: Ic34f6ac671cd80375085a3c9f858854ff74e2db2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132116 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-25tdf#147978 export subpaths individually in custGeomRegina Henschel
...and implement export of all missing commands, use existing viewBox if suitable, use one EnhancedCustomShape2d move WriteCustomGeometryPoint to protected, make GetCustomGeometryPointValue local The fix solves tdf#100390 too. Without the fix the entire enhanced-path was exported as one element <a:path>. The command F was applied to the whole drawing but should affect only the subpath. The implementation is changed so that each subpath gets its own element <a:path> and command F acts only on its subpath. Support for export of handles and equations is still a long way off. Thus there is no reason to tread shapes with and without handles different. Shapes with handles had used method WritePolyPolygon, but that is not able to handle subpaths. So have desided to use method WriteCustomGeometry for all cases. To get shapes exported regardless of path commands I have added the export for the missing commands. I have removed the no longer used method WritePolyPolygon. The special treatment of shapes "moon" and "mso-spt89" (right up arrow) in export is no longer needed. Related code parts are removed. The unit test testFlipAndRotateCustomShape is adapted. In case the method WriteCustomGeometry fails, the enhanced-path is invalid. In that case an minimal custGeom is written in case of docx. Shapes whose drawing does not touch all edges of the snap rectangle were exported with wrong position and size of the drawing inside the snap rectangle. That is fixed by using an existing ViewBox for the OOXML path size. The old way of creating a path size from point coordinates is only used if the shape has no suitable ViewBox. The point values in unit test SdOOXMLExportTest2::testTdf111798 are adapted to path size 21600 x 21600 and traverse direction of the points is corrected. The resulting shape outline is still the same as before. The expected xml is updated for file tdf92001.odp in SdImportTest::testDocumentLayout. The resulting shape outline is the same, because the shape touches the edges of the snap rectangle. The case, that the shape outline does not touch a edge of the snap rectangle is tested in SdOOXMLExportTest3::testEnhancedPathViewBox. Still missing is the case, that ViewBox has other left,top than 0,0. In that case all coordinates would have to be shifted because the path size in OOXML has only width and height but not left,top. That will not be included in this patch. Change-Id: Ib1736d6a08371f4d98411d2769275f0580cd0030 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131837 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-25tdf#147861 writerfilter: use GetFieldResult, not current DocPropertyJustin Luth
Import DOCX and RTF DocProperty fields as "fixed" if the displayed text does not match the File - Properties - Custom variable's content. Otherwise LO will automatically update the field and show the wrong contents (because MS Word requires the user to manually refresh via F9). Change-Id: Id5d3d0794e81b13465c5e824f1e994f563e62c1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131415 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-25simplify some TypedWhichId codeNoel Grandin
Change-Id: I7c908bac2217fb1e1a10dbd1fe8fe4d3cb253eff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132098 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-25sw clearing breaks: add clearing indicator during renderingMiklos Vajna
A left / right line around the break portion now allows seeing if the clearing is none, left, right or all (somewhat familiar from Word). No test for this, SwBreakPortion::Paint() is a NOP unless rendering on a window, so the metafile-based rendering used for testing won't detect the difference. Change-Id: I3ff0c89bc4bb45deb03bea43c3ee4589887dee7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132093 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins