Commit Graph
812 Commits
Author SHA1 Message Date
Noel Grandin 2c1ae17421 no need to allocate ControlLayoutData separately
Change-Id: I239befdaa05beea5200c81f23d0af861c9fc3baa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120177
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-08 22:32:12 +02:00
Noel Grandin 53840ffd97 Pass context and resource string down to boost::locale separately
because this is often on a hot path, and we can avoid the splitting and
joining of strings like this.

Create a new small index type TranslateId for some type-safety.

This change only updates accessibility to use the new API, other modules
will follow in stages.

Change-Id: I289245ad34fda775812302ca7ac1588710167b34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119632
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-29 09:22:30 +02:00
Michael Weghorn b5ada12ffd a11y: Add XAccessibleValue::getMinimumIncrement method
Add a method 'getMinimumIncrement' to the XAccessibleValue interface.
The method returns the minimal increment by which the value represented by
the object can be adjusted.

The main motivation is to expose this to AT-SPI, so it can be retrieved e.g.
by libatspi's 'atspi_value_get_minimum_increment' function [1],
s. the note in Change-Id: I8af326c2d24c1801147a56ea2e2a886ab42ac634
"a11y: Expose FormattedField as spinbox" for more details.

The implementation relevant for the 'FormattedField' class is in
'SVTXAccessibleNumericField::getMinimumIncrement', which returns
the spin size.

While at it, also move the comment in sw/source/core/access/acccell.hxx
mentioning what methods are overriden for the 'XAccessibleValue' interface
to the right place.

[1] https://developer.gnome.org/libatspi/stable/libatspi-atspi-value.html#atspi-value-get-minimum-increment

Change-Id: Ie148a4e1cedbdbb5964f8565c81611d3480465cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119596
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-07-28 15:45:28 +02:00
Michael Weghorn 349a8801b9 a11y: Expose FormattedField as spinbox
This adds a new accessibility class 'SVTXAccessibleNumericField'
that implements 'XAccessibleValue' and reports having an a11y
role of 'AccessibleRole::SPIN_BOX'. An object of that class
is returned by 'SVTXNumericField::CreateAccessibleContext'.

Create an 'SVTXNumericField' XWindow peer for windows
of type 'WindowType::FORMATTEDFIELD'
(instead of a 'VCLXNumericField' one), so the
newly introduced accessibility class gets used for
'FormattedField'.

This way, FormattedFields are now exposed to a11y tools
as spinboxes.

Previously, since no specific accessibility class
had been implemented for VCLXNumericField (then used as
XWindow peer class for FormattedField), the
one for VCLXEdit, i.e. VCLXAccessibleEdit, was used.

While VCLXNumericField implements XNumericField
and thus in general offers the relevant methods to implement
an accessible class that implements XAccessibleValue as well,
it uses the Formatter from the VCLXFormattedSpinField base class
to get/set values. However, that doesn't work for the FormattedField
case, since FormattedField has its own formatter of a different
type and the 'mpFormatter' member in the VCLXFormattedSpinField
base class is a nullptr, resulting in the corresponding
getter methods always returning 0 and the setters doing nothing.

With this commit in place, Accerciser now reports role
"spin box" instead of just "text" for FormattedFields
and displays the current value as well as allows to change
it via the "Value" interface when using the qt5/kf5 VCL plugin.

Note: For non-integer values, Accerciser doesn't show the actual
decimal value, but an integer, e.g. when the value for "Height"
spinbox in Writer's "Page Style" -> "Page" dialog (section "Paper
format") is set to "29.70cm", Accerciser shows "30" instead of
"29.70", despite 'Qt5AccessibleWidget::currentValue' returning
the exact value. This is because Accerciser appears to rely
on the value for the minimum increment being reported (as a
corresponding decimal value) by a call
to 'atspi_value_get_minimum_increment', s.[1].
However, there is currently no corresponding method in the
'XAccesibleValue' interface for that at-spi method which
'Qt5AccessibleWidget::currentValue' could call to retrieve
the value.

