Commit graph

475693 commits

Author SHA1 Message Date
Xisco Fauli
5938db731b tdf#105972: pdf form: export numeric and currency fields as number type
Initial support for AFNumber_Format and AFNumber_Keystroke
More info in
https://experienceleague.adobe.com/docs/experience-manager-learn/assets/FormsAPIReference.pdf?lang=en
This patch adds support for CurrencySymbol,
DecimalAccuracy and PrependCurrencySymbol for now

Change-Id: I8d6ffac51d576a8c243b9c6d5be2c3517bc0125a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134471
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-05-17 15:53:52 +02:00
Noel Grandin
f08c890482 osl::Mutex->std::mutex in HierarchyDataSource
HierarchyDataSource::createInstanceWithArguments does
not need locking since it does not access local state.

Change-Id: Ia29f9a5ca20095d51e4eb168cdc0a080d178f9bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134087
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-17 15:40:00 +02:00
László Németh
6af4c1d097 tdf#123877 sc XLSX: don't freeze during saving recovery
file by asking password re-typing unstoppably. Instead
of this, skip recovery file saving, if the document
contains password hashes which haven't been supported
by the "calc8" filter of the recovery file (which
triggered the "Re-type password" dialog).

Solved problems:

– Asking for passwords during a non-interactive
  background process.

– A single Cancel didn't close the "Re-type password" dialog
  window, only pressing three times at least (according to the
  value of RETRY_STORE_ON_MIGHT_FULL_DISC_USEFULL), but
  waiting for the password for a while could result a
  frozen "Re-type password" dialog, where only retyping or
  removing the password(s) were the escape routes.

