Commit graph

477902 commits

Author SHA1 Message Date
Noel Grandin
a20fa9bbbf unique_ptr->optional in DocumentFieldsManager::UpdateTableFields
Change-Id: I5b4595ea04d5e1a28007008b96a684defff744e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138322
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-16 09:11:34 +02:00
Noel Grandin
1920eb7843 improve SwContentIndexReg::Update...UpdateMode::Negative
the indexes in the linked list are stored in-order.
So
(a) there is no need to overwrite a value with the same value
and
(b) there is no need to walk the list backwards before going
forwards

Change-Id: I77d6b227c5c2eb8e70ce3975963ec2d1826d0246
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138321
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-16 09:11:16 +02:00
Tomaž Vajngerl
81a5f33101 chart2: always set text props. of the first paragraph and not cell
When setting the properties of the data table it is important to
differentiate when we set the properties of the text of the (first
and only) paragraph or set the properties for the current cell.

In this chage we refactor the code so that we always set the text
via UNO text::XText call for the current cell, and in the next step
get the XPropertySet of the first paragraph and set the properties
relevant for the text from the DataTable model.

Change-Id: Ibe82b21c3416083cfe8e86b95443d77984da05f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138330
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-16 08:16:27 +02:00
Tomaž Vajngerl
e0599e403b chart2: add "font effects" tab page to the data table dialog
Change-Id: I5530477dc86ba2174ba6e553dfe77f8fa355a863
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138329
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-16 08:16:13 +02:00
Tomaž Vajngerl
e4e5d77bcc chart2: render line legend symbols better in a data table
Change-Id: I556b4f249688a3836bbeeb3f554cb9ecf1d31f65
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138301
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-16 08:15:56 +02:00
Tomaž Vajngerl
5dcfa8f375 chart2: fix rendering of table borders of row/column headers
The row/column headers didn't enable/disable the table borders
correctly when outline was enabled and horizontal and vertical
borders properties were disabled.

Change-Id: Ifcb059dd7d39890bbcaf55d3a68dce41eef586cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138300
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-16 08:15:33 +02:00
Tomaž Vajngerl
9d6ffcc057 chart2: Data table rendering of keys (legend symbols)
Change-Id: Iff13b188df18fe8f9919274869774f53f2ea323b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138299
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-16 08:15:00 +02:00
Miklos Vajna
777f1dbb96 pdfium: replace windows arm64 patch with a backport from upstream
No functional changes intended, just this way the patch can be dropped
trivially the next time we update pdfium.

Change-Id: I3259e98ddd20a51e109e860e1a3ab4c138597436
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138323
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-08-16 08:12:25 +02:00
Tomaž Vajngerl
fcf839cd4b chart2: Add undo/redo for the data table
Change-Id: I6b25a7a82957705481952bc3cd181a6d0c1fce0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138298
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-16 08:12:16 +02:00
Xisco Fauli
3dec8709c1 tdf#150151: sw: Add UItest
Change-Id: I59da074531d4545ea80096db2b00376b632eddbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138295
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-08-16 07:53:29 +02:00
Xisco Fauli
c1446da82b tdf#103492: vcl_pdfexport: Add unittest
Change-Id: I426ace3f1272b2cb5f40d627c9c701b903c3e632
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138272
Reviewed-by: خالد حسني <khaled@aliftype.com>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-08-16 00:26:28 +02:00
Tomaž Vajngerl
f448de22e0 correct the description of NumberingRules
duplicated text - "@see NumberingLevel"

Change-Id: I210c392dba738e65ed22b8c66e16a6bafb1c4265
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138261
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-15 22:43:48 +02:00
Miklos Vajna
251589c17c tdf#148289 sw clearing breaks: fix vertical layout
There were 3 problems here:

1) SwTextFly::GetMaxBottom() gets an already swapped frame, so going via
   the aRectFnSet abstraction is not correct, need to use Left() and
   similar functions directly.

