Commit graph

475717 commits

Author SHA1 Message Date
Noel Grandin
41bbc62f38 elide allocation of CacheItem when enumerating filters
Change-Id: I44f83485b984548118364dc58cbc3939001506d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134805
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23 18:48:42 +02:00
Noel Grandin
86c95d195d std::unordered_set->o3tl::sorted_vector in TaskManager
avoids repeated allocation

Change-Id: Ie3f380ab2f38314b9c8a51fdcd1985329254f5dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134804
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23 18:48:25 +02:00
Noel Grandin
d850510bae use std::move to avoid some object allocation
Change-Id: Id37b54810e7755bd7a4e354c777e0cfdf069080f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134801
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23 18:48:06 +02:00
Stephan Bergmann
728ff63903 Bad hack to silence UBSan nullptr-with-offset
...since e912a44621 "tiff: use more complicated
apis to need a smaller buffer during read" in CppunitTest_vcl_filters_test,

> [_RUN_____] TiffFilterTest::testCVEs
[...]
> tif_getimage.c:998:21: runtime error: applying zero offset to null pointer
>     #0 0x7f487da9d408 in gtStripContig /workdir/UnpackedTarball/libtiff/libtiff/tif_getimage.c:998:21
>     #1 0x7f487da97c27 in TIFFRGBAImageGet /workdir/UnpackedTarball/libtiff/libtiff/tif_getimage.c:512:12
>     #2 0x7f487bd1a56c in ImportTiffGraphicImport(SvStream&, Graphic&) /vcl/source/filter/itiff/itiff.cxx:219:19
>     #3 0x7f485d820126 in TiffFilterTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) /vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx:70:12
>     #4 0x7f485a49ffa0 in test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) /unotest/source/cpp/filters-test.cxx:132:20
>     #5 0x7f485a4a3a52 in test::FiltersTest::testDir(rtl::OUString const&, std::basic_string_view<char16_t, std::char_traits<char16_t> >, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) /unotest/source/cpp/filters-test.cxx:157:5
>     #6 0x7f485d8206f9 in TiffFilterTest::testCVEs() /vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx:76:5

(<https://ci.libreoffice.org/job/lo_ubsan/2406/>).

(If UBSan or some other tool starts to flag this too, we'll probably need to
pass in a nullptr after all and teach libtiff to treat that case specially and
not advance it.)

Change-Id: I4477e6c7036c3c5f2782c2c90c612d98fee60468
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134822
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-23 18:17:10 +02:00
Julien Nabet
a14d8acb93 README libtiff
Change-Id: Icece0daad46896334cba7dc66435351a347bd2cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134819
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-23 18:16:43 +02:00
Caolán McNamara
daac48d510 tiff: reverse row pixels for ORIENTATION_LEFTBOT
and rotate

e.g. novell600797-1.tiff

Change-Id: I03edcc44f86a40f3e005bec1d8b82a0a89cad276
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134817
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-23 18:16:10 +02:00
Caolán McNamara
95567d6175 crashtesting: we can have negative skew
which is used to fill rows backwards

Change-Id: I07543a622b9566a1a4a8e85c72302545600916c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134816
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-23 18:15:53 +02:00
Miklos Vajna
9a76be53df sw content controls, picture: add LOK API
- send a LOK_CALLBACK_CONTENT_CONTROL callback with
  action=change-picture when a file picker should be shown

- extend lok::Document::sendContentControlEvent() to be able to replace
  the placeholder with the selected URL

- update gtktiledviewer to work with these

Change-Id: Ifb3750803885fc09fc82905b0cf85b2b8ca06e77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134750
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-05-23 18:04:09 +02:00
Michael Weghorn
95c55b40f7 qt6 configure: Consider more paths to find Qt 6 moc
commit 88d57cf241
    Date:   Wed Sep 29 11:09:51 2021 +0200

        qt6: Add a qt6 VCL plugin

mentioned:

> 1) At least in my self-compiled Qt versions,
> 'moc' (the meta-object compiler) is located
> in the 'libexec' subdirectory in 'QT6DIR', while the
> Qt 5 equivalent is located in the "bin" subdirectory
> of 'QT5DIR', so the configure.ac check uses the former.

Search for moc in the "libexec" subdirectory of
all paths in `lib_dir` before trying `$PATH`,
so e.g. the one provided as `/usr/lib/qt6/libexec/moc`
by package "qt6-base-dev-tools" in Debian testing is found
before a Qt 5 version in `$PATH`.

