summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2021-04-16Remove some unused includesMiklos Vajna
See tdf#42949 for motivation. Change-Id: Idf7aa9c902b656c05dc7871675c90dae63289815 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114192 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-04-16tdf#134951 docxexport: stop duplicating stuff in postponed textJustin Luth
Certain attributes like comments, fields, and footnotes should not be duplicated when a character run is split by the bPostponeWritingText hack. Only DOCX PostponesWritingText. The comment-with-range is still not perfect, but at least it is not fully duplicated. Best would be to just get rid of the hack? A few more items suggested themselves as belonging to this list, but I don't really know what they are, and no instances of them in this position were found in the existing unit tests. So I just left them as a commented possibility. Change-Id: I950c4250b5f7ed62d63eeff71cabaa10b67dca5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114148 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-04-16tdf#139906 Add an option to change data source from mail merge wizard dialog.Gülşah Köse
Change-Id: I52dfd9be82813a1b01c725eab97a7534ae9a05d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114079 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-04-15NFC sw ww8export cleanup: bPostponeWritingText already trueJustin Luth
if (x is true) set x to true is unnecessary. Change-Id: If94fc4ee4fa97fa8175795959217008264f53d0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114120 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-04-15partial fix tdf100961 doc import: E_Locked field as plain textJustin Luth
The date/time fields should be a const time, not the current, updateable time. This patch throws away the field and just imports the plain text (and paves the way for locking the field as well). A better fix requires a better programmer, one who can take that plain text string and use the formatting information to set the DateTime field to that time. But at least this plain-text date will be better than a completely wrong field date. Change-Id: I8a57ecde64aa670b2205fcf99ed9ae226579c4ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113986 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-04-15store ptr to the original entries in SfxItemPropertyMapNoel Grandin
instead of copying them to a new data structure that is practically identical. Helps startup time since we build a ton of these when loading documents. And use o3tl::sorted_vector as a dense map data structure to reduce allocations and improve cache friendliness, since this is a build-once thing. Change-Id: I950be03b1a21c0c81c40f2677d4215f5e8e256cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114015 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-15sw: avoid rel<->abs URL conversion in SwTOXAuthority::GetSourceURL()Miklos Vajna
Suggested at <https://gerrit.libreoffice.org/c/core/+/114104/2#message-5dce4cbf4bac90d4bad0726e50eb79cca0e40de9>, turns out we can clear the fragment of a relative URL without converting to an absolute one, which is less code and probably behaves better with a not yet saved document (empty base URL). Change-Id: I8cee210aada10a3e8049e5b7a6921f1be4445bb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114124 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-15tdf#141660 DOCX import: fix footnotes of deletionsLászló Németh
Footnotes of tracked deletions resulted exception during import. They don't need redline copying, because the anchor point (the footnote index) is already part of a redline. Note: handle also remaining unhandled w:footnote type "separationNotice", which could result shift of the footnote numbering. Regression from commit 9b39ce0e66acfe812e1d50e530dc2ccdef3e1357 (tdf#76260 DOCX import: fix slow footnote import). Change-Id: I01e06fb25aba4f97cca31b5da34f5a7a3f18a54a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114137 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-04-15loplugin:stringliteralvar look for assignmentsNoel Grandin
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-14loplugin:unusedmethodsNoel Grandin
Change-Id: I9c1c6f27e35a66d8e3623c3ebb1618dceda60e24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113988 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-14IsInput is equal to IsInterrupt, so drop itJan-Marek Glogowski
Nobody is really interested in the reason for the interrupt. And since we already checked IsInterrupt() to get in this branch, mbFormatContentOnInterrupt is always true. Also because we want to finish layouting the current page, especially on Idle, according to commit aa355eeec8c5526c68b17d15192aef94062607d7 ("#i42586# ... - finish format of current page on interrupt."), so must ignore many (all?) IsInterrupt() checks. Change-Id: Ic1d576130a605348a86115ebeb1f016d8163c6f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114095 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-04-14sw bibliography, refer to a page: also de-duplicate relative URLsMiklos Vajna
Relative URLs have to be converted to absolute ones, otherwise INetURLObject can't clear the mark (fragment) part of it. Then convert back, so the document remains portable. Change-Id: Idd9a3de045784a0430c20b689b2b3344b1e92cb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114104 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-14sw: layout dump: sorted_objs of SwPageFrameMichael Stahl
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-14sw define bibliography entry dialog: set browse button visibility based on typeMiklos Vajna
Show the browse button exactly when the biblio entry type is a local file. This needs to always weld the browse button, just not showing it initially in the non-local-file-type case. Change-Id: I8965bb87d0d7c362695b27d5278c0e7b03158e73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114094 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-14tdf#100961 rtf import: fldlock is FIXEDFLDJustin Luth
This depends on another fix in this bug report for exporting. I'm not sure why I even bother trying to work on RTF stuff. I'm not really into black magic. Change-Id: If596cae011a261a80ca13962932bf25561c0f63f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114062 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-04-14sw define bibliography entry dialog: recognize relative file URLsMiklos Vajna
So that in case a file:// document has relative URLs, we show the type as local file (with a file picker), not as "www document". Change-Id: Id7a5d181dc6b2b9e6165d83bd294d7350bd4ce24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114078 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-14tdf#141556 Fix 100% CPU usage in Writer idle loopLuke Deller
Do not interrupt the idle layout processing unnecessarily, because if it is continually interrupted before making enough progress then it will keep resuming at the same page, never finishing, constantly using CPU. This is achieved with two changes: - Revert "tdf#123583 use TaskStopwatch for Writer Idle loop" (commit 383032c50a3e3354f04200ce984a47ab9d2c5c67) which introduced a stopwatch timer to interrupt idle processing every 50ms. This reversion restores the previous behaviour where idle processing is interrupted only when there is an input event. - Filter out TIMER events so that they do not interrupt the idle loop; this fixes both tdf#123583 and tdf#141556 Conflicts: sw/source/core/inc/layact.hxx sw/source/core/layout/layact.cxx Change-Id: Ic989631e5f32199209d64b66b72059253fc0167a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113825 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-04-13tdf#140818 "Default Character Style" -> "No Character Style"Seth Chaiklin
Change-Id: Iba0c7310c5fac08f8fa90ed8eb65e7c9403635b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112311 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-04-13tdf#79591: No need to use getStr hereMike Kaganski
7ea1bbe712cef48a97faffdf03b45f2812a93e62 had abused the C-style strings, and relied on the names containing zero byte to be truncated on the byte. However, that would only work for names with zero bytes, not with other control characters. Additionally, that prevented the initial names from correct round-trip. This reverts the older fix, and makes sure to handle the attributes with zeroes correctly (using memcpy instead of strncpy). It also removes several similar unneeded uses of getStr. Change-Id: I6c52874d99fe9eb9ccbe0c9a9b57e3b51c45a19f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114040 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-13tdf#100961 doc/rtf export: save FIXEDFLD as fldlockJustin Luth
This fixes the 5.0 regression by commit a072b3533f44730565f42b45cfd9f77f44f506a9 fdo#59886 export fixed date and time fields to docx. which fixed it for DOCX, but broke it (a plain text dump) for DOC and RTF formats. We still can't READ fixed fields properly, (there is no impact/regression on import at all) but this at least works for MS Word, and gets us setup for properly importing. Change-Id: I8835fce06233a52f1433f02879196234f1355280 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114061 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-04-13sw bibliography, refer to a page: fix biblio field relative URLsMiklos Vajna
Clicking always requires an absolute URL, so add functionality to get the absolute URL (even if the field has a relative one) and use that when handling a click. Change-Id: I05f8b11937eac7b6032750557f4066181c6e4520 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114059 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-13Missing dependencyMike Kaganski
Change-Id: I6bb96d9be4926e9ea024a2edb5d9b752b37dd2e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114000 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-13sw define bibliography entry dialog, file picker: handle relative URLsMiklos Vajna
On one hand, if we have a setting at tools -> options -> load/save -> general -> Save URLs relative to file system, then let's be consistent and handle that setting here as well. On the other hand, this is the default, so this helps the scenario where a bunch of PDFs are in a directory, a document is next to them, and copying all of them to a different location doesn't break these links. Change-Id: Ic6fc552b656a754b29887915ac35ef5c2390f156 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114049 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-13impress: don't exit textbox editing when new slide was addedSzymon Kłos
When new slide is added by other user before currently visible slide then SwitchPage is called and textbox editing is ended. Avoid any focus change when setPart is called just for rendering or SwitchPage is used on previously avtive slide (only slide numer changed). Change-Id: I7fef42b863e0079acc84dadfc3f891548652b48f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113144 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113806 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2021-04-13No need to use getStr hereMike Kaganski
Change-Id: I11e0210cb4e72c11015b19b3a16d4f705ab3b13b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113996 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-13tdf#132393 sw: disable TabOverMargin layout flag inside sectionsMiklos Vajna
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-12docxattributeoutput: cleanup assert that has served its purposeJustin Luth
tdf#114799. No examples ever found. Change-Id: Id4a87ed12c3f41da93227c8034911b701b256a7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114014 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-04-12sw define bibliography entry dialog: add browse button for file:// URLsMiklos Vajna
- wrap "entry" in the biblio fragment into a "hbox" - audit uses of "entry" and work with "hbox" instead, depending on if the context is a child widget (want hbox) or indeed an entry (want entry) - add a hidden-by-default browse button to that box - add a handler which can edit the AUTH_FIELD_URL entry Change-Id: Ifecc6f1a86be1f609d470535f103c630e45d04cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114013 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-12less copying in SfxItemPropertyMap::getPropertyEntriesNoel Grandin
we can just expose the map now, and avoid copying all the properties Change-Id: Icb22975508582268dfa96e41eb98ac01e7f51317 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113982 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-12tdf#125909 tdf#141298 sw: show (Hidden) Track Changes infobarLászló Németh
instead of enabling Track Changes toolbar automatically, when there are hidden track changes data or settings in the document, i.e. Track Changes toolbar and Show Changes are disabled, but – the document contains (not visible) recorded changes, or – Record Track Changes is enabled (which will result hidden recording, e.g. unintended publishing of the deletions of the document); or – both of them. Messages of the infobar show these cases. Button of the Track Changes infobar allows to show/hide the Track Changes toolbar. Hiding the Track Changes toolbar with button of the Track Changes infobar closes the infobar, too. Regression from commit afbbfb3b55beb937555a972d9edbb47ede91001a "tdf#83958: sw: enable Track Changes toolbar automatically" and commit 1989201c56c03b1ef13a282cfd09af69620040ea "tdf#138870 sw: fix Track Changes toolbar reappearing". Change-Id: I9162102d63d671b412fa0228e6bbfb5c356ee03e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113792 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-04-12svx: prefix members of SdrObjectMiklos Vajna
So that nOrdNum doesn't cause -Wshadow in SwDrawVirtObj::AddToDrawingPage(). Change-Id: Ie7b1401f5c3cb07bfa653c4268dbdce7ba7abea5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113966 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-12update PCHsCaolán McNamara
Change-Id: Id3728ac0011d3deed7e56081e3a854c7fa5336f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113959 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-11ofz#26099 skip slow path when fuzzingCaolán McNamara
Change-Id: Idef5a50733bc4bdef45ea613b4833df0b9d7c9e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113952 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-10tdf#120761 doc import: fix z-order background logicJustin Luth
At first I thought I didn't need to jump past the hell layer, but then a good night of sleep told me I better revisit this, and test a few a my assumptions. Unfortunately, I don't know how to design a test document with the specific order I would need to test this. So I had to settle for proving it on paper. I did confirm that BodyText in the background is still higher than header text in the foreground, so indeed the header is always the lowest position. Change-Id: I2054c8fc3ec1e1e7a211397cebe9aff145d701be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113906 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-04-10cid#1476017 Dereference after null checkCaolán McNamara
Change-Id: Icd991bb20dc3aa96041f6a432bddf1bb2775f371 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113907 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-09sw_layoutwriter: fix assertXisco Fauli
Change-Id: Iddd6271c70bebe0b2b146509f6603e0a43fda4d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113890 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-04-09sw style copy: fix crash when handling a conditional paragraphy styleMiklos Vajna
- "Text body" is normally a conditional style for a full-blown, default SwDoc - SwTransferable::GetData() creates a temporary, stripped down SwDoc, which has a "Text body" style, but it's not conditional - SwDoc::CopyFormatArr() assumes that in case the target already has a style with a given name, then either both the source and destination styles are conditional, or neither - in practice this only causes a crash if the style is customized, as we skip default styles, probably that's why this was not noticed so far The Online case invokes this as part of lok::Document::getSelectionType(), so it was enough to set the paragraph style to Text body and then select some of that text (with a suitable document) to hit this. Based on a patch from Michael Meeks, thanks for that. Change-Id: Ic3c27ec582ae1745469042856254313cbc996ee0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113877 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-09sw doc model xml dump: show if a text format is conditionalMiklos Vajna
Text body is typically conditional, but not always, make it easier to spot this unusual case. Change-Id: I27c63f86c773324b258c6dd7e06097aa857fa9aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113848 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-09tdf#141549 sw: fix ordering of virtual SdrObjects for textboxesMichael Stahl
In header/footer it turns out that not only can the text box be inserted after the shape, it can also be inserted before the shape. This is because SwDrawFrameFormat::MakeFrames() ends up first destroying all the SwDrawVirtObj and then creating them from scratch again, while the SwVirtFlyDrawObj survives. 4 SwDrawContact::DisconnectFromLayout(bool) (this=0x6ed0200, _bMoveMasterToInvisibleLayer=false) at sw/source/core/draw/dcontact.cxx:1664 5 SwDrawContact::ConnectToLayout(SwFormatAnchor const*) (this=0x6ed0200, pAnch=0x0) at sw/source/core/draw/dcontact.cxx:1791 6 SwDrawContact::SwClientNotify(SwModify const&, SfxHint const&) (this=0x6ed0200, rMod=..., rHint=...) at sw/source/core/draw/dcontact.cxx:1521 7 SwModify::CallSwClientNotify(SfxHint const&) const (this=0x6ecfd80, rHint=...) at sw/source/core/attr/calbck.cxx:321 8 sw::BroadcastingModify::CallSwClientNotify(SfxHint const&) const (this=0x6ecfd80, rHint=...) at sw/source/core/attr/calbck.cxx:326 9 SwDrawFrameFormat::MakeFrames() (this=0x6ecfd80) at sw/source/core/layout/atrfrm.cxx:3394 10 AppendAllObjs(SwFrameFormats const*, SwFrame const*) (pTable=0x69c1920, pSib=0x38c6100) at sw/source/core/layout/frmtool.cxx:1349 11 InsertCnt_(SwLayoutFrame*, SwDoc*, unsigned long, bool, unsigned long, SwFrame*, sw::FrameMode) (pLay=0x6be4320, pDoc=0x69af7c0, nIndex=157, bPages=true, nEndIndex=0, pPrv=0x6baedc0, eMode=sw::FrameMode::New) at sw/source/core/layout/frmtool.cxx:1927 Fix this by searching for the existing SwVirtFlyDrawObj in SwDrawVirtObj::AddToDrawingPage(). (regression from 3bc8f90e9693f710f12632f69b9348c1c833c906) Change-Id: Ic00878685ab16018c9331190f1e80f874c1a9a4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113844 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-04-09tdf#120768 doc import: z-order background shapes behind othersJustin Luth
Interestingly, there were NO ww8export examples where a background item was attempting to insert itself after a foreground one. I think GENERALLY the order of shapes in a DOC file format is from bottom to top - and so it just worked by accident. Change-Id: If5226b4ad071455d1e3c30e334676cc5932a1064 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113837 Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-04-09if (x > 0), then there is no need for abs(x)Justin Luth
and the if() was added at the same times as abs(). Sigh. Change-Id: I04431b7f17f92471eb7adcf786c3d14587ce1a01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113780 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-04-09Recheck include/ with IWYUGabor Kelemen
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-04-09tdf#139495 doc import: prevent negative Int forced into uIntJustin Luth
Don't cast a negative number into a sal_uInt16 and expect good results. (ww8import test) But for bug 139495 (and ww8export3), the problem area is also related to pHdFormat->SetFormatAttr(SwFormatFrameSize... which takes an awt::Size which consists of Longs. So they should accept negative numbers. Likely the result is being treated as a uInt somewhere. And a negative height doesn't mean very much anyway. There seems to be a fundamental difference between Word and LO here. Word sets the page margins, but that is irrelevant to the header/footer, which have their own distance from the edge. In LO, the header starts at the page margin, and the body text must follow the header, (In Word, the body text can start above the header, as seen in the ww8export3 unit test.) [FYI: DOC format (since forever) seems to ignore the header size, allowing the content to at least overlap with the body text, but DOCX doesn't have that. Likely this is #112727# using floating frames hack. So I'd better not keep messing around in here.] Change-Id: Ie7bffec8a3de25958cf1f311ff2c8338d4870d99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113681 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-04-09tdf#97569 docxexport: export russianUpper/russianLower numberingJustin Luth
Change-Id: Iad5f5d4687eccc05a63d6a9a4f81cf3f552cb17d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113829 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-04-09remove need for an intermediate vcl::WindowCaolán McNamara
Change-Id: I59f24888e47ec17e46bf651d8530fc9468f16f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113795 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-09sw: prefix members of SwDoCapitalCursorOfst, SwDoDrawCapital, ...Miklos Vajna
... SwDoDrawStretchCapital and SwDoGetCapitalBreak See tdf#94879 for motivation. Change-Id: I0dcb958228003433fe49e24ab6cdce4f3b0e2af7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113822 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-04-08Typos in code with variables containing "inital"->"initial"Julien Nabet
Change-Id: I48205b40b7f9a0b37da3712ae05c49ff4a618db1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113823 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-04-08embeddedobj: fix lost native data when updating it via OLE failsMiklos Vajna
How to reproduce the problem: 1) Create an ODT file which has an OLE object, where the native data is an OLE2 container, containing a Package stream, containing a DOCX file. 2) Install some external application on Windows which registers itself as a handler for the DOCX CSLID [ this is where writing a testcase for this bug is challenging ]. 3) Open this document via Java, using URP. Load the document with Hidden=true and OnMainThread=true. 4) Dispatch .uno:UpdateAll 5) Save the document using XStorable.store() Expected result: the native data is there. Actual result: the native data is sometimes missing (0 bytes). Typically happens at least once if you perform the steps 4 times in a row. The root cause is that GetUserClassID() Win32 API fails in some cases, and re-trying a few times after a small sleep doesn't help. Handle this error better by detecting this situation in OleEmbeddedObject::SwitchOwnPersistence() and reusing the old native data, similar to how svt::EmbeddedObjectRef::GetReplacement() updates the preview image in a transactional way (only delete the old one when we have a one one). Finally, detect a broken OLE2 preview during reqif export, this way the reqif export result's embedded object is editable in Word, while \objdata was simply empty previously. Change-Id: I4dd34ebe6ad892a14cdcfb82acc82d9edf790fb3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113814 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-04-08Removed executable permission on fileAndrea Gelmini
Change-Id: Ifdc17cad2960183ea809eb953311db3135f366c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113796 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-04-08Make test_tdf141166 work also on macOS (where help is ⌘H, not ^H)Stephan Bergmann
However, without the additional 'FOCUS' action, the test would no longer verify the fix for <https://bugs.documentfoundation.org/show_bug.cgi?id=141166> "Crash in: mergedlo.dll: Press "Help" button in Hyperlink dialog", namely 92220638362755f0e776e222fa4e8b79377e75eb "tdf#141166 widget with id 'tabcontrol' might not be a TabControl": At least for a --without-help Linux build, in Window::RequestHelp at vcl/source/window/window.cxx:1897, > else if (!mpWindowImpl->maHelpRequestHdl.IsSet() || mpWindowImpl->maHelpRequestHdl.Call(*this)) the leading `!mpWindowImpl->maHelpRequestHdl.IsSet()` would be true, so the trailing `mpWindowImpl->maHelpRequestHdl.Call(*this)` would not be called and would thus not lead to the problematic call of VclBuilder::get<TabControl>. Change-Id: I35a687834b4eef46b81cc032c2f298ded8490f8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113347 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>