2) SwTextCursor::AdjustBaseLine() centers portions in the vertical case,
   so a clearing break portion with larger height will push the other
   portions towards the left, and this is not wanted. Fix this by
   filtering out the (logic) height of the clearing break portions in
   the vertical case.

3) The fix for 2) has the side effect that the non-printable line break
   indicator character now has the wrong (logic) top position in
   SwBreakPortion::Paint(). Fix this by compensating for the offset done in
   AdjustBaseLine().

No functional changes intended for the horizontal layout.

Change-Id: I9ea27b4247944cbab8e96c5c5e2c8f82bbbd731c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138314
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-08-15 20:43:03 +02:00
Caolán McNamara
f3b0a95f9c fix "invalid class cast from 'OOoAtkObj' to 'GtkWidgetAccessible'"
and similar

Change-Id: I8a989465057a5b7810f6cedf370fc1cd77f5af0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138311
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-15 20:22:24 +02:00
Noel Grandin
077cbb5fae pass SwNode and sal_Int32 to deleteMarks
instead of SwNodeIndex and SwContentIndex. Part of the process
of hiding the implementation of SwPosition.

Change-Id: I290fbc14d738d1bbf5d3f613eae6d114fc7cda17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138271
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-15 16:54:05 +02:00
Caolán McNamara
895d6716ba Resolves: tdf#149858 embedded starmath not using correct initial zoom
since...

commit ea21b870f8
Date:   Mon Apr 19 15:22:22 2021 +0100

    weld SmGraphicWindow

where the outer Window is not directly drawn into any more

Change-Id: I70f45590f0fb7ff2f7af80da8873d580d219aca4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138297
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-15 15:09:30 +02:00
Samuel Mehrbrodt
8750c812c9 Fix mispositioning when only quickstarter is active
When positioning a dialog via external UNO connection,
and no LibreOffice window is visible (only quickstarter is running),
the window was mispositioned.

The ClientToScreen call changes the requested position, so skip that
for dialogs too.

Change-Id: I7656ec66b6aeccdc1fa306f5e05cf72b3cb87214
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138135
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-08-15 14:00:50 +02:00
Stephan Bergmann
5b5f6b147f external/nss: Fix -Wincompatible-function-pointer-types
...with recent Clang 16 trunk since
<af01f717c4>
"Default implicit function pointer conversions diagnostic to be an error",
causing

