Commit Graph
20019 Commits
Author SHA1 Message Date
Noel Grandin 2bf5658247 add a more complete o3tl::getToken
so we avoid OUString copying (mostly when doing stuff like parsing
numbers of out of strings)

Change-Id: I4ef6ac23671c0b40807a22158e655e92dfad4af6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132730
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-09 09:08:56 +02:00
Luboš Luňák de45c09a3b add SalLayoutGlyphs* parameter to OutputDevice::GetTextBreak()
Change-Id: I278e485e03cf27bc57724233453a672569dfd53f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132682
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-08 21:29:33 +02:00
Luboš Luňák 3e58636058 use just one shared global SalLayoutGlyphsCache
Now the cache should be capable of detecting what needs
to stay the same for having the same result, so it should
be enough to have just one cache that can reuse results
even between callers from different places.

Change-Id: Ibdc0303f5b727d1a1d7be91d61db9465ed95e1c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132673
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-08 21:29:19 +02:00
Luboš Luňák 53fe4a26c7 ignore Point logicalPos argument in SalLayoutGlyphsCache
It's only used for the DXArray argument in ImplLayout(), so if we
ignore that one when caching, the position can be ignored too.

Change-Id: Id2a7b452e2b75139177c1e73c48eaa466742a59c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132672
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-08 21:28:58 +02:00
Luboš Luňák 9ed2912d4e check better for unchanged OutputDevice in SalLayoutGlyphsCache
Some things like font could change, so it needs to be saved and compared.
If would be even better to avoid comparing OutputDevice pointers
and instead compare only what actually matters, in order to reuse
the same glyphs used for different output devices, but I can't
find all the relevant data in OutputDevice.

Change-Id: Ib8634165b5b312d1db2c9fc28f8d7fdf7b552d25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132671
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-08 21:28:44 +02:00
Luboš Luňák 1b593dbc62 use vcl::text::TextLayoutCache in SalLayoutGlyphsCache
Change-Id: I0ec22fe53e05319dec15456a916b10e97ea91a75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132668
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-08 21:27:59 +02:00
Noel Grandin 3e76797384 move comphelper::string::toInt32 to o3tl
so we can use it in places where we cannot include comphelper

Change-Id: Iba0ba3e4c0dcf0f9d1f09092a77c3b2010ec4f6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132732
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-08 20:44:43 +02:00
Miklos Vajna cf5bbe3fce sw content controls: add ODT export
Wrap the text portions inside the content control in a
<loext:content-control> XML element. Also map the (so far) single UNO
property of it to <loext:content-control
loext:showing-place-holder="...">.

This is just initial export for inline text content controls, more
properties are to be added in follow-up commits.

Change-Id: I5d928255b925ed7e08fb635ba39f546e9a4879de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132717
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-04-08 12:51:09 +02:00
Noel Grandin 3a88b513fd loplugin:stringviewparam convert methods using trim
for which we add a new o3tl::trim method

Change-Id: I9d37b6264eea106aa2f3502bd24b8cccf7850938
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132658
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-08 10:26:10 +02:00
Noel Grandin 59059d00c2 prevent using O[U]String::subView on temporaties
by making the method "const &"

Change-Id: I8b369ca1dd1f8d10832c85ccf3d890edb14e2c54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132688
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-08 08:43:34 +02:00
Caolán McNamara 39076309c6 Related: tdf#148448 add a separate WarningColor settings
instead of a hard-coded yellow. For gtk we can use the named color
"warning_color" to populate it: https://docs.gtk.org/gtk4/css-properties.html

Change-Id: I538bffdc0f6286c78a08cef649fa8a074a6510ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132684
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-04-07 23:59:26 +02:00
Mike Kaganski aeeacd2845 Drop write-only uses of pNonConvertableChars argument
Change-Id: Ibf60405868cfda08d125f63c45f8b74e52b32da4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132642
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-06 20:09:22 +02:00
Mike Kaganski e4f53484d2 tdf#148413: Drop HTML export encoding configuration; use UTF-8
Anything else is just a joke today.

