This would have caught the issue discussed in
709b1f3ddb "Make sure VCLXPopupMenu has unique
RTTI". (The commit message talks about RTTI there, while what Clang actually
compared for an optimized implementation of a dynamic_cast to a final class is
vtable pointers, but the overall picture remains the same. Both RTTI and
vtables are emitted along the key function, and if that is missing or inline,
they are emitted for each dynamic library individually, and as internal symbols
on macOS.)
This commit also addresses all the issues found by the improved
loplugin:dyncastvisibility on Linux. See the newly added TODO in
compilerplugins/clang/dyncastvisibility.cxx and
86b86ac87e "Give DocumentEventHolder (aka
EventHolder<DocumentEvent>) a key function" for an issue with key functions for
class template instantiations.
Change-Id: Ia19155efb1d23692c92b9c97ff17f18ae7a1f3ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176576
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
which allows us to eliminate a bunch of rounding at various layers, and
consequently maintain a lot more precision
Change-Id: I911dedd7c041c1d67396c082e5695346ea689acb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175814
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
These are only sent to an external API expecting char*-like strings,
or for comparison. Having every assertXPath having three of _[ou]str
is too much syntactic noise, making the unit tests almost unreadable.
Change-Id: Ic004a36ea75e7bfe0b96f405c40f926a957b51cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174416
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
EMF has two ways to indicate that text should be treated as RTL:
- The ExtTextOut ETO_RTLREADING flag
- The SetTextAlign TA_RTLREADING flag
Previously, only the former was implemented. This change implements the
latter.
Change-Id: If1023b4a0a3b6eb2ce47d2b764edbfd1a5c0dd5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173579
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
Tested-by: Jenkins
The original issue that prevented the test on Linux is reproducible.
I didn't debug the cause, so this is just a workaround.
Change-Id: Ifa8fa2a7884adabf797ea2d711f62b6be382dfec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166351
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
And introduce GetTextWidth / GetTextHeight variants returning double.
It allows to avoid premature rounding.
At least in one case - testTdf145111_anchor_in_Fontwork - it allowed
to make the test DPI-independent (at least in my testing on Windows,
using 125, 150, and 175% UI scaling).
Change-Id: I973d2c729ec6bb7114b4f99b9027f1ead7c1d061
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166237
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
And use it when assigning to tools::Long
Change-Id: I0814d7bac9cdd48191ba69c64e3b12a4973b3417
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166071
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
The old name was misleading (it doesn't take an URL, but a filename);
also, now it's easier to grep for it - doesn't get mixed with
vcl::graphic::loadFromURL.
Change-Id: Ib88d2194200a6a54d2326971e0306ba39f0c7025
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161578
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
and try something a bit more generic
Change-Id: I1d8256576cd02f0a589df350ba7b53059dd586a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161250
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(*) Make all of it use a "Scoped" paradigm
(*) pass by value, no need to allocate on heap
(*) make all of the construction go via the *Access constructors, instead of it being some via the constructors and some via the Acquire*Access methods.
(*) take the Bitmap& by const& in the constructor, so we can avoid doing const_cast in random places.
Change-Id: Ie03a9145c0965980ee8df9a89b8714a425e18f74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160293
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
The size of W_META_EOF (record indicates the end of the WMF metafile)
could be different than 3 (e.g. 6).
The MS Office is allowing different sizes of EOF,
and just properly finalizine parsing WMF file, and display its content.
Original bug report:
https://bz.apache.org/ooo/show_bug.cgi?id=42090
Change-Id: I21b72615c7f45fdca145e6240c6451d7d264d238
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153204
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
In previous implementation, there was no proper validation
of the records, by it's size.
This commit adds validation of the WMF records.
It would allow to interrupt reading, if wrong record found
and play only records until it it correct.
It will allow to mimic the behaviour of MS Office:
If the wrong record is detected, the image is displayed till the wrong record.
Currently in LibreOffice, if wrong record is found whole read is interrupted.
Change-Id: I0c82deabcec7a416ca44540e693822f1986437eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153351
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
and use it to make WmfTest::testSetTextAlignWmf independent of DPI
Change-Id: I2048239088a8dcc3e3ab1db96413894b5bcc56d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157377
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
When doing subpixel positioning (i.e. OutputDevice is in map mode),
delay the rounding of the glyph coordinates after converting from pixel
to logical units to minimize the loss of precision as much as possible.
Some test expectations, expectedly, changes due to the improved
positioning precision.
Change-Id: I2591e3c7d4923ba7886a35bf53db759273354e24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154292
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: خالد حسني <khaled@libreoffice.org>
The EMR_POLYDRAW record specifies a set of line segments and Bezier curves.
Change-Id: I93d846d2fbb7a60b0565668a17ee092da30ef21c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151424
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
There is several benefits of such performance optimization:
1. We are drawing single curve instead of hundreds of small curves.
In the loop we are creating single Polygon and outside
of the loop we are invoking EMFPPlusDrawPolygon drawing method only
once. As https://bugs.documentfoundation.org/attachment.cgi?id=186725
image is using single EmfPlusRecordTypeDrawBeziers EMF+ record with
hundreds of curves, with using single EMFPPlusDrawPolygon call,
there is no lnger need for individual line creation (e.g. line
color, weight, line caps, line joints, line dashes, etc.)
- The PDF export performance without optimizations of the https://bugs.documentfoundation.org/attachment.cgi?id=186725:
time ./instdir/program/soffice --headless --convert-to "pdf:writer_pdf_Export" --outdir ~ ~/Pobrane/problem.docx
real 24m18,471s
user 2m56,004s
sys 1m37,816
- The PDF export performance with optimizations:
real 0m37,527s
user 0m37,004s
sys 0m0,531s
- With Libreoffice 7.5.2 from Ubuntu 22.04, the conversion was
crashed.
2. The PDF export for document: https://bugs.documentfoundation.org/attachment.cgi?id=186725
was not working correctly for me. The original image is containing
chart. Without optimization, the exported chart was empty.
Current export is working correctly, and graph is visible.
3. The standard opening of the document from https://bugs.documentfoundation.org/attachment.cgi?id=186725
is now much faster. The zooming in, move image operations are also
noticible faster.
Change-Id: Ic77d4c20a462587bb5da4a4df757e30c5ca04fc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150821
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
This suite is large enough so that avoiding the
declaration/registration/definition of each test manually saves a lot of
space.
Change-Id: I476b58a1c45ed5c977ce71a92d172b7e2df93015
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150224
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
It is so much easier to work with if a test failure's line number unambiguously
points at the code's sole execution. (That is, test code is necessarily non-
DRY.)
Change-Id: I75919c55671348f6190e9e108e72e24ec18ce986
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148514
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
It had originally been disabled by a037f6338c
"Disable CppunitTest_vcl_wmf_test under --enable-merglibs for now" because "the
problems caused by that test having the vcl objects linked into both the test's
library and the mergedlib (which the test's library links against) are just not
manageable", which is no longer an issue at least since
29cdfa3fc3 "no need to statically link against the
emfio library in the tests".
But the test code apparently uses WinMtfFontStyle, which can thus no longer be
hidden under --enable-mergelibs.
Change-Id: Ie807b19f0cb44408c69d03faca01fabe88239ca0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148493
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
on modern hardware, these are less efficient than regular alpha
channels.
Also, this greatly simplies the range of stuff that vcl needs to deal
with, which will make the upcoming transparency->alpha patch easier to
deal with.
Enhance vcl::CreateFromData to convert incoming 1-bit data to 8-bit
image.
Change-Id: I35829da750029fe373d0d2911a669d10bab6ad23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145321
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This reverts commit 1230b88055.
Reason for revert:
The reverted commit breaks the files documented in tdf#152435 (some
text is not shown in those .EMF files). The reverted commit would solve
an issue where some text was not clipped correctly, albeit in a naive
way. As it is more important that text is shown rather than some text
having correct clipping, that patch is reverted and I will look for one
that fixes both cases.
Change-Id: I42e85b802b8bf1e77e96f0016cd1d83201047032
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143970
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>