summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
2021-03-24tdf#118693: no need to use convertMm100ToTwip() for line shapes anymoreXisco Fauli
It was introduced in 11129d89b152db54c86bb2bda58c24b8abb6c5a8 < tdf#85232 WPG import: fix handling of line shapes > and later in 36bade04d3780bc54c51b46bb0b63e69789658a5 < tdf106792 Get rid of SvxShapePolyPolygonBezier > ForceMetricToItemPoolMetric was added to SvxShapePolyPolygon::setPropertyValueImpl to convert from 100thmm to twips as can be read in the comment in testTdf85232 With this change, xShape->getPosition().X in testTdf85232 is 2267, which was already in twips Change-Id: I30b757885327a477213f96f8f84541971f435164 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112663 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit c9e5640c8fcad7beb42a66f9bee0252eee9fe323) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112619 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit b393336817a64f8703607d3f6de37d0b6498d49c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112624 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-03-24Revert "tdf#136929 docx export: keep frame with paragraph"Justin Luth
This reverts 7.1 backport 7d90b50285f294a3c9cce0b22399fefe3ab46ee5. because tdf#141173 gives a disasterous example that fails. Change-Id: Ib3700c582c67973f7b0fac0edda6ae4033acc218 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112986 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit b850105570d0e99644ff1ad5d6d0f09734db7952) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112958 Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-03-24Revert "tdf#114076: Expand ClipRange to next PixelBound" ...Xisco Fauli
and "tdf#124272 use ClipRegion's geometry if not a rectangle" This commit reverts c1230cede19ae3633e51c7ca780cb34d9dbaa20f and 362c1cf2bd580f6dc8bf27bdcd79174111bc1b5c tdf#114076, or any of its duplicates, is not reproducible in master if c1230cede19ae3633e51c7ca780cb34d9dbaa20f ("tdf#114076: Expand ClipRange to next PixelBound") is reverted. (Tested on Linux and Windows) So, if we revert it, we no longer need 362c1cf2bd580f6dc8bf27bdcd79174111bc1b5c ("tdf#124272 use ClipRegion's geometry if not a rectangle"), which was a follow-up fix for a regression introduced by the first commit. This also fixes tdf#129085 and all the duplicates, which were introduced by the follow-up commit. I plan to add the unittests in a different commit Change-Id: Ie4328c15b24b521127c1b653bd621bfc92ac39cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112340 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112398 Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com> (cherry picked from commit 8926d9282fe84793ce909471b5caec3583fd3ec9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112531 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-03-10tdf#140597 DOCX import: fix missing tblPrEx borderLászló Németh
of first table cells, caused by the workaround for tdf#138612. Now property set of a new cell is a copy of the table exception property set of the table row, as needed for the import of the table style inheritance. Regression from commit f319d6b543c2367546bc80d138e56ed03731e265 (tdf#138612 DOCX import: fix lost part of split table cell). Change-Id: Iaf6637e757fbfeef7651a4300a7f65a23615f5c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112247 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 53884e8fe92597e909e4fa5599192783c3d31a56) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112223 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-03-10tdf#140674 sw change tracking: fix :emoji: replacementLászló Németh
Regression from commit 2951c96bcb673a260a09e2c6eb92ca0f99bf0c18 (tdf#83419 sw change tracking: clean-up autocorrect). Note: only :snowman: -> ☃ was added to the test autocorrect file acor_en-GB.dat. Change-Id: Ic3013e969ab937a5f9e5b6d1a6fac2f533b541f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112166 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit db999ddee7a890390f66d7e34906066c8bf178da) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112218 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-03-10tdf#133473 Change SDRATTR_SHADOWSIZEX flag.Gülşah Köse
SDRATTR_SHADOWSIZEX holds a percentage value. So we shouldn't use METRIC_ITEM. Change-Id: I9f1a20d5871f60d2899ef7d525f4cf837b0a9088 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111311 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112241
2021-03-09tdf#140661 Give shapes names when ungrouping if they don't already haveJim Raykowski
Change-Id: I8242a697980e4f661a914998792ae9efdb090915 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111725 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com> (cherry picked from commit 1c3e170d56d3cad1e7729f839fa63f607b62e4e3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112215 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-03-09make RenderMaskPrimitive2DPixel() clip using clipping (tdf#140797)Luboš Luňák
The original implementation had this peculiar idea of implementing clipping using transparency, which slows everything down, because contents need to be copied and then alpha-blended. Keep that only for when edges of the clip are to be smoothed. As a side-effect this also seems to fix tdf#115843 again. The commit also adjusts the test for tdf#133477 to not rely on the rounding introduced by the optimization from tdf#115843. Change-Id: Iebae5996159cf9f17066205985c5b591abdae105 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111966 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com> (cherry picked from commit 6b8c157a0b4f37a09fdbf656919b2df06a3abc3e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112217 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-03-04xmlsecurity: improve handling of multiple X509Data elementsMichael Stahl
Combine everything related to a certificate in a new struct X509Data. The CertDigest is not actually written in the X509Data element but in xades:Cert, so try to find the matching entry in XSecController::setX509CertDigest(). There was a confusing interaction with PGP signatures, where ouGpgKeyID was used for import, but export wrote the value from ouCertDigest instead - this needed fixing. The main point of this is enforcing a constraint from xmldsig-core 4.5.4: All certificates appearing in an X509Data element MUST relate to the validation key by either containing it or being part of a certification chain that terminates in a certificate containing the validation key. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111254 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 9e82509b09f5fe2eb77bcdb8fd193c71923abb67) xmlsecurity: improve handling of multiple certificates per X509Data It turns out that an X509Data element can contain an arbitrary number of each of its child elements. How exactly certificates of an issuer chain may or should be distributed across multiple X509Data elements isn't terribly obvious. One thing that is clear is that any element that refers to or contains one particular certificate has to be a child of the same X509Data element, although in no particular order, so try to match the 2 such elements that the parser supports in XSecController::setX509Data(). Presumably the only way it makes sense to have multiple signing certificates is if they all contain the same key but are signed by different CAs. This case isn't handled currently; CheckX509Data() will complain there's not a single chain and validation of the certificates will fail. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111500 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 5af5ea893bcb8a8eb472ac11133da10e5a604e66) xmlsecurity: add EqualDistinguishedNames() Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111545 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 1d3da3486d827dd5e7a3bf1c7a533f5aa9860e42) xmlsecurity: avoid exception in DigitalSignaturesDialog::getCertificate() Fallback to PGP if there's no X509 signing certificate because CheckX509Data() failed prevents the dialog from popping up. To avoid confusing the user in this situation, the dialog should show no certificate, which is already the case. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111664 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 90b725675c2964f4a151d802d9afedd8bc2ae1a7) xmlsecurity: fix crash in DocumentDigitalSignatures::isAuthorTrusted() If the argument is null. This function also should use EqualDistinguishedNames(). Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111667 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit ca98e505cd69bf95d8ddb9387cf3f8e03ae4577d) Change-Id: I9633a980b0c18d58dfce24fc59396a833498a77d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111901 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-04tdf#124678 DOCX export: always write title page in section propsVasily Melenchuk
Even if page description is not set we should try to mark title page because chaining of two page styles can not work for continuous sections. Unittests were implemented previously and were taken from abandoned patch https://gerrit.libreoffice.org/c/core/+/70646 Change-Id: I0b953d72d762f868735dc658f023d96944c9d308 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111757 Tested-by: Jenkins Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> (cherry picked from commit e305289f87ea058cc92ecd83379b848697aa5a80) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111884 Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
2021-03-02Revert "sw_fieldmarkhide: init fieldmark mode from options"Michael Stahl
This reverts commit c0864f26f3143ea81c65d3826fae32a8fd54c531. Revert "sw_fieldmarkhide: toggle mode depending on View->Field Names" This reverts commit c74a2fd835474caf311be10703c985e2f916a83b. Currently no time to fix the remaining bugs, for example tdf#138771 tdf#139638 tdf#139737 Change-Id: I800c5c8df10c02ac8be6234141e7c58d73915cd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111758 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 70dd95aabd11b2146e2556c1da87da4a22d6f7b5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111779 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-03-02tdf#140552 RTF export: fix hyperlink, in footnote, in hyperlinkMiklos Vajna
Regression from commit 7d42346ba77c9c4df241ea40eaf550993ca18783 (tdf#90421 RTF export: ignore hyperlinks without an URL, 2015-04-21), URLs can be nested in the footnote case, which requires a stack. Otherwise the inner URL clears "the" URL and we don't close the outer field as we believe it's empty, so it was not started. Change-Id: I9f87ddbb7e597c413bf836eb9b58beb76722361f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111794 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 5a74baa4f033f84c4bbcec869a68eef149f77161) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111778 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-03-02tdf#140158 tdf#138598 tdf#140598 sw: fix sync of AS_CHAR textboxesAttila Bakos (NISZ)
Textboxes anchored "As Character" fell apart, when typing before some characters or inserting a page break. By fixing that, the tdf#138598 bug also have fixed which was a regression from commit b6850bbe95418ecfde404be1696548f18d200c9b (tdf#106153 sw compatibility: fix textboxes exceeding the page). In addition, tdf140598 is also fixed, which was a regression from commit c96c386c5db45dc4d5e358915caad7474e373068 (tdf#136516 add positioning to SwTextBoxHelper::syncProperty()). Change-Id: Ifeadd8b2055ce52a019d651369ca41185de7bbe3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111338 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111796 Tested-by: Jenkins
2021-03-02tdf#139301 fix OOXML-compatible preset dash stylesLászló Németh
Despite the purpose of the new interoperability styles added in commit b2d8093b19642038631dfb8f1ab6745a380a652c (tdf#127499 added 9 new line styles all are (var) and in line with MSO), collision with commit 57c9bdab377a00649299d1a4c9ed2f9e5e03b84e (tdf#127166, tdf#123903 improve import/export of line styles) resulted still missing interoperability on the user interface: 1) opening an OOXML document, preset styles weren't recognized on the UI, also the preview was a solid line on the Drawing Object Properties toolbar. 2) using the new compatibility preset styles, OOXML export resulted custom styles instead of the intended preset styles. On the UI, now the layout of the first 8 preset dash styles follows the OOXML standard, see 20.1.10.49 ST_PresetLineDashVal (Preset Line Dash Value) in ISO/IEC 29500-1, 2016: dash pattern name (OOXML name) 10 "Dot" (sysDot) 1000 "Long Dot" (dot) 1110 "Dash" (sysDash) 1111000 "Long Dash" (dash) 11111111000 "Double Dash" (lgDash) 11110001000 "Long Dash Dot (dashDot) 111111110001000 "Double Dash Dot" (lgDashDot) 1111111100010001000 "Double Dash Dot Dot" (lgDashDotDot) (Note: missing "Dash Dot" (sysDashDot) and "Dash Dot Dot" (sysDashDotDot) were added only in the master, but not in this back-port, yet, because the commit would contain new translatable strings: 111010 "Dash Dot" (sysDashDot) 11101010 "Dash Dot Dot" (sysDashDotDot)) Remove "Double Dot": it really wasn't an OOXML-compatible preset style, and it has a good replacement among the older styles, the similarly loosely dotted "Fine dotted", which is still supported for back-compatibility. Note: to start the new UI test, use $ (cd sw; make -srj8 UITest_writer_tests7 UITEST_TEST_NAME="tdf139301.tdf139301.test_tdf139301" SAL_USE_VCLPLUGIN=gen) (cherry picked from commit 183c06fc02a50fb117bb6162e4d6e56cdd34fad1) Change-Id: I7f7cf6ea954aad4cb43ef7730b204ed7635f8fb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110403 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-03-01tdf#140668 Crashfix: disregard w:textDirection tag outside frameDaniel Arato (NISZ)
DomainMapper_Impl::SetFrameDirection had a false assumption that a w:textDirection tag will only be encountered when the OOXML parser is already inside a frame. This is not always the case. Regression from commit af4e5ee0f93c1ff442d08caed5c875f2b2c1fd43 (tdf#97128 DOCX import: fix frame direction). Change-Id: I39845599b0c7f502870e2de497df8cbdd4475594 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111594 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111754
2021-03-01tdf#136570 OOXML import: fix height of OLE objectsAttila Bakos (NISZ)
e.g. OLE icons or math formulas by skipping unset border properties. Regression from 636d16efe45a55c1a5a7a451c46fbb8618bf0393 (tdf#135653 OOXML import: fix OLE background color). Change-Id: I64bd68037d063de81fbb302b90d65b77af50a622 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111119 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit ca7855c24af858f52a11a593761ee9e6b9d6ba79) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111581 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-03-01tdf#140137 Don't throw exception when w:gridCol is missing "w" attrAron Budea
2149e924cbc32c370128c5f87a4f55c50c99e6bd added a division-by-zero check, which caused Writer to throw an error on the bugdoc. Since the file could be loaded fine before, let's return to a working version, with the check included. The cause is the following in document.xml (originating from a non-MS generator): <w:tblGrid> <w:gridCol/> <w:gridCol/> </w:tblGrid> Word still splits such tables differently, but that difference was always there in Writer. Change-Id: I6d91a736f460394a76f035298a238c41da201cb3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111723 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111736
2021-02-27tdf#140528 Crash in writer when switching from Numbering to PositionNoel Grandin
regression from commit e5ecb998fd78137aec32ad2cc996eaa4bb3e499d Date: Mon Dec 5 09:52:43 2016 +0000 avoid coverity#1371269 Missing move assignment operator rather write this code in a more obvious fashion, and bypass the use of the very weird operator= method, which barely copies anything at all. Change-Id: I548d8f73224c2625ed6389861551038b18396b0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111677 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 9ab2284660857f52efc9b68b9d2dd8ea768d6916) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111695 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-26tdf#134940 sw: fix AutoCorrect of arrow "-->"László Németh
Fix bad replacement of "-->" with "–>" instead of "→" (i.e. premature replacement of "--" to n-dash) since '>' was added to IsAutoCorrectChar(). Regression from commit 57f07b1d7378d218648667c5b1315cc8ad905875 "tdf#133524 AutoCorrect: support double angle quotes". Change-Id: I06f0cddb48d13c8e230dab964f79f588799ed4ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111527 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit d1be3d80d0ca5ccd7639ede379a1befc48dc73f2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111579 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-02-26tdf#140572 writerfilter: ignore position in docDefaultsJustin Luth
Despite the documentation saying that anything in docDefaults should apply everywhere unless it is overridden in a higher priority style, the subscript/superscript setting in docDefaults seems to be ignored. Makes sense in a way, but perhaps document those exceptions? I looked for documentation in both "docDefaults" and "position" and didn't see anything suggesting why it is ignored. Change-Id: If676415b112921e4cb8f7306b8c8ad93a6fd8cde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111442 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 861ca1f5030f2f6b7fbdc3bb3ded3d11130673ed) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111463
2021-02-25tdf#140572 docx export: avoid DocDefault superscript crashJustin Luth
This fixes a crash situation introduced in LO 6.4 by commit d71cf6390a89ea6a4fab724e3a7996f28ca33661. The crash was occurring when the DocDefaults were being exported. Since there was no character or paragraph context, the lookup of the related fontsize was crashing. Moving this variable closer to where it is used "just happens" to fix the crash. Because the DocDefault is considered a style, we are just exporting the superscript/subscript as a default size, and so don't need to know the font size. Thus a style-context position can't cause the crash again. So it isn't a great fix, and leaves the possibility for the same thing to happen in other situations (like RES_CHRATR_BACKGROUND), but at least it quickly solves this known problem, and is easily backportable, as well as following best practice of keeping variables as close to where they are used as possible - eliminating some unnecessary lookups. I did look for a more generic fix (or whether other properties could be affected) and didn't come with any clear examples or a better fix. Change-Id: I03dc3d74a5148973c065cadb09c5c79068f12df1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111403 Tested-by: Jenkins Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 76d2a9fd461dde817fbb1c5d4aa830cb2c42b504) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111457 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-02-24tdf#140397 make contenttoggle button visible again in all backendsJim Raykowski
fixes regression introduced by commit b80c2745c50d064ad9e673cf8a5b73aaf0aa1778 Change-Id: Ib93a0c1b203f399f4f64681aac8e1f76509bcc63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111439 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com> (cherry picked from commit 2b8ce3d62b71ca91df464e26ccc6c6c79d6c886f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111454 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-02-17tdf#140387 grab focus to first panel widget on panel gaining focusCaolán McNamara
otherwise focus is getting lost in these currently mixed vcl+gtk widget panels. Change-Id: I6488ddfc98afdedb55bb3217f3877e96258dd65a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110956 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-02-11tdf#140257 duplicate entire PaM ring when making copyCaolán McNamara
tdf#134439, tdf#135636 are the motivation behind copying the PaM, but multiselections require multiple PaMs Change-Id: I9f95eb6c62ac0e61053298d4e4dbe386f5686275 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110681 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-02-10tdf#139529 Fix incomplete DisplayName property for table stylesMaxim Monastirsky
Commit 4dc823990ab217cb9d07a0555d3015d43380fdf5 ("tdf#107852 Support DisplayName property for table styles") only handled the getPropertyValue method, which isn't enough to make it work with introspection, as used from Basic or the new dev docking panel. Change-Id: Ia4d90ab6030585dc469c0b274bef4b988ce647c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110468 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> (cherry picked from commit 9933c3631b5bd9d7b47d0d12c5a7dd292cf1944f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110568 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-02-08tdf#134619 docxexport: don't skip font properties in NumberingLevelJustin Luth
This partially reverts LO 6.4.5 commit 598ca431de96d8bfcf18fa2945e9e30f98387474 The output set can contain more than just the font name. Things like colour and fontsize were being lost when the "else" clause was added. Since it looks like the main intent of the else clause was to avoid specifying a font name twice, erase that from the property set before writing out the rest of the font properties. There is a unit test that enforces that. (I was not able to reproduce the original problem that this was trying to fix. The entire commit is hard to revert, and I will assume that the rest of the commit is useful/accurate, so just fix up a careless portion of the commit.) Change-Id: I772e40e8bd75c0589f3308d4d7470229855aed8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110034 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110169 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-02-08print struck-through 'deleted' comments with change-tracking enabledCaolán McNamara
in print comments in margins, the strike-through lines were missing in the print out previous to this Change-Id: I7f7f06d29b5f035a1e4996e1d89ce2b198b7a15c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110444 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-02-03tdf#138870 sw: fix Track Changes toolbar reappearingLászló Németh
on Save automatically. Now force enabling only on creating a new View instead of depending on the state of document modification (which is "unmodified" after saving the document, too, not only on load). Follow-up of commit afbbfb3b55beb937555a972d9edbb47ede91001a (tdf#83958: sw: enable Track Changes toolbar automatically) Change-Id: I8e074dadc4ec1280924ef88f589302c9e8dfc6e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110278 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 28d65bb877c193b3fa53a038f3b896e4ba2f7ee4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110294 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-02-01don't scroll to cursor during GetSurroundingTextCaolán McNamara
lock against scrolling to cursor if the IM requests the surrounding text around the cursor seen on launching a menu from a sidebar comment's menubutton in writer if the cursor is a scroll-off page position in the main document Change-Id: I325004987f576df65188629bf6fb63e0ed0be9bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110135 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-01-29sw: fix SwTOXMgr::UpdateOrInsertTOX() for user-definedMichael Stahl
The main problem is that when editing an existing user-defined index, the "Create From" changes aren't applied, because it does pCurTOX->SetCreate() and not pNewTOX->SetCreate(). But that wasn't obvious as the function is obviosly very confused about its 3 different TOX variables. pTOX is just used at the end, so just move it there. pCurTOX can be const. Then there is an odd condition on pSh->HasSelection() which ends up doing DelRight() but fortunately it's dead code since commit e9da29679bce3b544add9233a4aca2b19b78da1a #i97572# cleared the selection already. The pNewTOX = pCurTOX there seems pointless because pNewTOX is already a copy of *pCurTOX. Change-Id: I1e9c8178e314a188a50272410fbe566e4a566742 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110021 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 960e88835e0b2f7ff5fc57393b74017198c314e3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110063 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-28sw_fieldmarkhide: adjust SwPaM::HasReadonlySel() to the fact that...Michael Stahl
... there is, in fact, an else branch. D'oh. (regression from f8da730bd66d5d6d3e49935573b3223c06baffbe) Change-Id: I378b0a78a4ccc9a0e7fa9a6bf2e1ecb456133bed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110012 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit e65376ecd6e4356686927a5daeb845faf1fc4a42) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109985 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-27Fix errors in produced JSON introduced with the switch to JsonWriterTor Lillqvist
GetRedlineAuthorInfo() should produce a JSON array and not an object with empty strings as keys, which is incorrect JSON. The code in Collabora Online expects an array, see Document::getViewColors() in kit/Kit.cpp. Producing the wrong kind of data leads to Poco throwing an exception: Assertion violation: !_key.empty() [in file "src/ParseHandler.cpp", line 64] Also SwXTextDocument::getPostIts() should produce a JSON array. Change-Id: I1ab0653ca1eaa3c466d31b1f068ba5937a04e43e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109316 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109475 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-27tdf#139147 sw outline UI: allow clearing of custom list formatJustin Luth
Since LO 6.4.5, primarily for DOCX support, numbering can have a custom format that ignores the suffix, prefix etc. Well, the UI has no way to see or edit that. So allow the UI to throw that away and go back to the normal prefix/subLevels/suffix model. Change-Id: I84f93d37c95dabb18facf9140bf8f85b4bac5006 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109839 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de> Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 55933f49f5a04708d27dc69e8778ec126646e3a5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109975 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-01-26tdf#134605 DOCX export: fix unexpected loss of footer marginMiklos Vajna
Regression from commit 51534ac2b9747975945acb6a1e1ba5cc6d73f5c2 (tdf#127778 DOCX import: fix unexpected heading on non-first page ..., 2020-05-11), which replaced an import fix with an export fix. What was missed there is the import fix handled both headers and footers, while the export fix only handled headers. Fix the problem by doing the same mapping for footers: if a follow page style has no footer, but the first page style has, then take the margin from that one. The import side did the opposite of this already. (cherry picked from commit 80b360085f5974fbb3abe49a88b20f4d39704fb5) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport16.cxx Change-Id: Ibb191db4136bce0ad5e4bf14dcea15f5955bd298 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109933 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-01-25tdf#121669 ww8 export: use the "we have equal columns" flagJustin Luth
If the columns are marked as AutoWidth, then there is no need to go to the remarkably poor layout code to determine if the columns should be exported as equal. In this case, it appears as if the layout engine hadn't really identified the full width, or evaluated the wish values of each column. This fixes DOCX, DOC, and RTF. Change-Id: I1a1193b65d01e654b3bfbfaee7d8c02a683ae2c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109762 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 9e41002701285dc89a4dc8c91619a51071995172) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109811 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-01-25Revert "sw: DOCX export: don't export numPr to style from outline numrule"Justin Luth
This reverts 7.1 commit 9e455724e50bf512683b1cddfeb7493e047c19ae. to fix regression bugs tdf#138780 and tdf#139089 Change-Id: I2a5bbcd990a6648667342cc989160582e0367f09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109864 Tested-by: Justin Luth <justin_luth@sil.org> Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 32d11fb200d45cdacb973b625488d0b8bbee6d81) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109872 Tested-by: Jenkins
2021-01-25tdf#138899 DOCX import: fix removing last para of sectionLászló Németh
Fix regression from commit 39090afac268f9ae985832c2f08863b41e6c06f2 (tdf#120336 DOCX import: fix page break after tracked deletion), limiting the condition only for *empty* section starting paragraphs with tracked deletion. Change-Id: I020c8b0edf5d4a37a9150cccec8c25fce50327d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109779 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit b7ca9576c26ed258537134c0cf2944cfcfc65f2e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109799 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-01-22tdf#135590 MapUnit::Map100thMM fallback is inappropiate for writerCaolán McNamara
which uses MapUnit::Twip so directly after insert, envelope, ok the new document sidebar was using MapUnit::Map100thMM to lookup paper sizes instead of MapUnit::Twip giving inconsistent results against format, page Change-Id: I6a92fddedfe9fef8ad7532ad00b2b38b9741bb69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109751 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
2021-01-20tdf#135377 keep the correct index selectedCaolán McNamara
Change-Id: I8737b64300e4bb3a3441c1ec43620b2acea31d2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109588 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-01-20sw_fieldmarkhide: allow editing all fieldmarks if ...Michael Stahl
ForceImportWWFieldsAsGenericFields is set. Not sure what restrictions it needs. Change-Id: I8b8e61fb320d5c2b66d5ff332517759b53e68817 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109378 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit f8da730bd66d5d6d3e49935573b3223c06baffbe) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109518 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-01-20tdf#135014 sw_redlinehide: fix missing frames when removing fieldmarkMichael Stahl
A fieldmark was deleted. UpdateFramesForRemoveDeleteRedline() deleted the MergedPara but its start node was before the start node of the fieldmark, and then MakeFrames() didn't find a frame on the preceding node and did nothing. Similar problem likely possible with redline. Change-Id: I532f9a67c0268f3287736a61da4cc9fefec7b8e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109307 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 32e104c1d6be0ffe6ed6c4e08af868c87b3c258c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109346 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-01-20tdf#135014 sw_fieldmarkhide: fix crash deleting field in flyMichael Stahl
SwUndoDelete calls DelContentIndex(), which calls SwUndoFlyBase::DelFly(). This calls DelFrames() first and then SwUndoSaveSection::SaveSection(), so by the time UpdateFramesForRemoveDeleteRedline() runs for the fieldmark in fly it's expected that there are no more frames. Also, don't try to recreate fly frames in this situation; it will crash when resetting the RES_ANCHOR. Change-Id: I11f6fb011d84e96f77b93ffbd1b5904594cbc591 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109306 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit eef10be20a4c5108c68b19ccdda263c5ca852386) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109345 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-01-20tdf#135014 sw_fieldmarkhide: allow section overlap with fieldmarkMichael Stahl
In this bugdoc it happens that the field with instruction "\aINDEX \\c \"2\"\\h \"A\" \\e \"\t\"\003\063 " result end is on a node following the start of a section, so sw::mark::FindFieldSep() asserts. In this case it looks like the section was wrongly set by the import, but experimenting with Word reveals that it will respect sectPr on a paragraph inside a field, so i guess we need to cope with that. Also adapt InsertCnt_() to skip the section end node. Change-Id: I5517d463de43b04bf773528a28de12123e534069 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109305 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 359deaee45fd4a2bfe7aae255e6da38a9e1931ff) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109344 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-01-20tdf#135014 sw_fieldmarkhide: fix bogus assert on loading the bugdocMichael Stahl
The == case was omitted, iirc because of changing the first compare at the last minute. (regression from aacaa2aa91f705d64b929b5cff2872f160021b9f) Change-Id: I03602917def8248150139d788c880d93cab18bf1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109304 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 0771b84e4c5002338275da0d061f966e2fc47505) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109343 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2021-01-19tdf#119610 tdf#112634: Don't show broken connections - RevBJustin Luth
This changes LO 6.0 commit 75a881829f19439245cdb859fc16d59461992f79 to use a light-weight check to see if a database exists. The previous way made a connection, which is extremely expensive if there is a password, or if network traffic needs to timeout, etc. And if there are multiple registered databases like that... Change-Id: I980cb6979cfc7cae8f1251f3459718192459aaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109242 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 647c9de0338350c1b5eff4b9adf08bd06930e36b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109402 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-01-19Resolves tdf#139521 - Hide image anchor option in Writer Web modeHeiko Tietze
Change-Id: Ic5298069fcabbd2c72eb43fdf270b69c53570298 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109523 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-01-18tdf#136704 sw autofmt: prevent crash if no nextNodeJustin Luth
The second GetNextNode() was a nullptr that was being dereferenced. Now, when enter is pressed after some text followed by a colon, that line is made into a heading3, and the new blank line is properly using the text body paragraph style. Change-Id: If10dc85e490ac57fc150b3d541f5033dfd5293bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109413 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit fea7b531a4c9e8326a644cccc26325b16585675a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109519
2021-01-15tdf#138897 sw: avoid creating SwUndoResetAttr in CopyImplImpl()Michael Stahl
The problem is that SwTextNode::CopyCollFormat() both creates the SwTextFormatColl with undo and applies it with undo. The first is desirable, the second causes a problem because it necessarily happens after SplitNode() and currently happens before copying the non-start/end nodes, so the node-index may not match in Undo, regardless if it runs before or after SwUndoCpyDoc. But SwUndoInserts restores the SwTextFormatColl on the node itself, so it can just be suppressed, which looks easier than refactoring this to call SplitNode() with Undo enabled. (regression from b4365b985178e1866c74afd757a104aad1d405a9) Change-Id: I4d15fb88cd5ae4cc53d9afb3397dec8fcf7635fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107921 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109329
2021-01-15tdf#134101, tdf#134626 sw: fix UBSan warning about deleted SwTextFormatCollMichael Stahl
sw/source/core/txtnode/ndtxt.cxx:5254:17: runtime error: downcast of address 0x612000a321c0 which does not point to an object of type 'const SwTextFormatColl' 0x612000a321c0: note: object is of type 'SwFormat' 00 00 00 00 50 4c 3c fa bb 7f 00 00 80 b8 ba 05 50 61 00 00 c0 81 5f 02 20 61 00 00 c0 b6 b0 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'SwFormat' 0 in SwTextNode::TriggerNodeUpdate(sw::LegacyModifyHint const&) at sw/source/core/txtnode/ndtxt.cxx:5254:17 1 in SwTextNode::SwClientNotify(SwModify const&, SfxHint const&) at sw/source/core/txtnode/ndtxt.cxx:5306:9 2 in SwClient::SwClientNotifyCall(SwModify const&, SfxHint const&) at sw/inc/calbck.hxx:161:80 3 in SwFormat::~SwFormat() at sw/source/core/attr/format.cxx:240:22 4 in SwFormatColl::~SwFormatColl() at sw/inc/fmtcol.hxx:35:26 5 in SwTextFormatColl::~SwTextFormatColl() at sw/inc/fmtcol.hxx:56:20 6 in SwTextFormatColl::~SwTextFormatColl() at sw/inc/fmtcol.hxx:56:20 7 in SwDoc::DelTextFormatColl(unsigned long, bool) at sw/source/core/doc/docfmt.cxx:983:5 8 in SwDoc::DelTextFormatColl(SwTextFormatColl const*, bool) at sw/source/core/doc/docfmt.cxx:991:5 9 in SwUndoTextFormatCollCreate::Delete() at sw/source/core/undo/SwUndoFmt.cxx:203:12 10 in SwUndoFormatCreate::UndoImpl(sw::UndoRedoContext&) at sw/source/core/undo/SwUndoFmt.cxx:61:9 11 in SwUndo::UndoWithContext(SfxUndoContext&) at sw/source/core/undo/undobj.cxx:235:5 Any SwUndoFormatCreate that is added during CopyImplImpl() must go before SwUndoCopyDoc on the undo stack. SwNodes::CopyNodes() is pretty much the only thing of substance there that runs with Undo enabled; CopyBookmarks() and lcl_DeleteRedlines() and CopyFlyInFlyImpl() have it disabled. Let's see if the fix is really this simple... Change-Id: I4d586923f91a02861e9a4bd40d22701ceb0a0499 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107522 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit b4365b985178e1866c74afd757a104aad1d405a9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109333 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-01-15tdf#135014 sw: fix crash exporting numbering to DOCXMichael Stahl
It can happen that the default SwNumRule of a SwList isn't used by anything directly, but there are other SwNumRule associated with that SwList and then the DOCX export needs to export it as an abstract numbering definition. (regression from 632ee9aae6d5f3cf08b6d6b2789310c20db713b7) Change-Id: I6b1851980464aaa95bf731a60b7d11ab91cec7b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109303 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit cd1c9f5167e797807d6726219f06190657f58372) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109334 Reviewed-by: Caolán McNamara <caolanm@redhat.com>