LibreOffice.git
3 months agoVersion 7.3.3.1, tag libreoffice-7.3.3.1libreoffice-7.3.3.1
Christian Lohmaier [Tue, 12 Apr 2022 19:18:22 +0000 (12 21:18 +0200)]
Version 7.3.3.1, tag libreoffice-7.3.3.1

3 months agobump product version to 7.3.3.1
Christian Lohmaier [Tue, 12 Apr 2022 19:18:09 +0000 (12 21:18 +0200)]
bump product version to 7.3.3.1

Change-Id: I67bf4b3df1bb88155d77bd7a35f995a5c8421ee3

3 months agoBranch libreoffice-7-3-3
Christian Lohmaier [Tue, 12 Apr 2022 19:15:21 +0000 (12 21:15 +0200)]
Branch libreoffice-7-3-3

This is 'libreoffice-7-3-3' - the stable branch for the 7.3.3 release.
Only very safe changes, reviewed by three people are allowed.

If you want to commit more complicated fix for the next 7.3.x release,
please use the 'libreoffice-7-3' branch.

If you want to build something cool, unstable, and risky, use master.

3 months agotdf#147876 Fix crash when cancelling Dialog import dlg
Samuel Mehrbrodt [Fri, 8 Apr 2022 13:59:11 +0000 (8 15:59 +0200)]
tdf#147876 Fix crash when cancelling Dialog import dlg

Regression from 9a55b97e980bbf2a0ce12841f6168f1f7545ac96

Change-Id: I3fc35981a0cb81e5b59236ec3b07450aec10541a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132737
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
(cherry picked from commit 618d40799d25474c48d984ce1d52b0f08f220958)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132855
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
3 months agoUpdate git submodules
Christian Lohmaier [Tue, 12 Apr 2022 18:38:38 +0000 (12 20:38 +0200)]
Update git submodules

* Update translations from branch 'libreoffice-7-3'
  to d843f8419c9d76baeeeed4700c70ed225ca3f8ce
  - update translations for 7.3.3 rc1

    and force-fix errors using pocheck

    Change-Id: I6f710c70cb05b213a474cc705541d2558c2304dd

3 months agounit test: use temp copy in testInvalidEntrySave()
Dennis Francis [Tue, 12 Apr 2022 05:13:00 +0000 (12 10:43 +0530)]
unit test: use temp copy in testInvalidEntrySave()

Use a temporary copy of the source file to run this test otherwise it
will execute a .uno:Save on the original document in the git tree!

Change-Id: I673aad64453e72a9140efcad2b0ff9c0ceabc038

3 months agolok: unit test for invalid entry save
Dennis Francis [Thu, 7 Apr 2022 07:44:59 +0000 (7 13:14 +0530)]
lok: unit test for invalid entry save

Unit test related to the fix

lok: avoid validation-dialog yield when saving
e0175ee821eaff56c4b8e0a1b7afa1cabe0ab593

The test ensures that the document is marked unmodified after save has
been executed in the middle of entering partial data to a validation
cell.

Conflicts:
sc/qa/unit/tiledrendering/tiledrendering.cxx

Change-Id: Idffd6d647034e128d0d800fe8e29efc333c03db6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132657
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
3 months agolok: avoid validation-dialog yield when saving
Dennis Francis [Fri, 1 Apr 2022 09:20:42 +0000 (1 14:50 +0530)]
lok: avoid validation-dialog yield when saving

Disable error dialog box when about to save in lok mode as this
ultimately invokes SvpSalInstance::DoYield() when we want to save
immediately without committing any erroneous input in possibly a cell
with validation rules. After save is complete the user can continue
editing.

Conflicts:
sc/source/ui/app/inputhdl.cxx

Change-Id: Iffa0766ad594db75f57158986c4e1d2646f71da4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132410
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit e0175ee821eaff56c4b8e0a1b7afa1cabe0ab593)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132656
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
3 months agoClean up unused translatable strings
Adolfo Jayme Barrientos [Thu, 24 Mar 2022 07:02:52 +0000 (24 01:02 -0600)]
Clean up unused translatable strings

These icon themes no longer exist, and these items are ignored anyway
since the list was made dynamic in tdf#63962, back in 2014.

Change-Id: I5a4dd5001b449f94775447f22b726b99a4fe63ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132025
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
(cherry picked from commit 19c215e948678c5c8809df6ce8052122b32c97d8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132037
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
3 months agotdf#148491 Qt reconnect the QMenuBar close button
Jan-Marek Glogowski [Wed, 6 Apr 2022 14:42:24 +0000 (6 16:42 +0200)]
tdf#148491 Qt reconnect the QMenuBar close button

When the QMenuBar of a QMainWindow is replaced, an existing
corner widget is preserved / transferred, but its connections
are still severed; a bit unexpected...

The documentation for QMenuBar::setCornerWidget is not really
clear what is happening, but the code has this nice comment:
"// Reparent corner widgets before we delete the old menu".
At least there is no need to explicitly delete the button.

Still we must reconnect an existing button on each SetFrame.

Regression from commit 9c4ef8ce3183e27ca174475cf4a8d15cc0368f60
("tdf#145954 Qt unshare QMenubar usage").

This includes commit 4a537cf77affc4f1f2e2e5be9ff0b1ff11724509
("Qt drop unused QtMenu::mpCloseButton").

Change-Id: I13c31734e665b78231a08cd76ca6305122e08879
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132836
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit f751417b77e6573a0c639778e76ec943449f4573)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132894
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
3 months agoan inconsistent SwTextFormatInfo index, len, text length case
Caolán McNamara [Fri, 11 Mar 2022 21:47:43 +0000 (11 21:47 +0000)]
an inconsistent SwTextFormatInfo index, len, text length case

seen on loading sw/qa/python/testdocuments/TESTMETA.odt

maybe since:

commit 2f3684b2289a8c46dc6144064a452cc529400f28
Date:   Tue Jul 31 16:00:02 2018 +0200

    [API CHANGE] add some more asserts to the string functions

but probably an underlying issue since conversion from UniString
to OUString

Change-Id: If731163fbc5e05b813ccd21df65164fe476cba9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131361
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agoofz: Use-of-uninitialized-value
Caolán McNamara [Tue, 12 Apr 2022 07:45:23 +0000 (12 08:45 +0100)]
ofz: Use-of-uninitialized-value

Change-Id: I87cfad2da9b90bc4487dc4deb2fda5bb31a6b763
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132856
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agotdf#148423: Half a hack
Stephan Bergmann [Fri, 8 Apr 2022 13:05:50 +0000 (8 15:05 +0200)]
tdf#148423: Half a hack

"Regression" introduced with de4d296619b978ec303f1d7b1e2c78e13fa7a512 "Avoid
overflow in ScColumn::GetOptimalColWidth", which, for this bug document's
nWidth/nPPTX = 6004/0.0647708 = 92696.1, changed the calculation of nTwips from
the undefined-behavior 92696 % 65536 = 27161 to the clamped 65535, but which is
apparently a value large enough to cause "silent" issues (i.e., not causing
further undefined behavior) down the road, leading to a super-narrow column.

That commit already wondered whether sal_uInt16 is a useful choice here, but
lets keep that question unanswered and just clamp at half the previous value,
which happens to cause presumably more pleasing results.

Change-Id: I1df642b2b9d6818c8be0f8d8f4567a00c399c154
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132734
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 126b1826c465002dccc7c354a584731fa70ec5fd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132708
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agotdf#148481 Map RefHand cursor to Qt::PointingHand
Jan-Marek Glogowski [Mon, 11 Apr 2022 15:07:36 +0000 (11 17:07 +0200)]
tdf#148481 Map RefHand cursor to Qt::PointingHand

Change-Id: I79c7008655f22737f92a4a6430f1380e81c1c386
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132833
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
(cherry picked from commit 9ae398054833120df36bf51738cc4cfd7efb3fdc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132713
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 months agoofz#46526 Abrt
Caolán McNamara [Sat, 9 Apr 2022 08:56:23 +0000 (9 09:56 +0100)]
ofz#46526 Abrt

Change-Id: Iaec536b0989c4ec11b39b1534c7798e46715d7a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132704
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
3 months agotdf#95706: RTF import: tolerant font table parsing
Vasily Melenchuk [Thu, 7 Apr 2022 17:59:08 +0000 (7 20:59 +0300)]
tdf#95706: RTF import: tolerant font table parsing

While font name in font table should end with semicolon
({\fonttbl{\f42 Arial;}}) it is not always true and
MS Word is tolerant to it: it still able to parse this
correctly. Seems LO also should not require strict spec
conformance.

So idea of font parsing is changed: instead of inserting
font on semicolon, it is done on next \fN or destination
end. All collected text to this moment is a font name.

Change-Id: I6b41951217442a71fd2ebbfc58a3fc79f6f913db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132686
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 844be7358f1eec00094a55fa1fb4fadadb8cd1bf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132699
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agoRelated tdf#148384: do not pause after last email's failure
Mike Kaganski [Tue, 5 Apr 2022 18:50:30 +0000 (5 21:50 +0300)]
Related tdf#148384: do not pause after last email's failure

In this case, SwSendMailDialog::AllMailsSent will keep the dialog open
anyway, to allow to see the resulting report containing errors.

Change-Id: I351a5da01c3ab50677be1d735b261d8e5516cb43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132588
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 6453502fa8d3cc83e066c550d8df98facb1f4471)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132605
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 months agoResolves: tdf#148052 accept a ". Month " name for matching DMY format
Eike Rathke [Fri, 8 Apr 2022 19:46:47 +0000 (8 21:46 +0200)]
Resolves: tdf#148052 accept a ". Month " name for matching DMY format

... even if the locale doesn't define such DM order or
LongDateDaySeparator.

Change-Id: I4bef720dff3582de9b60313824a84b570c153e98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132741
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 7a16002ede5fd31ae8f3358136ad49de40465ac1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132703
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 months agotdf#141578 Qt handle QtFrame screen changes
Jan-Marek Glogowski [Wed, 6 Apr 2022 23:07:43 +0000 (7 01:07 +0200)]
tdf#141578 Qt handle QtFrame screen changes

LO doesn't provide any way to notify screen changes / scaling
factors of a window and in fact doesn't really handle scaling
factors in VCL. The QWidget doesn't receive a resize event,
because it's size doesn't change, just the scaling factor.
So we trigger a faked resize on QWindow::screenChanged signal.

