Commit Graph

592 Commits

Author SHA1 Message Date
Noel Grandin
84b396a235 new loplugin:namespaceindentation
check indentation of braces in namespace decls,
and the comments that often appear with them.

This is my penance for messing up the indentation with
clang-tidy-modernize-namespaces.

As such I have limited it to new-style namespaces for now,
and the check is off by default.

Change-Id: I4db7f10a81c79bc0eece8f8e3ee564da8bc7f168
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87723
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-31 09:34:46 +01:00
Noel Grandin
248ddbc4e9 clang-tidy modernize-concat-nested-namespace in cppcanvas..cppuhelper
Change-Id: I0bb4ea91288a15fb590d077fb390c53be8b50400
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86801
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-15 06:58:12 +01:00
Noel Grandin
175a2063ef use more std::make_shared
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>
2020-01-10 13:07:41 +01:00
cagatay
f1656f7db9 tdf#124176: Use pragma once instead of include guards
Change-Id: If73053c1fa0f65ff7296bf8f5a34d6ead64167ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85928
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2019-12-29 18:41:24 +01:00
Stephan Bergmann
47dd2c63f6 Rewrite uses of boost::optional
...to only use functions that are also available for std::optional (in
preparation for changing from boost::optional to std::optional):

* uses of get are replaced with operator * or operator ->
* uses of is_initialized are replaced with operator bool
* uses of reset with an argument are replace with operator =

(All of the replacements are also available for boost::optional "since forever",
so this change should not break builds against old --with-system-boost.  An
alternative replacement for is_initialized would have been has_value, but that
is only available since Boost 1.68.)

Change-Id: I532687b6a5ee37dab28befb8e0eb05c22cbecf0f
Reviewed-on: https://gerrit.libreoffice.org/84124
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-30 17:44:34 +01:00
Tomoyuki Kubota
f4544f3903 tdf#42949 restore vcl/canvastools.hxx for OSL_DEBUG_LEVEL > 2
Change-Id: I6c69bcca4d5cd34efc297764d940727ef8631bf4
Reviewed-on: https://gerrit.libreoffice.org/81953
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-03 16:11:26 +01:00
Gabor Kelemen
977c993353 tdf#42949 Fix IWYU warnings in cppcanvas/
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I3e6b35acf6266157d4cf634e2143e6e19a73102a
Reviewed-on: https://gerrit.libreoffice.org/81813
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-10-31 11:29:44 +01:00
Andrea Gelmini
c8e70f970a Fix typos
Change-Id: I4bd004af206813b9dc01c50ab20f2e8b954b8dca
Reviewed-on: https://gerrit.libreoffice.org/77323
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-12 09:34:52 +02:00
Caolán McNamara
ff706aa45c rhbz#1728763 black bg seen in renderer emfs
back in 5-4 series FWIW, since...

commit a3c95ec453
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Mon Jun 11 09:00:46 2018 +0100

    rhbz#1589029 tdf#93789 impress not showing text highlight in presentation mode

Change-Id: I8412854cd32af73cf2512db8c424d56ed84d9c1e
Reviewed-on: https://gerrit.libreoffice.org/76153
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-23 17:16:38 +02:00
Noel Grandin
31f04378db loplugin:passstuffbyref
Change-Id: Icb7c22cf4ac95eab54d04e79312fb471ca27bceb
Reviewed-on: https://gerrit.libreoffice.org/74246
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-18 20:10:57 +02:00
Arkadiy Illarionov
2ed3d691b4 Use hasElements to check Sequence emptiness in cppcanvas..desktop
Similar to clang-tidy readability-container-size-empty

Change-Id: I81c0ff78d2ecc7d984e3ed5e5ce60efe327fc162
Reviewed-on: https://gerrit.libreoffice.org/71799
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-05 19:24:57 +02:00
Noel Grandin
a361231b13 fix wrong SET/QUERY flags passed to uno::Reference
By creating deleted methods for the wrong calls.

Avoids the compiler needing to construct a temporary

Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a
Reviewed-on: https://gerrit.libreoffice.org/72103
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-13 08:15:27 +02:00
Noel Grandin
d0119ff7f2 improve tools::Rectangle->basegfx::B2?Rectangle conversion
Improve the conversion method to do something reasonable with
empty Rectangle.
Use the conversion method in more places.

