Commit Graph

823 Commits

Author SHA1 Message Date
Noel Grandin
5abc669599 new plugin stylepolice
check for local variables which follow our member field naming
convention, which is highly confusing

Change-Id: Idacedf7145d09843e96a584237b385f7662eea10
2016-04-21 08:32:47 +02:00
Stephan Bergmann
cde88284e8 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: I8130752ca7ccd47cda91458e39fbb56470ee38e5
2016-04-20 17:25:39 +02:00
Miklos Vajna
cac7055901 drawinglayer: fix Android-specific typo
The intention is to call the real function, not the template itself.

Change-Id: Ib10ac4877b33554fe3a5c0918de43bea6e62cfc9
2016-04-19 15:22:21 +02:00
Miklos Vajna
ce12a5021a drawinglayer: work around broken Android toolchain
Change-Id: I8679f44663aa81e04684751847cab4f06df3a71e
2016-04-19 14:53:14 +02:00
Stephan Bergmann
75ee4bb944 Missing include for std::round
Change-Id: Id9e67f800192eb9ddbf79960d4b17012531d0e08
2016-04-19 14:29:56 +02:00
Miklos Vajna
422f10c5d7 tdf#99315 VclPixelProcessor2D: fix double border line width
Regression from commit 2c91cb08d6 (better
drawing support for borders of different width, fdo#33634, 2012-04-04),
the problem is that previously the width of inner/outer double border
lines got rounded to integer values quite early, but after the commit
they are kept at a double precision for much longer, which needs pixel
correction in VclPixelProcessor2D.

Example: if the border with is 1.47, and the line gets moved by 0.2
pixels, then the inner and outer edge of the line will be 0.2 and 1.67,
which gets rounded to 0 -> 2 in the pixel processor. Previously the
input was rounded to 1, so moving by 0.2 resulted in 0.2 -> 1.2, which
got rounded to 0 -> 1. The result is that sometimes the line width is 1
pixel wider than expected.

Fix the problem by allowing VclPixelProcessor2D to request pixel
correction from BorderLinePrimitive2D. It wouldn't be possible to do
pixel correction only in VclPixelProcessor2D, as it has no idea what to
correct: it only gets polygons, so it has no idea if e.g. the top of a
polygon is the outer edge of a top border line or an inner edge of a
bottom border line.

Change-Id: I1971f3a952fbcdc598ab46c659e12d976c13cbe6
Reviewed-on: https://gerrit.libreoffice.org/24221
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-04-18 19:06:39 +00:00
Noel Grandin
789055bc2a clang-tidy performance-unnecessary-copy-initialization
probably not much performance benefit, but it sure is good at
identifying leftover intermediate variables from previous
refactorings.

Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657
Reviewed-on: https://gerrit.libreoffice.org/24026
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18 07:37:31 +00:00
Miklos Vajna
1ee570a4e6 Related: tdf#99315 BorderLinePrimitive2D: fix solid line primitive width
Regression from commit 2c62596cf2
(fdo#75260: Correctly draw double lines for both Writer and Calc.,
2014-03-03), the problem was that when decomposing a double border line
promitive to solid line primitives (which happens for the legacy
"border" type, while both the Calc UI and Excel importer creates
"border-thin" ones), the decomposed inner line's height was larger than
the requested width.

As a result there was no gap between the polygon of the inner and the
outer line of the double border, looking like a non-double border.

The width of the outer border is still incorrect on the screen, though.

Change-Id: Ia9713c315ce8f23e2579b257169798e7c82c0a64
Reviewed-on: https://gerrit.libreoffice.org/24115
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-04-15 14:46:00 +00:00
Noel Grandin
fad7d4417e clang-tidy performance-unnecessary-value-param in drawinglayer
Change-Id: I59d65ba81afab41e781f9dea5339a01d7918c51c
2016-04-11 11:38:57 +02:00
Jochen Nitschke
922ee9a9da tdf#94306 replace boost::noncopyable in d...
dbaccess, desktop and drawinglayer.

Replace with C++11 delete copy-constructur
and copy-assignment.
Nothing special, only one unused include in
dbaccess/source/filter/xml/xmlfilter.cxx.

Change-Id: Iebabbc658215162450d4caf08d4fb2f116c456d9
Reviewed-on: https://gerrit.libreoffice.org/23918
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
2016-04-08 17:42:57 +00:00
Noel Grandin
1900790736 loplugin:constantparam in drawinglayer
Change-Id: I93b14a4ced909fa87bc3ad69d6fe9741a218018f
2016-03-23 11:22:33 +02:00
Noel Grandin
9509a2b4d2 loplugin:constantparam in drawinglayer
Change-Id: Id0d212ff212e6ac8a2a4ab9a2552f8f8e975371e
2016-03-10 10:09:58 +02:00
David Ostrovsky
a3c70e760f Fix missing iterator include on MSVC 14.0
Change-Id: I55de612aef52038fd9979426950d4ae4131ca586
Reviewed-on: https://gerrit.libreoffice.org/22448
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Ostrovsky <david@ostrovsky.org>
2016-02-17 23:43:45 +00:00
Noel Grandin
2087484c65 use consistent #define checks for the Windows platform
stage 2 of replacing usage of various checks for the windows platform
with the compiler-defined '_WIN32' macro

In this stage we focus on replacing usage of the WIN macro

Change-Id: Ie8a4a63198a6de96bd158ecd707dadafb9c8ea84
Reviewed-on: https://gerrit.libreoffice.org/22393
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-17 11:33:57 +00:00
Noel Grandin
ce43d0ae92 use consistent #define checks for the Windows platform
stage 1 of replacing usage of various checks for the windows platform
with the compiler-defined '_WIN32' macro

Change-Id: Iece73abdee530937e0737190b1aa97a46cd3075f
Reviewed-on: https://gerrit.libreoffice.org/22390
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-02-16 10:37:55 +00:00
Chris Sherlock
6858d51757 vcl: include vcl headers via triangular brackets instead of quotes
Change-Id: I311f7db622ce341527fe12a92b516f800b602f92
2016-02-13 00:29:50 +11:00
Chris Sherlock
a238b1f8d3 Remove excess newlines
A ridiculously fast way of doing this is:

for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \
  --exclude-dir=workdir --exclude-dir=instdir '^
{3,}' .)
do
    perl -0777 -i -pe 's/^
{3,}/

/gm' $i
done

Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c
Reviewed-on: https://gerrit.libreoffice.org/22224
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:18:05 +00:00
Andrea Gelmini
6d68e88a0f Fix typos
Change-Id: I4586168d3af81f047a4ded59fc6d257f17554885
Reviewed-on: https://gerrit.libreoffice.org/22194
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
2016-02-08 06:53:49 +00:00
Noel Grandin
b14224fe97 loplugin:unusedmethods
using an idea from dtardon:

<dtardon> noelgrandin, hi. could you try to run the unusedmethods clang
plugin with "make build-nocheck"? that would catch functions that are
only used in tests. e.g., i just removed the whole o3tl::range class,
which has not been used in many years, but htere was a test for it...
<noelgrandin> dtardon, interesting idea! Sure, I can do that.

Change-Id: I5653953a426a2186a1e43017212d87ffce520387
Reviewed-on: https://gerrit.libreoffice.org/22041
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-08 06:08:14 +00:00
Chris Sherlock
88730cdae3 vcl: bmpacc.hxx -> bitmapaccess.hxx
Change-Id: I4bb19d6103c4a6a902d86b62a857e3478493924c
2016-02-06 21:04:09 +11:00
Andrea Gelmini
534b2a4b58 Fix typos
Change-Id: Ice72f8d9971e15dd6ef365e64cd567b8581a92d3
Reviewed-on: https://gerrit.libreoffice.org/21797
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-05 06:48:38 +00:00
Chris Sherlock
697d445ed0 vcl: take into account the font width is the average font width
I'm changing the Font class function names:

- SetSize       -> SetFontSize
- GetSize       -> GetFontSize
- SetHeight     -> SetFontHeight
- GetHeight     -> GetFontHeight
- SetWidth      -> SetAverageFontWidth
- GetWidth      -> GetAverageFontWidth

That's because it really makes no sense to say that there is a
single constant font width because obviously proportional fonts
don't have one - the best we can do is an average font width,
which is what folks like Microsoft sort of do already. On a fixed
font, the average is still accurate, for obvious reasons :-)