Change-Id: I6928c4c62d1c0995c70fea0088cff17849bcd1d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132650
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
(cherry picked from commit 881cfbf77567194f5016a961d1c3db869734d68b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132740
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
3 months agotdf#95706: RTF import: Use fontname suffixes to detect encoding
Vasily Melenchuk [Tue, 5 Apr 2022 16:13:05 +0000 (5 19:13 +0300)]
tdf#95706: RTF import: Use fontname suffixes to detect encoding

Font names like "Arial CE", "Times New Roman Cyr" are not special
fonts. They are classical Arial, Times New Roman... And these
suffixes can be used to detect encoding used for RTF text.

Most interesting: for MS Word these suffixes have priority:
{\f34\cpg1253\fcharset161 Arial Baltic;} will have cp1257
and not cp1253.

Looks like compatibility issue came from dark ages.

Change-Id: Ife8e781d5d04c3f6a8c11fcf604357c74bf33055
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132584
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132681
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agosw: keep URL when applying frame style on images
Miklos Vajna [Thu, 7 Apr 2022 14:59:32 +0000 (7 16:59 +0200)]
sw: keep URL when applying frame style on images

It seems that the intention is to reset properties which are possible to
set in a style when applying a style. For example the paragraph
alignment can be defined in a paragraph style, so reset that on style
apply.

URLs on frames can't be defined for frame styles, so it looks incorrect
to reset the URL of a frame/image on style apply, fix this.

Change-Id: Ie3a57b654cf06b9512b25d2dc103d15cd83727b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132675
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
(cherry picked from commit 97c18cf32a9a3088b5a51e2b0d535d8caf5daca8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132697
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agonss: depend on zlib
Michael Stahl [Wed, 6 Apr 2022 19:39:45 +0000 (6 21:39 +0200)]
nss: depend on zlib

Required on WNT since 1c748fefc3c5b42e3548a1a7f5017a579982005a, may
be needed on other platforms if using --without-system-zlib.

Change-Id: Ib8e544d81881f425d257514fc475e272ca2e53ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132648
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Tested-by: Jenkins
(cherry picked from commit b11a5d3900e3c19e94833c1b1e5218288320c3e3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132608
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agoRed used instead of Green
Caolán McNamara [Thu, 7 Apr 2022 15:46:33 +0000 (7 16:46 +0100)]
Red used instead of Green

Change-Id: I1261154fcff6f4904b4360099cbf26e33b9e7463
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132694
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agotdf#148445 sw: Make "Exchange Databases" dialog modal
Michael Weghorn [Thu, 7 Apr 2022 15:02:54 +0000 (7 17:02 +0200)]
tdf#148445 sw: Make "Exchange Databases" dialog modal

This among others prevents opening the "Exchange Database"
dialog from the mail merge wizard, then closing
the mail merge wizard while the "Exchange Dialog" is
still open, resulting in a crash.

Change-Id: I86bd80d0bfa6084bf0f772bb430b2a871e9b5ef0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132678
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 365bd679904ec5f67d1061511d7faf73f9f8aa62)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132696
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
3 months agotdf#148445 sw: Resave exchangedatabases.ui with glade 3.38.2
Michael Weghorn [Thu, 7 Apr 2022 15:02:47 +0000 (7 17:02 +0200)]
tdf#148445 sw: Resave exchangedatabases.ui with glade 3.38.2

... in preparation of fixing the actual issue.

Change-Id: Ia3e60984b06e4fda856889f5116b49aecbbfb960
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132677
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit dafa352065b31428c54e8eded382a36951f7af5c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132695
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
3 months agotdf#143135 Qt break recursive IM QueryCursorRect
Jan-Marek Glogowski [Wed, 6 Apr 2022 16:59:10 +0000 (6 18:59 +0200)]
tdf#143135 Qt break recursive IM QueryCursorRect

To reproduce the Impress crash, you need an IM, e.g. fcitx / ibus.
This is triggered by having an active input, like double-clicking
one of a presentations text fields, then leaving the window and
switching back to it.

This results in a stack exhaustion in a few seconds. The backtrace
is basically:

QWidget::setFocus
QtFrame::ToTop
sd::Window::GrabFocus
ImplHandleExtTextInputPos
QtWidget::inputMethodQuery
QInputMethod::cursorRectangle
QWidget::setFocus
QApplication::setActiveWindow
QtInstance::DoYield
main

I scratched my head over the longer backtrace for while, but there
seems to be no good way to prevent this from LO's POV. The only
alternative from the Qt VCL plugin is QtFrame::ToTop. That code
is less ugly (no mutable or cached result), but QtWidget::
inputMethodQuery is earlier in the backtrace.

Change-Id: Ief3a8e44bca295cc676e75050d52d70a1da98a88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132643
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
(cherry picked from commit e81385277c091dabb1f6542a94229d7dcc77289b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132612

3 months agoforcepoint#104 sw: do not delete fieldmark chars in MoveNodeRange()
Michael Stahl [Tue, 5 Apr 2022 19:09:45 +0000 (5 21:09 +0200)]
forcepoint#104 sw: do not delete fieldmark chars in MoveNodeRange()

The problem is that SwXTextTableCursor::mergeRange() wants to move some
nodes, and the deleteMarks() deletes a fieldmark creating a SaveBookmark
but it contains the positions relative to the CH_TXT_ATR_FIELD* still in
the text, while deleting the fieldmark of course removes these.

The SaveBookmark would need to adjust the indexes and store the
separator position too and the vector would need to be restored in
reverse order.

But every time the SaveBookmarks are created, they are restored as well,
so it looks simpler to just suppress deleting the CH_TXT_ATR_FIELD* in
this case, and inserting them too (latter is already done when copying
text).

Change-Id: I690c6432a38eab6dec10adff74e638f0e52cca55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132531
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 5d41c2461642364b7159398024acccbee12f6e3e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132589
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
3 months agosw: fix expansion of SetGetExpField in headers with split table rows
Michael Stahl [Tue, 5 Apr 2022 16:27:35 +0000 (5 18:27 +0200)]
sw: fix expansion of SetGetExpField in headers with split table rows

The problem is that a get field in a header on page N may calculate and
show values that do not take into account a set field on page N-1.

This happens if a table row with multiple columns is split across the
pages: SwGetExpField::ChangeExpansion() calls GetBodyTextNode(), which
returns the first node in the first column that is on page N, but in the
SwNodes array this node is *before* any node in columns 2..M, any of
which may be on page N-1 in the layout.

So try to fix this by adding a page number to SetGetExpField and using
that as the highest priority in operator<().

This is a bit risky because some of the places that create
SetGetExpField don't have a frame to get the page number from; try to
adapt all that call into MakeFieldList(), while leaving unrelated ones
such as in MakeSetList() unchanged.

Change-Id: Ied2a897ad34f0faf1ef3d50baad07b23fafd49bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132641
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 9dc6e2c9062725ef1f9d7e321cae5f4dbe8ca749)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132645
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
3 months agotdf#148342 docx export: fix puzzle shape
Attila Bakos (NISZ) [Tue, 5 Apr 2022 08:13:02 +0000 (5 10:13 +0200)]
tdf#148342 docx export: fix puzzle shape

There is an exporter class for preset shapes,
namely the DMLPresetShapeExporter, which in
its ctor calls the msfilter::GetShapeName()
converter method where the puzzle cause
exception. To avoid this return with false
to export it with custgeom in time.

Change-Id: I8d29bf551638a66abf381c9cb8f6a0eebc881195
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132567
Tested-by: Jenkins
Reviewed-by: Attila Bakos <bakos.attilakaroly@nisz.hu>
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
(cherry picked from commit 9592da0a8e596869a1cd0859619dd28a541d7234)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132606
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agotdf#148382: Keep first entry selected when address field is not set
Mike Kaganski [Tue, 5 Apr 2022 06:53:39 +0000 (5 09:53 +0300)]
tdf#148382: Keep first entry selected when address field is not set

Regression after commit f1ca64800074530d95e507f93c764a687310b9eb
  Author Caolán McNamara <caolanm@redhat.com>
  Date   Thu Oct 18 09:52:28 2018 +0100
    weld SwMMResultEmailDialog

ListBox::SelectEntry did not change previous selection in case the
entry was not found (because GetEntryPos would then return a huge
"not found" value). OTOH, weld::ComboBox::set_active_text clears
selection in that case (because find_text would return -1).

The code makes sure to pre-select entry 0 before attempting to
select an explicitly configured adderss field name; so keeping
that entry selected when no field name is configured is expected.

Change-Id: I9c8704261ce19bf06633bd4791d294fb16e76f63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132562
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 304be70b5b082ac4854dadc9e6a7c15075dd28b2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132597
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 months agotdf#147285 qt: Prefer "text/plain;charset=utf-8" over "text/plain"
Michael Weghorn [Wed, 6 Apr 2022 11:51:59 +0000 (6 13:51 +0200)]
tdf#147285 qt: Prefer "text/plain;charset=utf-8" over "text/plain"

If there were no data for MIME type "text/plain;charset=utf-16"
in the clipboard, but "text/plain" was provided, it was previously
assumed that this would be encoded in the locale's encoding, and
corresponding conversion using that encoding happened to provide
"text/plain;charset=utf-16" ourselves.

"text/plain;charset=utf-8" data was simply ignored, but using
it (if present) and preferring it over "text/plain"
is more reliable (and e.g. avoids incorrect paste of Chinese
characters from Firefox into Impress when using the qt5/qt6/kf5
VCL plugins on Wayland), so use it if present.

Rename the "m_bConvertFromLocale" member to better fit
the new meaning.

(An alternative solution to adding our own handling for
"text/plain;charset=utf-8" and making assumptions for the
encoding of "text/plain" data would be to let Qt handle
this and just call `QMimeData::text()` for the
`m_bProvideUTF16FromOtherEncoding=true` case
in `QtTransferable::getTransferData`.
Since qtbase commit 589a01ff6b1eacf81e74a5fc4801572135214f43
("QMimeData: Prefer UTF-8 when multiple charsets are available",
contained in Qt >= 5.13), that one handles MIME type
"text/plain;charset=utf-8" in addition to "text/plain".)

[1] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=589a01ff6b1eacf81e74a5fc4801572135214f43

Change-Id: I89f33216bf6be02a347d245b2359273af2eb530a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132631
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Tested-by: Jenkins
(cherry picked from commit 5b3227fac58dcbd588e2389e205679cd77842bac)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132607
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 months agoSync flatpak-manifest.in with Flathub
Stephan Bergmann [Wed, 6 Apr 2022 06:36:13 +0000 (6 08:36 +0200)]
Sync flatpak-manifest.in with Flathub

...including
<https://github.com/flathub/org.libreoffice.LibreOffice/commit/e7cb9cff2cf5db044195a7626327bd29b4b00c44>
"Merge pull request #184 from xlejo/adding-gvfsd:  Adding xdg-run/gvfsd"

Change-Id: I1b700c1e7170e67abf3fb1351be9f8c11cc15f8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132617
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit fd0aa82a61612b90352b0780e62bb4d4dd0d94f8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132603
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 months agoRelated tdf#148384: Don't overwrite task name with result
Mike Kaganski [Tue, 5 Apr 2022 07:16:35 +0000 (5 10:16 +0300)]
Related tdf#148384: Don't overwrite task name with result

Regression after commit ed200d9f2586b714718aaa7319ea68cf480261ad
  Author Caolán McNamara <caolanm@redhat.com>
  Date   Fri Jun 28 16:01:00 2019 +0100
    weld SwSendMailDialog

Change-Id: I397d3263268b94f83f2ccd7137c3de36e91a03a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132564
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 64b046b908cdf1204b105f1ebddfc41a5054e884)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132599
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agotdf#145954 Qt unshare QMenubar usage
Jan-Marek Glogowski [Tue, 5 Apr 2022 14:49:38 +0000 (5 16:49 +0200)]
tdf#145954 Qt unshare QMenubar usage

The Qt code was sharing the menu bar from the top level frame, but
LO expects independent menu bars per SetFrame calls. So instead of
showing the new bar and then hiding the old one, this was always
show and hiding the same menu bar, resulting in a hidden menu bar.

As a result of unsharing, LO now must check that its menu bar
pointer is still valid for usage. The QMainWindows takes ownership
when a QMenuBar is assigned and destroy old ones.

Change-Id: I2c6b12199a1e17a5d9f88686a4b27b1413beda47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132581
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
(cherry picked from commit 9c4ef8ce3183e27ca174475cf4a8d15cc0368f60)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132604
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
3 months agotdf#144585 Qt fix Wayland LO fake popups
Jan-Marek Glogowski [Mon, 4 Apr 2022 16:02:28 +0000 (4 18:02 +0200)]
tdf#144585 Qt fix Wayland LO fake popups

So Michael Weghorn was somehow reminded of an abandoned
commit from me ("Qt5 rework parent handling") archived in
https://gerrit.libreoffice.org/c/core/+/73463.

The bug introducing the new QWidget parenting, tdf#145363, was
resolved in a better way by explicitly setting parents for the
modal dialogs, so LO doesn't break Qt anymore. The actual problem
is, that an additional modal dialog needs to be stacked to the
previous modal dialog; no "parallel" modal dialogs are allowed,
which my original fix tried to enforce by reparenting.

Then there is the problem with Qt::Popup's focus grabbing on show,
which breaks LO's editable ComboBox. So LO's popup / FLOAT windows
are mapped to Qt::ToolTip, which are automatically advertised as
tooltips via accessibility. For X11 / xcb, Qt:Window with the
Qt::BypassWindowManagerHint works well enough as an alternative,
but WASM and Wayland don't seem to implement it correctly, so this
just handles popups as Qt::ToolTip on all platforms.

This reverts commit b00a68a8e19370e106cd76258a3c1825f43613ee
("tdf#145363 Qt reparent modal dialogs on show").
In addition the popup widgets are switched back to Qt::ToolTip.

Change-Id: If726771b4e9cc3f639f21cf502b3ec5985873643
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132526
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
(cherry picked from commit fbf739198aa7f02975d531521c6525073783c7f1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132625

3 months agoResolves: tdf#146174 allow shortcut key event handling before menubar
Vincent Reher [Wed, 6 Apr 2022 01:31:45 +0000 (5 18:31 -0700)]
Resolves: tdf#146174 allow shortcut key event handling before menubar

Change-Id: Ib0dadafcc66604baf53169cb222a059ee3f97362
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132601
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 months agoQt use platform-independent visibility functions
Jan-Marek Glogowski [Sun, 9 Jan 2022 00:01:49 +0000 (9 01:01 +0100)]
Qt use platform-independent visibility functions

show() isn't just some conveniently renamed setVisible(true), but
presents a window in a platform-dependant way, which - at least
for WASM - means maximized and without a title bar. This is not
really expected and WASM can also use multiple windows.

Change-Id: I3fbaec1dfc2cd32bf3a90a94dcee01ebc88e58c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128179
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
(cherry picked from commit f7346dc88200fa2160d39b4e4b4ae31fcad59a8c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132624
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
3 months agotdf#148397: Crash on font features dialog opening with EB Garamond
Julien Nabet [Tue, 5 Apr 2022 20:10:57 +0000 (5 22:10 +0200)]
tdf#148397: Crash on font features dialog opening with EB Garamond

bt:
0  0x00007f7ba5ef549c in rtl::str::acquire<_rtl_uString>(_rtl_uString*) (pThis=0x0) at sal/rtl/strtmpl.hxx:825
1  0x00007f7ba5ef8d45 in rtl_uString_acquire(rtl_uString*) (pThis=0x0) at sal/rtl/ustring.cxx:1199
2  0x00007f7b485757e3 in rtl::OUString::OUString(_rtl_uString*) (this=0x7ffc345a9f20, str=0x0) at include/rtl/ustring.hxx:252
3  0x00007f7b485fd1da in cui::FontFeaturesDialog::fillGrid(std::__debug::vector<vcl::font::Feature, std::allocator<vcl::font::Feature> > const&) (this=
   0x7ffc345aa538, rFontFeatures=std::__debug::vector of length 43, capacity 64 = {...}) at cui/source/dialogs/FontFeaturesDialog.cxx:98
4  0x00007f7b485fcc83 in cui::FontFeaturesDialog::initialize() (this=0x7ffc345aa538) at cui/source/dialogs/FontFeaturesDialog.cxx:66
5  0x00007f7b485fc8b9 in cui::FontFeaturesDialog::FontFeaturesDialog(weld::Window*, rtl::OUString const&) (this=0x7ffc345aa538, pParent=0x6f2f748, rFontName="EB Garamond 12")
   at cui/source/dialogs/FontFeaturesDialog.cxx:28
6  0x00007f7b488f3165 in SvxCharNamePage::FontFeatureButtonClicked(weld::Button&) (this=0x6f0a620, rButton=...) at cui/source/tabpages/chardlg.cxx:1157

Revealed with 5afdcad4c0e7850b18996c549892b9360cd8973f
Pass context and resource string down to boost::locale separately
because this is often on a hot path, and we can avoid the splitting and
joining of strings like this.

Change-Id: I20b18c8f46014feb453f81d66dd7cb490124efa1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132590
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
(cherry picked from commit ad3d2d1bc7e07f79a26841d89a85e94999a7c8ca)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132600
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agoResolves: rhbz#2069486 classic help index entry autocompletes on del/backspace
Caolán McNamara [Tue, 5 Apr 2022 15:44:39 +0000 (5 16:44 +0100)]
Resolves: rhbz#2069486 classic help index entry autocompletes on del/backspace

when it shouldn't

Change-Id: I90fa338479e0d5612d7b09f94c45e356ea71f89e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132596
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agotdf#148384: Really leave mail merge results dialog open upon errors
Mike Kaganski [Tue, 5 Apr 2022 07:06:51 +0000 (5 10:06 +0300)]
tdf#148384: Really leave mail merge results dialog open upon errors

Restructuring mail merge in 5.2 cycle had broken the dialog keeping
open when errors happened during sending. Later, in 2017, in commit
bfaa6e35ff09a0426d2c3c9c36f069fabc0c9489
  Author Alex McMurchy1917 <mcmurchy1917-libreoffice@yahoo.co.uk>
  Date   Thu Aug 24 14:34:13 2017 +0100
    tdf#103919 mailmerge: prevent premature end of emailing

SwSendMailDialog::AllMailsSent was changed in attempt to restore that
expected behavior, but the condition was incorrect:
m_nSendCount == m_nExpectedCount means "all mails processed", not
"everything went without errors".

So fix this by considering the error count when deciding to close the
dialog.

Change-Id: I98d61165803deaf0da985167ba0152e6f50f9246
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132563
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 2d9f12be1530f2532276a2447102ed2f1f0ecb5b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132598
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agotdf#148361: docx sdt: cleanup databinding data after inserting
Vasily Melenchuk [Mon, 4 Apr 2022 15:05:18 +0000 (4 18:05 +0300)]
tdf#148361: docx sdt: cleanup databinding data after inserting

Databinding data is used only for current sdt block. It should
be clean up after usage to avoid impact on next sdt blocks.

Change-Id: I53f47dd655ed027d40eb518784dcae69813e612f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132524
Tested-by: Jenkins
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
(cherry picked from commit fafadd7aee8c384af210008f693b5007a9f5ea48)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132595
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agotdf#148345 sw: reject all tracked row deletion in Hide Changes
László Németh [Mon, 4 Apr 2022 16:46:17 +0000 (4 18:46 +0200)]
tdf#148345 sw: reject all tracked row deletion in Hide Changes

In Hide Changes mode, undeleted rows didn't reappear at applying
Reject All for tracked row deletions.

See also commit a74c51025fa4519caaf461492e4ed8e68bd34885
"tdf#146962 sw: hide deleted row at deletion in Hide Changes".

Change-Id: I55d76fb0165fefc330934c5a2a6b018904d3a1a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132527
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit d4e2ed9324bd736275f07577ba81c974a0a70eb1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132391

3 months agoUpdate git submodules
Christian Lohmaier [Tue, 5 Apr 2022 11:08:26 +0000 (5 13:08 +0200)]
Update git submodules

* Update translations from branch 'libreoffice-7-3'
  to 6e640300395f31da22a9b1a3d44c9cfa2fc91222
  - update translations for 7.3.3 rc1

    and force-fix errors using pocheck

    Change-Id: Ifc08b7dc103dd15ce395f267397a8e000e16ba5a

3 months agotdf#147925 fix view scrolling back to comment
Jim Raykowski [Sat, 2 Apr 2022 06:08:42 +0000 (1 22:08 -0800)]
tdf#147925 fix view scrolling back to comment

fixes regression caused by fix done for commit
85057da7f19e8e5d6023c16fa07d138e2b519a66

Change-Id: I427513bd920f4e0047c64210feecfeac22ecfd10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132451
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
(cherry picked from commit 2d6af46a82c6b9f1565933e8a1175e7a184256ca)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132381
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agoforcepoint#101 sw: fix inserting at-page shapes to not set anchor pos
Michael Stahl [Mon, 4 Apr 2022 15:19:51 +0000 (4 17:19 +0200)]
forcepoint#101 sw: fix inserting at-page shapes to not set anchor pos

The problem is that for an at-page anchor SwXDrawPage::add() sets an
anchor position, but then a fieldmark is inserted and the node with the
anchor position is deleted.

The code that sets the surprising anchor position for at-page shape was
added in commit cf345e026fc0378c4436173c8064717c7db4d538 "Fix #91289#:
Draw objects anchored at page but without page number" and is similar to
the code for fly-frames added in commit
2e6d999cf8ceacabb94b11feee6ee0808c2a75bc "If no page number is given for
page bound frames, calculate it using cursor" except that it is missing
a check for GetPageNum() == 0, for no obvious reason.

The matching code to replace the anchor position with a page number is
in SwFlyFrameFormat::MakeFrames() and was added in commit
572a48cd16f6ce3a68ffead44a975698954dfe11 "Fix #85019#: Insertion of
flyframes without correct pagenumber"; it's not clear if this is only
needed for shapes inserted via the above 2 UNO APIs or also for shapes
inserted via UI.

Then there is the issue that the page number is set in
XMLTextShapeImportHelper::addShape() only after the shape is inserted,
which was added and commented in commit
b5fc47fe5c2892dd712e2bda922656eacbd932f1, earlier than all the above
commits; testing shows that if the page number is set before inserting
the shape, the shape ends up on the expected page anyway.

Let's change this:
1. the page number is set before inserting the shape
2. at-page anchor with page number is left as is
3. at-page anchor without page number gets anchor position and is changed
   to at-char

Change-Id: I2f874bec8424de5eee94cf022e3b49382eaa55f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132479
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132530
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 months agotdf#147523 Qt use inner QWidget to set pointer pos
Jan-Marek Glogowski [Mon, 4 Apr 2022 09:25:22 +0000 (4 11:25 +0200)]
tdf#147523 Qt use inner QWidget to set pointer pos

Regression from commit e63fe68fb1d0915b64fdf63f7fa6eed866fa3a0d
("Qt use asChild for pointer positioning"), which should just have
been a cleanup for commit ca28826a087245686d7fca3ffc8ca1f03307924d
("tdf#131467 Qt set default position on first resize").

And scale the requested position by the device scale factor.

Change-Id: I50b3c628d22896e987d8cc2eaf5635cb12ba3464
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132518
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
(cherry picked from commit cec215e0e3adaf26c89c4ffbaa53f87481772f0c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132388

3 months agoforcepoint#99 SwTextFormatter unaware that FirstOfBorderMerge was deleted
Caolán McNamara [Fri, 1 Apr 2022 15:52:06 +0000 (1 16:52 +0100)]
forcepoint#99 SwTextFormatter unaware that FirstOfBorderMerge was deleted

READ of size 8 at 0x606000a49e50 thread T0
    #0 0x7f7ab6214bf5 in SwPosSize::Height() const /home/caolan/LibreOffice/core-asan/sw/source/core/text/possiz.hxx:49:37
    #1 0x7f7ab636c311 in SwTextFormatter::MergeCharacterBorder(SwLinePortion&, SwLinePortion const*, SwTextFormatInfo&) /home/caolan/LibreOffice/core-asan/sw/source/core/text/itrform2.cxx:2807:43
    #2 0x7f7ab636ae08 in SwTextFormatter::InsertPortion(SwTextFormatInfo&, SwLinePortion*) /home/caolan/LibreOffice/core-asan/sw/source/core/text/itrform2.cxx:354:13
    #3 0x7f7ab6371db1 in SwTextFormatter::BuildPortions(SwTextFormatInfo&) /home/caolan/LibreOffice/core-asan/sw/source/core/text/itrform2.cxx:709:9
    #4 0x7f7ab638b2ac in SwTextFormatter::FormatLine(o3tl::strong_int<int, Tag_TextFrameIndex>) /home/caolan/LibreOffice/core-asan/sw/source/core/text/itrform2.cxx:1701:9
    #5 0x7f7ab62a8ad1 in SwTextFrame::FormatLine(SwTextFormatter&, bool) /home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1212:44
    #6 0x7f7ab62af1cc in SwTextFrame::Format_(SwTextFormatter&, SwTextFormatInfo&, bool) /home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1571:23
    #7 0x7f7ab62b1f17 in SwTextFrame::Format_(OutputDevice*, SwParaPortion*) /home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1743:5
    #8 0x7f7ab62b5260 in SwTextFrame::Format(OutputDevice*, SwBorderAttrs const*) /home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1932:17
    #9 0x7f7ab5dbdabd in SwContentFrame::MakeAll(OutputDevice*) /home/caolan/LibreOffice/core-asan/sw/source/core/layout/calcmove.cxx:1514:17

0x606000a49e50 is located 16 bytes inside of 56-byte region [0x606000a49e40,0x606000a49e78)
freed by thread T0 here:
    #0 0x4fe1f7 in operator delete(void*) (/home/caolan/LibreOffice/core-asan/instdir/program/soffice.bin+0x4fe1f7)
    #1 0x7f7ab6486d35 in SwTextPortion::~SwTextPortion() /home/caolan/LibreOffice/core-asan/sw/source/core/text/portxt.hxx:26:7
    #2 0x7f7ab63da0c9 in SwLineLayout::CalcLine(SwTextFormatter&, SwTextFormatInfo&) /home/caolan/LibreOffice/core-asan/sw/source/core/text/porlay.cxx:430:21
    #3 0x7f7ab6435413 in SwMultiPortion::CalcSize(SwTextFormatter&, SwTextFormatInfo&) /home/caolan/LibreOffice/core-asan/sw/source/core/text/pormulti.cxx:75:15
    #4 0x7f7ab6457749 in SwTextFormatter::BuildMultiPortion(SwTextFormatInfo&, SwMultiPortion&) /home/caolan/LibreOffice/core-asan/sw/source/core/text/pormulti.cxx:2090:16
    #5 0x7f7ab636f12c in SwTextFormatter::BuildPortions(SwTextFormatInfo&) /home/caolan/LibreOffice/core-asan/sw/source/core/text/itrform2.cxx:550:21
    #6 0x7f7ab638b2ac in SwTextFormatter::FormatLine(o3tl::strong_int<int, Tag_TextFrameIndex>) /home/caolan/LibreOffice/core-asan/sw/source/core/text/itrform2.cxx:1701:9
    #7 0x7f7ab62a8ad1 in SwTextFrame::FormatLine(SwTextFormatter&, bool) /home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1212:44
    #8 0x7f7ab62af1cc in SwTextFrame::Format_(SwTextFormatter&, SwTextFormatInfo&, bool) /home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1571:23
    #9 0x7f7ab62b1f17 in SwTextFrame::Format_(OutputDevice*, SwParaPortion*) /home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1743:5
    #10 0x7f7ab62b5260 in SwTextFrame::Format(OutputDevice*, SwBorderAttrs const*) /home/caolan/LibreOffice/core-asan/sw/source/core/text/frmform.cxx:1932:17
    #11 0x7f7ab5dbdabd in SwContentFrame::MakeAll(OutputDevice*) /home/caolan/LibreOffice/core-asan/sw/source/core/layout/calcmove.cxx:1514:17

similar seen in the past as:

commit 96acebb72211b4718eb3038c427df37b55b17b0b
Date:   Tue May 14 01:49:03 2019 +0800

    tdf#124937 reset m_pFirstOfBorderMerge before truncate.

commit ecd855794b22c0f7e6fb2f362b566c4d9c5f624a
Date:   Mon Jan 15 22:29:31 2018 +0100

    tdf#114536 sw: fix use-after-free in SwTextFormatter::MergeCharacterBorder()

Change-Id: Iad855f382a0daf50dac2537d4a91bfeaa9ff3799
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132439
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit b46baea4d1cce81c56ee0d82fbdc352921445fa7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132380
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agoforcepoint#103 avoid crash on layout of specific html
Caolán McNamara [Sun, 3 Apr 2022 16:07:45 +0000 (3 17:07 +0100)]
forcepoint#103 avoid crash on layout of specific html

return early if the prev frame was unexpectedly deleted

and another similar case to forcepoint#100 and drop a
SwBorderAttrAccess to allow the cache entry to be removed
in SwCache::DeleteObj

Change-Id: Ia83fe8911e2f6071a28d69c3089a96e3b87cc548
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132487
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132494
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agoforcepoint#102 refetch pPara if it might have been destroyed
Caolán McNamara [Sun, 3 Apr 2022 16:07:45 +0000 (3 17:07 +0100)]
forcepoint#102 refetch pPara if it might have been destroyed

by SwTextFly::Relax

READ of size 8 at 0x616006d9ab08 thread T0
    #0 0x7f5c56a0fbe5 in Size::Height() const include/tools/gen.hxx:213:52
    #1 0x7f5c56a0fb98 in Size::getHeight() const include/tools/gen.hxx:219:55
    #2 0x7f5c56a040f0 in SwRect::IsEmpty() const sw/inc/swrect.hxx:306:21
    #3 0x7f5c56dbb018 in SwRect::HasArea() const sw/inc/swrect.hxx:302:13
    #4 0x7f5c58571d04 in SwTextFrame::Prepare(PrepareHint, void const*, bool) sw/source/core/text/txtfrm.cxx:2986:45

0x616006d9ab08 is located 136 bytes inside of 608-byte region [0x616006d9aa80,0x616006d9ace0)
freed by thread T0 here:
    #0 0x4fe1f7 in operator delete(void*) (instdir/program/soffice.bin+0x4fe1f7)
    #1 0x7f5c584602c5 in SwParaPortion::~SwParaPortion() sw/source/core/text/porlay.cxx:2557:1
    #2 0x7f5c5850b997 in std::default_delete<SwParaPortion>::operator()(SwParaPortion*) const /usr/bin/../lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/bits/unique_ptr.h:85:2
    #3 0x7f5c5850b826 in std::__uniq_ptr_impl<SwParaPortion, std::default_delete<SwParaPortion> >::reset(SwParaPortion*) /usr/bin/../lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/bits/unique_ptr.h:182:4
    #4 0x7f5c5850b630 in std::unique_ptr<SwParaPortion, std::default_delete<SwParaPortion> >::reset(SwParaPortion*) /usr/bin/../lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/bits/unique_ptr.h:456:7
    #5 0x7f5c5850960d in SwTextLine::SetPara(SwParaPortion*, bool) sw/source/core/text/txtcache.hxx:45:17
    #6 0x7f5c58509e7d in SwTextFrame::ClearPara() sw/source/core/text/txtcache.cxx:113:24
    #7 0x7f5c5855606e in SwTextFrame::Init() sw/source/core/text/txtfrm.cxx:758:9
    #8 0x7f5c585735c4 in SwTextFrame::Prepare(PrepareHint, void const*, bool) sw/source/core/text/txtfrm.cxx:3090:17
    #9 0x7f5c57ecafb4 in lcl_NotifyContent(SdrObject const*, SwContentFrame*, SwRect const&, PrepareHint) sw/source/core/layout/frmtool.cxx:3367:15
    #10 0x7f5c57ec968b in Notify_Background(SdrObject const*, SwPageFrame*, SwRect const&, PrepareHint, bool) sw/source/core/layout/frmtool.cxx:3443:9
    #11 0x7f5c57958669 in lcl_NotifyBackgroundOfObj(SwDrawContact const&, SdrObject const&, tools::Rectangle const*) sw/source/core/draw/dcontact.cxx:951:13
    #12 0x7f5c579556bc in SwDrawContact::Changed_(SdrObject const&, SdrUserCallType, tools::Rectangle const*) sw/source/core/draw/dcontact.cxx:1233:21
    #13 0x7f5c57953b8d in SwDrawContact::Changed(SdrObject const&, SdrUserCallType, tools::Rectangle const&) sw/source/core/draw/dcontact.cxx:1009:5
    #14 0x7f5c96008baf in SdrObject::SendUserCall(SdrUserCallType, tools::Rectangle const&) const svx/source/svdraw/svdobj.cxx:2767:22
    #15 0x7f5c9601befa in SdrObject::Resize(Point const&, Fraction const&, Fraction const&, bool) svx/source/svdraw/svdobj.cxx:1561:5
    #16 0x7f5c57da650c in SwAnchoredDrawObject::GetObjBoundRect() const sw/source/core/layout/anchoreddrawobject.cxx:733:22
    #17 0x7f5c57dae236 in SwAnchoredObject::GetObjRectWithSpaces() const sw/source/core/layout/anchoredobject.cxx:569:31
    #18 0x7f5c5853c39e in SwTextFly::InitAnchoredObjList() sw/source/core/text/txtfly.cxx:900:48
    #19 0x7f5c58537b0c in SwTextFly::GetAnchoredObjList() const sw/source/core/inc/txtfly.hxx:311:44
    #20 0x7f5c58532a5d in SwTextFly::ForEach(SwRect const&, SwRect*, bool) const sw/source/core/text/txtfly.cxx:1067:56
    #21 0x7f5c58533eec in SwTextFly::IsAnyFrame() const sw/source/core/text/txtfly.cxx:405:12
    #22 0x7f5c5832ccbe in SwTextFly::Relax() sw/source/core/inc/txtfly.hxx:337:17
    #23 0x7f5c58571af5 in SwTextFrame::Prepare(PrepareHint, void const*, bool) sw/source/core/text/txtfrm.cxx:2976:48

Change-Id: Ibd0d4af69d2a8d74ad538afba7da53c864fa27b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132480
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit f49d218a671df5f7a956ccb219dc46a5c8d0a53c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132485
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agoforcepoint#98 don't delete SwFrame flagged as IsDeleteForbidden
Caolán McNamara [Fri, 1 Apr 2022 14:49:13 +0000 (1 15:49 +0100)]
forcepoint#98 don't delete SwFrame flagged as IsDeleteForbidden

Change-Id: I1ac2db4bf96afc4bdc8e0646576f5fa0bcd9e410
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132435
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 3644508aceee6019842bea1fee6c177eabd61681)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132484
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agoforcepoint#100 drop SwBorderAttrAccess to allow cache entry to be removed
Caolán McNamara [Sat, 2 Apr 2022 19:20:10 +0000 (2 20:20 +0100)]
forcepoint#100 drop SwBorderAttrAccess to allow cache entry to be removed

for SwBorderAttr which gets deleted during this call

also includes...

Related: forcepoint#100 we don't need pAttrs for the duration of the full scope

similar to the case of

commit 6b1eae0334ba8bad7656a859695551ce51b62f95
Date:   Fri May 18 08:26:14 2001 +0000

    Fix #87058#: Locked boraderattribut

the SwCache object cannot be deleted if its locked, leading to a leak,
we don't need pAttrs for the entire scope here so we can defer to the
end of the scope the reacquire the lock to set pAttrs

and also includes...

Related: forcepoint#100 don't reacquire after every release

instead release when we have to, and only reacquire if necessary
before use of pAttrs

Change-Id: Ie52aab7e5933d76b0c055389798104e4d93f39e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132461
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Caolán McNamara <caolanm@redhat.com>
3 months agoforcepoint#91 fix crash on layout of specific html
Caolán McNamara [Fri, 25 Mar 2022 21:26:43 +0000 (25 21:26 +0000)]
forcepoint#91 fix crash on layout of specific html

Change-Id: I145649e18f382c67ea34290f44fa219b7926127f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132129
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit be04a8072e4af30ca6ead36aa92d5f380cd9feb9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132483
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agotdf#147546 bump libnumbertext to 1.0.10
László Németh [Mon, 4 Apr 2022 08:26:50 +0000 (4 10:26 +0200)]
tdf#147546 bump libnumbertext to 1.0.10

fixing only regression of hu_Hung
transliteration of punctuation marks.
Add unit test for the fix.

Regression from commit 98fd4fcdc61202846e0957cb6aaed9e4a2d2c520
"tdf#136368 bump to libnumbertext 1.0.8".

(cherry picked from commit d925d1ca9e03863650dd3e450331598624f21724)
Change-Id: Ie92cad96f48f0a7f735bc9cde93a0fded4681800

Conflicts:
sw/qa/extras/uiwriter/uiwriter6.cxx

Change-Id: I7b49467943c97582dba0e5aca20c02a92c43deff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132492
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
3 months agotdf#53970 PPTX: fix broken export of linked media files
Tünde Tóth [Thu, 31 Mar 2022 11:11:04 +0000 (31 13:11 +0200)]
tdf#53970 PPTX: fix broken export of linked media files

Missing TargetMode="External" in the export of
linked media files resulted corrupted PPTX.

Change-Id: I76246db331d199810a5b413d44bec95283e88e47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132402
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit c2e8a96a8107a37901e475c65a8e61211fc3b132)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132383
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agotdf#148338: allow single-letter lowest-level domain
Mike Kaganski [Sat, 2 Apr 2022 08:10:22 +0000 (2 11:10 +0300)]
tdf#148338: allow single-letter lowest-level domain

The check that required lowest-level domain name to be at least
two characters long, was introduced for #i25107# in 2004 in the
commit dfcb4aa47b81ebd9affddefda88bf9b451508221
  Author Rüdiger Timm <rt@openoffice.org>
  Date   Mon Sep 20 12:13:22 2004 +0000
    INTEGRATION: CWS swmailmerge (1.1.2); FILE ADDED

(See also related #i20057# for feature specification.)
It didn't mention a rationale behind that check; but obviously,
it's unjustified. There are single-letter second-level domain
names [1], like 'x.com', and also under many other TLDs. Also
the check prevented single-character third-level names like
"a.foo.bar", etc. Plus, RFC 5322 (and its predecessors) do not
restrict these lengths in 'Addr-Spec Specification' (and RFCs
referenced from there).

This does not enable dotless domains [2]; if justified, they
should be enabled separately.

[1] https://en.wikipedia.org/wiki/Single-letter_second-level_domain
[2] https://en.wikipedia.org/wiki/Top-level_domain#Dotless_domains

Change-Id: I03cc26a90c08b94b9c1f70e0a0f1746192cb7afe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132482
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 1ea95f05ee8ec496c628bd11750d23cc012c7fe4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132382
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agoforcepoint#96 sw: delete fieldmarks in DelFullPara()
Michael Stahl [Fri, 1 Apr 2022 15:16:20 +0000 (1 17:16 +0200)]
forcepoint#96 sw: delete fieldmarks in DelFullPara()

The problem is that CorrAbs() will move any position of a fieldmark
that's in the deleted SwTextNodes to a different node that doesn't have
the CH_TXT_ATR_FIELD*.

Then it will inevitably crash later when it can't find its chars.

The other problem is that if there's only a CH_TXT_ATR_FIELDSEP in the
deleted nodes, that fieldmark would then be missing it.

Just delete fieldmarks with positions in deleted nodes, that should work
fine for the usual cases where DelFullPara() is called.

Change-Id: I8dfac9a315d74025dbe1ed5ccb95b7c9121fb569
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132379
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 months agotdf#148273 docx import: fix section break format leak to bullets
Sarper Akdemir [Wed, 30 Mar 2022 14:02:30 +0000 (30 17:02 +0300)]
tdf#148273 docx import: fix section break format leak to bullets

Fixes RES_PARATR_LIST_AUTOFMT leaking into the next section.

Achieves this by resetting list related attributes on the cursor's
text node in DomainMapper_Impl::RemoveLastParagraph() after the
deletion of the paragraph.

Change-Id: Ib4d09c5f190b8b8fd3bdc119ddd57d91f353de2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132324
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132440
Reviewed-by: Andras Timar <andras.timar@collabora.com>
3 months agoadd Initialization Vectors to password storage
Caolán McNamara [Tue, 22 Mar 2022 17:22:22 +0000 (22 17:22 +0000)]
add Initialization Vectors to password storage

old ones default to the current all zero case and continue to work
as before

Change-Id: I6fe3b02fafcce1b5e7133e77e76a5118177d77af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131974
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 192fa1e3bfc6269f2ebb91716471485a56074aea)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132186
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
3 months agotdf#148310: Firebird: copy complete rows, CLOB field, last character lost
Julien Nabet [Fri, 1 Apr 2022 17:40:21 +0000 (1 19:40 +0200)]
tdf#148310: Firebird: copy complete rows, CLOB field, last character lost

off by 1 pb.

Indeed we got:
610     sal_Int64 nCharWritten = 1; // XClob is indexed from 1
offapi/com/sun/star/sdbc/XClob.idl indeed indicates:
    114         The substring begins at position <code>pos</code> and has up
    115         to
    116         <code>length</code>
    117         consecutive characters.
    118         </p>
    119         @param pos
    120             the starting position, 1-based
    121         @param length
    122             the length of the substring
    123         @returns
    124             the substring
    125         @throws SQLException
    126             if a database access error occurs.
    127      */
    128     string getSubString([in]hyper pos, [in]long length) raises (SQLException);

but if the string to copy has length 1, we never enter:
while ( nLen > nCharWritten )
=> we must change this into: while ( nLen >= nCharWritten )
also number of remaining characters to take into account at each loop must be adapted too:
sal_Int64 nCharRemain = nLen - nCharWritten;  => would be 0
into:
sal_Int64 nCharRemain = nLen - nCharWritten + 1;

Change-Id: I7697c8312024818f73a19c39f694cf209f494d71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132443
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
(cherry picked from commit da81a880df76bebb6d9fbc770c313381a3c33268)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132378
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 months agonss: build with zlib module on WNT
Michael Stahl [Thu, 31 Mar 2022 18:33:02 +0000 (31 20:33 +0200)]
nss: build with zlib module on WNT

Change-Id: Ie875b4a8df1697de83a8f22cb1170a49792c47e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132367
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 1c748fefc3c5b42e3548a1a7f5017a579982005a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132419
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 months agoforcepoint#95 read past end of malformed document
Caolán McNamara [Wed, 30 Mar 2022 11:59:46 +0000 (30 12:59 +0100)]
forcepoint#95 read past end of malformed document

Change-Id: I8b2c558c733af3d7662f668af47e962e252ee339
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132311
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 0b9892fee990b7f6d0457ab6191f87c3991580e6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132409
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agoforcepoint#88 temp std::string assigned to std::string_view
Caolán McNamara [Fri, 25 Mar 2022 10:14:19 +0000 (25 10:14 +0000)]
forcepoint#88 temp std::string assigned to std::string_view

Change-Id: I128a60b68a3af988e3a4bdb06994f43d9b18d67e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132102
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 87259aef31a0411ccc8cb045ceb1365c23e917e5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132408
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Caolán McNamara <caolanm@redhat.com>
3 months agoforcepoint#87 Assertion 'mp_char <= mp_end' failed
Caolán McNamara [Fri, 25 Mar 2022 09:12:30 +0000 (25 09:12 +0000)]
forcepoint#87 Assertion 'mp_char <= mp_end' failed

Change-Id: I434928cb2425a2e8eb9440dff67f52cda241b2d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132097
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 32019baffa19a8f79cacf93d5dd5a95c7d416657)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132407
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agoforcepoint#83 forcepoint#84 update to upstream fix
Caolán McNamara [Thu, 24 Mar 2022 08:56:39 +0000 (24 08:56 +0000)]
forcepoint#83 forcepoint#84 update to upstream fix

Change-Id: I5add09b4379a1f86a720af75b758389424f4f50b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132055
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 2323fa29617e4919226517d50abbb9ad33b320ca)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132406
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Caolán McNamara <caolanm@redhat.com>
3 months agoResolves: tdf#117159 don't crash with chart selected in database report edit
Caolán McNamara [Wed, 30 Mar 2022 20:22:16 +0000 (30 21:22 +0100)]
Resolves: tdf#117159 don't crash with chart selected in database report edit