Change-Id: I48c13f3d6dae71f39f03f7939101e545c8125503
Reviewed-on: https://gerrit.libreoffice.org/71853
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-05-08 12:42:53 +02:00
Andrea Gelmini
0a3707c349 Fix typo
Change-Id: I9f75142304673c7512f92ae82d8d6cfee6f4a8a3
Reviewed-on: https://gerrit.libreoffice.org/70995
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-20 07:04:06 +02:00
Tomaž Vajngerl
98272c886b remove or change salbtype.hxx includes with the specific one
We probably don't need salbtype.hxx include, but if we do we can
now change it with a more specific one - namely BitmapPalette.hxx
in most cases. This doesn't yet touch the includes in VCL.

Change-Id: Ie3067ccb2eec425650b41ce7fca48e368215f489
Reviewed-on: https://gerrit.libreoffice.org/70761
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-04-15 12:32:52 +02:00
Noel Grandin
725a1f514c loplugin:sequentialassign in comphelper..cui
Change-Id: I1a08f3684b785e31535adcfb4220ded267a77c3b
Reviewed-on: https://gerrit.libreoffice.org/70643
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-12 15:33:02 +02:00
Arkadiy Illarionov
5af9e26ae8 Simplify containers iterations in cppcanvas, cppu, cppuhelper
Use range-based loop or replace with STL functions

Change-Id: I72bf7cdb632c04e2fc8d4f7ab85cb6571222aa07
Reviewed-on: https://gerrit.libreoffice.org/68636
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-03 16:27:08 +01:00
Noel Grandin
17dd2662cc convert "*xxx.get()" to "*xxx"
Change-Id: Ic307226591ff9702957ccdec486ccf70357eb6d9
Reviewed-on: https://gerrit.libreoffice.org/65951
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-08 10:38:35 +01:00
Gabor Kelemen
6256797dac tdf#42949 Fix IWYU warnings in include/vcl/[v-x]*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I98f49765c6b74808dcbd692e0f375dd2848fcfd4
Reviewed-on: https://gerrit.libreoffice.org/65614
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-07 09:13:14 +01:00
Noel Grandin
2cfdf00a9a loplugin:unnecessaryvirtual
Change-Id: I15633651aaa914918f1e7739c4f3d4793f7d800a
Reviewed-on: https://gerrit.libreoffice.org/64831
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-10 07:59:40 +01:00
Noel Grandin
0d43b791e6 loplugin:unusedmethods
Change-Id: I4f2635d468c9ad83b3ac93733529e01a4d03f38e
Reviewed-on: https://gerrit.libreoffice.org/64805
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-09 07:18:17 +01:00
Stephan Bergmann
6e614489dc Clean up obsolete uses of BOOST_FALLTHROUGH
Change-Id: If391c86c9b2c94eed9b95c692f290449a241ed4e
Reviewed-on: https://gerrit.libreoffice.org/64790
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-08 09:44:07 +01:00
Stephan Bergmann
5eac2e6bcc Remove misguided FALLTHROUGH comments
...between adjacent switch labels without any intervening statements

Change-Id: Ieb8a0d9f71ea4382b5f7d005cdf7111d06aeb5d0
Reviewed-on: https://gerrit.libreoffice.org/64789
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-08 09:43:46 +01:00
Bartosz Kosiorek
217ad59a41 tdf#111486 Removed not used EMF+ code
Change-Id: I708876fecab1bd6b0c37892efa9c4ab180457d6b
Reviewed-on: https://gerrit.libreoffice.org/64366
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-07 08:29:18 +01:00
Mike Kaganski
c59a5b81e9 tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: I8d98aa7dd77fbd79611b8a4aba77e8c378fd1cae
Reviewed-on: https://gerrit.libreoffice.org/63981
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-25 16:52:30 +01:00
Noel Grandin
2dbd02b576 loplugin:redundantfcast improvements
check for calls to constructors, and extend the list of types we check
for unnecessary temporary creation

