Commit Graph

711 Commits

Author SHA1 Message Date
Noel Grandin
95b04f52b5 loplugin:useuniqueptr in cppcanvas
Change-Id: I8e995128a7a1c5911efc82a762dbe7be015b2050
Reviewed-on: https://gerrit.libreoffice.org/41493
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-24 08:43:48 +02:00
Ivan Safonov
c88d4ddfcd tdf#96099 Remove ActionSharedPtr typedef
Replace ActionSharedPtr by its definition.

Change-Id: Iedd14c85169230d961f0707671885451875529d7
Reviewed-on: https://gerrit.libreoffice.org/40340
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-08-12 20:51:57 +02:00
Noel Grandin
612b489d3e loplugin:checkunusedparams
the "check for taking address of function" part was generating false+

Change-Id: Iad6203850901229b7b1b2f8938c68ec703cd343f
Reviewed-on: https://gerrit.libreoffice.org/40613
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-01 11:06:26 +02:00
Noel Grandin
b09deb0753 loplugin:constparams handle constructors
had to change the structure of the plugin considerably, was too messy to
structure it to do the calculations on a per-function basis

Change-Id: I4edee7735f726101105c607368124a08dba21086
Reviewed-on: https://gerrit.libreoffice.org/40516
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-28 14:51:56 +02:00
Noel Grandin
b32ead5dd2 loplugin:checkunusedparams more part1
seems I got one of the checks wrong, and was missing a bunch of stuff

Change-Id: I2c662fc4e735f8d6cbe56c6f82906a60a580331b
Reviewed-on: https://gerrit.libreoffice.org/40481
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-28 07:17:51 +02:00
Noel Grandin
f74da1315a use more comphelper::InitAnyPropertySequence
Found with:
  git grep -n -A10 'Sequence.*Any' -- *.cxx | grep -B5 -w PropertyValueProvider
and:
  git grep -n 'Sequence.*Any.*( *&'

Change-Id: Icb18c98bdd3f8352817e443ff78de5df042859ad
Reviewed-on: https://gerrit.libreoffice.org/40389
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-25 12:03:17 +02:00
Noel Grandin
939f9bd0b5 loplugin:unusedfields in cppcanvas..cui
Change-Id: I1cf1f7919e03d863c6f7756e1caf3b9313777479
Reviewed-on: https://gerrit.libreoffice.org/40294
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-22 14:04:39 +02:00
Noel Grandin
c0565f7011 loplugin:constparams in cppcanvas
Change-Id: Ic440819b5a1c71d2e4503b9a3b1e961c4ce123af
Reviewed-on: https://gerrit.libreoffice.org/40205
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-20 09:19:33 +02:00
Noel Grandin
ab9b38a406 use more begin()/end() for Sequence
Change-Id: I399be6b6ef7a6ce01e883569a177c0969bc29c69
2017-07-06 08:35:23 +02:00
Noel Grandin
b0e05f9ade loplugin:useuniqueptr in basic..cppcanvas
Change-Id: Ib40241eb794607154ae52f8aa68fbf5ea5e944af
Reviewed-on: https://gerrit.libreoffice.org/39551
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05 11:30:12 +02:00
Noel Grandin
58ae5fb5ff loplugin:oncevar in cppcanvas..drawinglayer
Change-Id: I5456aad61fb0dfe6830eae62b91d1a6399d6343f
Reviewed-on: https://gerrit.libreoffice.org/39128
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-23 08:59:30 +02:00
Jochen Nitschke
a5dba7dbec remove unused osl/mutex.hxx includes
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb
Reviewed-on: https://gerrit.libreoffice.org/38905
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-06-18 13:38:25 +02:00
Noel Grandin
307be8c9ce clang-tidy readability-redundant-control-flow
Change-Id: I832f7ef0f1bd55e365db7e49823fe8bc30390c04
Reviewed-on: https://gerrit.libreoffice.org/38215
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-31 08:33:40 +02:00
Noel Grandin
2ccde70d60 teach redundantcast plugin about functional casts
Change-Id: Iac8ccd17d9e46ebb2cb55db7adb06c469bbd4ea0
Reviewed-on: https://gerrit.libreoffice.org/37910
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-30 08:50:31 +02:00
Thorsten Behrens
ca5b8804f0 cppcanvas: this assert can stay
Both sequences are supposed to be 4 - input there does not result
from parsing the EMF+ file.