Change-Id: I770008bf0a775c108019c2005b6ec73ee9702a19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132190
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agoResolves: tdf#117162 ImportDocumentHandler expects data provider to exist
Caolán McNamara [Tue, 29 Mar 2022 19:00:09 +0000 (29 20:00 +0100)]
Resolves: tdf#117162 ImportDocumentHandler expects data provider to exist

already in its ctor

which changed since...

commit 9009663deb8f0862f419fd99bf0b761c7f923eff
Date:   Sun Feb 26 22:48:06 2017 +0100

    tdf#83257 [API-CHANGE] Pivot chart implementation

which defers it, take a probably safely backportable approach here to
fix it.

Change-Id: I1863791af7ae737f337993833a9cf1429a3a8028
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132286
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 78f7bd90b96ac168fdacd1e0cb0693ab3861872a)

also contains...

tdf#117162 ImportDocumentHandler expected XDocumentHandler argument

but SvXMLImport not longer supports XDocumentHandler since

commit fe2b4e7dc6533535736a8f08496f316427386179
Date:   Tue Oct 6 18:27:27 2020 +0200

    make SvXMLImport fast-parser only

here use a SvXMLLegacyToFastDocHandler to try and glue the two
parts together again. Though the use of reflection::XProxyFactory
is a bit worrying here wrt this change so unforseen side effects
are possible. Full change over to fast-parser only is probably
advisable.

