Use Q_* macros.

This way we won't conflict with boosts signals and slots.

Change-Id: Ia92b283a5b47b7bc8c2bec2c6be664c9b7f1bed8
Reviewed-on: https://gerrit.libreoffice.org/6682
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
(cherry picked from commit 2e6a17ac88e89d4db8491605ac4dd6ea249b5d01)
Drop processYield return type.

The virtual Yield function has no return type, and the result of
processYield is actually never used => drop it.

Change-Id: I3da7bc99fd8f56301da37ca196b03b34cdc84a40
Reviewed-on: https://gerrit.libreoffice.org/6684
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit bee6b3e6dad729263d10daf1550826871c57fe05)
Redirect file picker UI processing to GUI thread.

If a KDE4FilePicker is opened via an remote UNO call, e.g. via
a RPC Java call, a JVM is started in a new thread to handle the
call.

This was creating the KDE4FilePicker in the non-UI JVM process,
which crashes LibreOffice.

Therefore we redirect the processing of all FilePicker calls to
the main thread.

This fixes fdo#71145.

Reviewed-on: https://gerrit.libreoffice.org/6683
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit fa8b5ae8e24fe26de7b26eff8a4a523ab22408fa)

Conflicts:
	vcl/unx/kde4/KDE4FilePicker.cxx
	vcl/unx/kde4/KDE4FilePicker.hxx

Change-Id: If6ec2d205af5a883df35fddb44a12ac43e3560f0
Rewrite Qt4 based nested yield mutex locking.

The Qt event loop may start a nested event loop, when checking for
clipboard and Drag'n'Drop events.

Previously this was handled by running this nested yield loop
inside the main glib loop using
  qApp->clipboard()->property( "useEventLoopWhenWaiting" );

But this results in nested paint events which crash LO:
  QWidget::repaint: Recursive repaint detected

To prevend yield mutex deadlocks, check for nested event loops
and always release the yield lock before starting the nested Yield
event loop.

This fixes fdo#69002.

Change-Id: I7e827abd3489783053ec7123372742a32555875d
Reviewed-on: https://gerrit.libreoffice.org/6685
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Thorsten Behrens <thb@documentfoundation.org>
Tested-by: Thorsten Behrens <thb@documentfoundation.org>
(cherry picked from commit 13a34f4c6307d1bd2443cbf3fbd83bfdd8cdbafb)
fdo#72521 fdo#73103 Fix editable combo-boxes behavior under KDE4

Change-Id: I92a781a1e0f0adcb779155f8c477595e0dd762b1
Reviewed-on: https://gerrit.libreoffice.org/7287
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Tested-by: Jan-Marek Glogowski <glogow@fbihome.de>
(cherry picked from commit a62a80ac6cc0e337f4ff6d862bccc13c720d41ac)
Simplify control item switch statements

Just check the dynamic_cast result to verify check boxes.

Change-Id: I5f370e337e12719eb7ef0dd3512a0f46c76a981e
(cherry picked from commit 24e8b90d8a2864cfb60d3a5046be39410efe5c51)
fdo#72187 Implement KDE4 picker notifications

This notifies the XFilePickerListener of filter changes and file
selection changes.

(cherry picked from commit a8d102c2406b8c027afb32d61271e0a2c301f133)

Conflicts:

	vcl/unx/kde4/KDE4FilePicker.cxx

Change-Id: I749c5f7420f020a3a2fbb764acb5c45d40972cf1
Fix minimal VCL menu item height with icons

Don't reset the calculated minimal menu item height to the icon
height, if the minimal height is already larger then the icon height.

Change-Id: Ifcd6c750352c4d3f754a693df7254a4654a8afe6
(cherry picked from commit 56bea42176e5f0b850da0bab410dda560fc89255)
fix and simplify getting files from the KDE4 file dialog

- Fix multiple selection handling.
- The "double click selection KDE4 bug" does not exist (anymore?) as far
  as I can tell.
- Apparently it's not true that multiselect needs the first item in the list
  to be the directory.
- KFileDialog can already give full URLs.

(cherry picked from commit 03f666103d80f7a0c79150dae2367079b80e50a6)

Conflicts:

	vcl/unx/kde4/KDE4FilePicker.cxx

Change-Id: I5bb651902fb6c1d75af40b78bf32c79b004b7358
KDE4: Drop Qt 4.9 support

I don't think there will ever be any 4.9 release, so drop all the
unused code.

Change-Id: I4b72de96e6064240582cd83d4e45547096a2efb0
(cherry picked from commit 7b083444942b1d5890b51a1f4a8560ba4e411e46)
KDE4: Report correct check and radio item sizes

