LibreOffice.git
3 weeks agoBump version to 22.05.3.1cp-22.05.3-1
Andras Timar [Mon, 27 Jun 2022 17:36:13 +0000 (27 19:36 +0200)]
Bump version to 22.05.3.1

Change-Id: I9f5884ad4a2cacd5f9266616235803c82f5b1920

3 weeks agosvtools: avoid divide by zero in calcCustomItemSize
Xisco Fauli [Tue, 21 Jun 2022 14:58:24 +0000 (21 16:58 +0200)]
svtools: avoid divide by zero in calcCustomItemSize

See https://crashreport.libreoffice.org/stats/signature/%60anonymous%20namespace'::calcCustomItemSize

Change-Id: I5f1b19b7679c73cf29952629469e5151395b2b12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136254
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit ec03eef9b431048ea21a733c39c79b792b0f653c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136393
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136451

3 weeks agotdf#148522 svx: fix undo of cell border changes text alignment in other cells
Miklos Vajna [Fri, 24 Jun 2022 08:46:40 +0000 (24 10:46 +0200)]
tdf#148522 svx: fix undo of cell border changes text alignment in other cells

The Impress table properties dialog has multiple purposes: normally it
only affects the properties of the currently active cell, but shadow is
applied on the whole shape.

Regression from commit fdeb04f7c59cf8032fe17072ed779e70505cc6ab
(tdf#129961 svx: finish UI for table shadow as direct format,
2020-12-15), we started to apply properties to the current cell, and
then to the whole shape as well, unconditionally. This affects
undo/redo, as there is a separate undo manager while the text edit of a
table cell is active and when the text edit is ended.

Fix the problem by only applying properties on the shape when there we
actually have some properties: this way the text edit is typically not
ended, bringing back the old undo/redo behavior.

Note that we still need to end the text edit if the user explicitly sets
some shadow properties, that part is unchanged with this commit.

Change-Id: I78e28bd326a2c12c3775b33957adca4cd95ac582
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136357
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
(cherry picked from commit 3edfbc19950610bb2061d29cb58b3811b1a0b1a5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136460
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 750568d77812202c9c01fa87945b507a358c6db5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136468

3 weeks agocrashtesting: fix assert seen with forum-mso-en-8349.docx
Caolán McNamara [Mon, 27 Jun 2022 09:00:13 +0000 (27 10:00 +0100)]
crashtesting: fix assert seen with forum-mso-en-8349.docx

a string that ends in spaces

Change-Id: I808f046be816d0d4a76f801a349e284024a2061c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136465
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agotdf#148820 sc: fix conditional formatted cell color
Balazs Varga [Fri, 17 Jun 2022 14:51:22 +0000 (17 16:51 +0200)]
tdf#148820 sc: fix conditional formatted cell color

Store foreground color for color filtering, because in OOXML
the foreground color is used for color filtering and we overwrote
it with the background color which is used for conditional formatted cells too.

Regression from commit: 6f908b48373b71d45c8119b296b0504fb586f6f8
(tdf#143104 Fix xlsx import/export of color filter colors)

Change-Id: I737e6f1170851822a2689fa477db59e62f0d47fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136055
Tested-by: Jenkins
Tested-by: Gabor Kelemen <kelemeng@ubuntu.com>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
(cherry picked from commit 415dc3bb1c03dbdbc3cbca274bc435ac7557ba2d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136457
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136479

3 weeks agocrashtesting: fix assert seen on loading forum-nl-1226.ods
Caolán McNamara [Mon, 27 Jun 2022 08:40:22 +0000 (27 09:40 +0100)]
crashtesting: fix assert seen on loading forum-nl-1226.ods

Change-Id: If8c08a51b11a459a03b4a0604c1fb9897351e598
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136467
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
3 weeks agojsdialog: toggle toolbox buttons correctly
Szymon Kłos [Thu, 9 Jun 2022 15:41:15 +0000 (9 17:41 +0200)]
jsdialog: toggle toolbox buttons correctly

Change-Id: Ic02f9ceab29257ebc4cb6261aae10c4f1a7ef176
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135562
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit b6b7b3a5a46790baf2266aaeb10976753dfe0fce)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135539
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
3 weeks agolok: formulabar: send correct caret position for numbers
Szymon Kłos [Fri, 24 Jun 2022 12:04:03 +0000 (24 14:04 +0200)]
lok: formulabar: send correct caret position for numbers

It fixes the bug:

1. Open spreadsheet and type long numer in some cell (only numbers)
2. Move cell cursor to another cell, then using keyboard go back to the previous cell
3. click in formulabar somewhere in the middle of a number
4. try to type one character

result: character was added in correct place but cursor was moved to the start
expected: caret will stay at correct place

Change-Id: I514d868dce5478e65d57fd2f350da9777b615e0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136395
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Rashesh Padia <rashesh.padia@collabora.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
3 weeks agoRemove not necessary container in Animation Panel in Impress Sidebar
Szymon Kłos [Thu, 23 Jun 2022 14:25:11 +0000 (23 16:25 +0200)]
Remove not necessary container in Animation Panel in Impress Sidebar

It was causing layouting issues in LOK.

Change-Id: Ic7520f46efa764d2d6b50b021b44e0a5dd07d837
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136343
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Rashesh Padia <rashesh.padia@collabora.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
3 weeks agoResolves: tdf#149589 No "+ or - may start formula" when editing content
Eike Rathke [Tue, 21 Jun 2022 07:49:31 +0000 (21 09:49 +0200)]
Resolves: tdf#149589 No "+ or - may start formula" when editing content

If it was a formula already it would start with = anyway.

Change-Id: Ib3c0ebcaf99231d387f1aace8e1a5642061de3a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136208
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 909cdd552199d35f7c10be0a8be370158aea0815)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136173
Tested-by: Eike Rathke <erack@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 weeks agoResolves: tdf#147265 Return correct default if currency format is duplicate
Eike Rathke [Mon, 20 Jun 2022 15:13:53 +0000 (20 17:13 +0200)]
Resolves: tdf#147265 Return correct default if currency format is duplicate

For the default currency format
SvNumberFormatter::GetCurrencyFormatStrings() returned always the
last added position, regardless whether that format was added or
not, which it isn't if the format code is a duplicate. Let
addToCurrencyFormatsList() return the position of the existing
format if the duplicate was rejected and use that for default.

Change-Id: I148d7379de75cae402b063f7b2f92947e345176f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136187
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 36cf12d449c892e6bbacb7da5f4b008f7762232b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136166
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agoResolves: tdf#147822 ScUnoListenerEntry container must be std::list
Eike Rathke [Thu, 16 Jun 2022 19:44:40 +0000 (16 21:44 +0200)]
Resolves: tdf#147822 ScUnoListenerEntry container must be std::list

... instead of std::vector to not get invalidated iterators when
the container is resized.

Regression from

    commit f8defe59ff75df2b516ee407f1dac22b0ac72a19
    CommitDate: Wed Sep 6 22:45:10 2017 +0200

        Replace some lists by vectors in unoobj (sc)

which was bad for this case.

Change-Id: I8d3a001242865cadc82b359a3198906d26373a41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136007
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 7a0a0e23b7e81c1ee0601824a4ee990a2178f98b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136023
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agoRelated: tdf#149325 Fix yet another VbaRange empty ScRangeList access
Eike Rathke [Tue, 14 Jun 2022 11:55:09 +0000 (14 13:55 +0200)]
Related: tdf#149325 Fix yet another VbaRange empty ScRangeList access

Change-Id: If2c44795ab794482b841138bdd55f37c4d30b592
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135824
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 9470c5531dc928d438a6a7f4d47f2d82f2296cc1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135874
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agotdf#149531 tdf#149325 Eliminate unconditional ScRangeList::front() access
Eike Rathke [Mon, 13 Jun 2022 15:00:43 +0000 (13 17:00 +0200)]
tdf#149531 tdf#149325 Eliminate unconditional ScRangeList::front() access

 This is a combination of 2 commits.

Resolves: tdf#149531 Use initial sheet range for VBA Columns and Rows

... if the ScTableSheetObj's ScRangeList is empty. It might even
be that was never intended to be used and worked only by accident
in the past (pre 6.0), but it's somewhat unclear. It may even get
in the way in case it exists and the (first) range was modified,
e.g. shrunk by a Delete, as the resulting column or row object
could be different from the initial sheet range.

xChange-Id: Ib9911df1b23802054a5bb0621bb7f5559ef3f39b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135732
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 3ad12672e924f7aef394119f9fe5f0b06a900b9e)

Related: tdf#149325 Eliminate all unconditional ScRangeList::front() access

... to prevent crashes, and where possible substitute a missing
element with the original sheet object range.

xChange-Id: I245844e89fa3eb7d6ec07e279bdd23022fd77958
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135773
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit d6331fc7abe545ff0a369c41ab3f55b8f44a2cc1)

Change-Id: Ib9911df1b23802054a5bb0621bb7f5559ef3f39b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135739
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 weeks agoResolves: tdf#149484 Handle <number:boolean-style> with <number:text>
Eike Rathke [Fri, 10 Jun 2022 10:34:00 +0000 (10 12:34 +0200)]
Resolves: tdf#149484 Handle <number:boolean-style> with <number:text>

Backport as the current handling when writing such format (even if it
doesn't display the text literals) is utterly broken and results in

    <number:boolean-style style:name="N111">
      <number:text>--</number:text>
    </number:boolean-style>

so an implementation correctly reading such (e.g. now upcoming
LibreOffice 7.4) would create a format "--" and display that for any
value, true or false.

 This is a combination of 3 commits.

Related: tdf#149484 Display BOOLEAN literal string text additions

xChange-Id: Ifbaf0b18178091c3a340a7c4bc66f78397aadc18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135506
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 2932dc7aa0c1239d39e060e6b7627317f1305549)

Resolves: tdf#149484 Read and handle <number:text> in <number:boolean-style>

xChange-Id: I1be5f2be908eb88aa4ef7436ea7c09f35b076acf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135507
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 025231224b8b076e280235cd2b943addd2fb0755)

Related: tdf#149484 Write proper <number:boolean-style> with <number:text>

xChange-Id: I46b7987dde25840ae0b6e5871b14e3806c6e4ac8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135508
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 33a8c4bd0e8533ab42894280e7e04c13a47aefa9)

Change-Id: I1be5f2be908eb88aa4ef7436ea7c09f35b076acf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135586
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 weeks agoResolves: tdf#148072 Restore sheet-local names for Undo of Cut
Eike Rathke [Thu, 9 Jun 2022 22:01:23 +0000 (10 00:01 +0200)]
Resolves: tdf#148072 Restore sheet-local names for Undo of Cut