I'm also not a fan of GetSize/SetSize as I find it a might too
generic.

Change-Id: Ib80a604ba62d6883fd6cbc7994da763976be5c70
Reviewed-on: https://gerrit.libreoffice.org/22069
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-04 03:17:26 +00:00
Caolán McNamara
c3cc55968e remove B2DLineJoin::Middle
and consistently map css::drawing::LineJoint_MIDDLE to the same thing that
css::drawing::LineJoint_MITRE points to everywhere else

Change-Id: I77b7586ea13f3fe84c0529172758256666488d36
2016-02-02 16:41:23 +00:00
Chris Sherlock
3187193a61 tools: rename FontUnderline to FontLineStyle
Change-Id: I4750ad8569a1003b2f8c29052f3e25003ee433ca
Reviewed-on: https://gerrit.libreoffice.org/21892
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-31 04:31:13 +00:00
Armin Le Grand
6f12c93703 tdf#91017 Enhance WMF import of EMR_ALPHABLEND action
The EMR_ALPHABLEND action was added 2012/2013, but missed support for
Bitmaps with Mask/Alpha. Due to that files with WMF containing these
actions may look different from before. Added suport to load contained
Mask/Alpha information in DIBs and the needed additional processing
through the display chain. WMF import is still based on Metafile
creation, when it would be using Primitives more original data could be
preserved.