Change-Id: Ie14d1d9fa8534c187efc67a6c1cc0989316c4634
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132285
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 70f3a94949cce612be9eff14fca94976acfc61a4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132333
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agoSync flatpak-manifest.in with Flathub
Stephan Bergmann [Thu, 31 Mar 2022 12:45:18 +0000 (31 14:45 +0200)]
Sync flatpak-manifest.in with Flathub

...including
<https://github.com/flathub/org.libreoffice.LibreOffice/commit/1ad91b85a5bb60f38a505756a0b5c338a8cb49fb>
"Merge pull request #183 from ourigen/fallback-x11:  Change socket to
fallback-x11 to fix 'Unsafe' warning"

Change-Id: I9613d15cd74ac28e2d55eeed4a801a65062d5ede
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132362
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit d940013e1726eba4d043110d5a01367c8d3f0a05)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132193
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agozlib: upgrade to release 1.2.12
Michael Stahl [Thu, 31 Mar 2022 10:13:23 +0000 (31 12:13 +0200)]
zlib: upgrade to release 1.2.12

Fixes CVE-2018-25032

external/zlib/ubsan.patch: remove, fixed upstream

Change-Id: I2aa9a9008b9cf7efd970c5fff0df7029204204f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132358
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit bfb6c4c65781a610d21409d974227d73f264f41a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132191
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
3 months agotdf#116358: rtf import: "keep with next" also affects table rows
Vasily Melenchuk [Wed, 30 Mar 2022 10:09:19 +0000 (30 13:09 +0300)]
tdf#116358: rtf import: "keep with next" also affects table rows