Change-Id: Ie6a0cec1edcd257cbadef702018e6a919e6a0b44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132628
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-06 13:51:42 +02:00
Andrea Gelmini 0fafd7ff65 Fix typos
Change-Id: Idcb10d0cc0759473e95e47afec7ed69853628612
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132587
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2022-04-05 23:44:14 +02:00
Andrea Gelmini cbb66e9ace Fix typos
Change-Id: Iaf248ec769b82bdb22ac0620a1dc31ea90823d4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132535
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-04-05 21:49:04 +02:00
Andrea Gelmini b621e3e901 Removed duplicated include
Change-Id: I7e1608faf0dcb92ad710cb0f6346e9ceca2954aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132559
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2022-04-05 21:45:28 +02:00
Armin Le Grand (Allotropia) c79fa460fe Advanced Diagram support: Move Diagram Text information to svx
In a next step to get the Diagram mechanism/ModelData independent
from oox, I moved the Text ModelData to svx, using a TextBody
struct. This is a 1st move that covers most of what the
algorithms to handle Diagram re-layout and other functionality
use. This will potentially have to be extended accordingly
when missing data is detected. It is potentially much more
simple as the oox TextBody, by purpose.

Due to functionality using that data I could now massively move
more of it to svx.

Change-Id: I6d6e6c572f119aeefa4e91eff56f58f3ceb6a31e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132523
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-04-05 14:20:46 +02:00
Mike Kaganski b32c85d0be Move creation of case-insensitive variable name to a central place
SbxVariable::NameToCaseInsensitiveName might then be used wherever
such names may be needed (see e.g. tdf#148358).

Change-Id: I7749a12a05225398848cbf72700c6f0bc119bc22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132561
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-05 11:30:24 +02:00
Noel Grandin 9b2ad2e29e add some comphelper::string::toInt* functions for string_views
Change-Id: Icf42e00575edf8fc847bccf9c9505cd9710fc9b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132509
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-05 09:22:48 +02:00
Tomaž Vajngerl cf4d5ed026 add tools::Guid class to generate, parse GUID values
Change-Id: Ie4d8fad4d8f22c8277c22c21b7a9eb3e7c9e4f1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132513
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-04-05 01:57:21 +02:00
Tomaž Vajngerl bd992ae122 sc: sparkline import/export for ODF
Change-Id: I0d8293cdd35cc8c7afab98efac0a28a3613d122b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132505
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-04-04 16:22:11 +02:00
Noel Grandin 5de2437551 use string_view in comphelper::string::split
Change-Id: I4afe8aee85905ee35ba195b00b454aefa0ba38af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132486
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-04 13:48:11 +02:00
Mike Kaganski de81c2545a Related: tdf#144245 Optimize case-insensitive handling
1. Make BasicCollection::implGetIndexForName take OUString again,
after commit f7de7de118 made it take
std::u16string_view. All call sites pass OUStrings, and commit
ef32c3b4f9 made it create OUString
from the argument.
2. Have SbxVariable cache a case-insensitive variant of the name.
It is currently only used in the Collection implementation, but
may be used in other places; Tthe names are case-insensitive in
Basic, and VBA allows non-ASCII characters in names, so this
caching might be useful elsewhere.
3. Skip non-ASCII characters when calculating name hash, to allow
non-ASCII-containing strings still have some hash variance, when
at least some of the first 6 characters are ASCII.

Change-Id: If90ccea2c4b44c34967e6b764b6fab45b2976c40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132493
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-04 11:06:00 +02:00
Noel Grandin 3e1e0af376 loplugin:stringviewparam convert methods using match
which converts to a combination of substr and o3tl::starts_with

Change-Id: I5b01a181b9e6bee3483e4f49f1a9426abcc682d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132458
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-03 10:01:48 +02:00
Noel Grandin c898611bd5 loplugin:stringviewparam convert methods using compareTo
which converts to compare

Change-Id: If03c790ea113a7caedbe89f926b29055c9ec1e76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132455
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02 16:55:36 +02:00
Noel Grandin 1927b51993 loplugin:stringviewparam convert methods using indexOf
.. and lastIndexOf, which convert to find and rfind

Change-Id: I6c4156cf904774c0d867f85a4c2785dba7593f62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132445
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02 13:31:19 +02:00
Xisco Fauli 1403a335b4 uitest: add wrapper for VclExpander
Change-Id: I725c51fdddea9da9aa79d166d747261e80ca9376
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132416
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-01 14:12:05 +02:00
Stephan Bergmann ca832495ac A string_view is not necessarily NUL-terminated
Regression introduced into LIBO_INTERNAL_ONLY code with
1da6908173 "add string_view variants of methods to
O[U]StringBuffer".

And add some tests.  Assigning an OStringChar to an OStringBuffer also uses the
std::string_view assignment operator, so also test that with testOStringChar,
even though there it is relatively likely that the OStringChar temporary is
followed by null bytes, which could make the test happen to erroneously succeed.
But at least tools like ASan or Valgrind could catch that.  On the other hand,
assigning an OUStringChar to an OUStringBuffer does not use the
std::u16string_view assignment operator (and rather uses a
ConstCharArrayDetector-based one, which was similarly broken and has been fixed
in b66387574e "Fix -Werror=array-bounds"), so
there's no test for that here.

Change-Id: I7cf10ee5ce0e4280a91d116cd82d4871a0f44af6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132363
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-31 18:52:48 +02:00
Stephan Bergmann b66387574e Fix -Werror=array-bounds
> In file included from svtools/source/svrtf/parrtf.cxx:28:
> In member function ‘typename rtl::libreoffice_internal::ConstCharArrayDetector<T, rtl::OUStringBuffer&>::TypeUtf16 rtl::OUStringBuffer::operator=(T&) [with T = const rtl::OUStringChar_]’,
>     inlined from ‘virtual int SvRTFParser::GetNextToken_()’ at svtools/source/svrtf/parrtf.cxx:183:94:
> include/rtl/ustrbuf.hxx:352:20: error: array subscript ‘unsigned int[0]’ is partly outside array bounds of ‘rtl::OUStringChar [1]’ {aka ‘const rtl::OUStringChar_ [1]’} [-Werror=array-bounds]
>   352 |         std::memcpy(
>       |         ~~~~~~~~~~~^
>   353 |             pData->buffer,
>       |             ~~~~~~~~~~~~~~
>   354 |             libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
>       |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   355 |             (n + 1) * sizeof (sal_Unicode)); //TODO: check for overflow
>       |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> svtools/source/svrtf/parrtf.cxx: In member function ‘virtual int SvRTFParser::GetNextToken_()’:
> svtools/source/svrtf/parrtf.cxx:183:94: note: object ‘<anonymous>’ of size 2
>   183 |                                 aToken = OUStringChar( static_cast<sal_Unicode>(nTokenValue) );
>       |                                                                                              ^

as seen with recent GCC 12 trunk in an --enable-optimized build.

And add a test, even though it is relatively likely that the OUStringChar
temporary is followed by null bytes, which would make the test happen to
erroneously succeed.  But at least tools like ASan or Valgrind could catch that.

(For the corresponding OStringChar and OStringBuffer scenario, this issue does
not arise, as OStringChar is not covered by ConstCharArrayDetector, so the
correpsonding OStringBuffer assignment operator is OK memcpy'ing n+1 elements.
There /are/ similar issues with string_view assignment operators for both
O[U]StringBuffer, which will be addressed in a later commit.)

Change-Id: Ia131d763aa5f8df45b9625f296408cc935df96ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132354
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-31 16:58:39 +02:00
Armin Le Grand (Allotropia) ca6d879f76 Advanced Diagram support: Move class DiagramData to svx AFAP
Splitted and moved parts of DiagramData class to svx as peparation
to access from there. Done as pure virtual class so that no
incarnations will be possible, also made the constructor protected.
The derived class in oox hosts all functionality/data which
involves usage/modification of oox::Shape class. That way we get
closer to get the Diagram DataModel isloated/seperated.
Not-yet moved is the String/Text holding data, it's still in oox.
Moving that one will be next, that will allow to migrate quite
some more functionalty to svx.

Change-Id: I389dbf3ebf6171b8175cf30be7bbc8c20d9a38e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132303
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-03-31 15:29:28 +02:00
Tünde Tóth aea8043bc5 tdf#74670 tdf#91286 PPTX XLSX export: save image once
Impress and Calc used to dump the same image file
as many times as it was featured in the document,
resulting redundant, sometimes huge documents.

Note: using only checksum to recognize image duplication
is a regression, because checksum collision results
image loss. This is a very unlikely event, and
the following commits have got the same problem.
The solution is comparing the images with the same
checksum byte for byte.

See also commit b484e9814c
"tdf#83227 oox: reuse RelId in DML/VML export for the same graphic"
and commit 797fef3861
"tdf#118535 DOCX export: save header image once".

Change-Id: I9f233d521941381746634cf4f9b5991da0dadda9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131928
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2022-03-30 18:24:45 +02:00
Caolán McNamara 910251c050 use the device dpi
Change-Id: I8762e84a34a116778bd0bced706d631db4761a01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132302
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-30 16:34:36 +02:00
Caolán McNamara bbd196ff82 add infobar to prompt to refresh to replace old format
Change-Id: Id99cbf2b50a4ebf289dae6fc67e22e20afcda35b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131976
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-03-30 12:25:22 +02:00
Samuel Mehrbrodt 7efd22c912 Add UNO API for custom Jump Lists
Allows adding custom jump list categories to Windows Task Bar

Change-Id: I13b6c3ad5de386cf74e2b346f10889bc46a8ad4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131540
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-03-30 12:14:28 +02:00
Caolán McNamara 78f7bd90b9 Resolves: tdf#117162 ImportDocumentHandler expects data provider to exist
already in its ctor

which changed since...

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

    tdf#83257 [API-CHANGE] Pivot chart implementation

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

Change-Id: I1863791af7ae737f337993833a9cf1429a3a8028
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132286
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-30 09:39:22 +02:00
Regina Henschel 365a3ed390 Extract 'switch' block out of WriteCustomGeometry
This is a follow up to commit 2029b2f6dd.
That commit has increased the line count of WriteCustomGeometry to more
than 500. This patch splits it to a main part of about 230 lines and
a new method for the previous 'switch' block of about 300 lines. That
makes the loops in the main part better readable.

Change-Id: Ied4378f54e7c8dc7965a5b1db15baf0b35f63f59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132274
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-30 09:30:08 +02:00
Yomnasalama 92ddacfaa0 tdf#143148- Use pragma once in connectivity
Change-Id: If15cf06a986e4bf6ac43b91567a7b2b1aa153d18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132156
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-03-30 08:03:09 +02:00
mostafa-elsharnoby c03b09e502 tdf#143148: Use pragma once instead of include guards
Change-Id: Iad31b4d3d22519059d340a02868080c829ce7b98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132158
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2022-03-30 07:59:32 +02:00
Stephan Bergmann bd94e9dfd0 Add back the opportunity to leave O[U]StringLiteral's buffer uninitialized
...once we have a C++20 baseline, which would render uses of the consteval
O[U]StringLiteral ctors ill-formed if we accidentally failed to write to all of
buffer's elements.  This had been broken (and the TODO comments had become
misleading) with 21584b304b "make
OUString(OUStringLiteral) constructor constexpr" and
bca539e889 "make OString(OStringLiteral)
constructor constexpr".