– Re-typing the password required the password (but modifying
  the original document doesn't require this).

– Removing the password resulted in loss of the protection
  after saving the original XLSX document.

Add a UI test to keep the "Re-type password" dialog during Save As.

Note: because of the regression reported in tdf#145757, it needs
to wait 10 min for saving the recovery file, yet, despite the
changed time in Tools->Options->Load/Save->General.

Change-Id: Icc6ee4d67048cdf15ab75ef8e2ee8f1709cdd4c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134409
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2022-05-17 15:36:00 +02:00
Stephan Bergmann
4a23511cda At least make CppunitTest_sc_text_functions_test more resilient to ICU version
61f4250ee9 "Make CLEAN fully compliant woth ODFF
v1.3" has changed lcl_ScInterpreter_IsPrintable
(sc/source/core/tool/interpr1.cxx) to use ICU's u_isdefined to check for Unicode
code points of category Cn (i.e., noncharacter or reserved).  This is at least
questionable, as assignment of code points to that category varies with Unicode
versions.  And while
<https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part4-formula/OpenDocument-v1.3-os-part4-formula.html#__RefHeading__1017856_715980110>
"Open Document Format for Office Applications (OpenDocument) Version 1.3.
Part 4: Recalculated Formula (OpenFormula) Format: 1.4 Normative References"
references "The Unicode Standard, Version 5.2.0" (so one might expect CLEAN to
use the category classification from that old Unicode version), versions of ICU
keep being updated with current Unicode versions' category classifications.  For
example, the currently bundled external/icu's icu4c-70_1-src.tgz uses Unicode 14
(according to <https://icu.unicode.org/download/70#h.x1orhyniml8k>) for its
implementation of u_isdefined.  And for --with-system-icu, all that configure.ac
apparently requires is that "icu-i18n >= 4.6" (i.e., it will potentially allow
the behavior of u_isdefined to vary over a wide range of Unicode versions).

And case in point, 61f4250ee9 also added a test to
sc/qa/unit/data/functions/text/fods/clean.fods (row 47) that verifies that
U+FDCF ARABIC LIGATURE SALAAMUHU ALAYNAA does not get cleaned away by CLEAN.
But U+FDCF is only an assigned code point (thus no longer of category Cn) since
Unicode 14 (cf.
<https://www.unicode.org/charts/PDF/Unicode-14.0/U140-FB50.pdf>), so while
builds against external/icu (covering Unicode 14) succeed, --with-system-icu
builds like a flatpak build against org.freedesktop.Sdk//21.08, still at ICU 69
and Unicode 13, fail CppunitTest_sc_text_functions_test with

> Testing load file:///run/build/libreoffice//sc/qa/unit/data/functions/text/fods/clean.fods:
> /run/build/libreoffice/sc/qa/unit/functions_test.cxx:43:TextFunctionsTest::testTextFormulasFODS
> double equality assertion failed
> - Expected: 1
> - Actual  : 0
> - Delta   : 1e-14

(<https://flathub.org/builds/#/builders/11/builds/7103>).

Irrespective of whether using ICU's varying u_isdefined in the implementation of
CLEAN is correct, at least make that "doesn't get CLEAN'ed away" test more
resilient to what version of ICU is being used, by using F+UF00 TIBETIAN
SYLLABLE OM, which got added all the way back in Unicode 2, rather than U+FDCF
ARABIC LIGATURE SALAAMUHU ALAYNAA, which only got added in Unicode 14.

(And to add insult to injury, in sc/qa/unit/data/functions/text/fods/clean.fods
61f4250ee9 encoded U+FDCF in text not as the three
UTF-8 bytes 0xEF 0xB7 0x8F, but rather re-encoded as the six bytes 0xC3 0xAF
0xC2 0xB7 0xC2 0x8F, i.e., the three characters U+00EF LATIN SMALL LETTER I WITH
DIARESIS, U+00B7 MIDDLE DOT, U+008F.  But I assume that was just a mistake, not
something that I should faithfully copy in the file's new version.)

Change-Id: Icc8d879b1397d8292914cbd31708d0c561f3b06e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134474
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-17 15:27:22 +02:00
Marco A.G.Pinto
0ebc3a389e Update git submodules
* Update dictionaries from branch 'master'
  to 3cfa1a08999c0bfa7ef8f79db324b565fd87e8c6
  - Updated the English dictionaries: GB
    
    Change-Id: I3f96eeba1fdd449aed1b6922bf156f82fca925ed
    Reviewed-on: https://gerrit.libreoffice.org/c/dictionaries/+/133470
    Tested-by: Aron Budea <aron.budea@collabora.com>
    Reviewed-by: Aron Budea <aron.budea@collabora.com>
2022-05-17 15:21:18 +02:00
Mike Kaganski
28c82b4a01 Improve version check
... to not break on e.g. 4.0

Change-Id: I5b93f6138a5ca85891d2d60beca098b6bcfc15d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134435
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-17 14:12:58 +02:00
Mark Hung
01c1467055 vcl/GetTextBreak(): don't add extra width if char width is 0.
Char width is 0 when multiple characters made up of one glyph.
Don't insert extra space in that case.

Change-Id: Ieb37aa8a4fffc534d84acf994a231e801e89f782
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134244
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2022-05-17 13:56:28 +02:00
Rafael Lima
96de6dee60 tdf#65067 Remove excessive spacing from Formula objects
As described in bugs tdf#65067, tdf#103816, tdf#149052 and a few other duplicates, Formula objects in Writer receive 2 unnecessary spacings:
1) From the "Formula" frame style, which has a Left/Right internal spacing of 0.2cm
2) From the Math formula editor itself, that adds an additional 1pt of internal spacing (left/right)

In MS Word the default behavior is setting all of these spaces to zero, which makes the formula flow better alongside text in paragraphs.

Therefore, this patch set both of these spaces to Zero so that Formula objects in Writer behave similarly as Formulas in MS Word.

Change-Id: Iedcef7124afed6b799f85bcefe37016c8fd972e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134185
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-17 13:37:46 +02:00
Noel Grandin
069f0eb13f use exec_module on newer Python (>3.3) to avoid DeprecationWarning
Change-Id: I7d0624f63e5d123d5013c14aa0f23355cd42dd0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134466
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-17 13:23:02 +02:00
Noel Grandin
ef3c759357 osl::Mutex->std::mutex in HierarchyResultSetDataSupplier
Change-Id: I61bcbc85fbbae469c5463a69dc835b7d1ac0575c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134086
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-17 13:22:40 +02:00
Tor Lillqvist
42eeb37397 AC_RUN_IFELSE won't work when cross-compiling
Change-Id: I8e4d439f0e03ca9e9e3088b451efd8d09bf37203
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134462
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-05-17 12:41:37 +02:00
Seth Chaiklin
0b58218390 tdf#149047 improve labelling of .uno:InsertObjCtrl and .uno:InsertObject
.uno:InsertObject opens a dialog to insert an OLE object.
    .uno:InsertObjCtrl appears to provide a control for a dropdown menu.
    It appears in one toolbar, but it is unclear if it is actually used.
    Meanwhile, it appears in the Customize menu, but when added to a
    toolbar, it does not have any obvious functionality.

    The purpose of this patch is to change the labelling on these two
    commands, and add a tooltip to .uno:InsertObject so that it will be
    easier in the Customize dialog to understand what .uno:InsertObject
    does, and to get an impression of a possible function of
    .uno:InsertObjCtrl.

Change-Id: I7cb01763c4a84511e7b7c45d8d00dc6873a3748f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134434
Tested-by: Jenkins
Reviewed-by: Seth Chaiklin <sdc.blanco@youmail.dk>
2022-05-17 12:22:08 +02:00
Tor Lillqvist
f6b3746f9c Drop pointless and misleading copypasta comments
Change-Id: I68701a61944c0d950468c6f069d2d2f82d5237f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134228
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-05-17 12:18:34 +02:00
Tor Lillqvist
b3dc919206 Accept iOS SDK 15.5
Change-Id: I19f54042613769993b92cfaf04de292cfbb72b5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134459
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-05-17 11:41:32 +02:00
Stephan Bergmann
bad6799603 loplugin:unnecessaryparen
Change-Id: Ic96e2ee710cb28b0475c103ab9cba5974301e164
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134407
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-17 11:17:44 +02:00
Tor Lillqvist
c400311414 Revert "use boost::flat_map in config_map"
Fixes build breakage on macOS at least. Noel said it was OK to revert.

This reverts commit cc4325f84a.

Change-Id: Ib78d29fc21d4d030b4032955b18271de1761f396
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134458
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-17 10:48:20 +02:00
Caolán McNamara
9969b7ee34 Resolves: tdf#149093 connect_value_change if we will query its value
and not the text_change which is called before the value is parsed
from the new text

Change-Id: Ib6bd5647139f1b79f299beb42b704b465ddf535c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134412
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-17 09:54:15 +02:00
Caolán McNamara
40e55abe8b add truncate-multiline to match vcl default
Change-Id: Ic3e8840bd124eacdcd30182a584568d5ee0081fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134387
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-17 09:53:57 +02:00
Miklos Vajna
0f25676a07 sw content controls, picture: add doc model & UNO API
This is meant to be a content control (providing rich text), which is
also a picture placeholder field.

Add a new Picture property to track this type, this way the click
handler will be able to present a file picker when showing the
placeholder.

Change-Id: Ibbd3720fc94d0f17654ec813821d218166c76424
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134457
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-05-17 09:17:34 +02:00
Michael Weghorn
19f204a30d qt: Drop unnecessary reinterpret_cast
`OString::getStr` already returns `const char *`,
so there's no need to cast to that.

Change-Id: Ief787f9823ffea075882658cf0adec29a8030199
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134455
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-05-17 08:22:01 +02:00
Miklos Vajna
566afb5fdf sw: document SwEditShell::InsertTable()
How it interacts with SwCursorShell::MoveTable() is far from trivial.

Change-Id: I04c9123c0b39192df43fe32984d66852102ebd1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134410
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-17 08:16:46 +02:00
Noel Grandin
8a29fb3098 osl::Mutex->std::mutex in framework::TransactionManager
Change-Id: I8a1c8e8ccec8ca64cc4f615ea8e9e415a343996d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134396
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-17 08:09:33 +02:00
Noel Grandin
edb1070f1b elide some OUString allocation and re-arrange GetCustomShapeEngine
so we check if we have a shape before we try to do any work

Change-Id: I9496e6fd38d7d7f312226791b942190c56e9d34e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134398
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-17 08:09:14 +02:00
Luboš Luňák
ea980b36a7 freeze() and thaw() a widget during creation (tdf#149112)
The repeated inserts each trigger SvTreeList::GetVisibleCount(),
which has a poor performance because of repeated uses of the
SvListView::Impl::m_DataTable map.

Change-Id: Ibb261a8501a1d5c168b37675e34498386f161595
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134415
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-17 07:37:15 +02:00
Luboš Luňák
5bf7058f49 std::map -> std::unordered_map (tdf#149112)
Faster and the ordering is not needed.

Change-Id: I9d9f8ef084f441d24d35dc92ecf060f576d7db2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134414
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-17 07:37:00 +02:00
Mike Kaganski
964e2eaae9 tdf#142635: use the same ScDocument for clipboard and GlobalDrawPersist
This way, the document used for chart copy has the proper sheets, and
the data ranges are created correctly.

This reverts commit 8d98dd8b38
  Author Mike Kaganski <mike.kaganski@collabora.com>
  Date   Thu Jun 03 13:15:11 2021 +0200
    tdf#142635: skip UITest for now

Change-Id: I0a3aa6028f49ded278f8665556007b1f722e21b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134251
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-17 06:15:48 +02:00
Mike Kaganski
5386e56120 Related: tdf#142635 Make ScDocShell reference ScDocument by shared_ptr
Required for eventual sharing of the document between the shell
and other pieces having different lifetime, as required to fix
tdf#142635.

Change-Id: I9e69bd2e3b57d7712526f51161e7e725d4af8068
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134383
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-17 06:15:33 +02:00
Luboš Luňák
be441f1a8c use FontMetric as SalLayoutGlyphsCache key rather than vcl::Font
Apparently even calling OutputDevice::GetFontMetric() rather than
GetFont() makes a difference with e.g. tdf#65046-1, when only
vcl::Font is used it triggers the assert in checkGlyphsEqual()
because of the fonts actually being different.

Change-Id: I2a2aba6bf6d4bf78b7449ccdb16be0746663ee87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134401
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-16 21:14:47 +02:00
Mike Kaganski
60ab59ef59 Fix a UITest on Windows
Change-Id: I943a7696fd896c8709fdcd25bce650dd80244daf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134367
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-16 20:22:51 +02:00
Mike Kaganski
10bc799f9d Fix a UITest on Windows
Change-Id: Ieb6d04e344b1d875f2661833e17f64930681e528
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134366
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-16 20:22:43 +02:00
Mike Kaganski
212eeff283 Fix a UITest on Windows
Change-Id: If4e5612e2b9fa41c487a6ab54c1e23fd2d63ac9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134365
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-16 20:22:33 +02:00
Caolán McNamara
81623bf643 de-lint the .ui file for auto gtk3->gtk4 conversion
Change-Id: Icb288ae13e75784e7b560101f33b8a96935bda36
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134389
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-16 19:19:15 +02:00
Eike Rathke
f6e7b9a992 Update to ICU 71.1
No major changes.
See https://icu.unicode.org/download/71

Change-Id: I7929d175962ff13e4369005633a4135f17f97e8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134404
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2022-05-16 18:36:19 +02:00
Chris Sherlock
9d64ab991b store: add unit tests
Test:

- create a file in memory
- open a stream
- write a byte to the stream
- read the byte from the stream

Change-Id: I257880bdd9020d2410f183e612a356eb785621ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127674
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
2022-05-16 18:23:14 +02:00
Miklos Vajna
a1e2fc0121 sw content controls, dropdown: edit list items: add modify and delete
Modify is really similar to insert, just we pre-fill the list item
properties dialog with old data.

Also allow moving items up / down, and eliminate a not needed frame in
the inner dialog, which would assert when using the gen backend.

With this, the content control dialog is quite complete for dropdowns.

Change-Id: I26e77dd881f0a0eea44d2a6137f76fd29ab32fc5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134405
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-05-16 18:23:01 +02:00
Seth Chaiklin
9cfaeb1e08 tdf#137748 make keyboard accelerators functional in Statistics dialog
Make the keyboard accelerators in the Statistics tab of the
   File - Properties dialog select the text of the fields that they label.

Change-Id: I61a93e227ed1e457355dc971dc4864ab4419a770
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134358
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-16 17:57:12 +02:00
Caolán McNamara
673b781fcf use explicit translatable="no" like we typically do in this case
Change-Id: I6dfcca43fbeace4a75878f0eebe57289b221c4fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134388
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-16 17:56:28 +02:00
Noel Grandin
a49c683546 remove unnecessary copying in OInterfaceContainerHelper4
caused by triggering make_unique in cow_wrappe when calling through
non-const operator*

Change-Id: I3191466f464d0f741a628afbe45b60f66f6af2c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134395
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-16 17:51:27 +02:00
Noel Grandin
f23633aa0a no need to stat a dir when opening a temporary file
it can never be a dir

Change-Id: Ib1c234cb20387cd075a19e13e6656738be88716b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134397
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-16 17:51:02 +02:00
Xisco Fauli
985240136d pdfwriter: validator: fix rule 6.4-3
See https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Part-1-rules#rule-64-3

Spotted while validating https://bugs.documentfoundation.org/attachment.cgi?id=179703
from tdf#148706 with verapdf <https://demo.verapdf.org/>

Change-Id: Ic6cfd18b0c2e8fd252ddd470eff23941f54bb29f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134402
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-05-16 17:42:59 +02:00
Bartosz Kosiorek
3d077ff932 EMF+ Simplify and optimize the code
Change-Id: Iae7e83253cfe7c0545d2381d83a2e69cb4b80e5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134376
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2022-05-16 17:27:24 +02:00
Bartosz Kosiorek
2156c1090d tdf#143876 EMF+ Add DrawClosedCurve and FillClosedCurve support
With this commit EmfPlusDrawClosedCurve and EmfPlusFillClosedCurve
support was added. There is still missing Filling Mode (it
is always set to Even Odd Alternate:
https://en.wikipedia.org/wiki/Even%E2%80%93odd_rule )
and Tension support for spline bends.
The graphics is displayed as Tension=0.
A value of Tension=0 specifies that the spline is a sequence of straight lines.
As the value increases, the curve becomes more rounded.
For more information, see [SPLINE77] and [PETZOLD].

Change-Id: Ibccfd584e3d55cd0ca8a29da9f450916d56705d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134333
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2022-05-16 17:26:20 +02:00
Tomaž Vajngerl
c9711f2ff2 basegfx: remove CoordinateData2D class and use B2DPoint directly
For some reason B2DPolygon used a CoordinateData2D class that
derived from basegfx::B2DPoint with no added functionallity that
is used in practice (just an explicit method transform instead of
using an operator*=). This class has been removed and replaced
with B2DPoint instead.

Also removed was the typdef CoordinateData2DVector and calls to
the std::vector's iterator (begin, end) have been simplified with
"auto".

Change-Id: I0d187ded05a8e22de36a8e17523e87871aab912c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134378
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-05-16 17:09:51 +02:00
Tomaž Vajngerl
ed6d83dfbc basegfx: move ImplB2DPolyPolygon inside basegfx namespace
also remove unneeded typedef

Change-Id: I24fd31ff9da579260f1889ed87065f95dcfd1e23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134377
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-05-16 17:09:22 +02:00
Jim Raykowski
9e2391561d tdf#149049 give media object a name when created
so it is shown in the Navigator

Change-Id: Ia4e9c847a1a8cfbaa3465f1472d4b899f4bde3fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134334
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2022-05-16 17:01:15 +02:00
Jim Raykowski
fbe42e55fd Make media object delete when it is cut
Change-Id: Id586e015e42c23aa455d6f1a5dc42fbda492d2a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134381
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2022-05-16 17:00:48 +02:00
Jean-Pierre Ledure
f9fa11e1c2 ScriptForge - (SF_Calc) FIX CompactUp/Left whan range is 1 row/col
When the range to compact spans only 1 row (CompactUp)
or 1 column (CompactLeft), a GetValue() method returns
a scalar and not an array as expected in usual cases.

This caused an abort of the script when invoking the
UBound() value of the returned array with a Basic run-time error
   Object variable not set

A test on being scalar or array of the result of
the GetValue() method avoids the error.
To be done in both CompactXXX() methods.

Impact only on Basic code. Python not involved.
No changes due in documentation.

Change-Id: I74cf2b274944b442f843e1f4b7ac3a05dd6eaae7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134352
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2022-05-16 16:22:55 +02:00
Stephan Bergmann
4ebfd85322 Revert "use more string_view in getNameNoExtension"
This reverts commit d4f2b8eb74, as it causes
heap-use-after-free, e.g. during CppunitTest_dbaccess_hsqldb_test,

> ==24944==ERROR: AddressSanitizer: heap-use-after-free on address 0x6070001a04a8 at pc 0x0000004b6b42 bp 0x7fff0f651490 sp 0x7fff0f650c40
> READ of size 56 at 0x6070001a04a8 thread T0
>     #0 0x4b6b41 in __asan_memcpy /home/tdf/lode/packages/llvm-llvmorg-12.0.1.src/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22
>     #1 0x7f315931e373 in rtl::addDataHelper(char16_t*, char16_t const*, unsigned long) /include/rtl/stringconcat.hxx:89:9
>     #2 0x7f3159beb290 in rtl::ToStringHelper<std::basic_string_view<char16_t, std::char_traits<char16_t> > >::addData(char16_t*, std::basic_string_view<char16_t, std::char_traits<char16_t> >) /include/rtl/stringconcat.hxx:553:14
>     #3 0x7f3159beb7ea in rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >::addData(char16_t*) const /include/rtl/stringconcat.hxx:252:88
>     #4 0x7f3159beb59d in rtl::ToStringHelper<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > > >::addData(char16_t*, rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > > const&) /include/rtl/stringconcat.hxx:271:122
>     #5 0x7f315c3dc450 in rtl::OUStringConcat<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >, char const [5]>::addData(char16_t*) const /include/rtl/stringconcat.hxx:252:119
>     #6 0x7f315c3c41b2 in rtl::OUString::OUString<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >, char const [5]>(rtl::OUStringConcat<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >, char const [5]>&&) /include/rtl/ustring.hxx:495:34
>     #7 0x7f315c3eb066 in void __gnu_cxx::new_allocator<rtl::OUString>::construct<rtl::OUString, rtl::OUStringConcat<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >, char const [5]> >(rtl::OUString*, rtl::OUStringConcat<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >, char const [5]>&&) /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/ext/new_allocator.h:136:23
>     #8 0x7f315c3e9e46 in void std::allocator_traits<std::allocator<rtl::OUString> >::construct<rtl::OUString, rtl::OUStringConcat<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >, char const [5]> >(std::allocator<rtl::OUString>&, rtl::OUString*, rtl::OUStringConcat<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >, char const [5]>&&) /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/alloc_traits.h:475:8
>     #9 0x7f315c3ea266 in void std::__cxx1998::vector<rtl::OUString, std::allocator<rtl::OUString> >::_M_realloc_insert<rtl::OUStringConcat<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >, char const [5]> >(__gnu_cxx::__normal_iterator<rtl::OUString*, std::__cxx1998::vector<rtl::OUString, std::allocator<rtl::OUString> > >, rtl::OUStringConcat<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >, char const [5]>&&) /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/vector.tcc:415:4
>     #10 0x7f315c3e9c59 in rtl::OUString& std::__cxx1998::vector<rtl::OUString, std::allocator<rtl::OUString> >::emplace_back<rtl::OUStringConcat<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >, char const [5]> >(rtl::OUStringConcat<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >, char const [5]>&&) /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/vector.tcc:105:4
>     #11 0x7f315c3bc742 in rtl::OUString& std::__debug::vector<rtl::OUString, std::allocator<rtl::OUString> >::emplace_back<rtl::OUStringConcat<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >, char const [5]> >(rtl::OUStringConcat<rtl::OUStringConcat<rtl::OUStringConcatMarker, std::basic_string_view<char16_t, std::char_traits<char16_t> > >, char const [5]>&&) /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/debug/vector:489:11
>     #12 0x7f315c3a7729 in ImplImageTree::getPaths(rtl::OUString const&, LanguageTag const&) /vcl/source/image/ImplImageTree.cxx:226:20
[...]

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

Change-Id: I3af57646bc97c33aad4570a4d6b68dff340b4c64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134390
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-16 16:11:45 +02:00
Caolán McNamara
2438c2e9bc Related: tdf#137748 "Update" should have use-underline
Change-Id: I8303cd8d2cabd8888797758870480483661d8801
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134391
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Tested-by: Jenkins
2022-05-16 15:42:41 +02:00
Caolán McNamara
0181f557b3 forcepoint#97 avoid Invalid read of size 2
==143282== Invalid read of size 2
 ==143282==    at 0x190CDBFC: SfxItemSet::Count() const (itemset.hxx:96)
 ==143282==    by 0x1910F33E: SfxItemSet::Get(unsigned short, bool) const (itemset.cxx:748)
 ==143282==    by 0x1F14D76C: ScPatternAttr::GetItem(unsigned short, SfxItemSet const&, SfxItemSet const*) (patattr.cxx:1347)
 ==143282==    by 0x1F14D7DA: ScPatternAttr::GetItem(unsigned short, SfxItemSet const*) const (patattr.cxx:1352)
 ==143282==    by 0x202A3E44: ScLineBreakCell const& ScPatternAttr::GetItem<ScLineBreakCell>(TypedWhichId<ScLineBreakCell>, SfxItemSet const*) const (patattr.hxx:83)
 ==143282==    by 0x2028E8BC: ScOutputData::LayoutStrings(bool, bool, ScAddress const&) (output2.cxx:1677)
 ==143282==    by 0x2028D4A8: ScOutputData::DrawStrings(bool) (output2.cxx:1473)
 ==143282==    by 0x202D9879: ScPrintFunc::PrintArea(short, int, short, int, long, long, bool, bool, bool, bool) (printfun.cxx:1675)
 ==143282==    by 0x202DD459: ScPrintFunc::PrintPage(long, short, int, short, int, bool, ScPreviewLocationData*) (printfun.cxx:2301)
 ==143282==    by 0x202DF491: ScPrintFunc::DoPrint(MultiSelection const&, long, long, bool, ScPreviewLocationData*) (printfun.cxx:2713)
 ==143282==    by 0x20031888: ScModelObj::render(int, com::sun::uno::Any const&, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (docuno.cxx:2259)
 ==143282==    by 0x30C1A485: PDFExport::ExportSelection(vcl::PDFWriter&, com::sun::uno::Reference<com::sun::view::XRenderable> const&, com::sun::uno::Any const&, StringRangeEnumerator const&, com::sun::uno::Sequence<com::sun:🫘:PropertyValue>&, int) (pdfexport.cxx:219)
 ==143282==    by 0x30C1F879: PDFExport::Export(rtl::OUString const&, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (pdfexport.cxx:987)
 ==143282==    by 0x30C33BA2: PDFFilter::implExport(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (pdffilter.cxx:174)
 ==143282==    by 0x30C33F2A: PDFFilter::filter(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (pdffilter.cxx:237)
 ==143282==    by 0x21AC6986: SfxObjectShell::ExportTo(SfxMedium&) (objstor.cxx:2488)
 ==143282==    by 0x21AC2363: SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) (objstor.cxx:1553)
 ==143282==    by 0x21ACE816: SfxObjectShell::PreDoSaveAs_Impl(rtl::OUString const&, rtl::OUString const&, SfxItemSet const&, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (objstor.cxx:2966)
 ==143282==    by 0x21ACCA87: SfxObjectShell::CommonSaveAs_Impl(INetURLObject const&, rtl::OUString const&, SfxItemSet&, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (objstor.cxx:2756)
 ==143282==    by 0x21AA8CDB: SfxObjectShell::APISaveAs_Impl(rtl::OUString const&, SfxItemSet&, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (objserv.cxx:317)
 ==143282==    by 0x21B2B4AD: SfxBaseModel::impl_store(rtl::OUString const&, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&, bool) (sfxbasemodel.cxx:3132)
 ==143282==    by 0x21B2CB12: SfxBaseModel::storeToURL(rtl::OUString const&, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (sfxbasemodel.cxx:1768)
 ==143282==    by 0x1C507AFE: ScPDFExportTest::exportToPDF(com::sun::uno::Reference<com::sun::frame::XModel> const&, ScRange const&) (scpdfexport.cxx:192)
 ==143282==    by 0x1C511A33: ScPDFExportTest::testForcepoint97() (scpdfexport.cxx:571)
 ==143282==    by 0x1C52778D: void std::__invoke_impl<void, void (ScPDFExportTest::*&)(), ScPDFExportTest*&>(std::__invoke_memfun_deref, void (ScPDFExportTest::*&)(), ScPDFExportTest*&) (invoke.h:74)
 ==143282==    by 0x1C5276C1: std::__invoke_result<void (ScPDFExportTest::*&)(), ScPDFExportTest*&>::type std::__invoke<void (ScPDFExportTest::*&)(), ScPDFExportTest*&>(void (ScPDFExportTest::*&)(), ScPDFExportTest*&) (invoke.h:96)
 ==143282==    by 0x1C527659: void std::_Bind<void (ScPDFExportTest::*(ScPDFExportTest*))()>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) (functional:420)
 ==143282==    by 0x1C5275E2: void std::_Bind<void (ScPDFExportTest::*(ScPDFExportTest*))()>::operator()<, void>() (functional:503)
 ==143282==    by 0x1C52758C: void std::__invoke_impl<void, std::_Bind<void (ScPDFExportTest::*(ScPDFExportTest*))()>&>(std::__invoke_other, std::_Bind<void (ScPDFExportTest::*(ScPDFExportTest*))()>&) (invoke.h:61)
 ==143282==    by 0x1C52753C: std::enable_if<is_invocable_r_v<void, std::_Bind<void (ScPDFExportTest::*(ScPDFExportTest*))()>&>, void>::type std::__invoke_r<void, std::_Bind<void (ScPDFExportTest::*(ScPDFExportTest*))()>&>(std::_Bind<void (ScPDFExportTest::*(ScPDFExportTest*))()>&) (invoke.h:111)
 ==143282==    by 0x1C52731C: std::_Function_handler<void (), std::_Bind<void (ScPDFExportTest::*(ScPDFExportTest*))()> >::_M_invoke(std::_Any_data const&) (std_function.h:290)
 ==143282==    by 0x1C527A34: std::function<void ()>::operator()() const (std_function.h:590)
 ==143282==    by 0x1C527078: CppUnit::TestCaller<ScPDFExportTest>::runTest() (TestCaller.h:175)
 ==143282==    by 0x49326F2: CppUnit::TestCaseMethodFunctor::operator()() const (TestCase.cpp:32)
 ==143282==    by 0x15937E3D: (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (vclbootstrapprotector.cxx:46)
 ==143282==    by 0x4929ED1: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (ProtectorChain.cpp:20)
 ==143282==    by 0x4B05D6D: (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (unobootstrapprotector.cxx:78)
 ==143282==    by 0x4929ED1: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (ProtectorChain.cpp:20)
 ==143282==    by 0x4AF2F2A: (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (unoexceptionprotector.cxx:62)
 ==143282==    by 0x4929ED1: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (ProtectorChain.cpp:20)
 ==143282==    by 0x491261E: CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (DefaultProtector.cpp:15)
 ==143282==    by 0x4929ED1: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (ProtectorChain.cpp:20)
 ==143282==    by 0x4928690: CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (ProtectorChain.cpp:86)
 ==143282==    by 0x4946ACD: CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (TestResult.cpp:182)
 ==143282==    by 0x4932103: CppUnit::TestCase::run(CppUnit::TestResult*) (TestCase.cpp:91)
 ==143282==    by 0x4932BCF: CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) (TestComposite.cpp:64)
 ==143282==    by 0x4932A5F: CppUnit::TestComposite::run(CppUnit::TestResult*) (TestComposite.cpp:23)
 ==143282==    by 0x4932BCF: CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) (TestComposite.cpp:64)
 ==143282==    by 0x4932A5F: CppUnit::TestComposite::run(CppUnit::TestResult*) (TestComposite.cpp:23)
 ==143282==    by 0x494FDBF: CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) (TestRunner.cpp:47)
 ==143282==  Address 0x1d7624b0 is 64 bytes inside a block of size 120 free'd
 ==143282==    at 0x4847669: operator delete(void*) (vg_replace_malloc.c:923)
 ==143282==    by 0x1F150EA1: ScPatternAttr::~ScPatternAttr() (patattr.hxx:53)
 ==143282==    by 0x190D29B2: SfxItemPool::Remove(SfxPoolItem const&) (itempool.cxx:802)
 ==143282==    by 0x1EA27F8E: ScAttrArray::SetPatternAreaImpl(int, int, ScPatternAttr const*, bool, ScEditDataArray*, bool) (attarray.cxx:574)
 ==143282==    by 0x1EBF43D5: ScAttrArray::SetPattern(int, ScPatternAttr const*, bool) (attarray.hxx:148)
 ==143282==    by 0x1EBD9068: ScColumn::ApplyAttr(int, SfxPoolItem const&) (column.cxx:634)
 ==143282==    by 0x1EC6C1EB: ScColumn::SetNumberFormat(int, unsigned int) (column2.cxx:3094)
 ==143282==    by 0x1F1CB737: ScTable::SetNumberFormat(short, int, unsigned int) (table2.cxx:2238)
 ==143282==    by 0x1EE3F135: ScDocument::SetNumberFormat(ScAddress const&, unsigned int) (document.cxx:3717)
 ==143282==    by 0x1F09CCA5: ScFormulaCell::InterpretTail(ScInterpreterContext&, ScFormulaCell::ScInterpretTailParameter) (formulacell.cxx:2155)
 ==143282==    by 0x1F099D9F: ScFormulaCell::Interpret(int, int) (formulacell.cxx:1615)
 ==143282==    by 0x1ECC048D: ScFormulaCell::MaybeInterpret() (formulacell.hxx:465)
 ==143282==    by 0x1F09F5C8: ScFormulaCell::IsValue() (formulacell.cxx:2760)
 ==143282==    by 0x1EA82355: (anonymous namespace)::hasNumericImpl(CellType, ScFormulaCell*) (cellvalue.cxx:155)
 ==143282==    by 0x1EA822FA: ScRefCellValue::hasNumeric() const (cellvalue.cxx:624)
 ==143282==    by 0x2028E876: ScOutputData::LayoutStrings(bool, bool, ScAddress const&) (output2.cxx:1676)
 ==143282==    by 0x2028D4A8: ScOutputData::DrawStrings(bool) (output2.cxx:1473)
 ==143282==    by 0x202D9879: ScPrintFunc::PrintArea(short, int, short, int, long, long, bool, bool, bool, bool) (printfun.cxx:1675)
 ==143282==    by 0x202DD459: ScPrintFunc::PrintPage(long, short, int, short, int, bool, ScPreviewLocationData*) (printfun.cxx:2301)
 ==143282==    by 0x202DF491: ScPrintFunc::DoPrint(MultiSelection const&, long, long, bool, ScPreviewLocationData*) (printfun.cxx:2713)
 ==143282==    by 0x20031888: ScModelObj::render(int, com::sun::uno::Any const&, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (docuno.cxx:2259)
 ==143282==    by 0x30C1A485: PDFExport::ExportSelection(vcl::PDFWriter&, com::sun::uno::Reference<com::sun::view::XRenderable> const&, com::sun::uno::Any const&, StringRangeEnumerator const&, com::sun::uno::Sequence<com::sun:🫘:PropertyValue>&, int) (pdfexport.cxx:219)

Change-Id: Idf19b79f5aef7e07666249f5f9ec510003a3f886
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132431
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2022-05-16 15:40:27 +02:00