Like in DOCX for RTF there is exactly same behavior for paragraphs
inside cells. They do affect table breaking over the pages.

So:
1) Enable "TableRowKeep" doc setting for RTF documents.
2) Do not ignore \keepn token for paragraphs in tables.

Change-Id: I11e45ca9114c792b8cdbeb77dd51359717129651
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132305
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132355

3 months agotdf#148253: fix matching algorithm
Mike Kaganski [Wed, 30 Mar 2022 19:41:49 +0000 (30 22:41 +0300)]
tdf#148253: fix matching algorithm

Using 'flag' as a "continue the loop" marker allowed to continue
processing wildcard after its last character - not crashing because
it was a subview of a larger string with separators, but failing
the match.

Change-Id: I308058b68c59d5719f3c8b5f5656998a95a9ba09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132336
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 50add7c97e75d604287218f49c9283aab052fdf0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132374
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agoadd infobar to prompt to refresh to replace old format
Caolán McNamara [Wed, 23 Mar 2022 13:03:30 +0000 (23 13:03 +0000)]
add infobar to prompt to refresh to replace old format

Change-Id: Id99cbf2b50a4ebf289dae6fc67e22e20afcda35b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131976
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit bbd196ff82bda9f66b4ba32a412f10cefe6da60e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132187
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Reviewed-by: Sophie Gautier <sophi@libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
3 months agosw: fix crash in SwAttrSet::CopyToModify()
Miklos Vajna [Wed, 30 Mar 2022 09:20:12 +0000 (30 11:20 +0200)]
sw: fix crash in SwAttrSet::CopyToModify()