Undo of Cut uses CopyToTable() and not UndoToTab() as Copy does,
so copy the sheet-local names also *from* Undo and not only *to*
Undo. And mark for ScAreasChanged broadcast.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135568
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit b7eddf3e9c2db503dde632b35513844806be3c36)

 Conflicts:
sc/source/core/data/table2.cxx

Change-Id: Ib07f711a7d407dafdf548873291f1ccc81b85d47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135587
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 weeks agoInsertMatrixFormula: correct references for across sheets array formulas
Eike Rathke [Mon, 30 May 2022 19:38:41 +0000 (30 21:38 +0200)]
InsertMatrixFormula: correct references for across sheets array formulas

Inserting an array/matrix formula across two or more
selected/marked sheets generated wrong matrix offset references
starting with the second sheet, pointing to the top left of the
first array formula. Only the top left cell of the inserted
formula on each sheet displayed the correct value. Deleting the
array formula on the first sheet then left all matrix offset
references on the remaining sheets with #REF! errors and those
cells could not be deleted anymore because their original parent
cell was gone.

Change-Id: If5d53311f9aabdcd7432ff26ab555bb91b0b121d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135147
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit dfd5081ff3973d5d0f216b06dda6360fa490cc9c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135154
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 weeks agosw: fix crash in SwLayoutFrame::GetContentPos
Xisco Fauli [Thu, 23 Jun 2022 10:27:34 +0000 (23 12:27 +0200)]
sw: fix crash in SwLayoutFrame::GetContentPos

FindPageFrame might return nullptr

See https://crashreport.libreoffice.org/stats/signature/SwLayoutFrame::GetContentPos(Point%20&,bool,bool,SwCursorMoveState%20*,bool)

Change-Id: Ic69d26de4ab234ebd6283ace640d689f0ebe8eb3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136307
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 7500c243fea02acbeaddf91f6b48a53d698c1cab)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136383
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 weeks agoexternal/liborcus: Fix heap-buffer-overflow
Stephan Bergmann [Fri, 24 Jun 2022 16:21:32 +0000 (24 18:21 +0200)]
external/liborcus: Fix heap-buffer-overflow

...as seen during CppunitTest_vcl_pdfexport:

> ==573913==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62b0001dba0e at pc 0x560576627186 bp 0x7ffeab9fa730 sp 0x7ffeab9f9ef0
> READ of size 26624 at 0x62b0001dba0e thread T0
>  #0 in StrtolFixAndCheck(void*, char const*, char**, char*, int) at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:3629:3
>  #1 in strtol at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:485:3
>  #2 in orcus::sax_token_handler_wrapper_base::attribute(std::basic_string_view<char, std::char_traits<char>>, std::basic_string_view<char, std::char_traits<char>>) at workdir/UnpackedTarball/liborcus/src/parser/sax_token_parser.cpp:344:22
>  #3 in orcus::sax_ns_parser<orcus::sax_token_parser<orcus::xml_stream_handler>::handler_wrapper>::handler_wrapper::attribute(orcus::sax::parser_attribute const&) at workdir/UnpackedTarball/liborcus/src/liborcus/../../include/orcus/sax_ns_parser.hpp:212:27
>  #4 in orcus::sax_parser<orcus::sax_ns_parser<orcus::sax_token_parser<orcus::xml_stream_handler>::handler_wrapper>::handler_wrapper, orcus::sax_parser_default_config>::attribute() at workdir/UnpackedTarball/liborcus/src/liborcus/../../include/orcus/sax_parser.hpp:570:15
>  #5 in orcus::sax_parser<orcus::sax_ns_parser<orcus::sax_token_parser<orcus::xml_stream_handler>::handler_wrapper>::handler_wrapper, orcus::sax_parser_default_config>::declaration(char const*) at workdir/UnpackedTarball/liborcus/src/liborcus/../../include/orcus/sax_parser.hpp:389:9
>  #6 in orcus::sax_parser<orcus::sax_ns_parser<orcus::sax_token_parser<orcus::xml_stream_handler>::handler_wrapper>::handler_wrapper, orcus::sax_parser_default_config>::element() at workdir/UnpackedTarball/liborcus/src/liborcus/../../include/orcus/sax_parser.hpp:242:13
>  #7 in orcus::sax_parser<orcus::sax_ns_parser<orcus::sax_token_parser<orcus::xml_stream_handler>::handler_wrapper>::handler_wrapper, orcus::sax_parser_default_config>::body() at workdir/UnpackedTarball/liborcus/src/liborcus/../../include/orcus/sax_parser.hpp:214:13
>  #8 in orcus::sax_parser<orcus::sax_ns_parser<orcus::sax_token_parser<orcus::xml_stream_handler>::handler_wrapper>::handler_wrapper, orcus::sax_parser_default_config>::parse() at workdir/UnpackedTarball/liborcus/src/liborcus/../../include/orcus/sax_parser.hpp:182:5
>  #9 in orcus::sax_ns_parser<orcus::sax_token_parser<orcus::xml_stream_handler>::handler_wrapper>::parse() at workdir/UnpackedTarball/liborcus/src/liborcus/../../include/orcus/sax_ns_parser.hpp:277:14
>  #10 in orcus::sax_token_parser<orcus::xml_stream_handler>::parse() at workdir/UnpackedTarball/liborcus/src/liborcus/../../include/orcus/sax_token_parser.hpp:215:14
>  #11 in orcus::xml_stream_parser::parse() at workdir/UnpackedTarball/liborcus/src/liborcus/xml_stream_parser.cpp:68:9
>  #12 in orcus::orcus_xls_xml::detect(unsigned char const*, unsigned long) at workdir/UnpackedTarball/liborcus/src/liborcus/orcus_xls_xml.cpp:94:16
>  #13 in orcus::detect(unsigned char const*, unsigned long) at workdir/UnpackedTarball/liborcus/src/liborcus/format_detection.cpp:68:9
>  #14 in (anonymous namespace)::OrcusFormatDetect::detect(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&) at sc/source/filter/orcus/filterdetect.cxx:83:31
> 0x62b0001dba0e is located 0 bytes to the right of 26638-byte region [0x62b0001d5200,0x62b0001dba0e)
> allocated by thread T0 here:
>  #0 in operator new[](unsigned long) at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:98:3
>  #1 in SvMemoryStream::AllocateMemory(unsigned long) at tools/source/stream/stream.cxx:1698:12
>  #2 in SvMemoryStream::SvMemoryStream(unsigned long, unsigned long) at tools/source/stream/stream.cxx:1544:9
>  #3 in (anonymous namespace)::OrcusFormatDetect::detect(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&) at sc/source/filter/orcus/filterdetect.cxx:71:20

This started to occur now after a95c585433246813096e8890b7ed6ef4fe30c621 "Pump
XInputStream into an SvMemoryStream rather than an OStringBuffer" no longer
guarantees that the memory range passed into

  orcus::detect(const unsigned char* buffer, size_t length)

is followed by a null byte at buffer[length].  (There appears to be no
documentation for that function, but it looks unreasonable to me that it should
require callers to provide a buffer thus terminated, and I rather assume that
what is observed here is an orcus bug.)

The problematic calls of std::strtol were used in code apparently meant to parse
strings matching the XML VersionNum grammar production, and then store the two
dot-separated numbers each as uint8_t.  The new code using a local readUint8
accepts a different set of strings now than the original code using std::strtol,
but the new set is arguably closer to what the actual XML VersionNum grammar
production accepts (which is '1.' [0-9]+ for XML 1.0 and '1.1' for XML 1.1), so
this change should be OK.

Change-Id: I1668542c96ced64667cb9f251e79126e1a54ac30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136405
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 3f17a643d0f943d02c7cb2b5d8e702fe0e63e38d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136417
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
3 weeks agotdf#149626 use recursive_mutex to fix hang in macro callback during dnd
Caolán McNamara [Fri, 24 Jun 2022 14:44:40 +0000 (24 15:44 +0100)]
tdf#149626 use recursive_mutex to fix hang in macro callback during dnd

See frame #5 and frame #45 where

both the same DNDEventDispatcher object and both functions lock m_aMutex which is a std::mutex since