The NVDA screen reader on Windows now also says e.g.
"Width: (Type = 344)  spin button  editable  Alt+W  selected 8.50″"
instead of "Width: (Type = 344)  edit  Alt+W  selected 8.50″".

[1] https://developer.gnome.org/libatspi/stable/libatspi-atspi-value.html#atspi-value-get-minimum-increment

Change-Id: I8af326c2d24c1801147a56ea2e2a886ab42ac634
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119590
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-07-28 15:44:58 +02:00
Noel Grandin c2d73de5b5 convert AccessibleBrowseBoxObjType to scoped enum
Change-Id: Iaf764c905d080e4decabd853bd3847b34cb79cdd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118279
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-02 12:37:25 +02:00
Noel Grandin 0771ac00ac use string_view in the Translate API
Change-Id: I0bb0ea9d39ed623928060ffd3f2e2bc36ba33209
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117272
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-17 14:32:11 +02:00
Julien Nabet 3e8e5f079e Simplify Sequences initializations (accessibility/binaryurp)
Change-Id: I4b388b7faa1dc47f27d29aaaff9041fe81a29f71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116739
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-06-05 16:21:03 +02:00
Noel Grandin 32b09faca5 Revert "simplify the vcl<->toolkit connection"
because it introduces a link-time dependency of vcl on toolkit,
and toolkit already depends on vcl

This reverts commit f7a86c5cdf.

Change-Id: Ibdd4f3e8221d70e2abd8fcbda67f85af3ac0396e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115547
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-13 14:48:24 +02:00
Noel Grandin f7a86c5cdf simplify the vcl<->toolkit connection
No need to store two different pointers and hide the
underlying class behind an UNO interface

Change-Id: I72c55e912caa9eae1cffa6c9d1b1d480e5668d40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115496
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-12 19:57:24 +02:00
Noel Grandin e859bf8c4d loplugin:constmethod
Change-Id: I7913fd8144d521b8293ac43036d0fad82e457cd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115145
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-05 18:50:51 +02:00
Stephan Bergmann 10d29c390d throw() -> noexcept, part 2/3: Automatic loplugin:noexcept rewrite
Change-Id: I076f16d0536b534abf0ced4d76051eadb4c0e033
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114949
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-02 17:02:28 +02:00
Caolán McNamara 2577a6be55 forward decl vcl::Window in toolkit/awt/vclxwindow.hxx
Change-Id: I488f994fc890cacd20a6fdc224a098fe0caf3070
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113960
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-12 09:49:17 +02:00
Henry Castro f153be729e lok: remove event listener when disposing
In order to prevent that the event listener
holds the object reference count when removed,
ensure they are removed when disposing the object.

Change-Id: I7cb4cb7d87acfc9610c2498760ade531456fe22e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113493
Tested-by: Jenkins
Reviewed-by: Henry Castro <hcastro@collabora.com>
2021-04-08 13:58:11 +02:00
Noel 1692998399 use strong_int for item ids in vcl::ToolBox
(*) fix bug in SfxToolBoxControl::StateChanged where it was using the slot id
    instead of the toolbox item id
(*) I left the logic in SbaTableQueryBrowser alone, but it looks suspicious,
    casting slot ids to toolbox ids

Change-Id: Ied229164c27fb4456b0515c6fdcbd1682766a1a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112186
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-11 14:10:30 +01:00
Noel 04e7a34a19 loplugin:refcounting check for one more case
where we might be holding something newly created by pointer
instead of by *::Reference