With this change in place, building on Debian testing
using the system Qt 6 works when building with autogen option
`--enable-qt6` but no `QT6DIR` set and `/usr/bin/moc` points
to the Qt 5 version of moc.

Change-Id: I0471c73315224ffab018b350aff8d797a234a905
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134814
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-05-23 17:40:38 +02:00
Michael Weghorn
9adc0e9d38 qt6 configure: Consider 'qmake6' when searching Qt 6 qmake
Debian testing/unstable provides a `/usr/bin/qmake6`.

Change-Id: I3dba55fc1a2d5667d9fc16aecacf8db6119ced02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134813
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-05-23 17:40:21 +02:00
Noel Grandin
72582e9fb3 rename osl_getSystemPathFromFileURL_Ex->getSystemPathFromFileURL_Ex
so I can more readily distinguish between functions that are actually in
the OSL API and functions that are not

Change-Id: Ie113c30ea15d05457633396d56bca08057e38b60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134800
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23 17:26:15 +02:00
Caolán McNamara
ecae51e5f1 tiled tiff found at rhbz552360-2.tiff
fix up wrt skew and buffer size and the right put function

Change-Id: Iff93876c39213668f38ba341e597741b695b47bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134759
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-23 17:08:12 +02:00
Hossein
3eda5d345f tdf#149184 DOCX: fix crash removing footer, then saving to doc
When openeing the simplefooter.docx, after removing the footer and
exporting to .doc, LibreOffice crashes. This regression was
introduced with 88e6a1bfea which is
titled: "DOCX: export hidden (shared) headers/footers".

The current patch fixes this problem by checking to see if the header
or footer text is there or not.

A unit test is added to avoid this problem in the future. One can run
the test with:

    make CPPUNIT_TEST_NAME="testTdf149184" -sr CppunitTest_sw_uiwriter7

Change-Id: I5586561677b3c490e49b4b10bd987aecdf3fc134
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134684
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-23 16:29:54 +02:00
Noel Grandin
9c04632859 cache ref to GlobalEventConfig
so we avoid repeated allocation

Change-Id: I9541c52e73878cf515c9159477bd3d2fda9e0078
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134803
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23 15:26:12 +02:00
Noel Grandin
0a1bfe1e3f elide some OUString allocation
Change-Id: I5f0b9057b86ec98b66b4ce2d6c681b8cb93d49e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134802
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23 15:25:42 +02:00
Noel Grandin
e1b3a6edd4 no need to override 'operator new' in FileHandle_Impl
it's been a while since we had our own allocator

Change-Id: I091c69c94a9592657dd845387530a3fa587a8c01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134753
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23 15:25:04 +02:00
Stephan Bergmann
f546767b4e tdf#149198 Fix previous fix
...c8d4ae2ad0cfdac770d897e7aca72fbb4a87765f "tdf#149198 Fix use of nullptr".
Thanks to Mike for spotting my mistake there.

Change-Id: Id5bdd723f32247b0fd7313135f62124d0f18f4dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134811
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-23 15:21:11 +02:00
AshSinc
9e7597a1cc tdf#149141 - Added default object creation when drag size too low
Change-Id: Ibbc0fab14c0bcb18a979d6364b04c236c8c5e29e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134499
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2022-05-23 15:12:04 +02:00
AshSinc
3aa5aa8303 tdf#149141 - Writer - Added default object creation when drag size too low
Patch in case consistency is required for suggested Draw/Impress change here : https://gerrit.libreoffice.org/c/core/+/134499

Change-Id: If4f51109633338620cfe836695214df20c3ec577
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134682
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2022-05-23 15:09:35 +02:00
tagezi
69a103b57a tdf#132293: Removing unused imports from uitests files.
It seems, the most imports were copy-pasted from a file to a new one.
Additionally, the import block and surrounding area made more readable.

Change-Id: Ie1f31c489cb1e744b5d01d35e3908f1071313e90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134413
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-05-23 14:35:38 +02:00
tagezi
30a048cb89 tdf#132293: Removing unused imports from uitests files.
It seems, most of the most imports were copy-pasted from one file
to a new one.
Additionally, the import block and surrounding area made more readable.