commit 8de81db4e3fca488d50db2d74734109b31541a6f
Date:   Mon Aug 2 09:21:17 2021 +0200

    osl::Mutex->std::mutex in DNDEventDispatcher

 #0  0x00007ff094530c40 in __lll_lock_wait () at /lib64/libc.so.6
 #1  0x00007ff0945371d2 in pthread_mutex_lock@@GLIBC_2.2.5 () at /lib64/libc.so.6
 #2  0x00007ff08b901663 in __gthread_mutex_lock(pthread_mutex_t*) (__mutex=0x1a32c60)
     at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/x86_64-redhat-linux/bits/gthr-default.h:749
 #3  0x00007ff08b9024d5 in std::mutex::lock() (this=0x1a32c60) at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/std_mutex.h:100
 #4  0x00007ff08b9018f3 in std::scoped_lock<std::mutex>::scoped_lock(std::mutex&) (this=0x7ffdd0d79240, __m=...)
     at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/mutex:731
 #5  0x00007ff08b9006a8 in DNDEventDispatcher::dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x1a32c10, dtde=...)
     at vcl/source/window/dndeventdispatcher.cxx:156
 #6  0x00007ff075f47658 in GtkInstDropTarget::fire_dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x199eb40, dtde=...)
     at vcl/unx/gtk3/gtkinst.cxx:1710
 #7  0x00007ff0760a7010 in GtkInstDropTarget::signalDragMotion(_GtkWidget*, _GdkDragContext*, int, int, unsigned int)
     (this=0x199eb40, pWidget=0x1c67e40, context=0x1957450, x=89, y=175, time=0) at vcl/unx/gtk3/gtkframe.cxx:5026
 #8  0x00007ff07609bb77 in GtkSalFrame::signalDragMotion(_GtkWidget*, _GdkDragContext*, int, int, unsigned int, void*)
     (pWidget=0x1c67e40, context=0x1957450, x=89, y=175, time=0, frame=0x19b7d70) at vcl/unx/gtk3/gtkframe.cxx:4922
 #9  0x00007ff075649527 in _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINTv () at /lib64/libgtk-3.so.0
 #10 0x00007ff0865dcd5b in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
 #11 0x00007ff0865ddeb8 in g_signal_emit_by_name () at /lib64/libgobject-2.0.so.0
 #12 0x00007ff07595b491 in gtk_drag_dest_motion.lto_priv () at /lib64/libgtk-3.so.0
 #13 0x00007ff0757b8f7d in gtk_main_do_event () at /lib64/libgtk-3.so.0
 #14 0x00007ff0754e5463 in _gdk_event_emit () at /lib64/libgdk-3.so.0
 #15 0x00007ff075518056 in gdk_event_source_dispatch () at /lib64/libgdk-3.so.0
 #16 0x00007ff0864c3faf in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
 #17 0x00007ff0865192c8 in g_main_context_iterate.constprop () at /lib64/libglib-2.0.so.0
 #18 0x00007ff0864c1940 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
 #19 0x00007ff075f3e60f in GtkSalData::Yield(bool, bool) (this=0x952930, bWait=false, bHandleAllCurrentEvents=false) at vcl/unx/gtk3/gtkdata.cxx:405
 #20 0x00007ff075f43e43 in GtkInstance::DoYield(bool, bool) (this=0x9527e0, bWait=false, bHandleAllCurrentEvents=false) at vcl/unx/gtk3/gtkinst.cxx:428
 #21 0x00007ff08c2dc5df in ImplYield(bool, bool) (i_bWait=false, i_bAllEvents=false) at vcl/source/app/svapp.cxx:474
 #22 0x00007ff08c2dc24d in Application::Reschedule(bool) (i_bAllEvents=false) at vcl/source/app/svapp.cxx:493
 #23 0x00007ff091eeeb55 in SbiRuntime::Step() (this=0xa21eb20) at basic/source/runtime/runtime.cxx:801
 #24 0x00007ff091e0e659 in (anonymous namespace)::RunInitGuard::run() (this=0x76a6290) at basic/source/classes/sbxmod.cxx:1015
 #25 0x00007ff091e0d135 in SbModule::Run(SbMethod*) (this=0xa0ada00, pMeth=0xa16d7e0) at basic/source/classes/sbxmod.cxx:1176
 #26 0x00007ff091e0c503 in SbModule::Notify(SfxBroadcaster&, SfxHint const&) (this=0xa0ada00, rBC=..., rHint=...) at basic/source/classes/sbxmod.cxx:775
 #27 0x00007ff090b3ee6e in SfxBroadcaster::Broadcast(SfxHint const&) (this=0xa231de0, rHint=...) at svl/source/notify/SfxBroadcaster.cxx:39
 #28 0x00007ff091e1372e in SbMethod::Broadcast(SfxHintId) (this=0xa231ca0, nHintId=SfxHintId::BasicDataWanted) at basic/source/classes/sbxmod.cxx:2113
 #29 0x00007ff091f6ddfa in SbxObject::Call(rtl::OUString const&, SbxArray*) (this=0xa258670, rName="DTL_dragOver", pParam=0xa1e47d0)
     at basic/source/sbx/sbxobj.cxx:274
 #30 0x00007ff091d9dd76 in StarBASIC::Call(rtl::OUString const&, SbxArray*) (this=0xa258670, rName="DTL_dragOver", pParam=0xa1e47d0)
     at basic/source/classes/sb.cxx:1324
 #31 0x00007ff091dd7127 in (anonymous namespace)::BasicAllListener_Impl::firing_impl(com::sun::star::script::AllEventObject const&, com::sun::star::uno::Any*)
     (this=0xa2344a0, Event=..., pRet=0x0) at basic/source/classes/sbunoobj.cxx:3831
 #32 0x00007ff091dd6ba1 in (anonymous namespace)::BasicAllListener_Impl::firing(com::sun::star::script::AllEventObject const&) (this=0xa2344a0, Event=...)
     at basic/source/classes/sbunoobj.cxx:3855
 #33 0x00007ff091dd792f in (anonymous namespace)::InvocationToAllListenerMapper::invoke(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&)
     (this=0xa110b70, FunctionName="dragOver", Params=uno::Sequence of length 1 = {...}) at basic/source/classes/sbunoobj.cxx:3983
 #34 0x00007ff091dd7be7 in non-virtual thunk to (anonymous namespace)::InvocationToAllListenerMapper::invoke(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&) ()
     at /home/caolan/LibreOffice/core/instdir/program/libsblo.so
 #35 0x00007ff072d19921 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*)
     (pThis=0xa110b98, nVtableIndex=4, pRegisterReturn=0x7ffdd0d7b5c0, pReturnTypeRef=0xa875c0, bSimpleReturn=false, pStack=0x7ffdd0d7b5e0, nStack=0, pGPR=0x7ffdd0d7b900, pFPR=0x7ffdd0d7b8c0) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77
 #36 0x00007ff072d184fc in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**)
     (pThis=0xa238bb0, aVtableSlot=..., pReturnTypeRef=0xa875c0, nParams=4, pParams=0x2470e40, pUnoReturn=0x7ffdd0d7bb80, pUnoArgs=0x7ffdd0d7bbb0, ppUnoExc=0x7ffdd0d7bb60) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233
 #37 0x00007ff072d17c58 in unoInterfaceProxyDispatch(uno_Interface*, typelib_TypeDescription const*, void*, void**, uno_Any**)
     (pUnoI=0xa238bb0, pMemberDescr=0x24c98c0, pReturn=0x7ffdd0d7bb80, pArgs=0x7ffdd0d7bbb0, ppException=0x7ffdd0d7bb60)
     at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413
 #38 0x00007ff0472645ca in stoc_invadp::(anonymous namespace)::AdapterImpl::invoke(_typelib_TypeDescription const*, void*, void**, _uno_Any**)
     (this=0xa112060, pMemberType=0xa11be80, pReturn=0x7ffdd0d7c4f0, pArgs=0x7ffdd0d7bca0, ppException=0x7ffdd0d7bde0)
     at stoc/source/invocation_adapterfactory/iafactory.cxx:457
 #39 0x00007ff04726379d in stoc_invadp::adapter_dispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**)
     (pUnoI=0xa118a50, pMemberType=0xa11be80, pReturn=0x7ffdd0d7c4f0, pArgs=0x7ffdd0d7bca0, ppException=0x7ffdd0d7bde0)
     at stoc/source/invocation_adapterfactory/iafactory.cxx:605
 #40 0x00007ff072d04e95 in cpp2uno_call(bridges::cpp_uno::shared::CppInterfaceProxy*, _typelib_TypeDescription const*, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void**, void**, void**, unsigned long*)
     (pThis=0xa11b350, pMemberTypeDescr=0xa11be80, pReturnTypeRef=0x939280, nParams=1, pParams=0xa112460, gpreg=0x7ffdd0d7c520, fpreg=0x7ffdd0d7c540, ovrflw=0x7ffdd0d7c590, pRegisterReturn=0x7ffdd0d7c4f0) at bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:191
 #41 0x00007ff072d04611 in cpp_vtable_call(sal_Int32, sal_Int32, void**, void**, void**, sal_uInt64*)
     (nFunctionIndex=7, nVtableOffset=0, gpreg=0x7ffdd0d7c510, fpreg=0x7ffdd0d7c540, ovrflw=0x7ffdd0d7c590, pRegisterReturn=0x7ffdd0d7c4f0)
     at bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:389
 #42 0x00007ff072d29836 in privateSnippetExecutor () at /home/caolan/LibreOffice/core/instdir/program/libgcc3_uno.so
 #43 0x00007ff08b903787 in DNDListenerContainer::fireDragOverEvent(com::sun::star::uno::Reference<com::sun::star::datatransfer::dnd::XDropTargetDragContext> const&, signed char, int, int, signed char)
     (this=0x5a444c0, context=uno::Reference to ((anonymous namespace)::GtkDropTargetDragContext *) 0xa1dda68, dropAction=1 '\001', locationX=89, locationY=33, sourceActions=3 '\003') at vcl/source/window/dndlistenercontainer.cxx:224
 #44 0x00007ff08b900b7d in DNDEventDispatcher::fireDragOverEvent(vcl::Window*, com::sun::star::uno::Reference<com::sun::star::datatransfer::dnd::XDropTargetDragContext> const&, signed char, Point const&, signed char)
     (pWindow=0x5a27060, xContext=uno::Reference to ((anonymous namespace)::GtkDropTargetDragContext *) 0xa1dda68, nDropAction=1 '\001', rLocation=Point = {...}, nSourceActions=3 '\003') at vcl/source/window/dndeventdispatcher.cxx:297
 #45 0x00007ff08b9007f5 in DNDEventDispatcher::dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x1a32c10, dtde=...)
     at vcl/source/window/dndeventdispatcher.cxx:178
 #46 0x00007ff075f47658 in GtkInstDropTarget::fire_dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x199eb40, dtde=...)
    at vcl/unx/gtk3/gtkinst.cxx:1710

Change-Id: I06f24ac50d6d029803d46974162e1afec898d866
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136391
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
3 weeks agotdf#148138 change Text Boundaries color to Gray for Dark mode
Roman Kuznetsov [Tue, 21 Jun 2022 11:48:22 +0000 (21 13:48 +0200)]
tdf#148138 change Text Boundaries color to Gray for Dark mode

Change-Id: I276896d0ea94e741be8c0ae49f79f95769e0c2a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136234
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
(cherry picked from commit 4412044340ea8447058bb99f529310c2be56a5a9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136415

3 weeks agoFollow-up for Poppler 22.06 update
Nathan Pratta Teodosio [Tue, 21 Jun 2022 11:47:14 +0000 (21 08:47 -0300)]
Follow-up for Poppler 22.06 update

Change-Id: I8ee9f1a53cc4389e6a4d44e9765b478b5edfffd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136342
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit ad1ffc62e40c2409b610dfff25a8483b1f2556ad)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136382
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 weeks agoPPTX export: handle theme colors from the doc model for shape text
Miklos Vajna [Thu, 2 Dec 2021 07:45:26 +0000 (2 08:45 +0100)]
PPTX export: handle theme colors from the doc model for shape text

As a start, do this only in case there are no effects used. If there is
no theme color or there are effects, fall back to the old code.

Also move parseExportStream() from SdModelTestBaseXML up to MacrosTest,
so oox/ test code can use it as well.

(cherry picked from commit f36767fde87191258ea21f3faac0be6ad79328e0)

Conflicts:
oox/qa/unit/export.cxx

Change-Id: Ia76581dcef110341f6c3e60f22c34818ed0dcabc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136394
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
3 weeks agoPPTX export: write the theme for the master pages from the doc model
Miklos Vajna [Wed, 1 Dec 2021 10:48:17 +0000 (1 11:48 +0100)]
PPTX export: write the theme for the master pages from the doc model

The instant benefit is that now the name of the theme and the color
scheme are preserved, but this will also take changes done on the UI
into account (which is not true for the grab-bag).

(cherry picked from commit 5b253b2197e957fb5e42e3d0e233c10ac83afc10)