> ../../../pr/tests/testfile.c:126:41: error: incompatible function pointer types passing 'void (*)(void *)' to parameter of type 'void *(*)(void *)' [-Wincompatible-function-pointer-types]
>         if (!pthread_create(&tid, NULL, start, arg)) {
>                                         ^~~~~
> /usr/include/pthread.h:204:15: note: passing argument to parameter '__start_routine' here
>                            void *(*__start_routine) (void *),
>                                    ^

and

> ../../../pr/tests/testfile.c:576:31: error: incompatible function pointer types passing 'PRInt32 (void *)' (aka 'int (void *)') to parameter of type 'void (*)(void *)' [-Wincompatible-function-pointer-types]
>                               DirTest, &thrarg,
>                               ^~~~~~~
> ../../../pr/tests/testfile.c:93:36: note: passing argument to parameter 'start' here
>                             void (*start)(void *arg),
>                                    ^

Change-Id: I642e5ca69289993c86abafded65ac23a63fd837e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138267
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-15 13:38:14 +02:00
Thierry Emery
dbd104083d tdf#133299 Anchor pasted images 'to cell' by default
This is already the default when inserting images via menu,
do this also when pasting images from other applications
(currently it would anchor 'to page').

Change-Id: I5e1d010b026fc8eba2d3a7cca80ea96814a2ebe8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138005
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-08-15 13:17:04 +02:00
Tomaž Vajngerl
203eaefb4a xmloff: import and export for the chart data table
This change adds import and export code for the the chart's data
table properties to the ODF format for chart documents. The data
table properties are exported to a new element "data-table", which
then references a auto style with all the properties of a data
table + new data table specific properties: HBorder, VBorder,
Outline, Keys which are mapped to "show-horizontal-border",
"show-vertical-border", "show-outline" and "show-keys" chart
attributes.

Also adds a test for the import and export:
imports xlsx -> exports to ods -> imports ods

Change-Id: Id45d9369fd619959e4d6eba7ca51c8ddce9c8f56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138260
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-15 13:08:17 +02:00
Tomaž Vajngerl
5861af0da5 chart2: DataTable set properties to default to false
Change-Id: If8caf59629327b623b2630776b1e650cbe4fbed1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138259
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-15 13:08:04 +02:00
Tomaž Vajngerl
0c984c4dbe chart2: InsertDataTable and DeleteDataTable for context menu
Change-Id: I8ef0698252209af01b0741a59dec70f845f0c965
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138258
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-15 13:07:53 +02:00
Mark Hung
1bf82b26ae tdf#135991 fix unexpected hidden RTL sections.
SwLayoutFrame::MakeAll tried to manipulate the height instead of the
width for SwCellFrame and SwColumnFrame ( i.e. when IsNeghbourFrame()
is true. ), by selecting a wrong SwRectFn.

SwRectFn fnRect = bVert == IsNeighbourFrame() ? fnRectHori :
( IsVertLR() ? (IsVertLRBT() ? fnRectVertL2RB2T : fnRectVertL2R) : fnRectVert );

It doesn't make sense to select among fnRectVertL2RBT, fnRectVertL2R,
and fnRectVert if the layout is horizontal.
The frame position got a negative top value and make the frame invisble.

Check he following commit for reference:

commit c90b6806d1
Author: Andreas Martens <ama@openoffice.org>
Date:   Wed Sep 19 07:45:10 2001 +0000

    Chg: Moving vertical help functions from SwFrm to SwRect

Change-Id: I2f6da9cdbc2947de95a6fb9ce8fa94a79360c83a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138250
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-08-15 11:39:09 +02:00
Stephan Bergmann
ae7efecd24 external/lxml: Fix -Wincompatible-function-pointer-types
...with recent Clang 16 trunk since
<af01f717c4>
"Default implicit function pointer conversions diagnostic to be an error",
causing

> src/lxml/etree.c:175589:60: error: incompatible function pointer types passing 'void (void *, void *, xmlChar *)' (aka 'void (void *, void *, unsigned char *)') to parameter of type 'xmlHashScanner' (aka 'void (*)(void *, void *, const unsigned char *)') [-Wincompatible-function-pointer-types]
>   xmlHashScan(__pyx_v_self->__pyx_base._xpathCtxt->nsHash, __pyx_f_4lxml_5etree__registerExsltFunctionsForNamespaces, __pyx_v_self->__pyx_base._xpathCtxt);
>                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> workdir/UnpackedTarball/libxml2/include/libxml/hash.h:213:22: note: passing argument to parameter 'f' here
>                                          xmlHashScanner f,
>                                                         ^

Change-Id: I2a359ed0dfdfa83b49fb03f447967a6d0ff73989
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138266
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-15 11:17:41 +02:00
Stephan Bergmann
49f392feb9 external/cairo: Fix -Wincompatible-function-pointer-types
...with recent Clang 16 trunk since
<af01f717c4>
"Default implicit function pointer conversions diagnostic to be an error",
causing

> pixman-bits-image.c:1184:39: error: incompatible function pointer types passing 'const float (int, int)' to parameter of type 'dither_factor_t' (aka 'float (*)(int, int)') [-Wincompatible-function-pointer-types]
>         buffer = dither_apply_ordered (iter, dither_factor_blue_noise_64);
>                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> pixman-bits-image.c:1130:60: note: passing argument to parameter 'factor' here
> dither_apply_ordered (pixman_iter_t *iter, dither_factor_t factor)
>                                                            ^
> pixman-bits-image.c:1189:39: error: incompatible function pointer types passing 'const float (int, int)' to parameter of type 'dither_factor_t' (aka 'float (*)(int, int)') [-Wincompatible-function-pointer-types]
>         buffer = dither_apply_ordered (iter, dither_factor_bayer_8);
>                                              ^~~~~~~~~~~~~~~~~~~~~
> pixman-bits-image.c:1130:60: note: passing argument to parameter 'factor' here
> dither_apply_ordered (pixman_iter_t *iter, dither_factor_t factor)
>                                                            ^

Change-Id: I3e28280c9c25dfb7cee5155719a71655db00e344
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138265
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-15 11:17:16 +02:00
Michael Stahl
6f42a2c863 tdf#150382 writerfilter,sw: RTF import of paragraph border override
The style (default unnamed \s0, applied via \pard) defines green
borders, which are overridden at the 2nd paragraph and cleared.

Of course there isn't a single border control word to be found on the
2nd paragraph, the override happens by omitting the borders of the
implicitly applied style.

Hence handle LN_CT_PrBase_pBdr in getDefaultSPRM().

The export of the override relies on changes from commit
967a03eb8760fb498c5ea6c32d03d1eea486bbe2.

Change-Id: I081eb2908d76123e7828cab6c31ceb7b11760183
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138193
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-08-15 11:14:38 +02:00
Michael Stahl
f6a0ca0e92 tdf#149921 ucb: webdav-curl: WNT: certificate revocation check
- don't require it to be successful.

Trying to connect to a server with self-signed CA results in:

warn:ucb.ucp.webdav.curl:6796:6568:ucb/source/ucp/webdav-curl/CurlSession.cxx:946:
curl_easy_perform failed: (35) schannel: next InitializeSecurityContext failed:
Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.

Apparently schannel wants to check by default (called with
SCH_CRED_REVOCATION_CHECK_CHAIN) that all the certificates aren't
revoked, but the self-signed CA doesn't specify how to check.

Set it to only check revocation when the way to do so actually works,
via CURLSSLOPT_REVOKE_BEST_EFFORT, which sets these flags:
SCH_CRED_IGNORE_NO_REVOCATION_CHECK | SCH_CRED_IGNORE_REVOCATION_OFFLINE | SCH_CRED_REVOCATION_CHECK_CHAIN

Change-Id: I6d77ca23fe2012d8a5d65000b14775070b5c9a0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138204
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-08-15 10:34:27 +02:00
Noel Grandin
e83daa9ff1 pass content offset into FieldsToCalc instead of SwContentIndex
part of the process of hiding the internals of SwPosition

Change-Id: I76aee9e18f37f70648c181af0c2bbc4d4f2dfd2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138264
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-15 09:16:04 +02:00
Miklos Vajna
dd4d55b48c sw: prefix members of SwAddPrinterTabPage, SwCaptionOptPage, ...
... SwMarkPreview and SwParaDlg

See tdf#94879 for motivation.

Change-Id: I13d2961f46ebfd608176798be5a91ac0cd6c9d4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138263
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-08-15 09:07:19 +02:00
Andrea Gelmini
cb954e21aa Fix typo
Change-Id: I1bc4d4649fbf4d2cfe8e93bc3a4fca64804de6b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138241
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-08-15 08:40:47 +02:00
Noel Grandin
5dde7a14a2 this index should be sal_Int32
since we are indexing into node content here

Change-Id: I28c1a669a5202fb47757913bc175f1a926c4d4f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138252
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-15 08:16:32 +02:00
Tomaž Vajngerl
6c00d75738 chart2: InsertDataTableDialog for inserting/removing the data table
Change-Id: Ie3c033c587b150723e7aa39cd5ddf5774104db9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138257
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-15 07:42:32 +02:00
Caolán McNamara
6c81a09e3e ofz#49713 Heap-use-after-free
the dtor of ScAttrArray where the std::vector<ScAttrEntry> ends up
will call ScDocumentPool::Remove on each entries pPattern, assuming
that a matching ScDocumentPool::Put was called on each, something
that is elided if we just do a simply copy here.

probably a problem since:

commit dddee125cc
Date:   Thu Mar 10 15:03:25 2022 +0100

    load ods/xlsx with full row attributes without allocating all columns

Change-Id: I3a5e2e3fa4d40343f30f9eefbabd1579d8a97e02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138262
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-15 00:50:46 +02:00
Khaled Hosny
62ff1053ee svm: serialize MetaTextArrayAction’s Kashida array
Otherwise reading SVM files would lose the Kashida but not the DX
adjustments and would leave blanks in their place.

Change-Id: Id37e09fed12da5e256d65e2c45c91869364c8d06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138242
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-14 22:01:19 +02:00
Noel Grandin
d0c07ec1ca use more GetContentIndex
Change-Id: I48e36a95872b5c2bdb6b92c66403d4c08eedd38c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138255
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-14 21:28:37 +02:00
Khaled Hosny
895843ad46 tdf#103492: Messed Arabic letter spacing in text starting with LTR character(s)
This partially reverts the still relevant parts of commit

commit 41007842ed
Author: Martin Hosken <martin_hosken@sil.org>
Date:   Thu Sep 10 10:14:18 2015 +0700

    Refactor graphite integration and update graphite

    Change-Id: I09db7262c2a6180a078620ba086dd7a4c132bd82
    Reviewed-on: https://gerrit.libreoffice.org/18459
    Tested-by: Jenkins <ci@libreoffice.org>
    Reviewed-by: László Németh <nemeth@numbertext.org>
    Reviewed-by: Martin Hosken <martin_hosken@sil.org>

No mention of the commit about this change or its relevance to Graphite
integration. But the separate Graphite layout engine is long gone and
Graphite handling goes through HarfBuzz now, so whatever the change was
for is probably no longer relevant.

I reverted only one the two changes in impedit3.cxx, as the other one
does not seem to make any difference for this issue.

Change-Id: Id70a711d6231cce52c9a32dbc3604860b1da9f4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138217
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2022-08-14 21:13:04 +02:00
Khaled Hosny
3836b99f33 Use doubles when calculating the number of Kashidas to insert
Makes it a bit more stable across zoom levels and avoids excessive
overlaps due to calculating one copy too many because of rounding
errors.

Change-Id: I6a21a89c1dfda085b1f7fa9570c9875a0d39f671
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138192
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-14 21:12:37 +02:00
Khaled Hosny
3d0e482df8 tdf#106653: Try harder not to return 0 for Kashida width
The font in the bug document has a very small Kashida advance width and
this gets rounded to zero at smaller zoom level. Try to round up the
value to avoid returning zero too eagerly.

Change-Id: I78c309d66a9e94812827c7c6724c67c4d09bcff9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138169
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-14 21:12:21 +02:00
Khaled Hosny
5e2b7a6560 Streamline Kashida validation logic
We are asked to validate the position *after* which Kashida will be
inserted, but HarfBuzz will tell us which glyph we can insert Kashida
*before*. So align both by passing down the position before and after
and make the loop iterating over glyph items a lot simpler.

As a bonus, the new code allow Kashida insertion across layout change in
both sides, old code allowed it only at the start of the layout.

Change-Id: I9f632610b92c0f4c512e50456bf7d207175f17ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138168
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-14 21:11:52 +02:00
Khaled Hosny
72e56537d4 tdf#139627: Don’t set Kashida insertion position after combining marks
We were skipping the marks when checking for previous char, but not when
setting the index to previous char.

Fixes also the second part of tdf#106653.

Change-Id: I73436ba9df6ccf104ea6d4dfbd76a59c86040a44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138154
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-14 21:11:15 +02:00
Khaled Hosny
640a2bc1cd tdf#137528: Sync Kashida algorithm in editeng with sw
It seems that editeng is using an old copy of the code in sw and it was
never updated.

With this change, the text in the test document from tdf#137528 looks
essentially identical in both cases.

Fixes also tdf#146199.

Change-Id: I38541bfb35eae36681af84e73a7965d36152448f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138145
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-14 21:10:43 +02:00
Khaled Hosny
3901e029bd tdf#104921: Cleanup Kashida insertion logic
Communicate Kashida insertion positions in an explicit way.

Rest of LibreOffice communicate adjustments to character widths (e.g.
for justification or spacing) using so-called DX array. DX array is an
array of absolute character positions (e.g. DX[n] is the position after
character n from the start of the lines, and its widths is DX[n] -
DX[n-1]).

This DX array is modified also when Kashidas are inserted after a given
character for Arabic justification, by expanding its width. VCL would
use this to know where to insert the Kashidas and how many ones.

But because DX array is used for both widths adjustments and kashida
insertion, this turns out to be a source of bugs since VCL has tosecond
guess the DX array to find which is pure width adjustment and which also
involves Kashida insertion, and the heuristics it uses are fragile.

This change adds a second array of booleans that records where Kashida
is inserted and communicates it all the way from where Kashida insertion
is decoded in Writer and down to VCL layout.

This change passes the Kashida array only when it seems necessary (e.g.
during drawing but not when measuring text since the DX array is enough
in this case). Hopefully no places where Kashida insertion needs to be
passed down were missed.

A couple of glyph and layout flags that were used for old heuristics and
no longer needed and are removed.

This also fixes:
tdf#87731
tdf#106309
tdf#108604
tdf#112849
tdf#114257
tdf#127176
tdf#145647
tdf#146199

Change-Id: I4ed0850ef2fdc3e9143341afac649e7e7d463c39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138068
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-14 21:10:24 +02:00
Tomaž Vajngerl
cc54063b91 chart2: add some data table default properties
Change-Id: I4fac46ac2a119275bcdaa6ebc8b7382ad6fb5684
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138249
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-14 20:43:40 +02:00
Andrea Gelmini
c588128993 Fix typo
Change-Id: I9a973141bdefca22dc24ecfaba58803dfc256e15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138239
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2022-08-14 19:43:00 +02:00
Tomaž Vajngerl
16fac85be1 chart2: add "InsertMenuDataTable" action to menu
Change-Id: Ib60a2b061966eb61834480b63dc0653410a43a14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138248
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-14 19:37:42 +02:00
Andrea Gelmini
e727820149 Fix typo
Change-Id: Idb6ca21868789ea6e224e50e33198d684ef95638
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138240
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-08-14 19:17:12 +02:00
Caolán McNamara
f258dee156 ofz#49949 Timeout
Change-Id: I44ebfc50579cbcf6482fbb445c08b31961750467
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138254
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-14 19:00:08 +02:00
Caolán McNamara
a6bb3eb13a ofz#49750 Timeout
skip slow path on fuzzing

Change-Id: Idc27574ed7607011491248e726c1ba4bce9d483b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138253
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-14 18:52:46 +02:00
Tomaž Vajngerl
d4450b9a9f chart2: allow to select the data table, fix object CID
Change-Id: I0a8d3643fcaefe8105e935b929947174bd9bdc96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138247
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-14 18:16:05 +02:00
Tomaž Vajngerl
300ea910ba chart2: add UI to the data table
This adds a new object type "Data Table", with all the object
identifiers and converters of properties.
The data table is now shown in the drop-down of chart elements.
A properties dialog was added, which allows to change properties
of a data table. This contains the area, line and font tab pages
and a new tab page specific for data tables, to change if the
horiz. or vert. borders, key or the outline should be show.

Change-Id: I9b4cd58cffbcc952daaa2c0c8f8a5a17e38ac293
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138246
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-14 18:15:53 +02:00