Writer shapes are implemented using SwXShape, Impress shapes use
SdrGrafObj. So switch to working with the XShape interface, which is
supported by both.
Also, don't work with the transformed graphic if it has the same
checksum as the original graphic: the transformed graphic is not linked
to the original JPG/PNG data.
Now selecting an image in Writer Online has the same speedup that
Impress Online already had.
Change-Id: Iab2791c5f5c7a2754e3de0ebb2d6ea664f6c77e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89540
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
This has a number of benefits:
1) For a sample JPG photo, the SVG output is now 4,9MB, not 20MB.
2) Even the first export to SVG is fast, see commit
570be56b37 (svx: cache PNG export of
graphic shapes, 2020-02-25) for exact numbers.
3) Allow using less memory as the SdrGrafObj doesn't have to store a PNG
result till the document is closed.
We still require matching checksums, so in case anything problematic
happens with the bitmap (grayscale filter applied, etc), then the
optimization is meant to not help, but still produces correct output.
Change-Id: Id3bc359a8dcc4c4d12d3b66ffb512cfa71939a26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89419
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
One scenario where this is useful is: manipulate a JPEG photo in
Online's Impress, e.g. resize it multiple times. Each time we generate
an SVG preview of the shape, which includes the PNG export of the bitmap
itself.
This helps with a desktop CPU:
debug:9976:9974: SVGFilter::filter finished in 3422 ms
debug:9976:9974: SVGFilter::filter finished in 176 ms
But it is meant to help on mobile, too, where writing such a bitmap as
PNG takes 16-17 seconds without this.
(This works because SVG writes the original bitmap, even if it's scaled.
If that invariant will be broken in the future, we still emit correct
output, but then the cache will be less useful.)
Change-Id: I7204b04efeeb42c6eec67f04dfdb8a4ed50443a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89377
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
...now that macOS builds are guaranteed to have std::optional since
358146bbbd "Bump macOS build baseline to
Xcode 11.3 and macOS 10.14.4".
The change is done mostly mechanically with
> for i in $(git grep -Fl optional); do
> sed -i -e 's:<o3tl/optional\.hxx>\|\"o3tl/optional\.hxx\":<optional>:' \
> -e 's/\<o3tl::optional\>/std::optional/g' \
> -e 's/\<o3tl::make_optional\>/std::make_optional/g' "$i"
> done
> for i in $(git grep -Flw o3tl::nullopt); do
> sed -i -e 's/\<o3tl::nullopt\>/std::nullopt/g' "$i"
> done
(though that causes some of the resulting
#include <optional>
to appear at different places relative to other includes than if they had been
added manually), plus a few manual modifications:
* adapt bin/find-unneeded-includes
* adapt desktop/IwyuFilter_desktop.yaml
* remove include/o3tl/optional.hxx
* quote resulting "<"/">" as "<"/">" in officecfg/registry/cppheader.xsl
* and then solenv/clang-format/reformat-formatted-files
Change-Id: I68833d9f7945e57aa2bc703349cbc5a56b342273
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89165
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
See instructions in solenv/gbuild/Trace.mk . This generates a file than
can be viewed e.g. in the Chromium tracing view.
Change-Id: I5f90647c58ca729375525b6daed2d4918adc8188
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88754
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Files which could become clang-format conformant with
under 5-percent lines of change relative to the total
count of lines in the file are found by using bin/find-clang-format.py,
and fixed with /opt/lo/bin/clang-format -i <path-of-the-file>
There will be follow-up patches to fix all 'under-5-percent' files.
Change-Id: I702c09bcd3a9a113b3d66c30edb6cf3b7e6a6593
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88776
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
I checked return values.
Long variables didn't affect the calculation.
Change-Id: Ia3713eedf275de71b1096d1fe7e22da012a7f94e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87493
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
"Find explicit casts from signed to unsigned integer in comparison against
unsigned integer, where the cast is presumably used to avoid warnings about
signed vs. unsigned comparisons, and could thus be replaced with
o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx)
o3tl::make_unsigned requires its argument to be non-negative, and there is a
chance that some original code like
static_cast<sal_uInt32>(n) >= c
used the explicit cast to actually force a (potentially negative) value of
sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the
cast to avoid a false "signed vs. unsigned comparison" warning in a case where
n is known to be non-negative. It appears that restricting this plugin to non-
equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=)
is a useful heuristic to avoid such false positives. The only remainging false
positive I found was 0288c8ffec "Rephrase cast
from sal_Int32 to sal_uInt32".
But which of course does not mean that there were no further false positivies
that I missed. So this commit may accidentally introduce some false hits of the
assert in o3tl::make_unsigned. At least, it passed a full (Linux ASan+UBSan
--enable-dbgutil) `make check && make screenshot`.
It is by design that o3tl::make_unsigned only accepts signed integer parameter
types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses
which would in general be suspicious. But the STATIC_ARRAY_SELECT macro in
include/oox/helper/helper.hxx is used with both signed and unsigned types, so
needs a little oox::detail::make_unsigned helper function for now. (The
ultimate fix being to get rid of the macro in the first place.)
Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
found by my new aggressive unused var plugin. these are unused return
values from function calls
Change-Id: I3359c583f535828f192cb833762dfedc008d82f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87439
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Change-Id: I37a8b72895e75bf1f0e7e1b1574353b3317ca031
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87500
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
found by a more aggressive variant of loplugin:unusedvariables.
This is my first pass, committing the simplest and most obviously
unnecessary vars
Change-Id: I9676a6e39a101937097788548764506c93811c57
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87414
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
mostly to make the job of my very aggressive unused local vars plugin
easier
Change-Id: Ifc21a920841f8589f8b7e10de39dba6622a5d501
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87399
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This reverts commit 0a64b33617. Let's
revert this till it's clear how to fix UITest_writer_tests2 to not hang
with these changes.
Change-Id: I9b40b101ecdad0ccac9a0b52b6a2ef19bd47a38c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87333
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
property to 5.
In mobile view, touch spin button should increment by 5
Change-Id: Ib3c8966443d053ab0588fa0c124f0daae31b7ed8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86844
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86854
Tested-by: Henry Castro <hcastro@collabora.com>
The data was given to the PDF filter, but then we stopped iterating
right after finding our output stream. Seems this was always like this,
ever since commit 4111b430a0 (#101570#:
added pdf filter, 2002-08-13).
Change-Id: If26661935c22a7b7959fda5f92b4d50b15f13a35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87152
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
changed sal_uLong to one of {size_t, sal_uInt64, sal_uInt32, sal_uInt16, sal_uInt8} in flash/impswfdialog.cxx and graphicsfilter
changed PS_* in file filter/source/eps/eps.cxx to enum and overloaded bitwise or (|)
made types of nSize, nParseThis, nComp and nBytesRead to sal_uInt32 as Michael Stahl suggested
changes suggested by Michael Stahl
changed x, y, j to sal_uInt32 in filter/source/graphicfilter/etiff/etiff.cxx
changed nMinPercent, nMaxPercent, nLastPercent, nMainEntitiesCount to sal_uInt16 in filter/source/graphicfilter/idxf/dxf2mtf.hxx
removed nGcount variable from filter/source/graphicfilter/idxf/dxfgrprd.hxx and filter/source/graphicfilter/idxf/dxfgrprd.cxx
removed static_cast in filter/source/graphicfilter/idxf/dxf2mtf.cxx
changed nComp in filter/source/graphicfilter/ieps/ieps.cxx to size_t
changed mnCol to sal_uInt16 in filter/source/graphicfilter/ipbm/ipbm.cxx
revised a number of datatypes as suggested by michael stahl in his reviews
removed redundant static casts which caused test to fail
Change-Id: Id892ee7e9c1ef3cf75c9d768b790ced9c2ce3f3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84726
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
so we return a const& for the normal case, just like other methods,
which reduces copying.
This revealed that CreateDisplayBitmap in Bitmap can be const.
Change-Id: I9f9b9ff0c52d7e95eaae62af152218be8847dd63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86836
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
in PDF option dialog
Change-Id: Ib772599a68366be29f208e27f830b79015dbdc13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86593
Tested-by: Jenkins
Reviewed-by: Roman Kuznetsov <antilibreoffice@gmail.com>
found using 'git grep', I tried using clang-tidy, but it only
successfully found a tiny fraction of these
Change-Id: I61c7d85105ff7a911722750e759d6641d578da33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
...without having to spell out a specific type to cast to (and also making it
more obvious what the intend of such a cast is)
Change-Id: Id9c68b856a4ee52e5a40d15dc9d83e95d1c231cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86502
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This triggers the accessibility check, when we want to export
the PDF with PDF/UA functionallity. If issues are found, it will
show the issues. OK will continue with export despite the issues
and cancel will cancel the whole PDF export.
Change-Id: I2fde97381e08e9c2c79473888caa36e8dd828979
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86387
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>