Change-Id: I8afc5debef6e758d7ad42b1a649f9556d3d7abbd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134400
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-05-23 14:33:38 +02:00
Noel Grandin
d8b60f77f3 rtl_String->OString in DirectoryItem_Impl
Change-Id: Id7b97cbc4160b0d5953c5e378b11a2006292a9ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134799
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23 14:32:41 +02:00
Ilmari Lauhakangas
6ed597a7dd tdf#140215 Improve the Comment strings in .desktop files
Change-Id: I94bde89ee8cb122ed04f510e25e558240e3029b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134708
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-05-23 12:57:52 +02:00
Stephan Bergmann
1e51a325a8 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>
2022-05-23 12:08:30 +02:00
Stephan Bergmann
c8d4ae2ad0 tdf#149198 Fix use of nullptr
...which would have caused std::abort for non-production debug builds since
4f0c70fb55 "Avoid calling OString ctor with null
pointer", and started to erroneously pass a nullptr argument into a
std::string_view for all kinds of builds with
af16aa6256 "Improve loplugin:stringview"

Change-Id: Iad4d1576ed651a74c0f8b2e8dee3c59f5214accd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134758
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-23 12:00:23 +02:00
Noel Grandin
8d00d5f364 instantiate Title directly in chart
which simplifies some code

Change-Id: I0c9aa212334a3dedd8a54f8deda6100d93b0be70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134743
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23 11:58:54 +02:00
Noel Grandin
0c17712465 clang-tidy modernize-pass-by-value in jvmaccess
Change-Id: I9a2ef4370136b0f26ae3590f358025e7d89f30d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134757
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23 11:46:13 +02:00
Tibor Nagy
f4efaf4551 tdf#66228 PPTX export: fix lost U-shaped connectors
which were replaced with straight connector lines.

The "Line Connector" has no equivalent in OOXML. So far it has
been saved as a "Straight connector". In most cases, the better
solution is to change it to "Standard connector", keeping
the original layout with U-shaped connectors.

Change-Id: I9d6b6174d0556ba2478c6a9837c500b3cc794c82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134284
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2022-05-23 10:59:10 +02:00
Stephan Bergmann
6974647815 cid#1504543 Silence unhelpful, aggressive UNINIT_CTOR
Change-Id: Ida0c1bfd34ee68968b22579492bce4b137fa8a93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134749
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-23 10:55:45 +02:00
Michael Stahl
123d3a9301 sw: copy grab bags in mail merge
Otherwise formatting may get lost when the result is stored as DOCX.

Change-Id: I62cbeb1fc9f120dd9c424daf5dc0471686715537
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134694
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-23 10:54:16 +02:00
Michael Stahl
1b8c42f8b0 sw: avoid ~SwIndexReg() assert in SwFEShell::PastePages()
Change-Id: I5337dc8568255a778d29b676a39c99f72c42486b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134693
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-23 10:53:20 +02:00
Michael Stahl
4d3b750d08 sw_redlinehide: fix crash in IsMarkHidden() if pointing to table node
This is called during mail merge from documentStartPageNumber()
and if the document starts with a table, the passed UNO mark will point
to SwTableNode.

(regression from commit 943d9be770)

Change-Id: Ic69c12ba0d819eda85de5dde95e35a8071466c2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134692
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-23 10:52:57 +02:00
Noel Grandin
be9a394884 clang-tidy modernize-pass-by-value in configmgr
Change-Id: If2e69c04e4d72ec6911fb435092275dbfffbf991
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134752
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23 10:52:11 +02:00
Michael Stahl
32c43ee75c starmath: fix real use-after-free detected by GCC 12
In file included from starmath/inc/mathml/iterator.hxx:12,
                 from starmath/source/mathml/iterator.cxx:10:
In member function ‘SmMlElement* SmMlElement::getParentElement()’,
    inlined from ‘void mathml::SmMlIteratorBottomToTop(SmMlElement*, runType, void*) [with runType = void (*)(SmMlElement*, void*)]’ at starmath/inc/mathml/iterator.hxx:43:39,
    inlined from ‘void mathml::SmMlIteratorFree(SmMlElement*)’ at starmath/source/mathml/iterator.cxx:57:28:
starmath/inc/mathml/element.hxx:263:46: error: pointer ‘pCurrent’ used after ‘void operator delete(void*, std::size_t)’ [-Werror=use-after-free]
  263 |     SmMlElement* getParentElement() { return m_aParentElement; };
      |                                              ^~~~~~~~~~~~~~~~