Change-Id: I162eb7275d5a69d66db71fc5cd6e2e3ec94725bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136373
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
3 weeks agosvx: update objects of pages of a master page when the theme changes
Miklos Vajna [Tue, 30 Nov 2021 07:44:02 +0000 (30 08:44 +0100)]
svx: update objects of pages of a master page when the theme changes

Only text color as a start, and without effects.

(cherry picked from commit 48f0c5f73f99c919ec24deadc96c3cf5483c9314)

Change-Id: I52b1c110870605134c414bcc94b50871cd49975b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136372
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
3 weeks agotools Color: implement MSO-style luminance modulation/offset filter
Miklos Vajna [Mon, 29 Nov 2021 07:28:28 +0000 (29 08:28 +0100)]
tools Color: implement MSO-style luminance modulation/offset filter

To be used when a filtered theme color will be applied on the UI, and
not at PPTX import time.

(cherry picked from commit 8662293d17a875f4389ea21be00e768e3de3d048)

Change-Id: Ifb56e38e59b529ef436063c407ee156d76a77f9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136371
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
3 weeks agouse SAL_UNLIKELY to make logging a little more efficient
Noel Grandin [Tue, 21 Jun 2022 10:10:21 +0000 (21 12:10 +0200)]
use SAL_UNLIKELY to make logging a little more efficient

if we have logging compiled into a release build, the most frequent
logging (e.g. INFO) is typically off, so most of the time, we are not
going to execute the logging.

Change-Id: I2b464b4153307df8730998728e508cce09d5013b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136212
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 1fd6298be955331f64f6f0b2e04675d9914f44e4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136379
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
3 weeks agoUpdate for Poppler 22.06
Nathan Pratta Teodosio [Tue, 21 Jun 2022 11:47:14 +0000 (21 08:47 -0300)]
Update for Poppler 22.06

Change-Id: I8ee9f1a53cc4389e6a4d44e9765b478b5edfffd3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136261
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 0d0469b4302dfe95b016a6f04b145834b79d5ed3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136319
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 weeks agoUpdate git submodules
Christian Lohmaier [Fri, 24 Jun 2022 12:17:03 +0000 (24 14:17 +0200)]
Update git submodules

* Update translations from branch 'distro/collabora/co-22.05'
  to 178d01d84358992a53f6e2d5aed3462ad89fd23a
  - update translations for 7.3.4 rc2

    and force-fix errors using pocheck

    Change-Id: I1c546a8267022fa3412f19d9a4c656a2d76339b3

  - update translations for 7.3.4 rc1

    and force-fix errors using pocheck

    Change-Id: I98e91f447d0a0e556b95b1e318dd94bfe13b7897

3 weeks agotdf#149574 sc: fix missing nullptr check
Attila Szűcs [Tue, 21 Jun 2022 13:27:35 +0000 (21 15:27 +0200)]
tdf#149574 sc: fix missing nullptr check

Regression from commit 605b4ba57b2daa447af9d43d3759079e15df8148
"tdf#43958 sc: fix fill by selecting merged cell".

Check if GetPattern(actual cell) is not nullptr, before using it.
This is not the real problem of Bug 149574, but it is a problem
anyway, and it fixes this bug. The real problem is the wrong
ViewData::nTabNo, that point to an already deleted table,
(fixed in 954d119db932434dc976ef739c643be0d9c7023c
"tdf#149502 sc: crash fix: Change in Table destruction").

Co-authored-by: Tibor Nagy (NISZ)
Change-Id: I26fc629ccf354c9e0c2662d61254d01be91d08f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136230
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit c4c827e1d370dcc351c4dddc601b3c37fc71564b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136323
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agoPump XInputStream into an SvMemoryStream rather than an OStringBuffer
Stephan Bergmann [Wed, 22 Jun 2022 18:37:34 +0000 (22 20:37 +0200)]
Pump XInputStream into an SvMemoryStream rather than an OStringBuffer

...to avoid overflow with streams >= 2^31 bytes.  This should fix
<https://crashreport.libreoffice.org/stats/crash_details/d9613c81-de37-4de2-8c64-e36634d10ddc>
which I could reproduce with a recent master Linux build with

> $ truncate -s 3G test.xml
> $ instdir/program/soffice test.xml

causing a SIGSEGV at

> #0  0x00007ffff7f193a0 in rtl::str::stringbuffer_insert<_rtl_String, char>(_rtl_String**, int*, int, char const*, int) (ppThis=0x7fffffffb330, capacity=<optimized out>, offset=2147479552, pStr=0x20a92e8 "", len=4096) at sal/rtl/strtmpl.hxx:1424
> #1  0x00007fffb6af04e5 in rtl::OStringBuffer::append(char const*, int) (len=4096, str=<optimized out>, this=0x7fffffffb330) at include/rtl/strbuf.hxx:594
> #2  (anonymous namespace)::OrcusFormatDetect::detect(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&) (this=<optimized out>, rMediaDescSeq=<optimized out>) at sc/source/filter/orcus/filterdetect.cxx:80
[...]

(Ideally, orcus::detect would only need a short prefix of the stream's content,
but the implementation in
workdir/UnpackedTarball/liborcus/src/liborcus/format_detection.cpp delegates to
functions like orcus_ods::detect in
workdir/UnpackedTarball/liborcus/src/liborcus/orcus_ods.cpp, which passes the
content through some zip_archive that presumably needs the full content.)

Change-Id: Ifaa37ee887d8296cbcf971313bde347ddfb17c12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136297
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit a95c585433246813096e8890b7ed6ef4fe30c621)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136253
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 weeks agogtk: fix leak in treeview tooltip
Caolán McNamara [Mon, 23 May 2022 11:23:22 +0000 (23 12:23 +0100)]
gtk: fix leak in treeview tooltip

Change-Id: Ib268729abf501da7e9f217ac3c3700cd853dfd43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134781
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 weeks agocrashtesting: assert seen with forum-mso-de-53682
Caolán McNamara [Wed, 22 Jun 2022 15:05:53 +0000 (22 16:05 +0100)]
crashtesting: assert seen with forum-mso-de-53682

not reproducible for me, but appears to be an empty string here
sometimes.

Change-Id: I8465f178cc7e5a6efdc08c1d15c154eeb2277c7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136247
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agosw: fix crash in SwEditWin::MouseButtonDown
Xisco Fauli [Wed, 22 Jun 2022 10:49:04 +0000 (22 12:49 +0200)]
sw: fix crash in SwEditWin::MouseButtonDown

Since GetPageAtPos might return nullptr

See https://crashreport.libreoffice.org/stats/signature/SwEditWin::MouseButtonDown(MouseEvent%20const%20&)

Change-Id: I4ad3492ef46bcd7b263a4de92efd9439a966fb56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136243
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 weeks agocrashreporting: apparent null derefs of SfxViewFrame::Current()
Caolán McNamara [Wed, 22 Jun 2022 10:02:43 +0000 (22 11:02 +0100)]
crashreporting: apparent null derefs of SfxViewFrame::Current()

Change-Id: I0e2c07a7eaa0a13be0a44c7cd187feec8ed4c2c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136241
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 weeks agoFix crash when no valid EntryDescriptor found
Samuel Mehrbrodt [Mon, 20 Jun 2022 08:27:26 +0000 (20 10:27 +0200)]
Fix crash when no valid EntryDescriptor found

When opening macro run dlg, the last selected entry is displayed again.
When no entry was found, a crash occured in some situations
(GetLastEntryDescriptor() returned garbage).

Initialize m_aLastEntryDesc properly, and make sure the method returns
when no last selected macro was found.

Also fix some nullptr crashes which occurred during UITests

Change-Id: I7bd1a0b8824725f9935876ae26d8222410a3bc25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136140
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
(cherry picked from commit 499ecbf3a36990c29dc7e1fb9b0ecb1d297c2848)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136170
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 2545a7700f8a4872fd18cb8b1fffeaa4599136d9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136236
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
3 weeks agotdf#149639 Missing #include <stdint.h> in various external code
Stephan Bergmann [Mon, 23 May 2022 08:21:54 +0000 (23 10:21 +0200)]
tdf#149639 Missing #include <stdint.h> in various external code

...which is a problem presumably since GCC 13 trunk
<https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=6f038efd93593da6e661b829d1bd3877e75550f1>
"libstdc++: Avoid including <cstdint> for std::char_traits".  (All the broken
C++ code used unqualified uintptr_t etc. rather than std::uintptr_t etc., so I
deemed it more appropriate to include <stdint.h> rather than <cstdint>.)

Change-Id: Id9dfc383c5986126a425971c4557b90ac45ac963
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134760
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 1e51a325a8e21eb5f900336a0c9e1bd78ed330ab)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136163
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 weeks agoSukapura: tdf#149008 differentiate Description and Caption icons
Rizal Muttaqin [Sun, 19 Jun 2022 23:25:27 +0000 (20 06:25 +0700)]
Sukapura: tdf#149008 differentiate Description and Caption icons

Change-Id: I063e2d881fb17516dd2a76ede76d8d5b2831b1fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136130
Tested-by: Jenkins
Reviewed-by: Rizal Muttaqin <rizmut@libreoffice.org>
3 weeks agoSifr: tdf#149008 differentiate Description and Caption icons
Rizal Muttaqin [Sun, 19 Jun 2022 23:49:13 +0000 (20 06:49 +0700)]
Sifr: tdf#149008 differentiate Description and Caption icons

Change-Id: I5fdcd8bc72516153fd027460dcf5c58285573cab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136128
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 weeks agotdf#141186 ensure child of collapsed expander is not mapped
Caolán McNamara [Wed, 18 May 2022 15:33:57 +0000 (18 16:33 +0100)]
tdf#141186 ensure child of collapsed expander is not mapped

If the expander is initially collapsed then when mapped all its children
are mapped too.

If they are mapped then the mnemonics of the children are taken into
account on shortcuts and non-visible children in a collapsed expander
can be triggered which is confusing.

If the expander is expanded and collapsed the child is unmapped
and the problem doesn't occur.

So to avoid the problem of an initially collapsed expander, listen to
the map event and if the expander is mapped but collapsed then unmap the
child of the expander.

Change-Id: Ib4c7a704295b338230357c4c4102a3692f8a9707
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134453
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 weeks agotdf#128196: filenames containing # get truncated when saving to GVFS
Julien Nabet [Sat, 18 Jun 2022 13:14:33 +0000 (18 15:14 +0200)]
tdf#128196: filenames containing # get truncated when saving to GVFS

+ replace getLength() by a call to isEmpty() since we're here

