summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2020-02-04tdf#129582 sw: fix copying of flys in header/footer in DOCX/RTF importMichael Stahl
The problem is that the exception for writerfilter in IsDestroyFrameAnchoredAtChar() and IsSelectFrameAnchoredAtPara() is wrong in the case when the header/footer content is copied via SwXText::copyText(); that is, previously the situation was that writerfilter relied on Delete not deleting such flys (for RemoveLastParagraph) but Copy copying them. (regression from 28b77c89dfcafae82cf2a6d85731b643ff9290e5 and e75dd1fc992f168f24d66595265a978071cdd277) So restrict the writerfilter hack to delete; this causes a problem with ooxmlexport9 test testTdf100075: it has 2 flys anchored at the same paragraph; writerfilter will insert the content into the body and then convert to fly; when the 2nd one is converted it will copy the 1st fly and anchor it inside the 2nd fly but then unotext.cxx:1719 will reset its anchor to inside the body... Prevent this unwanted copy by relying on the new parameter bCopyText that was introduced in 04b2310aaa094794ceedaa1bb6ff1823a2d29d3e, but change things a bit so that the case that pass in the extra flag isn't the copyText() one that wants the *normal* selection semantics in writerfilter import, but the 2 known places that want the *exceptional* selection semantics in writerfilter import (hopefully there aren't more). This is not ideal and the various bool parameters to CopyRange() plus mbCopyIsMove plus mbIsRedlineMove should probably be consolidated into some flags enum passed to CopyRange(). Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87072 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 81ec0039b2085faab49380c7a56af0c562d4c9e4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87095 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 34bdbb98846115671dcc71e34f6f2900fb638154) The backport is limited to at-character flys because the at-para commit e75dd1fc992f168f24d66595265a978071cdd277 will not be backported to 6.3; lots of related conflicts were resolved. Change-Id: I638c7fa7ad0b4ec149aa6a1485e32f2c8e29ff5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87857 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-04DOCX import: fix lost objects anchored to an empty linked headerMiklos Vajna
This is really similar to commit 04b2310aaa094794ceedaa1bb6ff1823a2d29d3e (DOCX import: fix lost objects anchored to the single para of a linked header, 2020-01-10), except here the header is not just a single-paragraph one, but has no text portions. Update text-copy.docx to have a header which is not only a single paragraph, but also has no character content. This keeps testing the original case, but now also tests the more strict case (single paragraph -> single empty paragraph). Change-Id: I11bb062e77af1a83f717225ea5b4daef39e5a672 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86552 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit c12358166a9bd88fe10feabca45a6ad3f65dff8e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87123 Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 8d58d0ef72162bbfb92cd3a894387f57c62ee8ae) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87856 Tested-by: Michael Stahl <michael.stahl@cib.de>
2020-02-04DOCX import: fix lost objects anchored to the single para of a linked headerMiklos Vajna
Regression from commit 08f13ab85b5c65b5dc8adfa15918fb3e426fcc3c (tdf#112202 writerfilter,sw: fix loss of headers, 2019-12-16), the problem is that on one hand, copyText() is meant to copy a complete XText (header, table cell, footnote, etc), OTOH the internal API use used only copies at-para anchored objects for complete text nodes, so a one-paragraph header will loose its anchored objects when a linked header is copied. Introduce a new "CopyText" flag that provides the expected copyText() behavior and use that when the copyText() UNO API is invoked, but leave the selection behavior unchanged. Perform the inclusive check in IsSelectFrameAnchoredAtPara(), opt in for that from SwXText::copyText(), the rest is just passing the flag around. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86529 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit 04b2310aaa094794ceedaa1bb6ff1823a2d29d3e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87122 Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 8f84922be15d37cb54fa592e1445fa5ab2c37f15) Note: this backport doesn't fix anything and has lots of conflicts but is required for backporting a subsequent regression fix... Change-Id: Id727f7ca4f6121a7050340359716a52ecb4886f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87855 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Michael Stahl <michael.stahl@cib.de>
2020-01-29sw_redlinehide: fix SwScriptInfo hidden textMichael Stahl
A missing update of nOffset in SwScriptInfo::InitScriptInfo(); it must be updated for every extent but it's not for the last one in a node. test case: ab cd Delete "bc", hide "d", but "a" disappears. (regression from 0e26d48ad7f18deac8447a306215f79d5c62be27) Change-Id: I99fb88409e184a61866f908722b4430a53914153 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87201 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 53cd5d1f50d3da4efe0938aa340f6a57a0b8501d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87247 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-01-28tdf#130214: workaround invalid state resulting from error on importMike Kaganski
Obviously the real error is somewhere else, which results in tdf#126435, and produces unexpected state with missing text append context on stack. This is just a hack to avoid crash. Change-Id: I420ac3b74f5efb9688dc764ac2ad0dcc974ba0e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87595 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit eca00082c78fddf79f247057227404738be8806c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87635 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-01-24tdf#128782: Add UItestXisco Fauli
Change-Id: I389d05fa9b1e79af2c01abd920fb4454b96543fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87282 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> (cherry picked from commit e13f74ba563e1c82a1de587818f6090077c6f30f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87332
2020-01-24tdf#129382: sw: assign names to shape object stylesVasily Melenchuk
Empty style names for drawing object will cause problems with udo/redo which right now refers style names instead of style pointers. Change-Id: If2266f1db04c624dbfdd716b5599d5f6cbb5371e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86520 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit db8fdf20fbbb22e0510f0500140bbf7a3b2642f7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87214 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87305 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-24tdf#128782: sw: assign name to draw objectVasily Melenchuk
SwXDrawPage is inserting frame styles without name. This is confusing undo/redo code which is operating styles by names. Change-Id: Ibcda01fbd3ec88e9cdbde446c3f18c7ad6b0cbc8 Reviewed-on: https://gerrit.libreoffice.org/83415 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit c2d689790c332ffd2f0d73de6aae53f26f0fbe53) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87206 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87304 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-22tdf#129798: store SwWrtShell when it's availableMike Kaganski
GetActiveWrtShell may return nullptr when attaching a new component to current frame, e.g. destroying on print preview. OTOH SwWrtShell is passed to SwFieldDBPage::SetWrtShell on creation, so store it to own base class then. Possibly that would be enough, and we could remove all the checks in other methods - but I don't know the code well enough to be sure that SwFieldDlg::PageCreated and SwFieldEditDlg::CreatePage will always set SwWrtShell; to be on the safe side, I kept the checks where SwWrtShell is used, and stored it in those places if not yet stored. Regression after commit 39ba5e3bde93358af1b363da8f850bdc96806cfa. Change-Id: I21f3c8ef24764e98b1bc287db3c6485ce0b3ab48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86253 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 016c69c99e1ab26e6582ca8dea6fa1b4b9e5d109) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86406 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-20tdf#129839: pass initialized shared_ptr to SwDoc::GetBoxAttrMike Kaganski
Regression after commit 1e2682235cded9a7cd90e55f0bfc60a1285e9a46 Change-Id: I40acc9e0ffdd292283381366a31eb6647b80324f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86291 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 4056b70e6339102374898fff26f099da455475b1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86329 Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit ed7dc32834e11c93eaf21de8424d9d46c7fa0d53) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86964
2020-01-20tdf#129173 tdf#129175 Fix number format of data labelsBalazs Varga
Show the real value (cell value) of datapoints instead of the recalculated value in case of Percent Stacked Area chart. Also fix: tdf#95425 Do not reset number format of data labels when open dialog of 'Format data series' and close dialog. Note: Inherits the data series/point label format from the cell format and not the axis format, if we set the 'link to source data' option to true. Change-Id: I04e9968034a67c6bc6b92941df61d945b4292d79 Reviewed-on: https://gerrit.libreoffice.org/84819 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit e57d90cd4e51a1353eafc87bb29cfe6076704a7c) Reviewed-on: https://gerrit.libreoffice.org/85198 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> (cherry picked from commit 9c1063ba13028244346528e307d5563d6faf949d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85276 Reviewed-by: Balazs Varga <balazs.varga991@gmail.com>
2020-01-19tdf#128996 Chart: Fix disappeared vertical X axis labelsBalazs Varga
Regression from commit: 75ef0e41ea8a9096ac619356d2b837c5333b47e6 (tdf#125334 Chart: allow text break in bar chart axis labels) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86010 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org> (cherry picked from commit d53de6b0bfff08dfbde4fe305e2a9b7a60255458) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86259 Reviewed-by: Balazs Varga <balazs.varga991@gmail.com> Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Change-Id: Ib935de74314b7dec489d94a4aa3c65072e18d9e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86355 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga991@gmail.com> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2020-01-17tdf#126795 docx export: do not output tab stops twiceSerge Krot
Change-Id: I70235df7fb73133f413863ee5eb7c76905a60248 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86767 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 264d27c94d7286a407b05a32f4097ac9d543e1a3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86896 Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de> (cherry picked from commit 6358fb7d3139a7b5ce0ea2394faa55ea1e2e4b6c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86954 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-15tdf#128782: sw: set name for draw frame style for text boxVasily Melenchuk
Since new undo/redo code operates style names instead of pointers, it is important to have all formats with name. Change-Id: Ib91cd13b8a324ae674e9ace9bb5f17e679bd2dab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86162 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit c79dcf98d662e76b1290f8d43c927d1031e94729) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86400 Tested-by: Jenkins
2020-01-09tdf#129353, tdf#129402: fix node creation on index importMike Kaganski
ToC, bibliography, and index sections import code changed to closely follow what Word does, make sure that pre-rendered entries don't get imported as standalone paragraphs outside of the index sections, and paragraph count is accurate (no missing or added paragraphs as much as possible). In Word, an index may start and end in the middle of a paragraph: <w:p> <w:r> <w:t>Some text before index</w:t> </w:r> <w:r> <w:fldChar w:fldCharType="begin"/> </w:r> <w:r> <w:instrText> TOC ...</w:instrText> </w:r> <w:r> <w:fldChar w:fldCharType="separate"/> </w:r> <w:r> <w:t>First pre-rendered index entry</w:t> </w:r> </w:p> ... <w:p> <w:r> <w:t>Last pre-rendered index entry</w:t> </w:r> <w:r> <w:fldChar w:fldCharType="end"/> </w:r> <w:r> <w:t>Some text after index</w:t> </w:r> </w:p> However, normally it looks like either no runs precedig index, or no runs of pre-rendered contents will be present. When no Std elements are used, the typical situation is that there's a normal paragraph (possibly with some user text), which ends with index start marker, without any pre-rendered contents in the same paragraph; and all pre- rendered contents goes in following paragraphs. Such index normally ends with index end marker in the *first* run of a paragraph, which then might have normal text runs. When Stds are used, then no leading/trailing out-of-index runs in paragraphs with marks are usually present; and in this case, when paragraphs with index marks don't contain pre-rendered entries, they still are treated as part of the index. In Writer, indexes are node sections (and so cannot be inline with other paragraph contents). When there was some paragraph content already before the start-of-index mark, the paragraph is assumed to end before the index; in this case, when current <w:p> element ends, importer decides if a separate starting paragraph is needed or not, depending on if there was some runs after the mark. When there was no text runs before the starting mark, then the paragraph is treated as leading paragraph of the index. This allows to not miss empty paragraphs before index; and not have two paragraphs where there was one in Word. Only in cases when user had manually typed text both in and outside of the index in the same paragraph in Word, we would have the paragraph split into two in Writer. For end marks, the behaviour depends on whether it's inside Std. When inside, the ending paragraph starting with index end mark is considered part of the index. For out-of-Std case, it's considered normal paragraph (and measures are taken to make sure it's not dropped even if empty, because sometimes such paragraphs don't have other content, and have section settings, which is usually treated by Writer as "drop this paragraph" sign). A special problem is multi-column index. It's wrapped into a continuous section by Word; and in Writer, we also wrap it into a section. It would be possibly useful to detect somehow if this section is part of index definition, and in this case, drop the section and put its properties into the Writer's index section. That would avoid an explicit section in the imported document. This is TODO, for someone who figures how to detect reliably if the section belongs to index definition. See comment in DomainMapper_Impl::appendTextSectionAfter. By the way, current export code is wrong, producing an index that is single-column in Word; this change doesn't touch that. Several existing tests needed to be fixed, which used to test wrong results. Change-Id: I9597c8ab13f31ded9abcc24054d3478d3e3a3b40 Reviewed-on: https://gerrit.libreoffice.org/85089 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85278 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86464 Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-01-09tdf#129513: drop incorrect and redundant erasure of paragraph sprmMike Kaganski
It was introduced in commit 2499397cb39330dabeb8b7b3e0d7eb6213a0d8f4 "avoid sending duplicated paragraph flags", and supposedly was meant to avoid having duplicating sprms in the collected properties, when new properties were pushed back at that time. Using specific sprm id was likely a mistake (nParam should have been used instead). Now the new sprm is added using RTFSprms::set with eOverwrite having default value of RTFOverwrite::YES, which takes care to avoid dupes, so the call to erase is redundant. This reverts commit 2499397cb39330dabeb8b7b3e0d7eb6213a0d8f4. Reviewed-on: https://gerrit.libreoffice.org/85602 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 989043b0644354b92fd17e4194897c2eb0935031) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85742 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Change-Id: Ied19f6feb41bd17ef317812d4d295ca0542a5843 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86418 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-12-30tdf#54409 fix AutoCorrect with Unicode quotation marksLászló Németh
Now single or double typographical quotation marks don't break automatic correction of the quoted words. For example, ‘acn -> ‘can, acn’ -> can’, “acn” -> “can”. Change-Id: I7f895414be4c3bbc9a3914df83d93cf28b4311a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85812 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 0d52da4637b563c175cd21d04a639160441436ef) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85931 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2019-12-29sw: fix widow loop with as-char flys in text formattingMichael Stahl
The document has a paragraph with 4 as-character anchored flys depicting Zirbenholz; due to their size and an additional fly that is anchored at the paragraph, there are 3 lines that do not fit onto a single page. This situation causes a loop that proceeds like this: text frame 80 is the follow of text frame 21. when formatting 80: the 1 line violates the widow rule (>=2) and PREP_WIDOWS is sent to 21, invalidating its FrameAreaSize 80 validates its FrameAreaSize when formatting 21: PREP_WIDOWS_ORPHANS sent to 21 CalcPreps() sees IsPrepWidows() and sets a huge height and calls SetWidow(true) SwTextFrame::WouldFit() sees IsWidow() true and resets it false SwTextFrame::WouldFit() sees IsWidow() false and a huge but insufficiently huge height 21 validates its FrameAreaSize CalcPreps() sees IsPrepAdjust() FindBreak() calls TruncLines() and because of as-char fly invalidates FrameAreaSize of 80 The loop is most easily reproduced by printing via the API; it's possible to get a loop when loading the document in the UI, but typically the UI remains responsive even though the layout never finishes. As it happens, before commit ee299664940139f6f9543592ece3b3c0210b59f4 "SalInstance::DoYield: Don't drop SolarMutex when accessing user event queue" the loop on printing via API was broken by releasing SolarMutex; the result, however, was incorrect, with the last line of Zirbenholz that should be on the second page missing in the PDF. This loop is presumably a regression from commit f2e3655255db4032738849cd4b77ce67a6e2c984 "Avoid -fsanitize=signed-integer-overflow", which changed a magic number in SwTextFrame::CalcPreps(), but didn't adapt the poorly documented corresponding magic numbers in SwTextFrame::WouldFit(); in LO 5.1.6.2 the CPU is idle after loading the document. Change-Id: Ib6563c21edb68945c14a61b51ba34f0ee3f2544a Reviewed-on: https://gerrit.libreoffice.org/85623 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 68a5afaaabd0c75bba3439cfdff90fb75d1cdd3f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85750 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-12-24tdf#106164 AutoCorrect: capitalize words with apostropheLászló Németh
at sentence starting position, for example we’re -> We’re This worked only with ASCII apostrophe ('), and changing to default usage of typographical apostrophe (U+2019) broke this kind of capitalization from commit e6fade1ce133039d28369751b77ac8faff6e40cb (tdf#38395 enable smart apostrophe replacement by default). Change-Id: If582194364f77cfb9fc0f04a28ac79a08bb804ff Reviewed-on: https://gerrit.libreoffice.org/85630 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit f6cf80c81043d84606a5b5f7d93ae958307a16d3) Reviewed-on: https://gerrit.libreoffice.org/85660 (cherry picked from commit 030b7c01dcb2262e5dc73de81dd33e2e24529da2) Reviewed-on: https://gerrit.libreoffice.org/85664 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2019-12-23tdf#126127: Make nTmp smaller still, avoid -fsanitize=signed-integer-overflowStephan Bergmann
...after f2e3655255db4032738849cd4b77ce67a6e2c984 "Avoid -fsanitize=signed-integer-overflow" had already reduced it from using LONG_MAX to TWIPS_MAX/2 in the past. This time, avoid the computation of > const sal_uInt64 nCurrentDist = sal_Int64(aDiff.getX()) * sal_Int64(aDiff.getX()) + sal_Int64(aDiff.getY()) * sal_Int64(aDiff.getY()); // opt: no sqrt in GetFrameOfModify (sw/source/core/layout/frmtool.cxx) from overflowing (where aDiff.getY() derives from nTmp and can be close to it in magnitude, so computing its square would overflow on platforms where TWIPS_MAX is a large sal_Int64 value). (The "empirically shown to be large enough in practice" in the comment is a successful `make check` on Linux 64-bit with UBSan.) Change-Id: Ic7f058bd6853ff04ccb50a150509e98f850d12d2 Reviewed-on: https://gerrit.libreoffice.org/74801 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Jenkins (cherry picked from commit 8723ac4e20eda87a82393f2f6c7d28ece8514238) Reviewed-on: https://gerrit.libreoffice.org/85733
2019-12-19Related: tdf#115719 DOCX import: fix increased spacing vs left-aligned objectsMiklos Vajna
Commit 8b73bafbc18acb4dd8911d2f2de8158d98eb6144 (tdf#115719 DOCX import: increase paragraph spacing for anchored objects, 2018-02-14) added an import-time tweak for a problem that has been confirmed to be a Word layout bug in the meantime (and the tweak makes Writer behave the same way if the document has been created by an affected Word version for layout compatiblity). Later, commit 4883da6fd25e4645a3b30cb58212a2f666dae75a (Related: tdf#124600 DOCX import: ignore left wrap on left-aligned shapes, 2018-02-14) fixed left spacing of anchored objects aligned to the left, to be in sync with what the DOC import does. This broke the previous fix in case the shapes are left-aligned. Fix the problem by tracking what is the in-file-format and logical left margin, so the final doc model has the value necessary for correct horizontal positioning and the importer has the value that's necessary for correct vertical positioning. (cherry picked from commit 814cb2433da6bd608e935fa5531d2a2b92867985) Conflicts: writerfilter/source/dmapper/PropertyMap.cxx Change-Id: I8f16cbe7bad40e243111c902bdc1ab0e8141d6b9 Reviewed-on: https://gerrit.libreoffice.org/85223 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-18tdf#126353 merge character borders on layout portions.Mark Hung
Layout portions / para portions may have portion length. So merging them is valid and there's no need to check them at all. Invoke MergeCharacterBorder in InsertPortion to handle border merging consistently. Change-Id: I3669bcbb1d658e1df74d338d6cf062e5f07faf4d Reviewed-on: https://gerrit.libreoffice.org/77366 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com> (cherry picked from commit 56e95f8e20b20680d025f3ecbeb4cc5306085b1e) Reviewed-on: https://gerrit.libreoffice.org/85211 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-12-11Resolves: tdf#129250 move redline type into RedlinData so we can sort on itCaolán McNamara
Change-Id: Ia8e6744c1679655240a9a9cee9425030e994e16b Reviewed-on: https://gerrit.libreoffice.org/84808 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-12-09tdf#115630 tdf#88922 Chart: fix custom legend position and sizeBalazs Varga
Do not need to set the "AnchorPosition" value, when we move the legend object. It is enough to set only the "Expansion" as custom, so we keep the previously set "AnchorPosition" value and we can use the lcl_calculatePositionAndRemainingSpace function to calculate the remaining space of the inner chart area. Change-Id: I7b577bc6acf2de9b6755329b92603ea5ba631d57 Reviewed-on: https://gerrit.libreoffice.org/83399 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 739ed2c29f49ea5e83bcd1352b2644c2e2d09f7b) Reviewed-on: https://gerrit.libreoffice.org/83890 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> (cherry picked from commit 1903d0275b09d88eec6e57303a8a7d34246cb230) Reviewed-on: https://gerrit.libreoffice.org/84241 Reviewed-by: Balazs Varga <balazs.varga991@gmail.com>
2019-12-06tdf#127955 check if position stored in user config is in range for the treeviewCaolán McNamara
https://crashreport.libreoffice.org/stats/crash_details/8c4a3136-73be-4536-ad6f-ce97ae0368dd Change-Id: I320f965eb622f90f8059f85e7ba2ff203419ab3f Reviewed-on: https://gerrit.libreoffice.org/84601 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-12-06tdf#128611 sw: improve rotated text layout in table cellsMiklos Vajna
The problem was that in case a table with 1 row and 2 cells has rotated text in the A1 cell, then the row height is 0, so we aggressively try to break up the text into multiple lines. Then the A2 cell adds more content, so the row height is increased, but the A1 cell is not re-layouted to make use of the increased amount of vertical space. A similar (but working) situation is vertical alignment of cell content, there adding more content to A2 re-formats A1. Fix the problem in a similar way: track if a text frame contains at least one rotated portion, and throw away the portions of the text frame at the end of SwCellFrame::Format(), after vertical alignment is handled. (cherry picked from commit 0fa95852b0968fa2a35efb8ca816949c58af56e0) Change-Id: I65383bb1af486771dc671dca3d8bbf1831ba94ff Reviewed-on: https://gerrit.libreoffice.org/84552 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-12-05Add comment about confusion in SwCommentRuler::CreateJsonNotification()Tor Lillqvist
No code changes. (cherry picked from commit 5b6d23dcd0f2f779b4bbffe7f427a7c397f41c95) Change-Id: Ibc46b3e55038e84f2ad80ff12b277b2e2c77a4ce (cherry picked from commit 0fb2b9b23ac3d082251217b3478917b387fe162c) Reviewed-on: https://gerrit.libreoffice.org/84540 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2019-12-04tdf#128845 writer, cannot modify a bibliography entryNoel Grandin
regression from commit 3b16e997f69efe2e3f6cdf64fe8fb2727b6ebaa7 Date: Fri Jan 18 15:38:07 2019 +0200 cleanup SwAuthEntry manual ref-counting Change-Id: I30bd7af3cea51cedf5ca9bc43171665fb71830aa Reviewed-on: https://gerrit.libreoffice.org/84388 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 41b752756e53c4f9c3d08cbce412d1408c5aed2f) Reviewed-on: https://gerrit.libreoffice.org/84413 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-12-03Related: tdf#128611 RTF import: handle vertical flip of line shapesMiklos Vajna
UI uses SdrEditView::MirrorMarkedObjVertical() to flip a line shape vertically, handle it similarly at import time as well. Also note that this flips in-place, while the naive '*= -1' for the height would have an incorrect vertical position. (cherry picked from commit f9f421b7beaf117968c0dbfd84a2dad3dc85136a) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: I42b7feb5f799b99337ddec734dcf98dd1d553755 Reviewed-on: https://gerrit.libreoffice.org/84230 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-11-29tdf#128898 import text from file with text-decode failedNoel Grandin
regression from commit 8f6f9e4217d03d874fb1ce391730a1c893ab6844 tdf#127958 crash adding 2 or more files into writer master document just make SfxMedium use shared_ptr, rather than the sometimes yes, sometimes no, ownership. Reviewed-on: https://gerrit.libreoffice.org/83930 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit cc4dbe473b0b68dbe120065c1d6a64a087f41ba2) Resolves: tdf#129082 insert sheet from file fails since... tdf#127958 crash adding 2 or more files into writer master document commit 8f6f9e4217d03d874fb1ce391730a1c893ab6844 Date: Mon Oct 7 09:40:41 2019 +0200 used the SfxItemSet copy ctor to make a copy of the itemset, but the orig itemset was a SfxAllItemSet not a SfxItemSet. an SfxAllItemSet allows all items to be added but a plain SfxItemSet only allows items in certain ranges to be inserted. Upshot is that later on the filename property cannot be set in the itemset, so file can't be opened. since... tdf#128898 import text from file with text-decode failed commit cc4dbe473b0b68dbe120065c1d6a64a087f41ba2 Date: Wed Nov 27 11:47:57 2019 +0200 tdf#128898 import text from file with text-decode failed these are std::shared_ptr so we can return to passing in the original SfxAllItemSet again to fix the problem 63a4230a96f9dae7726d854297ebb2b51df4868d Change-Id: I77559e9f766d84aca0f9dc0bd1b856c69f0f62f1 Reviewed-on: https://gerrit.libreoffice.org/84029 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-27tdf#109425 NB accessibility event fixandreas kainz
Reviewed-on: https://gerrit.libreoffice.org/83626 Tested-by: Jenkins Reviewed-by: andreas_kainz <kainz.a@gmail.com> (cherry picked from commit b521f14f7c253113061798cb58fc3e565e92cb7d) Reviewed-on: https://gerrit.libreoffice.org/83852 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Conflicts: sw/uiconfig/swriter/ui/notebookbar.ui sw/uiconfig/swriter/ui/notebookbar_compact.ui Change-Id: I246189a0de364a1a0a5e2dc902fa3804762fe389 Reviewed-on: https://gerrit.libreoffice.org/83889 Tested-by: Jenkins Reviewed-by: andreas_kainz <kainz.a@gmail.com>
2019-11-27tdf#128605 DOC import: fix cont sect break with different top/bottom marginMiklos Vajna
Word has a feature to attach different page margins to sections, and then refer to these section definitions via continuous section breaks. The result is that the margin changes never introduce a page break, and left/right margins are applied instantly, while top/bottom margins are applied from the next page. Now in Writer, either these continuous section breaks are mapped to a page break and all margins show up as expected, or we don't do a page break, and then the number of page breaks are as expected; but you can't have both at the same time till the feature is missing in Writer core. Commit c5ed52b1cd6f22787c94bec035ceecf9e1da3271 (ww8import create a pagedesc if continuous section changes margins (bnc#875383), 2014-07-21) tweaked this decision, so that the DOC import always creates a page break, but left the DOCX import unchanged. Fix the bug by going back to not creating page breaks on top/bottom margin changes: this resolves the scenario and still keeps the original situation fixed, too. (cherry picked from commit 162722dfa96dc10243e9a07a3c123f22481d42cd) Change-Id: Id0e8c3a4ce40db8da024a0a20005eb0445325a1a Reviewed-on: https://gerrit.libreoffice.org/83870 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-11-25tdf#128820: use wps namespace for simple text shapesMike Kaganski
Without that, simple text shapes inside groups were written in <pic:wsp> elements, with many child elements also having pic:: prefix. Change-Id: I114cf3499e03aa5ca042211d7b134aaf5b0e7fbf Reviewed-on: https://gerrit.libreoffice.org/82980 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Also consider saved exceptions when terminating parse As with previous commit 18ae77a065cb8ae6940d4067f6ab7e99a3f74047, this will start showing parse errors on invalid files which previously just opened without warnings, silently losing the invalid stream part. Any bug bisected to this commit is not a regression from this commit! The real problem was already before, and was just disclosed by this (which is the actual goal). Also simplify unit test data for tdf#128820, which will now be enough after the change. A unit test (testN779627) revealed unexpected throws when parsing; this was fixed. Change-Id: I5a21b9001874ec6e3b8273c10043ef930bf1cc82 Reviewed-on: https://gerrit.libreoffice.org/82981 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> tdf#128820: improve unit test to not depend on opening bad file failing ... also test exported XML directly Change-Id: I50237593dd111e7c7974452769c8d49c22012713 Reviewed-on: https://gerrit.libreoffice.org/83005 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Fix UBSan build after 9fdf8c0a5cc036ea9bd1e11dd8f2c1a6e601fae2 The said commit simplified a testdoc to testTdf128820, using a smallest possible SVG in it. This seems to produce the smallest possible PNG of size 8, which is passed into GraphicDescriptor::ImpDetectPNG. There its size is read into nTemp32 past the end of the file without checks, which keeps last value of the variable (which was the magic number 0x0d0a1a0a), which is then saved into the descriptor. Then that value is used in ImpGraphic::ImplGetSizePixel, and later multiplying it in lclConvertScreenPixelToHmm causes UB. Fix by checking all the reads in GraphicDescriptor::ImpDetectPNG. Change-Id: Ib4740fac2b87fbef57d5150151129b9852f3ecb8 Reviewed-on: https://gerrit.libreoffice.org/83119 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/83296 (cherry picked from commit d54bae3471e9b9529f1ac03c811c3370d9f5ed89) Reviewed-on: https://gerrit.libreoffice.org/83337 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-11-23tdf#128499 DOC export: fix lost ToC formatting regressionLászló Németh
caused by commit 7376a47680b65cbdfd747a736f288e06f51f7f2d (tdf#92335 DOCX: fix multiplying of "ListLabel" styles). Change-Id: I7d6fc2be3ad7556b988cb00936b9b49deae23f19 Reviewed-on: https://gerrit.libreoffice.org/83443 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 82f7252b143ed18ac517b4261726d094f136047d) Reviewed-on: https://gerrit.libreoffice.org/83491 (cherry picked from commit a92794b86ed9c8673b4907a2369f30180e78e14e) Reviewed-on: https://gerrit.libreoffice.org/83543 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-11-22Resolves: rhbz#1775544 crash in navigatorCaolán McNamara
see demo reproducer in rhbz#1775544 nChildCount is a count of all descendants not just direct children. Just looping while FirstChild returns something is sufficient. Change-Id: If7b16032731d694bfffaae22faad5fe194d1822f Reviewed-on: https://gerrit.libreoffice.org/83456 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-21sw: revert change in expanding hints in SwXText::insertTextContent()Michael Stahl
The SwXText implementation for inserting text works like this: * XTextPortionAppend methods appendTextPortion()/insertTextPortion() get the text properties passed as a parameter, and they should apply only those properties to the inserted text, not expand any existing formatting hints at the insert position. * XSimpleText method insertString() does expand existing formatting at the insert position, just like editing in the UI does For inserting XTextContent: * XTextContentAppend methods appendTextContent()/insertTextContentWithProperties() with properties parameter, similar to XTextPortionAppend * XTextContent::insertTextContent(), without properties So arguably, by analogy to inserting text, the methods that take properties should not expand hints, and the insertTextContent() should follow the insertString and expand hints. Commit 18cbb8fe699131a234355e1d00fa917fede6ac46 is an important bugfix for writerfilter import, but the problem is, it added the DontExpandFormat() call to insertTextContent(), whereas the regression it was fixing (from commit 232ad2f2588beff50cb5c1f3b689c581ba317583) was that the call was removed from insertTextContentWithProperties(). So restore the state before 232ad2f2588beff50cb5c1f3b689c581ba317583. Turns out that SwUiWriterTest2::testTdf126206 was checking how a bookmark-start is formatted instead of how the text is formatted. Change-Id: If524409f88a1a36aa062b6e132996d3f9c1bb571 Reviewed-on: https://gerrit.libreoffice.org/83223 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 635bd7fbcb1d131627ba98fd9085dd2b11e0d33c) Reviewed-on: https://gerrit.libreoffice.org/83332 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-11-20sw: RTF export: fix invalid RTF for shapes and text frames againMichael Stahl
It turns out that commit 4652b911c4376048a452709c953197e1a879a921 wasn't quite right: writing out the m_aRunText doesn't necessarily put it in the right place, it just happened to work on that bugdoc but in other cases the shape may be written before the paragraph properties of the paragraph it's in... So instead change the text frame case to save and restore the run related buffers and members, so that the text frame itself can do whatever it wants, and the result is appended to m_aRunText. The members saved are a superset of those saved in WriteHeaderFooter_Impl(), writeTextFrame(), TextFootnote_Impl(). Also another thing was missing is that OLE objects would trigger the assert because they are also buffered into m_aRunText, e.g. ooo46760-1.odt. Change-Id: Icc6988f8ed19724c593760df46e0254792cd1735 Reviewed-on: https://gerrit.libreoffice.org/83105 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit da967d5f8f450fbcbe1f595dbfc357eb7c8b3c50) Reviewed-on: https://gerrit.libreoffice.org/83181 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-20tdf#128608 ww8import: COL_AUTO == NO FILL, not solidJustin Luth
This fixes problems in the patches for tdf#116071. Tables have nothing to do with this bug. It just is the most common place to have a background colour, and then to have direct formatting that reverts back to COL_AUTO. I created a unit test using the page background (black), default style paragraph background (blue), and direct formatting COL_AUTO. COL_AUTO was turned into WHITE if the fillstyle was set to SOLID. Change-Id: I8197c040cec5adbdf16f379a88fab5e534ac0c6e Reviewed-on: https://gerrit.libreoffice.org/82412 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> (cherry picked from commit b926a068a067e7aff6c8f11ed1098a76c39bf5e8) Reviewed-on: https://gerrit.libreoffice.org/83221 (cherry picked from commit b58225718f1915762d6c74de2ba9865250933c18) Reviewed-on: https://gerrit.libreoffice.org/83243 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-19tdf#128504 save DOCX as ODT: don't color not highlighted hyperlinksTünde Tóth
During DOCX import, not highlighted hyperlinks, ie. without hyperlink character styles, set the Visited/Unvisited character style text attributes to "Default Style" to avoid saving them with the default highlighted hyperlink character styles in ODT. Regression from the commit 576611895e51186d38ddefa10ed8d66075d9de37 "tdf#127741 DOCX import: format hyperlink with Default character style". Change-Id: I95e919a137f1ba85ca85372d5bdb23d958ef33c0 Reviewed-on: https://gerrit.libreoffice.org/82650 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-11-18Related: tdf#128104 extend popup handler to cover all CommandEventsCaolán McNamara
Reviewed-on: https://gerrit.libreoffice.org/80021 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 947150821e985c255f6c802322e696eff4257a5d) Change-Id: I26360ce5c696d0e571385d83a15876eb2286e12f Reviewed-on: https://gerrit.libreoffice.org/82741 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-18tdf#128700 ww8import: no relative width table if made into a flyJustin Luth
This is a partial revert for LO 6.0's tdf#55528 commit e69473539a33da5450d3878999eba7f9bfb9e631 Apparently Word tables can float without a frame, but in LO they need to wrapped in a frame? The relative size is supposed to be relative to the container they are in - so floated tables must not be assigned a relative value - otherwise the tablesize becomes relative to the custom frame that was created to float it. The fix was easy to make, but then trying to figure out whether to test using InLocalApo(), or just m_xSFlyPara took a lot of time. The documentation is sparse and unclear. In the end I settled on ignoring relative width if pFlyFormat exists, since certain conditions can cancel (bNoFly) a FloatingTableConversion. I tested what happens if a real frame is created and then a relatively sized table is dropped inside. I confirmed that relative SHOULD be relative to the frame. That case still works fine since it isn't considered an x_sFlyPara - I think because it actually is a textbox that the table is anchored onto. LO round-trips frame/table as textbox/table. Conclusion: tables inside of frames/textboxes MAY be relative, but if the table itself is floating (a WORD-ONLY feature) then it should not be relatively sized. Change-Id: I2b0bd525051a33b5606b79d2b26665d3edeb5357 Reviewed-on: https://gerrit.libreoffice.org/82647 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit b58b78f5275aedbc8904b8dd5cf2f54919da7c8a) Reviewed-on: https://gerrit.libreoffice.org/82762 (cherry picked from commit e13cebf480373f17c9161f17ebaed0286a72ca1f) Reviewed-on: https://gerrit.libreoffice.org/82818 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-11-15tdf#124986: docx: remove trailing quotation marks and spaces from set fieldsbrinzing
Change-Id: I6390344b72b0148cff8e0ed5150d7abfc9490a2a Reviewed-on: https://gerrit.libreoffice.org/81892 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit fea5c10e222b10d83e0081dc1d1b2e678689d250) Reviewed-on: https://gerrit.libreoffice.org/82629
2019-11-15sw: RTF export: fix invalid RTF for shapes and text framesMichael Stahl
RtfAttributeOutput::OutputFlyFrame_Impl() writes SdrObject into m_aRunText buffer, but for a text frame it writes directly into m_rExport.Strm(), also writing m_aRunText into it in the middle. So if you have both SdrObject and text frame at the same anchor position, first the shape goes into the buffer and then the first part of the text frame is written to the stream before it and the last part after it, and we get this: sw/source/filter/ww8/rtfattributeoutput.cxx:1886: m_aRunText is not empty And Word refuses to open the file with a funny error message about running out of memory. Reportedly this is a regression from commit d53dd70b15f0e3f7c8a05a93f8fcd70e1147c1f7 but really it was broken already in commit a8b59ef5951fe76b0b733ecef739173c1d104f6f. Change-Id: If01465dee71b63531b46c39dd557066f804c425d Reviewed-on: https://gerrit.libreoffice.org/82702 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 4652b911c4376048a452709c953197e1a879a921) Reviewed-on: https://gerrit.libreoffice.org/82736 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-13tdf#124367 DOCX import: fix rounding error in table cell widthsBakos Attila
Follow-up of commit 29cbbad64088354425c606f9eb6c267bdf7731dc (DOCX import: fix rounding error in table cell widths), its revert in commit e502463fa9a601963aa9f5a8783eb1318de36c13 (tdf#123104 DOCX import: fix lack of vertical merge due to rounding) and commit 44e44239de35c1548809c96e13bfa9d64c7ca441 (tdf#120315 DOCX import: fix cells merged vertically). Change-Id: Id85e8fd25dba26af77fe2fd3024db2ae834b5052 Reviewed-on: https://gerrit.libreoffice.org/82072 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org> Tested-by: Jenkins Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/82421 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-13table properties dialog should be modalCaolán McNamara
Change-Id: I3787f6e3a326c1f8e93fc966f890ea2c7cdacc29 Reviewed-on: https://gerrit.libreoffice.org/82550 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2019-11-12tdf#109219 Allow files with spaces in name as MM data sourceMichael Weghorn
The filter needs to be the unescaped file name. Change-Id: I2b5337c184c1ce75595e129d5a87ed4d189ec1e7 Reviewed-on: https://gerrit.libreoffice.org/82201 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 47708d533e1325032df55eb667ef0c47fa05e7e5, plus follow-up fix ef21e0d527655761b6c307cae89ee5b370de96d4 "tdf#109219 MM: Decode all percent encodings in file names") Reviewed-on: https://gerrit.libreoffice.org/82209 Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-11tdf#127921 Revert mouse/key listeners to original stateSamuel Mehrbrodt
The changes caused several issues in the presenter console (mouse events delivered to wrong widgets). Also it turned up that parent windows got the notification about mouse events from their children, but the position was always relative to the top widget, so very unhelpful for the parent widgets. Also I found out that there are XKeyHandler and XMouseClickHandler interfaces which already do what I tried to do with the below commits (events get passed down to parent widgets, and they even can be marked as consumed). So the original issue reported can be fixed by using XKeyHandler/XMouseClickHandler instead. This reverts the following two commits: * "Related tdf#122920 Treat UNO key events the same as mouse events" 9e0e97b716ab074d4558c76a62a66bf597f332a5 * "tdf#122920 Send UNO mouse events to parent window listeners as well" 6f43902b12dd36fa2b69401065df198ef9ffdb09 Change-Id: I005d22770a7a4db9588c5bc22197dc0ae526627e Reviewed-on: https://gerrit.libreoffice.org/82423 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit aadc7ee973c1f28a0e17d551fef6b76e015a28ef) Reviewed-on: https://gerrit.libreoffice.org/82433 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-09partial revert tdf#116071 import to XATTR_FILL not RES_BACKGROUNDJustin Luth
caused by commit 3539a1efb41a787237e4333ebc715db96ffacb5b which fixes table-related regression bug report tdf#128608. I was not able to create a unit test for this from scratch. In fact, if I use MSWord2003 to roundtrip the file, then LO opens it without problems. A real fix (to move LO away from RES_BACKGROUND in tables) should be subject to lots of testing time, so just reverting for now. Change-Id: I328741947b7ed319ff8df0ba169618f6ad0d2c75 Reviewed-on: https://gerrit.libreoffice.org/82339 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 5f0844077d289a257b914f0aad9fd93788f34511) Reviewed-on: https://gerrit.libreoffice.org/82349 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-11-09tdf#125778 docxexport: handle pageBreak before TOXJustin Luth
The pagebreak before the TOX was lost in docx (but not in .doc or .rtf). Change-Id: I280b0bd19a73db180b65a0937bd0fe809e5dfc6f Reviewed-on: https://gerrit.libreoffice.org/81979 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 4ea43e887498f9d78f70b40bcdc53865057a78c0) Reviewed-on: https://gerrit.libreoffice.org/82250 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-11-08tdf#128603 sw textbox: restore shape+frame pair on undoMiklos Vajna
Undo of cut + paste restored both the shape and the frame, but the shape's content pointed to an invalid node index. Later this resulted in a crash. Make sure that in case the content of shape+frame don't match by the time the frame format pointer is set, we sync the draw format to the fly format. (cherry picked from commit dbe744f1deef144e205b72e5927d61a6ea47af25) Also includes: Related: tdf#128603 sw textbox: fix use-after-free (cherry picked from commit 0c49f0f8a16cf3eeb887b6c68213d00bbd56a3eb) Conflicts: sw/qa/extras/uiwriter/uiwriter2.cxx sw/source/core/layout/atrfrm.cxx Change-Id: I233a504ca52698d1c514769d16c256408c29ae30 Reviewed-on: https://gerrit.libreoffice.org/82214 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>