Change-Id: Idcfa70d717b75ce226a8bae0ebe073002555ef17
Reviewed-on: https://gerrit.libreoffice.org/37861
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-05-21 00:09:07 +02:00
Chris Sherlock
8c0be54a7d tdf#43157: convert cppcanvas module away from OSL_ASSERT
2nd attempt, this time I've decided makes more sense to just produce
a warning.

Change-Id: Iaf373a2d38e8f47266b00ea869de38a584788d45
Reviewed-on: https://gerrit.libreoffice.org/37598
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-05-14 23:33:43 +02:00
Bartosz Kosiorek
43f5268c6f EMF+ tdf#31814 Add support of reading EmfPlusBoundaryPointData
The EmfPlusBoundaryPointData object specifies a closed cardinal spline boundary for a gradient brush.
This data is starting point for displaying correctly gradients.

Change-Id: I91b01417c6dc00a04dabfc5a035afe9085999240
Reviewed-on: https://gerrit.libreoffice.org/37519
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-05-12 14:38:35 +02:00
Bartosz Kosiorek
ac528503b4 EMF+ We already implemented most used EMF+ records.
Now it's time to enable warnings, to track not implemented cases,
to have clear notification what is wrong with imported image.

Change-Id: Ic880a5b7df03e4a98d4700bebb3d0f6d77980505
Reviewed-on: https://gerrit.libreoffice.org/37407
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-05-09 03:31:41 +02:00
Bartosz Kosiorek
4c40aeeaf3 tdf#31814 EMF+ Fix an issue when not all elements were displayed
On on EMF+ images generated by ChemDraw, some elements were not displayed.
After investigation, occurs that position of points was not read
properly in same cases. This commit fixes such cases.

Change-Id: I1d01d8defc41f4e437a669ef1268b8e33823cfc1
Reviewed-on: https://gerrit.libreoffice.org/37406
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Tested-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-05-09 00:04:44 +02:00
Bartosz Kosiorek
ff7f5e1bbd tdf#31814 Introduce minimal value of line width to fix EMF+ import issues
Based on observation of different EMF+ files (eg. exported by ChemDraw),
there is minimal value of line width.
This commit is fixing all such import issues.

Change-Id: I5c26a1b511363eb1e429bf770ad0f482b124ecb5
Reviewed-on: https://gerrit.libreoffice.org/37319
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-05-07 18:59:22 +02:00
Chris Sherlock
97eb00c75e revert OSL_ASSERT changes
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07 17:03:35 +10:00
Chris Sherlock
bbd2d2c116 tdf#43157: convert cppcanvas module away from OSL_ASSERT to assert
Change-Id: I1db04c35cc004a33b0d2586f9eb1d21bc545eb81
2017-05-07 09:39:49 +10:00
Bartosz Kosiorek
420d20d3ef EMF Replace magic numbers of pen and brush objects
Change-Id: Ia3b6208b3d42b46fbdc9d61bbdea1c790aaf3ba0
Reviewed-on: https://gerrit.libreoffice.org/37268
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-05-06 14:19:43 +02:00
Andrea Gelmini
a940826162 Fix typos
To complete commit 0ef94e2b55
and f12096272e

Change-Id: Ie86bbfbd58dd728a013bef221e4d5c8fbcaf8e03
Reviewed-on: https://gerrit.libreoffice.org/37199
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-05-05 23:35:06 +02:00
Bartosz Kosiorek
a2c14edcc5 Fix number of EmfPlusEndContainer record
EmfPlusEndContainer record closes a graphics state container
that was previously opened by a begin container operation.

Change-Id: I80d977ba53b98ef87b70e0dca2008c1980f901f9
Reviewed-on: https://gerrit.libreoffice.org/37217
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-05-04 22:20:47 +02:00
Noel Grandin
0dbf528c29 loplugin:checkunusedparams in cppcanvas and dbaccess
Change-Id: Ia66e6326f3d1750b4e46a3f9f7127e7ed4aa99ca
Reviewed-on: https://gerrit.libreoffice.org/37068
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-02 08:19:37 +02:00
Caolán McNamara
36977f7404 crashtesting: more crashing on exporting fdo31814-3.emf to odg
Change-Id: I4cb359b426daed6c5d83c4ed4b85fe87de9d739a
2017-04-27 16:58:30 +01:00
Caolán McNamara
c63a90453b crashtesting: crash on exporting fdo31814-3.emf to odg
since