Regression from commit 938a4d6624a78f3e272b3c4c07f314cb0c6db723
(tdf#128375 sw: fix copying RES_PARATR_LIST_AUTOFMT to different SwDoc,
2019-11-01), the problem is that we may get an autofmt pool item which
is set, but its style handle is empty. Assume that this is the same case
as having no autofmt at all.

(cherry picked from commit ddfafd9b67e6e61c144b29ac73bbafb413ddf03b)

Conflicts:
sw/Module_sw.mk
sw/source/core/attr/swatrset.cxx

Change-Id: I87494fd04687d31201b4ec712cb0fb1ec7362b46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132189
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agoforcepoint#84 Invalid read of size 1
Caolán McNamara [Wed, 23 Mar 2022 20:08:19 +0000 (23 20:08 +0000)]
forcepoint#84 Invalid read of size 1

Change-Id: I1d0d74940cfa78a3c88cee737c9535acf03e0f19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131991
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit d6a02a99eaa3690c0aa5c33fea3a4c710813a0de)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132188
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agoforcepoint#94 fix crash on layout of specific html
Caolán McNamara [Sun, 27 Mar 2022 19:51:48 +0000 (27 20:51 +0100)]
forcepoint#94 fix crash on layout of specific html

Change-Id: I1874a431d5af9d56248a695e08a2f95b5292ba9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132179
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agotdf#53970 PPTX: add unittest
Tünde Tóth [Wed, 30 Mar 2022 07:52:57 +0000 (30 09:52 +0200)]
tdf#53970 PPTX: add unittest

Change-Id: I1bcf8f79213245fdf135d6d3b2aafea6ed99f5b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132296
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/+/132320

3 months agotdf#53970 PPTX: fix export of embedded media files
Tünde Tóth [Thu, 24 Mar 2022 15:54:01 +0000 (24 16:54 +0100)]
tdf#53970 PPTX: fix export of embedded media files

Embedded media files lost in documents created
with Impress after PPTX export.

Change-Id: I453b58f9cfa6a33653e9216fb82b66970a9ec31b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132095
Tested-by: Jenkins
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/+/132319

3 months agosc: fix use after free in ScChart2DataSequence::ExternalRefListener
Michael Stahl [Mon, 28 Mar 2022 18:07:24 +0000 (28 20:07 +0200)]
sc: fix use after free in ScChart2DataSequence::ExternalRefListener

UITest_chart: tdf122011.tdf122011.test_tdf122011