Change-Id: Ife6f7acae4252bf56dcdeb95d72e43c523444f97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112138
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-08 07:37:26 +01:00
Noel 26d56470e6 loplugin:refcounting in accessibility
Change-Id: I0a17e149487cf05fb5e6d004a6402a2a5215a79b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111632
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-27 17:19:15 +01:00
Caolán McNamara c02696d7f9 forward declare some things and avoid includes
Change-Id: I8bf6e23904c932de646aa84fffab1b5549dbdf31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111349
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-22 20:26:08 +01:00
Noel 18aafdd0f9 loplugin:refcounting in accessibility
Change-Id: Ic9e780dc3f834e2e8b5d3a8d8445419a4bd050dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111300
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-22 13:39:58 +01:00
Noel fb6519ed62 loplugin:referencecasting in accessibility
Change-Id: If66b3c1829b02298b7c9c31172d2a66ad11dce30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110967
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-16 11:48:31 +01:00
Caolán McNamara 2b7a38bbf6 move Button to vcl/toolkit
Change-Id: I11e4fbab2e70342683febacf444fbe08dabf2417
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107346
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-06 12:17:22 +01:00
Caolán McNamara ddf8a2f91b TopLeft().Y() -> Top() etc.
TopLeft().X() -> Left()
BottomLeft().X() -> Left()
TopRight().X() -> Right()
BottomRight().X() -> Right()

TopLeft().Y() -> Top()
TopRight().Y() -> Top()
BottomLeft().Y() -> Bottom()
BottomRight().Y() -> Bottom()

Change-Id: I5050f619bf92cfc59b6f8dfe7c9f98ef1453c294
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110022
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-28 11:55:30 +01:00
Noel Grandin 1aa31294b2 avoid some ref-counting
can just return a pointer here, instead of VclPtr.

Change-Id: I9ab8962cbbe84ed4dfcfd658a6d758112914cb89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109923
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-25 20:21:48 +01:00
Caolán McNamara a8f6a87224 constant 'Focused object has invalid index in parent' a11y warning
clicking in a cell in the databrowser always produces a11y warnings,
the EditBrowseBoxTableCell parent was set to AccessibleBrowseBoxAccess
but AccessibleBrowseBoxAccess cannot find it as a child. It appears
to be constructed with an EditBrowseBoxTableCellAccess as parent,
changing this to reflect that ownership results in no more warnings

