summaryrefslogtreecommitdiff
path: root/sw/source/core/text
AgeCommit message (Collapse)AuthorFilesLines
2021-06-09sw: allow the width of a line portion to be larger than 65536 twipsMiklos Vajna6-12/+12
The line portion width can be quite large if the line contains an as-char image. Found by asking -fsanitize=implicit-unsigned-integer-truncation -fsanitize=implicit-signed-integer-truncation to flag the problematic conversions. Change-Id: I303b9c71dcd979d79b9c9aee5283b268cc4e3b8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116835 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-06-08tdf#142404 DOCX c15: add compat flag TabOverSpacingJustin Luth3-8/+28
DOCX in 2013 (compatibilityMode 15) no longer supports TabOverMargin (i.e. the text margin), but it does a similar kind of thing if the tab goes into the spacing-after of a paragraph. So add a compat flag to handle this in-between kind of situation. I grepped -i "tab_*over_*margin" to see if I was missing anything. Decimal/Center proved to be only tabOverMargin. IsInSect shouldn't matter since it fits inside the printing range. The other places where I didn't insert TabOverSpacing didn't seem relevant based on a code read. Tab-after-tab still doesn't work great, but what we have is already a massive house of cards that will just collapse if changed. No real provision for handling tabs-over-paragraph-end. -auto-tabs are created instead of "beyond nMyRight" tab, unless it is the first tab defined. -doesn't allow auto-tabs to fill the remaining space. But on the other hand, MS Word's implementation of tabs follows some kind of incomprehensible bizarre logic, so just ignore the tabs completely, please. Change-Id: I3723107b29ec3e287ea8661544711c13eee3ca48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116667 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-06-08tdf#142128 sw: set author-color strikethrough for AS_CHAR imagesLászló Németh5-6/+16
(anchored as character) during change tracking instead of using always the same NON_PRINTING_CHARACTER_COLOR blue one. Follow-up to commit 76dc21860ce185bd5495adde8858d2f23284c78e "tdf#142128 sw: set author-color strikethrough for deleted images". Change-Id: I3fa02f6ec6cd1f71ae3b3c06644dd24f6c684f6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116795 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-06-08tdf#142128 sw: set author-color strikethrough for deleted imagesLászló Németh1-4/+7
anchored to character during change tracking instead of using always the same NON_PRINTING_CHARACTER_COLOR blue one. Follow-up to commit 1610eeef6f2312616fe5d3535475f27f7896bef8 "tdf#142196 sw: crossing out images anchored to character". Change-Id: I267a492dc6bb75327fb96ccdb51b784d00ba7a41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116785 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-05-29no need to allocate these on the heapNoel Grandin3-56/+57
Change-Id: I07a1fd5833bc61eb97649ac5d85b1b0eb3054baa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116367 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-28fix buildJustin Luth1-1/+1
Change-Id: I6d0bfca4b66b02b4724885afc4c8d15a40a74e57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116351 Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-05-28tdf#142404 sw compat layout: ignore blank size only on one-linersJustin Luth1-2/+2
If the paragraph is longer than one line, then do not IgnoreBlanksAndTabsForLineHeightCalculation, which was introduced in LO 4.0. This is a preliminary step for fixing bug 142404. I found a few pre-existing unit tests that triggered this, but none were good examples to use as proofs. ooxmlexport7: 77219 - not sure where - no visual difference. ooxmlexport10: 92157 compatibilityMode15, but visual too little. ooxmlexport11: 88496 - not sure where. ooxmlexport13: 121374_sectionHF2.doc -tabOverMargin in header NOTE: This patch could be seen as a BAD THING in the case where tabOverMargin normally hides EVERYTHING. We don't handle that situation yet, so a very long series of tabs could take up several lines of space (which isn't done in Word). Now with this change it could take even more space. Well, the proper fix would be to not show any of those. Perhaps we could just set the width of the portion to zero if it sails past the end of the page? Anyway, the point is that this it-isn't-right-anyway situation should not block pushing this patch through. Change-Id: Iaea8e0edf78c8fbe319aadbc6d62fc0bdd180814 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116317 Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-05-27no need to allocate Sw2LinesPos separately on heapNoel Grandin2-21/+21
Change-Id: I39dec50f491a313ac188bb2f73073ecc32ebfc21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116240 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-26fix leak in BuildMultiPortionNoel Grandin1-3/+4
Change-Id: I267d59bdc8ac2f17d223d0345c4bcb4ea40a8704 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116149 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-26make SwRect(Rectangle) constructor explicitNoel Grandin2-3/+2
Change-Id: I715aa9499598c483ccf907f829c9ba3540edf216 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116120 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-24fix leak of wronglist in SwTextNodeNoel Grandin3-9/+9
Change-Id: Ib388575d60d7cc32829108f70d7900d95fc34121 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116022 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-23tdf#142448 sw offapi: add custom color metadata field shadingLászló Németh4-11/+73
using the new com::sun::star::rdf::URIs::LO_EXT_SHADING URI (modelled after odf:prefix and odf:suffix). Custom color field shading of text:meta annotated text ranges and text:meta-field metadata fields allows quick visual check of metadata categories. For example, RDF triple content.xml#id1753384014 urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0odf#shading FF0000 sets red (FF0000) shading color for the text span with xml:id="id1753384014". Pressing Ctrl-F8 or View->Field Shadings can disable custom color metadata field shading on the UI. Note: neither LO_EXT_SHADING, nor odf:prefix and odf:suffix changes invalidate the View (MetaPortion), but run-time update of shading color can be triggered without save and reload of the document e.g. by using (temporary) bookmarks on the annotated text spans. To run unit test with enabled visibility, use (cd sw && make UITest_sw_styleInspector UITEST_TEST_NAME="styleInspector.styleNavigator.test_metadata_shading_color" SAL_USE_VCLPLUGIN=gen) in Linux command line. Change-Id: I5de93cfa32ac6793d7dbdc7b64e6f4beacb2e8d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116015 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-05-21sw: replace most static_cast<sal_uInt16>() calls with o3tl::narrowing()Miklos Vajna19-62/+62
o3tl::narrowing() is a better way to handle this, as that way the integer conversion is still implicit, which allows detecting integer truncation at runtime (with suitable compiler flags). Change-Id: I499abda3be6943e8c111c56df390e72939586221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115948 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-05-21sw: layout: fix footnote UAF on tdf132248-3.odt (also, tdf134127-1.odt)Michael Stahl1-1/+9
Text frame 12 gets a follow 137 which gets a follow 138, and there's a footnote at index 95. When 138 is created, its mnOffest is 63 in SwTextFrame::SplitFrame() so 138 gets its mbFootnote set and the footnote frame mpReference points to 138 but then SwTextFrame::FormatAdjust() moves one line back and sets the offset of 138 to 96. Then SwTextFrame::CalcFollow() clears 138's mbFootnote due to lack of footnotes starting from 96. Later frame 138 is joined, but because its mbFootnote is false, the footnote's mpReference continues to point to it, which leads to UAF in SwFootnoteFrame::GetRef(). What's missing is that at the time when the offset of 138 is adjusted, RemoveFootnote() must be called, as is already the case in another branch of SwTextFrame::FormatAdjust(), since CVS initial import. Not sure why this started to crash in crashtesting relatively recently. Change-Id: Ic46019d34ff90d24d0f23effe8a6d54d6f197a71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115910 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-05-21Removed executable bits on source fileAndrea Gelmini1-0/+0
Change-Id: If37a1fd4dad10767804fe7c925c048a1b81b59f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115911 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-05-21sw: eliminate recently added static_cast<SwTwips>() callsMiklos Vajna11-26/+26
This was added in commit 301278b656e76b6f42af5cf8a6f5c6c02acfffeb (sw: allow the height of a line to be larger than 65536 twips, 2021-05-20) to fix -Werror,-Wsign-compare problems, but o3tl::narrowing() is a better way to handle this, as that way the integer conversion is still implicit, which allows detecting integer truncation at runtime (with suitable compiler flags). Change-Id: I2f62420457e3d053e6fbc3b787b3c224c6f0586c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115903 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-05-21tdf#104254 sw DOCX import: fix text wrapping in headersDaniel Arato (NISZ)1-3/+5
Text wrapping around shapes and images used to be turned off in header and footer frames. This commit simply reenables that feature for headers/footers (to avoid also regressions related to the fix i13832). Change-Id: I46ca112f36e0c0c86342fa34fdb7cb7502745731 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113098 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-05-20sw: allow the height of a line to be larger than 65536 twipsMiklos Vajna19-88/+88
The line height can be quite large if the line contains an as-char image. Found by temporarily changing static_cast<sal_uInt16>() in sw/ to a template function to make these conversions implicit (excluding cases where the input and output types can't convert implicitly), then asking -fsanitize=implicit-unsigned-integer-truncation -fsanitize=implicit-signed-integer-truncation to flag the problematic conversions. The first hit was in SwFlyCntPortion::SetBase() (that's where 67408 turns into 1872), then the same pattern at many other places. Change-Id: Ie12f490ed8dd5c531f11506c97598ce4f7610e2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115873 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-05-19ImplPlayWithRenderer never checks its OutputDevice against nullptrCaolán McNamara1-2/+6
just pass a reference instead and spread that around to some similar cases Change-Id: Ifb2dee8c7bf02a9f01982b928c90666cbbdd84fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115759 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-17split OutputDevice from WindowNoel Grandin3-3/+3
as part of a longer-term goal of doing our widget rendering only inside a top-level render- context. I moved all of the OutputDevice-related code that existed in vcl::Window into a new subclass of OutputDevice called WindowOutputDevice. Notes for further work (*) not sure why we are getting an 1x1 surface in SvpSalGraphics::releaseCairoContext, but to fix it I clamp the size there (*) might have to dump VCLXDevice, and move it's code down into VCLXWindow and VCLXVirtualDevice (*) can we remove use of VCLXDevice in other places, in favour of just talking to the VCL code? Change-Id: I105946377f5322677d6f7d0c1c23847178a720b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-14Outline folding experimental feature rehackJim Raykowski2-0/+23
* Changes the way the outline content visibility button is shown to similiar how the table un-float button is shown. * Toggle function is replaced by an invalidate function that makes outline content visible or not visible only if needed. * Removes the left and right arrow keys restrictions of cursor movement in and out of an outline node paragraph having outline content visibility attribute set false (folded outline content). These were prevented due to causing an assert in txtfrm.cxx SwTextFrame::MapModelToView but seems to do no harm here if allowed. * Makes a selection read-only if it spans an outline node that has folded content and disallows actions that would cause loss of folded content. * Adds RestoreSavePos when Move fails in SwCursor::LeftRight to fix a bug that occurs in documents with outline content folded at the end of the document. When the cursor is at the end of the visible document and right arrow key is pressed Move fails after moving the cursor to the end of the document model, which doesn't have a node frame and causes wierd numbers to be displayed in the statusbar page number count. Left arrow, when in this state causes a crash without the added RestoreSavePos. * Addresses tdf#141390 concerning position of view when feature is turned off and on. Change-Id: I0430f73643201aa08ffc347c1597b44b1de290e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114255 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2021-05-12tdf#142196 sw: crossing out images anchored to characterLászló Németh1-5/+39
Follow-up to commit d845b91bcc6eb885c55494d4d4fab4ec09577e1d (tdf#78864 sw track changes: cross out deleted images). Change-Id: I3daa772ac80f777e1badc58a424f98b1d655acba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115442 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-05-10tdf#142130 sw track changes: fix crossing out of neighboring imagesLászló Németh3-7/+6
Normal images got crossing out from the next deleted images. Fix it by using only the start position of the image in CheckLine() instead of the 1-character length range of the anchor point. Note: add unit test also for tdf#78864. Follow-up to commit d845b91bcc6eb885c55494d4d4fab4ec09577e1d (tdf#78864 sw track changes: cross out deleted images). Change-Id: I8894e625d479adea4b1003f55f24f292064ed7ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115255 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-05-07cid#1401328 Uncaught exceptionCaolán McNamara1-3/+3
and cid#1401334 Uncaught exception Change-Id: I609ec44bf28db28e69533d7b795f705fa8a330f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115228 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-04cid#1478174 Uninitialized scalar fieldCaolán McNamara1-0/+1
Change-Id: Ib17e55b600012ef5f6a26d01e9d54aa7be9c590d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115052 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-02sal_uLong->sal_uInt32 in SvParserNoel Grandin1-2/+2
Change-Id: Ibe5599e1cc136330a8e9c089c7cc66d0ef4bc966 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115002 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-30tdf#78864 sw track changes: cross out deleted imagesLászló Németh3-1/+59
Show Changes mode shows deleted images with crossing out to allow differentiate deleted and inserted images during change tracking. See also commit d6322bcedc197a654abc7d64bfea8cf570f123bf (tdf#59463 track changes: record deletion of images). Change-Id: If9bc2252c6cdd06cbe267fe130023c416aa53ce7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114906 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-04-28sw: fix crash in SwAnchoredObject::dumpAsXml()Michael Stahl1-1/+2
SwAnchoredObject::GetObjBoundRect() is const, so it's only idiomatic that calling it reformats everything. Change-Id: Id57472ae3041c7264bc904e1a68907c48e60ac96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114757 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-04-19tdf#141550 tdf#141557 tdf#140975 sw: fix textbox crashAttila Bakos (NISZ)1-0/+1
and regressions by refactoring SwTextBoxHelper. tdf#141550 was a DOCX import regression from commit ff321dd36554d25f0817903becf4598065e0a194 (tdf#140828 sw textbox: fix AS_CHAR regression), resulting bad horizontal position of the frame of the textbox. tdf#141557 was a regression resulting crash by changing text box anchoring "To Paragraph". tdf#140975 was an implementation error, resulting broken textbox by changing box anchoring to "As Character". In the SwTextBoxHelper class there were many repeating code parts for textbox positioning. Now these parts have been replaced with the calls of several new functions: 1) getShapeFormat() returns with the SwFrameFormat of the UNO XShape; 2) setWrapThrough() only sets the surround of the textframe (used in the code frequently); 3) changeAnchor() sets the anchor of the textframe according to the anchor of the shape; 4) doTextFramePositioning() sets the position of the textbox according to the shape (used in the code frequently); 5) isAnchorTypeDifferent() shows difference of the anchor types of the shape and the textframe. Also it handles the situation of anchoring "As Character"; 6) isTextBoxHasValidTextFrame() checks if the shape is a part of a textbox or not. Every function returns with true on success, otherwise gives information to the log. All of them can be called with ShapeFormat or UNO XShape. The goal of this to make the possibility to advance this class for further functions – rotation, grouped textboxes etc. – without code copying. Change-Id: I4441cab87931f161d0ace4983646d6d2a68a7321 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113463 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-04-15loplugin:stringliteralvar look for assignmentsNoel Grandin1-26/+26
to O[U]String from char array literals, we can convert the char literals to O[U]StringLiteral and avoid a runtime allocation Change-Id: I15d8dddb2cd428b90740e39f20daf98e0941aa6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-14sw: layout dump: sorted_objs of SwPageFrameMichael Stahl1-0/+21
Change-Id: I2bf8493744d054c513ab9b65136b6e29e9aa07f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114065 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-04-13tdf#132393 sw: disable TabOverMargin layout flag inside sectionsMiklos Vajna1-1/+6
Regression from commit bdfc6363d66aa079512cc8008996b633f693fed1 (n#793998 sw: add TabOverMargin compat mode, 2013-01-08), the problem is that currently adding an alphabetical index generates document model where tab positions are explicitly over the margin and users expect that the page numbers are still visible, even for Word documents. Fix the problem by disabling this mode inside sections. Long-term we may want to fix the ToX generator to create a more sane document model and then this flag can be handled even inside sections. Change-Id: Ic91ac36e703d59e4711a009db1f921e456bf8645 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114018 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-04-09Recheck include/ with IWYUGabor Kelemen1-0/+1
See tdf#42949 for motivation Change-Id: Ifc253bf800bb1468b5774663a93f4fb30bec81d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113657 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-30related tdf#131801: remove completed TODO commentJustin Luth1-2/+0
The todo was done in LO 7.1 with commit c77b9c349f0a48392d8cb7a49532844b2cafb5ba Michael's reference to testParagraphMark is puzzling because the only place that is found is in a unit test, and Miklos' ooxmlexport.cxx test has nothing to do with numbering. Change-Id: Ie24ff6a69edf92f9dbe586c64a6ea631718002cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110122 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-03-29tdf#140828 sw textbox: fix AS_CHAR regressionAttila Bakos (NISZ)1-0/+4
Textboxes anchored as characters don't lose their text frames after changing the anchor "To character". Regression from commit 493a916a3113e877835c9bc7c93faef0d29f9a33 (tdf#140158 tdf#138598 tdf#140598 sw: fix sync of AS_CHAR textboxes). Change-Id: I0e6d88c9dcdeff515744bc4c201a5640eb810d1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112209 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-03-29sw: prefix members of IndexEntrySupplierWrapper, SwDropCapCache, ...Miklos Vajna3-172/+220
... SwFootnoteSave and XmlPortionDumper See tdf#94879 for motivation. Change-Id: Ibd956314173cfd18e15c7c6b3c75d655bc9adf55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113292 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-03-26cid#1474452 Unchecked dynamic_castCaolán McNamara1-2/+2
Change-Id: Ib50140fad741d34eae0dfe28fd4ed03024d11e96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113165 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-26loplugin:flattenNoel1-25/+25
Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-25tdf#141079 Restore double click behavior for script fieldsSamuel Mehrbrodt1-2/+6
Change-Id: I5daa730740ea042bdae56b832f2557ec974339b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112668 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2021-03-24sw bibliography, refer to a page: add PDF export linksMiklos Vajna1-0/+62
This is similar to hyperlinks or footnote references, but the source rectangle is a field here and still the links are always external. With this, the UI and the PDF export result is consistent, it doesn't happen that you can click on biblio entry fields on the UI, but not in the PDF export result. Change-Id: I655ef6d5f79a7e372cdc8448ddc10af9ca488ac5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113035 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-03-23tdf#124176 replace include guards with pragma oncePanos9-36/+9
Change-Id: Iac0caac45130fd7da21ed9e7869abbd288931747 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112975 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-03-21cid#1473798 silence Unchecked return value from libraryCaolán McNamara1-1/+1
Change-Id: I00174b5444749f3345f5691e24eb5219d1b47059 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112837 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-19silence coverity unchecked return value from library on xmlText* functionsCaolán McNamara1-93/+93
Change-Id: I651abb00d8ae1bdbf758a6a0176fd8912531a585 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112753 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-18tdf#108518 partial revert tdf#64222 sw: better DOCX im/exportJustin Luth1-3/+3
...of paragraph marker formatting 6.4 commit 5ba30f588d6e41a13d68b1461345fca7a7ca61ac Ultimately, this just reverts back to an earlier 6.4 change (which means that this really is untested and unproven)... > Also revert the change in checkApplyParagraphMarkFormatToNumbering() > to consider hints that start before the end of the paragraph, > as it has unintended side effects as pointed out by Mike Kaganski. But those side effects were from a DOCX file, and DOCX isn't processed here anymore. The (unedited) comment (still) says: //Formatting for the paragraph mark is usually set to apply only to the //non-existent extra character at end of the text node but there can be //other hints too (ending at nTextLen), so look for all matching hints. //Still the (non-existent) extra character at the end is preferred So, that suggests that there is more than one possible valid autofmt, and that not ALL autofmts will have a start==end. This is being considered since it fixes the one example file that I could find that still broke when reverting OOo's 2012 hack commit 1c22545edf9085b9f2656ca92781158b6b123db3 Fix issue #i119405: Numbering text style changed after importing the *.doc The other alternative would be to // TODO remove this fallback (for WW8/RTF) Change-Id: I69b6e31fe570742b4b9dd94d2cce2b5b9850360d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112319 Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-03-17sw: prefix members of SwIsoRefPortion, SwIsoToxPortion, ...Miklos Vajna7-67/+66
... SwSoftHyphPortion and SwSpaceManipulator See tdf#94879 for motivation. Change-Id: Ib7034bfa158885d23cf51b9db2e8f7095885cf39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112595 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-17tdf#52065 sw: revert tdf#45908: Cleaning up the tabs too earlyJustin Luth2-0/+7
... 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-03-13tdf#135774 Char highlight: partial revert tdf#114799Justin Luth1-0/+4
...DOCX import: fix missing numbering highlight from 7.0 commit 315d56582f8a56d8f2d3ea6cda63ea4832249608. If the numbering had a specified w:highlight in numbering.xml, then that character background should apply to the bullet point. However, SetDiffFnt automatically clears the highlight, the same as it does with mxBackColor (fixed in earlier commit). So a special step is needed to check if the font has a highlight, and since that direct formatting has priority, re-apply it after SetDiffFnt has finished. This is slightly different from mxBackColor - which is an optional attribute. Highlight is reset to COL_TRANSPARENT. If a RES_CHRATR_HIGHLIGHT exists explicitly setting a COL_TRANSPARENT, then any overrides should have been removed from pCleanedSet, and so it never needs to SetHighlightColor(AUTO). Change-Id: Id9d88054254563706b9aee90a1d257b467139334 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112410 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-03-12tdf#135774 Char highlight: numbering: don't clear existing mxBackColorJustin Luth1-0/+8
If the numbering had a specified w:shd in numbering.xml, then that character background should apply to the bullet point. However, SetDiffFnt automatically clears mxBackColor (and I'm not sure why - but that has been true since way back to original import). Well, in this section the paragraph marker properties should only apply if the numbering doesn't have direct formatting already. So a special step is needed to check if the font has an mxBackColor, and since that direct formatting has priority, re-apply it after SetDiffFnt has finished. (P.S. This had been done earlier for GetHighlightColor, but it was reverted in 7.0. From my testing, I haven't seen an example where it was needed, but it too is reset to null - only it isn't optional.) Again, a unit test will be challenging here, since this is a visual change only. Change-Id: I2be129b11b6f746ba11c19d69bf01f3174c1b64b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111675 Tested-by: Jenkins Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-03-08sw: prefix members of SwHyphStrPortion, SwMinMaxArgs, SwMinMaxNodeArgs ...Miklos Vajna6-99/+110
... and SwTextCursor See tdf#94879 for motivation. Change-Id: Id226a5b30fae4c29476aebc6edf7fb180726eb4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112153 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-03-08tdf#140796: Wrong English string for U+2060 characterJulien Nabet4-4/+4
Rename "No-width No ~Break" to "Word ~Joiner" + replace pattern "ZWNBSP" variable names by "WJ" Change-Id: I95a874a9d2d20a30d2c4c3add6041adbe72d872c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112055 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>