Change-Id: Ia2c1f202b41ed6866779fff5343c821128033eec
Reviewed-on: https://gerrit.libreoffice.org/63472
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-21 12:44:55 +01:00
Andrea Gelmini
6751ed9e43 Fix typos
Change-Id: Id6f5edca053048540b57fd9871aabd1c71f9b64f
Reviewed-on: https://gerrit.libreoffice.org/62902
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2018-11-07 12:09:46 +01:00
Mark Hung
fff34169fa tdf#70851 fix strange waveline polygon.
::basegfx::utils::createWaveline was invoked with incorrect
parameter, resulted in wavelines rendered along a 4-sided
rectangle instead of a line.

Change-Id: I30f52c95bdb4f804438b04559ba339ba95dee6e1
Reviewed-on: https://gerrit.libreoffice.org/62838
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-06 00:15:09 +01:00
Mark Hung
13b4c191cb tdf#37636 Render textlines with colors.
Create a new helepr class, TextLinesHelper, to handle
textline colors and overall size.

Change-Id: I8635199819443429f7be1754a298e9a21ef17f8c
Reviewed-on: https://gerrit.libreoffice.org/62832
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05 13:16:01 +01:00
Mark Hung
8abe2d0ff1 tdf#37636: pass bNormalText to cppcanvas::internal::TextRenderer.
so that we know whether we are rendering a normal text or othewise
(like shadow, etc.) because it is not necessary to use the textline
color or overline color when rendering the shadow.

Change-Id: I51c21bbb4e3cec226320b46e2cdba4cd5e8792d6
Reviewed-on: https://gerrit.libreoffice.org/62831
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05 12:33:27 +01:00
Mark Hung
b0da1ca2d7 tdf#37636 create underlines, overlines, strikeout separately
and expose a new cppcanvas::tools::createTextLinesPolyPolygon
interace to fetch them in order to fill each of them with their
own color later.

Change-Id: I26e99a9af87a69d9cb71cda6a4c03c4ba42158dc
Reviewed-on: https://gerrit.libreoffice.org/62830
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05 12:20:41 +01:00
Mark Hung
9709061a57 tdf#37636 take care of MetaOverlineColorAction in mtfrenderer.
Keep the overline color in DevOutState so that it can be
used in text actions later.

Change-Id: Ia584de9b78e1adf6862c09fb50cbed1f16e2ad0b
Reviewed-on: https://gerrit.libreoffice.org/62829
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05 12:20:15 +01:00
Mark Hung
19e004ed1c cppcanvas::mtfrenderer refactor
to get rid of one of the initEffectLinePolyPolygon we used.

Change-Id: I04c6e1dc72e1f3936bfd268a3b1092bdc4a9b199
Reviewed-on: https://gerrit.libreoffice.org/62828
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05 11:38:58 +01:00
Mark Hung
144416c428 tdf#43671 creatCanvasFont with EmphasisMark.
Change-Id: I8c7592e9bdb212fcbb07655e81faadd07ed880f7
Reviewed-on: https://gerrit.libreoffice.org/62244
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-31 00:28:33 +01:00
Mark Hung
ae9f37ba75 tdf#100236 Implement linestyles with dash and dots.
Allow append dashes to have dash and dot line styles.
Segment length parameters were taken from cppcanvas, also restructure
the code to use the same appendDashes function.

Change-Id: I17c0796dbe722c4c6d5e91d0e318570a52a2514c
Reviewed-on: https://gerrit.libreoffice.org/62084
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-23 00:55:50 +02:00
Mark Hung
d2aee5ab5a tdf#70851 render wave underlines in slideshow.
Change-Id: I31b2717e60b5eae6c992e27700e589938764957c
Reviewed-on: https://gerrit.libreoffice.org/62035
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-22 17:09:55 +02:00
Mark Hung
c13f0a62fb tdf#100236 implement waveline in mtfrenderer.
Create B2DPolygon with ::basegfx::utils::createWaveline
to render the waveline. Parameters are adapted from
the drawinglayer. Thickness of the line isn't really
implemented yet.

Change-Id: I74d05744632d5d54e439a2a3e144fa2daf4ae1bb
Reviewed-on: https://gerrit.libreoffice.org/61947
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-22 17:09:36 +02:00
Noel Grandin
16690220ed loplugin:singlevalfields
tighten up the handling of binary operators