Also add corresponding test code.

Change-Id: I2bc680282c717d403a681ff4b9396580c8382de1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132275
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-29 21:15:13 +02:00
Tibor Nagy cbf66ec3e6 tdf#89449 PPTX import: fix line connectors
Line connectors were imported as plain shapes, losing
their functionality during editing, i.e. keeping
connections of boxes and other shapes.

Change-Id: I0f1562be2dbcce0e45eb209c6ca4e035731039e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131303
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2022-03-29 16:12:45 +02:00
Stephan Bergmann ac520c337b Revert "removed pointless using namespace std"
This reverts commit 5b53dd0514.

The using directive was not pointless, it was necessary to correctly call the
std::swap customization point.

Change-Id: I642587fe2a8fc281a6079837edce3a8a6c47ea33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132184
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-29 14:19:38 +02:00
offtkp 5b53dd0514 removed pointless using namespace std
Change-Id: I117aa1ea74b636ef06f7eedce8f2e12f9c4226b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132213
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2022-03-29 13:03:34 +02:00
Armin Le Grand (Allotropia) f41d048172 Advanced Diagram support: Move data classes to svx
As preparation for own im/export move data classes for
which that is now possible to svx

Made TypeConstant more safe, also sorted it. Corrected an
error there. Secured TypeConstant usage by identifying
usages (mnType -> mnXMLType). Had to convert from
oox::OptValue to std::optional since 1st is not available
in svx in datamodelcontext.cxx. That makes the test work
and the test-file load corrrectly.