ERROR: AddressSanitizer: heap-use-after-free on address 0x61e00007a13e at pc 0x7f9a88217e2b bp 0x7f9a901e7ab0 sp 0x7f9a901e7aa8
READ of size 1 at 0x61e00007a13e thread T53
    #0 ScDocument::IsInDtorClear() const sc/inc/document.hxx:2421:56
    #1 ScChart2DataSequence::ExternalRefListener::~ExternalRefListener() sc/source/ui/unoobj/chart2uno.cxx:2897:26
    #4 ScChart2DataSequence::~ScChart2DataSequence() sc/source/ui/unoobj/chart2uno.cxx:2458:1
    #6 cppu::OWeakObject::release() cppuhelper/source/weak.cxx:230:9
    #8 com::sun::star::uno::Reference<com::sun::star::chart2::data::XDataSequence>::~Reference() include/com/sun/star/uno/Reference.hxx:114:22
    #9 chart::LabeledDataSequence::~LabeledDataSequence() chart2/source/tools/LabeledDataSequence.cxx:89:1
    #11 cppu::OWeakObject::release() cppuhelper/source/weak.cxx:230:9
    #12 cppu::WeakImplHelper<com::sun::star::chart2::data::XLabeledDataSequence2, com::sun::star::lang::XServiceInfo>::release() include/cppuhelper/implbase.hxx:115:66
    #13 com::sun::star::uno::Reference<com::sun::star::chart2::data::XLabeledDataSequence>::~Reference() include/com/sun/star/uno/Reference.hxx:114:22
    #20 chart::DataSeries::~DataSeries() chart2/source/model/main/DataSeries.cxx:218:1
    #24 chart::DataSeries::release() chart2/source/model/main/DataSeries.cxx:537:1
    #25 rtl::Reference<chart::DataSeries>::~Reference() include/rtl/ref.hxx:129:22
    #32 std::__debug::vector<rtl::Reference<chart::DataSeries>, std::allocator<rtl::Reference<chart::DataSeries> > >::clear() /usr/bin/../lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/debug/vector:720:9
    #33 chart::ChartType::~ChartType() chart2/source/model/template/ChartType.cxx:65:19
    #34 chart::ColumnChartType::~ColumnChartType() chart2/source/model/template/ColumnChartType.cxx:134:2
    #36 cppu::OWeakObject::release() cppuhelper/source/weak.cxx:230:9
    #38 chart::ChartType::release() chart2/source/model/template/ChartType.cxx:330:1
    #39 rtl::Reference<chart::ChartType>::~Reference() include/rtl/ref.hxx:129:22
    #46 chart::BaseCoordinateSystem::~BaseCoordinateSystem() chart2/source/model/main/BaseCoordinateSystem.cxx:185:1
    #47 chart::CartesianCoordinateSystem::~CartesianCoordinateSystem() chart2/source/model/main/CartesianCoordinateSystem.cxx:53:2
    #49 cppu::OWeakObject::release() cppuhelper/source/weak.cxx:230:9
    #51 chart::BaseCoordinateSystem::release() chart2/source/model/main/BaseCoordinateSystem.cxx:406:1
    #52 rtl::Reference<chart::BaseCoordinateSystem>::~Reference() include/rtl/ref.hxx:129:22
    #53 chart::VCoordinateSystem::~VCoordinateSystem() chart2/source/view/axes/VCoordinateSystem.cxx:89:1
    #55 chart::VCartesianCoordinateSystem::~VCartesianCoordinateSystem() chart2/source/view/axes/VCartesianCoordinateSystem.cxx:69:1
    #65 chart::ChartView::impl_deleteCoordinateSystems() chart2/source/view/main/ChartView.cxx:1091:20
    #66 chart::ChartView::~ChartView() chart2/source/view/main/ChartView.cxx:1085:5
    #68 cppu::OWeakObject::release() cppuhelper/source/weak.cxx:230:9
    #70 rtl::Reference<chart::ChartView>::~Reference() include/rtl/ref.hxx:129:22
    #71 chart::ChartModel::~ChartModel() chart2/source/model/main/ChartModel.cxx:183:1
    #73 cppu::OWeakObject::release() cppuhelper/source/weak.cxx:230:9
    #75 rtl::Reference<chart::ChartModel>::clear() include/rtl/ref.hxx:196:19
    #76 chart::CreationWizardUnoDlg::disposing() chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx:235:19
    #77 cppu::OComponentHelper::dispose() cppuhelper/source/component.cxx:161:17
    #78 chart::CreationWizardUnoDlg::notifyTermination(com::sun::star::lang::EventObject const&) chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx:140:5
    #79 framework::Desktop::impl_sendNotifyTerminationEvent() framework/source/services/desktop.cxx:1649:79
    #80 framework::Desktop::terminate() framework/source/services/desktop.cxx:282:13

0x61e00007a13e is located 2238 bytes inside of 2712-byte region [0x61e000079880,0x61e00007a318)
freed by thread T53 here:
    #0 0x4fe267 in operator delete(void*) (instdir/program/soffice.bin+0x4fe267)
    #1 ScDocShell::~ScDocShell() sc/source/ui/docshell/docsh.cxx:2899:1
    #2 SvRefBase::ReleaseRef() include/tools/ref.hxx:163:29
    #3 tools::SvRef<SfxObjectShell>::~SvRef() include/tools/ref.hxx:56:36
    #4 IMPL_SfxBaseModel_DataContainer::~IMPL_SfxBaseModel_DataContainer() sfx2/source/doc/sfxbasemodel.cxx:245:5
    #12 SfxBaseModel::dispose() sfx2/source/doc/sfxbasemodel.cxx:757:13
    #13 SfxBaseModel::close(unsigned char) sfx2/source/doc/sfxbasemodel.cxx:1482:5
    #14 SfxBaseModel::dispose() sfx2/source/doc/sfxbasemodel.cxx:718:13
    #15 gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77:5

Change-Id: I4ac7a702c50f9519a0f982ece9776c2d449c43ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132242
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit c87bbaa87e2532c7601e8588d87de1dc4952f098)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132183
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 months agoadd support to explicitly test swriter/sweb layout
Caolán McNamara [Fri, 25 Mar 2022 14:01:47 +0000 (25 14:01 +0000)]
add support to explicitly test swriter/sweb layout

Change-Id: Ib47526d35428a95b081c88011d733397339f288d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132121
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit bd769805180c9b0aadca5301e29161c2d84fbe64)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132182

3 months agoforcepoint#90 fix crash on layout of specific rtf
Caolán McNamara [Fri, 25 Mar 2022 20:09:32 +0000 (25 20:09 +0000)]
forcepoint#90 fix crash on layout of specific rtf

Change-Id: I17c227ab278ed5a2cc60449d1d005212f00ded89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132046
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 months agoforcepoint#83 Invalid read of size 1
Caolán McNamara [Wed, 23 Mar 2022 16:49:03 +0000 (23 16:49 +0000)]
forcepoint#83 Invalid read of size 1

Change-Id: I1576dfd8c9731d943107764aeb66bb1c2294ad5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131996
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agoforcepoint#89 don't remove page with footnote continuation frame
Caolán McNamara [Fri, 25 Mar 2022 12:10:32 +0000 (25 12:10 +0000)]
forcepoint#89 don't remove page with footnote continuation frame

in browse/html/web mode

Change-Id: Ic821dd7f2cc1f47305b5fe2ced16d5168aedc0b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132045
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agoforcepoint#92 fix crash on layout of specific doc
Caolán McNamara [Sun, 27 Mar 2022 11:03:06 +0000 (27 12:03 +0100)]
forcepoint#92 fix crash on layout of specific doc

Change-Id: Id40d25d05d10d641d071cddd2e1c84594ac777a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132142
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132148
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agomove DeleteListener contraptions to toplevel writer includes
Caolán McNamara [Sat, 26 Mar 2022 21:50:49 +0000 (26 21:50 +0000)]
move DeleteListener contraptions to toplevel writer includes

Change-Id: Ifa1e75b62da4174f27fca52eb86559cd6a381513
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132141
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132147
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agosc: fix crash in SdrPageView::GetPageWindow()
Aron Budea [Thu, 24 Mar 2022 21:02:17 +0000 (24 22:02 +0100)]
sc: fix crash in SdrPageView::GetPageWindow()

From online crashreport:

SIG   Fatal signal received: SIGSEGV

SdrPageView::GetPageWindow(unsigned int) const
svx/source/svdraw/svdpagv.cxx:84
(anonymous namespace)::ScLOKProxyObjectContact::calculateGridOffsetForViewOjectContact(basegfx::B2DVector&, sdr::contact::ViewObjectContact const&) const
sc/source/ui/view/gridwin4.cxx:1397
sdr::contact::ViewObjectContact::getGridOffset() const
svx/source/sdr/contact/viewobjectcontact.cxx:463
sdr::contact::ViewObjectContact::getPrimitive2DSequence(sdr::contact::DisplayInfo const&) const
include/basegfx/tuple/b2dtuple.hxx:81
sdr::contact::ViewObjectContact::getObjectRange() const
svx/source/sdr/contact/viewobjectcontact.cxx:198

ScLOKProxyObjectContact::calculateGridOffsetForViewOjectContact()
didn't check if PageWindowCount() was non-zero.

Change-Id: I4a00b5b13a277d0805af3076150a952306908e53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132251
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
(cherry picked from commit 5d0965f3f12fedb2228ba28f261a90245e343c09)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132181
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agotdf#148235 Restore toolbar item to switch XForm to design mode
Michael Weghorn [Mon, 28 Mar 2022 09:05:34 +0000 (28 11:05 +0200)]
tdf#148235 Restore toolbar item to switch XForm to design mode

    commit 45b6f096e7ae86d0692ecdfd5b7069622d8a6efa
    Date:   Sun Oct 28 17:02:34 2018 +0100

        sw toolbars sync context toolbars between different apps

had replaced the "Form Design" toolbar item to switch
a complete XForm to design mode with an entry that
switches the form controls to design mode instead.
(The former one is labelled "Design Mode On/Off",
the latter one just "Design Mode" in the English UI.)

This meant that the XForm could no longer be switched
to design mode from there, unless the toolbar was
manually customized to add the entry back.

This brings the previous toolbar item back.
It also removes the one to switch the form controls
to design mode again, since that one is already contained
in the "Form Controls" toolbar, where it fits better.
(And having two different toolbar items with almost
identical labels but different functionality would
probably be rather confusing.)

Change-Id: Ia4c98dfa6ad8372eba08a9f08920153133a7f88d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132207
Reviewed-by: Andreas Kainz <kainz.a@gmail.com>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
(cherry picked from commit 4f9bf4201bb706cd19142f0805cfc4c859186cd4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132177
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 months agotdf#141671 fix destroyed pargraph style in exported RTF in MSO.
Mark Hung [Sat, 19 Mar 2022 13:18:54 +0000 (19 21:18 +0800)]
tdf#141671 fix destroyed pargraph style in exported RTF in MSO.

Do not call MoveCharacterProperties() in RtfAttributeOutput
::EndParagraphProperties(). RtfAttributeOutput::ParagraphStyle() has
emited run associated properties defined in paragraph style.
Calling MoveCharacterProperties() again overwrites them.

As this bug is only visible in MS Word, no unit test case is
added.

Change-Id: I6e5bfd12e8afa7dc286ca54448c1ff022aade31d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131848
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
(cherry picked from commit 882045b934a3416cc48da2c4e30648892a419577)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132175
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agotdf#148228 sw: fix Undo of tracked table deletion in Hide Changes mode
László Németh [Mon, 28 Mar 2022 09:35:35 +0000 (28 11:35 +0200)]
tdf#148228 sw: fix Undo of tracked table deletion in Hide Changes mode

In Hide Changes mode, tables didn't reappear during
Undo of their tracked deletion, only by saving and
reloading the document.

Follow-up to commit 0c6221e1545e7b96d9df23cdc24302c28ae935b8
"tdf#148227 sw: fix Undo of tracked row deletion in Hide Changes mode".

Change-Id: Ifdc25ab4ae0be25a0c7559ee05b6af2e4f1aa8cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132169
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit eda1a7aeff42c08e02295e5a8353a6d86a61a118)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132178
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agotdf#148227 sw: fix Undo of tracked row deletion in Hide Changes mode
László Németh [Fri, 25 Mar 2022 14:27:21 +0000 (25 15:27 +0100)]
tdf#148227 sw: fix Undo of tracked row deletion in Hide Changes mode

In Hide Changes mode, table rows didn't reappear during
Undo of tracked deletion of table rows, only by saving
and reloading the document.

Follow-up to commit a74c51025fa4519caaf461492e4ed8e68bd34885
"tdf#146962 sw: hide deleted row at deletion in Hide Changes"
and commit 794fd10af7361d5a64a0f8bfbe5c8b5f308617a5
"tdf#147347 sw: hide deleted table at deletion in Hide Changes".

Change-Id: I7ffe8a3687d1d385a549f7d438f7058d829ffd8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132123
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit 0c6221e1545e7b96d9df23cdc24302c28ae935b8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132049
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agotdf#147014 Image missing due to integer overflow
Aron Budea [Sun, 13 Feb 2022 05:57:16 +0000 (13 06:57 +0100)]
tdf#147014 Image missing due to integer overflow