Change-Id: I262ec57bf7142fa094d240738150a94d83fd15ee
Reviewed-on: https://gerrit.libreoffice.org/61777
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-17 08:25:06 +02:00
Mark Hung
800c60524d tdf#55361 adjust leftmost position for RTL text while animation.
Set the leftmost position correctly based on logical advancement
values of XTextLayout to render the substring of a RTL text.

Change-Id: Ib65b433105274f6ebfd251e92d831f1b28516294
Reviewed-on: https://gerrit.libreoffice.org/61459
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-09 01:28:19 +02:00
Noel Grandin
05db125c57 loplugin:staticconstfield improvements
Change-Id: Ia0a19736dfd4500bb17b04c072710f8ee8744031
Reviewed-on: https://gerrit.libreoffice.org/60526
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17 10:52:39 +02:00
Noel Grandin
c289c25523 loplugin:simplifyconstruct in canvas..cui
Change-Id: I02eba1df117a9d0df42bcac13c3251cb4fa6da14
Reviewed-on: https://gerrit.libreoffice.org/60074
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06 14:38:52 +02:00
Tor Lillqvist
c16d64ad4f Bin superfluous whitespace on empty line
Change-Id: Ida0ab3cd78514b2c10f8e6655becefe794217f8c
2018-08-28 11:24:50 +03:00
Mike Kaganski
8c48d69f06 Use more basegfx deg<->rad functions, instead of direct formulas
Also make the functions constexpr.

Due to slight changes in floating-point arithmetics (90.0 instead of
180.0, M_PI2 instead of M_PI resp.), results might differ in last
digits (usually 17th decimal digit). This has lead to need to tweak
char2dump's PieChartTest unit test.

Change-Id: I20323dd7dab27e4deb408ea4181e390cc05e7cd3
Reviewed-on: https://gerrit.libreoffice.org/58583
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-08-04 20:51:27 +02:00
Noel Grandin
d407304544 loplugin:stringloop cui,dbaccess
Change-Id: I32b63d2435d36b869823ea022ebd7f8347a46ea0
Reviewed-on: https://gerrit.libreoffice.org/58211
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-28 17:22:52 +02:00
Gabor Kelemen
dfaa7d4d28 Add missing sal/log.hxx headers
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it.
This is a continuation of commit 6ff2d84ade to be able to remove those unneeded includes.

This commit adds missing headers to every file found by:
grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG')
to directories from connectivity to cui

Change-Id: I9903c10d0a04bbeb93d0f776d1d252b152459499
Reviewed-on: https://gerrit.libreoffice.org/57408
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-16 12:24:49 +02:00
Noel Grandin
1501da0109 loplugin:oncevar
Change-Id: Id295dc0db174a448ef73db9de34f2de07d47f09a
Reviewed-on: https://gerrit.libreoffice.org/57108
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-09 11:06:19 +02:00
Caolán McNamara
a3c95ec453 rhbz#1589029 tdf#93789 impress not showing text highlight in presentation mode
the text hightlighting feature was implemented backed on to the vcl
TextFillColor feature. TextFillColor fills the background of the bounds
of the text with that color

Likely either the same problem or similar as tdf#93789

Change-Id: Iace62cedc49e5f5844ac35d3caa23249b6cb4bc1
Reviewed-on: https://gerrit.libreoffice.org/55629
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-11 17:35:44 +02:00
Jochen Nitschke
8ddca0648a tdf#42949 remove unused compheler includes ..
and fix the fallout

Change-Id: I15bc5d626f4d157cbc69a87392078b41e621d14e
Reviewed-on: https://gerrit.libreoffice.org/54882
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-05 10:56:36 +02:00
Noel Grandin
d4442ac1ac drop Graphic::GetBitmap
so that we flush out various code using Bitmap, in favour of using
BitmapEx.
This is part of the process of making Bitmap largely an internal detail
of vcl

Change-Id: Iaf2ead5e3d9960838723fb55b812b97108093d74
Reviewed-on: https://gerrit.libreoffice.org/55062
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-31 14:08:44 +02:00
Noel Grandin
17c936bca5 loplugin:unusedfields-in-constructor in various
Change-Id: Ie0fb647938e3cf730976fb2e435b92bfd67ef645
Reviewed-on: https://gerrit.libreoffice.org/54998
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-29 14:37:12 +02:00