Commit Graph
60 Commits
Author SHA1 Message Date
Bartosz Kosiorek 91082e711d Enable automatic code style formatting for EmfImportTest.cxx
As EmfImportTest.cxx code style is follow the recommended
code style (except too long lines), the code
is used only for testing and it is rarely modified,
I decided to enable automatic code formatting.

It is one step closed to migrate to common code style.

Change-Id: I1b7f980b9e68e121ba981b8a8222daa31424ac53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118864
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-07-13 22:49:04 +02:00
Bartosz Kosiorek c6447960ce Decrease line length of EmfImportTest.cxx by introducing const string
Change-Id: Ie30d0246d6ca54821f00fe516ab67f803ef0d804
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118863
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-07-13 21:41:55 +02:00
Miklos Vajna 4f33e72390 CppunitTest_emfio_emf: add some tolerance in TestDrawStringAlign
Commit 574dc1e8ff (EMF+ tdf#142995
tdf#142997 tdf#143076 Add alignment support for DrawString, 2021-06-24)
added this test, it seems the result depends on what fonts are
installed, so add some tolerance.

Probably it fails for me (and not on Jenkins) as I have lots of
additional fonts installed, e.g. Arial (and not only Liberation Sans).

Change-Id: Ie93d1f1efe1fbbf1851ad46f33f5f83c8812e6d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118470
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2021-07-06 12:22:12 +02:00
Bartosz Kosiorek 4992780d2b EMF+ tdf#142941 Fixes for SrcRect in DrawImagePoints
The SrcRect could be specified outside of source bitmap.
In such cases the Destination bitmap should be displayed as shifted
(eg. if position is negative), and scaled properly.
Change-Id: Ied6d339703999faaae061802ef6a28e190d5a176

Change-Id: Ia9772ced282684c2c94a261d97d30b53921d6171
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118345
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-07-03 14:59:06 +02:00
Bartosz Kosiorek 574dc1e8ff EMF+ tdf#142995 tdf#142997 tdf#143076 Add alignment support for DrawString
With this commit, real size of the text is used to make
proper horizontal alignment. Additionally vertical alignment
is added and fix for Center alignment was applied

Change-Id: I17d9fd7de7f00f5e69f99c5b09061eb6059be67e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117794
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-07-01 23:50:31 +02:00
Bartosz Kosiorek 9e8c35cc3f EMF+ tdf#142975 Add brush support to DrawString record
Change-Id: Icfcb4199dcd755fb20e14a8166571b6d6e763f2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117671
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-23 18:24:38 +02:00
Bartosz Kosiorek cabb9f5c8e WMF/EMF tdf#59814 tdf#142567 Fix RestoreDC record
With previous implementation, the RestoreDC index argument was skipped,
and always the last entry was taken.

With this commit the support for reading SaveDC by specific index
was added. The SaveDC/RestoreDC index support was added for
both EMF and WMF, according to [MS-WMF] and [MS-EMF] documentation.

Change-Id: I9b8a1a41462ae01de25ac3c85e453bcd80e05537
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117033
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-11 12:31:59 +02:00
Bartosz Kosiorek 01ded1e6d3 WMF tdf#55058 tdf#142722 Add implementation of BitBlt and StretchBlt
With previous implementation, only BitBlt record with 1 bit color depth
was supported and StretchBlt was not implemented at all.

With this commit the support for 1 bit, 24 bit and 32 bit,
for both BitBlt and StretchBlt were added.

Change-Id: I061b2beae8c2f143ddff9c8c8bb64bf52f4cf502
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116873
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-09 20:19:27 +02:00
Bartosz Kosiorek b6a30a9db0 WMF tdf#142625 Refactor Bitmap records, to better handle missing features
Change-Id: If3334158e6e0ef9bc3aa33656ad0ee45cf460dbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116827
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-08 22:40:01 +02:00
Bartosz Kosiorek 33d2cf7008 WMF Change the sign of read fields in BITBLT and DIB records
Additionally the names of variables were improved,
and additional checks were added for unsupported cases
Change-Id: Id84ef1218c5c2a40c8d01f2d40857d892badbb9f

Change-Id: I1b8571d0a627827bc1e67c2bfc6c1932d58c5233
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116744
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-05 20:20:24 +02:00
Bartosz Kosiorek f275c4b31f tdf#53004 tdf#142495 WMF EMF Always display Text rectangle
In previous implementation if BKMode was set to Transparent,
then both Background of Text and Rectangle was not drawn.

It was wrong, and Rectangle should be always drawn.

This commit fix that issue and allows EMF images
exported by LTspice to be rendered correctly under LibreOffice.

Change-Id: I03801d35d92eb2a3fdc175ca1d5b348a2aa30842
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116394
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-31 07:32:44 +02:00
Bartosz Kosiorek 3a9027609e tdf#53004 tdf#142495 WMF EMF Fix displaying Text with OPAQUE and CLIPPED
With OPAQUE option enabled, the rectangle need to be drawn,
before drawing text.

With CLIPPED option enabled, the text needs to be drawn
only inside rectangle.

In previous implementation, the rectangle read was skipped and
it was not drawn (for OPAQUE).

For CLIPPED the rectangle was read but Clip was not applied
to text drawing

This commit fix that issues, and allow to draw rectangle correctly,
with BGColor (background color), and add support for Text Clipping
according to [MS-WMF] and [MS-EMF] specification.
The fix applied to EMR_EXTTEXTOUTW, EMR_EXTTEXTOUTA and EXTTEXTOUT records

Change-Id: I0f6248bb9465e6d5f797cddb53f058afb0815a2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116072
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-28 21:47:40 +02:00
Bartosz Kosiorek 9864fbc9d5 tdf#117957 WMF Replace ellipses with rects to fix tests on arm64
The issue is caused by floating numbers,
On x86_64 it is:

  338.499728160392-445.269903703769

on arm it is:

  338.499728160392-445.26990370377

As in test files, we have two ellipses (which are made from small lines),
which points rounds differently on different architectures

Change-Id: I44dd5c7b3b13f3b1680d5a3a8348d6f467cb2f7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116270
Tested-by: Jenkins
Tested-by: René Engelhard <rene@debian.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-05-28 09:33:21 +02:00
Bartosz Kosiorek 9cc47eda70 tdf#117957 WMF Fix failing tests on arm64
So the issue is caused by floating numbers,
On x86_64 it is:

  338.499728160392-445.269903703769

on arm it is:

  338.499728160392-445.26990370377

As in test files, we have two ellipses (which are made from small lines),
which points rounds differently on different architectures

Change-Id: I10efe80fea0944cf957e949c8c209c94fd588702
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116234
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-27 13:09:33 +02:00
Bartosz Kosiorek b7c9ce6c86 tdf#127145 WMF Fix displaying line width in ROUNDRECT record
The EDGE optimization shouldn't be used for curves,
otherwise strange issues appearing.

Change-Id: Id677fc9002f0f79913ae756f0e456af7c9f7e507
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115984
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-22 10:02:56 +02:00
Bartosz Kosiorek fb5247bf58 tdf#55007 tdf#142263 tdf#142268 EMF ARC, PIE, CHORD allow to draw circle
In Metafile specification, if Start Point is the same as End Point,
then the full circle should be drawn.

Unfortunately with previous implementation, if Start Point is the same
as End Point, nothing is drawn.

This patch fixes that and removed EDGES optimizations, which causes
display issues.

Change-Id: I16a1b98f10378d57bed59696db6cc9f228044292
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115891
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-21 07:30:28 +02:00
Bartosz Kosiorek 39369c6e67 tdf#55007 tdf#142263 tdf#142268 EMF Properly display ARC and CHORD
With previous implementation the ARC, ARCTO and CHORD were
not displayed if the corners of rectangle was switched.

With this patch the shapes are always displayed correctly.

Change-Id: Ie8ac7af812298c0b96c3b5af417117784f128ce1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115757
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-18 20:42:27 +02:00
Bartosz Kosiorek e923f752a3 tdf#117957 WMF Add support for selecting colors from palette
Change-Id: I8f995dab566d9fae79d87fe13741b8ea9658b408
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112998
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-15 16:53:08 +02:00
Bartosz Kosiorek 699295ca7c tdf#142014 Fix displaying strokes when line width is 0
Change-Id: I80e05ff2f24f5da2f5c124c0ee1b302a1c8226ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115570
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-13 22:00:05 +02:00
Bartosz Kosiorek b5ece3fbc7 tdf#112603 tdf#142014 tdf#142139 WMF/EMF Fix line width
Previosly line width was always 1, and changing width do not affect
line.

Change-Id: I462096b915e053fa089e85860f124466b650558a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115497
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-12 20:32:27 +02:00
Bartosz Kosiorek f11ed681df tdf#141982 tdf#142139 Add rotation and line width support to ROUNDRECT
With this commit the ROUNDRECT is able to change line width and
transformation (including rotation) is supported.

Change-Id: Ic303a74adf0fd0dd452353f250a13140603d492e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115429
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-11 18:38:08 +02:00
Bartosz Kosiorek 1ef26ffe39 tdf#55058 tdf#141982 EMF: Add rotation support for INTERSECTCLIPRECT record
With this commit the rotation support was added
for INTERSECTCLIPRECT.

Before that change rotation was not applied to these CLIP rectangles.

Change-Id: I3da66790e0aeeaaeeb28d2fc30780cba8dbda390
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115102
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-07 21:02:22 +02:00
Bartosz Kosiorek 6bf2239a18 tdf#55058 tdf#141982 EMF: Add rotation support for ARC, ARCTO, CHORD, PIE
Change-Id: I5d9b76f0ddd2b7f12604f472986dd95976a8b04d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115185
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-06 20:59:19 +02:00
Bartosz Kosiorek 761fdaf26d tdf#142004 tdf#141982 EMF Import: Add rotation and path support for EMR_ELLIPSE
Previous implementation of EMR_ELLIPSE, doesn't support rotation
and EMR_ELLIPSE was not work with EMR_BEGINPATH, EMR_ENDPATH and EMR_ABORTPATH

The EMR_BEGINPATH opens path bracket construction.

Once path bracket construction is open, an application can begin specifying records to
define the points that lie in the path. Path bracket construction MUST be closed by an
EMR_ABORTPATH or EMR_ENDPATH record.

With this patch all these issue was resolved for EMR_ELLIPSE

Change-Id: I6d352e0ff0326dd788d43272bf1330fa6c777df4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115101
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-06 12:12:40 +02:00
Bartosz Kosiorek 24e71494d7 tdf#55058 tdf#141982 EMF: Add rotation and path support for RECTANGLE record
Previous implementation of EMR_RECTANGLE, doesn't support rotation
and EMR_RECTANGLE was not work with EMR_BEGINPATH, EMR_ENDPATH and EMR_ABORTPATH

The EMR_BEGINPATH opens path bracket construction.

Once path bracket construction is open, an application can begin specifying records to
define the points that lie in the path. Path bracket construction MUST be closed by an
EMR_ABORTPATH or EMR_ENDPATH record.

With this patch all these issue was resolved for EMR_RECTANGLE
Change-Id: Ic51442df8905e47c92eed811cc776762c9752af2

Change-Id: I111f183e509f03c0b276a038680f61156b37b235
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115065
Tested-by: Jenkins
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-05-05 10:24:01 +02:00
Miklos Vajna 700fe95fac CppunitTest_emfio_emf: avoid --disable-pdfium failure
'make check' now passes for me without pdfium, all relevant tests are
annotated to skip asserts when there is no pdfium anyway.

Change-Id: Ie22a2b3b42d16e72f9d34ada85dee264d79d5155
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114523
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-04-23 09:13:11 +02:00
Bartosz Kosiorek aa17ea3d36 tdf#37281 tdf#45820 tdf#48916 tdf#55058 EMF Implement complex clipping
As the visual glitches were resolved with:
https://gerrit.libreoffice.org/c/core/+/113423

It is time for enabling complex clipping.

Change-Id: I12edc88fc9a55c8deedf3d87faeb50cfe0067a01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113520
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-04-03 15:30:46 +02:00
Bartosz Kosiorek 5d4d8278b7 tdf#55058 tdf#141394 EMF FILLRGN record is not displayed correctly
The EMR_FILLRGN record fills the specified region by using the specified brush.

After deep analyse of [EMF] documentation, it seems that
bounds from RegionDataHeader was treated as first rectangle of
region. As a result whole bounds was treated as the Region.

Change-Id: Ie34877b71292c05a1f17381a6de51aaed2386565
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113423
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-03-31 20:08:37 +02:00
Bartosz Kosiorek 54a8aefa33 tdf#35986 tdf#140271 EMF Fix line width of CREATEPEN record
According to [MS-EMF] documentation:
"If the pen type in the PenStyle field is
PS_COSMETIC, this value MUST be 0x00000001."

Unfortunately based on observation of EMF import,
it seems that it is not true. As a result the implementation
must be partially reversed.

Change-Id: I0c2ec5e26b710e1a12d5196b6c8be4709f26dc4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112651
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-03-19 09:00:11 +01:00
Luboš Luňák f52c5bea77 fix test for tdf#137413
The test tested for the topleft corner to be transparent and not black,
but the bitmap has a black outline, so the corner actually should be
black, unlike the rest of the bitmap. I have no idea how the test
could have possibly passed (and those #if tests indicate that it
correctly failed with most drawing backends). What apparently enabled
this to pass was commit 828504974d, which made the drawing
use DrawTransformedBitmap() implementation in the VCL backends,
and the Cairo one apparently mishandles it. Reverting 828504974d
made the test fail.
This commit fixes (and simplifies) the test.

Change-Id: I1560849d683558abbe0cde816c4505b9824a0692
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110769
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-02-12 11:01:52 +01:00
Stephan Bergmann 042033f1e6 loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-29 16:42:33 +01:00
Chris Sherlock 17aea7c41c vcl: move access functions into appropriate bitmap access files
Split class functions into BitmapInfoAccess.cxx, BitmapReadAccess.cxx
and BitmapWriteAccess.cxx

Split header files into BitmapInfoAccess.hxx and BitmapReadAccess.hxx

Change-Id: I7dcbe1d26c5b64d297658a6b809c93d7ad7f053d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108039
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-12-24 09:40:16 +01:00
Bartosz Kosiorek e179e53e3c EMF: tdf#138467 Fix MapMode translation
Add proper translation for map mapping modes:
MM_LOMETRIC = 0x02, MM_HIMETRIC = 0x03, MM_LOENGLISH = 0x04, MM_HIENGLISH = 0x05, MM_TWIPS = 0x06

according to MS-EMF documentation.

Change-Id: If4c71b52e5236441837e62590797ced8acd6c80f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106251
Tested-by: Jenkins
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2020-12-03 10:36:42 +01:00
Bartosz Kosiorek eb2fdd9bc6 tdf#35986 EMF import: Add support for PS_COSMETIC line style in CREATEPEN
When the PS_COSMETIC line style is set in CREATEPEN,
line width should be set to one logical unit and a style that is a solid color

This patch is fixing that, allowing to properly import EMF file.
The corresponding unit tests were added

Change-Id: I1a0caf6382d9c313d9725d0b94e2fcd37122a099
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105790
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-11-14 18:12:42 +01:00
Bartosz Kosiorek b0b78838e7 tdf#35986 tdf#92315 tdf#116335 tdf#116622 Add support for MapMode TEXT
To properly import some EMF files, the proper implementation of MapMode Text
needs to be done according to MS documentation.
I have also added regression tests.

Change-Id: Id788294a498b93bebb62118d13ea545f80a60f01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105771
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-11-14 18:10:09 +01:00
Gabor Kelemen a5389cb5dd tdf#42949 Fix new IWYU warnings in directories [e-f]*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I963aa5fb892a0be36212fd0587b69f217f017947
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105469
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-11-12 10:53:07 +01:00
Miklos Vajna 4a35c118a3 tdf#137413 EMF import: fix transparency in the PDF fallback case
Commit d75c5b3891 (tdf#136836 emfio: speed
up import of EMF import when the orig PDF is available, 2020-09-17)
improved both performance and correctness of the EMF import, in case it
had a PDF fallback.

It turns out that PDF fallback can be nominally non-transparent, and
still the EMF equivalent supports transparency.

Fix the problem by enabling transparency in the PDF-in-EMF case.

Change-Id: I4d1585a5db6f28bd9c9cb380b5f193f4d5edcc8d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104849
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2020-10-27 11:20:46 +01:00
Miklos Vajna 01024ee24c [API CHANGE] tdf#136836 emfio: set size hint on inner PDF if used as shape fill
The bugdoc has a shape, its bitmap fill is an EMF, which is actually a
PDF. The PDF is has a height of 5cm, but the shape has a height of 14
cm.

Inform vcl::RenderPDFBitmaps() about the size of the shape, so the
result won't be blurry. This approach makes sure that we don't
unconditionally render at higher resolution, i.e. the "load a PDF of 100
pages into Online" use-case won't use more memory than before.

API CHANGE, because the EMF reader is only available via UNO, though
it's likely that no actual external code would ever invoke it directly.

Change-Id: If1d8def0136d408a31a0cc54777a7f26430a0ff3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102996
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2020-09-18 21:24:38 +02:00
Tomaž Vajngerl 4b0daa9ce7 move Primitive2dXmlDump from drawinglayer::tools to drawinglayer NS
drawinglayer::tools causes conflicts with ::tools namespace, so
better to move Primitive2dXmlDump out from this namespace as for
inspecting purposes it ccan be injected into existing code which
could break make it conflict and break compilation.

Change-Id: I5f9e594b2b8b1dd24067fa5f5ca3cfc4eefb85cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98627
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-07-13 19:31:18 +02:00
Noel Grandin ec6eaa58ad fix memory leak of xmlDoc objects
in unit tests

Change-Id: Id16731bbbe2f1b0e3642722d77aba04fc98db4cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93508
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-07 09:52:27 +02:00
Bartosz Kosiorek e11796866f tdf#124424 EMF+ Extend test options of SvgLinearGradientPrimitive2D
The extended options were used in LinearGradient tests

Change-Id: I44336edda2d82f936b6e931668bdac46ee7899e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90541
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2020-03-16 16:52:24 +01:00
Bartosz Kosiorek 1f540cc761 tdf#124424 EMF+ Add tests for LinearGradient
Change-Id: I85dadb067c4e77b47504dee8bb11b4c15b6ead8d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90536
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2020-03-15 19:20:33 +01:00
Muhammet Kara f99e765cb3 clang-format c*,d*,e* with under 5-percent lines of change
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: I06087a1385ca9da6a28d36ea4c0d2e40bdbf8f03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88774
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-02-16 14:10:11 +01:00
Gabor Kelemen 8f4087138c tdf#42949 Fix IWYU warnings in emfio/
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I644bbebe798329e68665b8c751eccbb829178e91
Reviewed-on: https://gerrit.libreoffice.org/85182
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-20 10:25:19 +01:00
Jan-Marek Glogowski 3f7e8ddea8 Enable many more unit tests on all archs
This depends on commit "Make font-based unit test depend on instdir
fonts, not that it's sure that this really fixes the problem, as its
origin is really unknown.

It especially enables all the font-based tests I could find on all
archs. Same for many more test where I couldn't see any reason they
don't work generally. To get rid of even more ifdefs, it moves these
from the class to the functions, so there is actually just one needed
for any test. As a result some few tests run but do nothing.

There is still some problem with embedded fonts on MacOS and with
delayed graphics loading on Windows, so these ifdefs are kept.

Change-Id: I63f8424e9debda6cbf3e5777c93245e09f8eb0f2
Reviewed-on: https://gerrit.libreoffice.org/74719
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-07-05 20:05:59 +02:00
Tomaž Vajngerl 24f7dd6251 move and extend primitive2dxmldump to drawinglayer
Also needs extending the XmlWriter to output double numbers as
the attribute content.

Change-Id: Ie749ea990d856c8c90092ed8153c24efda99c444
Reviewed-on: https://gerrit.libreoffice.org/67573
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-02-09 11:58:06 +01:00
Miklos Vajna 66b919c867 svm xml dumper: move this from test to vcl
This is very useful functionality, this way it can be invoked from the
debugger and/or nested into an outer xml dump (sw/sd doc model dump)
more easily.

Change-Id: If6c83b11d0f3e65fcce71e8d820c6bc354f64d68
Reviewed-on: https://gerrit.libreoffice.org/65834
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2019-01-03 15:08:06 +01:00
Bartosz Kosiorek 1873ba08d8 tdf#113624 EMF+ Fix shift of DrawString without StringFormat
While we are drawing DrawString record, in most cases optional
StringFormat information is available.
If StringFromat information is available then we should use default
values.
For LeadingMargin for String the default value is 1/6 inch.

Change-Id: I4a0a68df5ebe74e810f8b5864232b477b3aac255
Reviewed-on: https://gerrit.libreoffice.org/62927
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-11-08 20:59:41 +01:00
Bartosz Kosiorek cd7054b5e4 tdf#55058 tdf#106084 tdf#114738 EMF+ Add rotation support for String drawing
Added rotation support for DrawString and DrawDriverString

The EmfPlusDrawString record specifies text output with string formatting.
The EmfPlusDrawDriverString record specifies text output
with character positions.

Now both EMF+ records properly support rotation.

Change-Id: I15a7a6dd2b8a209cf2aac2af75d7dd89cedd1aeb
Reviewed-on: https://gerrit.libreoffice.org/62783
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-11-05 19:28:22 +01:00
Jan-Marek Glogowski 18c628ae6e Fix emfio_wmf_test VCL dependency
This unit test sometimes fails on Windows with the message:
"no suitable windowing system found, exiting."

Currently the test just depends on desktop_detector and manually
sets up VCL duplicating a lot of code and even library symbols.
The original Gerrit change describes a lot of failures in its
comments (change 28322, version 16). Now that Windows and MacOS
were converted to VCL plugins, depending on desktop_detector is
not sufficient anymore.

This reverts a lot of VCL test setup from commit 20f6a6b159
("tdf#99402: fix Metafile Font handling"). Seems now a simple
gb_CppunitTest_use_vcl is enough.

Change-Id: Ia941ded91358231021741ff4a5d96e2014ac6c80
Reviewed-on: https://gerrit.libreoffice.org/61497
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-10-08 16:56:47 +02:00