32-bit awt::Point/Size/Rectangle cannot fit size of 1M rows with
larger (eg. 5x the usual) height, and could overflow.

This causes problems in 64-bit Linux builds and, since the
following commit, in 64-bit Windows builds:
3d90997fb6f232d8008df4d166d7b97b869c200f

For now, clamp possibly overflowing values to 32-bit.

Change-Id: Ifda7265703388abdfb47f523da4f0c5822358404
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129876
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Reviewed-by: Aron Budea <aron.budea@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132168

3 months agosvx: don't remove object right after insertion
Szymon Kłos [Wed, 9 Mar 2022 15:41:36 +0000 (9 16:41 +0100)]
svx: don't remove object right after insertion

This is regression from:
commit 2d95b3846eac367d2baadc194ab258dc31e7bd33
Author: Tomaz Vajngerl <tomaz.vajngerl@collabora.co.uk>
Date:   Thu Oct 7 16:48:46 2021 +0200

    svx: Don't end text edit mode for all views

It was visible with "direct insertion" where user doesn't
need to draw anything but textbox is inserted in the center
of a screen (eg. used in LOK case)

Object was inserted into a view and right after that was removed when
EndTextEditCurrentView was called

Change-Id: I9943d46746aabadf96d76d6e74770b56d648b79d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131263
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131537
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131596
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 months agolok: insert textbox directly in Calc
Szymon Kłos [Wed, 9 Mar 2022 20:32:35 +0000 (9 21:32 +0100)]
lok: insert textbox directly in Calc

Change-Id: I3ae00b255dfbaa34ab8d973356d12dfd0f71d345
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131267
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131536
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132101

3 months agotdf#147761 record sort command in macros
Szymon Kłos [Mon, 14 Mar 2022 20:55:59 +0000 (14 21:55 +0100)]
tdf#147761 record sort command in macros

fixes regression introduced in:

commit 70b81e74d2a14308e1897d840c681404225d328a
author Szymon Kłos <szymon.klos@collabora.com> Tue Jul 21 11:40:22 2020 +0200

SfxRequest's Done method records the action. It has to be called.

Change-Id: I32529fa11febca3d3829b4afd2cd4e6dd359bf74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131484
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
(cherry picked from commit eca978841816f833616b4c2334e65aa976a9fb61)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131587
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agoforcepoint#85 Conditional jump or move depends on uninitialised value
Caolán McNamara [Thu, 24 Mar 2022 09:33:44 +0000 (24 09:33 +0000)]
forcepoint#85 Conditional jump or move depends on uninitialised value

==398461==    by 0xCDC7960: (anonymous namespace)::CopyUntil(char16_t*&, char16_t const*&, char16_t, bool) (strhelper.cxx:88)
==398461==    by 0xCDC839F: psp::WhitespaceToSpace(rtl::OUString const&, bool) (strhelper.cxx:294)
==398461==    by 0xCB54980: vcl::PDFWriterImpl::setOutlineItemText(int, rtl::OUString const&) (pdfwriter_impl.cxx:9875)
==398461==    by 0xCB547FF: vcl::PDFWriterImpl::createOutlineItem(int, rtl::OUString const&, int) (pdfwriter_impl.cxx:9851)
==398461==    by 0xCAF39B0: vcl::PDFWriter::CreateOutlineItem(int, rtl::OUString const&, int) (pdfwriter.cxx:383)
==398461==    by 0xCABD7C8: vcl::GlobalSyncData::PlayGlobalActions(vcl::PDFWriter&) (pdfextoutdevdata.cxx:250)
==398461==    by 0xCAC0628: vcl::PDFExtOutDevData::PlayGlobalActions(vcl::PDFWriter&) (pdfextoutdevdata.cxx:616)
==398461==    by 0x3D06EA0F: PDFExport::Export(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (pdfexport.cxx:1004)

Change-Id: I6bc086997851ee06531a4a9ae263e2b26edfba84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132035
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agotdf#147978 export subpaths individually in custGeom
Regina Henschel [Fri, 18 Mar 2022 17:31:05 +0000 (18 18:31 +0100)]
tdf#147978 export subpaths individually in custGeom

...and implement export of all missing commands,
   use existing viewBox if suitable,
   use one EnhancedCustomShape2d
   move WriteCustomGeometryPoint to protected,
   make GetCustomGeometryPointValue local

The fix solves tdf#100390 too.

Without the fix the entire enhanced-path was exported as one element
<a:path>. The command F was applied to the whole drawing but should
affect only the subpath. The implementation is changed so that each
subpath gets its own element <a:path> and command F acts only on its
subpath.

Support for export of handles and equations is still a long way off.
Thus there is no reason to tread shapes with and without handles
different. Shapes with handles had used method WritePolyPolygon, but
that is not able to handle subpaths. So have desided to use method
WriteCustomGeometry for all cases.

To get shapes exported regardless of path commands I have added the
export for the missing commands.

I have removed the no longer used method WritePolyPolygon.

The special treatment of shapes "moon" and "mso-spt89" (right up arrow)
in export is no longer needed. Related code parts are removed. The
unit test testFlipAndRotateCustomShape is adapted.

In case the method WriteCustomGeometry fails, the enhanced-path is
invalid. In that case an minimal custGeom is written in case of docx.

Shapes whose drawing does not touch all edges of the snap rectangle
were exported with wrong position and size of the drawing inside the
snap rectangle. That is fixed by using an existing ViewBox for the
OOXML path size. The old way of creating a path size from point
coordinates is only used if the shape has no suitable ViewBox.

The point values in unit test SdOOXMLExportTest2::testTdf111798 are
adapted to path size 21600 x 21600 and traverse direction of the points
is corrected. The resulting shape outline is still the same as before.

The expected xml is updated for file tdf92001.odp in
SdImportTest::testDocumentLayout. The resulting shape outline is the
same, because the shape touches the edges of the snap rectangle.

The case, that the shape outline does not touch a edge of the snap
rectangle is tested in SdOOXMLExportTest3::testEnhancedPathViewBox.

Still missing is the case, that ViewBox has other left,top than 0,0.
In that case all coordinates would have to be shifted because the path
size in OOXML has only width and height but not left,top. That will
not be included in this patch.

Change-Id: Ib1736d6a08371f4d98411d2769275f0580cd0030
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131837
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 2029b2f6dd0109c5892e5ac5640022b31fe42fd2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132048
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
3 months agotdf#148111: docx std fields: use placeholder text for empty data
Vasily Melenchuk [Fri, 25 Mar 2022 08:14:10 +0000 (25 11:14 +0300)]
tdf#148111: docx std fields: use placeholder text for empty data

It is quite unexpected Word behavior: if data source for sdt field
exists but contains empty string it is not used. Placeholder is
inserted instead.

In general behavior is more complex: logic of replacement is defined
by <w:showingPlcHdr> property and results can vary (see testcase).
But LO does not support this property correctly yet.

Change-Id: I2ec8efe05f79a01af5d74d21bfcd05f3b19e3970
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132096
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
(cherry picked from commit 9d033508af5257aeebbd8c22a053db5e74a814d3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132050
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agoforcepoint#86 RES_TXTATR_UNKNOWN_CONTAINER item put at invalid index
Caolán McNamara [Thu, 24 Mar 2022 14:32:22 +0000 (24 14:32 +0000)]
forcepoint#86 RES_TXTATR_UNKNOWN_CONTAINER item put at invalid index

RES_CHRATR_BEGIN is 1, presumably RES_TXTATR_UNKNOWN_CONTAINER should
be stored in the last index

Change-Id: Id37fff41cbbccbc26fe5ccce6027014af7362729
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132039
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agoofz: ensure unsigned index
Caolán McNamara [Thu, 24 Mar 2022 20:14:41 +0000 (24 20:14 +0000)]
ofz: ensure unsigned index

Change-Id: I38d6238a6eede0188f942229b2fb931614e56309
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132042
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agoDepend on 64-bit packages for aarch64 as well
Michael Weghorn [Fri, 25 Mar 2022 07:37:37 +0000 (25 08:37 +0100)]
Depend on 64-bit packages for aarch64 as well

As Christian Lohmaier pointed out in [1]:

> When building packages using the epm method, the dependency gets added
> by instsetoo_native/inc_openoffice/unix/find-requires-x11.sh - and it
> looks like it should also add the ()(64bit) marker to the dependency
> when PLATFORMID is linux_aarch64 and not only for linux_x86_64
>
> check with rpm -q --provides libXinerama-1.1.3-2.1.el7.aarch64 whether
> it provides "libXinerama.so.1()(64bit)"

The reply of 2022-03-25T10:41 (public mailing list version
probably still pending in some moderator queue)
shows it does:

> [root@1 rpm2]# `rpm -q --provides
> > ^CbXinerama-1.1.3-2.1.el7.aarch64
> [root@1 rpm2]# rpm -q --provides libXinerama-1.1.3-2.1.el7.aarch64
> libXinerama = 1.1.3-2.1.el7
> libXinerama(aarch-64) = 1.1.3-2.1.el7
> libXinerama.so.1()(64bit)

[1] https://lists.freedesktop.org/archives/libreoffice/2022-March/088637.html

Change-Id: I1b9a4025399d82ac5f5e51ea5523417e3e6cf395
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132094
Tested-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit d6ea4b8ffce91d7956cea0267c95ca69e208db24)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132044
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 months agoconfigure.ac: add missing MAC_OS_X_VERSION_MAX_ALLOWED for macOS SDK 12.3
Xisco Fauli [Fri, 25 Mar 2022 10:29:19 +0000 (25 11:29 +0100)]
configure.ac: add missing MAC_OS_X_VERSION_MAX_ALLOWED for macOS SDK 12.3

Support for macOS SDK 12.3 was backported to libreoffice-7-3 in
1d875592eb4a2ca78b94c959f1acbc3552db608f "Accept macOS SDK 12.3"
but MAC_OS_X_VERSION_MAX_ALLOWED was missing in the commit
because it was removed in master after

b0ab07ba89c88006932c68e0ca08dffcd0a4621e
"Always set MAC_OS_X_VERSION_MAX_ALLOWED =
MAC_OS_X_VERSION_MIN_REQUIRED"

Change-Id: Ic7d8581bebad12bfe7f23b06c24d3b8ea2fdde43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132104
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 months agotdf#96389 Use default tab stop value of MSO for pptx import.
Gülşah Köse [Thu, 24 Mar 2022 08:19:03 +0000 (24 11:19 +0300)]
tdf#96389 Use default tab stop value of MSO for pptx import.

Change-Id: Ib3dde68c672b44d8b60f121fb0e637942b5986b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131698
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132103