Change-Id: I577569848cee2528328181fa0c7eb7f87857d094
Reviewed-on: https://gerrit.libreoffice.org/21709
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2016-01-29 12:02:11 +00:00
Chris Sherlock
d1a49df683 vcl: add text alignment functions to ImplFont and FontAttributes
ImplFont and FontAttributes now have GetAlignment and SetAlignment,
and I have renamed Font::GetAlign to Font::GetAlignment, and
Font::SetAlign to Font::SetAlignment.

See commit description in 8bfccd3a71 ("vcl: Create accessor
and mutator for font scaling in FontMetric") for reasoning behind
patch.

Unit test added to vcl/qa/cppunit/font.cxx to test text alignment.

Change-Id: I6272c84fc9416c90616d957d1897eba9469fe7ba
Reviewed-on: https://gerrit.libreoffice.org/21876
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-29 01:59:55 +00:00
Tor Lillqvist
526b0a566d Bin some unneeded 'using' and includes
Change-Id: Ia91b3837ce39ae48e8c660274a08415ee4f9e5c7
2016-01-26 10:15:57 +02:00
Chris Sherlock
28c96fc255 vcl: rename Font::GetName to Font::GetFamilyName
Change-Id: Ie20871a3078bf875c1782b7761d60591a9c9704f
Reviewed-on: https://gerrit.libreoffice.org/21529
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-17 23:35:37 +00:00
Norbert Thiebaud
45654a1d4d revert vcl patch series that brok Mac and Windows
revert:
9bc2f3de86
 vcl: add comment about ImplFontMetric::{Get|Set}LineHeight()
26371f105b
 vcl: FontAttributes::GetSlantType() -> FontAttributes::GetItalic()
2dd0b43173
 vcl: font.hxx and metric.hxx cleanup, make ctors explicit and the dtor virtual
5ab13bf3ea
 vcl: tabify font.hxx
f99550dae5
 vcl: change Font::SetName() to Font::SetFamilyName()
2b297116cb
 vcl: rename Font::GetName to Font::GetFamilyName

Change-Id: I23f38921187d66b970ca815eb30dda4222a2da62
2016-01-16 12:20:45 -06:00
Chris Sherlock
2b297116cb vcl: rename Font::GetName to Font::GetFamilyName
Change-Id: I83927e0992dfe0a2a79d139818a9f45d3761aae5
Reviewed-on: https://gerrit.libreoffice.org/21509
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-16 16:11:28 +00:00
Miklos Vajna
1859acbc7c svx: remove now unused SdrModel::isTiledRendering()
Change-Id: I8d3c6b1de2db57e39678a7e57de6e015c72719ec
2016-01-15 07:44:58 +01:00
Chris Sherlock
08bbdaa2f9 vcl: Create accessor and mutator for int and ext leading in FontMetric
Accessor and mutator created for external and internal leading space in
FontMetric.

See commit description in 8bfccd3a71 ("vcl: Create accessor
and mutator for font scaling in FontMetric") for reasoning behind
patch.

Unit tests
- check to ensure that can set external and leading space
- check equality operator on FontMetric after setting both external
  and internal leading space
- enhanced tests to also check the inequality operator

Change-Id: I973970dd0b0631c5eca3e89039dce57ac3a3eb63
Reviewed-on: https://gerrit.libreoffice.org/21454
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-13 19:50:18 +00:00
Stephan Bergmann
9ff5abf2e1 loplugin:privatebase: Make derivation from noncopyable explicitly private
Change-Id: Ia410950353aec0106ea82d025ed3ee89c79ca127
2016-01-11 13:17:07 +01:00
Andrea Gelmini
64d624b651 Fix typos
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86
Reviewed-on: https://gerrit.libreoffice.org/21209
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-10 14:17:20 +00:00
Noel Grandin
85e9b0f3ea tdf#96541 - dialog "About LibreOfficeDev" has lost its logo
regression from 58d8d8a "tdf#69977: uno::Sequence is expensive"

Change-Id: I792b5971a7a3a9532cccb36add5b558c68e397ef
2015-12-23 09:38:46 +02:00
Noel Grandin
e18b08363a loplugin:unusedmethods
Change-Id: Ifafdaf6da0225f244853a0042a6458643b570623
2015-12-21 10:20:31 +02:00
Stephan Bergmann
3dc76dc72e Missing include
Change-Id: Iac9006292bfdb1b56e213346188245a205146803
2015-12-15 13:19:51 +01:00
Stephan Bergmann
0a8e78a21e loplugin:unreffun
Change-Id: Ic741021b18b4064cb74786fc3d40fadf8eb85ab7
2015-12-15 13:14:02 +01:00
Tor Lillqvist
d612d921a9 Correct claim made in comment
Change-Id: I7adccb1833ad2823ec7fa85f06752614d38639f9
2015-12-15 11:18:28 +02:00
Noel Grandin
4463da0488 use vector as container for Primitive3DReference
rather than uno::Sequence, since we modify this container a lot
and uno::Sequence is expensive to update

Change-Id: Id5bc5171cbc4b90b243e6dda6d572f21b3bdf00d
2015-12-15 10:42:52 +02:00
Noel Grandin
9c9291255f create a move append method for Primitive2DContainer
since it is fairly common to append temporaries.

Change-Id: I920daf8539e42fc9fe313af48fdb34ee4aaf908d
Reviewed-on: https://gerrit.libreoffice.org/20637
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-12-15 08:17:13 +00:00
Miklos Vajna
6f8deb4601 drawinglayer: remove comment that no longer makes sense
It referred to the previouly removed
Primitive2DContainerToPrimitive2DSequence(), not to maybeInvert().

Change-Id: I77dad2218d5b3e2e2d76673bd2e97d856d0b94f2
2015-12-14 09:27:21 +01:00
Noel Grandin
da419ab6b2 loplugin:unreffun
fallout from 58d8d8ac67
"tdf#69977: uno::Sequence is expensive"

Change-Id: Ib55de090c72dcfd8ad049746b693b383e70e8ca9
2015-12-11 11:56:00 +02:00
Noel Grandin
58d8d8ac67 tdf#69977: uno::Sequence is expensive
when used as a mutable data-structure. Plain std::vector halves the time
taken to display the chart dialog

Create a class to represent the std::vector we are going to be passing
around, and move some of the utility methods into it to make the code
prettier.
Also create an optimised append(&&) method for the common case of
appending small temporaries.

Change-Id: I7f5b43fb4a8a84e40e6a52fcb7e9f974091b4485
2015-12-11 10:11:23 +02:00
Stephan Bergmann
d7ceaae4cd Missing includes
Change-Id: I4cefabc51c00b0e6ffd0613c4409cc31e1aa5673
2015-11-27 17:45:34 +01:00
Caolán McNamara
26c32cfee9 Resolves: rhbz#1283426 using vdevs based on now dead physical devs is unsafe
This is the same problem that

commit 133e04fc1a870c0aad207e82eefeeeceaba5dc6d
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Wed Jun 17 09:23:32 2015 +0100

    Resolves: tdf#91880 Invalidate graphics when the gtk window is destroyed

    not just when the GtkSalFrame is dtored

tried to fix, but that just made it more unlikely to fail

Change-Id: Icba750c787adb6cd5c5ed0874ef07e6201c4cf25
2015-11-27 16:29:03 +00:00
Michael Meeks
9c554c2c8c vcl: improve scheduler debugging information.
Change-Id: I6f7d7d3b5b027097417a15804a42aaaab4a03158
Reviewed-on: https://gerrit.libreoffice.org/20185
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-11-25 23:15:42 +00:00
Caolán McNamara
b639fe60ea VirtualDevices either match another device depth, or are 1 bit
cairo can therefore always render to a svp virtual device with
need for a fallback

Change-Id: I5d03ae541820389e26f7448444444be009fb28a4
2015-11-23 14:25:59 +00:00
Caolán McNamara
c43a3a5867 establish that Virtual Devices either match Physical Device depth or ...
are 1 or (rarely) 8 bit and lock that down.

Change-Id: I3d946ebef34ffb71c5adea7aa420af50e9584e05
2015-11-23 14:25:59 +00:00
Noel Grandin
be3d2309f0 other #includes should be AFTER the include-once #define
found with the following script:
git ls-files *.hxx | xargs perl -0777 -ne 'if
(/include.*
.*
.*

"; close ARGV }'

Change-Id: I3afb0e81eb315c34bc0eb6bb4733dd1f0537d5c0
2015-11-17 14:24:58 +02:00