Change-Id: Ifee008caf486ddb6b52a347dc08e7e053c49ef49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132195
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-03-28 18:26:56 +02:00
Stephan Bergmann 8a734ba928 Drop support for OpenGL denylist on X11
...which appears to have become even less relevant with
db89f53c31 "remove OpenGL VCL backend code".  And
the vcl/unx/glxtest.cxx machinery that it is based on is (a) known to cause
issues like <https://gitlab.freedesktop.org/mesa/mesa/-/issues/3957>
"LibreOffice's OpenGL version detection code hangs when running inside a flatpak
container with a different mesa version", and (b) is one of the two reasons why
an soffice that uses Wayland nevertheless also requires Xwayland during startup
(the other reason being oosplash).  So getting rid of the glxtest machinery is
beneficial.

The remaining two potential uses of OpenGL on X11/Wayland are the obscure
css.rendering.SpriteCanvas.OGL service implementation (about which
db89f53c31 states that "it seems has never been
finished or enabled (or so it most probably should be dumped too)") and some
slideshow transitions.  About the latter, Caolán stated on IRC:  "I think we
grew this set of stuff to check for dodgy opengl primarily for the case where
vcl used opengl for ordinary UI optimizations; but I think that use is gone now
so I wonder does it make sense to just drop all of that entirely; for just slide
transitions we apparently survived fine without the denylist for ages".  (And in
any case there is still the WatchdogThread support with OpenGLZone::hardDisable
in VCLExceptionSignal_impl, vcl/source/app/svmain.cxx, should any OpenGL code
run into problems.)