Use the correct sizs from the current style.

Change-Id: I7e163bdc8d467baf2d6e3d0d2bc3e1da7558cf42
(cherry picked from commit c11deb60cabfa8e7ee511b94abb0e19601b42fe6)
KDE4: evaluate frameWidth in the Qt thread

When opening a document via Java UNO without a running LO instance, one
gets the following Qt error messages:

CE>  QObject: Cannot create children for a parent that is in a different thread.
CE>  (Parent is Oxygen::WidgetStateEngine(0x8deb878), parent's thread is QThread(0x8d6cf70), current thread is QThread(0xa8fa7fc8)
CE>  QObject::installEventFilter(): Cannot filter events for objects in a different thread.
CE>  QObject::installEventFilter(): Cannot filter events for objects in a different thread.
CE>  QObject::installEventFilter(): Cannot filter events for objects in a different thread.

This happens, because the Java UNO call is processed in the first /
Qt thread while document loading happens in a second thread.

Document loading actually just calls getNativeControlRegion, which
should not involve any drawing. But the KDE4 backend does some style
processing to get the correct frame width (QWidget::ensurePolished(),
which uses GUI based events and need to be processed in the Qt
thread.

Change-Id: I344d5089d958963c48a9a8a84bfa9fe8f092b75a
(cherry picked from commit 7163d64b90ac4d4259b1d0379cfca348dd30601c)
fdo#45935: try hard to paint a frame for menus

Current Oxygen theme doesn't draw frames for menus, but uses shaped
and "colored" background images. This workaround paints the window
and menu frame for menus. Any frame seems to be better then no frame
at all.

Change-Id: I4d553ea58cac2729826f8395cb2597fa200187b6
(cherry picked from commit e72849cd435cc50a744dcbcfb422f5600dd0cce9)
fdo#73115: Always run timeouts as events

Right-click popup menus run click events throught the LO main loop.
In case of KDE4 the LO main loop is run by a timer in the main thread,
with Qt::DirectConnection execution.

If the timeout actually starts a nested event loop for a new dialog,
the timer is blocked, the nested mainloop detects it was started
from the timeout and drops the blocked timout from polling, which
blocks any further LibreOffice event loop processing.

This changes the timers to Qt::QueuedConnection, so they always
generate an event and are processed by the Qt event loop.

Change-Id: Ie626b22be3d8f9b8934bcc5e9e0e67a365549cfc
(cherry picked from commit aeda478a02523cec146f6af69710f0391061db56)
Revert "Rewrite Qt4 based nested yield mutex locking."

This reverts the unx/kde4/KDEXLib.cxx part of

commit 13a34f4c6307d1bd2443cbf3fbd83bfdd8cdbafb.

Conflicts:

	vcl/unx/kde4/KDE4FilePicker.cxx
	vcl/unx/kde4/KDEXLib.cxx

Change-Id: Ica8a0f678f080ae7d763bb7da7761d20ceec328c
(cherry picked from commit daf011870efae282244c0298494820d9a0c6d3bc)
KDE4: change eventLoopType enum to glib bool

Just check for glib; it's the default in later Qt4 versions on unix.

Change-Id: Ia99466e9010eb835bea0c3c4420da3c8b3cd4671
(cherry picked from commit 516a8dedac9c3cb77cd26a740cf793b1cab920d0)
KDE4: add Qt4 glib ExcludeSocket runtime check

Add a runtime check and configure warning to disable KDE4 native
file pickers, if the Qt4 glib dispatcher doesn't honor the
QEventLoop::ExcludeSocketNotifiers flag.

This way polling the QClipboard using the event loop won't
crash LibreOffice with recursive paint events,

See https://bugreports.qt-project.org/browse/QTBUG-37380

(cherry picked from commit cc8d566d74a2e0b969b92d9cf22cc95a3bf31a98)

Conflicts:

	configure.ac

Change-Id: I5cad30ead74571e49a075c084cca7a19acff7523
KDE4: prevent blocking in Display::Yield

SalX11Display registers a Yield handler, which splits check and
and processing into two functions, which both lock the yield mutex.

Normally this no problem, but during a Drag'n'Drop operation the
D'n'D thread also checks and processes XEvents (for D'n'D). So the
XNextEvent in Display::Yield will actually block, if the seen XEvent
was for D'n'D and was already processed.

Change-Id: I9f8d96d4f9986997cbe150a2b66bc767b4bbc2f1
(cherry picked from commit 6c7374f071d998f726cd4a5b67baf54e357d096b)