commit f9af0abce2
Date:   Sat Apr 15 01:44:46 2017 +0200

    EMF+ Add initial support for EmfPlusStringFormat Object

    The EmfPlusStringFormat object specifies text layout, display manipulations,
    and language identification. With this commit the support for font language
    and country was added. Also Bold style is applied,
    for strings which needs that.

elsewhere the pattern is to mask with 0xff to restrict to the hardcoded
256 size, so do that here too

Change-Id: Iba5bcc3fabe836c963b3eef47a864e87425675c7
2017-04-27 16:58:30 +01:00
Bartosz Kosiorek
e31c535b57 tdf#47243 tdf#39327 tdf#103639 Proper scaling of SetPageTransform
The EmfPlusSetPageTransform record specifies scaling factors and units for converting page space
coordinates to device space coordinates.
In previous implementation I made scaling after translating page scaling.
For some images it was working correctly (if there wasn't translating).
WIth this commit I fixed this issue.

Change-Id: I1e9e78ecdab663328f86a960d8547ad0a7fc1314
Reviewed-on: https://gerrit.libreoffice.org/37010
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-04-27 16:25:50 +02:00
Chris Sherlock
da64d198ec tools: svstream.hxx needs only errcode.hxx & not errinf.hxx
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca
Reviewed-on: https://gerrit.libreoffice.org/36896
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-25 09:31:31 +02:00
Bartosz Kosiorek
78a3a30487 tdf#47243 tdf#39327 Add support for SetPageTransform
Change-Id: Iea78cf1e9ca99c97814d9eaa4a65ad4b83a2bbe2
Reviewed-on: https://gerrit.libreoffice.org/36749
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-04-24 09:53:00 +02:00
Bartosz Kosiorek
f9af0abce2 EMF+ Add initial support for EmfPlusStringFormat Object
The EmfPlusStringFormat object specifies text layout, display manipulations,
and language identification. With this commit the support for font language
and country was added. Also Bold style is applied,
for strings which needs that.

Change-Id: Id9735a9ddb959aebd20d6d4d1bb5da0fa9c1fb85
Reviewed-on: https://gerrit.libreoffice.org/36555
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-04-24 09:52:17 +02:00
Noel Grandin
8c8f2a5285 remove unnecessary explicit linefeeds from end of SAL and OSL log calls
Change-Id: I3fa363c8e76e6cfb297f4ec346e3f031c09d6fbf
Reviewed-on: https://gerrit.libreoffice.org/36727
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-21 09:15:11 +02:00
Bartosz Kosiorek
715df6e9f8 tdf#107159 EMF+ Add support for EmfPlusDrawArc record
EmfPlusDrawArc record specifies drawing the arc of an ellipse.

Change-Id: I87788a9b14f518a383cbc5b804af635427e4c395
Reviewed-on: https://gerrit.libreoffice.org/36537
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-04-16 14:32:44 +02:00
Bartosz Kosiorek
fe62003caa tdf#106084 EMF+ Add support for EmfPlusScaleWorldTransform record
The EmfPlusScaleWorldTransform record performs a scaling on the current world space transform.

Change-Id: I03717b28a88d574d597174c6ca3446f937c96a15
Reviewed-on: https://gerrit.libreoffice.org/36320
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-04-13 18:31:55 +02:00
Bartosz Kosiorek
5726633455 tdf#39053 EMF+ Draw an extra line between the last point and the first point.
The EmfPlusDrawlLines record specifies drawing a series of connected lines.
Bit 0x2000 indicates whether to draw an extra line between the last point
and the first point, to close the shape.
In this commit support of additional line which close shape was added.

Change-Id: I47ae3d8003cbfdd5b8ff5ba78e1ebe10f97af04b
Reviewed-on: https://gerrit.libreoffice.org/36317
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-04-13 18:30:37 +02:00
Bartosz Kosiorek
fcb32f1cbc tdf#106084 EMF+ Add support for EmfPlusTranslateWorldTransform record
The EmfPlusTranslateWorldTransform record performs a translation
on the current world space transform.

Change-Id: I3e5744060c8a6d758bcc2804c6798e0208d2191f
Reviewed-on: https://gerrit.libreoffice.org/36287
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-04-13 18:30:02 +02:00
Bartosz Kosiorek
2e7c94f505 tdf#107034 EMF+ Add support for import EmfPlusDrawPie record
The EmfPlusDrawPie record specifies drawing a section of the interior of an ellipse.

Change-Id: Icd9d64117cc612d348c531932931f31e4d04e567
Reviewed-on: https://gerrit.libreoffice.org/36286
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-04-13 13:28:05 +02:00
Bartosz Kosiorek
9b693d896b tdf#107019 EMF+ Add support for import EmfPlusRecordTypeDrawBeziers record
EmfPlusDrawBeziers record defines the pen strokes for drawing a Bezier spline.

Change-Id: I6ae08a861bcbadd373741781af0011528947243e
Reviewed-on: https://gerrit.libreoffice.org/36280
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-04-13 13:26:20 +02:00
Noel Grandin
0514442730 no need to use OUStringToOString in SAL_INFO
Change-Id: I707e0d72aba89b7e644def6f4c251e14f6599ad2
Reviewed-on: https://gerrit.libreoffice.org/36451
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-12 12:49:25 +02:00
Bartosz Kosiorek
a45feba83e tdf#107016 EMF+ Add support of import EmfPlusRecordTypeDrawRects record
EmfPlusDrawRectss record defines the pen strokes for drawing a series of rectangles.

Change-Id: Iaa061f8502fb51de44d2e65a1c92daf297b79d2b
Reviewed-on: https://gerrit.libreoffice.org/36261
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-04-11 11:02:18 +02:00
Bartosz Kosiorek
723ee43cf6 Replace EmfPlusRecordType decimal valuse with hex
Change-Id: Ia5f248282e663e86b76a8c90fb5dd55d112f6912
Reviewed-on: https://gerrit.libreoffice.org/36260
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-04-07 23:17:06 +00:00
Noel Grandin
7662e92c64 loplugin:redundantcast find cstyle double casts
Change-Id: I5507be190dac781e5cdb545a60acf3d50056c9f8
Reviewed-on: https://gerrit.libreoffice.org/36187
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-06 07:47:30 +00:00
Miklos Vajna
a5a571307f tdf#82580 tools: rename Rectangle to tools::Rectangle
Mostly generated using

make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle"

Except some modules have their own foo::tools namespace, so there have
to use ::tools::Rectangle. This commit just moves the class from the
global namespace, it does not update pre/postwin.h yet.

Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2
Reviewed-on: https://gerrit.libreoffice.org/35923
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-03-31 06:27:11 +00:00
Noel Grandin
e4f6db9ec2 FontDescription.IsVertical is a tristate
found by still in progress "UNO scoped enum" change

Change-Id: I0a21b89e77be165bc96e914017a402cf8724d218
Reviewed-on: https://gerrit.libreoffice.org/34719
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-28 12:21:06 +00:00
Stephan Bergmann
43f2a7d979 Better make the zero-initialization more explicit
...if initializing these members is necessary at all; a bit hard to tell from
the code.

Change-Id: I3ddb25c35f0d1b44a092bdb2cb0192ce619f947c
2017-02-23 08:49:32 +01:00
Tor Lillqvist
6de3688cc6 Drop :: prefix from std in c*/
Change-Id: If078cda95fa6ccd37270a5e9d81cfa0b84e71155
Reviewed-on: https://gerrit.libreoffice.org/34324
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-02-15 23:01:23 +00:00
Noel Grandin
f4826959c1 new loplugin:unusedenumconstants
These are the simple removals, where it is obviously safe,
the more complex ones will come in separate commits

Change-Id: I7211945a6a5576354b60d9c709940ce9b674f308
Reviewed-on: https://gerrit.libreoffice.org/33828
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-03 08:59:39 +00:00
Noel Grandin
2489000d3f loplugin:useuniqueptr extend to check local vars
just the simple and obvious case for now, of a local var being allocated
and deleted inside a single local block, and the delete happening at the
end of the block

Change-Id: I3a7a094da543debdcd2374737c2ecff91d644625
Reviewed-on: https://gerrit.libreoffice.org/33749
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-01 12:15:22 +00:00
Patrick J
e3a47c0950 tdf#101638 diameter and radius were mixed up, devide by two
Change-Id: Iaece1ca3439ab3e1029156a5847768728b53b96e
Reviewed-on: https://gerrit.libreoffice.org/33717
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
2017-01-31 09:26:02 +00:00