(The removal of gb_LinkTarget_use_glxtest from gb_LinkTarget_use_vclmain, which
indirectly brought in gb_LinkTarget_use_libraries,*,vcl, revealed that an
explicit use of vcl was missing from various Executables etc., which thus had to
be added now.)

Change-Id: Ifa5220fd09910a4459ca546d9655e479a2e38f1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131943
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-28 14:31:07 +02:00
Regina Henschel 2029b2f6dd tdf#147978 export subpaths individually in custGeom
...and implement export of all missing commands,
   use existing viewBox if suitable,
   use one EnhancedCustomShape2d
   move WriteCustomGeometryPoint to protected,
   make GetCustomGeometryPointValue local

The fix solves tdf#100390 too.

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

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

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

I have removed the no longer used method WritePolyPolygon.

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

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

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

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

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

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

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

Change-Id: Ib1736d6a08371f4d98411d2769275f0580cd0030
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131837
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-25 14:00:23 +01:00
Armin Le Grand (Allotropia) b658fdc335 Advanced Diagram support: Continue isolate oox-Shapes
As preparations to use the Diagram ModelData further isolate
it from the oox-library-only drawingML Shape used for import.
It is necessary to completely isolate the Diagram ModelData
from the Diagram import mechanism as a preparation to be
able to re-create that Shapes on-demand anytime if needed
for re-layout(s).

Also removed one unused loadDiagram implementation and
streamlined the AdvancedDiagramHelper some more.

Change-Id: I7a7c55389e0d00f70c02db73ce2c3ff9ce7a5b22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132058
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-03-24 16:31:42 +01:00
Noel Grandin ceb8f5d62c loplugin:constantparam
Change-Id: I86592be0717c062a918108bf4437074b0f70b372
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132029
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-24 15:06:24 +01:00
Mike Kaganski 1e2483a3ab Create OUString from ASCII literal instead of createFromAscii
Change-Id: I58d0b49a32edf4d67807c0d67e08a28705d7334e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132026
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-24 12:02:37 +01:00
Noel Grandin 6ed4be1257 loplugin:constantparam
Change-Id: Ib65abd0546f1219387fe3fd7ad4f6ba0eb029bd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131987
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-24 08:50:56 +01:00
Miklos Vajna 37c41f2c44 sd theme: add PPTX export for shape fill color
Do this only in case there are no effects on the color, as that is not
yet handled.

Note that the theme color was already stored in the grab-bag, so this is
primarily interesting in case the theme color was changed or the source
format was ODP.

Change-Id: Ia4995be68d5f243875632eec4aaf8afbb8f4d5cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131984
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-24 08:36:25 +01:00