Change-Id: I77a318ea3e8ceeeddd6c64cee25aa6700cb3457b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136084
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
(cherry picked from commit 2a38c834c8b7712421f1125aa0e382de70767b55)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136122
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 weeks agoShow start center when closing last document
Samuel Mehrbrodt [Wed, 15 Jun 2022 12:25:36 +0000 (15 14:25 +0200)]
Show start center when closing last document

also when there are active UNO connections.

(Behavior was different when there were active UNO connections)

Change-Id: Ief37b0f362b7e2a47eccbec985ee3017c475046c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135905
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
(cherry picked from commit 539374caa5deac788f394a54a75b6e167ab04864)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135940
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
3 weeks agotdf#135976 sw: preserve flys on backspace/delete with redlining enabled
Michael Stahl [Wed, 15 Jun 2022 13:08:16 +0000 (15 15:08 +0200)]
tdf#135976 sw: preserve flys on backspace/delete with redlining enabled

This is a continuation of commit 85376a02348810812d515ee72140dbf56f2b6040
for the case when redlining is turned on.

Also try to restore the anchors in SwUndoRedlineDelete.

(regression from commit 3345feb67f2c49a1b76639965b56968e1c5f03ee)

Change-Id: I4199f5755398d469a606618c037ad9756cb7aeba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135909
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 932a8efce878547bfd81521d0cf1ddfe8dc33ec6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135968
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
3 weeks agoKJ: tdf#149008 differentiate Description and Caption icons
Rizal Muttaqin [Mon, 20 Jun 2022 02:24:22 +0000 (20 09:24 +0700)]
KJ: tdf#149008 differentiate Description and Caption icons

Change-Id: I6f02d336c1da9108199a3aa83efe033b84784a48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136134
Tested-by: Rizal Muttaqin <rizmut@libreoffice.org>
Reviewed-by: Rizal Muttaqin <rizmut@libreoffice.org>
(cherry picked from commit 39ffe421047e69554e601cedf0fde931ccc18ca7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136132
Tested-by: Jenkins
3 weeks agoelementary tdf#149008 differentiate Description and Caption icons
Rizal Muttaqin [Sun, 19 Jun 2022 07:58:25 +0000 (19 14:58 +0700)]
elementary tdf#149008 differentiate Description and Caption icons

Change-Id: Ie05280cb594a748f9189eafccea2b219316065ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136098
Tested-by: Jenkins
Reviewed-by: Rizal Muttaqin <rizmut@libreoffice.org>
(cherry picked from commit a1b01a1840e119a055d1c237e65892f69d3f45a9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136116

3 weeks agoelementary Sifr: tdf#144303 Calc cross cursor
Rizal Muttaqin [Sun, 19 Jun 2022 04:17:23 +0000 (19 11:17 +0700)]
elementary Sifr: tdf#144303 Calc cross cursor

Change-Id: I2805060487720a434f3b68b24ca05d576d10d717
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136097
Tested-by: Jenkins
Reviewed-by: Rizal Muttaqin <rizmut@libreoffice.org>
(cherry picked from commit 5b4d85247d96e4e70d35fff4b4e08f3cd2453c20)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136114

3 weeks agoBreeze: tdf#138400 update General Format icons
Rizal Muttaqin [Fri, 17 Jun 2022 23:15:36 +0000 (18 06:15 +0700)]
Breeze: tdf#138400 update General Format icons

Change-Id: I7daad09129c505e300d84634768f4bcf14653500
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136069
Tested-by: Jenkins
Reviewed-by: Rizal Muttaqin <rizmut@libreoffice.org>
(cherry picked from commit 4207f5c291902cd157f204e4f025b040f4445912)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136041
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 weeks agorhbz#2097411 Avoid obsolete PyThreadState_Delete crashing Python 3.11
Stephan Bergmann [Thu, 16 Jun 2022 16:58:18 +0000 (16 18:58 +0200)]
rhbz#2097411 Avoid obsolete PyThreadState_Delete crashing Python 3.11

1fb53a637597f76bea86514b62ddfad34f60c889 "pyuno_loader::CreateInstance: delete
the initial PyThreadState" had added the PyThreadState_Delete for claimed
benefits but whose details appear lost to history (cf. the comment thread
starting at
<https://gerrit.libreoffice.org/c/core/+/3452/2#message-602ff52abdd1c95fd5c13cfe405b5fadd0048c5f>
"pyuno_loader::CreateInstance: delete the initial PyThreadState").  And at least
a recent master Linux --enable-python=fully-internal build with the bundled
Python 3.8.12 appears to succeed `make check` just fine with the
PyThreadState_Delete temporarily removed.

But on the other hand, building against upcoming Python 3.11 now started to make
CppunitTest_services fail with

> Fatal Python error: init_threadstate: thread state already initialized
> Python runtime state: initialized
> Thread 0x0000ffff81c8b020 (most recent call first):
>   <no Python frame>
> Fatal exception: Signal 6
> Stack:
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libuno_sal.so.3(+0x37c28)[0xffff81be7c28]
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libuno_sal.so.3(+0x37e40)[0xffff81be7e40]
> linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0xffff81ccb7ec]
> /lib64/libc.so.6(+0x82878)[0xffff81742878]
> /lib64/libc.so.6(raise+0x20)[0xffff816fae00]
> /lib64/libc.so.6(abort+0xe8)[0xffff816e72b8]
> /lib64/libpython3.11.so.1.0(+0x104e28)[0xfffee4de4e28]
> /lib64/libpython3.11.so.1.0(+0x105200)[0xfffee4de5200]
> /lib64/libpython3.11.so.1.0(PyThread_get_thread_native_id+0x0)[0xfffee4ed6764]
> /lib64/libpython3.11.so.1.0(PyThreadState_New+0x14)[0xfffee4ed6628]
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libpyuno.so(_ZN5pyuno14PyThreadAttachC2EP3_is+0x78)[0xfffee4c8c52c]
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libpythonloaderlo.so(pyuno_Loader_get_implementation+0x5c)[0xfffee5243060]
> /builddir/build/BUILD/libreoffice-7.3.4.2/instdir/program/libuno_cppuhelpergcc3.so.3(+0x544b4)[0xffff815544b4]

because of the PyThreadState_Delete.  (The deleted PyThreadState, while not
reused again directly, is still recorded in the state obtained from
PyInterpreterState_Head() later.)

So conservatively keep the PyThreadState_Delete of unclear benefit for older
Python versions and only drop it for 3.11 where it is known to have negative
effects now.

Change-Id: I9b99f1e947f0b165ddc95c2bfbd764858dda39db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136006
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 1638b4f78af70b7b97d0a081ed51390dd87bf1f9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136025
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 weeks agotdf#149529 crash on deref deleted ScDocument*
Caolán McNamara [Thu, 16 Jun 2022 12:47:31 +0000 (16 13:47 +0100)]
tdf#149529 crash on deref deleted ScDocument*

maybe a problem since

commit 46419cd7a2d453c6f252c28dfb9dbfb08605e1c4
Date:   Tue Jun 18 15:11:30 2013 -0400

    ScFormulaCell is no longer a child class of ScBaseCell.

    Change-Id: Id33072f193045e2eaf51373b47dac803f9a5d52c

presumably the cloned ScColorScaleEntry should end up with
a ScFormulaCell for the destination document and not the source one

Change-Id: I451d5827be183198b61116ab8c582cfda03b2031
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135998
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit 10404751bcb643605c50d530e3855ae005e60a5e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135992

3 weeks agosw: fix odd m_bCanGroup check in SwUndoRedlineDelete
Michael Stahl [Wed, 15 Jun 2022 13:06:59 +0000 (15 15:06 +0200)]
sw: fix odd m_bCanGroup check in SwUndoRedlineDelete

This looks like copypasta, presumably both flags must be true to allow
grouping.

Change-Id: I96afeac98f94b122a3b1a155940776a3aa44b0a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135908
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit f31f11f3222933dbc96dc672e6fa52233cda12be)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135934
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agoMake sure pEntry is not null
Samuel Mehrbrodt [Wed, 15 Jun 2022 14:54:55 +0000 (15 16:54 +0200)]
Make sure pEntry is not null

Crash seen:
> mergedlo.dll!SvTreeList::GetDepth(const SvTreeListEntry * pEntry) line 106
  mergedlo.dll!SalInstanceTreeView::get_iter_depth(const weld::TreeIter & rIter) line 4230
  basctllo.dll!basctl::SbTreeListBox::FindVariable(const weld::TreeIter * pEntry) line 271
  basctllo.dll!basctl::SbTreeListBox::FindModule(const weld::TreeIter * pEntry) line 695
  basctllo.dll!basctl::MacroChooser::BasicSelectHdl(weld::TreeView & __formal) line 473
  basctllo.dll!basctl::MacroChooser::RestoreMacroDescription() line 158
  basctllo.dll!basctl::MacroChooser::run() line 178

Change-Id: Ic85758c0bbee952d0a23b1d52e8bbdd231e8de26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135914
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
(cherry picked from commit 21747f8ef471080817db464a91ef203813e84677)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135938
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agotdf#139982 sw: preserve flys in Replace with redlining enabled
Michael Stahl [Fri, 10 Jun 2022 14:26:40 +0000 (10 16:26 +0200)]
tdf#139982 sw: preserve flys in Replace with redlining enabled

The problem is that there isn't a redline type "Replace" so it's
represented as Delete+Insert.

To prevent the flys anchored in the text from being deleted, move the
anchors to the point between the old (deleted) and new (inserted) text.

(regression from commit 28b77c89dfcafae82cf2a6d85731b643ff9290e5)

Change-Id: Ib600c9dbfb9421917e4b8d61195c48cf0b364f06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135604
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 646c6ddd91a98afddf914e3889cb269fc814c060)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135737
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
3 weeks agosw_redlinehide: skip unnecessary updates when undoing redlined delete
Michael Stahl [Tue, 14 Jun 2022 15:19:23 +0000 (14 17:19 +0200)]
sw_redlinehide: skip unnecessary updates when undoing redlined delete

When reproducing tdf#135976 and then Undo, an UAF crash happens here:

  assert(!pFrame->GetDrawObjs() || !pObjs->Contains(*pObj));

The pObjs was actually deleted and then re-created, because the pObj was
removed from the frame and added again to the same frame.

This is a bit unexpected, so prevent it by taking a shortcut in the
caller UpdateFramesForRemoveDeleteRedline() to insert a check that had
been removed in commit 14e87a4b15d31a34e6053f6194688f3aa23af991.

If the rPam is inside a single node, the sw::RedlineUnDelText hint that
was sent to the SwTextFrame should be sufficient to update it and the
rest of the code in the loop that deals with newly split paragraph can
be skipped.