In function ‘void mathml::deleteElement(SmMlElement*, void*)’,
    inlined from ‘void mathml::deleteElement(SmMlElement*, void*)’ at starmath/source/mathml/iterator.cxx:19:20,
    inlined from ‘void mathml::SmMlIteratorBottomToTop(SmMlElement*, runType, void*) [with runType = void (*)(SmMlElement*, void*)]’ at starmath/inc/mathml/iterator.hxx:65:21,
    inlined from ‘void mathml::SmMlIteratorFree(SmMlElement*)’ at starmath/source/mathml/iterator.cxx:57:28:
starmath/source/mathml/iterator.cxx:19:77: note: call to ‘void operator delete(void*, std::size_t)’ here
   19 | static inline void deleteElement(SmMlElement* aSmMlElement, void*) { delete aSmMlElement; }
      |                                                                             ^~~~~~~~~~~~

Change-Id: I09acfe3f7e90bd7f919cfba161f72bdd7a8da70a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134742
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-23 10:48:56 +02:00
Michael Stahl
486991b8ec sw: SwNodeIndex GCC12 spurious -Werror=dangling-pointer=
It doesn't understand that ~SwNodeIndex() will remove the pointer,
which is obfuscated by over-boostified code.

In member function ‘void SwNodeIndex::RegisterIndex(SwNodes&)’,
    inlined from ‘SwNodeIndex::SwNodeIndex(SwNodes&, SwNodeOffset)’ at sw/inc/ndindex.hxx:54:22,
    inlined from ‘bool SwNodes::InsBoxen(SwTableNode*, SwTableLine*, SwTableBoxFormat*, SwTextFormatColl*, const SfxItemSet*, sal_uInt16, sal_uInt16)’ at sw/source/core/docnode/ndtbl.cxx:301:41:
sw/inc/ndindex.hxx:37:31: error: storing the address of local variable ‘aEndIdx’ in ‘*this.SwNodes::m_vIndices’ [-Werror=dangling-pointer=]
   37 |             rNodes.m_vIndices = this;
      |             ~~~~~~~~~~~~~~~~~~^~~~~~
sw/source/core/docnode/ndtbl.cxx: In member function ‘bool SwNodes::InsBoxen(SwTableNode*, SwTableLine*, SwTableBoxFormat*, SwTextFormatColl*, const SfxItemSet*, sal_uInt16, sal_uInt16)’:
sw/source/core/docnode/ndtbl.cxx:301:17: note: ‘aEndIdx’ declared here
  301 |     SwNodeIndex aEndIdx( *this, nIdxPos );
      |                 ^~~~~~~
sw/source/core/docnode/ndtbl.cxx:301:17: note: ‘<unknown>’ declared here

Change-Id: I3f24cd8e3e0b1fd0a0943150d3d83d09f2c984fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134741
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-23 10:48:07 +02:00
Michael Stahl
d37486537e svx: work around GCC12 spurious -Werror=stringop-overflow
/usr/include/c++/12/bits/stl_algobase.h:431:30: error: ‘void*
__builtin_memcpy(void*, const void*, long unsigned int)’ writing 1 or
more bytes into a region of size 0 overflows the destination
[-Werror=stringop-overflow=]

Change-Id: Ib581b5788ff5d363b688000e700a42074c3b78eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134740
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-23 10:47:28 +02:00
Michael Stahl
02ebfb8ed6 vcl: GCC12 says fclose() causes -Werror=use-after-free on any use of FILE*
In file included from vcl/inc/unx/cpdmgr.hxx:34,
                 from vcl/unx/generic/printer/cpdmgr.cxx:25:
