Commit Graph

1559 Commits

Author SHA1 Message Date
d5b3c5d509 weld DbNumericField item
Change-Id: I96b7945cdf9f00c3d0a4e043ee77666e19c8a072
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97896
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-06 14:53:21 +02:00
95cfa85395 adjust FormattedSpinButton to be driven by an EntryFormatter
so we can have the same backend driving the FormattedSpinButtons as a
FormattedEntry

Change-Id: I07a472315a04787eb5fcf992cde8f758af742156
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97860
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-05 16:44:09 +02:00
a751d9c414 weld FormattedControl
by using the newly split out Formatter to do the number formatting
but input/output to/from a weld::Entry

Change-Id: Ic9e619dc5d1ed2fae87e2d89a40dc51f3881468f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97660
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-02 20:22:05 +02:00
d2f1cd0043 weld EditControl for browsebox
Change-Id: I8f21c12f7ee10e1b9ba883a8ff01bb5252429f09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97353
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-01 18:04:46 +02:00
733023dd10 tdf#134386 set m_pTemplateProvider before creating any other pages
Change-Id: Icc501b127f92cdbfbf0987af9b0b560f1efbc056
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97404
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-06-29 16:18:27 +02:00
74efa49fb3 Upcoming improved loplugin:elidestringvar: chart2
Change-Id: If64cf392b3b77994c3f57660a7ddc6bf1db5b0ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97194
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-26 10:44:55 +02:00
e871c9cb7c loplugin:simplifybool in canvas..cui
Change-Id: Ib7c3b381ce4456e3d48538ee6f762ceaf2784fe1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94973
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-28 09:04:51 +02:00
fe6cce01c8 Fix loplugin:simplifypointertobool for libstdc++ std::shared_ptr
...where the get member function is defined on a std::__shared_ptr base class,
so loplugin:simplifypointertobool used to miss those until now.  (While e.g.
using libc++ on macOS found those cases.)

366d08f2f6d4de922f6099c62bb81b49d89e0a68 "new loplugin:simplifypointertobool"
was mistaken in breaking isSmartPointerType(const clang::Type* t) out of
isSmartPointerType(const Expr* e); c874294ad9fb178df47c66875bfbdec466e39763 "Fix
detection of std::unique_ptr/shared_ptr in loplugin:redundantpointerops" had
introduced that indivisible two-step algorithm on purpose.

The amount of additional hits (on Linux) apparently asked for turning
loplugin:simplifypointertobool into a rewriting plugin.  Which in turn showed
that the naive adivce to just "drop the get()" is not sufficient in places that
are not contextually converted to bool, as those places need to be wrapped in a
bool(...) functional cast now.  If the expression was already wrapped in
parentheses, those could be reused as part of the functional cast, but
implementing that showed that such cases are not yet found at all by the
existing loplugin:simplifypointertobool.  Lets leave that TODO for another
commit.

Besides the changes to compilerplugins/ itself, this change has been generated
fully automatically with the rewriting plugin on Linux.

Change-Id: I83107d6f634fc9ac232986f49044d7017df83e2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94888
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
2020-05-26 22:33:02 +02:00
ed2c880a69 tdf#133005 Chart: fix ODF import of date axis position
Chart with date axis setting "On tick marks" wasn't
imported correctly.