Change-Id: Icdbf7157511ab606bf564f2f48df3a02bd7ede88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109759
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-21 20:38:28 +01:00
Caolán McNamara 25214daa34 don't need to include vcl/menu.hxx here
Change-Id: I16c4c2fd84ea8af6b7601e49c38630bbbfdb2cb6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107746
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-15 13:41:42 +01:00
Noel d6d80c4e17 OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTION
Change-Id: I6800e23ead2767d245d5da71d2d40e0f8a6d7e1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106859
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-01 09:28:52 +01:00
Arnaud Versini 613c55115a a11y : avoid double locking
Change-Id: I1348fb33b9c93d54cd128bf6ac56a3c4c57eec3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106806
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-29 10:59:57 +01:00
Noel bb06f51308 loplugin:stringviewparam extend to comparison operators
which means that some call sites have to change to use
unicode string literals i.e. u"foo" instead of "foo"

Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-24 09:45:04 +01:00
Caolán McNamara 0945e840a4 move RadioButton to be toolkit only
Change-Id: Ie548ad3c471745297242a390fd2e500fa699de19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105836
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-20 21:20:43 +01:00
Noel 8ef6067596 loplugin:stringviewparam check methods too
not just functions

Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-17 09:57:35 +01:00
Philipp Hofer b53fa6344d tdf#123936 Formatting file in module accessibility with clang
Change-Id: I9ac4df1ecc3ea1d48f3961fa95f34207dab8976e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105411
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2020-11-10 12:44:40 +01:00
Gabor Kelemen 0505a00a9b tdf#42949 Fix new IWYU warnings in directories [ab]*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: Ib0008b9bb095f27e5e436d6b507dc709ab7bf01a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105313
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-05 14:57:25 +01:00
Noel 915c7529e9 use tools::Long in accessibility..basctl
Change-Id: I67087c7a281e5bdecbaf227bd3147e7c12828791
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104587
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-21 14:34:01 +02:00
Caolán McNamara cef50b5266 move Edit into toolkit only headers
Change-Id: If51bf7143116721e8f16272cf8aff797651d5ed1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101880
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-02 12:52:26 +02:00
Caolán McNamara 7541fac2c0 tdf#136331 implement applying atk properties to tab pages
Change-Id: I2ee57dbdb3d743fe1dd3d505a3aa2f479ffa62b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101765
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-02 09:37:08 +02:00
Caolán McNamara 45649f44ca SvtIconChoiceCtrl can move into toolkit only headers
Change-Id: Ice3c01019d3e961c0ef1dce7d3eaf4f602269fff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101488
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-27 20:14:21 +02:00
Caolán McNamara 7d0279121f tdf#136162 implement applying atk properties to gen menus
Change-Id: I77dbc21910b01524d281869a83d9d12efd419bf6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101446
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-27 14:33:23 +02:00
Caolán McNamara cee0a2a93e move VclMultiLineEdit to toolkit-only headers
Change-Id: I2e8728061e484f79768fcfe67d674cb76367a94d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100951
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-19 10:12:19 +02:00
Andrea Gelmini d7484b08c6 Fix typos
Change-Id: Id31299912b822baf9eecbb03cba53339f0528ae8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100867
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-17 19:42:42 +02:00
Caolán McNamara 70a008181a SvTreeListBox can move into toolkit headers now
Change-Id: I6b3b6ef1530a192f4b6bf87aa9688687063683ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100591
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-12 20:23:20 +02:00
Caolán McNamara 4ddafa14d7 svlbitm.hxx can be toolkit only now
Change-Id: Ie5ad0febca0747fa66c2caede619d14e468da032
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100498
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-12 20:22:57 +02:00
Caolán McNamara bcea211b66 move CheckBox to toolkit-only headers
Change-Id: Id1b2dd11bd0ebd9c88cf7e86d990a1990d760b2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98605
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-12 20:28:56 +02:00
Stephan Bergmann 80f92c3ce3 Upcoming improved loplugin:staticanonymous -> redundantstatic: accessibility
Change-Id: Ibb44e313924970319c3409323160ca7f5a6d184e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97519
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-30 18:29:06 +02:00
Caolán McNamara 501c8d64b5 move ListBox to toolkit-only headers
Change-Id: I6266dedb17cd7c3b730fc69804695536fef37cfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96751
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-06-23 12:50:52 +02:00
Arnaud Versini 970ca51795 accessibility : don't initialize manually VclPtr
Change-Id: Iee3bbe796dfc8a4e8bc15447a6a54a5c33160494
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96812
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-21 22:02:08 +02:00
Caolán McNamara a854500861 PopupMenuFloatingWindow is now unused
Change-Id: Ie8fa026becb1899e466fb0e7dbb987290788aaf2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96207
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-06-12 20:13:46 +02:00
Noel Grandin 054c0e7177 loplugin:simplifypointertobool improve
to look for the
    x.get() != null
pattern, which can be simplified to
    x

I'll do the
   x.get() == nullptr
pattern in a separate patch, to reduce the chances of a mistake

Change-Id: I45e0d178e75359857cdf50d712039cb526016555
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95354
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-03 10:51:57 +02:00
Noel Grandin 5f19287a9c loplugin:simplifybool in accessibility..basic
Change-Id: Ibf6cef4baa2d3d400d953ac8bc97a66b5901def9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94972
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-28 09:05:11 +02:00
Caolán McNamara 4a231d1fc1 move ComboBox to toolkit-only headers
Change-Id: If5f0ab1fba8fa7302b7c0e8d2b25761ab64c97e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94143
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-20 20:24:32 +02:00
Colomban WendlingandMartin Pieuchot b46a0a7f9f tdf#118418 implement scrollSubstringTo() for gtk
Define & use new accessibility scroll type compatible with IAccessible2
and extend the XAccessibleText interface to require scrollSubstringTo().

Co-authored-by: Martin Pieuchot <mpi@grenadille.net>
Change-Id: Id3b2e8616892d7dcbfb41a14b72a8a457fd1dbf6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89851
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-07 12:11:33 +02:00
Stephan Bergmann b512ce255f Make upcasting css::uno::Reference ctor require complete types
The main reason for the "home-grown" UpCast introduced with
904b3d1fce "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 39a1edd6fe "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