In member function ‘size_t psp::FPtrHash::operator()(const FILE*) const’,
    inlined from ‘std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache_hash_code>::__hash_code std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache_hash_code>::_M_hash_code(const _Key&) const [with _Key = _IO_FILE*; _Value = std::pair<_IO_FILE* const, rtl::OString>; _ExtractKey = std::__detail::_Select1st; _Hash = psp::FPtrHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; bool __cache_hash_code = true]’ at /usr/include/c++/12/bits/hashtable_policy.h:1268:18,
    inlined from ‘std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::size_type std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::_M_erase(std::true_type, const key_type&) [with _Key = _IO_FILE*; _Value = std::pair<_IO_FILE* const, rtl::OString>; _Alloc = std::allocator<std::pair<_IO_FILE* const, rtl::OString> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<_IO_FILE*>; _Hash = psp::FPtrHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>]’ at /usr/include/c++/12/bits/hashtable.h:2358:43,
    inlined from ‘std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::size_type std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::erase(const key_type&) [with _Key = _IO_FILE*; _Value = std::pair<_IO_FILE* const, rtl::OString>; _Alloc = std::allocator<std::pair<_IO_FILE* const, rtl::OString> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<_IO_FILE*>; _Hash = psp::FPtrHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>]’ at /usr/include/c++/12/bits/hashtable.h:971:24,
    inlined from ‘std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::erase(const key_type&) [with _Key = _IO_FILE*; _Tp = rtl::OString; _Hash = psp::FPtrHash; _Pred = std::equal_to<_IO_FILE*>; _Alloc = std::allocator<std::pair<_IO_FILE* const, rtl::OString> >]’ at /usr/include/c++/12/bits/unordered_map.h:763:26,
    inlined from ‘virtual bool psp::CPDManager::endSpool(const rtl::OUString&, const rtl::OUString&, FILE*, const psp::JobData&, bool, const rtl::OUString&)’ at vcl/unx/generic/printer/cpdmgr.cxx:725:28:
vcl/inc/unx/cupsmgr.hxx:35:43: error: pointer may be used after ‘int fclose(FILE*)’ [-Werror=use-after-free]
   35 |     { return reinterpret_cast<size_t>(pPtr); }
      |                                           ^
vcl/unx/generic/printer/cpdmgr.cxx: In member function ‘virtual bool psp::CPDManager::endSpool(const rtl::OUString&, const rtl::OUString&, FILE*, const psp::JobData&, bool, const rtl::OUString&)’:
vcl/unx/generic/printer/cpdmgr.cxx:695:15: note: call to ‘int fclose(FILE*)’ here
  695 |         fclose( pFile );
      |         ~~~~~~^~~~~~~~~

Change-Id: Ib035f2287649dcf9a2d37bda85ebcf52c6c51aaa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134739
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-23 10:47:08 +02:00
Michael Stahl
cd4976646d 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>
2022-05-23 10:45:21 +02:00
Michael Stahl
694db7d3e7 svl: spurious GCC12 -Werror=maybe-uninitialized
In file included from svl/source/misc/sharedstringpool.cxx:11:
In constructor ‘svl::SharedString::SharedString(rtl_uString*, rtl_uString*)’,
    inlined from ‘svl::SharedString svl::SharedStringPool::intern(const rtl::OUString&)’ at svl/source/misc/sharedstringpool.cxx:129:51:
include/svl/sharedstring.hxx:56:20: error: ‘pResultUpper’ may be used uninitialized [-Werror=maybe-uninitialized]
   56 |     mpData(pData), mpDataIgnoreCase(pDataIgnoreCase)
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
svl/source/misc/sharedstringpool.cxx: In member function ‘svl::SharedString svl::SharedStringPool::intern(const rtl::OUString&)’:
svl/source/misc/sharedstringpool.cxx:93:33: note: ‘pResultUpper’ was declared here
   93 |     rtl_uString *pResultLower, *pResultUpper;
      |                                 ^~~~~~~~~~~~

Change-Id: I2171855844c76ad3b2a72c1eca737691ca96fc46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134736
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-23 10:40:54 +02:00
Luboš Luňák
5d02daa519 handle RTL space in non-RTL layout in SalLayoutGlyphsCache
Reproduced with tdf#95217-1 on the crashtesting server.

Change-Id: I44dfa762b624ca24a8bd4ce8df03f8c870d4e7c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134755
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-23 10:34:04 +02:00
Stephan Bergmann
de403384f2 Adapt comment
...after 084b2b068a "optimise Any::operator=(&&) a
little" folded moveAnyInternals into its only remaining call site

Change-Id: I2a9d8a775d601bc0307a3f3a5dfc139c571489ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134751
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-23 10:32:40 +02:00
Michael Stahl
3a1d90f484 skia: fix GCC12 -Werror=shadow
Change-Id: I0ec8e9d7d54b48281332cb5128d03ac28dad87e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134737
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-05-23 10:14:38 +02:00
Michael Stahl
5cf5df83aa comphelper: -Werror=class-memaccess
Change-Id: Ia38274fac70618902f562fec657ad9cccfcf8cb3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134735
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-05-23 09:42:24 +02:00
Miklos Vajna
42e88e3b34 sw: prefix members of SwWW8Shade, WW8Glossary, WW8ListManager and ...
... sw::util::HdFtDistanceGlue