See commit 40d83914d43f60a196dfabddea0b52e2046b333a
(tdf#127792 implement UNO chart attribute MajorOrigin)

Change-Id: I5967c4bab8690df1f191b33ecb0e5b043bca68a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94621
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2020-05-25 13:41:49 +02:00
77445e201c Make Chart Creation Wizard async
* FuInsertChart as a memeber in ScTabViewShell
  stores instance is needed to react on the dialog's result
* CreationWizardUnoDlg converted to XAsynchronousExecutableDialog
  added dialog close handler which notifies listeners
  In the Online dialog become dead after closing, additional
  PostUserEvent was needed to kill the dialog after real close
  (without it user needed to select any cell to close dialog)
* Reuse in Writer

Change-Id: Ib09b5d83af9e1aa67218e093aa161419e8ddb922
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90380
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2020-05-18 20:45:26 +02:00
337a9a454c use for-range on Sequence in chart2
Change-Id: Ief02e5d5284b0cbad26b04c0a282dccfee577b90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94398
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-18 11:28:50 +02:00
8027cc622f tdf#132757 UI: option to set Position Axis property of charts
Follow-up of commit 40d83914d43f60a196dfabddea0b52e2046b333a
(tdf#127792 implement UNO chart attribute MajorOrigin).

Change-Id: I68c35a4552a3915c045036d1f0f38804a00b7093
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93566
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
2020-05-13 13:02:01 +02:00
366d08f2f6 new loplugin:simplifypointertobool
Change-Id: Iff68e8f379614a6ab6a6e0d1bad18e70bc76d76a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91907
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-10 12:02:44 +02:00
6751a89552 compact namespace in canvas..cui
Change-Id: I7bd0c2a55b936896fcfe7e1a374871008a18618f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93706
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-08 12:40:03 +02:00
b512ce255f Make upcasting css::uno::Reference ctor require complete types
The main reason for the "home-grown" UpCast introduced with
904b3d1fceee5827076758ed2a81f80cb73493ca "Up-cast conversion constructor for
css::uno::Reference" in 2013 was probably that we could not yet rely on C++11
std::is_base_of back then.  A (welcome) side effect was that the derived class
could be incomplete.

However, specializations of UpCast relying on whether or not T2 is incomplete
are obviously an ODR violation if the type is incomplete in some TUs and
complete (and derived from T1) in others.  And even if UpCast had internal
linkage, it would still be brittle that its behavior depends on the completeness
of T2 at the point of the template's instantiation, and not necessarily at the
point of use.

That means we should better base that ctor on std::is_base_of (which we can do
now since 39a1edd6fec902ef378acce8af42c4d7fba280d0 "Make css::uno::Reference
upcast ctor LIBO_INTERNAL_ONLY"), which causes a compilation error at least on
Clang and GCC if the completeness requirements are not met.  This change fixes
all the cases where types need to be complete now, plus any resulting
loplugin:referencecasting warnings ("the source reference is already a subtype
of the destination reference").

Change-Id: Ieb9e3552e90adbf2c5a5af933dcb872e20661a2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92950
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-27 07:19:30 +02:00
d26d1da82f rename SvtValueSet back to ValueSet
Change-Id: I51ab96ffef7acc0d416d13ac8e380e49381f4d1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92902
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-25 22:43:39 +02:00
3d79f395ea weld SvxColorDockingWindow
Change-Id: Iabefa16f850d3d76017adfd77fb6be30ed467887
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92895
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-25 21:50:47 +02:00
9df2821e61 loplugin:flatten in chart2
Change-Id: Iadc4da6515a7d82e7a92b33d74d589b61fa2c64f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92480
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-19 11:01:18 +02:00
e4a087876d tdf#95425 follow-up: enable "Source format" checkbox of data label
settings after file opening, if its value is true in the opened
ODF or OOXML document, instead of always showing disabled state.

Testing notes: double click on a data label during chart editing
of unit test document testAreaChartNumberFormat.docx of
commit e57d90cd4e51a1353eafc87bb29cfe6076704a7c
(tdf#129173 tdf#129175 Fix number format of data labels)
to see the Data Labels for Data Series... window. On the page
"Data Labels...", click on the Number format... button to see
the enabled checkbox "Source format" (that was disabled
previously).

Change-Id: I2845e6f462db273f21c47bb286bed56046f8cf21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91038
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2020-04-09 10:25:52 +02:00
fc028b21a7 set focus in data browser by default
Change-Id: Ided1c9be38db517cbae846fd4377bf5a34c6593d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91730
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-05 22:29:04 +02:00
1e668a4c81 default dtor order is sufficient
Change-Id: I360fe03a0e11f8392f56f95b4e2b1d90ba75b813
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91726
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-05 21:06:01 +02:00
66b5cbf67b tdf#131873 data table fills with extra columns during scroll
Change-Id: Iccdb113a609e0873fb68cfb52405993a0f4362bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91704
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-05 15:52:53 +02:00
7de7512718 Revert "tdf#95425 follow-up: enable "Source format" checkbox of data label"
This reverts commit 9bf40c635c41c6b3b072b7c61fea67a20ba4342b.

Reason for revert: This apparently causes builds to hang.  Witness all the six failed Jenkins builds for <https://gerrit.libreoffice.org/c/core/+/90079> as well as <https://ci.libreoffice.org/job/lo_tb_master_linux_dbg/29218/> and following.

Change-Id: I441e04cba0f1234cdc200a9aa714b166bda4ab89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90950
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: Jenkins
2020-03-24 16:10:42 +01:00
9bf40c635c tdf#95425 follow-up: enable "Source format" checkbox of data label
settings after file opening, if its value is true in the opened
ODF or OOXML document, instead of always showing disabled state.

Testing notes: double click on a data label during chart editing
to see the Data Labels for Data Series... window. On the page
"Data Labels...", click on the Number format... button to see
the checkbox "Source format".

Change-Id: Idb837d9492ad7e83b9020167c47ed52499c070a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90079
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2020-03-24 11:20:46 +01:00
3bf3face22 tdf#130975 replace rtl::math::isNan with std::isnan.
Change-Id: I5d53e6369d35093445b2efd8936bbf8c6775ff47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90451
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-14 09:19:00 +01:00
9fab1ba8dd tdf#75330 add a new overlay/no-overlay feature for the legend
Implement "Show the legend without overlapping the chart" option
for chart legend.

Change-Id: Ifbba4c81136e13995d276434dc17a97b0675428c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89810
Tested-by: Jenkins
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2020-03-05 12:27:04 +01:00
381c9c6e5d tdf#130777 UI: add Hide legend entry option for pie chart
Follow-up of the following commits related to the new UNO property
DeletedLegendEntries for pie charts:

commit a96ec04a07c35338f5f9a0cb361b9322e5ca9cec
(tdf#130225 implement ODF export of deleted legend entries of pie
charts)

commit 86be3422cd55fa9e44104f1628648061bb6a3495
(tdf#129857 Chart OOXML export: fix deleted legend entries)

commit 6e847aa817999ab18acd534f9e6a86685bb268fc
(tdf#129859 XLSX import: don't show deleted legend entries)

Change-Id: I8b13823da745dfbfbf20f1d30f742c4baf803fc3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89456
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2020-03-03 13:30:54 +01:00
e17224501e Revert "Make Chart Creation Wizard async"
This reverts commit ed86b6250cd00ed6b7bdb81307bc66adba129cae.

Reason for revert: Most Jenkins builds for that change were aborted
after timing out, and many other Gerrit Jenkins and tinderbox builds
now time out, too.  It very much smells like that commit was the
culprit.

Change-Id: I5473c58957f92d63113e32f862ad9c114f9c844c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89803
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-03-03 05:52:55 +01:00
ed86b6250c Make Chart Creation Wizard async
* FuInsertChart as a memeber in ScTabViewShell
  stores instance is needed to react on the dialog's result
* CreationWizardUnoDlg converted to XAsynchronousExecutableDialog
  added dialog close handler which notifies listeners
  In the Online dialog become dead after closing, additional
  PostUserEvent was needed to kill the dialog after real close
  (without it user needed to select any cell to close dialog)
* Reuse in Writer

Change-Id: I9fe123d5c189d568f0edb4d36173a224a820a8a3
Reviewed-on: https://gerrit.libreoffice.org/79654
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/79571
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2020-03-02 10:30:52 +01:00
b7a1e92a27 loplugin:referencecasting
getting --enable-pch=normal working with clang
means that the plugins now have a better view on some
stuff, so trigger more warnings

Change-Id: I83ca010c0ef07c8106068362bb50a354e3cf7dae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89312
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-25 08:37:17 +01:00
1ec5204eb5 clang-format chart2 with under 5-percent lines of change
Change-Id: Ia60d23c7a75086c2a68e0e295b99a3df3dfd164f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88771
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-02-16 11:05:14 +01:00
f147b160ae clang-analyzer-deadcode.DeadStores
Change-Id: Ifa384933569b27d0d08eb479bb95b799163ae386
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88450
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-12 10:31:25 +01:00
1fb4887613 tdf#94234 Add Period as chart data label separator
Change-Id: I50b9662b22bdb10086e6aa557622566591135514
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88139
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
2020-02-07 18:47:21 +01:00
93670d6cb7 tdf#130389: Data ranges dialog, data series tab, move up/down reversed
Change-Id: I6a12acacec9bad33cab9fd86b0ffa7193ee74b75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87921
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2020-02-04 15:31:38 +01:00
0528012fd0 loplugin:constantparam
Change-Id: If2dee122bf07dc179fd8f6e766442ec1891a5f3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87845
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-03 10:53:01 +01:00
69e0d871ec make update_pch also consider files in <module>/src/**/inc
With --enable-pch=full there's not much difference between a "public"
header in <module>/inc and a private one in <module>/src/somewhere/inc .
And since the script searches recursively, this apparently helps to
find even more headers for lower pch levels.

Change-Id: I8483d0aa5b4fea5a59107c20a8aa5f1ef694af0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87799
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-02-01 20:12:21 +01:00
aef7feb3e6 New loplugin:unsignedcompare
"Find explicit casts from signed to unsigned integer in comparison against
unsigned integer, where the cast is presumably used to avoid warnings about
signed vs. unsigned comparisons, and could thus be replaced with
o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx)

o3tl::make_unsigned requires its argument to be non-negative, and there is a
chance that some original code like

  static_cast<sal_uInt32>(n) >= c

used the explicit cast to actually force a (potentially negative) value of
sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the
cast to avoid a false "signed vs. unsigned comparison" warning in a case where
n is known to be non-negative.  It appears that restricting this plugin to non-
equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=)
is a useful heuristic to avoid such false positives.  The only remainging false
positive I found was 0288c8ffecff4956a52b9147d441979941e8b87f "Rephrase cast
from sal_Int32 to sal_uInt32".

But which of course does not mean that there were no further false positivies
that I missed.  So this commit may accidentally introduce some false hits of the
assert in o3tl::make_unsigned.  At least, it passed a full (Linux ASan+UBSan
--enable-dbgutil) `make check && make screenshot`.

It is by design that o3tl::make_unsigned only accepts signed integer parameter
types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses
which would in general be suspicious.  But the STATIC_ARRAY_SELECT macro in
include/oox/helper/helper.hxx is used with both signed and unsigned types, so
needs a little oox::detail::make_unsigned helper function for now.  (The
ultimate fix being to get rid of the macro in the first place.)

Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-28 07:42:15 +01:00
b9fe4f26ea rename some local variables
mostly to make the job of my very aggressive unused local vars plugin
easier

Change-Id: Ifc21a920841f8589f8b7e10de39dba6622a5d501
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87399
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-26 08:01:13 +01:00
2f4dda0a26 Related: tdf#128942 remove the scrolledwindow frames from all the dialcontrols
Change-Id: I445753ad1eb4d441e5a5e909ae450bda6013a6b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87352
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-25 18:31:41 +01:00
df416b6919 rename LightControl3D back to Svx3DLightControl
Change-Id: I3e62bd55f195e9f652ddc21bff74f529a8678b5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87337
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2020-01-24 16:04:38 +01:00
7d55b62c1e rename LightCtl3D back to SvxLightCtl3D
Change-Id: I2cf5d019324643b048eea432753705af485720a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87336
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2020-01-24 16:02:12 +01:00
278f01eadd weld Svx3DWin
Change-Id: I472a4edb5ac7a8039d21128256c204e2969acc6a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87296
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2020-01-24 15:59:50 +01:00
b1d48a0e22 loplugin:makeshared in chart2..comphelper
Change-Id: Ia25f5de3167fd554d463ce6111e8c5b0e7842907
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87275
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-24 07:18:35 +01:00
83057749a9 Resolves: tdf#130045 dial control frame not hidden along with the control
Change-Id: Idcdf3d748849fbe1ba1a6cce278373e349ba1e5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86967
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-17 22:06:55 +01:00
dca52ec998 show degree symbol in DialControl linked spinbuttons
Change-Id: I792755f043109173606a78e947d5dc01f78c6849
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86982
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-17 20:18:14 +01:00
db54dd2351 clang-tidy modernize-concat-nested-namespace in chart2
Change-Id: I320234b60963d80f6870a9ce1fead8e29de437aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86759
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-14 18:09:25 +01:00
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
bda40b7eaa rename SvxDialControl back to DialControl
Change-Id: I4dcf12b6eccf18a0659c5d5f9cd58bd104c4dc6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85770
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-30 13:16:35 +01:00
d59987b164 loplugin:expandablemethods
Change-Id: I333d91ea5ce78c82e9bb107f934614efc7bfb8f7
Reviewed-on: https://gerrit.libreoffice.org/85078
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-13 08:12:45 +01:00
f853ec317f Extend loplugin:external to warn about classes
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend
loplugin:external to warn about enums".

Cases where free functions were moved into an unnamed namespace along with a
class, to not break ADL, are in:

  filter/source/svg/svgexport.cxx
  sc/source/filter/excel/xelink.cxx
  sc/source/filter/excel/xilink.cxx
  svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx

All other free functions mentioning moved classes appear to be harmless and not
give rise to (silent, even) ADL breakage.  (One remaining TODO in
compilerplugins/clang/external.cxx is that derived classes are not covered by
computeAffectedTypes, even though they could also be affected by ADL-breakage---
but don't seem to be in any acutal case across the code base.)

For friend declarations using elaborate type specifiers, like

  class C1 {};
  class C2 { friend class C1; };

* If C2 (but not C1) is moved into an unnamed namespace, the friend declaration
must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see
C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither
qualified nor a template-id and the declaration is a function or an
elaborated-type-specifier, the lookup to determine whether the entity has been
previously declared shall not consider any scopes outside the innermost
enclosing namespace.")

* If C1 (but not C2) is moved into an unnamed namespace, the friend declaration
must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882>
"elaborated-type-specifier friend not looked up in unnamed namespace".

Apart from that, to keep changes simple and mostly mechanical (which should help
avoid regressions), out-of-line definitions of class members have been left in
the enclosing (named) namespace.  But explicit specializations of class
templates had to be moved into the unnamed namespace to appease
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of
template from unnamed namespace using unqualified-id in enclosing namespace".

Also, accompanying declarations (of e.g. typedefs or static variables) that
could arguably be moved into the unnamed namespace too have been left alone.

And in some cases, mention of affected types in blacklists in other loplugins
needed to be adapted.

And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which
is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is
not moved into an unnamed namespace (because it is declared in
sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is.  GCC warns about
such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler
doesn’t give this warning for types defined in the main .C file, as those are
unlikely to have multiple definitions."
(<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>)  The
warned-about classes also don't have multiple definitions in the given test, so
disable the warning when including the .cxx.

Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4
Reviewed-on: https://gerrit.libreoffice.org/83239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-22 12:57:32 +01:00