Change-Id: I5f36eb91bc20003887ee0bad03ea4a6e67135de9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135907
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit cf9a16caf5012d65b2a45a5525e36e40585dd35c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135892
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
3 weeks agotdf#131506 tdf#143031 EMF+ Fix displaying PathGradient fill
Bartosz Kosiorek [Sun, 12 Jun 2022 19:51:52 +0000 (12 21:51 +0200)]
tdf#131506 tdf#143031 EMF+ Fix displaying PathGradient fill

With previous implementation, the EMF+ import is calculating
gradient positions wrongly. It is causing warning:

  SvgGradientHelper got invalid SvgGradientEntries outside [0.0 .. 1.0]

and the gradient was not displayed at all.
This patch fixes that and gradient is displayed correctly

Change-Id: I6229c516165436d0c7ae187d9eb69b5494da396f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135607
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
(cherry picked from commit 7b12c659842eb53b96dd98ecea65c6071506dfbb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135746
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135858

3 weeks agoFix leak with stock widgets in a dialog from an extension
Samuel Mehrbrodt [Thu, 2 Jun 2022 13:51:47 +0000 (2 15:51 +0200)]
Fix leak with stock widgets in a dialog from an extension

When loading a dialog from XDL, buttons can have dlg:button-type="cancel"
or dlg:button-type="help". These buttons might not have a peer when
they are not referenced from the extension.

In this case, they also weren't disposed when the dialog was disposed,
leading to an abort on exit.

Change-Id: I799d7535b766984fde47cafbe41ee6e89e476205
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135266
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
(cherry picked from commit 4879f99b824036b3d409ed52f74dc3eb3b4949e4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135745
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 weeks agocrashtesting: negative index seen on loading forum-de3-15472.ods
Caolán McNamara [Tue, 14 Jun 2022 11:24:41 +0000 (14 12:24 +0100)]
crashtesting: negative index seen on loading forum-de3-15472.ods

Change-Id: I737e6132f117a85c4d7e5df4a33561d09eff86af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135837
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agotdf#149536 Move Up/Down in Data Table switched enabled statuses
Aron Budea [Tue, 14 Jun 2022 03:18:02 +0000 (14 05:18 +0200)]
tdf#149536 Move Up/Down in Data Table switched enabled statuses

Regression from aa7e7747f4296b3b92379c3c7703b80ad8af6a8b.

Change-Id: Id2b66b2e87fdb13a55b32a4989cae2c7796fd003
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135801
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
(cherry picked from commit b33d89d8e97ba4bfb17743632dee471727d11ac5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135848
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agocrashtesting: assert seen on loading forum-en-38962.ods
Caolán McNamara [Tue, 14 Jun 2022 11:56:41 +0000 (14 12:56 +0100)]
crashtesting: assert seen on loading forum-en-38962.ods

mismatched Push/Pop, catch offending exception

Change-Id: Ib2297a8ab04a2f2491e4c922d9e4db82a66ea911
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135841
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agotdf#148868 sw: handle selection then Insert similar to Replace
Michael Stahl [Fri, 10 Jun 2022 16:25:05 +0000 (10 18:25 +0200)]
tdf#148868 sw: handle selection then Insert similar to Replace

... if the selection is inside one paragraph, to avoid deleting flys
anchored in the selection.

From a code point of view it's a bit inconsistent to do this, but
from user point of view there are some ways to conveniently create
a selection such as by double clicking a word.

(see also tdf#133957)

Also in SwWrtShell::AutoCorrect(), which oddly enough might get called
with a selection from textsh*.cxx, at least in theory.

Change-Id: I8cf9459e5a7ec7754ce8fe323cd158c7e84a5c93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135606
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit d72bee64a97650507d042f17846b6fc427b8434c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135839
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agocrashtesting: crash seen on exporting forum-it-5909.ods to xlsx
Caolán McNamara [Tue, 14 Jun 2022 09:51:13 +0000 (14 10:51 +0100)]
crashtesting: crash seen on exporting forum-it-5909.ods to xlsx

Change-Id: I64b629e2f5b0ece7f903049bd006775463f97586
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135752
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agotdf#149507 sw: don't delete bookmarks in SwUndoInsLayFormat::UndoImpl()
Michael Stahl [Mon, 13 Jun 2022 13:59:12 +0000 (13 15:59 +0200)]
tdf#149507 sw: don't delete bookmarks in SwUndoInsLayFormat::UndoImpl()

The problem is that the CorrAbs() here deletes the bookmarks in the fly,
and this isn't supposed to happen at this point, because DelFly() will
call SaveSection(), which saves the bookmarks in the m_pHistory via
DelContentIndex(), so that they can be re-inserted in Redo/InsFly().

Also change the code that was inserted in commit
0ee28fdf3e9a0bd8763eda6299af1d5c873a9dcf to not call CorrAbs().

(although this bug has existed forever, crashing is a regression from
 commit 657de5fba12b0e9afcdee361654d2a2d0dbd7311)

Change-Id: Iabac0ccf5587d5d974e88cbbc3e05bbaed3526f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135728
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 6de844c5da695bf4605bef5510d33e74a7ff04ee)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135750
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
3 weeks agosc: ODF export: fix style:font-name on EE text/paragraph styles
Michael Stahl [Sun, 12 Jun 2022 19:48:58 +0000 (12 21:48 +0200)]
sc: ODF export: fix style:font-name on EE text/paragraph styles

The problem is that sc contains its own duplicate export of EditEngine
styles, where the SvxFontItem aFamilyName is exported directly to
style:font-name.

But style:font-name refers to a style:font-face, and for a given font
family name there may be multiple font-face elements whose names have a
counter appended, and they are written in some non-deterministic order,
so effectively this picks font-face at random.

In XMLTextExportPropertySetMapper::ContextFontFilter() there is already
code to do the lookup, and also a fallback when the lookup fails to a
set of individual attributes fo:font-family style:font-style-name
style:font-family-generic etc., which is actually used for fonts in
control shapes, which have "unknown" for one of the components, so there
could be some other problem with them.

It doesn't look possible for the lookup to fail for EditEngine items, as
ScXMLFontAutoStylePool_Impl should have added all of them.

This problem was detected by current ODFunDiff in 22 of 2000 ODS files;
with this fix only other problems remain.

Change-Id: I276f705296df628b0869526f4ea676c47a014328
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135684
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 32dd76143bdf55ac73f03f705097453521b4bf2c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135735
Reviewed-by: Eike Rathke <erack@redhat.com>
3 weeks agotdf#140007 sw: fix SwUndoReplace
Michael Stahl [Thu, 9 Jun 2022 16:58:06 +0000 (9 18:58 +0200)]
tdf#140007 sw: fix SwUndoReplace

(regression from commit d6b0e84b236b78f4b21bd16e46dda3fa0876096d)

Change-Id: I1facf1584a349d1d087438f4e6fd3a63a80c6f7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135585
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 45613274794636ba98d0e978fe872511297d275d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135549
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agocrashtesting: fix crash seen on loading forum-mso-de-98993.xlsx
Caolán McNamara [Sun, 12 Jun 2022 15:57:38 +0000 (12 16:57 +0100)]
crashtesting: fix crash seen on loading forum-mso-de-98993.xlsx

which may explain the backtraces seen with BitmapFilterStackBlur::filter
and BitmapBasicMorphologyFilter::filter in crashreporting

Change-Id: Ib55cde1603d354b8ca0e336a08fe2d73b548f73f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135695
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agotdf148321: convert OOXML inset values to text distance values
Tomaž Vajngerl [Mon, 6 Jun 2022 20:53:23 +0000 (6 22:53 +0200)]
tdf148321: convert OOXML inset values to text distance values

Inset values for top, bottom are calcualted differently in OOXML
and need to be coverted on import to the text distance LO values,
that place the text relative to the shape correctly.

At export, the values can be converted back to the OOXML inset
compatible values, but the values are not always converted back to
the same values as the conversion is not bijective, however they
do render the same.

This also adds the test for the conversion when importing and
checks that the exported values are expected.

Change-Id: Ic64eec1a2a80ddad997f916da3e87dc30aaa12be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135463
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit e216988657e20a1e52986f742ab60464697bcb41)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135504
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
3 weeks ago(related: tdf#139514) sw: fix Undo of delete with at-para fly
Michael Stahl [Wed, 8 Jun 2022 15:34:32 +0000 (8 17:34 +0200)]
(related: tdf#139514) sw: fix Undo of delete with at-para fly

Nonobviously, there are situations where the anchor node must be
preserved and restored when it's not on the node that is being deleted.

(probably regression from commit 91b2325808a75174f284c48c8b8afc118fad74e4)

Change-Id: I39f09ddb631204c8ad522f9ec7068d235ca94ad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135509
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 12acdce71dd6b6af2c52ba8fa3248d3166418543)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135518
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
3 weeks agotdf#133957 sw: don't delete flys on Backspace/Delete keys
Michael Stahl [Tue, 7 Jun 2022 17:01:24 +0000 (7 19:01 +0200)]
tdf#133957 sw: don't delete flys on Backspace/Delete keys

Also fixes: tdf#134007 tdf#138835 tdf#139514

When a character is deleted via the keyboard by Backspace or Delete key,
an artificial selection is created in SwWrtShell::DelLeft()/DelRight().

Ideally this should not delete flys that may be anchored to the
paragraphs, but unfortunately this may happen if there are only 2 empty
paragraphs in the section, because then the artificial selection cannot
be distinguished by the SwDoc implementation from a selection from
Ctrl+A (Select All), which *should* delete the flys.

So introduce a new flag that needs to be passed down multiple layers so
that SwUndoDelete can use it to determine if flys should be deleted, and
translating it to a flag that had been introduced to preserve flys in
ReplaceRange() previously.

There are a couple more callers that look like they want to "replace"
some text, so guess a bit at where to set this new flag.

(note: of course fly anchored *as char* must be deleted via keys.)

(regression from commit e75dd1fc992f168f24d66595265a978071cdd277)

Change-Id: Ib4467476b12a12aefbbcb74ab9802f9318cf9aa0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135476
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 85376a02348810812d515ee72140dbf56f2b6040)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135517
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
3 weeks agotdf#149503: Check size of vectors
Xisco Fauli [Fri, 10 Jun 2022 08:04:15 +0000 (10 10:04 +0200)]
tdf#149503: Check size of vectors

Crash introduced by 41f95c4a35a6335e9edb2f51c11d136d88bd0749
"Remove SC_DPOUT_MAXLEVELS limit in Pivot"

This brings back the old behaviour and now the
"You cannot change this part of the pivot table." message
is displayed again

Change-Id: Ibad84c0a279d7d67b709b7e311ac875739cdb210
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135578
Tested-by: Eike Rathke <erack@redhat.com>
Reviewed-by: Eike Rathke <erack@redhat.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135717
Tested-by: Jenkins
3 weeks agoautocorr for da: fx can appear at end of sentence
Christian Lohmaier [Tue, 10 May 2022 08:54:15 +0000 (10 10:54 +0200)]
autocorr for da: fx can appear at end of sentence

as in e.g. "Vi kunne jo tage bussen, fx." so remove the "fx." entry from
the autocorrect list

Change-Id: I5c03f46bd1e35fcf8fa731983c7459f2ba99b174
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134107
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
(cherry picked from commit 3a688ca467cebd65ef30ab80d4211715b1665348)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135706
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 weeks agoRelated: tdf#149490 OLE Object dialog should be modal
Caolán McNamara [Sat, 11 Jun 2022 15:13:45 +0000 (11 16:13 +0100)]
Related: tdf#149490 OLE Object dialog should be modal

Change-Id: I909f2afbf149c4d92c97e04c2d8f93648e1e3162
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135636
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 weeks agotdf#135346 clear page row map to avoid invalid "hidden" flags
Tomaž Vajngerl [Thu, 9 Jun 2022 22:33:09 +0000 (10 00:33 +0200)]
tdf#135346 clear page row map to avoid invalid "hidden" flags

With the print range cache surviving a longer time, we can get to
a state where we reuse the page row map (m_xPageRows) that had
older "hidden rows" flags still set, but they aren't valid for
our new recalculated ranges. The result for this is that in the
bug document, the print preview is empty (as hidden flags for the
rows was kept but not valid anymore).

We don't really benefit from keeping this map, so we can just
clear it when we need to recalculate the print ranges.

Change-Id: I1f8de889d6f006e700c6f21ef5bfa52a36bcdfc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135567
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 317dc8569723d434fe4175a2b665b84fd15f6f99)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135540
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agoResolves: tdf#142368 drop popover on ControlLoseFocus
Caolán McNamara [Thu, 9 Jun 2022 11:46:49 +0000 (9 12:46 +0100)]
Resolves: tdf#142368 drop popover on ControlLoseFocus

which is what appears when the Control derived inputbar loses focus
while the main window losing focus gives WindowLoseFocus

Change-Id: Iae9a2874c3dd513a1a092a18846858f819542370
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135534
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 weeks agoGtkIconView uses a different way to link model and view
Caolán McNamara [Wed, 8 Jun 2022 18:44:05 +0000 (8 19:44 +0100)]
GtkIconView uses a different way to link model and view

Change-Id: I1ad2734c9f28568433de8b9532cf20da8a27f7cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135391
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
3 weeks agovcl: WhitespaceToSpace() spurious -Werror=maybe-uninitialized
Michael Stahl [Sun, 22 May 2022 10:51:35 +0000 (22 12:51 +0200)]
vcl: WhitespaceToSpace() spurious -Werror=maybe-uninitialized

vcl/source/helper/strhelper.cxx:366:9: error: ‘pBuffer[-1]’ may be used uninitialized [-Werror=maybe-uninitialized]

Change-Id: I37250b0790bd9c33eb01c552c8267251bc0026f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134738
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit cd4976646dc2e5b28c3328a7fa96361e147b23b9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134631
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
3 weeks agotdf#137471 Qt return frame pos + client area size
Jan-Marek Glogowski [Sun, 5 Jun 2022 06:55:43 +0000 (5 08:55 +0200)]
tdf#137471 Qt return frame pos + client area size

My code comment about "drawable area" and Michaels bug comment
12 about the "frameGeometry()" usage were both half right. LO
expects the window's frame position and the drawable client area
size almost everywhere when "geometry" is involved. The frame's
border is stored in the decorations members of SalFrameGeometry.

Change-Id: Ic00ad1f1d74d7afadcaca0c01e1a41ea7f2833de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135434
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
(cherry picked from commit 3f8d3fd4649ef09e86c735617383a4bda0425540)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135375
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
3 weeks agoRelated: tdf#149408 various crashes seen in redline panel
Caolán McNamara [Wed, 1 Jun 2022 10:58:32 +0000 (1 11:58 +0100)]
Related: tdf#149408 various crashes seen in redline panel

with this writer in calc ole case

Change-Id: I1ecd7725703674cc1bcfc9b3d411ec890bfe4bcc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135238
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
3 weeks agohandle nullptr SharedString in ScQueryEvaluator (tdf#149679)
Luboš Luňák [Thu, 23 Jun 2022 14:39:39 +0000 (23 16:39 +0200)]
handle nullptr SharedString in ScQueryEvaluator (tdf#149679)

This may be the case if the string comes from ScMatrix::Get()
for ScMatValType::Empty.

Change-Id: I35013449611bf7ffd1bc74e023d76597af010724
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136347
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
(cherry picked from commit 9e170a35eebbe86e6137510bc8ea34e5a45dbd8d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136332
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
3 weeks agoFix shape rectangle calculation
Mike Kaganski [Wed, 22 Jun 2022 13:22:50 +0000 (22 16:22 +0300)]
Fix shape rectangle calculation

At specific screen resolutions, caused failed CppunitTest_sc_shapetest:

  C:/lo/src/core/sc/qa/unit/scshapetest.cxx(169) : error : Assertion
  Test name: sc_apitest::ScShapeTest::testTdf137576_LogicRectInDefaultMeasureline
  assertion failed
  - Expression: std::abs(rExpected.Y() - rActual.Y()) <= nTolerance
  - after reload Y expected 9731 actual 10287 Tolerance 1

which manifested the actual wrong position of shape written into ODF.
Commit cd966aac6ecd8ce606ac3f2ccd602e467114ba3f
  Author Regina Henschel <rb.henschel@t-online.de>
  Date   Fri Dec 25 19:27:51 2020 +0100
    tdf#137033 improve save of cell anchored shapes

had corrected the calculation of anchor point, but the overlook was
that in some cases of non-transformed shapes, rMyCell.maCellAddress
may differ from pObjData->maStart. Since aSnapStartAddress could be
not set to pObjData->maStart for such shapes, the wrong cell range
could be calculated for resized-with-cell objects.

Fix this by using pObjData->maStart whenever there is pObjData. If
it turns out that in some cases, rMyCell.maCellAddress is needed in
calculations before the 'if (rShape.bResizeWithCell && pObjData)',
aSnapStartAddress should be assigned to pObjData->maStart after the
check.

Change-Id: I7e0dc834c2ffb147430fb5b2cb8bdb4dca201b3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136285
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 7d5dcf5f547e29d61e788b88f7a3f7b4feafb6b2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136314
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
4 weeks agolok: fix position for cell item list dropdown
Szymon Kłos [Tue, 21 Jun 2022 09:26:22 +0000 (21 11:26 +0200)]
lok: fix position for cell item list dropdown

Change-Id: I911199970d8c01fcf0767b974936d077f48fc89c

4 weeks agojsdialog: send grab_focus action
Szymon Kłos [Mon, 20 Jun 2022 18:10:30 +0000 (20 20:10 +0200)]
jsdialog: send grab_focus action

- disable jsdialogs for navigator panel for now because it breaks
  tests but is not used in online yet

Change-Id: Ib91050363add8cda1c386627c312b79e0f62b99e

4 weeks agojsdialog: formulabar: handle multiline selection
Szymon Kłos [Wed, 15 Jun 2022 08:02:59 +0000 (15 10:02 +0200)]
jsdialog: formulabar: handle multiline selection

it uses format: "start;end;startPara;endPara"

Change-Id: If3d36550f5e4a35fc04c72114c7719119b10da61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135866
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
4 weeks agojsdialog: formulabar: send also paragraph number for multiline formula
Szymon Kłos [Tue, 14 Jun 2022 14:59:32 +0000 (14 16:59 +0200)]
jsdialog: formulabar: send also paragraph number for multiline formula

Change-Id: Ia146be83f0ac6f3fbc94d5a904b8067ac8b2a8d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135833
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
4 weeks agofix SwViewShellImp::AddPaintRect() for sub-rects (tdf#146536)
Luboš Luňák [Mon, 20 Jun 2022 10:32:07 +0000 (20 12:32 +0200)]
fix SwViewShellImp::AddPaintRect() for sub-rects (tdf#146536)

Using just two corners to build the new resulting rect works only
if the new rectangle actually really extends the previous one,
but the <= means that this may compress also rects that are already
contained in the previous rect, in which case it's necessary to
make sure to use union to get the larger coordinate).

Change-Id: Ie4303dfef903bded6d63625531e424a32cc01b06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136144
Tested-by: Luboš Luňák <l.lunak@collabora.com>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
(cherry picked from commit a6b9fbfc15b9e1756ac8ea939b4c588e3f170c1d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136159
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
4 weeks agosw HTML export, XHTML mode: fix lost <li> with a list header + item
Miklos Vajna [Thu, 16 Jun 2022 13:55:23 +0000 (16 15:55 +0200)]
sw HTML export, XHTML mode: fix lost <li> with a list header + item

There is a general mismatch between XHTML and Writer lists: XHTML can
only contain list items (for ordered or unordered lists), while Writer
can contain list headers and list items. List headers have no bullet or
number at the start, list items are the normal text nodes.

Commit 8c2607ae3ce143586e623532b8ae5288277ec3ac (sw HTML export, XHTML
mode: fix lost </li> when last list item is not numbered, 2022-02-21)
fixed the list item end side of this problem: if all text nodes in a
list are headers, then don't write ul/ol at all, otherwise end list
headers with </li> as well to make sure the output XML is valid.
However, this created a mis-match, the starting <li> for list headers in
a list which have non-header text nodes at as was not adapted.

Fix the problem by extending OutHTML_SwFormat() so list headers in a
list with non-header text nodes always have a <li> and </li>, and this
condition is the same on the start/end side.

Calculating if at least one text node is non-header in a list may not be
cheap, so reuse the already calculated info from
OutHTML_NumberBulletListStart() in OutHTML_SwFormat().

(cherry picked from commit 472a40b022ef685610faa663421a00cfe6121c24)

Change-Id: I3817a489f16166fc5b4c33ee64e2283c41a4402c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136136
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
4 weeks agoupstream Skia fix for Vulkan crash on texture binding (tdf#148624)
Luboš Luňák [Fri, 17 Jun 2022 08:38:03 +0000 (17 10:38 +0200)]
upstream Skia fix for Vulkan crash on texture binding (tdf#148624)

Change-Id: Ic16a516bfde04aba0336baca58f605d6cf9fd413
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136036
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
4 weeks agotdf#147844: Use sanity check only if LibreOfficeKit is active
Xisco Fauli [Thu, 26 May 2022 14:45:30 +0000 (26 16:45 +0200)]
tdf#147844: Use sanity check only if LibreOfficeKit is active

Regression from 2b58a0979f9206cfca6d78cb2f3d5e65cd735f8b
"Add sanity check to avoid potential crash in the Collabora Online
server"

Change-Id: I2fcfb634b47f9d76f8efbbd64a8e69ea236894c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135024
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit b7efccde76ca7bfa181fff39c52282e87e940614)

Related: tdf#147844 still log the discrepancy

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135367
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Aron Budea <aron.budea@collabora.com>
(cherry picked from commit 08850dbead8a8a797965aaa97d43d639bc0814d3)

Change-Id: I2fcfb634b47f9d76f8efbbd64a8e69ea236894c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136065
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Aron Budea <aron.budea@collabora.com>
4 weeks agoallocate column in ScTable::DeleteBeforeCopyFromClip() (tdf#149554)
Luboš Luňák [Wed, 15 Jun 2022 07:29:20 +0000 (15 09:29 +0200)]
allocate column in ScTable::DeleteBeforeCopyFromClip() (tdf#149554)

Change-Id: I22607f1dd0ec1c083f6a52a2ecccb976fc133687
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135864
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
(cherry picked from commit e445eac863ac616fb99c9d6bf5510b965fd15957)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135950
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
4 weeks agoallocate columns in ScTable::TransposeClip() (tdf#149554)
Luboš Luňák [Mon, 13 Jun 2022 17:51:43 +0000 (13 19:51 +0200)]
allocate columns in ScTable::TransposeClip() (tdf#149554)

Change-Id: I2ae151ed9656884bca6963ba09bdf236e09096b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135774
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
(cherry picked from commit ef1be22efb3e1625da1683ea98392cc41657b1cd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135748
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
4 weeks agomake VirtualDevice::SetOutputSizePixelScaleOffsetAndBuffer() LOK-only
Luboš Luňák [Fri, 10 Jun 2022 10:33:53 +0000 (10 12:33 +0200)]
make VirtualDevice::SetOutputSizePixelScaleOffsetAndBuffer() LOK-only

Because it's used only for LOK, and SvpSalVirtualDevice::CreateSurface()
otherwise wouldn't know whether to apply LOK DPI settings or not
(since this might be called for LOK tiled painting, when it should,
or it might be called from somewhere else while LOK is active, in which
case this should be handled normally). Getting that mismatched can cause
things like https://github.com/CollaboraOnline/online/issues/4834 .

Change-Id: I1df7b8a169c8ef2e799731a6695a032948536582
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135546
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
4 weeks agofind last data row before searching for first data row
Luboš Luňák [Fri, 10 Jun 2022 15:39:46 +0000 (10 17:39 +0200)]
find last data row before searching for first data row

GetLastDataRow() is more efficient than iterating every cell
with HasDataAt(), so first reduce the row range from the end
(in case the whole range is empty cells it's just one call).

Change-Id: Idc494795f68492ed8b05b2cd575598a9c5868b7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135605
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
(cherry picked from commit 7689bf445264d1b54038ec0b8d134c26847af40f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135552
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
4 weeks agouse recursive mutex for LOK queue
Luboš Luňák [Wed, 8 Jun 2022 13:23:22 +0000 (8 15:23 +0200)]
use recursive mutex for LOK queue

Callbacks may be invoked while calling getLOKPayload(), which
would try to lock the mutex again. I actually originally expected
this possibility, as the comment and moving the data to
temporaries in CallbackFlushHandler::enqueueUpdatedTypes()
shows, I just didn't realize the used mutex wasn't recursive
and so would deadlock.

Change-Id: I2b5c4b6b4c1a3933a32ae4641830877e085f2b6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135499
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit 118bafcfd1ce4a26ec9df912197ebd466d1bd497)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135387
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
4 weeks agosw: jsdialog: enable contentcontrol and contentcontrollistitem dialogs
rash419 [Wed, 15 Jun 2022 11:53:44 +0000 (15 17:23 +0530)]
sw: jsdialog: enable contentcontrol and contentcontrollistitem dialogs

contentcontrol: fix: modify, remove, move up/down buttons doesnot work even if item is selected in jsdialog

Signed-off-by: rash419 <rashesh.padia@collabora.com>
Change-Id: Ib038ce2a3ff6f92ab7314b18f36a038991a35f3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135902
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
4 weeks agosw content controls: allow the properties dialog in read-only sel
Miklos Vajna [Thu, 16 Jun 2022 07:14:04 +0000 (16 09:14 +0200)]
sw content controls: allow the properties dialog in read-only sel

Once you enter a checkbox or picture content control, the selection is
read-only to avoid loosing content the next time the content control is
updated. But this means you can't launch the properties dialog to e.g.
enable placeholder mode.

Fix this by relaxing the restriction and allow the properties dialog on
protected cursor as well, matching Word behavior.

(cherry picked from commit 9aeca50f4f0c1b2503a91eb1c7d9ed8a7231e598)

Change-Id: Ifef9af66d077682c46c852c9ecba2df5f17234fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135967
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
5 weeks agooox: fix div by zero in lclCalculateCropPercentage()
Miklos Vajna [Wed, 15 Jun 2022 09:24:47 +0000 (15 11:24 +0200)]
oox: fix div by zero in lclCalculateCropPercentage()

Similar to what oox::vml::ShapeType::getAbsRectangle() already does.

Crashreport signature:

Fatal signal received: SIGFPE code: 1 for address: 0x7fcd55eeff59

program/libooxlo.so
        oox::drawingml::GraphicProperties::pushToPropMap(oox::PropertyMap&, oox::GraphicHelper const&, bool, bool) const
oox/source/drawingml/fillproperties.cxx:103

Change-Id: I0f82cbc955d9e60bad103682638b07153a5589e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135906
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
5 weeks agovcl: restore lost spinner images
Miklos Vajna [Mon, 13 Jun 2022 13:39:11 +0000 (13 15:39 +0200)]
vcl: restore lost spinner images

This went wrong in commit 13aa5081793f133077610cd01b7f01ee765b4add
(remove unused defines, 2021-11-19), the trouble is that
postprocess/CustomTarget_images.mk needs these images to be listed in
bitmaps.hlst explictly, and the makefile won't see that the same names
are used in Throbber::getDefaultImageURLs(), constructed dynamically.

(cherry picked from commit 214438f1dcce52043c27c39e529cf60ff96c98cf)

Change-Id: Ie7ea1734ed417d17e1ce54d6a755509ef52572d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135829
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 358391950bf67b689668bc7b4018371d5a846ae3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135850
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135861
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
5 weeks agosw XHTML export: avoid writing default transparent background for ReqIF
Miklos Vajna [Fri, 10 Jun 2022 07:12:33 +0000 (10 09:12 +0200)]
sw XHTML export: avoid writing default transparent background for ReqIF

We started writing properties of tables and rows since commit
c3c3303516c3da9372dce3f05f38f15a104e961c (sw XHTML export: output table
/ table row background format using CSS, 2022-05-10).

In case the SwTableLine has an explicit SvxBrushItem with its color set
to COL_TRANSPARENT, we turn that into a "background: transparent" CSS by
default. This is a 1:1 mapping from the doc model, but HTML defaults to
this already, so this is considered as noise.

Extend IgnorePropertyForReqIF() to filter out these unwanted defaults,
and fix SwHTMLWriter::OutCSS1_Property(), because it used to not pass
the CSS value for the filter function.

The behavior for table cells is unchanged, we continue to not export
cell properties (in the ReqIF case) at all.

Change-Id: Idbcd07809e159def694f4de017eebc7ad4104575
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135576
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 04cc6e079e3122c183054fde046c054ed6c7b737)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135707
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135860
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
5 weeks agotdf#149509 sw content controls: reject page break insertion
Miklos Vajna [Fri, 10 Jun 2022 14:13:04 +0000 (10 16:13 +0200)]
tdf#149509 sw content controls: reject page break insertion

Similar to input fields, the intention is to keep the start and end of
(inline) content controls within the same text node, so just disable the
command in this context, as Word does.

(cherry picked from commit aa5824b2a6df99ef9d788a8d37bdfa77582375c8)

Change-Id: Ib797ad164a3a36b4bbde4d686cde29adf6db96bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135822
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
5 weeks agosw content controls: reject typing inside checkbox or picture content controls
Miklos Vajna [Fri, 10 Jun 2022 06:16:48 +0000 (10 08:16 +0200)]
sw content controls: reject typing inside checkbox or picture content controls

Content controls are editable by default (and not only editable, but
also capable of hosting rich text content), and Writer doesn't limit
the possibility to edit explicitly, either.

Certain content control types (checkbox and picture for now) limit the
hosted content though: checkbox overwrites the content on click and
picture is meant to host a single as-char anchored image. So far the
simple implementation Writer didn't enforce these limits, leading the
unexpected behavior when clicking on checkbox content controls (possibly
not only a checked/non-checked checkmark was toggled, but other content
was removed).

Fix the problem by making these content control types read-only: this is
what also Word does and this way you can't loose the content when you
can't enter it earlier.

We may want to also do this for dropdowns in the future, once combo
boxes will be supported.

(cherry picked from commit c321498f915f4e8b3f4853232860ce040ab48e46)

Change-Id: I9d44206b3c719a64ec552f2fa0a076901094163e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135821
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
5 weeks agoDrop unused text column from IconView's model
Mike Kaganski [Fri, 10 Jun 2022 10:15:53 +0000 (10 13:15 +0300)]
Drop unused text column from IconView's model

... and also the hardcoded column count and width. This allows to
make the elements position themselves better in the dialog, and to
avoid the unused space below the icon in GTK, similar to non-GTK
as implemented in commit 54725f6e5f06b074d1c08d8efbd16518b96882d5
  Author Mike Kaganski <mike.kaganski@collabora.com>
  Date   Tue May 03 09:49:07 2022 +0100
    Don't add empty labels to fontwork's icon view

Change-Id: I19fa4e2002856322266b21873b383bc887cf1029
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135584
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 098999e62e5a428b268259704584dd0f15dc22f7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135548
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
5 weeks agolok: set LanguageTool config parameters from environment
Mert Tumer [Fri, 10 Jun 2022 10:09:51 +0000 (10 13:09 +0300)]
lok: set LanguageTool config parameters from environment

Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ic7343439536abee626c269d2a824bb36f9abc40f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135583
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>