See tdf#94879 for motivation.

And add a build-time test to ensure that wrtsh.hxx is self-contained.

Change-Id: I493931eeeb8c57264c6f884b48b83881dda6632d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134748
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-05-23 09:15:34 +02:00
Heiko Tietze
7c2bcac3e6 Resolves tdf#131155 - Keep frequently used options on sort criteria tab
* Row/Column header moved
* Sort by row/column moved
* Extra variables removed
* UI tests adjusted to read/set sort direction and header from first tab

Change-Id: I9fc0406806256f289d52e45b096e392067768eaa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130843
Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2022-05-23 09:02:45 +02:00
Tünde Tóth
aeb8a0076c tdf#149176 tdf#149178 fix Save autorecovery information.. option
Autorecovery information was saved in every 10 minutes,
regardless of the "Save Autorecovery information every" setting.

Change-Id: I1a52da2fa5febb53c270a8db7472e9a8c0e4c426
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134642
Tested-by: Jenkins
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2022-05-23 08:59:45 +02:00
Mark Hung
f94ba53cd4 tdf#149017 Justify::SpaceDistribution unit tests.
Cerate new unit test cases for core/txtnode/justify.cxx
and Justify namespace. It implements basic utility to
convert between KernArray and char width array, and can
serve for kern array related tests.

Change-Id: I3da172853c6d8aca517247af34b29f712d3b6e62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134298
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-23 08:48:04 +02:00
Michael Weghorn
123bb44f4a Extend '-Werror=attributes' workaround to GCC versions < 12.1
Adapt the GCC version check from the workaround introduced
in

    commit 2c6cea672a
    Date:   Wed May 18 10:46:55 2022 +0200

        Work around bogus -Werror=attributes with old GCC

        ...after 9c3c6a6b66 "Replace OFFSET_OF macro with
        a function template", as seen at
        <https://ci.libreoffice.org//job/lo_tb_master_linux_dbg/38076/>,

        > /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppu/source/uno/check.cxx:263:28: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
        >      [[maybe_unused]] Char3 chars;
        >                             ^~~~~

        (Not sure which versions of GCC are affected exactly; lets restrict this to

to all versions before 12.1.

My GCC 11.3.0 build on Debian testing failed just the
same way otherwise.

A `git log --grep=maybe_unused` in the GCC git repo suggests
that this is no longer necessary from the following
GCC 12.1 commit [1] on:

    commit c0f769fa3114ea852a26d93f0ee3f9595463de0b
    Author: Jason Merrill <jason@redhat.com>
    Date:   Fri Jun 11 16:10:50 2021 -0400

        c-family: don't warn for [[maybe_unused]] on data member

        The C++17 standard (and C2x) says that [[maybe_unused]] may be applied to a
        non-static data member, so we shouldn't warn about it.  And I don't see a
        reason not to handle a FIELD_DECL the same as any other decl, by setting
        TREE_USED on it.  It doesn't look like anything yet cares about that flag on
        a FIELD_DECL, but setting it shouldn't hurt.

        gcc/c-family/ChangeLog:

                * c-attribs.c (handle_unused_attribute): Handle FIELD_DECL.

        gcc/testsuite/ChangeLog:

                * g++.dg/ext/attrib62.C: No longer warn.
                * g++.dg/diagnostic/maybe_unused1.C: New test.

        gcc/ChangeLog:

                * doc/extend.texi (unused variable attribute): Applies to
                structure fields as well.

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=c0f769fa3114ea852a26d93f0ee3f9595463de0b

Change-Id: I815e4a24da13e0ae66b1dff2941e636c7ebdfd9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134653
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
2022-05-23 08:46:50 +02:00
Jim Raykowski
7ee7e966bd tdf#144788 follow up fix: Fix null pointer use
Change-Id: I62c3e337a8ec5391c3f18bb42ce8778acd36451b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134747
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2022-05-23 01:23:35 +02:00
Jim Raykowski
be0f8c1933 tdf#144788 follow up: fix SwNavigator footnote tracking
Changes incorrect handling for both footnote and endnote tracking
when either a footnote or an endnote attribute is at the current
cursor position to handling for only footnote or endnote.

Change-Id: Ib65704ae48298c02cfe557d62d1c002a1859321f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134717
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2022-05-22 23:57:56 +02:00