core.git: shell/source

2024-05-31 Thread Michael Weghorn (via logerrit)
 shell/source/backends/kf5be/kfaccess.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit eff8497fa2ab9c0e4889e1cf38fdeff1b2ec195a
Author: Michael Weghorn 
AuthorDate: Thu May 30 14:29:05 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 31 14:29:01 2024 +0200

kf5be: Make fromQStringToOUString work for Qt 6

Sync `fromQStringToOUString` with the `toOUString`
implementation in `vcl/inc/qt5/QtTools.hxx`, which
makes it work with Qt 6 as well.

Without this, building this with a planned upcoming
change that introduces a KF 6 desktop backend would fail
like this:

In file included from 
/home/user/development/git/libreoffice/shell/source/backends/kf6be/kfaccess.cxx:10:

/home/user/development/git/libreoffice/shell/source/backends/kf6be/../kf5be/kfaccess.cxx:53:60:
 error: non-constant-expression cannot be narrowed from type 'qsizetype' (aka 
'long long') to 'sal_Int32' (aka 'int') in initializer list [-Wc++11-narrowing]
   53 | return { reinterpret_cast(s.utf16()), 
s.size() };
  |
^~~~

/home/user/development/git/libreoffice/shell/source/backends/kf6be/../kf5be/kfaccess.cxx:53:60:
 note: insert an explicit cast to silence this issue
   53 | return { reinterpret_cast(s.utf16()), 
s.size() };
  |
^~~~
  |
static_cast( )

Change-Id: Ic2b1ddcaa290379187db69b33e4a700c148650e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168275
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/shell/source/backends/kf5be/kfaccess.cxx 
b/shell/source/backends/kf5be/kfaccess.cxx
index 93fe1ed49b20..498fb9e1efb5 100644
--- a/shell/source/backends/kf5be/kfaccess.cxx
+++ b/shell/source/backends/kf5be/kfaccess.cxx
@@ -47,10 +47,9 @@ namespace uno = css::uno;
 
 namespace
 {
-OUString fromQStringToOUString(QString const& s)
+OUString fromQStringToOUString(const QString& s)
 {
-// Conversion from QString size()'s int to OUString's sal_Int32 should be 
non-narrowing:
-return { reinterpret_cast(s.utf16()), s.size() };
+return OUString(reinterpret_cast(s.data()), 
s.length());
 }
 }
 


core.git: 2 commits - shell/IwyuFilter_shell.yaml shell/Library_kf5be.mk shell/source

2024-05-31 Thread Michael Weghorn (via logerrit)
 shell/IwyuFilter_shell.yaml   |4 ++--
 shell/Library_kf5be.mk|4 ++--
 shell/source/backends/kf5be/kfaccess.cxx  |4 ++--
 shell/source/backends/kf5be/kfaccess.hxx  |7 ++-
 shell/source/backends/kf5be/kfbackend.cxx |6 +++---
 5 files changed, 11 insertions(+), 14 deletions(-)

New commits:
commit 9214b80fe67f6771a4120b6eeaddd85cea1d6f2a
Author: Michael Weghorn 
AuthorDate: Thu May 30 13:57:03 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 31 14:28:52 2024 +0200

kf: Drop "5" from KF 5 desktop backend file names

... and namespace.

This is in preparation of implementing a KF 6
backend that will reuse most of the code.

Change-Id: I0c0f499ff57dd18e7e0bc7dd838acfeffa30d88c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168274
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/shell/IwyuFilter_shell.yaml b/shell/IwyuFilter_shell.yaml
index 755dc738343e..5239593d0ee0 100644
--- a/shell/IwyuFilter_shell.yaml
+++ b/shell/IwyuFilter_shell.yaml
@@ -4,7 +4,7 @@ excludelist:
 shell/source/sessioninstall/SyncDbusSessionHelper.hxx:
 # No hpp->hdl replacement
 - org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp
-shell/source/backends/kf5be/kf5access.cxx:
+shell/source/backends/kf5be/kfaccess.cxx:
 # Keep abstract QT headers
 - QtCore/QDir
 - QtCore/QStandardPaths
@@ -12,7 +12,7 @@ excludelist:
 - QtCore/QUrl
 - QtGui/QFont
 - QtGui/QFontDatabase
-shell/source/backends/kf5be/kf5backend.cxx:
+shell/source/backends/kf5be/kfbackend.cxx:
 # Keep abstract QT headers
 - QtWidgets/QApplication
 shell/source/backends/localebe/localebackend.cxx:
diff --git a/shell/Library_kf5be.mk b/shell/Library_kf5be.mk
index 1355d402dc00..dfcac91f871a 100644
--- a/shell/Library_kf5be.mk
+++ b/shell/Library_kf5be.mk
@@ -25,8 +25,8 @@ $(eval $(call gb_Library_use_libraries,kf5be1,\
 $(eval $(call 
gb_Library_set_componentfile,kf5be1,shell/source/backends/kf5be/kf5be1,services))
 
 $(eval $(call gb_Library_add_exception_objects,kf5be1,\
-shell/source/backends/kf5be/kf5access \
-shell/source/backends/kf5be/kf5backend \
+shell/source/backends/kf5be/kfaccess \
+shell/source/backends/kf5be/kfbackend \
 ))
 
 # Workaround for clang+icecream (clang's -frewrite-includes
diff --git a/shell/source/backends/kf5be/kf5access.cxx 
b/shell/source/backends/kf5be/kfaccess.cxx
similarity index 99%
rename from shell/source/backends/kf5be/kf5access.cxx
rename to shell/source/backends/kf5be/kfaccess.cxx
index d266f147d68a..93fe1ed49b20 100644
--- a/shell/source/backends/kf5be/kf5access.cxx
+++ b/shell/source/backends/kf5be/kfaccess.cxx
@@ -19,7 +19,7 @@
 
 #include 
 
-#include "kf5access.hxx"
+#include "kfaccess.hxx"
 
 #include 
 #include 
@@ -38,7 +38,7 @@
 #include 
 #include 
 
-namespace kf5access
+namespace kfaccess
 {
 namespace
 {
diff --git a/shell/source/backends/kf5be/kf5access.hxx 
b/shell/source/backends/kf5be/kfaccess.hxx
similarity index 98%
rename from shell/source/backends/kf5be/kf5access.hxx
rename to shell/source/backends/kf5be/kfaccess.hxx
index bb4817c38cf5..2bbd5ad4887b 100644
--- a/shell/source/backends/kf5be/kf5access.hxx
+++ b/shell/source/backends/kf5be/kfaccess.hxx
@@ -30,7 +30,7 @@ namespace com::sun::star::uno
 class Any;
 }
 
-namespace kf5access
+namespace kfaccess
 {
 css::beans::Optional getValue(std::u16string_view id);
 }
diff --git a/shell/source/backends/kf5be/kf5backend.cxx 
b/shell/source/backends/kf5be/kfbackend.cxx
similarity index 97%
rename from shell/source/backends/kf5be/kf5backend.cxx
rename to shell/source/backends/kf5be/kfbackend.cxx
index 7a90dfdcdffd..81a48ad53ffe 100644
--- a/shell/source/backends/kf5be/kf5backend.cxx
+++ b/shell/source/backends/kf5be/kfbackend.cxx
@@ -46,7 +46,7 @@
 #include 
 #include 
 
-#include "kf5access.hxx"
+#include "kfaccess.hxx"
 
 namespace
 {
@@ -144,14 +144,14 @@ void readKDESettings(std::map>& rS
 
 for (const OUString& aKey : aKeys)
 {
-css::beans::Optional aValue = kf5access::getValue(aKey);
+css::beans::Optional aValue = kfaccess::getValue(aKey);
 std::pair> elem
 = std::make_pair(aKey, aValue);
 rSettings.insert(elem);
 }
 }
 
-// init the QApplication when we load the kf5backend into a non-Qt vclplug 
(e.g. gtk3_kde5)
+// init the QApplication when we load the kfbackend into a non-Qt vclplug 
(e.g. gtk3_kde5)
 // TODO: use a helper process to read these values without linking to Qt 
directly?
 // TODO: share this code somehow with Qt5Instance.cxx?
 void initQApp(std::map>& 
rSettings)
commit cc733542fecc2e63bc794559dfa6320d788e9254
Author:     Michael Weghorn 
AuthorDate: Thu May 30 13:48:35 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 31 14:28:44 2024 +0200

tdf#143148 kf: Use pragma once in kf5access.hxx

C

core.git: avmedia/CustomTarget_avmediaqt6_moc.mk avmedia/Library_avmediaqt6.mk avmedia/source

2024-05-31 Thread Michael Weghorn (via logerrit)
 avmedia/CustomTarget_avmediaqt6_moc.mk |1 
 avmedia/Library_avmediaqt6.mk  |1 
 avmedia/source/qt6/QtFrameGrabber.cxx  |  106 +
 avmedia/source/qt6/QtFrameGrabber.hxx  |   50 +++
 avmedia/source/qt6/QtPlayer.cxx|9 ++
 5 files changed, 166 insertions(+), 1 deletion(-)

New commits:
commit f04e711ea34ad3ad5ee642047be5d56a18fa0b53
Author: Michael Weghorn 
AuthorDate: Thu May 30 13:24:02 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 31 09:24:01 2024 +0200

tdf#145735 qt avmedia: Implement frame grabber

Add a new `QtFrameGrabber` class that implements
the `css::media::XFrameGrabber` interface and
return an instance of it in
`QtPlayer::createFrameGrabber`.

As there seems to be no direct way to retrieve
the image/frame of a video at a certain point
in time, create a separate `QMediaPlayer` instance
for the `QtFrameGrabber`, set a video sink, connect
to its `::videoFrameChanged` signal and
start playing the video (and stop it again once the
first frame has been received) in order to retrieve
a corresponding frame.

From that `QVideoFrame`, a `QImage` can be retrieved
that can then be converted to an `XGraphic`.

With this in place, a frame from the actual video
is now displaced in Impress in non-presentation
mode instead of just a generic "video icon" placeholder
when opening a presentation containing a video,
(e.g. attachment 145517 from tdf#120452) when the
qt6 VCL plugin is in use.

Change-Id: I3bba3c0fb62a219ac632ceed03ec17f9078f18d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168255
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/avmedia/CustomTarget_avmediaqt6_moc.mk 
b/avmedia/CustomTarget_avmediaqt6_moc.mk
index 0f9ca1af23b6..6cce5d258323 100644
--- a/avmedia/CustomTarget_avmediaqt6_moc.mk
+++ b/avmedia/CustomTarget_avmediaqt6_moc.mk
@@ -10,6 +10,7 @@
 $(eval $(call gb_CustomTarget_CustomTarget,avmedia/source/qt6))
 
 $(call gb_CustomTarget_get_target,avmedia/source/qt6) : \
+   $(gb_CustomTarget_workdir)/avmedia/source/qt6/QtFrameGrabber.moc \
$(gb_CustomTarget_workdir)/avmedia/source/qt6/QtPlayer.moc
 
 
diff --git a/avmedia/Library_avmediaqt6.mk b/avmedia/Library_avmediaqt6.mk
index a1acb7568d02..86b4553e1add 100644
--- a/avmedia/Library_avmediaqt6.mk
+++ b/avmedia/Library_avmediaqt6.mk
@@ -37,6 +37,7 @@ $(eval $(call gb_Library_use_libraries,avmediaqt6,\
 
 $(eval $(call gb_Library_add_exception_objects,avmediaqt6,\
avmedia/source/qt6/gstwindow \
+   avmedia/source/qt6/QtFrameGrabber \
avmedia/source/qt6/QtManager \
avmedia/source/qt6/QtPlayer \
 ))
diff --git a/avmedia/source/qt6/QtFrameGrabber.cxx 
b/avmedia/source/qt6/QtFrameGrabber.cxx
new file mode 100644
index ..58726d649af0
--- /dev/null
+++ b/avmedia/source/qt6/QtFrameGrabber.cxx
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "QtFrameGrabber.hxx"
+#include 
+
+using namespace ::com::sun::star;
+
+namespace
+{
+inline OUString toOUString(const QString& s)
+{
+return OUString(reinterpret_cast(s.data()), 
s.length());
+}
+
+uno::Reference toXGraphic(const QImage& rImage)
+{
+QByteArray aData;
+QBuffer aBuffer();
+rImage.save(, "PNG");
+
+SvMemoryStream aStream(aData.data(), aData.size(), StreamMode::READ);
+vcl::PngImageReader aReader(aStream);
+Graphic aGraphic;
+aReader.read(aGraphic);
+
+return aGraphic.GetXGraphic();
+}
+}
+
+namespace avmedia::qt
+{
+QtFrameGrabber::QtFrameGrabber(const QUrl& rSourceUrl)
+: m_bWaitingForFrame(false)
+{
+m_xMediaPlayer = std::make_unique();
+m_xMediaPlayer->setSource(rSourceUrl);
+
+m_xVideoSink = std::make_unique();
+m_xMediaPlayer->setVideoSink(m_xVideoSink.get());
+
+connect(m_xMediaPlayer.get(), ::errorOccurred, this,
+::onErrorOccured, Qt::BlockingQueuedConnection);
+}
+
+void QtFrameGrabber::onErrorOccured(QMediaPlayer::Error eError, const QString& 
rErrorString)
+{
+std::lock_guard aLock(m_aMutex);
+
+SAL_WARN("avmedia", "Media playback error occured when trying to grab 
frame: "
+<< toOUString(rErrorString) << ", code: " << 
eError);
+
+m_bWaitingForFrame = false;
+}
+
+void QtFrameGrabber::onVideoFrameChanged(const QVideoFrame& rFrame)
+{
+std::lock_guard aLock(m_aMutex)

core.git: vcl/unx

2024-05-29 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 405cf00e4818886b0d3053d03cfb2e3f3a5e8eb8
Author: Michael Weghorn 
AuthorDate: Tue May 28 11:50:12 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed May 29 09:47:21 2024 +0200

related tdf#160971 gtk3 a11y: Keep new combobox value

Selecting a new value in an editable combobox using
the gtk3 VCL plugin using the popup didn't work when
that popup was opened using the keyboard, sample
scenario:

1) Start Writer
2) Press F6 until the Formatting toolbar has focus
3) Press Tab until the "Font Name" combobox has focus
4) Press Alt+Down to open the combobox popup
5) Press Down key a few times to select another font, e.g.
   "Carlito"
6) Press Enter to confirm

Rather than the newly selected font, the previously
set one would still be set in the combobox.

Selecting a new font using the popup would work however
when clicking the combobox's button using the mouse
instead of steps 1-4 above.

The problem was that restoring focus was resulting
in the newly selected value not getting saved.

Backtrace for how the value already got properly saved
for the case where the button was previously clicked
using the mouse:

1 weld::ComboBox::save_value weld.hxx 853 0x7f19a7af3f81
2 FontNameBox::save_value ctrlbox.hxx 369 0x7f19a7b01f3d
3 (anonymous namespace)::SvxFontNameBox_Base::statusChanged_Impl 
tbcontrl.cxx 3432 0x7f19a7ad95e0
4 (anonymous namespace)::SvxFontNameToolBoxControl::statusChanged 
tbcontrl.cxx 3439 0x7f19a7ad8312
5 SfxStatusDispatcher::sendStatusChanged(rtl::OUString const&, 
com::sun::star::frame::FeatureStateEvent 
const&)::$_0::operator()(com::sun::star::uno::Reference
 const&) const unoctitm.cxx 132 0x7f19a98ae241
6 
comphelper::OInterfaceContainerHelper4::forEach(std::unique_lock&, 
SfxStatusDispatcher::sendStatusChanged(rtl::OUString const&, 
com::sun::star::frame::FeatureStateEvent const&)::$_0 const&) const 
interfacecontainer4.hxx 304 0x7f19a98a4411
7 SfxStatusDispatcher::sendStatusChanged unoctitm.cxx 129 0x7f19a98a42aa
8 SfxDispatchController_Impl::sendStatusChanged unoctitm.cxx 802 
0x7f19a98a907c
9 SfxDispatchController_Impl::StateChanged unoctitm.cxx 885 
0x7f19a98a987a
10 SfxStateCache::SetState_Impl statcach.cxx 424 0x7f19a98308cc
11 SfxStateCache::SetState statcach.cxx 328 0x7f19a98306f2
12 SfxBindings::UpdateControllers_Impl bindings.cxx 1211 0x7f19a97aeffd
13 SfxBindings::Update_Impl bindings.cxx 274 0x7f19a97ae5cf
14 SfxBindings::Update bindings.cxx 353 0x7f19a97af682
15 SfxDispatcher::Call_Impl dispatch.cxx 280 0x7f19a97c731c
16 SfxDispatcher::Execute_ dispatch.cxx 753 0x7f19a97cbc4b
17 SfxDispatcher::Execute dispatch.cxx 812 0x7f19a97cc02f
18 SfxDispatchController_Impl::dispatch unoctitm.cxx 671 0x7f19a98a6673
19 SfxOfficeDispatch::dispatch unoctitm.cxx 250 0x7f19a98a511a
20 SfxToolBoxControl::Dispatch tbxitem.cxx 253 0x7f19a9df168f
21 (anonymous namespace)::SvxFontNameBox_Base::Select tbcontrl.cxx 2007 
0x7f19a7adb44a
22 (anonymous namespace)::SvxFontNameBox_Base::SelectHdl tbcontrl.cxx 
1962 0x7f19a7adafb4
23 (anonymous namespace)::SvxFontNameBox_Base::LinkStubSelectHdl 
tbcontrl.cxx 1960 0x7f19a7adab9d
24 Link::Call link.hxx 111 0x7f199a19ddd8
25 weld::ComboBox::signal_changed weld.hxx 731 0x7f199a19dd8c
26 (anonymous namespace)::GtkInstanceComboBox::fire_signal_changed 
gtkinst.cxx 21229 0x7f199a0e1880
27 (anonymous namespace)::GtkInstanceComboBox::handle_row_activated 
gtkinst.cxx 21891 0x7f199a0e17f9
28 (anonymous namespace)::GtkInstanceComboBox::signalRowActivated 
gtkinst.cxx 21876 0x7f199a0dd299
29 ?? 0x7f1999695931
30 ?? 0x7f19a87b4939
31 ?? 0x7f19a87ca33f
32 g_signal_emit_valist 0x7f19a87cff06
33 g_signal_emit 0x7f19a87cffc3
34 ?? 0x7f13384b
35 ?? 0x7f1999697085
36 ?? 0x7f19a87b4939
37 ?? 0x7f19a87ca33f
38 g_signal_emit_valist 0x7f19a87cff06
39 g_signal_emit 0x7f19a87cffc3
40 ?? 0x7f19997b317e
41 g_cclosure_marshal_VOID__BOXEDv 0x7f19a87b7b76
42 ?? 0x7f19a87b4939
43 ?? 0x7f19a87ca33f
44 g_signal_emit_valist 0x7f19a87cff06
45 g_signal_emit 0x7f19a87cffc3
46 ?? 0x7f19997b0213
47 ?? 0x7f19997b1803
48 ?? 0x7f19997b4a42
49 gtk_event_controller_handle_event 0x7f1999779361
50 ?? 0x7f1488bd
51 ?? 0x7f1999690db8
52 ?? 0x7f19a87b4939
53 ?? 0x7f19a87c9693
54 g_signal_emit_valist 0x7f19a87cff06
55 g_signal_emit 0x7f19a87cffc3
56 ?? 0x7f14a314
5

core.git: accessibility/source

2024-05-29 Thread Michael Weghorn (via logerrit)
 accessibility/source/extended/accessibleiconchoicectrl.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit ceca4cde363154b0c7e276d65fc87ec94eb0bb9a
Author: Michael Weghorn 
AuthorDate: Tue May 28 15:07:30 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed May 29 09:46:56 2024 +0200

a11y: Don't report dummy a11y name for icon choice control

If no a11y name is set for the `SvtIconChoiceCtrl`, don't
report any, rather than using "IconChoiceControl" as
accessible name.

Having the Orca screen reader (when used with the qt6 VCL plugin)
announce "IconChoiceControl" and then the name of the actually
selected item e.g. in Writer's "Insert" -> "Hyperlink" or the
"Format" -> "Page Setup" dialog is rather confusing when an
entry in the control gets focus.

Change-Id: Ie7e25d5a65c57be118abf2dcaff0648430f26154
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168155
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx 
b/accessibility/source/extended/accessibleiconchoicectrl.cxx
index 33b15d5f54c8..877816466a19 100644
--- a/accessibility/source/extended/accessibleiconchoicectrl.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx
@@ -194,10 +194,7 @@ namespace accessibility
 {
 ::comphelper::OExternalLockGuard aGuard( this );
 
-OUString sName = getCtrl()->GetAccessibleName();
-if ( sName.isEmpty() )
-sName = "IconChoiceControl";
-return sName;
+return getCtrl()->GetAccessibleName();
 }
 
 // XAccessibleSelection


core.git: accessibility/source

2024-05-29 Thread Michael Weghorn (via logerrit)
 accessibility/source/extended/accessibleiconchoicectrlentry.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit c61f6a78022de6b29f031f3ac6726520032de187
Author: Michael Weghorn 
AuthorDate: Tue May 28 14:44:29 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed May 29 09:46:36 2024 +0200

a11y: Report focused state for icon choice control entries

Handle the FOCUSABLE and FOCUSED a11y states in
`AccessibleIconChoiceCtrlEntry::getAccessibleStateSet`.

Without this, the currently focused tab item would
e.g. not be reported by Orca when using the qt6 VCL
plugin in Writer's "Insert" -> "Hyperlink" dialog
or in "Format" -> "Page Style" that was recently
converted to use vertical tabs.

Monitoring AT-SPI events showed that an
`object:state-changed:focused` event was sent
on the AT-SPI layer (see also
`AccessibleIconChoiceCtrl::ProcessWindowEvent` that sends
an `AccessibleEventId::ACTIVE_DESCENDANT_CHANGED` event):

However, the focused state is not set, so Orca
would not report the item as the new focus item:

95.1 object:state-changed:focused(0, 0, [list item | Mail])
source: [list item | Mail]
application: [application | soffice.bin]

With this change in place, the state is properly
set now and Orca announces the newly focused item:

31.0 object:state-changed:focused(1, 0, [list item | Mail])
source: [list item | Mail]
application: [application | soffice.bin]

Change-Id: I41667c842e607f494b9e0e236b8c6f2f9ca95dfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168154
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx 
b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
index 5f4761770f03..95e9c4375004 100644
--- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
@@ -297,6 +297,7 @@ namespace accessibility
 
 if ( IsAlive_Impl() )
 {
+nStateSet |= AccessibleStateType::FOCUSABLE;
 nStateSet |= AccessibleStateType::TRANSIENT;
 nStateSet |= AccessibleStateType::SELECTABLE;
 nStateSet |= AccessibleStateType::ENABLED;
@@ -308,7 +309,11 @@ namespace accessibility
 }
 
 if ( m_pIconCtrl && m_pIconCtrl->GetCursor() == 
m_pIconCtrl->GetEntry( m_nIndex ) )
+{
 nStateSet |=  AccessibleStateType::SELECTED;
+if (m_pIconCtrl->HasChildPathFocus())
+nStateSet |= AccessibleStateType::FOCUSED;
+}
 }
 else
 nStateSet |=  AccessibleStateType::DEFUNC;


core.git: 3 commits - include/vcl vcl/qt5 vcl/source vcl/unx

2024-05-27 Thread Michael Weghorn (via logerrit)
 include/vcl/settings.hxx  |   11 +++
 vcl/qt5/QtFrame.cxx   |4 
 vcl/source/app/settings.cxx   |   14 ++
 vcl/source/control/combobox.cxx   |   29 +
 vcl/unx/gtk3/salnativewidgets-gtk.cxx |4 
 5 files changed, 58 insertions(+), 4 deletions(-)

New commits:
commit 4b53712cccfa48fc7d1f754d6a596204e041d554
Author: Michael Weghorn 
AuthorDate: Mon May 27 14:16:53 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 28 06:47:08 2024 +0200

tdf#160971 gtk: Don't select combobox text on entry selection

In the same way that

Change-Id: I17ce71198ec37cb1735194818bae17d1a5654d89
Author: Michael Weghorn 
Date:   Mon May 27 13:35:52 2024 +0200

tdf#160971 qt a11y: Don't select combobox text on entry selection

together with

Change-Id: Ia2c77245049d708885cbd374c20ce1892259329b
Author: Michael Weghorn 
Date:   Mon May 27 13:29:39 2024 +0200

tdf#160971 vcl a11y: Make combobox text selection mode style-able

sets the style option to not select combobox text when switching
between entries in an editable combobox for the Qt-based VCL plugins,
do the same for the GTK-based VCL plugins, except for putting the
text cursor at the beginning of the entry text instead of the end,
as happens when using a native GtkComboBox (see tdf#160971 comment 11).

Since the GTK-based VCL plugins use native GTK widgets
in most places, the behavior for e.g. the "Font Name"
combobox in Writer's Formatting toolbar is already like that
without this change in place and is unaffected by this change
(even though LO's gtk3 VCL plugin is using a custom combobox
implementation, see vcl/uiconfig/ui/combobox.ui).

However, the new behavior applies for combobox form
controls, as can be seen e.g. with the sample doc
attachment 194376 from tdf#160971.

Change-Id: I5b17efaa167ab49d07f19b3649ff934cf0f34754
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168104
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index 7c2fcc633b77..402a50df6d96 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -209,6 +209,7 @@ enum class ToolbarIconSize
 enum class ComboBoxTextSelectionMode
 {
 SelectText, // select the whole text of the new entry
+CursorToStart, // don't select text, put text cursor to start of text
 CursorToEnd // don't select text, put text cursor to end of text
 };
 
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 360053e4134d..e8d93f1ea52c 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -384,9 +384,17 @@ IMPL_LINK_NOARG(ComboBox, ImplSelectHdl, LinkParamNone*, 
void)
 m_pSubEdit->SetSelection(aNewSelection);
 break;
 }
+case ComboBoxTextSelectionMode::CursorToStart:
+{
+Selection aNewSelection(0, 0);
+m_pSubEdit->SetSelection(aNewSelection);
+break;
+}
 case ComboBoxTextSelectionMode::CursorToEnd:
+{
 m_pSubEdit->SetCursorAtLast();
 break;
+}
 default:
 assert(false && "Unhandled ComboBoxTextSelectionMode case");
 break;
diff --git a/vcl/unx/gtk3/salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
index a4e8a82aed28..e02e642bc534 100644
--- a/vcl/unx/gtk3/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
@@ -2579,6 +2579,10 @@ bool GtkSalGraphics::updateSettings(AllSettings& 
rSettings)
 }
 #endif
 
+// match native GtkComboBox behavior of putting text cursor to start of 
text
+// without text selection when combobox entry is selected
+
aStyleSet.SetComboBoxTextSelectionMode(ComboBoxTextSelectionMode::CursorToStart);
+
 // get cursor blink time
 gboolean blink = false;
 
commit 3776874c20b4d4b2b24850c5f21e3b89a7feaaea
Author: Michael Weghorn 
AuthorDate: Mon May 27 13:35:52 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 28 06:47:01 2024 +0200

tdf#160971 qt a11y: Don't select combobox text on entry selection

In order to align the behavior with that of the native
`QComboBox`, don't select the entry text when selecting
a different combobox entry, e.g. using the up/down arrow
keys in the editable combobox for the font name in
Writer's Formatting toolbar.

In order to achieve that, set the corresponding
style setting newly introduced in the previous commit,

Change-Id: Ia2c77245049d708885cbd374c20ce1892259329b
Author: Michael Weghorn 
Date:   Mon May 27 13:29:

Re: GSoC: Libreoffice Theme (week - 1 update)

2024-05-26 Thread Michael Weghorn

On 2024-05-27 06:48, Sahil Gautam wrote:

@Michael made a vaild point.

Haven't played around with the ColorConfig
much, (slow PC reasons), but this week I will go  through that.
Things will be more clear then.

This is my take on it now.
- Read the colors from the widget toolkits and store it somewhere.
   The entries in the `Color 
ColorConfig::GetDefaultColor(ColorConfigEntry eEntry)`
   are hard-coded, can be created on startup instead. Something like 
having a vector
   of structs with the default color values for different ENUMs 
associated to

   UI elements.

- Then the colors in the StyleSettings can be initialized based on theme 
selection.
   If it's "System Theme", then the colors saved in the point above can 
be used to
   initialize the StyleSettings. If it's some custom theme (extension), 
then the

   colors should be read from the expert configuration instead.


One more aspect to take into account is that the system theme can change 
while LO is running.


You can see that e.g. by starting LO with the gtk3 VCL plugin, then 
changing the GTK system theme:

The new theme is applied right away, not only after restarting LO.
(Similar with kf5 and changing the Qt style.)


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: GSoC: Libreoffice Theme (week - 1 update)

2024-05-26 Thread Michael Weghorn

On 2024-05-27 05:04, Sahil Gautam wrote:

The project is about not depending on the OS for colors and implement "Themes"
in Libreoffice. So as per my understanding (opinions invited), all the 
`Set...Color()`
calls in the `bool UpdateSettings(AllSettings& rSettings)` functions, which take
colors from the OS and put them into the `StyleSettings` are to be removed, and 
colors
should be passed to the widget toolkits, which were read from the expert 
configuration.


My take would be that colors should still be taken from the 
OS's/toolkit's current system theme/style by default, and only be 
overriden if explicitly configured so.


OpenPGP_signature.asc
Description: OpenPGP digital signature


core.git: Branch 'libreoffice-24-2-4' - sc/source

2024-05-26 Thread Michael Weghorn (via logerrit)
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 661eed7b8e5412a0c6f952dc30a529683a2f5986
Author: Michael Weghorn 
AuthorDate: Thu May 23 12:57:46 2024 +0200
Commit: Noel Grandin 
CommitDate: Sun May 26 09:53:14 2024 +0200

related tdf#158914 sc a11y: Release references when disposing sheet

Clear all `ScAccessibleCell` references that are owned by
`ScAccessibleSpreadsheet` when disposing the sheet instead
of when the sheet is deleted.

While `ScAccessibleSpreadsheet::disposing` is always called,
`ScAccessibleSpreadsheet::~ScAccessibleSpreadsheet` is not called
until all of the sheet's `ScAccessibleCell` instances have been
deleted. So make sure that `ScAccessibleSpreadsheet::disposing`
releases all `ScAccessibleCell` references.

This might possibly reduce some of the leaks mentioned in [1].

[1] 
https://gerrit.libreoffice.org/c/core/+/167961/comments/15a6a4e4_91a77291

Change-Id: Iaf14338945c1899d54c8e7f8a16f38a48316ac98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167985
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 4d2c41e8171139e210d94b0c3c2b6b3d6392665a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168051
Reviewed-by: Noel Grandin 
Reviewed-by: Patrick Luby 
Tested-by: Noel Grandin 

diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx 
b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 7aaa7237ccac..020386a69af8 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -310,7 +310,11 @@ void SAL_CALL ScAccessibleSpreadsheet::disposing()
 mpViewShell->RemoveAccessibilityObject(*this);
 mpViewShell = nullptr;
 }
+
 mpAccCell.clear();
+m_mapSelectionSend.clear();
+m_mapFormulaSelectionSend.clear();
+m_pAccFormulaCell.clear();
 
 ScAccessibleTableBase::disposing();
 }


core.git: Branch 'libreoffice-24-2' - sc/source

2024-05-26 Thread Michael Weghorn (via logerrit)
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit e7a660709c153239bfec8ddb445d0ee7ed790215
Author: Michael Weghorn 
AuthorDate: Thu May 23 12:57:46 2024 +0200
Commit: Noel Grandin 
CommitDate: Sun May 26 09:53:04 2024 +0200

related tdf#158914 sc a11y: Release references when disposing sheet

Clear all `ScAccessibleCell` references that are owned by
`ScAccessibleSpreadsheet` when disposing the sheet instead
of when the sheet is deleted.

While `ScAccessibleSpreadsheet::disposing` is always called,
`ScAccessibleSpreadsheet::~ScAccessibleSpreadsheet` is not called
until all of the sheet's `ScAccessibleCell` instances have been
deleted. So make sure that `ScAccessibleSpreadsheet::disposing`
releases all `ScAccessibleCell` references.

This might possibly reduce some of the leaks mentioned in [1].

[1] 
https://gerrit.libreoffice.org/c/core/+/167961/comments/15a6a4e4_91a77291

Change-Id: Iaf14338945c1899d54c8e7f8a16f38a48316ac98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167985
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 4d2c41e8171139e210d94b0c3c2b6b3d6392665a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168050
Reviewed-by: Noel Grandin 
Reviewed-by: Patrick Luby 

diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx 
b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 7aaa7237ccac..020386a69af8 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -310,7 +310,11 @@ void SAL_CALL ScAccessibleSpreadsheet::disposing()
 mpViewShell->RemoveAccessibilityObject(*this);
 mpViewShell = nullptr;
 }
+
 mpAccCell.clear();
+m_mapSelectionSend.clear();
+m_mapFormulaSelectionSend.clear();
+m_pAccFormulaCell.clear();
 
 ScAccessibleTableBase::disposing();
 }


core.git: sc/source

2024-05-25 Thread Michael Weghorn (via logerrit)
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 4d2c41e8171139e210d94b0c3c2b6b3d6392665a
Author: Michael Weghorn 
AuthorDate: Thu May 23 12:57:46 2024 +0200
Commit: Michael Weghorn 
CommitDate: Sat May 25 09:02:38 2024 +0200

related tdf#158914 sc a11y: Release references when disposing sheet

Clear all `ScAccessibleCell` references that are owned by
`ScAccessibleSpreadsheet` when disposing the sheet instead
of when the sheet is deleted.

While `ScAccessibleSpreadsheet::disposing` is always called,
`ScAccessibleSpreadsheet::~ScAccessibleSpreadsheet` is not called
until all of the sheet's `ScAccessibleCell` instances have been
deleted. So make sure that `ScAccessibleSpreadsheet::disposing`
releases all `ScAccessibleCell` references.

This might possibly reduce some of the leaks mentioned in [1].

[1] 
https://gerrit.libreoffice.org/c/core/+/167961/comments/15a6a4e4_91a77291

Change-Id: Iaf14338945c1899d54c8e7f8a16f38a48316ac98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167985
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx 
b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index fdeea8d7579a..7296863d0cee 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -310,7 +310,11 @@ void SAL_CALL ScAccessibleSpreadsheet::disposing()
 mpViewShell->RemoveAccessibilityObject(*this);
 mpViewShell = nullptr;
 }
+
 mpAccCell.clear();
+m_mapSelectionSend.clear();
+m_mapFormulaSelectionSend.clear();
+m_pAccFormulaCell.clear();
 
 ScAccessibleTableBase::disposing();
 }


core.git: avmedia/source

2024-05-24 Thread Michael Weghorn (via logerrit)
 avmedia/source/qt6/QtPlayer.cxx |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 7960bd204bdecb73522c1eda6c101c40edda
Author: Michael Weghorn 
AuthorDate: Fri May 24 11:31:09 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 24 18:18:17 2024 +0200

tdf#145735 qt avmedia: Return video resolution for preferred win size

In `QtPlayer::getPreferredPlayerWindowSize`, retrieve the
video resolution from the meta data and return that for the
preferred window size if available, instead of always returning
an empty rect.

For the sample presentation referenced in tdf#145735,
the size retrieved this way also matches what
`GtkPlayer::getPreferredPlayerWindowSize` returns
(720x400).

As mentioned in

commit 441d8ed9be0e7f831b455a69b8688dcb79a8bc00
Author: Michael Weghorn 
Date:   Mon May 20 16:25:09 2024 +0200

tdf#145735 avmedia qt: Use QtMultimedia for Qt 6 media playback

, the behaviour without this was:

> * In non-presentation mode, the placeholder
>   shown until the video gets started using the controls
>   in the sidebar is just an "audio icon", not a frame
>   from the actual video. (This might be related to the
>   fact that `QtPlayer::createFrameGrabber` currently
>   returns an empty reference.)

With this in place, the placeholder is now a different
icon, a "video icon" (but still not a frame from the actual
video).

Change-Id: I295abe6b7973fece3fcaf9a38af2602cb08610a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168013
    Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/avmedia/source/qt6/QtPlayer.cxx b/avmedia/source/qt6/QtPlayer.cxx
index 1ad675f37d5c..5f75394ff1a3 100644
--- a/avmedia/source/qt6/QtPlayer.cxx
+++ b/avmedia/source/qt6/QtPlayer.cxx
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -178,8 +179,16 @@ awt::Size SAL_CALL QtPlayer::getPreferredPlayerWindowSize()
 {
 osl::MutexGuard aGuard(m_aMutex);
 
-awt::Size aSize(0, 0);
-return aSize;
+assert(m_xMediaPlayer);
+const QMediaMetaData aMetaData = m_xMediaPlayer->metaData();
+const QVariant aResolutionVariant = 
aMetaData.value(QMediaMetaData::Resolution);
+if (aResolutionVariant.canConvert())
+{
+const QSize aResolution = aResolutionVariant.value();
+return awt::Size(aResolution.width(), aResolution.height());
+}
+
+return awt::Size(0, 0);
 }
 
 uno::Reference<::media::XPlayerWindow>


core.git: vcl/qt5

2024-05-24 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtObject.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 81c94af71206013cb200f5612bc3bd61c799cf83
Author: Michael Weghorn 
AuthorDate: Fri May 24 11:16:17 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 24 18:17:58 2024 +0200

tdf#145735 qt: Set margins for video widget/layout to 0

Set all of the content margins of the layout that
holds the widget for video playback to 0.

Quoting [1]:

> Sets the left, top, right, and bottom margins to use around the layout.
>
> By default, QLayout uses the values provided by the style. On most 
platforms,
> the margin is 11 pixels in all directions.

This makes the odd margin/frame shown around the video
on video playback mentioned in

commit 441d8ed9be0e7f831b455a69b8688dcb79a8bc00
Author: Michael Weghorn 
Date:   Mon May 20 16:25:09 2024 +0200

tdf#145735 avmedia qt: Use QtMultimedia for Qt 6 media playback

disappear.

[1] https://doc.qt.io/qt-6/qlayout.html#setContentsMargins

Change-Id: I29f1093caa986e6818fd575b031375ded0a572bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168010
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/qt5/QtObject.cxx b/vcl/qt5/QtObject.cxx
index cd133e095ff5..bde8b570ac2e 100644
--- a/vcl/qt5/QtObject.cxx
+++ b/vcl/qt5/QtObject.cxx
@@ -115,6 +115,7 @@ QtObjectWidget::QtObjectWidget(QtObject& rParent)
 
 // set layout, used for video playback, see QtPlayer::createPlayerWindow
 QVBoxLayout* layout = new QVBoxLayout;
+layout->setContentsMargins(0, 0, 0, 0);
 setLayout(layout);
 }
 


core.git: 2 commits - accessibility/inc accessibility/source

2024-05-24 Thread Michael Weghorn (via logerrit)
 accessibility/inc/standard/accessiblemenubasecomponent.hxx|4 
 accessibility/source/standard/accessiblemenubasecomponent.cxx |   68 +-
 2 files changed, 35 insertions(+), 37 deletions(-)

New commits:
commit 248a19ad2b21669be6f76dbacb0f89ea41fe6d96
Author: Michael Weghorn 
AuthorDate: Fri May 24 08:01:41 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 24 11:07:42 2024 +0200

a11y: Rename m_aAccessibleChildren1 -> m_aAccessibleChildren

Was previously changed the other way around in

commit 28c89e58d90ea73513e273db274eb46ff9081c35
Date:   Wed Aug 30 15:16:01 2023 +0200

use concrete type for 
OAccessibleMenuBaseComponent::m_aAccessibleChildren

for no apparent reason.

Change-Id: I0d0c6627134bcef8ac9732cc8a5213ab266afbf7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168005
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/accessibility/inc/standard/accessiblemenubasecomponent.hxx 
b/accessibility/inc/standard/accessiblemenubasecomponent.hxx
index 7d62a63eff63..4ddcdd791e1b 100644
--- a/accessibility/inc/standard/accessiblemenubasecomponent.hxx
+++ b/accessibility/inc/standard/accessiblemenubasecomponent.hxx
@@ -45,7 +45,7 @@ class OAccessibleMenuBaseComponent : public 
cppu::ImplInheritanceHelper<
 friend class VCLXAccessibleMenu;
 
 protected:
-std::vector> 
m_aAccessibleChildren1;
+std::vector> 
m_aAccessibleChildren;
 VclPtrm_pMenu;
 
 boolm_bEnabled;
diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx 
b/accessibility/source/standard/accessiblemenubasecomponent.cxx
index e5e390d59512..4ef911dccc12 100644
--- a/accessibility/source/standard/accessiblemenubasecomponent.cxx
+++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx
@@ -54,7 +54,7 @@ OAccessibleMenuBaseComponent::OAccessibleMenuBaseComponent( 
Menu* pMenu )
 {
 if ( m_pMenu )
 {
-m_aAccessibleChildren1.assign( m_pMenu->GetItemCount(), 
rtl::Reference< OAccessibleMenuItemComponent >() );
+m_aAccessibleChildren.assign( m_pMenu->GetItemCount(), rtl::Reference< 
OAccessibleMenuItemComponent >() );
 m_pMenu->AddEventListener( LINK( this, OAccessibleMenuBaseComponent, 
MenuEventListener ) );
 }
 }
@@ -196,9 +196,9 @@ void OAccessibleMenuBaseComponent::SetChecked( bool 
bChecked )
 
 void OAccessibleMenuBaseComponent::UpdateEnabled( sal_Int32 i, bool bEnabled )
 {
-if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren1.size() )
+if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
 {
-rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren1[i] );
+rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren[i] );
 if ( xChild.is() )
 xChild->SetEnabled( bEnabled );
 }
@@ -207,9 +207,9 @@ void OAccessibleMenuBaseComponent::UpdateEnabled( sal_Int32 
i, bool bEnabled )
 
 void OAccessibleMenuBaseComponent::UpdateFocused( sal_Int32 i, bool bFocused )
 {
-if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren1.size() )
+if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
 {
-rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren1[i] );
+rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren[i] );
 if ( xChild.is() )
 xChild->SetFocused( bFocused );
 }
@@ -219,7 +219,7 @@ void OAccessibleMenuBaseComponent::UpdateFocused( sal_Int32 
i, bool bFocused )
 void OAccessibleMenuBaseComponent::UpdateVisible()
 {
 SetVisible( IsVisible() );
-for (const rtl::Reference& xChild : 
m_aAccessibleChildren1)
+for (const rtl::Reference& xChild : 
m_aAccessibleChildren)
 {
 if ( xChild.is() )
 xChild->SetVisible( xChild->IsVisible() );
@@ -231,9 +231,9 @@ void OAccessibleMenuBaseComponent::UpdateSelected( 
sal_Int32 i, bool bSelected )
 {
 NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() 
);
 
-if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren1.size() )
+if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
 {
-rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren1[i] );
+rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren[i] );
 if ( xChild.is() )
 xChild->SetSelected( bSelected );
 }
@@ -242,9 +242,9 @@ void OAccessibleMenuBaseComponent::UpdateSelected( 
sal_Int32 i, bool bSelected )
 
 void OAccessibleMenuBaseComponent::UpdateChecked( sal_Int32 i, bool bChecked )
 {
-if ( i >= 0 && o3tl::make_unsi

core.git: vcl/qa

2024-05-24 Thread Michael Weghorn (via logerrit)
 vcl/qa/cppunit/a11y/atspi2/atspi2testbase.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 87c41bbf04c361746bf9c2373aa144a02d971303
Author: Michael Weghorn 
AuthorDate: Fri May 24 06:21:30 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 24 08:44:29 2024 +0200

gtk3 a11y tests: Increase timeout for AT-SPI method calls

As discussed in the ESC call of 2024-05-23,
CppunitTest_vcl_gtk3_a11y fails relatively often recently:

> 38 CppunitTest_vcl_gtk3_a11ygerrit_linux_clang_dbgutil
>+ this week: have a new problem with CppunitTest_vcl_gtk3_a11y (Cloph)
>  + failure is not new, but the frequency increased recently
>  + assume: timing issue

Jenkins logs show that failures are due to running into
timeouts, example from [1]:

[...]
found run attribute: CharTopBorder=
found run attribute: CharTopBorderComplexColor=
found run attribute: MMToPixelRatio=
  matching atspi attribute is: mm-to-pixel-ratio=1.25
unknown:0:Test1::TestBody
An uncaught exception of type com.sun.star.uno.RuntimeException
- timeout from dbind at 
/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/vcl/qa/cppunit/a11y/atspi2/atspiwrapper.hxx:302

Increase the timeout for method calls from 2.5 to 10 seconds
in the hope that will help.
(Issue is not reproducible locally for me.)

[1] 
https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/162811/consoleFull

Change-Id: Ib0eef753cf9f574ee5b2a013a46a0a600c91eb34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168002
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/qa/cppunit/a11y/atspi2/atspi2testbase.hxx 
b/vcl/qa/cppunit/a11y/atspi2/atspi2testbase.hxx
index bcde764aa981..a0ac926c719d 100644
--- a/vcl/qa/cppunit/a11y/atspi2/atspi2testbase.hxx
+++ b/vcl/qa/cppunit/a11y/atspi2/atspi2testbase.hxx
@@ -80,8 +80,8 @@ public:
 if (!atspi_is_initialized())
 atspi_init();
 
-// increase timeout to avoid spurious avoid CI failures
-atspi_set_timeout(2500, 15000);
+// increase timeout to avoid spurious CI failures
+atspi_set_timeout(1, 15000);
 }
 
 virtual void setUp() override


core.git: vcl/unx

2024-05-23 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   23 +++
 1 file changed, 23 insertions(+)

New commits:
commit ee168614ddea2f349e80372599296e835080f264
Author: Michael Weghorn 
AuthorDate: Thu May 23 15:39:34 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 24 06:25:54 2024 +0200

tdf#160971 gtk3 a11y: Manually unset focus for combobox popup

The gtk3 VCL plugin uses a custom implementation that
has a listbox in a popup (s. vcl/uiconfig/ui/combobox.ui).

The popup window gets shown when expanding the combobox, e.g.
using Alt+Up/Alt+Down while the edit has focus.

Once the popup is closed again, focus is given to the edit
again.

That one correctly reports focus when checked via
`gtk_widget_has_focus`, but for some unknown
reason, the listbox in the popup assumes/claims
it still has global keyboard focus as well, despite it no
longer being visible and the `gtk_widget_has_focus` doc [1]
explicitly mentioning:

> Determines if the widget has the global input focus.
> See gtk_widget_is_focus() for the difference between
having the global input focus, and only having the focus
> within a toplevel.

The tree view listbox still assuming focus leads to it
emitting invalid active-descendant-changed a11y events
when the selected entry changes, which e.g. breaks focus
tracking by the Orca screen reader.
As a consequence, current Orca git main
(as of commit d70919051ef01384c473e08321a88cec52549cd2)
doesn't doesn't announce the new value of e.g. the "Font Name"
combobox in the Writer toolbar when changing it via the
Up/Down arrow keys any more once the popup has been shown.
(It works fine before showing the popup for the first time.)

To avoid that problem, manually unset the focus
using `gtk_widget_send_focus_change`.
Its doc [2] mentions

> This function is not meant to be used by applications.

, but since the focus is apparently not unset
automatically, still use it as a workaround for now.

[1] https://docs.gtk.org/gtk3/method.Widget.has_focus.html
[2] https://docs.gtk.org/gtk3/method.Widget.send_focus_change.html

Change-Id: Ifd32c2a66b4a7b9e827f5c8dc2927c7e359a42aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167994
Tested-by: Jenkins
    Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index f9b087e25f4e..6e4f95dc7e3d 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -21368,6 +21368,29 @@ private:
 //is what the vcl case does, to ease the transition a little
 gtk_widget_grab_focus(m_pEntry);
 enable_notify_events();
+
+// tdf#160971: For some reason, the tree view in the no longer 
visible
+// popup still incorrectly assumes it has focus in addition to the 
now
+// actually focused entry.
+// That would cause it to send invalid active-descendant-changed 
a11y events when
+// the selected entry changes, e.g. breaking focus tracking by the 
Orca screen reader.
+// Manually unset focus to avoid that
+assert(!gtk_widget_is_visible(GTK_WIDGET(m_pTreeView)));
+const bool bTreeViewFocus = 
gtk_widget_has_focus(GTK_WIDGET(m_pTreeView));
+if (bTreeViewFocus)
+{
+SAL_WARN("vcl.gtk", "No more visible tree view in combobox 
still incorrectly "
+"claims having focus - unsetting 
manually.");
+GdkWindow* pWindow = 
gtk_widget_get_window(GTK_WIDGET(m_pTreeView));
+GdkEvent* pEvent = gdk_event_new(GDK_FOCUS_CHANGE);
+pEvent->focus_change.type = GDK_FOCUS_CHANGE;
+pEvent->focus_change.window = pWindow;
+if (pWindow)
+g_object_ref(pWindow);
+pEvent->focus_change.in = 0;
+gtk_widget_send_focus_change(GTK_WIDGET(m_pTreeView), pEvent);
+gdk_event_free(pEvent);
+}
 }
 }
 


core.git: 2 commits - android/source sw/inc

2024-05-23 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/FontController.java|   37 
++
 android/source/src/java/org/libreoffice/LOKitTileProvider.java |1 
 sw/inc/swmodule.hxx|8 +-
 3 files changed, 14 insertions(+), 32 deletions(-)

New commits:
commit 6bab5485913ca99feb00855a20171a8a770f0469
Author: Michael Weghorn 
AuthorDate: Wed May 22 13:50:24 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu May 23 15:53:26 2024 +0200

android: Use "compact_fonts" LibreOfficeKit option

For Android Viewer, set the "compact_fonts" LibreOfficeKit
option via environment variable `SAL_LOK_OPTIONS` introduced in

Change-Id: I3dc9f5de876def6e4afc09a43105b1740f7c621f
Author: Michael Meeks 
Date:   Fri May 17 21:25:29 2024 +0100

lok: stop amazing waste of repeated font sizes in each font element.

and adjust the handling in `FontController` to process
the flat lists for font names and sizes that is reported
with that options set, rather than processing
font sizes for each individual font.

(See also discussion in original Gerrit change
for the distro/collabora/co-24.04 branch: [1].).

[1] https://gerrit.libreoffice.org/c/core/+/167799

Change-Id: I85734c1876d152f4f95f9182629affd6b250fdbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167963
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/android/source/src/java/org/libreoffice/FontController.java 
b/android/source/src/java/org/libreoffice/FontController.java
index 72f35d8b42d8..211b9d6c8b56 100644
--- a/android/source/src/java/org/libreoffice/FontController.java
+++ b/android/source/src/java/org/libreoffice/FontController.java
@@ -19,8 +19,6 @@ import org.json.JSONException;
 import org.json.JSONObject;
 
 import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
 
 public class FontController implements AdapterView.OnItemSelectedListener {
 
@@ -32,7 +30,6 @@ public class FontController implements 
AdapterView.OnItemSelectedListener {
 private final LibreOfficeMainActivity mActivity;
 private final ArrayList mFontList = new ArrayList<>();
 private final ArrayList mFontSizes = new ArrayList<>();
-private final HashMap> mAllFontSizes = new 
HashMap<>();
 
 private String mCurrentFontSelected = null;
 private String mCurrentFontSizeSelected = null;
@@ -210,21 +207,17 @@ public class FontController implements 
AdapterView.OnItemSelectedListener {
 
 public void parseJson(String json) {
 mFontList.clear();
-mAllFontSizes.clear();
+mFontSizes.clear();
 try {
 JSONObject jObject = new JSONObject(json);
-JSONObject jObject2 = jObject.getJSONObject("commandValues");
-Iterator keys = jObject2.keys();
-ArrayList fontSizes;
-while (keys.hasNext()) {
-String key = keys.next();
-mFontList.add(key);
-JSONArray array = jObject2.getJSONArray(key);
-fontSizes = new ArrayList<>();
-for (int i = 0; i < array.length(); i++) {
-fontSizes.add(array.getString(i));
-}
-mAllFontSizes.put(key, fontSizes);
+final JSONArray fontNameArray = jObject.getJSONArray("FontNames");
+for (int i = 0; i < fontNameArray.length(); i++) {
+mFontList.add(fontNameArray.getString(i));
+}
+
+final JSONArray fontSizeArray = jObject.getJSONArray("FontSizes");
+for (int i = 0; i < fontSizeArray.length(); i++) {
+mFontSizes.add(fontSizeArray.getString(i));
 }
 } catch (JSONException e) {
 e.printStackTrace();
@@ -405,18 +398,6 @@ public class FontController implements 
AdapterView.OnItemSelectedListener {
 mCurrentFontSelected = fontName;
 spinner.setSelection(position,false);
 }
-
-resetFontSizes(fontName);
-}
-
-private void resetFontSizes(String fontName) {
-if (mAllFontSizes.get(fontName) != null) {
-mFontSizes.clear();
-mFontSizes.addAll(mAllFontSizes.get(fontName));
-Spinner spinner = mActivity.findViewById(R.id.font_size_spinner);
-ArrayAdapter arrayAdapter = 
(ArrayAdapter)spinner.getAdapter();
-arrayAdapter.notifyDataSetChanged();
-}
 }
 
 public void selectFontSize(final String fontSize) {
diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java 
b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
index 5d1cf12209dc..c8a055206dd0 100644
--- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/source/src/java/org/libreoffice/LO

core.git: sw/source

2024-05-22 Thread Michael Weghorn (via logerrit)
 sw/source/core/doc/tblrwcl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 554c06b2f66ff7c26df0ac29f89894fff89eecd6
Author: Michael Weghorn 
AuthorDate: Wed May 22 08:16:00 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed May 22 11:05:03 2024 +0200

sw: Change OSL_ENSURE -> assert

This fixes my local Windows/MSVC build that previously
failed like this:


C:/tools/cygwin/home/user/development/git/libreoffice/sw/source/core/doc/tblrwcl.cxx(3187):
 error C2220: the following warning is treated as an error
C:  oolsmake[1]: *** 
[C:/tools/cygwin/home/user/development/git/libreoffice/solenv/gbuild/LinkTarget.mk:338:
 
C:/tools/cygwin/home/user/development/git/libreoffice/workdir/CxxObject/sw/source/core/doc/tblrwcl.o]
 Error 2
make: *** [Makefile:294: build] Error 2

Change-Id: I50faeba555d307ec27d1dccec7dbc3034c543830
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167918
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index b13dc38ebcef..38c5074f0e89 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -3100,7 +3100,7 @@ bool SwTable::SetRowHeight( SwTableBox& rCurrentBox, 
TableChgWidthHeightType eTy
 for( auto n = nStt; n < nEnd; ++n )
 {
 SwLayoutFrame* pLineFrame = GetRowFrame( *(*pLines)[ n 
] );
-OSL_ENSURE( pLineFrame, "Where is the Frame from the 
SwTableLine??" );
+assert(pLineFrame && "Where is the Frame from the 
SwTableLine??");
 aParam.nMaxSpace += CalcRowRstHeight( pLineFrame );
 aParam.nMaxHeight += 
pLineFrame->getFrameArea().Height();
 }


core.git: avmedia/CustomTarget_avmediaqt6_moc.mk avmedia/Library_avmediaqt6.mk avmedia/Module_avmedia.mk avmedia/source config_host/config_vclplug.h.in config_host.mk.in configure.ac Repository.mk vcl

2024-05-21 Thread Michael Weghorn (via logerrit)
 Repository.mk  |1 
 avmedia/CustomTarget_avmediaqt6_moc.mk |   24 ++
 avmedia/Library_avmediaqt6.mk  |   44 +++
 avmedia/Module_avmedia.mk  |7 
 avmedia/source/qt6/QtManager.cxx   |   62 +
 avmedia/source/qt6/QtManager.hxx   |   33 ++
 avmedia/source/qt6/QtPlayer.cxx|  328 +
 avmedia/source/qt6/QtPlayer.hxx|   84 +++
 avmedia/source/qt6/avmediaqt.component |   16 +
 avmedia/source/qt6/gstwindow.cxx   |   12 +
 avmedia/source/viewer/mediawindow_impl.cxx |5 
 config_host.mk.in  |1 
 config_host/config_vclplug.h.in|1 
 configure.ac   |   19 +
 vcl/qt5/QtObject.cxx   |5 
 15 files changed, 641 insertions(+), 1 deletion(-)

New commits:
commit 441d8ed9be0e7f831b455a69b8688dcb79a8bc00
Author: Michael Weghorn 
AuthorDate: Mon May 20 16:25:09 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 21 17:28:04 2024 +0200

tdf#145735 avmedia qt: Use QtMultimedia for Qt 6 media playback

Similar to the way that GTK 4's native facilities for
video playback are used for the gtk4 VCL plugin, initially
added in commit

commit d0a527ec09516bc7215baf229adb90cd21ffa27a
Author: Caolán McNamara 
Date:   Thu Feb 10 12:55:18 2022 +

first cut at using Gtk4 built in video playback

, implement media playback using QtMultimedia for the
Qt 6 based VCL plugins (qt6/kf6) via a new service
"com.sun.star.comp.avmedia.Manager_Qt".

Video playback with the mechanism used for qt5 no
longer works with qt6, as "qwidget5videosink"
that gets used on Wayland for qt5 wasn't ported
to Qt 6 and is unmaintained, s. the commit message of

commit 88d57cf241209ffec9eaed3e523942ab51af6db6
    Author: Michael Weghorn 
Date:   Wed Sep 29 11:09:51 2021 +0200

qt6: Add a qt6 VCL plugin

for more details. Additionally, this also doesn't work
properly any more on X11/with the xcb Qt QPA platform, see
tdf#145735 comment 7.

Instead of using GStreamer directly, let Qt handle
the low-level stuff by using the QtMultimedia module [1]
instead.

This adds a new dependency on QtMultimedia.
For building, this requires installing the Qt 6 QtMultimedia
development headers (e.g. package `qt6-multimedia-dev`
on current Debian testing).

Except for WASM, the use of QtMultimedia is enabled by
default when building with autogen options `--enable-qt6`
or `--enable-kf6`, but can explicitly be disabled using
`--disable-qt6-multimedia`.

In tests with the qt6 VCL plugin on Debian testing, with a
sample presentation containing an embedded
video, attachment 145517 from tdf#120452, video playback
generally works for both, the xcb and the wayland
Qt QPA platforms:

* Video and audio are played as expected on the external
  screen in presentation mode when using the presenter
  console
* Video and audio playback work in non-presentation
  mode by clicking on the video and using the controls
  in the Impress sidebar (play, pause,...).

However, the following issues were observed with
the current implementation:

* There's an odd frame/margin around the video.
* In non-presentation mode, the placeholder
  shown until the video gets started using the controls
  in the sidebar is just an "audio icon", not a frame
  from the actual video. (This might be related to the
  fact that `QtPlayer::createFrameGrabber` currently
  returns an empty reference.)
* At least on Wayland (issue not observed with
  QT_QPA_PLATFORM=xcb so far), when using the presenter
  console,   video playback in the presenter console (i.e. on the
  non-presentation screen) is unreliable: The video
  sometimes shows, but sometimes doesn't. At least the
  (more important) one on the presentation screen was
  reliably shown in my tests, however.

Tested with git dev versions of qtbase
(as of commit 8d5e7d50d8dbf1ad79bd8ff9f6ef6028eba481c9),
qtwayland (as of commit 6f0ebd916f176f6fbe35af28caeb52b62768ac94)
and qtmultimedia (as of commit
264b7e8d7d5683252102b5e5149685c8b8a70c2d).

[1] https://doc.qt.io/qt-6/qtmultimedia-index.html

Change-Id: I29c3c7ded01c61b49b192fa5c313d8a92c942185
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167869
    Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/Repository.mk b/Repository.mk
index b6ebf64dcf39..b86eb1bc5646 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -656,6 +656,7 @@ $(eval $(call 
gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \

core.git: 2 commits - vcl/inc vcl/qt5

2024-05-21 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtAccessibleEventListener.hxx |2 
 vcl/qt5/QtAccessibleEventListener.cxx |  196 ++
 2 files changed, 119 insertions(+), 79 deletions(-)

New commits:
commit 575ab78504c5082590970812e723ec01299787a2
Author: Michael Weghorn 
AuthorDate: Mon May 20 12:54:34 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 21 09:57:09 2024 +0200

qt a11y: Don't leak QAccessibleEvent

Create the `QAccessibleEvent`s passed to
`QAccessible::updateAccessibility` as local
stack variables instead of on the heap, to not leak
them, as `QAccessible::updateAccessibility` does
not take over ownership, i.e. doesn't delete them.

This is also what the example in the Qt doc [1]
does.

This fixes leaks reported by Valgrind, for example:

==104242== 416 bytes in 13 blocks are definitely lost in loss record 
23,612 of 27,514
==104242==at 0x4840F83: operator new(unsigned long) (in 
/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==104242==by 0x186F6884: 
QtAccessibleEventListener::HandleStateChangedEvent(QAccessibleInterface*, 
com::sun::star::accessibility::AccessibleEventObject const&) 
(QtAccessibleEventListener.cxx:144)
==104242==by 0x186F8478: 
QtAccessibleEventListener::notifyEvent(com::sun::star::accessibility::AccessibleEventObject
 const&) (QtAccessibleEventListener.cxx:401)
==104242==by 0x61B2756: 
comphelper::AccessibleEventNotifier::addEvent(unsigned int, 
com::sun::star::accessibility::AccessibleEventObject const&) 
(accessibleeventnotifier.cxx:256)
==104242==by 0x61ADB50: 
comphelper::OCommonAccessibleComponent::NotifyAccessibleEvent(short, 
com::sun::star::uno::Any const&, com::sun::star::uno::Any const&, int) 
(accessiblecomponenthelper.cxx:127)
==104242==by 0xBAA46FB: 
VCLXAccessibleComponent::ProcessWindowChildEvent(VclWindowEvent const&) 
(vclxaccessiblecomponent.cxx:173)
==104242==by 0xBAA4285: 
VCLXAccessibleComponent::WindowChildEventListener(VclWindowEvent&) 
(vclxaccessiblecomponent.cxx:124)
==104242==by 0xBAA3BBC: 
VCLXAccessibleComponent::LinkStubWindowChildEventListener(void*, 
VclWindowEvent&) (vclxaccessiblecomponent.cxx:114)
==104242==by 0xD56C687: Link::Call(VclWindowEvent&) const (link.hxx:111)
==104242==by 0xD56977E: vcl::Window::CallEventListeners(VclEventId, 
void*) (event.cxx:296)
==104242==by 0xD6C83A1: vcl::Window::ImplSetReallyVisible() 
(window.cxx:1328)
==104242==by 0xD6C846C: vcl::Window::ImplSetReallyVisible() 
(window.cxx:1344)

[1] https://doc.qt.io/qt-6/accessible-qwidget.html

Change-Id: I82af810f0c618ffd5c5e4c8f568f4b4358df5900
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167862
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/qt5/QtAccessibleEventListener.cxx 
b/vcl/qt5/QtAccessibleEventListener.cxx
index 4668e1585fba..ae79709fde86 100644
--- a/vcl/qt5/QtAccessibleEventListener.cxx
+++ b/vcl/qt5/QtAccessibleEventListener.cxx
@@ -140,8 +140,8 @@ void QtAccessibleEventListener::HandleStateChangedEvent(
 eEventType = QAccessible::ObjectShow;
 else
 eEventType = QAccessible::ObjectHide;
-QAccessible::updateAccessibility(
-new QAccessibleEvent(pQAccessibleInterface, eEventType));
+QAccessibleEvent aEvent(pQAccessibleInterface, eEventType);
+QAccessible::updateAccessibility();
 break;
 }
 // These don't seem to have a matching Qt equivalent
@@ -160,8 +160,8 @@ void QtAccessibleEventListener::HandleStateChangedEvent(
 return;
 }
 
-QAccessible::updateAccessibility(
-new QAccessibleStateChangeEvent(pQAccessibleInterface, aState));
+QAccessibleStateChangeEvent aEvent(pQAccessibleInterface, aState);
+QAccessible::updateAccessibility();
 }
 
 void QtAccessibleEventListener::notifyEvent(const 
css::accessibility::AccessibleEventObject& rEvent)
@@ -171,17 +171,23 @@ void QtAccessibleEventListener::notifyEvent(const 
css::accessibility::Accessible
 switch (rEvent.EventId)
 {
 case AccessibleEventId::NAME_CHANGED:
-QAccessible::updateAccessibility(
-new QAccessibleEvent(pQAccessibleInterface, 
QAccessible::NameChanged));
+{
+QAccessibleEvent aEvent(pQAccessibleInterface, 
QAccessible::NameChanged);
+QAccessible::updateAccessibility();
 return;
+}
 case AccessibleEventId::DESCRIPTION_CHANGED:
-QAccessible::updateAccessibility(
-new QAccessibleEvent(pQAccessibleInterface, 
QAccessible::DescriptionChanged));
+{
+QAccessibleEvent aEvent(pQAccessibleInterface, 
QAccessible::DescriptionChanged);
+QAccessible::up

New QtMultimedia dependency for --enable-qt6/--enable-kf6 builds (by default)

2024-05-20 Thread Michael Weghorn
In order to make video playback work for the Qt 6 based VCL plugins 
(qt6, kf6) work, the pending Gerrit change [1] ("tdf#145735 avmedia qt: 
Use QtMultimedia for Qt 6 media playback") will introduce a new default 
dependency on QtMultimedia for builds using the 
--enable-qt6/--enable-kf6 autogen options, except for WASM.


If you're building these, please make sure the corresponding development 
package (e.g. qt6-multimedia-dev on Debian) is installed or explicitly 
disable the use of QtMultimedia using the new autogen option 
"--disable-qt6-multimedia" once the change has landed on master.


[1] https://gerrit.libreoffice.org/c/core/+/167869


OpenPGP_signature.asc
Description: OpenPGP digital signature


core.git: avmedia/Library_avmediagtk.mk

2024-05-20 Thread Michael Weghorn (via logerrit)
 avmedia/Library_avmediagtk.mk |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit ba41718095a790e2a39d569f5cdd9006c5169545
Author: Michael Weghorn 
AuthorDate: Mon May 20 10:28:05 2024 +0200
Commit: Michael Weghorn 
CommitDate: Mon May 20 15:22:49 2024 +0200

avmediagtk: Use gb_Library_set_include for GTK4_CFLAGS

In the same way that `vcl/Library_vclplug_gtk4.mk` does
it, set the `GTK4_CFLAGS` (which have the includes) via
`gb_Library_set_include`, not `gb_Library_add_cxxflags`.

This makes sure that they end up in the `INCLUDE`
section in `workdir/GbuildToJson/Library/libavmediagtk.so`
and thus end up in the IDE integrations as includes,
which makes Qt Creator's Clang Code Model  find them
instead of showing an error
("gtkplayer.cxx:28:10: 'gtk/gtk.h' file not found").

See also this similar commit for more details:

commit 6a53832080cf201e960113de8e1887d99e857606
    Author: Michael Weghorn 
Date:   Mon Dec 17 15:35:58 2018 +0100

Use 'gb_Library_set_include' for GTK3_CFLAGS

Change-Id: I5ef01aff32073d37b8add0b2250402ccaa48b2dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167857
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/avmedia/Library_avmediagtk.mk b/avmedia/Library_avmediagtk.mk
index 08d30d3259dc..4e7fc1c50f77 100644
--- a/avmedia/Library_avmediagtk.mk
+++ b/avmedia/Library_avmediagtk.mk
@@ -13,16 +13,13 @@ $(eval $(call 
gb_Library_set_componentfile,avmediagtk,avmedia/source/gtk/avmedia
 
 $(eval $(call gb_Library_set_include,avmediagtk,\
$$(INCLUDE) \
+   $$(GTK4_CFLAGS) \
-I$(SRCDIR)/avmedia/source/inc \
-I$(SRCDIR)/avmedia/source/gstreamer \
 ))
 
 $(eval $(call gb_Library_use_external,avmediagtk,boost_headers))
 
-$(eval $(call gb_Library_add_cxxflags,avmediagtk,\
-$$(GTK4_CFLAGS) \
-))
-
 $(eval $(call gb_Library_use_sdk_api,avmediagtk))
 
 $(eval $(call gb_Library_use_libraries,avmediagtk,\


core.git: Branch 'libreoffice-24-2' - vcl/qt5

2024-05-18 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtFrame.cxx |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 9497be2e668c19aedc588588bf9dfed9338afe54
Author: Michael Weghorn 
AuthorDate: Fri May 17 17:02:49 2024 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat May 18 15:17:40 2024 +0200

tdf#160565 tdf#145735 qt: Avoid native window handles for Qt 6

Similar to the tdf#122293 scenario with Qt 5 on Wayland,
using native windows causes unresponsive UI even with
the xcb Qt QPA plugin when using Qt 6.

Therefore, don't call `QWidget::winId()` at all when
using Qt 6, but just refuse to resolve a native window
handle, the same way that is already done here for the
wayland Qt QPA plugin with qt5.

Add a comment based on the one originally added with

commit 0e3c3b842e14b9646d3697cf1266be21359e0f13
Author: Michael Weghorn 
Date:   Sat May 11 21:31:33 2019 +0200

tdf#122293 qt5: Use "alien widgets" by default on Wayland

that was later dropped during a refactoring.

This code path is triggered when trying to resolve the
parent window for a file picker (s. `QtFilePicker::initialize`).
In a quick test in a KDE Plasma 5 Wayland session on Debian testing,
the modality behavior was unchanged with or without this change in
place:

* With qt6 xcb, the main window nicely gets grayed out and is
  unresponsive while the file dialog gets shown  when using
  e.g. "File" -> "Open" in Writer.

* With qt6 wayland, the main window is not grayed out and looks
  more "active" still, but doesn't actually accept keyboard
  or mouse input.

This is basically the same in other Qt/KDE applications, e.g.
a self-compiled Kate from git master, so not LO-specific.

If resolving the parent for the file picker turns out to be necessary,
maybe something similar to what commit

commit 3ff4800fe400de916c97f587322104af06cc0879
Author: Caolán McNamara 
Date:   Wed Apr 4 10:22:34 2018 +0100

weld SvInsertOleDlg

and

weld SfxInsertFloatingFrameDialog

and smuggle in the parent widget for the Gtk File dialog via
an XWindow interface

did for gtk3 might be worth looking into.

However, I can at least not reproduce issues like the one described
for gtk3 in

commit 203d96787969f707c78101be18d51b44ace98f93
Author: Caolán McNamara 
Date:   Mon Jun 21 13:01:52 2021 +0100

give folderpicker an optional parent

so, like a file picker, it can make its parent modal while its
operating. Otherwise its possible to interact with the parent 
dialog in
undesirable ways, e.g. file, export as, export as epub, the folder
picker of 'media directory'

with the qt6 VCL plugin even with this commit in place.

Another scenario relying on a native window handle is video
playback with GStreamer's x11 video sink.

That still works for qt5 with the xcb plugin as the handle is
still returned for that one.

For qt6 with the xcb plugin, that didn't work properly
without this commit either (at least not in my tests with
current qtbase dev as of commit
70a2e7f32b9f9ce19d1538f14fbde7b0d1e77ffd), s.
tdf#145735 comment 7.
It's now broken a different way than before
(extra windows show up instead of no video being shown).
This will be further tracked together with a solution for
Wayland in tdf#125219.

As a side note, forcing native windows for everything
using `QT_USE_NATIVE_WINDOWS=1` as described at [1]
causes more sever brokenness with the qt6 xcb plugin
(mostly black window in Writer instead of showing the
actual content).

[1] https://doc.qt.io/qt-6/qwidget.html#native-widgets-vs-alien-widgets

Change-Id: I9718c680bd8bc4ff0574f171403d965c1beac781
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167783
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
(cherry picked from commit 2f4103da5625a9b90eb41d5c767a248a8d0b4255)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167813
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index 6aff814aacd2..1c3839a287d9 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -35,6 +35,7 @@
 #include 
 #endif
 
+#include 
 #include 
 #include 
 #include 
@@ -1339,8 +1340,17 @@ void QtFrame::ResolveWindowHandle(SystemEnvData& rData) 
const
 if (!rData.pWidget)
 return;
 assert(rData.platform != SystemEnvData::Platform::Invalid);
-if (rData.platform != SystemEnvData::Platform::Wayland)
+// Calling QWidget::winId() implicitly enables native windows to be used 
instead
+// of 

core.git: 3 commits - vcl/qt5

2024-05-17 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtFrame.cxx |   28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

New commits:
commit 2f4103da5625a9b90eb41d5c767a248a8d0b4255
Author: Michael Weghorn 
AuthorDate: Fri May 17 17:02:49 2024 +0200
Commit: Michael Weghorn 
CommitDate: Sat May 18 06:55:31 2024 +0200

tdf#160565 tdf#145735 qt: Avoid native window handles for Qt 6

Similar to the tdf#122293 scenario with Qt 5 on Wayland,
using native windows causes unresponsive UI even with
the xcb Qt QPA plugin when using Qt 6.

Therefore, don't call `QWidget::winId()` at all when
using Qt 6, but just refuse to resolve a native window
handle, the same way that is already done here for the
wayland Qt QPA plugin with qt5.

Add a comment based on the one originally added with

commit 0e3c3b842e14b9646d3697cf1266be21359e0f13
Author: Michael Weghorn 
Date:   Sat May 11 21:31:33 2019 +0200

tdf#122293 qt5: Use "alien widgets" by default on Wayland

that was later dropped during a refactoring.

This code path is triggered when trying to resolve the
parent window for a file picker (s. `QtFilePicker::initialize`).
In a quick test in a KDE Plasma 5 Wayland session on Debian testing,
the modality behavior was unchanged with or without this change in
place:

* With qt6 xcb, the main window nicely gets grayed out and is
  unresponsive while the file dialog gets shown  when using
  e.g. "File" -> "Open" in Writer.

* With qt6 wayland, the main window is not grayed out and looks
  more "active" still, but doesn't actually accept keyboard
  or mouse input.

This is basically the same in other Qt/KDE applications, e.g.
a self-compiled Kate from git master, so not LO-specific.

If resolving the parent for the file picker turns out to be necessary,
maybe something similar to what commit

commit 3ff4800fe400de916c97f587322104af06cc0879
Author: Caolán McNamara 
Date:   Wed Apr 4 10:22:34 2018 +0100

weld SvInsertOleDlg

and

weld SfxInsertFloatingFrameDialog

and smuggle in the parent widget for the Gtk File dialog via
an XWindow interface

did for gtk3 might be worth looking into.

However, I can at least not reproduce issues like the one described
for gtk3 in

commit 203d96787969f707c78101be18d51b44ace98f93
Author: Caolán McNamara 
Date:   Mon Jun 21 13:01:52 2021 +0100

give folderpicker an optional parent

so, like a file picker, it can make its parent modal while its
operating. Otherwise its possible to interact with the parent 
dialog in
undesirable ways, e.g. file, export as, export as epub, the folder
picker of 'media directory'

with the qt6 VCL plugin even with this commit in place.

Another scenario relying on a native window handle is video
playback with GStreamer's x11 video sink.

That still works for qt5 with the xcb plugin as the handle is
still returned for that one.

For qt6 with the xcb plugin, that didn't work properly
without this commit either (at least not in my tests with
current qtbase dev as of commit
70a2e7f32b9f9ce19d1538f14fbde7b0d1e77ffd), s.
tdf#145735 comment 7.
It's now broken a different way than before
(extra windows show up instead of no video being shown).
This will be further tracked together with a solution for
Wayland in tdf#125219.

As a side note, forcing native windows for everything
using `QT_USE_NATIVE_WINDOWS=1` as described at [1]
causes more sever brokenness with the qt6 xcb plugin
(mostly black window in Writer instead of showing the
actual content).

[1] https://doc.qt.io/qt-6/qwidget.html#native-widgets-vs-alien-widgets

Change-Id: I9718c680bd8bc4ff0574f171403d965c1beac781
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167783
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index 0ff940408769..0950b520cb77 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -35,6 +35,7 @@
 #include 
 #endif
 
+#include 
 #include 
 #include 
 #include 
@@ -1355,8 +1356,17 @@ void QtFrame::ResolveWindowHandle(SystemEnvData& rData) 
const
 if (!rData.pWidget)
 return;
 assert(rData.platform != SystemEnvData::Platform::Invalid);
-if (rData.platform != SystemEnvData::Platform::Wayland)
+// Calling QWidget::winId() implicitly enables native windows to be used 
instead
+// of "alien widgets" that don't have a native widget asscoiated with them,
+// s. https://doc.qt.io/qt-6/qwidget.html#native-widgets-vs-alien-widgets
+/

core.git: Branch 'libreoffice-24-2' - android/README.md android/source

2024-05-16 Thread Michael Weghorn (via logerrit)
 android/README.md |   14 ++
 android/source/src/main/play/listings/en-US/graphics/icon.png |1 
 2 files changed, 15 insertions(+)

New commits:
commit 6460b76852b69f428ed26aba3877e9853ec22555
Author: Michael Weghorn 
AuthorDate: Thu May 16 09:26:44 2024 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu May 16 21:45:49 2024 +0200

tdf#157009 android: Add icon symlink for F-Droid

Add a symlink to the app icon at the expected
location when using the Triple-T data structure
that can be used to provide metadata for F-Droid. [1]

As Android Viewer currently uses a non-default directory layout,
this currently needs to be placed in a different subdirectory than
the actual source code in order for F-Droid to find it, see the
discussion in [2] for more details.

This should cause the app icon to show up in F-Droid
after the next update.

[1] 
https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/#triple-t-structure
[2] 
https://gitlab.com/fdroid/fdroiddata/-/merge_requests/13643#note_153683

Change-Id: Ic1a987e430b6e92134ac19d7f1c264953cd3cf0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167732
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
(cherry picked from commit 69189de8fa9a9d4973a4304a82780d32e79fbe6f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167679
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/android/README.md b/android/README.md
index 919122df38d1..186208c3e118 100644
--- a/android/README.md
+++ b/android/README.md
@@ -310,3 +310,17 @@ Anyway, our current "experimental" apps are not based on 
`NativeActivity`.
 They have normal Java code for the activity, and just call out to a single,
 app-specific native library (called `liblo-native-code.so`) to do all the
 heavy lifting.
+
+## Triple-T metadata for F-Droid
+
+The subdirectory `source/src/main/play` contains data in the Triple-T
+structure that F-Droid evaluates to extract metadata.
+
+More information:
+<https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/#triple-t-structure>
+
+As Android Viewer currently uses a non-default directory layout,
+this currently needs to be placed in a different subdirectory than
+the actual source code in order for F-Droid to find it, see the
+[related 
discussion](<https://gitlab.com/fdroid/fdroiddata/-/merge_requests/13643#note_153683>)
+for more details.
diff --git a/android/source/src/main/play/listings/en-US/graphics/icon.png 
b/android/source/src/main/play/listings/en-US/graphics/icon.png
new file mode 12
index ..f3e316efb456
--- /dev/null
+++ b/android/source/src/main/play/listings/en-US/graphics/icon.png
@@ -0,0 +1 @@
+../../../../../../ic_launcher-web.png
\ No newline at end of file


core.git: 2 commits - android/source instsetoo_native/inc_ooohelppack instsetoo_native/inc_openoffice instsetoo_native/inc_sdkoo solenv/bin

2024-05-16 Thread Michael Weghorn (via logerrit)
 android/source/build.gradle |4 -
 android/source/src/java/org/libreoffice/LibreOfficeApplication.java |4 -
 instsetoo_native/inc_ooohelppack/windows/msi_templates/CustomAc.idt |   18 
+++---
 instsetoo_native/inc_ooohelppack/windows/msi_templates/_Validat.idt |1 
 instsetoo_native/inc_openoffice/windows/msi_templates/CustomAc.idt  |   26 
+-
 instsetoo_native/inc_openoffice/windows/msi_templates/_Validat.idt  |1 
 instsetoo_native/inc_sdkoo/windows/msi_templates/CustomAc.idt   |   16 
+++---
 instsetoo_native/inc_sdkoo/windows/msi_templates/_Validat.idt   |1 
 solenv/bin/modules/installer/windows/idtglobal.pm   |4 -
 9 files changed, 37 insertions(+), 38 deletions(-)

New commits:
commit 86050dc7c72b98cf7af98d78e664965c9d9bb383
Author: Michael Weghorn 
AuthorDate: Thu May 16 10:35:39 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu May 16 15:13:20 2024 +0200

android: Disable multidex, only needed for minSdkVersion < 21

multidex was enabled in

commit 037680488b56aa2c4eb21900168aa88ef35d5b07
Author: Michael Weghorn 
Date:   Tue Dec 27 12:51:54 2022 +0100

android: Enable multidex, update com.google.android.material to 
1.7.0

as it was needed when building for minSdkVersion <= 20, see [1]
and the full commit message of the above-mentioned commit
for more details.

However, since

commit c2fc2c8c7c63ca4e43bca6e8c9b82c50418422d2
Author: Michael Weghorn 
Date:   Tue Dec 5 09:57:22 2023 +0100

android: Bump minSdkVersion to 21 (Android 5.0)

, the minSdkVersion is greater than that, so this
is no longer needed.

[1] https://developer.android.com/build/multidex

Change-Id: I31502ec74e9c4201a8a11be42820f70e5fd5a1fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167735
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/android/source/build.gradle b/android/source/build.gradle
index 6428a0ffcfda..8aa3d2dbf9c6 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -34,7 +34,6 @@ dependencies {
 ])
 implementation 'com.google.android.material:material:1.12.0'
 implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
-implementation "androidx.multidex:multidex:2.0.1"
 implementation 'androidx.preference:preference:1.2.1'
 }
 
@@ -60,9 +59,6 @@ android {
 defaultConfig {
 // minSdkVersion is set in liboSettings.gradle
 targetSdkVersion 34
-// multidex needed when > 65,536 methods referenced with minSdKVersion 
< 21
-// s. https://developer.android.com/studio/build/multidex
-multiDexEnabled true
 vectorDrawables.useSupportLibrary = true
 }
 buildTypes {
diff --git 
a/android/source/src/java/org/libreoffice/LibreOfficeApplication.java 
b/android/source/src/java/org/libreoffice/LibreOfficeApplication.java
index 3b03c83adda9..77f1af493b0e 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeApplication.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeApplication.java
@@ -10,11 +10,11 @@
 
 package org.libreoffice;
 
+import android.app.Application;
 import android.content.Context;
 import android.os.Handler;
-import androidx.multidex.MultiDexApplication;
 
-public class LibreOfficeApplication extends MultiDexApplication {
+public class LibreOfficeApplication extends Application {
 
 private static Handler mainHandler;
 
commit bf06fee9fccd361fecc106eafc587b1c8a88
Author: kubak 
AuthorDate: Wed May 1 09:59:14 2024 +0200
Commit: Mike Kaganski 
CommitDate: Thu May 16 15:13:09 2024 +0200

MSI: Adds the missing ExtendedType column in the CustomAction table

ICE06 WARNING Column: ExtendedType of Table: CustomAction is not defined in 
database.

https: //learn.microsoft.com/en-us/windows/win32/msi/ice06
https: //learn.microsoft.com/en-us/windows/win32/msi/customaction-table

Change-Id: I5f9368fedf421b23a397f5dcd77f383cb9f42ac5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166951
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins

diff --git 
a/instsetoo_native/inc_ooohelppack/windows/msi_templates/CustomAc.idt 
b/instsetoo_native/inc_ooohelppack/windows/msi_templates/CustomAc.idt
index aaf07ca28d96..80f0a0ad043a 100644
--- a/instsetoo_native/inc_ooohelppack/windows/msi_templates/CustomAc.idt
+++ b/instsetoo_native/inc_ooohelppack/windows/msi_templates/CustomAc.idt
@@ -1,10 +1,10 @@
-Action TypeSource  Target
-s72i2  S64 S255
+Action TypeSource  Target  ExtendedType
+s72i2  S72 S255I4
 CustomAction   Action
-setAllUsersProfile2K   51  ALLUSERSPROFILE [%ALLUSERSPROFILE]
-SetAllUsersProfileNT   51  ALLUSERSPROFILE [%SystemRoot]\Profiles\All Users
-setUserProfileNT   51  USERPRO

core.git: 2 commits - android/README.md android/source

2024-05-16 Thread Michael Weghorn (via logerrit)
 android/README.md |   14 +
 android/source/lint-baseline.xml  |   72 --
 android/source/src/main/play/listings/en-US/graphics/icon.png |1 
 3 files changed, 18 insertions(+), 69 deletions(-)

New commits:
commit 69189de8fa9a9d4973a4304a82780d32e79fbe6f
Author: Michael Weghorn 
AuthorDate: Thu May 16 09:26:44 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu May 16 12:14:04 2024 +0200

tdf#157009 android: Add icon symlink for F-Droid

Add a symlink to the app icon at the expected
location when using the Triple-T data structure
that can be used to provide metadata for F-Droid. [1]

As Android Viewer currently uses a non-default directory layout,
this currently needs to be placed in a different subdirectory than
the actual source code in order for F-Droid to find it, see the
discussion in [2] for more details.

This should cause the app icon to show up in F-Droid
after the next update.

[1] 
https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/#triple-t-structure
[2] 
https://gitlab.com/fdroid/fdroiddata/-/merge_requests/13643#note_153683

Change-Id: Ic1a987e430b6e92134ac19d7f1c264953cd3cf0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167732
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/android/README.md b/android/README.md
index 919122df38d1..186208c3e118 100644
--- a/android/README.md
+++ b/android/README.md
@@ -310,3 +310,17 @@ Anyway, our current "experimental" apps are not based on 
`NativeActivity`.
 They have normal Java code for the activity, and just call out to a single,
 app-specific native library (called `liblo-native-code.so`) to do all the
 heavy lifting.
+
+## Triple-T metadata for F-Droid
+
+The subdirectory `source/src/main/play` contains data in the Triple-T
+structure that F-Droid evaluates to extract metadata.
+
+More information:
+<https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/#triple-t-structure>
+
+As Android Viewer currently uses a non-default directory layout,
+this currently needs to be placed in a different subdirectory than
+the actual source code in order for F-Droid to find it, see the
+[related 
discussion](<https://gitlab.com/fdroid/fdroiddata/-/merge_requests/13643#note_153683>)
+for more details.
diff --git a/android/source/src/main/play/listings/en-US/graphics/icon.png 
b/android/source/src/main/play/listings/en-US/graphics/icon.png
new file mode 12
index ..f3e316efb456
--- /dev/null
+++ b/android/source/src/main/play/listings/en-US/graphics/icon.png
@@ -0,0 +1 @@
+../../../../../../ic_launcher-web.png
\ No newline at end of file
commit e63fa1ab17a082b14927079cfc04843061024947
Author: Michael Weghorn 
AuthorDate: Thu May 16 09:07:30 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu May 16 12:13:57 2024 +0200

android lint: Udate lint-baseline.xml

Some of the issues have been addressed in
the meanwhile, so regenerate the file to
reflect that.

Change-Id: I5c0f8a112cf02a89fe652c79ed8d70213f6fbc1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167725
Tested-by: Jenkins
    Reviewed-by: Michael Weghorn 

diff --git a/android/source/lint-baseline.xml b/android/source/lint-baseline.xml
index d973b4c4b078..d78cdfca6bd4 100644
--- a/android/source/lint-baseline.xml
+++ b/android/source/lint-baseline.xml
@@ -8,7 +8,7 @@
 errorLine2="   
~">
 
 
 
@@ -67,17 +67,6 @@
 column="25"/>
 
 
-
-
-
-
 
 
 
-
-
-
-
 
 
 
-https://g.co/dev/packagevisibility for details"
-errorLine1="if 
(takePictureIntent.resolveActivity(mContext.getPackageManager()) != null) {"
-errorLine2="  ~~~">
-
-
-
-https://g.co/dev/packagevisibility for details"
-errorLine1="
.queryIntentActivities(takePictureIntent, PackageManager.MATCH_DEFAULT_ONLY);"
-errorLine2=" ~">
-
-
-
-
-
-
-
-
-
-
-
 
 
 
 
@@ -1436,7 +1370,7 @@
 errorLine2="
~~">
 
 
 


core.git: 3 commits - android/source

2024-05-16 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java |   30 
++---
 android/source/src/java/org/libreoffice/SettingsActivity.java|   21 ---
 android/source/src/java/org/libreoffice/SettingsListenerModel.java   |   56 
--
 3 files changed, 15 insertions(+), 92 deletions(-)

New commits:
commit 91fa1f792de325f0fb95e56c59a52d5fc97d860d
Author: Michael Weghorn 
AuthorDate: Thu May 16 08:58:40 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu May 16 12:13:51 2024 +0200

android: Avoid unnecessary prefs processing

When the experimental editing mode preference
was toggled, it was processed twice:

Toggling that pref requires starting the
`SettingsActivity`, and when returning to
`LibreOfficeMainActivity`, its `onResume` method
was called which updates `mIsExperimentalMode` as needed.
In addition, the `LibreOfficeMainActivity#onSharedPreferenceChanged`
callback was called that also processed that preference.

The latter is more "targeted" and only called when a preference
actually changes.
Call `updatePreferences()` from there so other preferences
are also handled and drop the call to `updatePreferences`
from the `onResume` method, which is no longer needed
with that in place.

Change-Id: Ic0cacd8ad551137d5aea14cda6838d2ac50de8db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167724
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git 
a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java 
b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 8bacb3f0df72..9f4424f93dab 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -458,8 +458,6 @@ public class LibreOfficeMainActivity extends 
AppCompatActivity implements Shared
 protected void onResume() {
 super.onResume();
 Log.i(LOGTAG, "onResume..");
-// check for config change
-updatePreferences();
 if (mToolbarController.getEditModeStatus() && isExperimentalMode()) {
 mToolbarController.switchToEditMode();
 } else {
@@ -847,10 +845,7 @@ public class LibreOfficeMainActivity extends 
AppCompatActivity implements Shared
 
 @Override
 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, 
String key) {
-if (key.matches(ENABLE_EXPERIMENTAL_PREFS_KEY)) {
-Log.d(LOGTAG, "Editing Preference Changed");
-mIsExperimentalMode = 
sharedPreferences.getBoolean(ENABLE_EXPERIMENTAL_PREFS_KEY, false);
-}
+updatePreferences();
 }
 
 public void promptForPassword() {
commit 3865c81e96432638f3f4cc2ba4eeb481da1c6ebb
Author: Michael Weghorn 
AuthorDate: Thu May 16 08:26:14 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu May 16 12:13:45 2024 +0200

android: Drop indirection listening to pref change

Let `LibreOfficeMainActivity` implement the standard
Android `SharedPreferences.OnSharedPreferenceChangeListener`
interface directly, rather than having a custom
`SettingsListenerModel.OnSettingsPreferenceChangedListener`
indirection and the `SettingsFragment` implementing the
standard interface.

This simplifies the code and removes one level of
indirection.

Drop the now unused `SettingsListenerModel`.

Change-Id: I8c7d6088e711631409f9189bba966439db3daa44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167723
    Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git 
a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java 
b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 315656b6ef7e..8bacb3f0df72 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -57,7 +57,7 @@ import java.util.UUID;
 /**
  * Main activity of the LibreOffice App. It is started in the UI thread.
  */
-public class LibreOfficeMainActivity extends AppCompatActivity implements 
SettingsListenerModel.OnSettingsPreferenceChangedListener {
+public class LibreOfficeMainActivity extends AppCompatActivity implements 
SharedPreferences.OnSharedPreferenceChangeListener {
 
 private static final String LOGTAG = "LibreOfficeMainActivity";
 public static final String ENABLE_EXPERIMENTAL_PREFS_KEY = 
"ENABLE_EXPERIMENTAL";
@@ -125,8 +125,9 @@ public class LibreOfficeMainActivity extends 
AppCompatActivity implements Settin
 Log.w(LOGTAG, "onCreate..");
 super.onCreate(savedInstanceState);
 
-SettingsListenerModel.getInstance().setListener(this);
 updatePreferences();
+PreferenceManager.getDefaultSharedPreferences(getApplicat

core.git: 3 commits - android/source

2024-05-16 Thread Michael Weghorn (via logerrit)
 android/source/build.gradle   |1 
 android/source/res/values/arrays.xml  |   15 --
 android/source/res/values/strings.xml |2 
 android/source/res/xml/libreoffice_preferences.xml|9 -
 android/source/src/java/org/libreoffice/LibreOfficeApplication.java   |5 
 android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java  |2 
 android/source/src/java/org/libreoffice/LocaleHelper.java |   57 
--
 android/source/src/java/org/libreoffice/SettingsActivity.java |   28 
++--
 android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java |   27 

 9 files changed, 19 insertions(+), 127 deletions(-)

New commits:
commit 39ed595d608efd852a0239f6cf74f1168981cfc2
Author: Michael Weghorn 
AuthorDate: Thu May 16 07:01:35 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu May 16 12:13:30 2024 +0200

android: No longer manually set UI language

Drop the possibility to manually set a UI language
introduced in

commit f2e35a695671028b32139df1824ff536e7610d35
Author: Mert Tumer 
Date:   Tue Sep 18 23:29:57 2018 +0300

Added language support on Android Viewer

Since

commit 5bf2ec9ed8728a2042e110122ea2b0e4ff55104a
Author: Michael Weghorn 
Date:   Fri Dec 20 10:40:34 2019 +0100

android: Use system locale by default

, Android Viewer defaulted to the system
language for its UI language as well.

In addition, current Android versions allow to set
a specific language for apps: [1]

The previous approach of manually setting a language
in Android Viewer shouldn't really be necessary any more.

With the app now being available for translation on
Weblate and having been translated to more languages,
the list of available languages had become out of sync.

Additionally, the manually selected language wasn't
consistently applied everywhere:

* On the start activity where a document can be selected,
  it was only applied after closing the app, then opening
  it again.

* in the Settings, the language was not applied at all,
  that was always using the system locale anyway

Changes to the system locale are applied immediately
and consistently, so stick to the default Android mechanism
and reduce the overall complexity and maintenance burden.

[1] https://support.google.com/android/answer/12395118?hl=en

Change-Id: Ida61650b888a563f2346ea94a14b260802b1d24d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167718
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/res/values/arrays.xml 
b/android/source/res/values/arrays.xml
deleted file mode 100644
index 832bca781572..
--- a/android/source/res/values/arrays.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-SYSTEM_DEFAULT_LANGUAGE
-de
-en
-tr
-
-
-(System Default)
-Deutsch
-English
-Turkçe
-
-
diff --git a/android/source/res/values/strings.xml 
b/android/source/res/values/strings.xml
index 3766db146098..36b3cef75a25 100644
--- a/android/source/res/values/strings.xml
+++ b/android/source/res/values/strings.xml
@@ -140,8 +140,6 @@
 OK
 Cancel
 Current UNO command
-Display Language
-Set the default display 
language
 PDF export finished
 Unable to export to pdf
 Unable to save file
diff --git a/android/source/res/xml/libreoffice_preferences.xml 
b/android/source/res/xml/libreoffice_preferences.xml
index 052efacb2e3e..d8ca4dc8c7a7 100644
--- a/android/source/res/xml/libreoffice_preferences.xml
+++ b/android/source/res/xml/libreoffice_preferences.xml
@@ -4,15 +4,6 @@
 android:title="@string/pref_category_general"
 android:key="PREF_CATEGORY_GENERAL">
 
-
-
 
AuthorDate: Thu May 16 06:01:12 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu May 16 12:13:24 2024 +0200

android: Port Settings{Activity,Fragment} from deprecated API

API used in `SettingsActivity` and `SettingsFragment` has
been deprecated, e.g. `PreferenceFragment` was deprecated in
API level 28 [1].

Port that to non-deprecated API from the androidx.preference
library [2].

This addresses these deprecation warnings:


/home/michi/development/git/libreoffice-WORKTREE-android/android/source/src/java/org/libreoffice/SettingsActivity.java:14:
 warning: [deprecation] PreferenceFragment in android.preference has been 
deprecated
import android.preference.PreferenceFragment;
 ^

/home/michi/development/git/libreoffice-WORKTREE-android/android/source/src/java/org/libreoffice/SettingsAct

core.git: android/Bootstrap config_host.mk.in configure.ac

2024-05-16 Thread Michael Weghorn (via logerrit)
 android/Bootstrap/Makefile.shared |1 +
 config_host.mk.in |1 +
 configure.ac  |1 +
 3 files changed, 3 insertions(+)

New commits:
commit f895ee6de44cddfb86cdb0912693f7aa56cb3340
Author: Michael Weghorn 
AuthorDate: Thu May 16 04:51:47 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu May 16 12:13:02 2024 +0200

android: Set android.ndkVersion for Gradle

Set the `android.ndkVersion` property [1] for
the Android Gradle Plugin, in addition to `android.ndkPath`
that is set there already.

This addresses the warning

> Task :stripStrippedUIEditingDebugDebugSymbols
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
[CXX1100] android.ndkVersion is [26.1.10909125] but android.ndkPath 
/home/michi/Android/Sdk/ndk/25.1.8937393 refers to a different version 
[25.1.8937393].
Unable to strip the following libraries, packaging them as they are: 
libc++_shared.so, libfreebl3.so, liblo-native-code.so, libnspr4.so, libnss3.so, 
libnssckbi.so, libnssdbm3.so, libnssutil3.so, libplc4.so, libplds4.so, 
libsmime3.so, libsoftokn3.so, libsqlite3.so, libssl3.so.

 that started to show up in a local
`--with-android-ndk=$HOME/Android/Sdk/ndk/25.1.8937393`
Android build after

commit 1610ebc06b34263bf3e525babe1e583b932f6242
Author: Michael Weghorn 
Date:   Mon May 13 10:47:49 2024 +0200

android: Update Android Gradle Plugin to 8.4.0

... and gradle to 8.6, as suggested by Android Studio.

As described at [2], that Android Gradle Plugin defaults to
NDK 26.1.10909125.

[1] 
https://developer.android.com/studio/projects/install-ndk#apply-specific-version
[2] https://developer.android.com/build/releases/gradle-plugin

Change-Id: Ied81f13f535303f9578177646f177b4ef791eefa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167715
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/Bootstrap/Makefile.shared 
b/android/Bootstrap/Makefile.shared
index 0cd5ec6fcbda..b93735234b3d 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -108,6 +108,7 @@ liboSettings.gradle: $(BUILDDIR)/config_build.mk 
$(BUILDDIR)/config_host.mk \
&& echo "}" \
&& echo "android {" \
&& echo "ndkPath '$(ANDROID_NDK_DIR)'" \
+   && echo "ndkVersion '$(ANDROID_NDK_VERSION)'" \
&& echo "}" \
&& echo "android.defaultConfig {" \
&& echo "applicationId '$(ANDROID_PACKAGE_NAME)'" \
diff --git a/config_host.mk.in b/config_host.mk.in
index fe1fb546a6d1..e303f5945d99 100644
--- a/config_h

core.git: android/source

2024-05-14 Thread Michael Weghorn (via logerrit)
 android/source/AndroidManifest.xml|1 
 android/source/src/java/org/libreoffice/FormattingController.java |   38 
+++---
 2 files changed, 13 insertions(+), 26 deletions(-)

New commits:
commit e1216e47751b80238825aaeb21702d46dc34
Author: Michael Weghorn 
AuthorDate: Mon May 13 15:36:20 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 14 08:37:49 2024 +0200

android: Fix taking photos by dropping permission

At least on recent devices (seen e.g. on an AVD
with API level 34 and a Fairphone 3 with LineageOS 20
(based on Android 13)), inserting a picture by
taking a photo using the camera didn't work,
"nothing was happening" when choosing the corresponding
option from the formatting toolbar with experimental
editing mode enabled.

This is due to the system filtering information about
other apps/packages with target API level >= 30 for
privacy reasons, see [1] for more details.

As described at [2], requesting the `CAMERA`
permission is not required:

> Users might take pictures in your app, using the pre-installed
> system camera app.
>
> In this situation, don't declare the CAMERA permission. Instead,
> invoke the ACTION_IMAGE_CAPTURE intent action.

In fact, specifying the permission is even counter-productive
and would cause this to not work, as also described at [2]:

> Note: If your app declares Manifest.permission.CAMERA
> permission and is not granted, then the action results in
> a SecurityException.

Rather than explicitly requesting the permission, just
drop it from the AndroidManifest, as it's not needed.
Also drop the additional code interacting with the package
manager, as that doesn't work with newer API
versions as described above.

With these changes in place, inserting a photo works fine
in tests in API 21 and API 34 AVDs and on the
above-mentioned Fairphone 3.

[1] https://developer.android.com/training/package-visibility
[2] 
https://developer.android.com/privacy-and-security/minimize-permission-requests#take-photo

Change-Id: Ia1ee4e4de577a269e2b79bf5460d08b1bf2bee56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167603
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/android/source/AndroidManifest.xml 
b/android/source/AndroidManifest.xml
index 3ece77d62bfd..ba71fdddb197 100644
--- a/android/source/AndroidManifest.xml
+++ b/android/source/AndroidManifest.xml
@@ -6,7 +6,6 @@
 
 
 
-
 
 
  resInfoList = mContext.getPackageManager()
-.queryIntentActivities(takePictureIntent, 
PackageManager.MATCH_DEFAULT_ONLY);
-for (ResolveInfo resolveInfo : resInfoList) {
-String packageName = resolveInfo.activityInfo.packageName;
-mContext.grantUriPermission(packageName, photoURI, 
Intent.FLAG_GRANT_WRITE_URI_PERMISSION
-| Intent.FLAG_GRANT_READ_URI_PERMISSION);
-}
-mContext.startActivityForResult(takePictureIntent, TAKE_PHOTO);
-}
+// Create the File where the photo should go
+File photoFile = null;
+try {
+photoFile = createImageFile();
+} catch (IOException ex) {
+ex.printStackTrace();
+}
+// Continue only if the File was successfully created
+if (photoFile != null) {
+Uri photoURI = FileProvider.getUriForFile(mContext,
+mContext.getPackageName() + ".fileprovider", photoFile);
+takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
+mContext.startActivityForResult(takePictureIntent, TAKE_PHOTO);
 }
 }
 


core.git: 3 commits - android/source

2024-05-14 Thread Michael Weghorn (via logerrit)
 android/source/AndroidManifest.xml|2 
 android/source/build.gradle   |4 -
 android/source/gradle/wrapper/gradle-wrapper.properties   |4 -
 android/source/lint-baseline.xml  |   28 
--
 android/source/src/java/org/libreoffice/FormattingController.java |2 
 5 files changed, 31 insertions(+), 9 deletions(-)

New commits:
commit 5ad26dfac2a4d3f209721c5c3c9b7b6d6ad71a6f
Author: Michael Weghorn 
AuthorDate: Mon May 13 13:00:57 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 14 08:37:43 2024 +0200

android: Don't restrict taking photo to rear camera

Check for `FEATURE_CAMERA_ANY` ("The device has at least
one camera pointing in some direction, or can support an
external camera being connected to it.") [1] instead
of only the rear camera via `FEATURE_CAMERA`
("The device has a camera facing away from the screen.") [2]
when taking a photo is selected in the "Insert" menu, as
there's no need to restrict this to the rear camera.

This addresses this warning shown in Android Studio:

> You should look for any camera available on the device, not just the rear

Note however that trying to use that feature (with or
without this change in place) currently doesn't actually
work at least on a current device (e.g. an API 34 AVD),
"nothing happens" rather than the camera showing up to
be able to take a photo. This will be addressed
in an upcoming commit.

[1] 
https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_CAMERA_ANY
[2] 
https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_CAMERA

Change-Id: I52d2147df8fb3f1fdfb277376d7796380f9a8da0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167602
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/AndroidManifest.xml 
b/android/source/AndroidManifest.xml
index 0a11a1d3654b..3ece77d62bfd 100644
--- a/android/source/AndroidManifest.xml
+++ b/android/source/AndroidManifest.xml
@@ -6,7 +6,7 @@
 
 
 
-
+
 
 
 
AuthorDate: Mon May 13 11:35:20 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 14 08:37:37 2024 +0200

android: Update com.google.android.material:material to 1.12.0

Change-Id: I4ac5b67ddf978d6646dbbd67f858ffad3a6adeca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167587
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/build.gradle b/android/source/build.gradle
index b537a9ae3e61..7012c275aa33 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -32,7 +32,7 @@ dependencies {
 "libreoffice.jar",
 "unoloader.jar"
 ])
-implementation 'com.google.android.material:material:1.11.0'
+implementation 'com.google.android.material:material:1.12.0'
 implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
 implementation "androidx.multidex:multidex:2.0.1"
 }
commit 1610ebc06b34263bf3e525babe1e583b932f6242
Author: Michael Weghorn 
AuthorDate: Mon May 13 10:47:49 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 14 08:37:30 2024 +0200

android: Update Android Gradle Plugin to 8.4.0

... and gradle to 8.6, as suggested by Android Studio.

Update the lint baseline file to initially ignore
new warnings that the new version reports.
These can be handled separately.

Change-Id: I6ecd7300072c16ea583b5ba19b03de89d671b87e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167586
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/android/source/build.gradle b/android/source/build.gradle
index 8cbef7744d8e..b537a9ae3e61 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -21,7 +21,7 @@ buildscript {
 google()
 }
 dependencies {
-classpath 'com.android.tools.build:gradle:8.3.2'
+classpath 'com.android.tools.build:gradle:8.4.0'
 }
 }
 
diff --git a/android/source/gradle/wrapper/gradle-wrapper.properties 
b/android/source/gradle/wrapper/gradle-wrapper.properties
index cdea548c75ee..af9c6a996c1d 100644
--- a/android/source/gradle/wrapper/gradle-wrapper.properties
+++ b/android/source/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,7 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionSha256Sum=c16d517b50dd28b3f5838f0e844b7520b8f1eb610f2f29de7e4e04a1b7c9c79b
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
+distributionSha256Sum=85719317abd2112f021d4f41f09ec370534ba288432065f4b477b6a3b652910d
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
 validateDistributionUrl=true
 zipStoreBase

core.git: vcl/source

2024-05-13 Thread Michael Weghorn (via logerrit)
 vcl/source/control/spinfld.cxx |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 869b88488ac443cc64943254064da20b0f361c56
Author: Michael Weghorn 
AuthorDate: Mon May 13 16:37:45 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 14 07:25:44 2024 +0200

tdf#160824 vcl: Require mouse over spinfield to mouse-wheel through values

In the same way that

commit 22250df05830700b2555348b8ac46ee1007d0e5d
Author: Michael Weghorn 
Date:   Fri Dec 8 11:50:40 2023 +0100

tdf#158548 vcl: Require mouse over listbox to mouse-wheel through 
entries

restricted changing listbox values for the focused
listbox on mouse-wheel to the case when the listbox
is also hovered over by the mouse, do the same for
`SpinField` as well, to avoid accidently changing
the value as described e.g. for the tdf#160824
scenario.

This is also in line with Qt spin boxes that
only change their values on mouse-wheel when
the mouse pointer is above them.

For the gtk3 VCL plugin that uses native spin boxes,
this commit has no effect, and the value doesn't
change on mouse-wheel at all.

Change-Id: I22277294f76655cd13b1dc57416c82afe44460d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167604
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 973825a3a977..1eb8357a2940 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -543,9 +543,18 @@ bool SpinField::EventNotify(NotifyEvent& rNEvt)
 {
 if ((rNEvt.GetCommandEvent()->GetCommand() == CommandEventId::Wheel) 
&& !IsReadOnly())
 {
+const Point& rMousePos = 
rNEvt.GetCommandEvent()->GetMousePosPixel();
+bool bMouseHovered = maUpperRect.Contains(rMousePos) || 
maLowerRect.Contains(rMousePos);
+if (!bMouseHovered && mpEdit)
+{
+const tools::Rectangle aEditRect(mpEdit->GetPosPixel(), 
mpEdit->GetSizePixel());
+bMouseHovered = aEditRect.Contains(rMousePos);
+}
+
 MouseWheelBehaviour 
nWheelBehavior(GetSettings().GetMouseSettings().GetWheelBehavior());
-if (nWheelBehavior == MouseWheelBehaviour::ALWAYS
-   || (nWheelBehavior == MouseWheelBehaviour::FocusOnly && 
HasChildPathFocus()))
+if (bMouseHovered
+&& (nWheelBehavior == MouseWheelBehaviour::ALWAYS
+|| (nWheelBehavior == MouseWheelBehaviour::FocusOnly && 
HasChildPathFocus(
 {
 const CommandWheelData* pData = 
rNEvt.GetCommandEvent()->GetWheelData();
 if (pData->GetMode() == CommandWheelMode::SCROLL)


core.git: include/vcl vcl/source

2024-05-12 Thread Michael Weghorn (via logerrit)
 include/vcl/toolkit/combobox.hxx |   33 ++
 vcl/source/control/combobox.cxx  |  576 ++-
 2 files changed, 298 insertions(+), 311 deletions(-)

New commits:
commit 737a07897e7414228d727fd3d16b3bd47ff226fa
Author: Michael Weghorn 
AuthorDate: Fri May 10 16:55:49 2024 +0200
Commit: Michael Weghorn 
CommitDate: Mon May 13 06:31:55 2024 +0200

vcl: Merge ComboBox and ComboBox::Impl

This removes one level of indirection.

`ComboBox::Impl` had originally been introduced in

commit ece8699f8f22f6bae137c601bc29b83b75dc3bf3
Author: Michael Stahl 
Date:   Fri Jul 10 12:05:48 2015 +0200

vcl: pImplify ComboBox

The boost::signal stuff is quite heavy (33 kloc), so try to hide it
from the header.

Change-Id: I87826ccfd2a151aff274ffa6b7159a988f751808

, but all of the boost usage in here has been replaced
since then.

Change-Id: Ia8fb5cb895800edae104857c7713fa65e509a3c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167485
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/vcl/toolkit/combobox.hxx b/include/vcl/toolkit/combobox.hxx
index 89565cac8652..9e676601f8a8 100644
--- a/include/vcl/toolkit/combobox.hxx
+++ b/include/vcl/toolkit/combobox.hxx
@@ -31,15 +31,44 @@
 #define COMBOBOX_ENTRY_NOTFOUND (SAL_MAX_INT32)
 #define COMBOBOX_MAX_ENTRIES(SAL_MAX_INT32 - 1)
 
+class ImplBtn;
+class ImplListBox;
 class ImplListBoxWindow;
+class ImplListBoxFloatingWindow;
 class UserDrawEvent;
+struct ComboBoxBounds;
 
 /// A widget used to choose from a list of items and which has an entry.
 class VCL_DLLPUBLIC ComboBox : public Edit
 {
 private:
-struct SAL_DLLPRIVATE Impl;
-std::unique_ptr m_pImpl;
+VclPtr m_pSubEdit;
+VclPtr m_pImplLB;
+VclPtr m_pBtn;
+VclPtr m_pFloatWin;
+sal_uInt16 m_nDDHeight;
+sal_Unicode m_cMultiSep;
+bool m_isDDAutoSize : 1;
+bool m_isSyntheticModify : 1;
+bool m_isKeyBoardModify : 1;
+bool m_isMatchCase : 1;
+sal_Int32 m_nMaxWidthChars;
+sal_Int32 m_nWidthInChars;
+Link m_SelectHdl;
+
+void ImplInitComboBoxData();
+void ImplUpdateFloatSelection();
+ComboBoxBounds calcComboBoxDropDownComponentBounds(
+const Size , const Size ) const;
+
+DECL_LINK(ImplSelectHdl, LinkParamNone*, void);
+DECL_LINK(ImplCancelHdl, LinkParamNone*, void);
+DECL_LINK(ImplDoubleClickHdl, ImplListBoxWindow*, void);
+DECL_LINK(ImplClickBtnHdl, void*, void);
+DECL_LINK(ImplPopupModeEndHdl, FloatingWindow*, void);
+DECL_LINK(ImplSelectionChangedHdl, sal_Int32, void);
+DECL_LINK(ImplAutocompleteHdl, Edit&, void);
+DECL_LINK(ImplListItemSelectHdl , LinkParamNone*, void);
 
 protected:
 using Window::ImplInit;
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 89a53c537d91..f4327ac77024 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -36,7 +36,6 @@
 #include 
 #include 
 
-namespace {
 
 struct ComboBoxBounds
 {
@@ -47,54 +46,6 @@ struct ComboBoxBounds
 Size aButtonSize;
 };
 
-}
-
-struct ComboBox::Impl
-{
-ComboBox &  m_rThis;
-VclPtrm_pSubEdit;
-VclPtr m_pImplLB;
-VclPtr m_pBtn;
-VclPtr  m_pFloatWin;
-sal_uInt16  m_nDDHeight;
-sal_Unicode m_cMultiSep;
-boolm_isDDAutoSize: 1;
-boolm_isSyntheticModify   : 1;
-boolm_isKeyBoardModify: 1;
-boolm_isMatchCase : 1;
-sal_Int32   m_nMaxWidthChars;
-sal_Int32   m_nWidthInChars;
-Link   m_SelectHdl;
-
-explicit Impl(ComboBox & rThis)
-: m_rThis(rThis)
-, m_nDDHeight(0)
-, m_cMultiSep(0)
-, m_isDDAutoSize(false)
-, m_isSyntheticModify(false)
-, m_isKeyBoardModify(false)
-, m_isMatchCase(false)
-, m_nMaxWidthChars(0)
-, m_nWidthInChars(-1)
-{
-}
-
-void ImplInitComboBoxData();
-void ImplUpdateFloatSelection();
-ComboBoxBounds calcComboBoxDropDownComponentBounds(
-const Size , const Size ) const;
-
-DECL_LINK( ImplSelectHdl, LinkParamNone*, void );
-DECL_LINK( ImplCancelHdl, LinkParamNone*, void );
-DECL_LINK( ImplDoubleClickHdl, ImplListBoxWindow*, void );
-DECL_LINK( ImplClickBtnHdl, void*, void );
-DECL_LINK( ImplPopupModeEndHdl, FloatingWindow*, void );
-DECL_LINK( ImplSelectionChangedHdl, sal_Int32, void );
-DECL_LINK( ImplAutocompleteHdl, Edit&, void );
-DECL_LINK( ImplListItemSelectHdl , LinkParamNone*, void );
-};
-
-
 static void lcl_GetSelectedEntries( ::std::set< sal_Int32 >& rSelectedPos, 
std::u16string_view rText, sal_Unicode cTokenSep, const ImplEntryList& 
rEntryList )
 {
 if (rText.empty())
@

core.git: accessibility/inc accessibility/source

2024-05-10 Thread Michael Weghorn (via logerrit)
 accessibility/inc/standard/vclxaccessibleedit.hxx |3 +
 accessibility/inc/standard/vclxaccessibletextcomponent.hxx|5 ++
 accessibility/source/standard/vclxaccessibleedit.cxx  |   16 
 accessibility/source/standard/vclxaccessibletextcomponent.cxx |   18 +-
 4 files changed, 41 insertions(+), 1 deletion(-)

New commits:
commit ab7a94b8403e7fc89398a603a10e9002bd7e2077
Author: Michael Weghorn 
AuthorDate: Fri May 10 15:35:23 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 10 21:49:49 2024 +0200

tdf#160971 a11y: Send full text on changed combobox text

When the text of an editable combobox is changed
(e.g. using the up/down keys), the Orca screen
reader on Linux announces the newly inserted text.

This has been the case for other GTK or Qt
applications for a while, and with recent Orca
commit [1]

commit 3a9e6b8d7b16bf2fc7919868cfd1a16e44422710
Author: Michael Weghorn 
Date:   Fri May 10 10:16:58 2024 +0200

soffice: Use default logic for editable combobox value change

, the same logic is used for LibreOffice as well.

For the gtk3 VCL plugin which has a custom combobox
implementation using native GTK widgets, this generally
works since

commit 9f078ed7b625e86182d64d5ccfbb410cdd38081c
Author: Michael Weghorn 
Date:   Tue May 7 10:04:16 2024 +0200

tdf#160971 gtk3 a11y: Set role for custom editable combobox

However, the qt6 VCL plugin uses the VCL combobox
implementation, and only the actual difference between
the text of the previous and current entry was sent
in the TEXT_CHANGED event, resulting in Orca only
announcing those letters that were added/changed,
e.g. just "ans Narrow" when changing the font in the
Writer formatting toolbar from "Liberation Serif"
to "Liberation Sans Narrow".

This doesn't really make clear what entry is selected.
Align the a11y event with what GTK and Qt do
and set the full old and new entry texts in the event.

To do that, add a new virtual
`VCLXAccessibleTextComponent:PreferFullTextInTextChangedEvent`
that defaults to false to keep the previous behavior as default,
and override it for `VCLXAccessibleEdit` to return true
in the case that the edit is the subedit of a combobox
(the parent has a combobox role).
Use this in `VCLXAccessibleTextComponent::SetText` to
determine whether to notify just of the changed characters
or to send the whole old/new text.

With this in place, Orca also announces the whole new
entry text (e.g. "Liberation Sans Narrow" for the above
example) when using the qt6 VCL plugin.
(It currently additionally announces an extra "Selection
deleted" when switching entries, as the text selection
also changes, but that aspect is to be handled separate
from this change here.)

[1] 
https://gitlab.gnome.org/GNOME/orca/-/commit/3a9e6b8d7b16bf2fc7919868cfd1a16e44422710

Change-Id: I240aa0ad5ac9585e007d67a8c69e305cf1f38185
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167479
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/inc/standard/vclxaccessibleedit.hxx 
b/accessibility/inc/standard/vclxaccessibleedit.hxx
index b3b6a239b9d7..187a03264718 100644
--- a/accessibility/inc/standard/vclxaccessibleedit.hxx
+++ b/accessibility/inc/standard/vclxaccessibleedit.hxx
@@ -50,6 +50,9 @@ protected:
 virtual OUStringimplGetText() override;
 virtual voidimplGetSelection( sal_Int32& nStartIndex, 
sal_Int32& nEndIndex ) override;
 
+// VCLXAccessibleTextComponent
+virtual boolPreferFullTextInTextChangedEvent() override;
+
 public:
 VCLXAccessibleEdit( VCLXWindow* pVCLXindow );
 
diff --git a/accessibility/inc/standard/vclxaccessibletextcomponent.hxx 
b/accessibility/inc/standard/vclxaccessibletextcomponent.hxx
index 3585dd778574..9678eb15469b 100644
--- a/accessibility/inc/standard/vclxaccessibletextcomponent.hxx
+++ b/accessibility/inc/standard/vclxaccessibletextcomponent.hxx
@@ -40,6 +40,11 @@ class VCLXAccessibleTextComponent : public 
cppu::ImplInheritanceHelper<
 protected:
 voidSetText( const OUString& sText );
 
+// Whether text segments for old/new value in 
AccessibleEventId::TEXT_CHANGED
+// event should always include the whole old and new text instead of just
+// the characters that changed between the two
+virtual boolPreferFullTextInTextChangedEvent() 
{ return false; };
+
 virtual voidProcessWindowEvent( const 
VclWindowEvent& rVclWindowEvent ) override;
 
 // OCommonAccessibleText
diff --git a/accessibility/so

core.git: accessibility/source

2024-05-10 Thread Michael Weghorn (via logerrit)
 accessibility/source/extended/accessiblelistbox.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit c24db71bc56c5d81a6e8fb72b6d6358992d0
Author: Michael Weghorn 
AuthorDate: Fri May 10 13:33:35 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 10 16:24:12 2024 +0200

tdf#160971 a11y: Add null check in AccessibleListBox::getAccessibleRole

Add a null check in `AccessibleListBox::getAccessibleRole`.

Otherwise, LO Writer crashes on exit when using the qt6 VCL
plugin with Orca running for this scenario:

1) start Writer with the qt6 VCL plugin
2) press F6 until focus is in the formatting toolbar
3) use tab key to get to the editable comboboxes
4) use up/down keys to change entries
5) use Alt+Down to expand combobox
6) switch between entries using up/down keys
7) close Writer

The reason is that the window gets unset when when
`SvTreeListBox::dispose` emits the
`VclEventId::ObjectDying` event, see
`VCLXAccessibleComponent::ProcessWindowEvent`.

But then, Qt's AT-SPI adaptor wants to query the accessible
role when the `AccessibleEventId::CHILD` event is forwarded
in our Qt a11y bridge, which previously resulted in a
nullptr dereference with the below backtrace.

Just return `AccessibleRole::LIST` for the null case.

Backtrace:

1  std::__uniq_ptr_impl>::_M_ptr unique_ptr.h   
   199  0x7f0c1ee0b055
2  std::unique_ptr>::get
 unique_ptr.h  470  0x7f0c1ee0b035
3  std::unique_ptr>::operator bool   
unique_ptr.h  487  0x7f0c1ee4abc5
4  vcl::Window::GetStyle
 window2.cxx   989  0x7f0c1f0e594d
5  accessibility::AccessibleListBox::getAccessibleRole  
 accessiblelistbox.cxx 347  0x7f0be055205a
6  QtAccessibleWidget::role 
 QtAccessibleWidget.cxx380  0x7f0c151cc242
7  AtSpiAdaptor::pathForInterface   
 atspiadaptor.cpp  1771 0x7f0c13a8b112
8  AtSpiAdaptor::notifyAboutDestruction 
 atspiadaptor.cpp  1419 0x7f0c13a86e81
9  AtSpiAdaptor::notify 
 atspiadaptor.cpp  988  0x7f0c13a8246b
10 QSpiAccessibleBridge::notifyAccessibilityUpdate  
 qspiaccessiblebridge.cpp  85   0x7f0c13ad9bf2
11 QAccessible::updateAccessibility 
 qaccessible.cpp   940  0x7f0c13a603aa
12 QtAccessibleEventListener::notifyEvent   
 QtAccessibleEventListener.cxx 232  0x7f0c151c1363
13 comphelper::AccessibleEventNotifier::addEvent
 accessibleeventnotifier.cxx   256  0x7f0c270ee1b7
14 comphelper::OCommonAccessibleComponent::NotifyAccessibleEvent
 accessiblecomponenthelper.cxx 127  0x7f0c270e95b1
15 VCLXAccessibleComponent::ProcessWindowEvent  
 vclxaccessiblecomponent.cxx   229  0x7f0c20e80720
16 VCLXAccessibleComponent::WindowEventListener 
 vclxaccessiblecomponent.cxx   109  0x7f0c20e7fbbe
17 VCLXAccessibleComponent::LinkStubWindowEventListener 
 vclxaccessiblecomponent.cxx   98   0x7f0c20e7f58d
18 Link::Call
 link.hxx  111  0x7f0c1efa2898
19 vcl::Window::CallEventListeners  
 event.cxx 262  0x7f0c1ef9f62e
20 vcl::Window::dispose 
 window.cxx163  0x7f0c1f0f6513
21 Control::dispose 
 ctrl.cxx  65   0x7f0c1f177a06
22 SvTreeListBox::dispose   
 treelistbox.cxx   1340 0x7f0c1f464d1b
23 SvTabListBox::dispose
 svtabbx.cxx   243  0x7f0c1f407a09
24 VclReferenceBase::di

core.git: chart2/source

2024-05-10 Thread Michael Weghorn (via logerrit)
 chart2/source/controller/accessibility/AccessibleBase.cxx |9 -
 chart2/source/controller/inc/AccessibleBase.hxx   |5 +
 2 files changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 34bfb9f506fa661a19498176f20bf3dfb7d8ff6c
Author: Michael Weghorn 
AuthorDate: Fri May 10 08:18:56 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 10 16:23:27 2024 +0200

chart2 a11y: Drop ChildListVectorType typedef

Change-Id: Ie7ad5157bdcd261c8e5e6507b93b2820424c9125
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167432
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx 
b/chart2/source/controller/accessibility/AccessibleBase.cxx
index a823cf25c003..c297814bebcd 100644
--- a/chart2/source/controller/accessibility/AccessibleBase.cxx
+++ b/chart2/source/controller/accessibility/AccessibleBase.cxx
@@ -144,7 +144,7 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, 
const AccessibleUniqueId
 
 ClearableMutexGuard aGuard( m_aMutex );
 // make local copy for notification
-ChildListVectorType aLocalChildList( m_aChildList );
+std::vector> aLocalChildList(m_aChildList);
 aGuard.clear();
 
 for (auto const& localChild : aLocalChildList)
@@ -285,8 +285,7 @@ void AccessibleBase::RemoveChildByOId( const 
ObjectIdentifier& rOId )
 m_aChildOIDMap.erase( aIt );
 
 // search child in vector
-ChildListVectorType::iterator aVecIter =
-std::find( m_aChildList.begin(), m_aChildList.end(), xChild );
+auto aVecIter = std::find(m_aChildList.begin(), m_aChildList.end(), 
xChild);
 
 OSL_ENSURE( aVecIter != m_aChildList.end(),
 "Inconsistent ChildMap" );
@@ -361,7 +360,7 @@ void AccessibleBase::KillAllChildren()
 ClearableMutexGuard aGuard( m_aMutex );
 
 // make local copy for notification, and remove all children
-ChildListVectorType aLocalChildList;
+std::vector> aLocalChildList;
 aLocalChildList.swap( m_aChildList );
 m_aChildOIDMap.clear();
 
@@ -586,7 +585,7 @@ Reference< XAccessible > SAL_CALL 
AccessibleBase::getAccessibleAtPoint( const aw
 ( aRect.Y <= aPoint.Y && aPoint.Y <= (aRect.Y + aRect.Height)))
 {
 ClearableMutexGuard aGuard( m_aMutex );
-ChildListVectorType aLocalChildList( m_aChildList );
+std::vector> aLocalChildList( m_aChildList );
 aGuard.clear();
 
 Reference< XAccessibleComponent > aComp;
diff --git a/chart2/source/controller/inc/AccessibleBase.hxx 
b/chart2/source/controller/inc/AccessibleBase.hxx
index b7ccbac900da..788de8cebcae 100644
--- a/chart2/source/controller/inc/AccessibleBase.hxx
+++ b/chart2/source/controller/inc/AccessibleBase.hxx
@@ -283,9 +283,6 @@ private:
 Color getColor( eColorType eColType );
 
 private:
-/** type of the vector containing the accessible children
- */
-typedef std::vector< css::uno::Reference< css::accessibility::XAccessible 
> > ChildListVectorType;
 /** type of the hash containing a vector index for every AccessibleUniqueId
 of the object in the child list
  */
@@ -294,7 +291,7 @@ private:
 bool  m_bIsDisposed;
 const boolm_bMayHaveChildren;
 bool  m_bChildrenInitialized;
-ChildListVectorType   m_aChildList;
+std::vector> 
m_aChildList;
 
 ChildOIDMap   m_aChildOIDMap;
 


core.git: chart2/source

2024-05-10 Thread Michael Weghorn (via logerrit)
 chart2/source/controller/main/ChartController.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2684a1be8dceb0864772b57ce89ab822d198da04
Author: Michael Weghorn 
AuthorDate: Fri May 10 07:50:15 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 10 16:23:00 2024 +0200

chart2 a11y: Use XAccessible ref, not XInterface

Use the more specific type that
`Window::GetAccessible` returns.

Change-Id: Ied837b043997b4a51b280c71d0b35ca7eaa07385
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167431
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index f21bfad50549..5c9bbb2d0133 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1550,7 +1550,7 @@ void ChartController::impl_initializeAccessible()
 auto pChartWindow(GetChartWindow());
 if( !pChartWindow )
 return;
-Reference< XInterface > xInit( pChartWindow->GetAccessible(false) );
+Reference xInit = pChartWindow->GetAccessible(false);
 if(xInit.is())
 impl_initializeAccessible( dynamic_cast(*xInit) 
);
 #endif


core.git: 2 commits - vcl/unx

2024-05-08 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk3/a11y/atkwrapper.cxx |   24 ++--
 1 file changed, 6 insertions(+), 18 deletions(-)

New commits:
commit 5e1aaaf07d70cb8eda1c7f14a458680d9323ff74
Author: Michael Weghorn 
AuthorDate: Wed May 8 10:26:55 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed May 8 13:56:16 2024 +0200

gtk3 a11y: Drop superfluous check

If `nStateSet` is 0, no states will be set int the
loop anyway, so the extra check is not needed.

Change-Id: Id26f2210c51cb6bf952720f9a84696a327992df6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167330
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx
index a16e8f80834c..b83cf04d48b5 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -630,17 +630,13 @@ wrapper_ref_state_set( AtkObject *atk_obj )
 {
 try {
 sal_Int64 nStateSet = obj->mpContext->getAccessibleStateSet();
-
-if( nStateSet )
+for (int i = 0; i < 63; ++i)
 {
-for (int i=0; i<63; ++i)
-{
-// ATK_STATE_LAST_DEFINED is used to check if the state
-// is unmapped, do not report it to Atk
-sal_Int64 nState = sal_Int64(1) << i;
-if ( (nStateSet & nState) && mapAtkState( nState ) != 
ATK_STATE_LAST_DEFINED )
-atk_state_set_add_state( pSet, mapAtkState( nState ) );
-}
+// ATK_STATE_LAST_DEFINED is used to check if the state
+// is unmapped, do not report it to Atk
+sal_Int64 nState = sal_Int64(1) << i;
+if ((nStateSet & nState) && mapAtkState(nState) != 
ATK_STATE_LAST_DEFINED)
+atk_state_set_add_state(pSet, mapAtkState(nState));
 }
 }
 
commit addb7abeb8ec1a145d9ba35d3be8518f2502325b
Author: Michael Weghorn 
AuthorDate: Wed May 8 10:17:53 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed May 8 13:56:10 2024 +0200

gtk3 a11y: No longer manually add focused state for focus object

No longer manually add `ATK_STATE_FOCUSED` to the
ATK focus object.

The focused object should should have the
`css::accessbibility::AccessibleStateType::FOCUSED`
state set on UNO level, in which case this is already
mapped to the focused state in the lines above the
newly removed code, so explicitly addding it
again shouldn't be necessary.

If the state is missing, that most likely needs
to be fixed in the underlying `XAccessibleStateSet`
implementation.

Therefore, remove what looks like a workaround.
If any issues show up after this, let's rather take
a look at the underlying issues and try to fix things
there.

Change-Id: Ie7252c4b2dd2ec15c7a3bbc6a1a5e2830cdd39a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167309
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx
index db0aa1dbc907..a16e8f80834c 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -641,14 +641,6 @@ wrapper_ref_state_set( AtkObject *atk_obj )
 if ( (nStateSet & nState) && mapAtkState( nState ) != 
ATK_STATE_LAST_DEFINED )
 atk_state_set_add_state( pSet, mapAtkState( nState ) );
 }
-
-// We need to emulate FOCUS state for menus, menu-items etc.
-if( atk_obj == atk_get_focus_object() )
-atk_state_set_add_state( pSet, ATK_STATE_FOCUSED );
-/* FIXME - should we do this ?
-else
-atk_state_set_remove_state( pSet, ATK_STATE_FOCUSED );
-*/
 }
 }
 


core.git: vcl/uiconfig

2024-05-07 Thread Michael Weghorn (via logerrit)
 vcl/uiconfig/ui/combobox.ui |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 9f078ed7b625e86182d64d5ccfbb410cdd38081c
Author: Michael Weghorn 
AuthorDate: Tue May 7 10:04:16 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 7 16:17:26 2024 +0200

tdf#160971 gtk3 a11y: Set role for custom editable combobox

Set the combobox a11y role for the box in the .ui file
used for the custom gtk3 combobox implementation.

With this in place, moving focus to the "Font Name" or
another editable combobox in the Writer toolbar now
makes Orca announce that one as "editable combobox"
rather than just "text".

See also

commit 1e851093f0148d2c55fc3fd377d274f6703c71c9
    Author: Michael Weghorn 
Date:   Thu Apr 18 14:02:25 2024 +0200

tdf#159910 gtk3 a11y: Keep a11y props for combobox

for a very similar change that caused the proper
role to be announced for non-editable comboboxes.

Change-Id: I3062e5c062911040ef0ec5721d15fee78d85d0dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167262
Tested-by: Jenkins
    Reviewed-by: Michael Weghorn 

diff --git a/vcl/uiconfig/ui/combobox.ui b/vcl/uiconfig/ui/combobox.ui
index 6abaa6a25171..a9c697f10bc7 100644
--- a/vcl/uiconfig/ui/combobox.ui
+++ b/vcl/uiconfig/ui/combobox.ui
@@ -67,6 +67,11 @@
 2
   
 
+
+  
+combo-box
+  
+
 
   <class name="linked"/>
 


core.git: 2 commits - vcl/inc vcl/Library_vclplug_gtk3_kde5.mk vcl/Library_vclplug_gtk3.mk vcl/unx

2024-05-07 Thread Michael Weghorn (via logerrit)
 vcl/Library_vclplug_gtk3.mk|1 
 vcl/Library_vclplug_gtk3_kde5.mk   |1 
 vcl/inc/unx/gtk/atkbridge.hxx  |   25 -
 vcl/unx/gtk3/a11y/atkbridge.cxx|   32 ---
 vcl/unx/gtk3/a11y/atkutil.cxx  |   67 -
 vcl/unx/gtk3/a11y/atkutil.hxx  |   26 -
 vcl/unx/gtk3/gtkinst.cxx   |8 --
 vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkbridge.cxx |   12 
 8 files changed, 172 deletions(-)

New commits:
commit 26e7ddb2c87642099f1320279c96a9176ef18dfe
Author: Michael Weghorn 
AuthorDate: Tue May 7 08:38:29 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 7 16:16:55 2024 +0200

gtk3 a11y: Drop WindowEventHandler completely

As mentioned in

commit c45c64aeb57dce91965d7be54601128946455c90
Author: Michael Weghorn 
Date:   Mon May 6 14:44:36 2024 +0200

tdf#160806 tdf#160837 gtk3 a11y: Drop handling of some VclEventIds

, the a11y bridge should not have to handle VCL events itself,
but all relevant events should be forwarded to the a11y
event listener as appropriate `AccessibleEventObject` and be handled
by the a11y event listener instead, see `AtkListener::notifyEvent`
for the gtk3 implementation.

Now that handling of all VCL events has been dropped in
previous commits, drop the `WindowEventHandler` completely.
This also means that the call to `InitAtkBridge` when initializing
the `GtkInstance` and the `DeInitAtkBridge` on destruction
is no longer necessary.

In a quick test with the Orca screen reader and the gtk3
VCL plugin, nothing suspicious showed up, things were
still working as expected and experienced prior to the
change series dropping the VCL event handling from the
gtk3 a11y bridge.

Change-Id: Ieed270b636f361c57cd4e78aceaecc7d174409d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167256
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/vcl/Library_vclplug_gtk3.mk b/vcl/Library_vclplug_gtk3.mk
index 0809edd770a7..ff631f17b450 100644
--- a/vcl/Library_vclplug_gtk3.mk
+++ b/vcl/Library_vclplug_gtk3.mk
@@ -82,7 +82,6 @@ $(eval $(call gb_Library_use_externals,vclplug_gtk3,\
 
 $(eval $(call gb_Library_add_exception_objects,vclplug_gtk3,\
 vcl/unx/gtk3/a11y/atkaction \
-vcl/unx/gtk3/a11y/atkbridge \
 vcl/unx/gtk3/a11y/atkcomponent \
 vcl/unx/gtk3/a11y/atkeditabletext \
 vcl/unx/gtk3/a11y/atkfactory \
diff --git a/vcl/Library_vclplug_gtk3_kde5.mk b/vcl/Library_vclplug_gtk3_kde5.mk
index 853ec7aafa4e..c58619af8c5d 100644
--- a/vcl/Library_vclplug_gtk3_kde5.mk
+++ b/vcl/Library_vclplug_gtk3_kde5.mk
@@ -88,7 +88,6 @@ $(eval $(call gb_Library_use_externals,vclplug_gtk3_kde5,\
 
 $(eval $(call gb_Library_add_exception_objects,vclplug_gtk3_kde5,\
vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkaction \
-   vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkbridge \
vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkcomponent \
vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkeditabletext \
vcl/unx/gtk3_kde5/a11y/gtk3_kde5_atkfactory \
diff --git a/vcl/inc/unx/gtk/atkbridge.hxx b/vcl/inc/unx/gtk/atkbridge.hxx
deleted file mode 100644
index e77a9ab571e3..
--- a/vcl/inc/unx/gtk/atkbridge.hxx
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#pragma once
-
-bool InitAtkBridge();
-void DeInitAtkBridge();
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk3/a11y/atkbridge.cxx b/vcl/unx/gtk3/a11y/atkbridge.cxx
deleted file mode 100644
index c7cb32ca3ce2..
--- a/vcl/unx/gtk3/a11y/atkbridge.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozil

core.git: 2 commits - vcl/unx

2024-05-07 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk3/a11y/atkutil.cxx |   92 --
 1 file changed, 92 deletions(-)

New commits:
commit fedd4886b0b63ea3254ea4ce4b7f9b5b73af95f0
Author: Michael Weghorn 
AuthorDate: Tue May 7 08:19:35 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 7 16:16:41 2024 +0200

gtk3 a11y: Drop VclEventId::MenuHighlight processing

Drop the manual processing of `VclEventId::MenuHighlight`
in the gtk3 a11y bridge.

As mentioned in

commit c45c64aeb57dce91965d7be54601128946455c90
Author: Michael Weghorn 
Date:   Mon May 6 14:44:36 2024 +0200

tdf#160806 tdf#160837 gtk3 a11y: Drop handling of some VclEventIds

, the a11y bridge should not have to handle VCL events itself,
but all relevant events should be forwarded to the a11y
event listener as appropriate `AccessibleEventObject` and be handled
by the a11y event listener instead, see `AtkListener::notifyEvent`
for the gtk3 implementation.

In a quick test, menu items were still announced
just fine by the Orca screen reader when using the
gtk3 VCL plugin with this commit in place.

By now, most menus should be native GTK widgets anyway.
For non-native menus,
`OAccessibleMenuBaseComponent::ProcessMenuEvent` contains
handling for the `VclEventId::MenuHighlight` event that
should be taking care of forwarding that as the corresponding
a11y event to the a11y bridges. If anything is missing after
this commit, that's probably a good starting point for further
analysis.

Change-Id: Ia8686101dc559ed98b48285eac15c35fc10818af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167254
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/vcl/unx/gtk3/a11y/atkutil.cxx b/vcl/unx/gtk3/a11y/atkutil.cxx
index 6cc52a56ba6c..d10bc3b27967 100644
--- a/vcl/unx/gtk3/a11y/atkutil.cxx
+++ b/vcl/unx/gtk3/a11y/atkutil.cxx
@@ -306,47 +306,12 @@ rtl::Reference 
GtkSalData::GetDocumentFocusListener()
 return xDFL;
 }
 
-static void handle_menu_highlighted(::VclMenuEvent const * pEvent)
-{
-try
-{
-Menu* pMenu = pEvent->GetMenu();
-sal_uInt16 nPos = pEvent->GetItemPos();
-
-if( pMenu &&  nPos != 0x)
-{
-uno::Reference< accessibility::XAccessible > xAccessible ( 
pMenu->GetAccessible() );
-
-if( xAccessible.is() )
-{
-uno::Reference< accessibility::XAccessibleContext > xContext ( 
xAccessible->getAccessibleContext() );
-
-if( xContext.is() )
-
atk_wrapper_notify_focus_change(xContext->getAccessibleChild(nPos));
-}
-}
-}
-catch (const uno::Exception&)
-{
-g_warning( "Exception caught processing menu highlight events" );
-}
-}
-
-/*/
-
 static void WindowEventHandler(void *, VclSimpleEvent& rEvent)
 {
 try
 {
 switch (rEvent.GetId())
 {
-case VclEventId::MenuHighlight:
-if (const VclMenuEvent* pMenuEvent = dynamic_cast())
-{
-handle_menu_highlighted(pMenuEvent);
-}
-break;
-
 case VclEventId::TabpageActivate:
 handle_tabpage_activated(static_cast< ::VclWindowEvent const * 
>()->GetWindow());
 break;
commit f44b1cf1fc2925d54512f1f04361ac2c2fc7d276
Author: Michael Weghorn 
AuthorDate: Tue May 7 08:08:49 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 7 16:16:33 2024 +0200

gtk3 a11y: Drop VclEventId::ToolboxHighlight{,Off} processing

Drop the manual processing of `VclEventId::ToolboxHighlight`
in the gtk3 a11y bridge.

As mentioned in

commit c45c64aeb57dce91965d7be54601128946455c90
Author: Michael Weghorn 
Date:   Mon May 6 14:44:36 2024 +0200

tdf#160806 tdf#160837 gtk3 a11y: Drop handling of some VclEventIds

, the a11y bridge should not have to handle VCL events itself,
but all relevant events should be forwarded to the a11y
event listener as appropriate `AccessibleEventObject` and be handled
by the a11y event listener instead, see `AtkListener::notifyEvent`
for the gtk3 implementation.

In a quick test, toolbar items were still announced
just fine by the Orca screen reader when using the
gtk3 VCL plugin with this commit in place.

`VCLXAccessibleToolBox::ProcessWindowEvent` handles
`VclEventId::ToolboxHighlight` and
`VclEventId::ToolboxHighlightOff` whose manual processing
is now dropped from gtk3, so the former might be a good place
to further look into if anything is still missing after
this commit.

The now dropped handling was originally added in

commit e98163

Re: GSoC project to add CPDB support to the LibreOffice print dialog

2024-05-07 Thread Michael Weghorn
On 2024-05-06 19:22, Biswadeep Purkayastha wrote:> I am Biswadeep 
Purkayastha, a GSoC 2024 contributor to OpenPrinting. In
the upcoming months I'll be working on getting CPDB support into the 
LibreOffice print dialogs. I had previously reached out to the community 
asking for a mentor to help me from the LibreOffice side and I am happy 
to announce that Michael Weghorn will be mentoring me from the 
LibreOffice side on this project. I look forward to working on this 
project with my mentors and being a part of the open-source community.


Thanks for the update and welcome again!
I'm looking forward to working together and hope you'll have a great 
GSoC experience!


OpenPGP_signature.asc
Description: OpenPGP digital signature


core.git: accessibility/inc

2024-05-06 Thread Michael Weghorn (via logerrit)
 accessibility/inc/extended/accessibletabbar.hxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit b420a5cd2424d2fc5efa3fcc395d14366f4b2773
Author: Michael Weghorn 
AuthorDate: Mon May 6 12:38:33 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 7 06:07:11 2024 +0200

a11y: Drop AccessibleChildren typedef

Change-Id: I13946bb4a991dceeb26a0a9364f6067397b94001
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167197
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/accessibility/inc/extended/accessibletabbar.hxx 
b/accessibility/inc/extended/accessibletabbar.hxx
index b921fdb16719..86848679ffbb 100644
--- a/accessibility/inc/extended/accessibletabbar.hxx
+++ b/accessibility/inc/extended/accessibletabbar.hxx
@@ -38,9 +38,7 @@ namespace accessibility
css::accessibility::XAccessible,
css::lang::XServiceInfo>
 {
-typedef std::vector< css::uno::Reference< 
css::accessibility::XAccessible > > AccessibleChildren;
-
-AccessibleChildren  m_aAccessibleChildren;
+std::vector> 
m_aAccessibleChildren;
 
 virtual voidProcessWindowEvent( const VclWindowEvent& 
rVclWindowEvent ) override;
 voidFillAccessibleStateSet( sal_Int64& rStateSet );


core.git: winaccessibility/source

2024-05-06 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/AccActionBase.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 0feb490c7625ed1bef7c59d197436fc849bd8dfa
Author: Michael Weghorn 
AuthorDate: Mon May 6 13:16:04 2024 +0100
Commit: Michael Weghorn 
CommitDate: Tue May 7 06:06:45 2024 +0200

wina11y: Return E_INVALIDARG if out param is null

Change-Id: Ia7abdd7fe1fbc5b1a6eaecf7d842852bc3815e6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167201
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/winaccessibility/source/UAccCOM/AccActionBase.cxx 
b/winaccessibility/source/UAccCOM/AccActionBase.cxx
index 0b7a652cef9f..aa5f63b55c61 100644
--- a/winaccessibility/source/UAccCOM/AccActionBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccActionBase.cxx
@@ -58,16 +58,18 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CAccActionBase::nActions(/*[out,retval]*/long*
 {
 SolarMutexGuard g;
 
+if (!nActions)
+return E_INVALIDARG;
+
 try {
 
-if( pRXAct.is() && nActions != nullptr )
+if (pRXAct.is())
 {
 *nActions = pRXAct->getAccessibleActionCount();
 return S_OK;
 }
-if( nActions != nullptr )
-*nActions = 0;
 
+*nActions = 0;
 return S_OK;
 
 } catch(...) { return E_FAIL; }


core.git: include/vcl vcl/source vcl/unx

2024-05-06 Thread Michael Weghorn (via logerrit)
 include/vcl/vclevent.hxx   |1 -
 vcl/source/window/toolbox2.cxx |9 -
 vcl/unx/gtk3/a11y/atkutil.cxx  |   38 --
 3 files changed, 48 deletions(-)

New commits:
commit 593923ee108b01c03ee3b14295fedfb8d07e7ea0
Author: Michael Weghorn 
AuthorDate: Mon May 6 15:45:39 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 7 06:06:01 2024 +0200

tdf#160806 tdf#160837 gtk3 a11y: Drop VclEventId::ToolboxButtonStateChanged

Similar to how the previous

Change-Id: I00e62016ced2fbb8796960671f5e58a3ceac4b29
Author: Michael Weghorn 
Date:   Mon May 6 14:44:36 2024 +0200

tdf#160806 tdf#160837 gtk3 a11y: Drop handling of some VclEventIds

dropped handling for `VclEventId::WindowGetFocus`
and `VclEventId::ObjectDying` in the gtk3 a11y bridge,
do the same for `VclEventId::ToolboxButtonStateChanged`.

And drop `VclEventId::ObjectDying` completely, as the
gtk3 a11y bridge was the only place processing it.

That event and the handling had been introduced in

commit 3b40f502341272e989ae5266a1f8a03f2736449b
Author: Ivo Hinkelmann 
Date:   Tue Feb 5 11:30:51 2008 +

INTEGRATION: CWS fwk83_SRC680 (1.7.186); FILE MERGED
2008/01/30 12:40:39 obr 1.7.186.2: fix for fedora tinderbox (64bit)
2008/01/15 23:49:28 obr 1.7.186.1: #i70872# create wrapper for 
toolbox items that change state

commit a1cbbd113da4ce3d5342d9ae5ff1c8d2137aa59c
Author: Ivo Hinkelmann 
Date:   Tue Feb 5 11:30:25 2008 +

INTEGRATION: CWS fwk83_SRC680 (1.51.160); FILE MERGED
2008/01/14 14:35:26 cd 1.51.160.1: #i70872# Added 
VCLEVENT_TOOLBOX_BUTTONCHANGED to notify accessibility implementation that an 
action happens to a toolbox button

commit 3f1afd178875babe7ab79d22ab260221665bfb3f
Author: Ivo Hinkelmann 
Date:   Tue Feb 5 11:29:57 2008 +

INTEGRATION: CWS fwk83_SRC680 (1.2.262); FILE MERGED
2008/01/14 14:35:26 cd 1.2.262.1: #i70872# Added 
VCLEVENT_TOOLBOX_BUTTONCHANGED to notify accessibility implementation that an 
action happens to a toolbox button

to ensure that an a11y object is created for toolbar
buttons whose state changes, so that the corresponding
a11y events are forwarded to the platform layer, see
the referenced OOo bug #i70872# [1] for more details.

This seems to be no longer necessary.
By now, at least the scenario of toggling the
bold/italics/underline status of text is
announced just fine by Orca 46.1-1 on Debian
testing with this change in place.

(FWIW, tdf#123864 and the corresponding commits are more
recent tickets/commits related to the topic.)

Like for the above-mentioned change,
dropping that handling addresses another case where the
work window/root pane's a11y object when walking up
the a11y hierarchy would be problematic, as it doesn't
take into account the GtkWidget hierarchy.

Sample backtrace of how the "problematic" a11y object
was created (frame 1 below is the one where the a11y object
with role root pane is created.)

1  atk_object_wrapper_new  
atkwrapper.cxx 983  0x7f620365672b
2  atk_object_wrapper_ref  
atkwrapper.cxx 948  0x7f62036560a0
3  atk_object_wrapper_new  
atkwrapper.cxx 1000 0x7f6203656952
4  atk_object_wrapper_ref  
atkwrapper.cxx 948  0x7f62036560a0
5  atk_object_wrapper_new  
atkwrapper.cxx 1000 0x7f6203656952
6  atk_object_wrapper_ref  
atkwrapper.cxx 948  0x7f62036560a0
7  atk_object_wrapper_new  
atkwrapper.cxx 1000 0x7f6203656952
8  atk_object_wrapper_ref  
atkwrapper.cxx 948  0x7f62036560a0
9  create_wrapper_for_child
atkutil.cxx359  0x7f620364c740
10 handle_toolbox_buttonchange 
atkutil.cxx376  0x7f620364c1ef
11 WindowEventHandler  
atkutil.cxx438  0x7f620364bd7f
12 Link::Call   
link.hxx   111  0x7f620dfd4ef8
13 VclEventListeners::Call 
vclevent.cxx   46   0x7f620dfd3f1a
14 Application::ImplCallEven

core.git: 3 commits - vcl/unx

2024-05-06 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk3/a11y/atkutil.cxx |  205 ++
 1 file changed, 30 insertions(+), 175 deletions(-)

New commits:
commit c45c64aeb57dce91965d7be54601128946455c90
Author: Michael Weghorn 
AuthorDate: Mon May 6 14:44:36 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 7 06:05:55 2024 +0200

tdf#160806 tdf#160837 gtk3 a11y: Drop handling of some VclEventIds

Drop custom handling for VCL events `VclEventId::WindowGetFocus`
and `VclEventId::ObjectDying` in the gtk3 a11y bridge.

In my understanding, the a11y bridge should not have to
handle any of these by itself, but all relevant a11y
events should be forwarded to the a11y listener
as an appropriate `AccessibleEventObject` and be handled
by the a11y event listener instead, see
`AtkListener::notifyEvent` for the gtk3 implementation.

In a quick test with Orca, I didn't notice anything not being
announced anymore with this change in place.

If something is still not announced due to this change, a
proper fix is likely to make sure that a proper a11y event
is emitted and handled in `AtkListener::notifyEvent` instead.

Note how `VCLXAccessibleComponent::ProcessWindowEvent` already
handles the `VclEventId::WindowGetFocus` and
`VclEventId::ObjectDying` window events. This (or
a corresponding override in a subclass) and
`VclEventId::ObjectDying` are potentially good places to
start analysis if this change here results in any regressions.

Dropping this custom handling also fixes one problematic
way that an accessible object would be created for the
work window/root panel (e.g. in Writer) from the corresponding
XAccessible independent of the corresponding GTK Widget hierarchy,
thus breaking the a11y hierarchy (ascending the tree doesn't
work, see tdf#160806).

This could be observed by starting LO Writer with the gtk3 VCL
plugin first, then start Accerciser.

Printing the a11y info for the parent of the object with role
root pane as shown in Accerciser:

In [1]: acc.parent
Out[1]: 
In [2]: acc.parent.role
Out[2]: 
In [3]: acc.parent.role
Out[3]: 

Selecting the object shown as the parent in Accerciser's tree
of LO's a11y hierarchy shows that this is not the same object:

In [4]: acc
Out[4]: 
In [5]: acc.role
Out[5]: 

and consequently, the first child of that accessible doesn't
report the accessible itself as its parent:

In [6]: acc.get_child_at_index(0).parent == acc
Out[6]: False

The commit message of

commit 252b1591d5e4e3adbf7063b56c2b578fe046ad3d
Author: Michael Weghorn 
Date:   Tue Apr 30 15:30:52 2024 +0200

tdf#159369 tdf#160806 tdf#160837 gtk3 a11y: Don't skip parents one 
way

has some more background information.

Extra local change in place showing where the accessible object gets
created (used for analysis with rr):

diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx 
b/vcl/unx/gtk3/a11y/atkwrapper.cxx
index db0aa1dbc907..c73d28987f26 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -977,6 +977,10 @@ atk_object_wrapper_new( const css::uno::Reference< 
css::accessibility::XAccessib

 AtkObject* atk_obj = ATK_OBJECT(pWrap);
 atk_obj->role = mapToAtkRole(xContext->getAccessibleRole(), 
xContext->getAccessibleStateSet());
+// NOTE: the object of interest is root pane, breaks the a11y 
hierarchy
+// as it reports wrong parent
+if (atk_obj->role == ATK_ROLE_ROOT_PANE)
+SAL_WARN("vcl.gtk", "Creating wrapper for root pane");
 atk_obj->accessible_parent = parent;

 ooo_wrapper_registry_add( rxAccessible, atk_obj );

Sample backtrace of how the problematic accessible object
got created without this commit in place:

1  atk_object_wrapper_new  
atkwrapper.cxx   983  0x7fb5dda5ae8b
2  atk_object_wrapper_ref  
atkwrapper.cxx   948  0x7fb5dda5a800
3  atk_wrapper_notify_focus_change 
atkutil.cxx  47   0x7fb5dda4cab0
4  handle_get_focus
atkutil.cxx  451  0x7fb5dda4debd
5  WindowEventHandler  
atkutil.cxx  512  0x7fb5dda4d9e3
6  Link::Call   
link.hxx 111  0x7fb5e81d4ef8
7  VclEventListeners::Call 
vclevent.cxx

Re: Which GUI toolkit should I learn so that I can "Hack the UI"

2024-05-06 Thread Michael Weghorn

On 2024-05-03 19:15, Printf Debugging wrote:
**Opinions invited**: I want to work on the UI, beyond small issues, 
like creating custom widgets, notebookbar, tabbed UI etc. I feel that I 
need to know a GUI toolkit well, like gtk or qt for that. So some days 
ago, I started playing around with GTK. My question is that which 
toolkit will be more useful? I picked GTK because we use .ui files for 
the UI, and being good at GTK will somehow help when working on LO UI, 
but again I don't know, that's just an idea.


Starting with GTK generally sounds reasonable to me.
Concepts are usually very similar in other toolkits (like Qt), so 
learning GTK will also help understanding those better.


In any case, I recommend explicitly testing the non-GTK case when doing 
UI changes (with SAL_USE_VCLPLUGIN=gen and qt5/qt6/kf5/kf6 on Linux or 
by testing on a different platform).


OpenPGP_signature.asc
Description: OpenPGP digital signature


core.git: include/svx sd/inc sd/source

2024-05-03 Thread Michael Weghorn (via logerrit)
 include/svx/svdpage.hxx|4 ++--
 sd/inc/Annotation.hxx  |2 +-
 sd/inc/sdpage.hxx  |2 +-
 sd/source/core/annotations/Annotation.cxx  |5 +++--
 sd/source/core/sdpage2.cxx |7 +++
 sd/source/filter/pdf/sdpdffilter.cxx   |3 +--
 sd/source/ui/annotations/annotationmanager.cxx |3 +--
 sd/source/ui/unoidl/unopage.cxx|4 +---
 8 files changed, 13 insertions(+), 17 deletions(-)

New commits:
commit b7ba358d48c1419142f88b8121b848113969eaaf
Author: Michael Weghorn 
AuthorDate: Thu May 2 17:12:55 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 3 08:11:53 2024 +0200

sd, svx: Return new annotation instead of using out param

Let `SdrPage::createAnnotation` et al. return the newly
created annotation rather than using an out parameter,
which makes this more straightforward.

Change-Id: Iee0561859756522ef33680c2cc9b492541a31d5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167019
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index c8c7eecddd5c..0747c4625773 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -40,7 +41,6 @@
 namespace model { class Theme; }
 namespace reportdesign { class OSection; }
 namespace sdr::contact { class ViewContact; }
-namespace sdr::annotation { class Annotation; }
 class SdrPage;
 class SdrModel;
 class SfxItemPool;
@@ -555,7 +555,7 @@ public:
 
 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 
-virtual void createAnnotation(rtl::Reference& 
/*xAnnotation*/) { assert(false); }
+virtual rtl::Reference createAnnotation() { 
assert(false); return nullptr; }
 virtual void addAnnotation(rtl::Reference 
const& /*xAnnotation*/, int /*nIndex*/) { assert(false); }
 virtual void removeAnnotation(rtl::Reference 
const& /*xAnnotation*/) { assert(false); }
 
diff --git a/sd/inc/Annotation.hxx b/sd/inc/Annotation.hxx
index f19584525865..00a0b2a22af8 100644
--- a/sd/inc/Annotation.hxx
+++ b/sd/inc/Annotation.hxx
@@ -46,7 +46,7 @@ class SfxViewShell;
 namespace sd
 {
 
-void createAnnotation(rtl::Reference& 
xAnnotation, SdPage* pPage);
+rtl::Reference createAnnotation(SdPage* pPage);
 
 std::unique_ptr 
CreateUndoInsertOrRemoveAnnotation(rtl::Reference& 
xAnnotation, bool bInsert);
 
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index efaf3fa876bf..5c393082ad40 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -364,7 +364,7 @@ public:
 */
 bool IsPrecious() const { return mbIsPrecious; }
 
-void createAnnotation(rtl::Reference& 
xAnnotation) override;
+rtl::Reference createAnnotation() override;
 void addAnnotation(rtl::Reference const& 
xAnnotation, int nIndex) override;
 void removeAnnotation(rtl::Reference const& 
xAnnotation) override;
 
diff --git a/sd/source/core/annotations/Annotation.cxx 
b/sd/source/core/annotations/Annotation.cxx
index 8c3e76d6a95f..1d1786ff460c 100644
--- a/sd/source/core/annotations/Annotation.cxx
+++ b/sd/source/core/annotations/Annotation.cxx
@@ -61,10 +61,11 @@ protected:
 
 }
 
-void createAnnotation(rtl::Reference& 
xAnnotation, SdPage* pPage )
+rtl::Reference createAnnotation(SdPage* pPage )
 {
-xAnnotation.set(new Annotation(comphelper::getProcessComponentContext(), 
pPage));
+rtl::Reference xAnnotation(new 
Annotation(comphelper::getProcessComponentContext(), pPage));
 pPage->addAnnotation(xAnnotation, -1);
+return xAnnotation;
 }
 
 Annotation::Annotation(const uno::Reference& context, 
SdPage* pPage)
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index 74d3dd94334f..e6dbc1f2a560 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -379,8 +379,7 @@ void SdPage::lateInit(const SdPage& rSrcPage)
 // annotations
 for (auto const& rSourceAnnotation : rSrcPage.maAnnotations)
 {
-rtl::Reference aNewAnnotation;
-createAnnotation(aNewAnnotation);
+rtl::Reference aNewAnnotation = 
createAnnotation();
 aNewAnnotation->setPosition(rSourceAnnotation->getPosition());
 aNewAnnotation->setSize(rSourceAnnotation->getSize());
 aNewAnnotation->setAuthor(rSourceAnnotation->getAuthor());
@@ -552,9 +551,9 @@ bool SdPage::Equals(const SdPage& rOtherPage) const
 return true;
  }
 
-void SdPage::createAnnotation(rtl::Reference& 
xAnnotation)
+rtl::Reference SdPage::createAnnotation()
 {
-sd::createAnnotation(xAnnotation, this);
+return sd::createAnnotation(this);
 }
 
 void SdPage::addAnnotation(rtl::Reference const& 
xAnnotation, int nIndex )
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx 
b/sd/source/filter/pdf/s

core.git: vcl/unx

2024-05-02 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk4/a11y.cxx |   11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 192bda84402bda175d7620319c019747b24de460
Author: Michael Weghorn 
AuthorDate: Thu May 2 09:32:22 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 3 07:27:13 2024 +0200

gtk4 a11y: Align role mapping with upstream GTK

Align the gtk4 a11y role mapping with what upstream
GTK 4 does with current git main (as of commit
0064500146fc080dae1ef2b30bebf7bb8b35a52f), see this
upstream GTK commit [0] and the one it refers to for
more details:

commit ad8613876c753cea8695dc8b03dcd37eb8e723a5
Author: Michael Weghorn 
Date:   Tue Apr 30 14:44:11 2024 +0200

a11y atspi: Improve mapping for container roles

GTK_ACCESSIBLE_ROLE_GENERIC is for
"a nameless container that has no semantic meaning of its own",
for which AT-SPI role ATSPI_ROLE_PANEL [1]
("A generic container that is often used to group
objects.") fits better than ATSPI_ROLE_FILLER
("A object that fills up space in a user interface."),
so map to this one.

With this in place, widgets like GtkBox are again
reported with the panel role on AT-SPI level after
commit a86923de943b6a42ba431be2a336972dca9c587d
("a11y: Change the role for many containers"),
whose commit message suggests that the change
on the AT-SPI level was unintended.

For GTK_ACCESSIBLE_ROLE_GROUP, use the corresponding
ATSPI_ROLE_GROUPING ("A group of related widgets.
This group typically has a label.").

[1] https://docs.gtk.org/atspi2/enum.Role.html

This causes the LO a11y roles `PANEL`, `SPLIT_PANE` and
`ROOT_PANE` to be mapped to the AT-SPI panel role again.

With the above-mentioned GTK upstream change, the native
GTK widgets now also use the panel role without having
to explicitly set anything on LO side rather than being
fillers, which removes the need to set them explicitly,
see the full commit message of

commit f6ca163d3f6383d3a48dbdacc5410e630d678ea1
Author: Michael Weghorn 
Date:   Fri Apr 26 12:43:24 2024 +0200

gtk4 a11y: Don't create second AT context for OOoFixed

for more details.

Also, map the LO `FILLER` role to `GTK_ACCESSIBLE_ROLE_WIDGET`
which GTK maps to the AT-SPI filler role.
(The previously used `GTK_ACCESSIBLE_ROLE_GENERIC`
is now mapped to the AT-SPI panel role,  which
is for widget containers rather than fillers.)

[0] 
https://gitlab.gnome.org/GNOME/gtk/-/commit/ad8613876c753cea8695dc8b03dcd37eb8e723a5

Change-Id: I1d1a8f626911455481d2d722790e8915daa921c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166995
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index bf66b058b231..4860c7cff33d 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -93,10 +93,9 @@ map_accessible_role(const 
css::uno::Reference&
 eRole = GTK_ACCESSIBLE_ROLE_LINK;
 break;
 case css::accessibility::AccessibleRole::PANEL:
-eRole = GTK_ACCESSIBLE_ROLE_GROUP;
-break;
 case css::accessibility::AccessibleRole::ROOT_PANE:
-eRole = GTK_ACCESSIBLE_ROLE_GROUP;
+case css::accessibility::AccessibleRole::SPLIT_PANE:
+eRole = GTK_ACCESSIBLE_ROLE_GENERIC;
 break;
 case css::accessibility::AccessibleRole::MENU_BAR:
 eRole = GTK_ACCESSIBLE_ROLE_MENU_BAR;
@@ -108,9 +107,6 @@ map_accessible_role(const 
css::uno::Reference&
 case css::accessibility::AccessibleRole::POPUP_MENU:
 eRole = GTK_ACCESSIBLE_ROLE_MENU;
 break;
-case css::accessibility::AccessibleRole::SPLIT_PANE:
-eRole = GTK_ACCESSIBLE_ROLE_GROUP;
-break;
 case css::accessibility::AccessibleRole::TOOL_BAR:
 eRole = GTK_ACCESSIBLE_ROLE_TOOLBAR;
 break;
@@ -159,7 +155,8 @@ map_accessible_role(const 
css::uno::Reference&
 #endif
 break;
 case css::accessibility::AccessibleRole::FILLER:
-eRole = GTK_ACCESSIBLE_ROLE_GENERIC;
+// GTK maps this to ATSPI_ROLE_FILLER
+eRole = GTK_ACCESSIBLE_ROLE_WIDGET;
 break;
 case css::accessibility::AccessibleRole::PUSH_BUTTON:
 case css::accessibility::AccessibleRole::BUTTON_DROPDOWN:


core.git: 2 commits - vcl/unx

2024-04-30 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk3/a11y/atkfactory.cxx |   83 +--
 1 file changed, 12 insertions(+), 71 deletions(-)

New commits:
commit be543e321552d4331e7dddca954a2b57f4c7f379
Author: Michael Weghorn 
AuthorDate: Tue Apr 30 16:17:25 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Apr 30 20:53:20 2024 +0200

tdf#159369 tdf#160806 gtk3 a11y: Drop fallback dummy a11y obj

No longer return a dummy AtkObject in
`wrapper_factory_create_accessible`, but drop the
implementation of that dummy object completely.

As far as I understand, the code path previously
creating those dummy objects should never be triggered,
so add asserts to detect any cases where it does.
However, gracefully return nullptr for release builds
for now at least.

This dummy implementation was originally added
as part of:

commit 62f451cb03d5202e2f15bf440c53a61b2efd99f8
Date:   Fri May 5 09:54:24 2006 +

INTEGRATION: CWS atkbridge (1.1.2); FILE ADDED
2006/03/31 12:19:39 obr 1.1.2.12: #i63583# eliminated warnings
2006/03/28 10:49:45 obr 1.1.2.11: #i47890# redid the last patch to 
make it more clear
2006/03/23 14:45:26 obr 1.1.2.10: fixed endless loop problem with 
tooltips
2006/02/15 10:59:22 obr 1.1.2.9: #i47890# replaced tabs with spaces
2006/01/05 14:06:31 obr 1.1.2.8: #i47890# override toolkit name and 
version and reworked bridge initialization
2005/11/16 12:29:16 obr 1.1.2.7: no longer return NULL in 
factory_create_accessible
2005/11/16 09:09:20 obr 1.1.2.6: gail rev. 1.8.6 fixes the things 
we needed gsignalhook for
2005/10/20 07:09:09 obr 1.1.2.5: #i47890# made cxx files 
standalone, avoid queryInterface on each API call and demacrofied try/catch to 
include appropriate warnings
2005/09/28 07:24:12 obr 1.1.2.4: #i47890# changed ref-counting/life 
cycle once again, adjust tree and role of dialogs and filter sub-menu windows
2005/09/26 11:01:00 obr 1.1.2.3: #i47890# reworked lifecycle of atk 
wrapper objects
2005/06/14 13:57:23 obr 1.1.2.2: #i47890# global focus event 
listening stuff
2005/04/21 14:59:24 mmeeks 1.1.2.1: Issue number: i#47890#
Submitted by: mmeeks

Hacked up prototype of atk bridge

Change-Id: Ibdc525412ba6cc4b449c775a74dcd919c4045b6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166934
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk3/a11y/atkfactory.cxx b/vcl/unx/gtk3/a11y/atkfactory.cxx
index c9702c9f85d8..3c8e6222e896 100644
--- a/vcl/unx/gtk3/a11y/atkfactory.cxx
+++ b/vcl/unx/gtk3/a11y/atkfactory.cxx
@@ -27,68 +27,6 @@ using namespace ::com::sun::star;
 
 extern "C" {
 
-/*
- *  Instances of this dummy object class are returned whenever we have to
- *  create an AtkObject, but can't touch the OOo object anymore since it
- *  is already disposed.
- */
-
-static AtkStateSet *
-noop_wrapper_ref_state_set( AtkObject * )
-{
-AtkStateSet *state_set = atk_state_set_new();
-atk_state_set_add_state( state_set, ATK_STATE_DEFUNCT );
-return state_set;
-}
-
-static void
-atk_noop_object_wrapper_class_init(gpointer klass_, gpointer)
-{
-auto const klass = static_cast(klass_);
-AtkObjectClass *atk_class = ATK_OBJECT_CLASS( klass );
-atk_class->ref_state_set = noop_wrapper_ref_state_set;
-}
-
-static GType
-atk_noop_object_wrapper_get_type()
-{
-static GType type = 0;
-
-if (!type)
-{
-static const GTypeInfo typeInfo =
-{
-sizeof (AtkNoOpObjectClass),
-nullptr,
-nullptr,
-atk_noop_object_wrapper_class_init,
-nullptr,
-nullptr,
-sizeof (AtkObjectWrapper),
-0,
-nullptr,
-nullptr
-} ;
-
-type = g_type_register_static (ATK_TYPE_OBJECT, "OOoAtkNoOpObj", 
, GTypeFlags(0)) ;
-}
-return type;
-}
-
-static AtkObject*
-atk_noop_object_wrapper_new()
-{
-  AtkObject *accessible;
-
-  accessible = static_cast(g_object_new 
(atk_noop_object_wrapper_get_type(), nullptr));
-  g_return_val_if_fail (accessible != nullptr, nullptr);
-
-  accessible->role = ATK_ROLE_INVALID;
-  accessible->layer = ATK_LAYER_INVALID;
-
-  return accessible;
-}
-
 /*
  * The wrapper factory
  */
@@ -103,24 +41,27 @@ static AtkObject*
 wrapper_factory_create_accessible( GObject *obj )
 {
 GtkWidget* pEventBox = gtk_widget_get_parent(GTK_WIDGET(obj));
-
-// gail_container_real_remove_gtk tries to re-instantiate an accessible
-// for a widget that is about to vanish ..
+assert(pEventBox);
 if (!pEventBox)
-return atk_noop_object_wrapper_new();
+return nullptr;
 
 GtkWidget* pTopLevelGrid = gtk_widget_get_parent(pEventBox);
+assert(pTopLevelGrid);
 if (!p

core.git: vcl/unx

2024-04-30 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk4/a11y.cxx  |   70 +
 vcl/unx/gtk4/gtkaccessibleregistry.cxx |   16 +++
 vcl/unx/gtk4/gtkaccessibleregistry.hxx |2 
 3 files changed, 87 insertions(+), 1 deletion(-)

New commits:
commit 4cec279cf2bf55d33e0eb6c92348aa883d7593ff
Author: Michael Weghorn 
AuthorDate: Tue Apr 30 13:06:15 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Apr 30 17:36:44 2024 +0200

gtk4 a11y: Handle accessible relations

When creating a new LoAccessible, also consider
accessible relations.
These can be retrieved via the XAccessibleRelationSet
UNO interface.

Bridge those that have an equivalent in the GTK 4 a11y API.

As the parent GtkAccessible of a target XAccessible
is not known, extend `GtkAccessibleRegistry::getLOAccessible`
with the functionality to find a parent via the XAccessible
hierarchy (i.e. by walking up the XAccessible hierarchy
until a parent is reached that has an entry in registry
already).
This could potentially be problematic as an a11y hierarchy
solely based on the XAccessible hierarchy doesn't necessarily
match the one with the GtkAccessibles from the native GtkWidget
hierarchy. In my current understanding, this should presumably
be OK as long as that mechanism finds one existing
entry before getting to the root, so assert that this is the case.

With this in place, having a Writer doc with multiple paragraphs,
there is a flows_to relation shown for the first paragraph to the
second in Accerciser, etc., and jumping to the target selects
the next paragraph as expected.

Change-Id: I2ec1fe8c48dd4250d407ae4fb3c8d9c0f6671646
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166926
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index 4b9447c19ae4..bf66b058b231 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -391,6 +392,73 @@ applyObjectAttributes(GtkAccessible* pGtkAccessible,
 } while (nIndex >= 0);
 }
 
+static void applyRelations(LoAccessible* pLoAccessible,
+   
css::uno::Reference& xContext)
+{
+assert(pLoAccessible);
+
+if (!xContext)
+return;
+
+css::uno::Reference 
xRelationSet
+= xContext->getAccessibleRelationSet();
+if (!xRelationSet.is())
+return;
+
+for (sal_Int32 i = 0; i < xRelationSet->getRelationCount(); i++)
+{
+GtkAccessibleRelation eGtkRelation;
+css::accessibility::AccessibleRelation aRelation = 
xRelationSet->getRelation(i);
+switch (aRelation.RelationType)
+{
+case css::accessibility::AccessibleRelationType::CONTENT_FLOWS_TO:
+eGtkRelation = GTK_ACCESSIBLE_RELATION_FLOW_TO;
+break;
+case css::accessibility::AccessibleRelationType::CONTROLLER_FOR:
+eGtkRelation = GTK_ACCESSIBLE_RELATION_CONTROLS;
+break;
+case css::accessibility::AccessibleRelationType::DESCRIBED_BY:
+eGtkRelation = GTK_ACCESSIBLE_RELATION_DESCRIBED_BY;
+break;
+case css::accessibility::AccessibleRelationType::LABELED_BY:
+eGtkRelation = GTK_ACCESSIBLE_RELATION_LABELLED_BY;
+break;
+case 
css::accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM:
+case css::accessibility::AccessibleRelationType::CONTROLLED_BY:
+case css::accessibility::AccessibleRelationType::INVALID:
+case css::accessibility::AccessibleRelationType::LABEL_FOR:
+case css::accessibility::AccessibleRelationType::MEMBER_OF:
+case css::accessibility::AccessibleRelationType::NODE_CHILD_OF:
+case css::accessibility::AccessibleRelationType::SUB_WINDOW_OF:
+// GTK has no equivalent for these
+continue;
+default:
+assert(false && "Unhandled relation type");
+}
+
+gtk_accessible_reset_relation(GTK_ACCESSIBLE(pLoAccessible),
+  GTK_ACCESSIBLE_RELATION_FLOW_TO);
+
+GList* pTargetObjects = nullptr;
+for (const css::uno::Reference& 
xTargetAcc :
+ aRelation.TargetSet)
+{
+LoAccessible* pTargetLOAcc
+= GtkAccessibleRegistry::getLOAccessible(xTargetAcc, 
pLoAccessible->display);
+assert(pTargetLOAcc);
+GObject* pObject = G_OBJECT(pTargetLOAcc);
+g_object_ref(pObject);
+pTargetObjects = g_list_append(pTargetObjects, pObject);
+}
+
+GValue aValue = G_VALUE_INIT;
+gtk_accessible_relation_init_value(eGtkRelation, );
+

core.git: 2 commits - editeng/source vcl/qt5

2024-04-30 Thread Michael Weghorn (via logerrit)
 editeng/source/editeng/impedit2.cxx |   51 
 vcl/qt5/QtWidget.cxx|4 +-
 2 files changed, 26 insertions(+), 29 deletions(-)

New commits:
commit 63a62abae01e7beb15d1e7cb12c469b42253bf1b
Author: Michael Weghorn 
AuthorDate: Tue Apr 30 11:30:12 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Apr 30 17:36:05 2024 +0200

tdf#160838 qt: Update IM cursor position also on modifier change

In `QtWidget::handleKeyEvent`, move the call to

QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle);

further up, so the cursor update also happens for the code path
of calling the `SalEvent::KeyModChange` callback and then returning
early.

This makes fcitx5's keyboard layout indicator show up at the right
position again when switching layout right after starting Writer
(s. tdf#160838 comment comment 2), which was no longer the case
after the new code path had been introduced in

commit 862fdb98ca271b60a831cd5420fd16d5f9c1c747
Date:   Mon Jul 19 15:17:53 2021 +0200

tdf#143298 Qt5 send SalEvent::KeyModChange events

(Not sure whether it wouldn't even make more sense
to update *after* processing the key event for the
case that actual text is typed, as that presumably
modifies the cursor position, but leave the logic
otherwise unchanged for now.)

Change-Id: I6e21ae51568eefc8e2ae64109d5596f5e20cc28a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166923
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index 996a0a7cc9ce..5c860333793f 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -580,6 +580,8 @@ bool QtWidget::handleKeyEvent(QtFrame& rFrame, const 
QWidget& rWidget, QKeyEvent
 return true;
 }
 
+QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle);
+
 if (nCode == 0 && pEvent->text().isEmpty())
 {
 sal_uInt16 nModCode = GetKeyModCode(pEvent->modifiers());
@@ -669,8 +671,6 @@ bool QtWidget::handleKeyEvent(QtFrame& rFrame, const 
QWidget& rWidget, QKeyEvent
 aEvent.mnCode = nCode;
 aEvent.mnCode |= GetKeyModCode(pEvent->modifiers());
 
-QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle);
-
 bool bStopProcessingKey;
 if (bIsKeyPressed)
 bStopProcessingKey = rFrame.CallCallback(SalEvent::KeyInput, );
commit 691c61146d3d627d24fec336550a0d4933549cda
Author: Michael Weghorn 
AuthorDate: Tue Apr 30 09:24:53 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Apr 30 17:35:53 2024 +0200

tdf#160838 editeng: Report IME cursor pos more reliably

`mpIMEInfos` is set when handling the
`CommandEventId::StartExtTextInput` command. However,
the cursor position can also be queried without it
being set, as seen e.g. at least for the fcitx5 use case
from tdf#160838 when using the Qt-based VCL plugins.

If no IME Input has happened yet, just use the current
selection PaM index as the end index.

This makes the fcitx5 language indicator show up at the
current cursor position when positioned in a comment in
Writer, the Calc input bar or a Math formula and
switching the fcitx5 language/keyboard layout using the shortcut
with the Qt-based VCL plugins.

The correct position had no longer been used after welding,
i.e. since

commit 69c546e1e7a697217f273baa7c1729ff823efd76
Date:   Fri Dec 4 16:30:31 2020 +

weld annotation window

for Writer comments and since

commit e087e25f05e689091cbf1c4f91b6e93878ac17ec
Date:   Mon Oct 5 14:19:05 2020 +0100

weld InputBar

for the Calc input bar.

The fact that the indicator shows up at the wrong position
before typing any character (e.g. opening Writer, then switching the
keyboard layout right away, as mentioend in tdf#160838
comment 2) is a different issue and will be addressed
separately.

Change-Id: Ibe7698e113cbbea7f273cc929d72ca47fb407a20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166888
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index da4d851b3315..9568e800ee4e 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -477,36 +477,33 @@ bool ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
 }
 else if ( rCEvt.GetCommand() == CommandEventId::CursorPos )
 {
-if (mpIMEInfos)
-{
-EditPaM aPaM( pView->getImpl().GetEditSelection().Max() );
-tools::Rectangle aR1 = PaMtoEditCursor( aPaM );
+EditPaM aPaM( pView->getImpl().GetEditSelection().Max() );
+

core.git: Branch 'libreoffice-24-2' - vcl/inc vcl/qt5

2024-04-30 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtTransferable.hxx |   10 +-
 vcl/qt5/QtClipboard.cxx|2 +-
 vcl/qt5/QtTransferable.cxx |8 
 3 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit 8fbff7fa22cc50132f09442e338fc71434c4a77a
Author: Michael Weghorn 
AuthorDate: Fri Apr 26 15:04:24 2024 +0200
Commit: Michael Stahl 
CommitDate: Tue Apr 30 11:07:08 2024 +0200

qt: Guard clipboard mime data with SolarMutex

Most of the access to the QtClipboardTransferable
mime data happens exclusively on the main thread,
with the solar mutex held.

However, `mimeData()`, called from `QtClipboard::getContents`
didn't ensure that yet, so as Michael Stahl pointed out in [1],

commit 1db5b87fe69c2375f1d66974dafcd563303c76db
Author: Michael Weghorn 
Date:   Tue Feb 13 13:23:17 2024 +0100

tdf#156562 qt: Sync with system clipboard content if necessary

introduced a data race by allowing to set new mime data.

Introduce a new
`QtClipboardTransferable::hasMimeData(const QMimeData* pMimeData)`
that guards access to the mime data with the solar mutext as well
and use that instead, so all access to the `QtClipboardTransferable`
mime data is now guarded by the solar mutex.

Also add an explicit note for the mime data getter/setter in the
`QtTransferable` base class that subclasses allowing to update
mime data are responsible for preventing data races.

[1] https://gerrit.libreoffice.org/c/core/+/166141/comment/fe75f418_40c1b622

Change-Id: I01dbbb0b37a4c6ad06b4d3001ecce8b0260eb32e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166750
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 621cfc0e4120ab2b381b54268fe39bd19257df9b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166892

diff --git a/vcl/inc/qt5/QtTransferable.hxx b/vcl/inc/qt5/QtTransferable.hxx
index c58490e90460..5687fa06df52 100644
--- a/vcl/inc/qt5/QtTransferable.hxx
+++ b/vcl/inc/qt5/QtTransferable.hxx
@@ -40,12 +40,17 @@ protected:
  *  Since data flavors supported by this class depend on the mime data,
  *  results from previous calls to the public methods of this
  *  class are no longer valid after setting new mime data using this 
method.
+ *
+ *  Subclasses that set new mime data must ensure that no data race exists
+ *  on m_pMimeData.
+ *  (For the current only subclass doing so, QtClipboardTransferable, all 
access
+ *  to m_pMimeData happens with the SolarMutex held.)
  */
 void setMimeData(const QMimeData* pMimeData) { m_pMimeData = pMimeData; }
+const QMimeData* mimeData() const { return m_pMimeData; }
 
 public:
 QtTransferable(const QMimeData* pMimeData);
-const QMimeData* mimeData() const { return m_pMimeData; }
 
 css::uno::Sequence SAL_CALL 
getTransferDataFlavors() override;
 sal_Bool SAL_CALL isDataFlavorSupported(const 
css::datatransfer::DataFlavor& rFlavor) override;
@@ -74,6 +79,9 @@ class QtClipboardTransferable final : public QtTransferable
 public:
 explicit QtClipboardTransferable(const QClipboard::Mode aMode, const 
QMimeData* pMimeData);
 
+// whether pMimeData are the current mime data
+bool hasMimeData(const QMimeData* pMimeData) const;
+
 // these are the same then QtTransferable, except they go through 
RunInMainThread
 css::uno::Sequence SAL_CALL 
getTransferDataFlavors() override;
 sal_Bool SAL_CALL isDataFlavorSupported(const 
css::datatransfer::DataFlavor& rFlavor) override;
diff --git a/vcl/qt5/QtClipboard.cxx b/vcl/qt5/QtClipboard.cxx
index e9eb476fb253..ea05784bbfb2 100644
--- a/vcl/qt5/QtClipboard.cxx
+++ b/vcl/qt5/QtClipboard.cxx
@@ -103,7 +103,7 @@ css::uno::Reference 
QtClipboard::getContents()
 {
 const auto* pTrans = 
dynamic_cast(m_aContents.get());
 assert(pTrans);
-if (pTrans && pTrans->mimeData() == pMimeData)
+if (pTrans && pTrans->hasMimeData(pMimeData))
 return m_aContents;
 }
 
diff --git a/vcl/qt5/QtTransferable.cxx b/vcl/qt5/QtTransferable.cxx
index a6902824ab3a..1aec5da27843 100644
--- a/vcl/qt5/QtTransferable.cxx
+++ b/vcl/qt5/QtTransferable.cxx
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -173,10 +174,17 @@ void 
QtClipboardTransferable::ensureConsistencyWithSystemClipboard()
 {
 SAL_WARN("vcl.qt", "In flight clipboard change detected - updating 
mime data with current "
"clipboard contents.");
+DBG_TESTSOLARMUTEX();
 setMimeData(pCurrentClipboardData);
 }
 }
 
+bool QtClipboardTransferable::hasMimeData(const QMimeData* pMimeData) const
+{
+SolarMutexGuard aGuard;
+return QtTransferable::mimeData() == pMimeData;
+}
+
 css::uno::Any SAL_CALL
 QtClipboardTrans

core.git: Branch 'libreoffice-24-2' - vcl/inc vcl/qt5

2024-04-30 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtTransferable.hxx |1 -
 vcl/qt5/QtTransferable.cxx |   35 +--
 2 files changed, 17 insertions(+), 19 deletions(-)

New commits:
commit 28b2020f276f12561252ea3a42555bfe88a0c1b6
Author: Michael Weghorn 
AuthorDate: Fri Apr 26 14:39:14 2024 +0200
Commit: Michael Stahl 
CommitDate: Tue Apr 30 11:06:26 2024 +0200

qt: Avoid race on QtTransferable member

As Michael Stahl pointed out in [1], there is a data
race on `QtTransferable::m_bProvideUTF16FromOtherEncoding`.

Adjust the code a bit to no longer make use of the
member and drop it.

The QtClipboard case was fine because both methods making
use of the member always run in the main thread with the
SolarMutex held.

For anything else, the `m_pMimeData` doesn't change
don't change, so access to that member doesn't need
to be guarded by a mutex and thus dropping
`QtTransferable::m_bProvideUTF16FromOtherEncoding`
should be sufficient to address that race at least.
(Another one will be addressed separately.)

[1] https://gerrit.libreoffice.org/c/core/+/166140/comment/bc1c9f11_6ad630b7

Change-Id: Iaf2fb460b129493f5627c95b6968aa57da368b4c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166749
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
(cherry picked from commit 893deef4f77f19d7b2d31df09260a34affe1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166891

diff --git a/vcl/inc/qt5/QtTransferable.hxx b/vcl/inc/qt5/QtTransferable.hxx
index 38cb4d92005b..c58490e90460 100644
--- a/vcl/inc/qt5/QtTransferable.hxx
+++ b/vcl/inc/qt5/QtTransferable.hxx
@@ -34,7 +34,6 @@ class QtTransferable : public 
cppu::WeakImplHelper SAL_CALL 
QtTransferable::getTr
 nMimeTypeCount++;
 }
 
-m_bProvideUTF16FromOtherEncoding = (bHaveNoCharset || bHaveUTF8) && 
!bHaveUTF16;
-if (m_bProvideUTF16FromOtherEncoding)
+// in case of text/plain data, but no UTF-16 encoded one,
+// QtTransferable::getTransferData converts from existing encoding to 
UTF-16
+const bool bProvideUTF16FromOtherEncoding = (bHaveNoCharset || bHaveUTF8) 
&& !bHaveUTF16;
+if (bProvideUTF16FromOtherEncoding)
 {
 aFlavor.MimeType = "text/plain;charset=utf-16";
 aFlavor.DataType = cppu::UnoType::get();
@@ -127,26 +128,24 @@ css::uno::Any SAL_CALL 
QtTransferable::getTransferData(const css::datatransfer::
 if (rFlavor.MimeType == "text/plain;charset=utf-16")
 {
 OUString aString;
-if (m_bProvideUTF16FromOtherEncoding)
-{
-if (m_pMimeData->hasFormat("text/plain;charset=utf-8"))
-{
-QByteArray 
aByteData(m_pMimeData->data(QStringLiteral("text/plain;charset=utf-8")));
-aString = OUString::fromUtf8(reinterpret_cast(aByteData.data()));
-}
-else
-{
-QByteArray 
aByteData(m_pMimeData->data(QStringLiteral("text/plain")));
-aString = OUString(reinterpret_cast(aByteData.data()),
-   aByteData.size(), 
osl_getThreadTextEncoding());
-}
-}
-else
+// use existing UTF-16 encoded text/plain or convert to UTF-16 as 
needed
+if (m_pMimeData->hasFormat("text/plain;charset=utf-16"))
 {
 QByteArray 
aByteData(m_pMimeData->data(toQString(rFlavor.MimeType)));
 aString = OUString(reinterpret_cast(aByteData.data()),
aByteData.size() / 2);
 }
+else if (m_pMimeData->hasFormat("text/plain;charset=utf-8"))
+{
+QByteArray 
aByteData(m_pMimeData->data(QStringLiteral("text/plain;charset=utf-8")));
+aString = OUString::fromUtf8(reinterpret_cast(aByteData.data()));
+}
+else
+{
+QByteArray 
aByteData(m_pMimeData->data(QStringLiteral("text/plain")));
+aString = OUString(reinterpret_cast(aByteData.data()), aByteData.size(),
+   osl_getThreadTextEncoding());
+}
 aAny <<= aString;
 }
 else


core.git: Branch 'libreoffice-24-2' - vcl/inc vcl/qt5

2024-04-30 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtTransferable.hxx |   18 +-
 vcl/qt5/QtTransferable.cxx |   27 +--
 2 files changed, 30 insertions(+), 15 deletions(-)

New commits:
commit 2e4a593abc2fb82f7d26f73db71bb7fdd68add35
Author: Michael Weghorn 
AuthorDate: Tue Feb 13 13:23:17 2024 +0100
Commit: Michael Stahl 
CommitDate: Tue Apr 30 11:05:45 2024 +0200

tdf#156562 qt: Sync with system clipboard content if necessary

If the `QtClipboardTransferable`'s mime data gets out of sync
with the system clipboard's one, no longer cease operation
and stop reporting any transfer data, but sync with  the
clipboard data, i.e. update the mime data with those
currently in the system clipboard.

For the "Paste Special" dialog with qt6 on Wayland
(see tdf#156562), an external clipboard update gets
triggered between the point in time when the

std::shared_ptr aDataHelper

in the `SID_PASTE_SPECIAL` case in `SwBaseShell::ExecClpbrd`
gets assigned and when the callback set via
`pDlg->StartExecuteAsync` gets called, even if there
was no user interaction with the system clipboard at all.

This however meant that the `aDataHelper` used in the
callback would no longer return any transfer/mime data,
so pasting wouldn't work.

Handle that case by updating the `QtClipboardTransferable`
mime data with the current system clipboard's data, but
keep emitting a warning at least.

As a consequence, opening the "Paste Special" dialog, then
copying something else to the clipboard, then confirming
the dialog will copy the newly copied data rather than
what was in the clipboard when the dialog was initially
started. That's the same for gtk3 already, but on Windows,
the original clipboard content would still be pasted.

(Retrieving the clipboard content anew in the callback using
`TransferableDataHelper::CreateFromSystemClipboard` instead
of passing the original `aDataHelper` into the callback
would have a similar effect. However, on other platforms,
reusing the previously copied data from the clipboard when
the actual system clipboard was changed in between may
be what's desired.)

The observed extra/unexpected clipboard change event may be
related/similar to what the following commit was addressing for
the case of LO itself being the clipboard owner:

commit 71471a36b125f6bdc915d5dbcae92ebcaa7ff5a4
Date:   Tue Apr 6 01:41:08 2021 +0200

tdf#140404 Qt ignore "unchanged" clipboard events

LO gets a Qt signal on all clipboard changes. For X11 you get one
signal when you set the clipboard. Anything else normally signals
lost of clipboard ownership.

But on Wayland LO somehow gets a second notification without any
actual change. AFAIK it's not triggered by any LO actions and
isOwner still indicates, that LO has the ownership. This breaks
the single notification assumption, the code was relying on.

(...)

Backtrace showing how the clipboard update gets triggered
(with mode `QClipboardMode::Clipboard`, not just
`QClipboardMode::Selection`; qtbase dev as of
0d0810e2dcc8a9ee28935af5daadc2ef36ed25a2):

1 QtClipboard::handleChanged QtClipboard.cxx 156 0x7f6284c7a7a8
2 QtPrivate::FunctorCall, 
QtPrivate::List, void, void (QtClipboard:: 
*)(QClipboard::Mode)>::call(void (QtClipboard:: *)(QClipboard::Mode), 
QtClipboard *, void * *)::{lambda()#1}::operator()() const qobjectdefs_impl.h 
153 0x7f6284c8450f
3 QtPrivate::FunctorCallBase::call_internal, 
QtPrivate::List, void, void (QtClipboard:: 
*)(QClipboard::Mode)>::call(void (QtClipboard:: *)(QClipboard::Mode), 
QtClipboard *, void * *)::{lambda()#1}>(void * *, 
QtPrivate::FunctorCall, 
QtPrivate::List, void, void (QtClipboard:: 
*)(QClipboard::Mode)>::call(void (QtClipboard:: *)(QClipboard::Mode), 
QtClipboard *, void * *)::{lambda()#1}&&) qobjectdefs_impl.h 72 0x7f6284c8500b
4 QtPrivate::FunctorCall, 
QtPrivate::List, void, void (QtClipboard:: 
*)(QClipboard::Mode)>::call qobjectdefs_impl.h 152 0x7f6284c8457f
5 QtPrivate::FunctionPointer::call, void> 
qobjectdefs_impl.h 200 0x7f6284c833ee
6 QtPrivate::QCallableObject, void>::impl qobjectdefs_impl.h 571 
0x7f6284c81f81
7 QtPrivate::QSlotObjectBase::call qobjectdefs_impl.h 487 0x7f62841b863f
8 doActivate qobject.cpp 4116 0x7f628425772e
9 QMetaObject::activate qobject.cpp 4176 0x7f628424cdef
10 QClipboard::changed moc_qclipboard.cpp 182 0x7f62831e9fcc
11 QClipboard::emitChanged qclipboard.cpp 558 0x7f62831e9bc1
12 QPlatformClipboard::emitChanged qplatformclipboard.cpp 89 
0x7f628324ed69
13 QtWaylandClient::QWaylan

core.git: Branch 'libreoffice-24-2' - vcl/inc vcl/qt5

2024-04-30 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtTransferable.hxx |2 --
 vcl/qt5/QtTransferable.cxx |   13 +
 2 files changed, 1 insertion(+), 14 deletions(-)

New commits:
commit fedd7587477ae7c2b3f3cb350db3aeedbbb20f1c
Author: Michael Weghorn 
AuthorDate: Fri Feb 9 10:55:16 2024 +0100
Commit: Michael Stahl 
CommitDate: Tue Apr 30 11:04:33 2024 +0200

tdf#156562 qt: Don't cache supported mime types/data flavors

Drop the optimization to remember the supported
data flavors in `QtTransferable::m_aMimeTypeSeq`
and evaluate them each time instead.

This is in preparation of allowing to change
the mime data in an upcoming commit.

Another alternative would be to (re-)calculate
`QtTransferable::m_aMimeTypeSeq` only at the point
in time that the mime data are set. Keep that
in mind for further consideration in case this should
ever become relevant from a performance perspective.

Change-Id: Ic1792f6c2a19bf4c8f642a6288e9f3413fe7c893
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163303
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit ee03b3a7e85c7bb293e161cc6ea7fe7bb3bc9240)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166140
Reviewed-by: Michael Stahl 

diff --git a/vcl/inc/qt5/QtTransferable.hxx b/vcl/inc/qt5/QtTransferable.hxx
index 5f1533dd5968..11d673b98a12 100644
--- a/vcl/inc/qt5/QtTransferable.hxx
+++ b/vcl/inc/qt5/QtTransferable.hxx
@@ -34,9 +34,7 @@ class QtTransferable : public 
cppu::WeakImplHelper m_aMimeTypeSeq;
 
 public:
 QtTransferable(const QMimeData* pMimeData);
diff --git a/vcl/qt5/QtTransferable.cxx b/vcl/qt5/QtTransferable.cxx
index d9e0beaa71d3..675e5ef75cdc 100644
--- a/vcl/qt5/QtTransferable.cxx
+++ b/vcl/qt5/QtTransferable.cxx
@@ -50,16 +50,6 @@ QtTransferable::QtTransferable(const QMimeData* pMimeData)
 
 css::uno::Sequence SAL_CALL 
QtTransferable::getTransferDataFlavors()
 {
-// it's just filled once, ever, so just try to get it without locking first
-if (m_aMimeTypeSeq.hasElements())
-return m_aMimeTypeSeq;
-
-// better safe then sorry; preventing broken usage
-// DnD should not be shared and Clipboard access runs in the GUI thread
-osl::MutexGuard aGuard(m_aMutex);
-if (m_aMimeTypeSeq.hasElements())
-return m_aMimeTypeSeq;
-
 QStringList aFormatList(m_pMimeData->formats());
 // we might add the UTF-16 mime text variant later
 const int nMimeTypeSeqSize = aFormatList.size() + 1;
@@ -113,8 +103,7 @@ css::uno::Sequence SAL_CALL 
QtTransferable::getTr
 
 aMimeTypeSeq.realloc(nMimeTypeCount);
 
-m_aMimeTypeSeq = aMimeTypeSeq;
-return m_aMimeTypeSeq;
+return aMimeTypeSeq;
 }
 
 sal_Bool SAL_CALL


core.git: 2 commits - vcl/inc vcl/qt5

2024-04-29 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtTransferable.hxx |   11 --
 vcl/qt5/QtClipboard.cxx|2 -
 vcl/qt5/QtTransferable.cxx |   43 +++--
 3 files changed, 35 insertions(+), 21 deletions(-)

New commits:
commit 621cfc0e4120ab2b381b54268fe39bd19257df9b
Author: Michael Weghorn 
AuthorDate: Fri Apr 26 15:04:24 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Apr 30 06:53:19 2024 +0200

qt: Guard clipboard mime data with SolarMutex

Most of the access to the QtClipboardTransferable
mime data happens exclusively on the main thread,
with the solar mutex held.

However, `mimeData()`, called from `QtClipboard::getContents`
didn't ensure that yet, so as Michael Stahl pointed out in [1],

commit 1db5b87fe69c2375f1d66974dafcd563303c76db
Author: Michael Weghorn 
Date:   Tue Feb 13 13:23:17 2024 +0100

tdf#156562 qt: Sync with system clipboard content if necessary

introduced a data race by allowing to set new mime data.

Introduce a new
`QtClipboardTransferable::hasMimeData(const QMimeData* pMimeData)`
that guards access to the mime data with the solar mutext as well
and use that instead, so all access to the `QtClipboardTransferable`
mime data is now guarded by the solar mutex.

Also add an explicit note for the mime data getter/setter in the
`QtTransferable` base class that subclasses allowing to update
mime data are responsible for preventing data races.

[1] https://gerrit.libreoffice.org/c/core/+/166141/comment/fe75f418_40c1b622

Change-Id: I01dbbb0b37a4c6ad06b4d3001ecce8b0260eb32e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166750
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/vcl/inc/qt5/QtTransferable.hxx b/vcl/inc/qt5/QtTransferable.hxx
index c58490e90460..5687fa06df52 100644
--- a/vcl/inc/qt5/QtTransferable.hxx
+++ b/vcl/inc/qt5/QtTransferable.hxx
@@ -40,12 +40,17 @@ protected:
  *  Since data flavors supported by this class depend on the mime data,
  *  results from previous calls to the public methods of this
  *  class are no longer valid after setting new mime data using this 
method.
+ *
+ *  Subclasses that set new mime data must ensure that no data race exists
+ *  on m_pMimeData.
+ *  (For the current only subclass doing so, QtClipboardTransferable, all 
access
+ *  to m_pMimeData happens with the SolarMutex held.)
  */
 void setMimeData(const QMimeData* pMimeData) { m_pMimeData = pMimeData; }
+const QMimeData* mimeData() const { return m_pMimeData; }
 
 public:
 QtTransferable(const QMimeData* pMimeData);
-const QMimeData* mimeData() const { return m_pMimeData; }
 
 css::uno::Sequence SAL_CALL 
getTransferDataFlavors() override;
 sal_Bool SAL_CALL isDataFlavorSupported(const 
css::datatransfer::DataFlavor& rFlavor) override;
@@ -74,6 +79,9 @@ class QtClipboardTransferable final : public QtTransferable
 public:
 explicit QtClipboardTransferable(const QClipboard::Mode aMode, const 
QMimeData* pMimeData);
 
+// whether pMimeData are the current mime data
+bool hasMimeData(const QMimeData* pMimeData) const;
+
 // these are the same then QtTransferable, except they go through 
RunInMainThread
 css::uno::Sequence SAL_CALL 
getTransferDataFlavors() override;
 sal_Bool SAL_CALL isDataFlavorSupported(const 
css::datatransfer::DataFlavor& rFlavor) override;
diff --git a/vcl/qt5/QtClipboard.cxx b/vcl/qt5/QtClipboard.cxx
index e9eb476fb253..ea05784bbfb2 100644
--- a/vcl/qt5/QtClipboard.cxx
+++ b/vcl/qt5/QtClipboard.cxx
@@ -103,7 +103,7 @@ css::uno::Reference 
QtClipboard::getContents()
 {
 const auto* pTrans = 
dynamic_cast(m_aContents.get());
 assert(pTrans);
-if (pTrans && pTrans->mimeData() == pMimeData)
+if (pTrans && pTrans->hasMimeData(pMimeData))
 return m_aContents;
 }
 
diff --git a/vcl/qt5/QtTransferable.cxx b/vcl/qt5/QtTransferable.cxx
index a6902824ab3a..1aec5da27843 100644
--- a/vcl/qt5/QtTransferable.cxx
+++ b/vcl/qt5/QtTransferable.cxx
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -173,10 +174,17 @@ void 
QtClipboardTransferable::ensureConsistencyWithSystemClipboard()
 {
 SAL_WARN("vcl.qt", "In flight clipboard change detected - updating 
mime data with current "
"clipboard contents.");
+DBG_TESTSOLARMUTEX();
 setMimeData(pCurrentClipboardData);
 }
 }
 
+bool QtClipboardTransferable::hasMimeData(const QMimeData* pMimeData) const
+{
+SolarMutexGuard aGuard;
+return QtTransferable::mimeData() == pMimeData;
+}
+
 css::uno::Any SAL_CALL
 QtClipboardTransferable::getTransferData(const css::datatransfer::DataFlavor& 
rFlavor)
 {
commit 8939999deef4f77f

core.git: 2 commits - vcl/unx

2024-04-26 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk4/a11y.cxx |   29 ++---
 1 file changed, 2 insertions(+), 27 deletions(-)

New commits:
commit f6ca163d3f6383d3a48dbdacc5410e630d678ea1
Author: Michael Weghorn 
AuthorDate: Fri Apr 26 12:43:24 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri Apr 26 20:18:30 2024 +0200

gtk4 a11y: Don't create second AT context for OOoFixed

Similar to how the previous

Change-Id: I35196ca686e9d56f97bbf884da8b6492358e41fc
Author: Michael Weghorn 
Date:   Fri Apr 26 09:45:39 2024 +0200

gtk4 a11y: Don't create multiple AT contexts for same accessible

avoids creating multiple AT contexts for the same
accessible when the role changes, this commit addresses
another case in which 2 GtkATContexts could be created
for the OOoFixed which could result in segfault crashes:

The OOoFixed is a GtkWidget, and GTK's `gtk_widget_init`
already creates an AT context for widgets.
Then, a second AT context would be created because
`ooo_fixed_accessible_init` set an own implementation
for GtkAccessibleInterface::get_at_context that would
create a second AT context when it got called, resulting
in breaking the apparent assumption that there's a 1:1 mapping
between GtkAccessible and GtkATConetxt.

No longer override `GtkAccessibleInterface::get_at_context`
but live with the GtkATContext created for the GtkWidget,
even if that means an a11y role cannot explicitly be set
for these for now.
From a first quick look at the tree in Accerciser,
I only see one item changed its a11y role from panel to filler.

The main class used. e.g. for the document content is
LOAccessible, not OOoFixed, and setting the proper role
for instances of that class is unaffected, see
`lo_accessible_get_at_context`.

If setting the a11y role is relevant, this could be
done when initializing the OOoFixed instead by setting
the "accessible-role" property [1], tested with this demo
local change to set a dummy table-cell a11y role and
verifying in Accerciser that it was actually set:

--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -993,7 +993,10 @@ void GtkSalFrame::InitCommon()
 #else
 m_pOverlay = GTK_OVERLAY(gtk_overlay_new());
 #if GTK_CHECK_VERSION(4,9,0)
-m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), 
nullptr ));
+GValue aValue = G_VALUE_INIT;
+g_value_init (, GTK_TYPE_ACCESSIBLE_ROLE);
+g_value_set_enum(, GTK_ACCESSIBLE_ROLE_CELL);
+m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), 
"accessible-role", aValue,  nullptr ));
 #else
 m_pFixedContainer = GTK_FIXED(gtk_fixed_new());
 #endif

Similar to how the dropped code did, this could use the
a11y role from the corresponding `vcl::Window`, which is
currently not passed, but that could be adjusted, e.g.
by either passing the window or its accessible info
to `SalInstance::CreateFrame`/`SalInstance::CreateChildFrame`.
See `Window::ImplInit`, where the `vcl::Window` is currently
only set via `SalFrame::SetCallback` after the call to
`SalInstance::CreateFrame`/`SalInstance::CreateChildFrame`.

Without this commit, for me, this crash happened about 10-30 %
of the time when starting LO Writer with the gtk4 VCL plugin in rr,
when Accerciser was running already.

Backtrace for first AT context creation (from `gtk_widget_init`):

1 gtk_at_context_create gtkatcontext.c 671 0x7f677daf129e
2 create_at_context gtkwidget.c 8574 0x7f677dd6bcd9
3 gtk_widget_init gtkwidget.c 2392 0x7f677dd5edbc
4 g_type_create_instance 0x7f678ed8f2a3
5 ?? 0x7f678ed72500
6 g_object_new_with_properties 0x7f678ed73b96
7 g_object_new 0x7f678ed74a41
8 GtkSalFrame::InitCommon gtkframe.cxx 996 0x7f677edb9243
9 GtkSalFrame::Init gtkframe.cxx 1785 0x7f677edb7bca
10 GtkSalFrame::GtkSalFrame gtkframe.cxx 510 0x7f677edb726d
11 GtkInstance::CreateFrame gtkinst.cxx 273 0x7f677ec7cebc
12 vcl::Window::ImplInit window.cxx 1057 0x7f6788cf7f49
13 ImplBorderWindow::ImplInit brdwin.cxx 1555 0x7f6788a6d45b
14 ImplBorderWindow::ImplBorderWindow brdwin.cxx 1584 0x7f6788a6da21
15 VclPtrInstance::VclPtrInstance vclptr.hxx 280 0x7f6788d31049
16 WorkWindow::ImplInit wrkwin.cxx 51 0x7f6788d2f809
17 IntroWindow::IntroWindow introwin.cxx 35 0x7f6788bb7ee0
18 (anonymous namespace)::SplashScreenWindow::SplashScreenWindow 
splash.cxx 122 0x7f677c1cee61
19 VclPtr<(anonymous namespace)::SplashScreenWindow>::Create<(anonymous 
namespace)::SplashScreen *> vclptr.hxx 129 0x7f677c1cc86b
20 (anonymous namespace)::SplashScr

core.git: vcl/unx

2024-04-25 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk4/convert3to4.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 0c3fb583b9fdbbc634a5cabe578d3e717c36bff6
Author: Michael Weghorn 
AuthorDate: Thu Apr 25 10:11:15 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 25 18:00:35 2024 +0200

gtk4: Ignore "input-purpose" for GtkSpinButton

"input-purpose" is a property of GtkEntry, for both,
GTK 3 [1] and GTK 4 [2].

However, while the GTK 3 GtkSpinButton derives from GtkEntry [3],
the GTK 4 one doesn't any more but it derives directly from
GtkWidget [4].

Therefore, after

commit 139199ee9c09d25624191132adbe4fd29365eb7a
Date:   Thu Feb 22 00:03:01 2024 -0900

tdf#141728 Revamp sw navigator go to page spin control

, opening the navigator by pressing F5 in Writer when
using the gtk4 VCL plugin triggered the following assert:

warn:vcl.gtk:233860:233860:vcl/unx/gtk4/convert3to4.cxx:1595: 
GtkInstanceBuilder: error when calling gtk_builder_add_from_string: .:197:65 
Invalid property: GtkSpinButton.input-purpose
soffice.bin: 
/home/michi/development/git/libreoffice/vcl/unx/gtk4/convert3to4.cxx:1598: void 
builder_add_from_gtk3_file(GtkBuilder *, const OUString &): Assertion `rc && 
"could not load UI file"' failed.

Just ignore that property for gtk4.

[1] https://docs.gtk.org/gtk3/property.Entry.input-purpose.html
[2] https://docs.gtk.org/gtk4/property.Entry.input-purpose.html
[3] https://docs.gtk.org/gtk3/class.SpinButton.html
[4] https://docs.gtk.org/gtk4/class.SpinButton.html

Change-Id: Ia3ece9fdf0269dc5178786fc64644ab3f0433871
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166618
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk4/convert3to4.cxx b/vcl/unx/gtk4/convert3to4.cxx
index 16c7403bb261..ffbda70037ad 100644
--- a/vcl/unx/gtk4/convert3to4.cxx
+++ b/vcl/unx/gtk4/convert3to4.cxx
@@ -541,6 +541,13 @@ ConvertResult Convert3To4(const 
css::uno::Reference& xNode
 xRemoveList.push_back(xChild);
 }
 
+if (sName == "input-purpose" && GetParentObjectType(xChild) == 
"GtkSpinButton")
+{
+// "input-purpose" is a property of GtkEntry, but
+// GTK 4 GtkSpinButton no longer derives from GtkEntry
+xRemoveList.push_back(xChild);
+}
+
 if (sName == "truncate-multiline")
 {
 if (GetParentObjectType(xChild) == "GtkSpinButton")


core.git: 2 commits - accessibility/source dbaccess/source editeng/source offapi/com sc/source sd/source svx/source sw/source test/source toolkit/source vcl/osx vcl/qa vcl/qt5 vcl/source vcl/unx winac

2024-04-24 Thread Michael Weghorn (via logerrit)
 accessibility/source/extended/accessiblelistboxentry.cxx   |2 
 accessibility/source/extended/textwindowaccessibility.cxx  |6 +-
 accessibility/source/standard/floatingwindowaccessible.cxx |2 
 accessibility/source/standard/vclxaccessiblelist.cxx   |2 
 accessibility/source/standard/vclxaccessibleradiobutton.cxx|2 
 dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx|2 
 dbaccess/source/ui/querydesign/TableWindowAccess.cxx   |   10 ++--
 editeng/source/accessibility/AccessibleEditableTextPara.cxx|8 +--
 offapi/com/sun/star/accessibility/AccessibleRelation.idl   |2 
 offapi/com/sun/star/accessibility/XAccessibleMultiLineText.idl |1 
 sc/source/ui/Accessibility/AccessibleCell.cxx  |4 -
 sc/source/ui/Accessibility/AccessibleCsvControl.cxx|4 -
 sc/source/ui/Accessibility/AccessibleEditObject.cxx|4 -
 sd/source/console/PresenterAccessibility.cxx   |4 -
 svx/source/accessibility/AccessibleControlShape.cxx|2 
 svx/source/accessibility/AccessibleShape.cxx   |2 
 svx/source/accessibility/svxrectctaccessiblecontext.cxx|2 
 sw/source/core/access/accpara.cxx  |4 -
 sw/source/core/access/acctextframe.cxx |2 
 test/source/a11y/accessibletestbase.cxx|   10 +---
 toolkit/source/awt/vclxaccessiblecomponent.cxx |6 +-
 vcl/osx/a11ywrapper.mm |   12 ++---
 vcl/qa/cppunit/a11y/atspi2/atspi2.cxx  |3 -
 vcl/qt5/QtAccessibleWidget.cxx |2 
 vcl/source/app/salvtables.cxx  |4 -
 vcl/unx/gtk3/a11y/atkwrapper.cxx   |5 --
 winaccessibility/source/UAccCOM/AccRelation.cxx|8 +--
 winaccessibility/source/UAccCOM/MAccessible.cxx|   22 
--
 28 files changed, 64 insertions(+), 73 deletions(-)

New commits:
commit d4f6534e8870e8f271984c37ce54a6878f372ae1
Author: Michael Weghorn 
AuthorDate: Wed Apr 24 14:39:46 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Apr 24 23:04:35 2024 +0200

[API CHANGE] a11y: Use XAccessible for relation targets

Use a Sequence of XAccessible rather than its base
interface XInterface for AccessibleRelation's TargetSet.

As the targets are accessible objects as well,
anything other than XAccessible doesn't make much sense.
Using XAccessible right away makes that clearer and avoids
the need to query the XAccessible interface.

(The winaccessibility bridge was already using
`static_cast`, relying on the fact that the objects
are XAccessibles.)

The a11y UNO API is not published, so an API change
should be unproblematic.

Change-Id: I7f08e98d1ec303d5343d9a7954187cdd71495ebc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166586
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx 
b/accessibility/source/extended/accessiblelistboxentry.cxx
index 6c8fa6fc26dc..a843b938b9a3 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -463,7 +463,7 @@ namespace accessibility
 if ( xParent.is() )
 {
 rtl::Reference 
pRelationSetHelper = new utl::AccessibleRelationSetHelper;
-Sequence< Reference< XInterface > > aSequence { xParent };
+Sequence> aSequence { xParent };
 pRelationSetHelper->AddRelation(
 AccessibleRelation( AccessibleRelationType::NODE_CHILD_OF, 
aSequence ) );
 xRelSet = pRelationSetHelper;
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx 
b/accessibility/source/extended/textwindowaccessibility.cxx
index f1ccc69c413d..5cef04128d82 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -1293,14 +1293,14 @@ Document::retrieveParagraphRelationSet( Paragraph const 
* pParagraph )
 
 if ( aPara > m_aVisibleBegin && aPara < m_aVisibleEnd )
 {
-css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > 
aSequence { getAccessibleChild( aPara - 1 ) };
+
css::uno::Sequence> 
aSequence { getAccessibleChild(aPara - 1) };
 css::accessibility::AccessibleRelation aRelation( 
css::accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM, aSequence );
 pRelationSetHelper->AddRelation( aRelation );
 }
 
 if ( aPara >= m_aVisibleBegin && aPara < m_aVisibleEnd -1 )
 {
-css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > 

core.git: 2 commits - winaccessibility/source

2024-04-23 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/MAccessible.cxx |   17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 31a4062bc0f3a751d3758a2d9b3ebb4fe9010590
Author: Michael Weghorn 
AuthorDate: Tue Apr 23 09:26:34 2024 +0100
Commit: Michael Weghorn 
CommitDate: Tue Apr 23 20:52:57 2024 +0200

wina11y: Use AccessibleRelationType::MEMBER_OF constant

... instead of hard-coded 7.

Change-Id: I2ac44719043c827ce2a65687be021d7f823898d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166505
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx 
b/winaccessibility/source/UAccCOM/MAccessible.cxx
index 3f261e9d4bd7..8694ef418bbc 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -1792,7 +1792,7 @@ static XAccessible* getTheParentOfMember(XAccessible* 
pXAcc)
 for(sal_Int32 i=0 ; igetRelation(i);
-if(accRelation.RelationType == 7)
+if (accRelation.RelationType == AccessibleRelationType::MEMBER_OF)
 {
 Sequence< Reference< XInterface > > xTargets = 
accRelation.TargetSet;
 return static_cast(xTargets[0].get());
@@ -1861,7 +1861,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CMAccessible::get_groupPosition(long __RPC_FAR
 for(int i=0 ; igetRelation(i);
-if(accRelation.RelationType == 7)
+if (accRelation.RelationType == 
AccessibleRelationType::MEMBER_OF)
 {
 Sequence< Reference< XInterface > > xTargets = 
accRelation.TargetSet;
 
commit b97ff95cc2ef4c1da83c5889690b7a703f5c0699
Author: Michael Weghorn 
AuthorDate: Tue Apr 23 09:08:33 2024 +0100
Commit: Michael Weghorn 
CommitDate: Tue Apr 23 20:52:49 2024 +0200

wina11y: Use AccessibleRelationType constants

Use `AccessibleRelationType::LABELED_BY` and
`AccessibleRelationType::LABEL_FOR` instead of
hard-coded numbers 6 and 5.

While at it, also rename the misspelt
"pRLebelContext" to "xLabelContext".

Change-Id: Id4e5cec0f04b9257eb141fd9bac64e7f01fa32ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166504
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx 
b/winaccessibility/source/UAccCOM/MAccessible.cxx
index 6c1367185cac..3f261e9d4bd7 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -706,7 +707,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CMAccessible::get_accKeyboardShortcut(VARIANT
 AccessibleRelation accRelation;
 for(int i=0; igetRelation(i).RelationType == 
6 )
+if (pRrelationSet->getRelation(i).RelationType == 
AccessibleRelationType::LABELED_BY)
 {
 accRelation = pRrelationSet->getRelation(i);
 paccRelation = 
@@ -721,17 +722,17 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CMAccessible::get_accKeyboardShortcut(VARIANT
 
 XAccessible* pXAcc = 
static_cast(pRAcc.get());
 
-Reference pRLebelContext = 
pXAcc->getAccessibleContext();
-if(!pRLebelContext.is())
+Reference xLabelContext = 
pXAcc->getAccessibleContext();
+if (!xLabelContext.is())
 return S_FALSE;
 
-pRrelationSet = 
pRLebelContext->getAccessibleRelationSet();
+pRrelationSet = 
xLabelContext->getAccessibleRelationSet();
 nRelCount = pRrelationSet->getRelationCount();
 
 paccRelation = nullptr;
 for(int j=0; jgetRelation(j).RelationType == 
5 )
+if (pRrelationSet->getRelation(j).RelationType == 
AccessibleRelationType::LABEL_FOR)
 {
 accRelation = pRrelationSet->getRelation(j);
 paccRelation = 
@@ -746,7 +747,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP 
CMAccessible::get_accKeyboardShortcut(VARIANT
 return S_FALSE;
 }
 
-Reference 
pRXIE(pRLebelContext,UNO_QUERY);
+Reference 
pRXIE(xLabelContext, UNO_QUERY);
 if(!pRXIE.is())
 return S_FALSE;
 


core.git: offapi/com

2024-04-23 Thread Michael Weghorn (via logerrit)
 offapi/com/sun/star/accessibility/XAccessibleSelection.idl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c356b68656e57248123d333abd87803e4e89e8eb
Author: Michael Weghorn 
AuthorDate: Mon Apr 22 18:09:28 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Apr 23 08:07:08 2024 +0200

Fix XAccessibleSelection::getSelectedAccessibleChild doc

The valid indices to pass as params to
`XAccessibleSelection::getSelectedAccessibleChild`
depend on the the number of selected children, i.e. the
return value of
`XAccessibleSelection::getSelectedAccessibleChildCount`.

The previously mentioned
`XAccessibleRelationSet::getAccessibleChildCount`
doesn't even exist.

Change-Id: Iaabbc9e3972c7a8274495e19978db9eae36077fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166466
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/offapi/com/sun/star/accessibility/XAccessibleSelection.idl 
b/offapi/com/sun/star/accessibility/XAccessibleSelection.idl
index 206d552ee259..8be6310ba6ef 100644
--- a/offapi/com/sun/star/accessibility/XAccessibleSelection.idl
+++ b/offapi/com/sun/star/accessibility/XAccessibleSelection.idl
@@ -117,7 +117,7 @@ interface XAccessibleSelection : 
::com::sun::star::uno::XInterface
 @throws ::com::sun::star::lang::IndexOutOfBoundsException
 if the given index does not lie in the valid range of 0 up to
 the result of
-XAccessibleRelationSet::getAccessibleChildCount()-1.
+XAccessibleSelection::getSelectedAccessibleChildCount()-1.
 */
 XAccessible getSelectedAccessibleChild ([in] hyper nSelectedChildIndex)
 raises (::com::sun::star::lang::IndexOutOfBoundsException);


core.git: editeng/source

2024-04-23 Thread Michael Weghorn (via logerrit)
 editeng/source/accessibility/AccessibleParaManager.cxx |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit f063aac5143f14226f3e909c3d0a87e040d03538
Author: Michael Weghorn 
AuthorDate: Mon Apr 22 17:54:42 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue Apr 23 08:06:38 2024 +0200

editeng a11y: Switch DBG_ASSERT to real assert

All current callers check the index before calling
`AccessibleParaManager::IsReferencable`.

Change-Id: If585e11eba3c48037b65439e8b95cb8d27bd4ffe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166465
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/editeng/source/accessibility/AccessibleParaManager.cxx 
b/editeng/source/accessibility/AccessibleParaManager.cxx
index c88f82d67709..aae8c5817f36 100644
--- a/editeng/source/accessibility/AccessibleParaManager.cxx
+++ b/editeng/source/accessibility/AccessibleParaManager.cxx
@@ -17,10 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 
 // Global header
-
-
 #include 
 #include 
 #include 
@@ -29,10 +28,7 @@
 #include 
 #include 
 
-
 // Project-local header
-
-
 #include 
 #include 
 
@@ -116,8 +112,8 @@ namespace accessibility
 
 bool AccessibleParaManager::IsReferencable( sal_Int32 nChild ) const
 {
-DBG_ASSERT( 0 <= nChild && maChildren.size() > 
o3tl::make_unsigned(nChild),
-"AccessibleParaManager::IsReferencable: invalid index" );
+assert(0 <= nChild && maChildren.size() > o3tl::make_unsigned(nChild)
+   && "AccessibleParaManager::IsReferencable: invalid index");
 
 if( 0 <= nChild && maChildren.size() > o3tl::make_unsigned(nChild) )
 {


core.git: vcl/unx

2024-04-20 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   15 +++
 1 file changed, 15 insertions(+)

New commits:
commit 94c97ecdbfa606401fb53685048731128186672b
Author: Michael Weghorn 
AuthorDate: Thu Apr 18 18:59:46 2024 +0200
Commit: Michael Weghorn 
CommitDate: Sat Apr 20 15:29:29 2024 +0200

gtk3 a11y: Set a11y relations for custom combobox impl

As described in more detail in the previous commit

Change-Id: If5faf77c5f82836c376c04bb6e4e42ce5a3023a2
Author: Michael Weghorn 
Date:   Thu Apr 18 14:02:25 2024 +0200

tdf#159910 gtk3 a11y: Keep a11y props for combobox

, the gtk3 VCL plugin uses a custom combobox implementation
rather than the stock GtkComboBox.

Similar to how the above commit makes sure that accessible
role, name and description set for the stock GtkComboBox
are also set in the custom implementation, do the same
for the accessible relations as well, by taking over
the relations from the GtkComboBox to the toggle
button of the custom implementation as well.

One particularly relevant relation in practice is
`ATK_RELATION_LABELLED_BY`, because the target set
via that relation is what screen readers tend to
announce when a combobox receives focus and doesn't
have an accessible name set for itself.

With this change in place, the Orca screen reader
announces the corresponding label e.g. in the
"Format" -> "Character" dialog in Writer, tab
"Font Effects", so e.g. "Overlining:, combobox"
is announced by Orca when the combobox for setting
the value for the overlining receives focus,
rather than just saying "combobox", which
wouldn't make clear to the user what this
combobox is for.

(This also matches what Orca already does for
the qt6 VCL plugin.)

This change only takes over the relations
set for the combobox itself. Usually, relations
are set both ways (e.g. the target of the
`ATK_RELATION_LABELLED_BY` relation would
itself have an `ATK_RELATION_LABEL_FOR`
relation with the combobox as a target).
If necessary, this solution could be
extended to also iterate over all the
target objects and check whether they
have relations with the combobox as a target
and set corresponding relations to the toggle
button as well (or instead).

Change-Id: I05e39ef5606ffa49ca7673039de3e1aa74fc8649
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166259
    Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index bcdcbc1c6157..41aa48dbed7f 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -22172,6 +22172,7 @@ public:
 g_signal_connect(getContainer(), "query-tooltip", 
G_CALLBACK(signalComboTooltipQuery), this);
 }
 
+// take over a11y characteristics from the stock GtkComboBox to the 
toggle button
 if (AtkObject* pComboBoxAccessible = 
gtk_widget_get_accessible(GTK_WIDGET(m_pComboBox)))
 {
 if (AtkObject* pToggleButtonAccessible = 
gtk_widget_get_accessible(GTK_WIDGET(m_pToggleButton)))
@@ -22181,6 +22182,20 @@ public:
 atk_object_set_name(pToggleButtonAccessible, pName);
 if (const char* pDesc = 
atk_object_get_description(pComboBoxAccessible))
 atk_object_set_description(pToggleButtonAccessible, pDesc);
+
+if (AtkRelationSet* pComboBoxRelationSet = 
atk_object_ref_relation_set(pComboBoxAccessible))
+{
+AtkRelationSet* pToggleButtonRelationSet = 
atk_object_ref_relation_set(pToggleButtonAccessible);
+assert(pToggleButtonRelationSet);
+for (int i = 0; i < 
atk_relation_set_get_n_relations(pComboBoxRelationSet); i++)
+{
+AtkRelation* pRelation = 
atk_relation_set_get_relation(pComboBoxRelationSet, i);
+assert(pRelation);
+atk_relation_set_add(pToggleButtonRelationSet, 
pRelation);
+}
+g_object_unref(pComboBoxRelationSet);
+g_object_unref(pToggleButtonRelationSet);
+}
 }
 }
 


core.git: vcl/uiconfig vcl/unx

2024-04-20 Thread Michael Weghorn (via logerrit)
 vcl/uiconfig/ui/combobox.ui |5 +
 vcl/unx/gtk3/gtkinst.cxx|   12 
 2 files changed, 17 insertions(+)

New commits:
commit 1e851093f0148d2c55fc3fd377d274f6703c71c9
Author: Michael Weghorn 
AuthorDate: Thu Apr 18 14:02:25 2024 +0200
Commit: Michael Weghorn 
CommitDate: Sat Apr 20 15:28:58 2024 +0200

tdf#159910 gtk3 a11y: Keep a11y props for combobox

Due to various issues with GtkComboBox, the gtk3 VCL
plugin does not use the original GtkComboBox, but a
custom implementation, originally
introduced in

commit bc0e0f633b05c4f91b6695488fc9e5c127507ba5
Date:   Thu Apr 9 11:41:00 2020 +0100

tdf#131120 use a replacement for GtkComboBox

(See full commit message for more details and reasons.)

This means that the accessible role, name and description
from the .ui file are not set automatically for the
GtkToggleButton widget that acts as the combobox
instead and receives keyboard focus.

In order to make these available for AT, explicitly
take these over from the original GtkComboBox.

With this in place, the Orca screen reader now
e.g. properly announces the comboboxes in Writer's
Navigator as "Navigate By, combobox" and
"Active window, combobox" (similar to how it already
does for the qt6 VCL plugin), rather than just saying
"toggle button, not pressed", which didn't give any hint
to the user what the currently focused UI element
is about and how to interact with it.

Also set a default a11y role of combo-box in
the replacement's .ui file. (The role from
the GtkComboBox's AtkObject should always override
that in practice, though.)

Change-Id: If5faf77c5f82836c376c04bb6e4e42ce5a3023a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166248
Tested-by: Jenkins
    Reviewed-by: Michael Weghorn 

diff --git a/vcl/uiconfig/ui/combobox.ui b/vcl/uiconfig/ui/combobox.ui
index a0b72e27821f..6abaa6a25171 100644
--- a/vcl/uiconfig/ui/combobox.ui
+++ b/vcl/uiconfig/ui/combobox.ui
@@ -51,6 +51,11 @@
 
   
 
+
+  
+combo-box
+  
+
 
   <class name="combo"/>
 
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index f35dad49d141..bcdcbc1c6157 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -22172,6 +22172,18 @@ public:
 g_signal_connect(getContainer(), "query-tooltip", 
G_CALLBACK(signalComboTooltipQuery), this);
 }
 
+if (AtkObject* pComboBoxAccessible = 
gtk_widget_get_accessible(GTK_WIDGET(m_pComboBox)))
+{
+if (AtkObject* pToggleButtonAccessible = 
gtk_widget_get_accessible(GTK_WIDGET(m_pToggleButton)))
+{
+atk_object_set_role(pToggleButtonAccessible, 
atk_object_get_role(pComboBoxAccessible));
+if (const char* pName = 
atk_object_get_name(pComboBoxAccessible))
+atk_object_set_name(pToggleButtonAccessible, pName);
+if (const char* pDesc = 
atk_object_get_description(pComboBoxAccessible))
+atk_object_set_description(pToggleButtonAccessible, pDesc);
+}
+}
+
 insertAsParent(GTK_WIDGET(m_pComboBox), GTK_WIDGET(getContainer()));
 gtk_widget_set_visible(GTK_WIDGET(m_pComboBox), false);
 gtk_widget_set_no_show_all(GTK_WIDGET(m_pComboBox), true);


core.git: 2 commits - sw/uiconfig vcl/uiconfig

2024-04-20 Thread Michael Weghorn (via logerrit)
 sw/uiconfig/swriter/ui/navigatorpanel.ui |5 ++
 vcl/uiconfig/ui/combobox.ui  |   75 ++-
 2 files changed, 41 insertions(+), 39 deletions(-)

New commits:
commit 9bb46a8e9819fa74dee53b305a4255bb72a89e22
Author: Michael Weghorn 
AuthorDate: Thu Apr 18 13:50:12 2024 +0200
Commit: Michael Weghorn 
CommitDate: Sat Apr 20 15:28:24 2024 +0200

tdf#159910 gtk3: Resave vcl/uiconfig/ui/combobox.ui with glade 3.40

... before doing more changes to the file in an upcoming
commit, to keep the diff clearer.

Change-Id: I3da5d9d708681888418251139e1d5aad4c152ad6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166247
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/uiconfig/ui/combobox.ui b/vcl/uiconfig/ui/combobox.ui
index 23cfe7ed9e31..a0b72e27821f 100644
--- a/vcl/uiconfig/ui/combobox.ui
+++ b/vcl/uiconfig/ui/combobox.ui
@@ -1,18 +1,18 @@
 
-
+
 
   
   
 combobox
 True
-False
-True
+False
+True
 
   
 True
-True
-True
-True
+True
+True
+True
 True
 
   <class name="combo"/>
@@ -27,25 +27,25 @@
 <child>
   <object class="GtkToggleButton" id="button">
 <property name="visible">True</property>
-<property name="can_focus">True</property>
-<property name="receives_default">True</property>
-<property name="no_show_all">True</property>
-<property name="always_show_image">True</property>
-<property name="draw_indicator">True</property>
+<property name="can-focus">True</property>
+<property name="receives-default">True</property>
+<property name="no-show-all">True</property>
+<property name="always-show-image">True</property>
+<property name="draw-indicator">True</property>
 <child>
   <object class="GtkBox">
 <property name="visible">True</property>
-<property name="can_focus">False</property>
+<property name="can-focus">False</property>
 <child>
   <object class="GtkImage" id="arrow">
 <property name="visible">True</property>
-<property name="can_focus">False</property>
-<property name="icon_name">pan-down-symbolic</property>
+<property name="can-focus">False</property>
+<property name="icon-name">pan-down-symbolic</property>
   </object>
   <packing>
 <property name="expand">False</property>
 <property name="fill">False</property>
-<property name="pack_type">end</property>
+<property name="pack-type">end</property>
 <property name="position">0</property>
   </packing>
 </child>
@@ -58,7 +58,7 @@
   <packing>
 <property name="expand">False</property>
 <property name="fill">True</property>
-<property name="pack_type">end</property>
+<property name="pack-type">end</property>
 <property name="position">2</property>
   </packing>
 </child>
@@ -67,49 +67,46 @@
 
   
   
-True
-True
-True
-True
-False
+True
+True
+True
+True
+False
 
   
 True
-False
-pan-down-symbolic
+False
+pan-down-symbolic
   
 
   
   
 gtk-combobox-popup-window
-    False
+False
 popup
 False
 True
-combo
-    
-      
-
+combo
 
   
 True
-False
+False
 
   
 True
-True
-never
-in
-False
+True
+never
+in
+False
 
   
 True
-True
-False
-False
-0
-False
-True
+True
+False
+False
+0
+False
+True
 
  

core.git: winaccessibility/inc winaccessibility/source

2024-04-17 Thread Michael Weghorn (via logerrit)
 winaccessibility/inc/AccObject.hxx|2 +-
 winaccessibility/source/service/AccObject.cxx |3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 58de3a5f1cd80cfff0c7e8db326a66d34501e09b
Author: Michael Weghorn 
AuthorDate: Wed Apr 17 15:44:50 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Apr 17 21:33:06 2024 +0200

wina11y: Drop unnecessary null check and make static

`AccObject::GetMAccessibleValueFromAny` converts an
Any to a string representation, which is unrelated
to any class members, so drop the null check for the
`m_pIMAcc` member and make the method static.

Change-Id: I07216f87c0fadbe239d1e16a048e2799cebac7bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166184
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/inc/AccObject.hxx 
b/winaccessibility/inc/AccObject.hxx
index 65c8f5777331..81d69082095a 100644
--- a/winaccessibility/inc/AccObject.hxx
+++ b/winaccessibility/inc/AccObject.hxx
@@ -67,7 +67,7 @@ private:
 DWORD GetMSAAStateFromUNO(sal_Int64 xState);//translate state from UNO to 
MSAA value
 css::accessibility::XAccessibleSelection* GetXAccessibleSelection();
 void GetExpandedState(sal_Bool* isExpandable, sal_Bool* isExpanded);
-OUString GetMAccessibleValueFromAny(css::uno::Any pAny);
+static OUString GetMAccessibleValueFromAny(css::uno::Any pAny);
 
 public:
 
diff --git a/winaccessibility/source/service/AccObject.cxx 
b/winaccessibility/source/service/AccObject.cxx
index 51d04ec18dea..c7003568324b 100644
--- a/winaccessibility/source/service/AccObject.cxx
+++ b/winaccessibility/source/service/AccObject.cxx
@@ -506,9 +506,6 @@ OUString AccObject::GetMAccessibleValueFromAny(Any pAny)
 {
 OUString strValue;
 
-if(nullptr == m_pIMAcc)
-return strValue;
-
 if(pAny.getValueType() == cppu::UnoType::get() 
)
 {
 sal_uInt16 val;


core.git: winaccessibility/inc winaccessibility/source

2024-04-17 Thread Michael Weghorn (via logerrit)
 winaccessibility/inc/AccObjectWinManager.hxx  |2 
 winaccessibility/source/service/AccComponentEventListener.cxx |   27 +++---
 winaccessibility/source/service/AccObjectWinManager.cxx   |   20 ---
 3 files changed, 19 insertions(+), 30 deletions(-)

New commits:
commit 0425b6eb47830b1fe630dc0128d5049f4b3e5582
Author: Michael Weghorn 
AuthorDate: Tue Apr 16 19:02:30 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Apr 17 08:07:17 2024 +0200

tdf#160695 wina11y: Send status change events for toolbar buttons

When the checked or indeterminate state of a toolbar button
changes, forward the corresponding UNO a11y event as
a corresponding MSAA event.

For roles `AccessibleRole::PUSH_BUTTON` and
`AccessibleRole::TOGGLE_BUTTON`, `AccObject::GetMSAAStateFromUNO`
uses `STATE_SYSTEM_PRESSED` instead of
`STATE_SYSTEM_CHECKED`, so also use
`UnoMSAAEvent::STATE_PRESSED` for the event.

It's unclear why sending of such events would generally
be omitted for "special toolbar items" previously.

The events can be used to implement announcement of
toggled font attributes in NVDA, e.g. when the "Bold"
button in the formatting toolbar is toggled via a keyboard
shortcut, similar to how Orca does it (s. tdf#123864).

Related NVDA issue for which I plan to submit a PR: [1]

[1] https://github.com/nvaccess/nvda/issues/4248

Change-Id: Ic2846e338802c3cb7656de5b77e4df23bd5b0703
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166155
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/winaccessibility/inc/AccObjectWinManager.hxx 
b/winaccessibility/inc/AccObjectWinManager.hxx
index 024a58fc8655..8e50adaf75c4 100644
--- a/winaccessibility/inc/AccObjectWinManager.hxx
+++ b/winaccessibility/inc/AccObjectWinManager.hxx
@@ -132,8 +132,6 @@ public:
 
 void UpdateChildState(css::accessibility::XAccessible* pXAcc);
 
-bool IsSpecialToolbarItem(css::accessibility::XAccessible* pXAcc);
-
 static short GetRole(css::accessibility::XAccessible* pXAcc);
 
 css::accessibility::XAccessible* GetAccDocByAccTopWin( 
css::accessibility::XAccessible* pXAcc );
diff --git a/winaccessibility/source/service/AccComponentEventListener.cxx 
b/winaccessibility/source/service/AccComponentEventListener.cxx
index bc6475754097..a55b585544d2 100644
--- a/winaccessibility/source/service/AccComponentEventListener.cxx
+++ b/winaccessibility/source/service/AccComponentEventListener.cxx
@@ -207,6 +207,19 @@ void 
AccComponentEventListener::SetComponentState(sal_Int64 state, bool enable)
  */
 void AccComponentEventListener::FireStatePropertyChange(sal_Int64 state, bool 
set)
 {
+if (!m_xAccessible.is())
+return;
+
+css::uno::Reference xAccContext = 
m_xAccessible->getAccessibleContext();
+if (!xAccContext.is())
+return;
+
+const sal_Int16 nRole = xAccContext->getAccessibleRole();
+// for these button roles, MSAA state STATE_SYSTEM_PRESSED is used instead 
of
+// STATE_SYSTEM_CHECKED (s. AccObject::GetMSAAStateFromUNO)
+const bool bPressedInsteadOfChecked
+= (nRole == AccessibleRole::PUSH_BUTTON) || (nRole == 
AccessibleRole::TOGGLE_BUTTON);
+
 if( set)
 {
 // new value
@@ -216,11 +229,10 @@ void 
AccComponentEventListener::FireStatePropertyChange(sal_Int64 state, bool se
 case AccessibleStateType::INDETERMINATE:
 m_rObjManager.IncreaseState(m_xAccessible.get(), state);
 m_rObjManager.UpdateAction(m_xAccessible.get());
-
-if (!m_rObjManager.IsSpecialToolbarItem(m_xAccessible.get()))
-{
+if (bPressedInsteadOfChecked)
+m_rObjManager.NotifyAccEvent(m_xAccessible.get(), 
UnoMSAAEvent::STATE_PRESSED);
+else
 m_rObjManager.NotifyAccEvent(m_xAccessible.get(), 
UnoMSAAEvent::STATE_CHECKED);
-}
 break;
 case AccessibleStateType::PRESSED:
 m_rObjManager.IncreaseState(m_xAccessible.get(), state);
@@ -256,11 +268,10 @@ void 
AccComponentEventListener::FireStatePropertyChange(sal_Int64 state, bool se
 case AccessibleStateType::INDETERMINATE:
 m_rObjManager.DecreaseState(m_xAccessible.get(), state);
 m_rObjManager.UpdateAction(m_xAccessible.get());
-
-if (!m_rObjManager.IsSpecialToolbarItem(m_xAccessible.get()))
-{
+if (bPressedInsteadOfChecked)
+m_rObjManager.NotifyAccEvent(m_xAccessible.get(), 
UnoMSAAEvent::STATE_PRESSED);
+else
 m_rObjManager.NotifyAccEvent(m_xAccessible.get(), 
UnoMSAAEvent::STATE_CHECKED);
-}
 break;
 case AccessibleStateType::PRESSED:
 m_rObjManager.DecreaseState(m_xAccessible.get(), state);
diff --git a/winaccessibility/source/service/AccObjectWinManager.cxx 
b/winac

core.git: android/source

2024-04-15 Thread Michael Weghorn (via logerrit)
 android/source/build.gradle  |2 
 android/source/lint-baseline.xml |   79 +--
 2 files changed, 13 insertions(+), 68 deletions(-)

New commits:
commit 312b9a67f08de17f68ca971f4d640bc2df8de12e
Author: Michael Weghorn 
AuthorDate: Mon Apr 15 10:53:46 2024 +0200
Commit: Michael Weghorn 
CommitDate: Mon Apr 15 20:06:34 2024 +0200

android: Update Android Gradle Plugin to 8.3.2

... as suggested by Android Studio.

Also update the Lint baseline file, as the build would
otherwise fail due to this new warning:

> Task :lintReportStrippedUIEditingDebug
Wrote HTML report to 
file:///home/michi/development/git/libreoffice-WORKTREE-android/android/source/build/reports/lint-results-strippedUIEditingDebug.html

> Task :lintStrippedUIEditingDebug FAILED

/home/michi/development/git/libreoffice-WORKTREE-android/android/source/lint-baseline.xml:
 Information: 213 errors and 1 warning were filtered out because they are 
listed in the baseline file, lint-baseline.xml
 [LintBaseline]

/home/michi/development/git/libreoffice-WORKTREE-android/android/source/lint-baseline.xml:
 Information: 6 errors/warnings were listed in the baseline file 
(lint-baseline.xml) but not found in the project; perhaps they have been fixed? 
Another possible explanation is that lint recently stopped analyzing (and 
including results from) dependent projects by default. You can turn this back 
on with android.lintOptions.checkDependencies=true. Unmatched issue types: 
PrivateResource, RedundantNamespace, TypographyEllipsis (3), UnusedNamespace 
[LintBaseline]

/home/michi/development/git/libreoffice-WORKTREE-android/android/source/AndroidManifest.xml:109:
 Error: Should not restrict activity to fixed orientation. This may not be 
suitable for different form factors, causing the app to be letterboxed. 
[DiscouragedApi]
android:screenOrientation="landscape" >
~

   Explanation for issues of type "DiscouragedApi":
   Discouraged APIs are allowed and are not deprecated, but they may be 
unfit
   for common use (e.g. due to slow performance or subtle behavior).

1 errors, 0 warnings (213 errors, 1 warning filtered by baseline 
lint-baseline.xml)

FAILURE: Build failed with an exception.

Change-Id: I621b2334fef954bcd341cdde9034187f455339e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166114
Tested-by: Jenkins
    Reviewed-by: Michael Weghorn 

diff --git a/android/source/build.gradle b/android/source/build.gradle
index 090d73f49bfb..8cbef7744d8e 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -21,7 +21,7 @@ buildscript {
 google()
 }
 dependencies {
-classpath 'com.android.tools.build:gradle:8.2.1'
+classpath 'com.android.tools.build:gradle:8.3.2'
 }
 }
 
diff --git a/android/source/lint-baseline.xml b/android/source/lint-baseline.xml
index 24e6447295e3..01fdd6f8d234 100644
--- a/android/source/lint-baseline.xml
+++ b/android/source/lint-baseline.xml
@@ -1,5 +1,5 @@
 
-
+
 
 
 
 
-
-
-
-
 
 
 
+
+
+
+
 
 
 
-http://schemas.android.com/apk/res/android;
-errorLine2="  
~~">
-
-
-
 
 
 
-http://schemas.android.com/apk/res/android;
-errorLine2="  
~~">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 


core.git: Branch 'libreoffice-24-2' - svx/source

2024-04-12 Thread Michael Weghorn (via logerrit)
 svx/source/form/fmpage.cxx |   31 +++
 1 file changed, 15 insertions(+), 16 deletions(-)

New commits:
commit d1c29054449b00a16da6ee7ecaef0a94fe3964bf
Author: Michael Weghorn 
AuthorDate: Thu Apr 11 11:02:41 2024 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Fri Apr 12 08:08:06 2024 +0200

tdf#160176 svx: Reset help text when form control has none

In `FmFormPage::RequestHelp`, also call
`Help::ShowQuickHelp`/`Help::ShowBalloon` when
the help text is empty, as that is the way to
unset the help text/remove the tooltip again,
see `ImplShowHelpWindow` in `vcl/source/app/help.cxx`:

For the case of non-native tooltips (e.g. the
gen VCL plugin on Linux), the `bRemoveHelp = true`
code path is relevant.
For qt5/qt6/kf5/kf6 which use native tooltips,
the call to

pParent->ImplGetFrame()->ShowTooltip(rHelpText, rHelpArea)

further up sets the `QtFrame`'s `m_aTooltipText` member
to an empty string, which prevents showing the outdated
help text for the `QEvent::ToolTip` event in
`QtWidget::handleEvent`.

Change-Id: Iceb2424d9c72ae46333a718c677629122e517f11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166006
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 6347c89711903834cc9188abda5d5a253053b789)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165933
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx
index 8c24f3cc22ae..6e4f2093d011 100644
--- a/svx/source/form/fmpage.cxx
+++ b/svx/source/form/fmpage.cxx
@@ -139,22 +139,21 @@ bool FmFormPage::RequestHelp( vcl::Window* pWindow, 
SdrView const * pView,
 }
 }
 }
-if ( !aHelpText.isEmpty() )
-{
-// display the help
-tools::Rectangle aItemRect = pObj->GetCurrentBoundRect();
-aItemRect = pWindow->LogicToPixel( aItemRect );
-Point aPt = pWindow->OutputToScreenPixel( aItemRect.TopLeft() );
-aItemRect.SetLeft( aPt.X() );
-aItemRect.SetTop( aPt.Y() );
-aPt = pWindow->OutputToScreenPixel( aItemRect.BottomRight() );
-aItemRect.SetRight( aPt.X() );
-aItemRect.SetBottom( aPt.Y() );
-if( rEvt.GetMode() == HelpEventMode::BALLOON )
-Help::ShowBalloon( pWindow, aItemRect.Center(), aItemRect, 
aHelpText);
-else
-Help::ShowQuickHelp( pWindow, aItemRect, aHelpText );
-}
+
+// display the help
+tools::Rectangle aItemRect = pObj->GetCurrentBoundRect();
+aItemRect = pWindow->LogicToPixel( aItemRect );
+Point aPt = pWindow->OutputToScreenPixel( aItemRect.TopLeft() );
+aItemRect.SetLeft( aPt.X() );
+aItemRect.SetTop( aPt.Y() );
+aPt = pWindow->OutputToScreenPixel( aItemRect.BottomRight() );
+aItemRect.SetRight( aPt.X() );
+aItemRect.SetBottom( aPt.Y() );
+if( rEvt.GetMode() == HelpEventMode::BALLOON )
+Help::ShowBalloon( pWindow, aItemRect.Center(), aItemRect, aHelpText);
+else
+Help::ShowQuickHelp( pWindow, aItemRect, aHelpText );
+
 return true;
 }
 


core.git: 2 commits - svx/source vcl/qt5

2024-04-11 Thread Michael Weghorn (via logerrit)
 svx/source/form/fmpage.cxx  |   31 +++
 vcl/qt5/QtGraphics_Controls.cxx |   23 +--
 2 files changed, 32 insertions(+), 22 deletions(-)

New commits:
commit 6347c89711903834cc9188abda5d5a253053b789
Author: Michael Weghorn 
AuthorDate: Thu Apr 11 11:02:41 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 11 23:54:21 2024 +0200

tdf#160176 svx: Reset help text when form control has none

In `FmFormPage::RequestHelp`, also call
`Help::ShowQuickHelp`/`Help::ShowBalloon` when
the help text is empty, as that is the way to
unset the help text/remove the tooltip again,
see `ImplShowHelpWindow` in `vcl/source/app/help.cxx`:

For the case of non-native tooltips (e.g. the
gen VCL plugin on Linux), the `bRemoveHelp = true`
code path is relevant.
For qt5/qt6/kf5/kf6 which use native tooltips,
the call to

pParent->ImplGetFrame()->ShowTooltip(rHelpText, rHelpArea)

further up sets the `QtFrame`'s `m_aTooltipText` member
to an empty string, which prevents showing the outdated
help text for the `QEvent::ToolTip` event in
`QtWidget::handleEvent`.

Change-Id: Iceb2424d9c72ae46333a718c677629122e517f11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166006
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx
index 8c24f3cc22ae..6e4f2093d011 100644
--- a/svx/source/form/fmpage.cxx
+++ b/svx/source/form/fmpage.cxx
@@ -139,22 +139,21 @@ bool FmFormPage::RequestHelp( vcl::Window* pWindow, 
SdrView const * pView,
 }
 }
 }
-if ( !aHelpText.isEmpty() )
-{
-// display the help
-tools::Rectangle aItemRect = pObj->GetCurrentBoundRect();
-aItemRect = pWindow->LogicToPixel( aItemRect );
-Point aPt = pWindow->OutputToScreenPixel( aItemRect.TopLeft() );
-aItemRect.SetLeft( aPt.X() );
-aItemRect.SetTop( aPt.Y() );
-aPt = pWindow->OutputToScreenPixel( aItemRect.BottomRight() );
-aItemRect.SetRight( aPt.X() );
-aItemRect.SetBottom( aPt.Y() );
-if( rEvt.GetMode() == HelpEventMode::BALLOON )
-Help::ShowBalloon( pWindow, aItemRect.Center(), aItemRect, 
aHelpText);
-else
-Help::ShowQuickHelp( pWindow, aItemRect, aHelpText );
-}
+
+// display the help
+tools::Rectangle aItemRect = pObj->GetCurrentBoundRect();
+aItemRect = pWindow->LogicToPixel( aItemRect );
+Point aPt = pWindow->OutputToScreenPixel( aItemRect.TopLeft() );
+aItemRect.SetLeft( aPt.X() );
+aItemRect.SetTop( aPt.Y() );
+aPt = pWindow->OutputToScreenPixel( aItemRect.BottomRight() );
+aItemRect.SetRight( aPt.X() );
+aItemRect.SetBottom( aPt.Y() );
+if( rEvt.GetMode() == HelpEventMode::BALLOON )
+Help::ShowBalloon( pWindow, aItemRect.Center(), aItemRect, aHelpText);
+else
+Help::ShowQuickHelp( pWindow, aItemRect, aHelpText );
+
 return true;
 }
 
commit bf4ec3b2beb8121614b8a4098061f49f851b30f8
Author: Michael Weghorn 
AuthorDate: Thu Apr 11 10:31:40 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 11 23:54:14 2024 +0200

related tdf#160176 qt: Create dummy Qt widget in main thread

Always run `QtGraphics_Controls::getNativeControlRegion`
in the main thread, as it may create a dummy `QLineEdit`
(see the `ControlType::MultilineEditbox` and
`ControlType::Editbox` cases) and creating Qt widgets
is only allowed in the main thread.

Without the following scenario runs into an assert
with a current Qt 6 dev debug build when using the
qt6 VCL plugin:

1) open sample document attachment 193089
   from tdf#160176
2) enable Form Design Toolbar
3) switch to Design mode
4) select label next to "Labelfield2" label
5) right-click, "Control Properties"
6) type anything for the help text and tab
   to the next UI element

Backtrace:

ASSERT failure in QWidget: "Widgets must be created in the GUI 
thread.", file 
/home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp, line 956

Thread 45 "browserlistbox" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fff8d08d6c0 (LWP 203558)]
__pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x778a81cf in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7785a472 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3 

core.git: 2 commits - vcl/source

2024-04-11 Thread Michael Weghorn (via logerrit)
 vcl/source/window/accessibility.cxx |  147 ++--
 1 file changed, 107 insertions(+), 40 deletions(-)

New commits:
commit 520722210d9ffcf57b08e4bd7dd8803c5190937c
Author: Michael Weghorn 
AuthorDate: Thu Apr 11 09:39:08 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 11 23:53:52 2024 +0200

a11y: Assign a11y role for WindowType::PROGRESSBAR

`WindowType::PROGRESSBAR` was recently added in

commit 460a7103664ac8dc60e260c56e5113d689b8072f
Author: Hubert Figuière 
Date:   Fri Mar 22 09:59:54 2024 -0400

vcl: Implement JSLevelBar

This fixes the JSDialog layout of the sheet protection dialog.
This was introduced for 24.02 to provide password strength 
indication
of the sheet password.

Defined a new WindowType of PROGRESSBAR.
The type property in JSDialog JSON will be "progressbar".

Map it to the corresponding a11y role,
`accessibility::AccessibleRole::PROGRESS_BAR`, so
it's reported as such on the a11y level.

The role can e.g. be seen in Accerciser for the password strength
indicator (progress bar) in the dialog to set a document password
(shown when checking the "Save with password" checkbox in the Save
dialog in Writer).

Before:

In [2]: acc.role
Out[2]: 

With this commit in place:

In [8]: acc.role
Out[8]: 

Change-Id: Idfd7798641e30632a9ffd2ea07a79d42d159a51f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165989
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/window/accessibility.cxx 
b/vcl/source/window/accessibility.cxx
index 47f46ee44ab7..e48d5d22dd5e 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -363,6 +363,10 @@ sal_uInt16 Window::getDefaultAccessibleRole() const
 nRole = accessibility::AccessibleRole::TOOL_TIP;
 break;
 
+case WindowType::PROGRESSBAR:
+nRole = accessibility::AccessibleRole::PROGRESS_BAR;
+break;
+
 case WindowType::RULER:
 nRole = accessibility::AccessibleRole::RULER;
 break;
commit 0de33d779747d4117348daf92b08b105102968b3
Author: Michael Weghorn 
AuthorDate: Thu Apr 11 09:17:39 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 11 23:53:45 2024 +0200

vcl a11y: Reformat switch-case in Window::getDefaultAccessibleRole

Use more standard formatting for this switch-case in
`Window::getDefaultAccessibleRole` (mostly done by clang-format).
It helps at least myself see more easily what a11y role
a window type is mapped to as the assignment and break are
on separate, further indented lines now.

Change-Id: Ic6c7588f2212055812cd32d34eccbaf27fa41eb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165988
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/window/accessibility.cxx 
b/vcl/source/window/accessibility.cxx
index 72dc2797d935..47f46ee44ab7 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -215,111 +215,174 @@ void Window::SetAccessibleRole( sal_uInt16 nRole )
 sal_uInt16 Window::getDefaultAccessibleRole() const
 {
 sal_uInt16 nRole = 0x;
-switch ( GetType() )
+switch (GetType())
 {
-case WindowType::MESSBOX:// MT: Would be nice to have special 
roles!
+case WindowType::MESSBOX: // MT: Would be nice to have special roles!
 case WindowType::INFOBOX:
 case WindowType::WARNINGBOX:
 case WindowType::ERRORBOX:
-case WindowType::QUERYBOX: nRole = 
accessibility::AccessibleRole::ALERT; break;
+case WindowType::QUERYBOX:
+nRole = accessibility::AccessibleRole::ALERT;
+break;
 
 case WindowType::MODELESSDIALOG:
 case WindowType::TABDIALOG:
 case WindowType::BUTTONDIALOG:
-case WindowType::DIALOG: nRole = 
accessibility::AccessibleRole::DIALOG; break;
+case WindowType::DIALOG:
+nRole = accessibility::AccessibleRole::DIALOG;
+break;
 
 case WindowType::PUSHBUTTON:
 case WindowType::OKBUTTON:
 case WindowType::CANCELBUTTON:
 case WindowType::HELPBUTTON:
 case WindowType::IMAGEBUTTON:
-case WindowType::MOREBUTTON: nRole = 
accessibility::AccessibleRole::PUSH_BUTTON; break;
-case WindowType::MENUBUTTON: nRole = 
accessibility::AccessibleRole::BUTTON_MENU; break;
+case WindowType::MOREBUTTON:
+nRole = accessibility::AccessibleRole::PUSH_BUTTON;
+break;
+case WindowType::MENUBUTTON:
+nRole = accessibility::AccessibleRole::BUTTON_MENU;
+break;
 
-case WindowType::RADIOBUTTON: nRole = 
accessibility::Accessib

core.git: 3 commits - offapi/com vcl/unx

2024-04-04 Thread Michael Weghorn (via logerrit)
 offapi/com/sun/star/accessibility/XAccessibleEditableText.idl  |2 
 offapi/com/sun/star/accessibility/XAccessibleMultiLineText.idl |4 
 vcl/unx/gtk4/gtkaccessibletext.cxx |   53 
++
 3 files changed, 56 insertions(+), 3 deletions(-)

New commits:
commit 23f13bc8c1aba9e53789180ef09ed06594ea4649
Author: Michael Weghorn 
AuthorDate: Thu Apr 4 13:09:51 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 4 17:16:18 2024 +0200

gtk4 a11y: Implement new GtkAccessibleTextInterface::get_offset

Implement the new `get_offset` method for
`GtkAccessibleTextInterface` newly introduced
in GTK 4 in GTK commits

commit f802be88e98f817c3d6fa048bf79d82de60173d3
Author: Matthias Clasen 
Date:   Sun Mar 10 10:27:56 2024 -0400

a11y: Use gtk_accessible_text_get_offset

Implement GetOffsetAtPoint using gtk_accessible_text_get_offset.

commit b9d2049991427e8dee443e9f3b683e52c96d6b83
Author: Matthias Clasen 
Date:   Sun Mar 10 10:27:32 2024 -0400

a11y: Add gtk_accessible_text_get_offset

This is not implemented yet.

commit cfe35586107d7c42eb3af7aa38ee23df22f718d0
Author: Matthias Clasen 
Date:   Sun Mar 10 10:02:24 2024 -0400

a11y: Add GetOffsetAtPoint

We don't handle it yet.

In order for this to actually work on the AT-SPI level,
this also needs fixes on the GTK side. Pending MR: [1]

With this, the previous

Change-Id: I7d171b6696037a696f0d767d3134c7a7184f93a3
Author: Michael Weghorn 
Date:   Thu Apr 4 11:08:10 2024 +0200

gtk4 a11y: Implement new GtkAccessibleTextInterface::get_extents

and the mentioned GTK MR in place, a quick test with a Writer
paragraph using Accerciser's IPython console now looks OK:

In [1]: acc.queryText().getCharacterExtents(5, pyatspi.XY_WINDOW)
Out[1]: (483, 219, 4, 18)
In [2]: acc.queryText().getOffsetAtPoint(484, 220, pyatspi.XY_WINDOW)
Out[2]: 5

[1] https://docs.gtk.org/atk/vfunc.Text.get_range_extents.html

Change-Id: Ieb45e3d0d6f37350898ffee081491bf94b6dbea0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165794
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk4/gtkaccessibletext.cxx 
b/vcl/unx/gtk4/gtkaccessibletext.cxx
index 40040fb52f1c..05a8a2fe6ba7 100644
--- a/vcl/unx/gtk4/gtkaccessibletext.cxx
+++ b/vcl/unx/gtk4/gtkaccessibletext.cxx
@@ -251,6 +251,23 @@ static gboolean 
lo_accessible_text_get_extents(GtkAccessibleText* self, unsigned
 
 return true;
 }
+
+static gboolean lo_accessible_text_get_offset(GtkAccessibleText* self,
+  const graphene_point_t* point, 
unsigned int* offset)
+{
+css::uno::Reference xText = 
getXText(self);
+if (!xText.is())
+return false;
+
+css::awt::Point aPoint(point->x, point->y);
+const sal_Int32 nIndex = xText->getIndexAtPoint(aPoint);
+
+if (nIndex < 0)
+return false;
+
+*offset = nIndex;
+return true;
+}
 #endif
 
 void lo_accessible_text_init(gpointer iface_, gpointer)
@@ -264,6 +281,7 @@ void lo_accessible_text_init(gpointer iface_, gpointer)
 iface->get_default_attributes = lo_accessible_text_get_default_attributes;
 #if GTK_CHECK_VERSION(4, 15, 0)
 iface->get_extents = lo_accessible_text_get_extents;
+iface->get_offset = lo_accessible_text_get_offset;
 #endif
 }
 
commit 89f272c8bbcdb5e46ed051564735b46cc0023b8b
Author: Michael Weghorn 
AuthorDate: Thu Apr 4 11:08:10 2024 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 4 17:16:12 2024 +0200

gtk4 a11y: Implement new GtkAccessibleTextInterface::get_extents

Implement the new `get_extents` method for
`GtkAccessibleTextInterface` newly introduced
in GTK 4 in GTK commits

  commit 7955efef6c31d23c8553dc3464e72273886a4417
  Author: Matthias Clasen 
  Date:   Sun Mar 10 14:28:07 2024 -0400

  atspi: Use gtk_accessible_text_get_extents

  Implement the GetCharacterExtents and GetRangeExtents methods of
  the atspi Text interface using the new GtkAccessibleText api.

  commit 3134003376fc37c6d5e7e6eb7c6f36307039a92c
  Author: Matthias Clasen 
  Date:   Sun Mar 10 14:27:42 2024 -0400

  a11y: Add gtk_accessible_text_get_extents

  This will be used to implement GetRangeExtents in atspi.

The `XAccessibleText` UNO interface currently
only has a way to retrieve the extents of a
single character, so just return `false`
if the extents for a larger text range is
requested.
(LO's gtk3/ATK implemenation currently also doesn't
implement AtkText.get_range_extents` [1])

Re: Adding support for the Common Print Dialog Backends (CPDB)

2024-03-28 Thread Michael Weghorn

On 2024-03-28 11:23, Biswadeep Purkayastha wrote:

 >@Biswadeep: As you're implementing the feature, could you please keep in
 >mind to add this to the release notes once it's been integrated?

 >(Depending on when it gets merged, this would likely be either for
 >LibreOffice 24.8 or 25.2).

Sure, I'll keep it in mind.


Great, thanks!


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Eager to contribute to GSoC 2024

2024-03-28 Thread Michael Weghorn

On 2024-03-27 12:12, Ritobroto Mukherjee wrote:
I am submitting my formal application for GSoC in this email, and an 
attached document with further details.


Please note that (from what I know at least), the formal application 
needs to be submitted via the GSoC website, so I'd recommend to check 
and resubmit there.


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Adding support for the Common Print Dialog Backends (CPDB)

2024-03-28 Thread Michael Weghorn

On 2024-03-27 19:33, Till Kamppeter wrote:


Would be good to tell them that for CUPS 3.x use of CPDB is required.

For CUPS 2.x the direct CUPS interface can be used and CPDB also works 
with CUPS 2.x (CPDB works with any CUPS).


Once CPDB support has been implemented, that can be added to the release 
notes.

These are maintained on a wiki page.

For the next Libreoffice release LibreOffice 24.8:
https://wiki.documentfoundation.org/ReleaseNotes/24.8

@Biswadeep: As you're implementing the feature, could you please keep in 
mind to add this to the release notes once it's been integrated?


(Depending on when it gets merged, this would likely be either for 
LibreOffice 24.8 or 25.2).


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Adding support for the Common Print Dialog Backends (CPDB)

2024-03-27 Thread Michael Weghorn

On 2024-03-27 17:40, Till Kamppeter wrote:

On 27/03/2024 16:22, Michael Weghorn wrote:


Are you aware of any specific reasons why distros would prefer direct 
use of CUPS API over CPDB other than the usual packaging efforts 
needed for any new library?




No.

It could only happen that some distros are perhaps not aware of CPDB and 
therefore try to go the way of directly talking with CUPs.


Good, then I currently see no blocker for requiring CPDB for CUPS 3.x 
support. Distros will then become aware once they're packaging any 
software depending on CPDB at latest.


OK. If CPDB is used it must be taken care that we nowhere talk with CUPS 
directly, as otherwise non-CUPS CPDB backends (cloud printing services) 
will not work.


Yes, that makes sense. (For the CPDB case, we won't want to use CUPS 
directly anymore, as CPDB API should be providing everything that's 
needed, as you mentioned earlier.)


Michael


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Adding support for the Common Print Dialog Backends (CPDB)

2024-03-27 Thread Michael Weghorn

On 2024-03-27 15:26, Till Kamppeter wrote:
Also, if we would clean up and update the current CUPS/PPD interface, 
some distros will not go CPDB and users complain when CUPS has another 
significant change or if a clod printing service with their CPDB backend 
shows up.


Are you aware of any specific reasons why distros would prefer direct 
use of CUPS API over CPDB other than the usual packaging efforts needed 
for any new library?


This ways distros have to go CPDB at a certain point of time. They can 
opt to switch over early, for a smooth transition to CUPS 3.x.


Yes, distro packagers should generally be able to judge best when it's 
the right time to switch.


GTK has no alternative CUPS-based backend. Only its original one and 
alternative is CPDB with CPDB's CUPS backend. This alternative is 
required for CUPS 3.x.


I did not actually check the GTK dialog's CUPS backend code. I only 
observed that the GTK dialog is the only one not only showing the 
permanent CUPS queues but also the IPP print destinations for which CUPS 
creates a temporary queue on demand. I did not look into how the options 
and choices are obtained.


Then it seems that they just plugged the problem "IPP destinations 
without permanent CUPS queue do not get listed" by using cupsEnumDests() 
but left all the rest untouched. This satisfies all needs for users of 
CUPS 2.x but will fail with PPD-less CUPS 3.x, requiring the use of CPDB 
for CUPS 3.x here, too.


Even better if the approach other projects take seems to be the same one 
as we're discussing for LibreOffice now. This should also provide a more 
uniform user experience (same printers + options show up regardless of 
the application/toolkit,...).


This means also that the only example known to me, which uses the 
"Dests" API of CUPS correctly is the CUPS backend of CPDB, even more 
important to driver forward that CPDB gets used everywhere.


Thanks for the hint, I'll keep that in mind.

Modern (driverless) printers seem to have a job-password IPP attribute. 
Print dialogs (and for them CPDB) should add support for that.


On old printers Printer Applications (PAPPL, pappl-retrofit) should 
support generatring a job-password IPP attribute (from typical PPD file 
options) and report it.


CUPS should pass on this attributes for print queues which support this 
kind of secured printing.


So we should post feature requests for all these components.

This would also improve the UI of print dialogs when you can type the 
PIN as a 4-digit number instead of selecting the digits with 4 dropdowns.


There's the existing [1], but I don't know whether that would still be 
the right place to report such things these days.



OK, let us keep it for now and make sure uses/packagers/admins using 
CUPS 3.x use CPDB. The CUPS/PPD interface could be automatically skipped 
at build time if there is no libcups2 present, as the CPDB part could be 
skipped if there is no cpdb-libs present. If both got built, one could 
have a choice in the settings (not in the print dialog itself, to avoid 
clutter) which one actually to use.



(...)


I think we can go this way, see above. Important is that libcups2 with 
its PPD APIs is not required to build LibreOffice with print functionality.


That sounds reasonable and shouldn't be a problem in general, but will 
of course need a closer look into the code to see whether CUPS-related 
code is already fairly local or currently spread all over the place 
right now, requiring some more refactoring or reconsideration.


We already have various `--enable-`/`--disable-` 
configure flags (some with autodetection if not passed explicitly) for 
various features. Adding additional ones for those cases should be fine 
and fairly straightforward.


(Details on how to configure things at build and run time can also be 
discussed later.)



Michael


[1] https://bugs.linuxfoundation.org/show_bug.cgi?id=1393


OpenPGP_signature.asc
Description: OpenPGP digital signature


core.git: solenv/clang-format vcl/inc vcl/unx

2024-03-27 Thread Michael Weghorn (via logerrit)
 solenv/clang-format/excludelist|2 
 vcl/inc/unx/cpdmgr.hxx |   59 +--
 vcl/unx/generic/printer/cpdmgr.cxx |  574 ++---
 3 files changed, 317 insertions(+), 318 deletions(-)

New commits:
commit 88f051257ebec4341864027f3af02e0f44df2367
Author: Michael Weghorn 
AuthorDate: Wed Mar 27 09:17:29 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Mar 27 15:12:57 2024 +0100

clang-format CPDManager sources

These will likely be significantly changed in the process
of updating the code to support current CPDB
(Common Print Dialog Backends) versions, see [1].

[1] 
https://lists.freedesktop.org/archives/libreoffice/2024-March/091748.html

Change-Id: I2d8fe1cfedb703e4843ade261e5c09e24dfe30b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165366
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index a4f7c15fa4b9..53e7e4252996 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -14219,7 +14219,6 @@ vcl/inc/textlineinfo.hxx
 vcl/inc/textrender.hxx
 vcl/inc/toolbox.h
 vcl/inc/unx/cairotextrender.hxx
-vcl/inc/unx/cpdmgr.hxx
 vcl/inc/unx/cupsmgr.hxx
 vcl/inc/unx/fc_fontoptions.hxx
 vcl/inc/unx/fontmanager.hxx
@@ -14874,7 +14873,6 @@ vcl/unx/generic/print/prtsetup.cxx
 vcl/unx/generic/print/psputil.cxx
 vcl/unx/generic/print/psputil.hxx
 vcl/unx/generic/print/text_gfx.cxx
-vcl/unx/generic/printer/cpdmgr.cxx
 vcl/unx/generic/printer/cupsmgr.cxx
 vcl/unx/generic/printer/jobdata.cxx
 vcl/unx/generic/printer/ppdparser.cxx
diff --git a/vcl/inc/unx/cpdmgr.hxx b/vcl/inc/unx/cpdmgr.hxx
index 2806f1d09b53..76a46b261c15 100644
--- a/vcl/inc/unx/cpdmgr.hxx
+++ b/vcl/inc/unx/cpdmgr.hxx
@@ -38,7 +38,6 @@ typedef struct _GDBusConnection GDBusConnection;
 
 namespace psp
 {
-
 class PPDParser;
 
 struct CPDPrinter
@@ -57,13 +56,13 @@ struct CPDPrinter
 class CPDManager final : public PrinterInfoManager
 {
 #if ENABLE_DBUS && ENABLE_GIO
-GDBusConnection * m_pConnection = nullptr;
+GDBusConnection* m_pConnection = nullptr;
 bool m_aPrintersChanged = true;
 std::vector> m_tBackends;
-std::unordered_map< std::string, GDBusProxy * > m_pBackends;
-std::unordered_map< FILE*, OString, FPtrHash > m_aSpoolFiles;
-std::unordered_map< OUString, CPDPrinter * > m_aCPDDestMap;
-std::unordered_map< OUString, PPDContext > m_aDefaultContexts;
+std::unordered_map m_pBackends;
+std::unordered_map m_aSpoolFiles;
+std::unordered_map m_aCPDDestMap;
+std::unordered_map m_aDefaultContexts;
 #endif
 CPDManager();
 // Function called when CPDManager is destroyed
@@ -72,49 +71,45 @@ class CPDManager final : public PrinterInfoManager
 virtual void initialize() override;
 
 #if ENABLE_DBUS && ENABLE_GIO
-static void onNameAcquired(GDBusConnection *connection, const gchar* name, 
gpointer user_data);
-static void onNameLost (GDBusConnection *, const gchar *name, gpointer);
-static void printerAdded (GDBusConnection *connection,
-  const gchar *sender_name,
-  const gchar *object_path,
-  const gchar *interface_name,
-  const gchar *signal_name,
-  GVariant*parameters,
-  gpointeruser_data);
-static void printerRemoved (GDBusConnection *connection,
-const gchar *sender_name,
-const gchar *object_path,
-const gchar *interface_name,
-const gchar *signal_name,
-GVariant*parameters,
-gpointeruser_data);
-
-static void getOptionsFromDocumentSetup( const JobData& rJob, bool 
bBanner, const OString& rJobName, int& rNumOptions, GVariant **arr );
+static void onNameAcquired(GDBusConnection* connection, const gchar* name, 
gpointer user_data);
+static void onNameLost(GDBusConnection*, const gchar* name, gpointer);
+static void printerAdded(GDBusConnection* connection, const gchar* 
sender_name,
+ const gchar* object_path, const gchar* 
interface_name,
+ const gchar* signal_name, GVariant* parameters, 
gpointer user_data);
+static void printerRemoved(GDBusConnection* connection, const gchar* 
sender_name,
+   const gchar* object_path, const gchar* 
interface_name,
+   const gchar* signal_name, GVariant* parameters, 
gpointer user_data);
+
+static void getOptionsFromDocumentSetup(const JobData& rJob, bool bBanner,
+   

Re: Adding support for the Common Print Dialog Backends (CPDB)

2024-03-27 Thread Michael Weghorn

On 2024-03-27 11:27, Till Kamppeter wrote:
Michael, Biswadeep will take care of the CPDB interface, but the 
CUPS/PPD interface also needs attention, as if it is not done correctly, 
it will cease to work if CUPS 3.x is used (also if the CUPS Snap or any 
other containerized form of CUPS is used).


For CUPS 3.x support, my initial thought was that requiring the 
CPDB-based implementation for that could be a way forward, while leaving 
LO's internal CUPS/PPD implementation basically unchanged and around for 
compatibility reasons (for CUPS 2.x setups only) as long as necessary.


The CPDB implementation would then be optional for CUPS 2.x, but 
required for CUPS 3.x.


If the CPDB approach will cover everything that the current CUPS/PPD 
implementation does (does it?), that could avoid the need to spend extra 
effort on LibreOffice's CUPS/PPD implementation.


So the CUPS interface (I intentionally do not call it CUPS/PPD 
interface) following has to be assured:


1. The correct CUPS APIs have to be used (cupsEnumDests(), ...), to list 
both classic, permanent CUPS queues with PPD file and IPP print 
destinations for which CUPS creates a queue on-demand. The GTK print 
dialog (GTK version 4.x) uses these APIs, to have an example.


2. Also for obtaining the options only these new "Dests" APIs of CUPS 
have to be used, no old PPD-downloading APIs, and especially no direct 
access to PPD files. The "Dests" APIs for options automatically take 
care what the best is for obtaining the options (including providing all 
PPD options if the queue is a classic CUPS queue), and they continue to 
be available in libcups3. Take the GTK (4.x) print dialog as example for 
use of these APIs.


3. Generally take care to use only libcups API functions which are also 
available in libcups3. Also make the code build with both libcups2 and 
libcups3 (see the projects libcupsfilters (2.x) and libpappl (1.4.x 
branch) as example repos which can be compiled with the user's choice of 
libcups2 or libcups3.


Thanks for explaining what would be needed.

From a first glance at the GTK 4.x code, I'm a bit surprised by it 
being referenced as an example of how to implement things properly.


While I see it has a CPDB implementation (initially added in [1]), its 
own CUPS print backend implementation (e.g. in [2] and [3]) seems to be 
full of uses of deprecated API, including direct use of PPDs.

[2] even has this comment at the top:

/* Cups 1.6 deprecates ppdFindAttr(), ppdFindCustomOption(),
 * ppdFirstCustomParam(), and ppdNextCustomParam() among others.
 * The replacement is to use the Job Ticket API, but that requires
 * a larger refactoring of this backend.
 */

Is there another CUPS-based implementation (besides the CPDB-based 
backend) or am I missing anything else here?



The "Dests" APIs for options automatically take care what the best is
for obtaining the options (including providing all PPD options if the queue is
a classic CUPS queue), (...)


Does that include cases like [4]? And if so, what would be the 
requirements for that to work (as it didn't work in the past)?


In general, my opinion is that for LibreOffice's existing CUPS/PPD 
implementation, we should be very careful not to risk to break existing 
(legacy) setups.


To me, the potential approach outlined above (envision to fully move to 
CPDB-approach in the longer run, leave existing CUPS/PPD implementation 
basically unchanged and around as long as needed so things work "as they 
always did" for legacy setups) seemed to match well with that idea, but 
I'm certainly not as knowledgeable about how this all works as you are, 
so would appreciate to hear your (and anyone else's) opinion on that.



You are now officially registered as mentor and you can see the 
submitted proposals now. Please mark at Biswadeep's proposal that you 
are interested in mentoring. Also have a look into Biswadeep's proposal 
itself.


Thanks, I've done that right after registering. The proposal looks good 
to me.


You will do the LibreOffice side of the mentoring, Gaurav Guleria and me 
will do the CPDB side.


That sounds great, thank you!


[1] 
https://gitlab.gnome.org/GNOME/gtk/-/commit/41b60bbd6ceb36dfc22e625d2b3c65bd45f15c76
[2] 
https://gitlab.gnome.org/GNOME/gtk/-/blob/b1eed1c153f7553c353dc77ae2b0154bdcedc8a0/modules/printbackends/gtkprintbackendcups.c
[3] 
https://gitlab.gnome.org/GNOME/gtk/-/blob/b1eed1c153f7553c353dc77ae2b0154bdcedc8a0/modules/printbackends/gtkprintercups.c

[4] https://github.com/apple/cups/issues/4969


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Adding support for the Common Print Dialog Backends (CPDB)

2024-03-27 Thread Michael Weghorn

On 2024-03-26 18:26, Till Kamppeter wrote:
This is no problem to keep it optional, so that the packager/admin/user 
can choose, at least at build time, perhaps even at run time.


Great.

But note that PPD files and classic CUPS drivers are deprecated. CUPS 
3.x, getting completeky released near the end of this year will not 
support PPD files and addable driver filters any more, but exclusively 
support driverless IPP printers. For legacy (non-driverless) we have 
introduced the concept of Printer Applications, software emulations of 
driverless IPP printers.


This requires changes on the print dialog:

- List IPP print destinations, independent whether there is a CUPS queue 
for them or not (if not, CUPS would create a temporary queue)
- Obtain printer capabilities and options via IPP, do not try to 
download the PPD file via CUPS or even try to directly access it in the 
file system.


This can be principally obtained by using the current CUPS APIs (the 
"Dest" ones, already available in libcups2 for several years). Also all 
PPD-related APIs will go away in libcups3.


The CPDB backend for CUPS is already completely updated to the new CUPS 
3.x realm and can actually be built with libcups3. This means with a 
CPDB-supporting print dialog we can smoothly transition from CUPS 2.x to 
CUPS 3.x without loss of functionality and without loss of access to any 
of the available print destinations.


Also the CPDB backend for CUPS is maintained by OpenPrinting, the 
maintainer of CUPS and is updated along with any future change on CUPS. 
So CPDB-supporting print dialogs will keep working in case of such a 
change, so the maintainers of the print dialogs do not have to keep pace 
with that.


So the CPDB option for the LibreOffice dialog will work with CUPS 3.x 
and future versions, the CUPS/PPD option requires updating by the 
maintainers of the LibreOffice dialog.


Thanks for the detailed description. Since printing is a critical 
feature for many users and the current CUPS/PPD API implementation has 
been used successfully for quite a long time now, I wouldn't feel 
comfortable unconditionally replacing it with the CPDB-based approach at 
this point in time. (So I'm glad that isn't the goal for the GSoc project.)


Of course, switching the default to the CPDB-based implementation and 
ultimately dropping the custom CUPS/PPD API implementation are things 
that can be considered at some point in the future, once the CPDB-based 
implementation has proven to be able to cover all relevant use cases and 
all relevant distros provide the libraries and printer applications,


(I remember that the CUPS PPD API has been deprecated for a long time, 
and the IPP-based API would have provided the necessary means to make 
everything work in theory. But at least in pre-printer-application 
times, the practical problem I saw years ago was that - even then new - 
printers weren't offering all of their functionality as IPP attributes, 
so still using the deprecated API was the only way to not lose that 
functionality. IIUC, printer applications are meant to bridge that gap now.)


So I am inviting you as GSoC mentor officially. To get access to all 
resources I do an invitation to the GSoC dashboard. Please watch out for 
an e-mail from Google and follow the instructions in it. If you do not 
feel comfortable to use these facilities, please tell me and I will do 
the official part.


Thanks! I've followed those instructions, am happy to co-mentor.


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Adding support for the Common Print Dialog Backends (CPDB)

2024-03-26 Thread Michael Weghorn

Hi Biswadeep,

On 2024-03-24 14:24, Biswadeep Purkayastha wrote:
Hello, I am Biswadeep Purkayastha, a contributor to OpenPrinting. I am 
reaching out to the community with a request for assistance in 
integrating CPDB (Common Print Dialog Backends) support into the current 
LibreOffice print dialog. CPDB has evolved a lot since the last time an 
attempt was made at providing CPDB support around 6 years ago and so has 
LibreOffice. So I am willing to adapt the older 
code(https://gerrit.libreoffice.org/#/c/40565 
) to align with the current 
LibreOffice and CPDB versions(https://github.com/OpenPrinting/cpdb-libs 
).


That sounds great.

Do I understand correctly that the idea is that the new CPDB-based 
approach would remain optional (for now at least), i.e. replace the 
previous CPDB implementation and co-exist with the existing code 
directly using CUPS/PPD API, rather than making it mandatory to use the 
new approach unconditionally once it's implemented?


To accomplish this task 
effectively, I am seeking guidance and support from LibreOffice 
developers who can provide insights into the current codebase and help 
me achieve this integration. Additionally, having a mentor from the 
LibreOffice community would greatly facilitate the process, allowing for 
smoother integration and ensuring adherence to best practices. If anyone 
in the community is willing to assist or mentor me through this 
endeavor, I would greatly appreciate your support. Please feel free to 
reach out to me via email.


I'm generally willing to support/mentor this project from the 
LibreOffice side.


Our wiki has some general documentation on how to get started with 
LibreOffice development:

https://wiki.documentfoundation.org/Development

Please feel free to ask any questions you might have either on the 
regular channels (like IRC and this mailing list) or directly.


Regards,
Michael


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Error Compiling LibreOffice Core on Debian 12 - x64

2024-03-25 Thread Michael Weghorn

On 2024-03-24 00:17, Andreas Mantke wrote:

I try to compile LibreOffice core on Debian 12 -x64 but the process
ended with an error.

Here the messages in the shell at the end of the build process:

[MOD] unoxml
/builddir/core/filter/source/graphicfilter/icgm/cgmtypes.hxx:108:
warning: type ‘LineType’ violates the C++ One Definition Rule [-Wodr]
   108 | enum LineType   { LT_SOLID = 1, LT_DASH = 2, LT_DOT =
3, LT_DASHDOT = 4, LT_DASHDOTDOT = 5, // Standard
   |
/builddir/core/vcl/inc/regband.hxx:47: note: an enum with different
value name is defined in another translation unit
    47 | enum class LineType { Ascending, Descending };
   |
/builddir/core/filter/source/graphicfilter/icgm/cgmtypes.hxx:108: note:
name ‘LT_SOLID’ differs from name ‘Ascending’ defined in another
translation unit
   108 | enum LineType   { LT_SOLID = 1, LT_DASH = 2, LT_DOT =
3, LT_DASHDOT = 4, LT_DASHDOTDOT = 5, // Standard
   |
/builddir/core/vcl/inc/regband.hxx:47: note: mismatching definition
    47 | enum class LineType { Ascending, Descending };
   |
g++: fatal error: Getötet signal terminated program lto1
compilation terminated.
lto-wrapper: fatal error: /usr/bin/g++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[1]: *** [/builddir/core/Library_merged.mk:11:
/builddir/core/instdir/program/libmergedlo.so] Fehler 1
make: *** [Makefile:290: build] Fehler 2


I tried in parallel with a build on openSUSE 15.5 -x64 and the build of
LibreOffice  core was successful.

Any hints about a workaround or fix?


Renaming one of the enums could be one approach, e.g. the one defined in 
vcl/inc/regband.hxx to something like "RegionBandLineType".  (Just a 
first thought when skimming over the file, I don't otherwise know the 
involved code.)


OpenPGP_signature.asc
Description: OpenPGP digital signature


core.git: Branch 'libreoffice-24-2-2' - vcl/qt5

2024-03-22 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtInstance.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 17fe161389df04b16a4c61bf089a3ce113ea22e7
Author: Michael Weghorn 
AuthorDate: Wed Mar 13 12:27:12 2024 +0100
Commit: Christian Lohmaier 
CommitDate: Fri Mar 22 19:36:20 2024 +0100

tdf#159915 qt: Force Qt::HighDpiScaleFactorRoundingPolicy::Round

For now, force `Qt::HighDpiScaleFactorRoundingPolicy::Round`
for the HighDPI-scale factor rounding policy [1], which is the default
for Qt 5, while Qt 6 defaults to 
`Qt::HighDpiScaleFactorRoundingPolicy::PassThrough`
(see [2]), which resulted in broken rendering (e.g. "Help" -> "About"
dialog not showing the whole content) when fractional display scaling like 
150 %
is configured in the KDE Plasma display settings (in contrast to manually 
setting the
`QT_SCALE_FACTOR=1.5` env variable to apply scaling, which was working
fine).

Quoting from [3]:

> The two principal options are whether fractional scale factors should be
> rounded to an integer or not. Keeping the scale factor as-is will make
> the user interface size match the OS setting exactly, but may cause
> painting errors, for example with the Windows style.

Manually setting the env variable `QT_SCALE_FACTOR_ROUNDING_POLICY="Round"`
has the same effect (and can be used with LO versions not yet
containing this fix).

(There might be a way to adjust the way that scaling happens
to make other policies work, but for now, just hard-code to
the policy that is known to work.)

[1] https://doc.qt.io/qt-6/qt.html#HighDpiScaleFactorRoundingPolicy-enum
[2] https://doc.qt.io/qt-6/highdpi.html#environment-variable-reference
[3] 
https://doc.qt.io/qt-6/qguiapplication.html#setHighDpiScaleFactorRoundingPolicy

Change-Id: I8eb6911d4dd5faf00912b8f15a58e0bdace1995a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164768
    Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 07688e864c913e005dcae366cf10702404a73d80)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164744
Reviewed-by: Adolfo Jayme Barrientos 
(cherry picked from commit 7989a04cee3b614d493a5acbd1ff0363596efc00)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164816
Reviewed-by: Xisco Fauli 
Tested-by: Christian Lohmaier 
Reviewed-by: Christian Lohmaier 

diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index 4880c1bdec55..f87cdef9348e 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -708,6 +708,11 @@ std::unique_ptr 
QtInstance::CreateQApplication(int& nArgc, char**
 // for scaled icons in the native menus
 QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
 #endif
+// force Qt::HighDpiScaleFactorRoundingPolicy::Round, which is the Qt 5 
default
+// policy and prevents incorrect rendering with the Qt 6 default policy
+// Qt::HighDpiScaleFactorRoundingPolicy::PassThrough (tdf#159915)
+QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
+Qt::HighDpiScaleFactorRoundingPolicy::Round);
 
 FreeableCStr session_manager;
 if (getenv("SESSION_MANAGER") != nullptr)


core.git: Branch 'libreoffice-7-6-6' - vcl/qt5

2024-03-19 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtInstance.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit eaf9c8ccb68dfdfb1f509c43ed922f18fa6f5e74
Author: Michael Weghorn 
AuthorDate: Wed Mar 13 12:27:12 2024 +0100
Commit: Christian Lohmaier 
CommitDate: Tue Mar 19 17:59:35 2024 +0100

tdf#159915 qt: Force Qt::HighDpiScaleFactorRoundingPolicy::Round

For now, force `Qt::HighDpiScaleFactorRoundingPolicy::Round`
for the HighDPI-scale factor rounding policy [1], which is the default
for Qt 5, while Qt 6 defaults to 
`Qt::HighDpiScaleFactorRoundingPolicy::PassThrough`
(see [2]), which resulted in broken rendering (e.g. "Help" -> "About"
dialog not showing the whole content) when fractional display scaling like 
150 %
is configured in the KDE Plasma display settings (in contrast to manually 
setting the
`QT_SCALE_FACTOR=1.5` env variable to apply scaling, which was working
fine).

Quoting from [3]:

> The two principal options are whether fractional scale factors should be
> rounded to an integer or not. Keeping the scale factor as-is will make
> the user interface size match the OS setting exactly, but may cause
> painting errors, for example with the Windows style.

Manually setting the env variable `QT_SCALE_FACTOR_ROUNDING_POLICY="Round"`
has the same effect (and can be used with LO versions not yet
containing this fix).

(There might be a way to adjust the way that scaling happens
to make other policies work, but for now, just hard-code to
the policy that is known to work.)

[1] https://doc.qt.io/qt-6/qt.html#HighDpiScaleFactorRoundingPolicy-enum
[2] https://doc.qt.io/qt-6/highdpi.html#environment-variable-reference
[3] 
https://doc.qt.io/qt-6/qguiapplication.html#setHighDpiScaleFactorRoundingPolicy

[Note: The libreoffice-7-6 backport needs an extra Qt version check
as Qt::HighDpiScaleFactorRoundingPolicy requires Qt 5.14 while
the 7-6 baseline is lower. The master/libreoffice-24-2 baseline already
ensures Qt 5.15, see also commit afb4c96d271958ced3175dfc2cf8bb9e8b0a9d3b,
"qt: Drop code for Qt < 5.15".]

Change-Id: I8eb6911d4dd5faf00912b8f15a58e0bdace1995a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164768
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 86abb6fd8a8f680f9fc5ff1db775845c9f4e254b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164745
Reviewed-by: Adolfo Jayme Barrientos 
(cherry picked from commit a64d0da7d09cd27a332060f61a25980131e48a56)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164815
Reviewed-by: Xisco Fauli 
Tested-by: Christian Lohmaier 
Reviewed-by: Christian Lohmaier 

diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index df3df5d17a74..2675445702de 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -708,6 +708,13 @@ std::unique_ptr 
QtInstance::CreateQApplication(int& nArgc, char**
 // for scaled icons in the native menus
 QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
 #endif
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+// force Qt::HighDpiScaleFactorRoundingPolicy::Round, which is the Qt 5 
default
+// policy and prevents incorrect rendering with the Qt 6 default policy
+// Qt::HighDpiScaleFactorRoundingPolicy::PassThrough (tdf#159915)
+QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
+Qt::HighDpiScaleFactorRoundingPolicy::Round);
+#endif
 
 FreeableCStr session_manager;
 if (getenv("SESSION_MANAGER") != nullptr)


core.git: sw/JunitTest_sw_complex.mk

2024-03-15 Thread Michael Weghorn (via logerrit)
 sw/JunitTest_sw_complex.mk |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit a6bb2e837264451ed896dd6783249e335e145605
Author: Michael Weghorn 
AuthorDate: Fri Mar 15 10:52:04 2024 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 15 16:29:34 2024 +0100

sw a11y: Disable unreliable CheckIndeterminateState test for now

Running the test was enabled in

commit 97337f5395ca1f4597690c97a19da9fd55ee1c66
Date:   Thu Jan 18 18:30:09 2024 +

Fix sw_complex JUnitTest not running

, but it turns out both the current Java test as well as the
pending C++ port are unreliable, see discussions in [1] and [2].

Therefore, disable it for now. If the underlying issue
gets fixed, it can be reenabled again.

[1] https://gerrit.libreoffice.org/c/core/+/162263
[2] https://gerrit.libreoffice.org/c/core/+/164231

Change-Id: I490d012b73154203884bdd966bfcafa889ac820c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164861
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sw/JunitTest_sw_complex.mk b/sw/JunitTest_sw_complex.mk
index 45c5a29859d4..274da992ba7b 100644
--- a/sw/JunitTest_sw_complex.mk
+++ b/sw/JunitTest_sw_complex.mk
@@ -25,8 +25,11 @@ $(eval $(call gb_JunitTest_add_sourcefiles,sw_complex,\
 
 $(eval $(call gb_JunitTest_use_unoapi_jars,sw_complex))
 
-$(eval $(call gb_JunitTest_add_classes,sw_complex,\
-complex.indeterminateState.CheckIndeterminateState \
-))
+# disable running the test for now as it is unreliable, see discussions
+# in https://gerrit.libreoffice.org/c/core/+/162263
+# and https://gerrit.libreoffice.org/c/core/+/164231
+#$(eval $(call gb_JunitTest_add_classes,sw_complex,\
+#complex.indeterminateState.CheckIndeterminateState \
+#))
 
 # vim: set noet sw=4 ts=4:


core.git: vcl/unx

2024-03-15 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk4/a11y.cxx  |2 +-
 vcl/unx/gtk4/gtkaccessibletext.cxx |   22 +-
 vcl/unx/gtk4/gtkaccessibletext.hxx |2 +-
 3 files changed, 23 insertions(+), 3 deletions(-)

New commits:
commit 8a0543f9fec90b0b7538fa5f219c9dc38b07ea34
Author: Michael Weghorn 
AuthorDate: Fri Mar 15 10:19:55 2024 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 15 14:00:37 2024 +0100

gtk4 a11y: Report default text attributes

Implement handling of default text attributes
by implementing the GtkAccessibleTextInterface
method `get_default_attributes` recently added to
the GTK 4 API in GTK commit [1]

commit fe64c998f82c218e46211984485a7a824a781426
Author: Emmanuele Bassi 
Date:   Sun Mar 3 14:23:37 2024 +

a11y: Add GtkAccessibleText.get_default_attributes

With this in place, the default font family for a Writer
paragraph is now reported as expected.

With the paragraph selected in Accerciser's treeview of
the LO a11y hierarchy, this can be seen as follows using
Accerciser's IPython console:

In [4]: acc.queryText().getDefaultAttributes()
Out[4]: 'family-name:Liberation Serif'

This API is available from GTK 4.14.0 on, so bump
the version check for the GtkAccessibleText
implementation to that minimum version.

[1] 
https://gitlab.gnome.org/GNOME/gtk/-/commit/fe64c998f82c218e46211984485a7a824a781426

Change-Id: Id22bee4b7db542ddde241a4d94a7eb916090ba92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164860
Tested-by: Michael Weghorn 
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index 41e49bf2845b..bfb6e38b0038 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -411,7 +411,7 @@ const struct
 GetGIfaceType const aGetGIfaceType;
 const css::uno::Type& (*aGetUnoType)();
 } TYPE_TABLE[] = {
-#if GTK_CHECK_VERSION(4, 13, 8)
+#if GTK_CHECK_VERSION(4, 14, 0)
 { "Text", reinterpret_cast(lo_accessible_text_init),
   gtk_accessible_text_get_type, 
cppu::UnoType::get },
 #endif
diff --git a/vcl/unx/gtk4/gtkaccessibletext.cxx 
b/vcl/unx/gtk4/gtkaccessibletext.cxx
index 4d7853c054d4..51091e735327 100644
--- a/vcl/unx/gtk4/gtkaccessibletext.cxx
+++ b/vcl/unx/gtk4/gtkaccessibletext.cxx
@@ -19,7 +19,7 @@
 #include "a11y.hxx"
 #include "gtkaccessibletext.hxx"
 
-#if GTK_CHECK_VERSION(4, 13, 8)
+#if GTK_CHECK_VERSION(4, 14, 0)
 
 namespace
 {
@@ -202,6 +202,25 @@ static gboolean 
lo_accessible_text_get_attributes(GtkAccessibleText* self, unsig
 return true;
 }
 
+static void lo_accessible_text_get_default_attributes(GtkAccessibleText* self,
+  char*** attribute_names,
+  char*** attribute_values)
+{
+css::uno::Reference xText = 
getXText(self);
+if (!xText.is())
+return;
+
+css::uno::Reference 
xAttributes(
+xText, com::sun::star::uno::UNO_QUERY);
+if (!xAttributes.is())
+return;
+
+css::uno::Sequence aAttribs
+= xAttributes->getDefaultAttributes(css::uno::Sequence());
+
+convertUnoTextAttributesToGtk(aAttribs, attribute_names, attribute_values);
+}
+
 void lo_accessible_text_init(GtkAccessibleTextInterface* iface)
 {
 iface->get_contents = lo_accessible_text_get_contents;
@@ -209,6 +228,7 @@ void lo_accessible_text_init(GtkAccessibleTextInterface* 
iface)
 iface->get_caret_position = lo_accessible_text_get_caret_position;
 iface->get_selection = lo_accessible_text_get_selection;
 iface->get_attributes = lo_accessible_text_get_attributes;
+iface->get_default_attributes = lo_accessible_text_get_default_attributes;
 }
 
 #endif
diff --git a/vcl/unx/gtk4/gtkaccessibletext.hxx 
b/vcl/unx/gtk4/gtkaccessibletext.hxx
index 3e8a08db0d73..82acc7db418f 100644
--- a/vcl/unx/gtk4/gtkaccessibletext.hxx
+++ b/vcl/unx/gtk4/gtkaccessibletext.hxx
@@ -11,7 +11,7 @@
 
 #include 
 
-#if GTK_CHECK_VERSION(4, 13, 8)
+#if GTK_CHECK_VERSION(4, 14, 0)
 
 void lo_accessible_text_init(GtkAccessibleTextInterface* iface);
 


core.git: 2 commits - vcl/unx

2024-03-15 Thread Michael Weghorn (via logerrit)
 vcl/unx/gtk4/gtkaccessibletext.cxx |   85 +
 1 file changed, 78 insertions(+), 7 deletions(-)

New commits:
commit 5a4c3575945876f90dc2f6d67211107ed3b1de4f
Author: Michael Weghorn 
AuthorDate: Fri Mar 15 10:06:49 2024 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 15 13:59:44 2024 +0100

gtk4 a11y: Extract helper function for text attr conversion

Extract conversion of LO's text attr representation to the
one that the GTK implementation in
`lo_accessible_text_get_attributes` needs to return to
a new helper function `convertUnoTextAttributesToGtk` that
will be reused in an upcoming commit to implement handling
of default text attributes for which API has recently been
added to GTK.

Change-Id: I01a703012c668149a29c3ce759437a1b716988dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164859
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/unx/gtk4/gtkaccessibletext.cxx 
b/vcl/unx/gtk4/gtkaccessibletext.cxx
index ffe4108a1e6f..4d7853c054d4 100644
--- a/vcl/unx/gtk4/gtkaccessibletext.cxx
+++ b/vcl/unx/gtk4/gtkaccessibletext.cxx
@@ -125,6 +125,38 @@ static gboolean 
lo_accessible_text_get_selection(GtkAccessibleText* self, gsize*
 return true;
 }
 
+static int
+convertUnoTextAttributesToGtk(const 
css::uno::Sequence& rAttribs,
+  char*** attribute_names, char*** 
attribute_values)
+{
+std::vector> aNameValuePairs;
+for (const css::beans::PropertyValue& rAttribute : rAttribs)
+{
+if (rAttribute.Name == "CharFontName")
+{
+const OUString sValue = 
*o3tl::doAccess(rAttribute.Value);
+aNameValuePairs.emplace_back(GTK_ACCESSIBLE_ATTRIBUTE_FAMILY, 
sValue);
+}
+}
+
+if (aNameValuePairs.empty())
+return 0;
+
+const int nCount = aNameValuePairs.size();
+*attribute_names = g_new(char*, nCount + 1);
+*attribute_values = g_new(char*, nCount + 1);
+for (int i = 0; i < nCount; i++)
+{
+(*attribute_names)[i] = g_strdup(aNameValuePairs[i].first.getStr());
+(*attribute_values)[i] = g_strdup(
+OUStringToOString(aNameValuePairs[i].second, 
RTL_TEXTENCODING_UTF8).getStr());
+}
+(*attribute_names)[nCount] = nullptr;
+(*attribute_values)[nCount] = nullptr;
+
+return nCount;
+}
+
 static gboolean lo_accessible_text_get_attributes(GtkAccessibleText* self, 
unsigned int offset,
   gsize* n_ranges, 
GtkAccessibleTextRange** ranges,
   char*** attribute_names, 
char*** attribute_values)
@@ -152,40 +184,20 @@ static gboolean 
lo_accessible_text_get_attributes(GtkAccessibleText* self, unsig
 else
 aAttribs = xText->getCharacterAttributes(offset, 
css::uno::Sequence());
 
-std::vector> aNameValuePairs;
-for (const css::beans::PropertyValue& rAttribute : aAttribs)
-{
-if (rAttribute.Name == "CharFontName")
-{
-const OUString sValue = 
*o3tl::doAccess(rAttribute.Value);
-aNameValuePairs.emplace_back(GTK_ACCESSIBLE_ATTRIBUTE_FAMILY, 
sValue);
-}
-}
-
-if (aNameValuePairs.empty())
+const int nCount = convertUnoTextAttributesToGtk(aAttribs, 
attribute_names, attribute_values);
+if (nCount == 0)
 return false;
 
-const css::accessibility::TextSegment aAttributeRun
-= xText->getTextAtIndex(offset, 
css::accessibility::AccessibleTextType::ATTRIBUTE_RUN);
-
-const int nCount = aNameValuePairs.size();
 *n_ranges = nCount;
 *ranges = g_new(GtkAccessibleTextRange, nCount);
-*attribute_names = g_new(char*, nCount + 1);
-*attribute_values = g_new(char*, nCount + 1);
-
+// just use start and end of attribute run for each single attribute
+const css::accessibility::TextSegment aAttributeRun
+= xText->getTextAtIndex(offset, 
css::accessibility::AccessibleTextType::ATTRIBUTE_RUN);
 for (int i = 0; i < nCount; i++)
 {
-// just use start and end of attribute run for each single attribute
 ((*ranges)[i]).start = aAttributeRun.SegmentStart;
 ((*ranges)[i]).length = aAttributeRun.SegmentEnd - 
aAttributeRun.SegmentStart;
-
-(*attribute_names)[i] = g_strdup(aNameValuePairs[i].first.getStr());
-(*attribute_values)[i] = g_strdup(
-OUStringToOString(aNameValuePairs[i].second, 
RTL_TEXTENCODING_UTF8).getStr());
 }
-(*attribute_names)[nCount] = nullptr;
-(*attribute_values)[nCount] = nullptr;
 
 return true;
 }
commit ae00b39c43b7c767d7f0eea78eb104b983799265
Author: Michael Weghorn 
AuthorDate: Fri Mar 15 09:40:31 2024 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 15 13:59:36 2024 +0100

gtk4 a11y: Add initial text attribute handling

Implement initial handling for reporting text

core.git: Branch 'libreoffice-7-6-6' - vcl/inc vcl/source vcl/unx

2024-03-15 Thread Michael Weghorn (via logerrit)
 vcl/inc/unx/desktops.hxx  |1 +
 vcl/source/app/IconThemeSelector.cxx  |1 +
 vcl/source/app/salplug.cxx|4 ++--
 vcl/unx/generic/desktopdetect/desktopdetector.cxx |   11 +++
 vcl/unx/kf5/KF5SalInstance.cxx|8 +---
 5 files changed, 20 insertions(+), 5 deletions(-)

New commits:
commit 626a2cd3b644a7c841cee7a6ad43dc7a6956369d
Author: Michael Weghorn 
AuthorDate: Thu Jun 22 08:40:56 2023 +0200
Commit: Michael Stahl 
CommitDate: Fri Mar 15 10:59:09 2024 +0100

Detect Plasma 6 desktop

Add detection for Plasma 6, which is currently in development stage.
With the following plasma-workspace commit [1] in place,
KDE_SESSION_VERSION is set to 6, so use that to detect it:

commit 4c2242d7dfafac161baec3ec316af24d7b48ef8b
Author: Michael Weghorn 
Date:   Thu Jun 22 07:47:31 2023 +0200

Set KDE_SESSION_VERSION to 6

Since the master branch is based on Qt6/KF6 and will
become Plasma 6, set KDE_SESSION_VERSION to "6".

This will allow other applications to detect they're
running in a (preview of a) Plasma 6 session and react
accordingly.
(E.g. LibreOffice can use this to choose to
use its upcoming kf6 integration by default instead of the
kf5 one.)

[1] 
https://invent.kde.org/plasma/plasma-workspace/-/commit/4c2242d7dfafac161baec3ec316af24d7b48ef8b

Change-Id: I5a15ad1fb177721fbfa016139c56a08b228f2e1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153437
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 8b0e1f2a914d672182d585d8cb2d4a815e88977e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164700
Reviewed-by: Adolfo Jayme Barrientos 
(cherry picked from commit 4c836645eb0556a496c80e4604b63b47085020dd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164739
Reviewed-by: Xisco Fauli 
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/vcl/inc/unx/desktops.hxx b/vcl/inc/unx/desktops.hxx
index 0abb6aa71339..2056c2c37928 100644
--- a/vcl/inc/unx/desktops.hxx
+++ b/vcl/inc/unx/desktops.hxx
@@ -33,6 +33,7 @@ enum SAL_DLLPUBLIC_RTTI DesktopType
 DESKTOP_XFCE,
 DESKTOP_MATE,
 DESKTOP_PLASMA5,
+DESKTOP_PLASMA6,
 DESKTOP_LXQT
 }; // keep in sync with desktop_strings[] in salplug.cxx
 
diff --git a/vcl/source/app/IconThemeSelector.cxx 
b/vcl/source/app/IconThemeSelector.cxx
index 6b8dfc0f42c7..15eb4b7768fc 100644
--- a/vcl/source/app/IconThemeSelector.cxx
+++ b/vcl/source/app/IconThemeSelector.cxx
@@ -70,6 +70,7 @@ IconThemeSelector::GetIconThemeForDesktopEnvironment(const 
OUString& desktopEnvi
 #else
 OUString r;
 if ( desktopEnvironment.equalsIgnoreAsciiCase("plasma5") ||
+ desktopEnvironment.equalsIgnoreAsciiCase("plasma6") ||
  desktopEnvironment.equalsIgnoreAsciiCase("lxqt") ) {
 if (!bPreferDarkIconTheme)
 r = "breeze";
diff --git a/vcl/source/app/salplug.cxx b/vcl/source/app/salplug.cxx
index e51375b94ae5..fee5b7e33e6d 100644
--- a/vcl/source/app/salplug.cxx
+++ b/vcl/source/app/salplug.cxx
@@ -249,7 +249,7 @@ const char* const* autodetect_plugin_list()
   desktop == DESKTOP_XFCE  ||
   desktop == DESKTOP_MATE )
 pList = pStandardFallbackList;
-else if (desktop == DESKTOP_PLASMA5 || desktop == DESKTOP_LXQT)
+else if (desktop == DESKTOP_PLASMA5 || desktop == DESKTOP_PLASMA6 || 
desktop == DESKTOP_LXQT)
 pList = pKDEFallbackList;
 
 return pList;
@@ -426,7 +426,7 @@ const OUString& SalGetDesktopEnvironment()
 // Order to match desktops.hxx' DesktopType
 static const char * const desktop_strings[] = {
 "none", "unknown", "GNOME", "UNITY",
-"XFCE", "MATE", "PLASMA5", "LXQT" };
+"XFCE", "MATE", "PLASMA5", "PLASMA6", "LXQT" };
 static OUString aDesktopEnvironment;
 if( aDesktopEnvironment.isEmpty())
 {
diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx 
b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
index bad134fbdafd..8baeb303feed 100644
--- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx
+++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
@@ -117,6 +117,13 @@ static bool is_plasma5_desktop()
 return pFullVersion && pSessionVersion && (0 == strcmp(pSessionVersion, 
"5"));
 }
 
+static bool is_plasma6_desktop()
+{
+static const char* pFullVersion = getenv("KDE_FULL_SESSION");
+static const char* pSessionVersion = getenv("KDE_SESSION_VERSION");
+return pFullVersion && pSe

core.git: include/vcl

2024-03-15 Thread Michael Weghorn (via logerrit)
 include/vcl/BitmapTools.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7454d3adf09cbc841e3681f9e32be57bdfb518c7
Author: Michael Weghorn 
AuthorDate: Fri Mar 15 07:46:15 2024 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 15 10:03:35 2024 +0100

Make vcl::bitmap::get_unpremultiply_table VCL_DLLPUBLIC again

This fixes my GCC 13.2.0 --enable-gtk4 build on Debian
testing, which started failing after

commit acd40306b3737d50cf24462b2d3e451092543e64
Date:   Thu Mar 14 12:22:13 2024 +0200

reduce symbol visibility in vcl

like this:


/home/michi/development/git/libreoffice-WORKTREE/vcl/unx/gtk4/../gtk3/salnativewidgets-gtk.cxx:2195:
 error: undefined reference to 'vcl::bitmap::get_unpremultiply_table()'
collect2: error: ld returned 1 exit status
make[1]: *** 
[/home/michi/development/git/libreoffice-WORKTREE/vcl/Library_vclplug_gtk4.mk:20:
 
/home/michi/development/git/libreoffice-WORKTREE/instdir/program/libvclplug_gtk4lo.so]
 Error 1
make[1]: *** Waiting for unfinished jobs
make: *** [Makefile:290: build] Error 2

Change-Id: I0921801f6ad0f20f5250ca15a2749d7da044fcd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164856
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/vcl/BitmapTools.hxx b/include/vcl/BitmapTools.hxx
index 0fa68905b139..d321d2be79a3 100644
--- a/include/vcl/BitmapTools.hxx
+++ b/include/vcl/BitmapTools.hxx
@@ -32,7 +32,7 @@ namespace vcl::bitmap {
 typedef std::array, 256> lookup_table;
 
 lookup_table const & get_premultiply_table();
-lookup_table const & get_unpremultiply_table();
+VCL_DLLPUBLIC lookup_table const & get_unpremultiply_table();
 #endif
 
 sal_uInt8 unpremultiply(sal_uInt8 c, sal_uInt8 a);


core.git: Branch 'libreoffice-7-6' - vcl/qt5

2024-03-13 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtInstance.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit a64d0da7d09cd27a332060f61a25980131e48a56
Author: Michael Weghorn 
AuthorDate: Wed Mar 13 12:27:12 2024 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Mar 13 22:06:07 2024 +0100

tdf#159915 qt: Force Qt::HighDpiScaleFactorRoundingPolicy::Round

For now, force `Qt::HighDpiScaleFactorRoundingPolicy::Round`
for the HighDPI-scale factor rounding policy [1], which is the default
for Qt 5, while Qt 6 defaults to 
`Qt::HighDpiScaleFactorRoundingPolicy::PassThrough`
(see [2]), which resulted in broken rendering (e.g. "Help" -> "About"
dialog not showing the whole content) when fractional display scaling like 
150 %
is configured in the KDE Plasma display settings (in contrast to manually 
setting the
`QT_SCALE_FACTOR=1.5` env variable to apply scaling, which was working
fine).

Quoting from [3]:

> The two principal options are whether fractional scale factors should be
> rounded to an integer or not. Keeping the scale factor as-is will make
> the user interface size match the OS setting exactly, but may cause
> painting errors, for example with the Windows style.

Manually setting the env variable `QT_SCALE_FACTOR_ROUNDING_POLICY="Round"`
has the same effect (and can be used with LO versions not yet
containing this fix).

(There might be a way to adjust the way that scaling happens
to make other policies work, but for now, just hard-code to
the policy that is known to work.)

[1] https://doc.qt.io/qt-6/qt.html#HighDpiScaleFactorRoundingPolicy-enum
[2] https://doc.qt.io/qt-6/highdpi.html#environment-variable-reference
[3] 
https://doc.qt.io/qt-6/qguiapplication.html#setHighDpiScaleFactorRoundingPolicy

[Note: The libreoffice-7-6 backport needs an extra Qt version check
as Qt::HighDpiScaleFactorRoundingPolicy requires Qt 5.14 while
the 7-6 baseline is lower. The master/libreoffice-24-2 baseline already
ensures Qt 5.15, see also commit afb4c96d271958ced3175dfc2cf8bb9e8b0a9d3b,
"qt: Drop code for Qt < 5.15".]

Change-Id: I8eb6911d4dd5faf00912b8f15a58e0bdace1995a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164768
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 86abb6fd8a8f680f9fc5ff1db775845c9f4e254b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164745
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index df3df5d17a74..2675445702de 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -708,6 +708,13 @@ std::unique_ptr 
QtInstance::CreateQApplication(int& nArgc, char**
 // for scaled icons in the native menus
 QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
 #endif
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+// force Qt::HighDpiScaleFactorRoundingPolicy::Round, which is the Qt 5 
default
+// policy and prevents incorrect rendering with the Qt 6 default policy
+// Qt::HighDpiScaleFactorRoundingPolicy::PassThrough (tdf#159915)
+QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
+Qt::HighDpiScaleFactorRoundingPolicy::Round);
+#endif
 
 FreeableCStr session_manager;
 if (getenv("SESSION_MANAGER") != nullptr)


core.git: Branch 'libreoffice-24-2' - vcl/qt5

2024-03-13 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtInstance.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 7989a04cee3b614d493a5acbd1ff0363596efc00
Author: Michael Weghorn 
AuthorDate: Wed Mar 13 12:27:12 2024 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Mar 13 17:08:49 2024 +0100

tdf#159915 qt: Force Qt::HighDpiScaleFactorRoundingPolicy::Round

For now, force `Qt::HighDpiScaleFactorRoundingPolicy::Round`
for the HighDPI-scale factor rounding policy [1], which is the default
for Qt 5, while Qt 6 defaults to 
`Qt::HighDpiScaleFactorRoundingPolicy::PassThrough`
(see [2]), which resulted in broken rendering (e.g. "Help" -> "About"
dialog not showing the whole content) when fractional display scaling like 
150 %
is configured in the KDE Plasma display settings (in contrast to manually 
setting the
`QT_SCALE_FACTOR=1.5` env variable to apply scaling, which was working
fine).

Quoting from [3]:

> The two principal options are whether fractional scale factors should be
> rounded to an integer or not. Keeping the scale factor as-is will make
> the user interface size match the OS setting exactly, but may cause
> painting errors, for example with the Windows style.

Manually setting the env variable `QT_SCALE_FACTOR_ROUNDING_POLICY="Round"`
has the same effect (and can be used with LO versions not yet
containing this fix).

(There might be a way to adjust the way that scaling happens
to make other policies work, but for now, just hard-code to
the policy that is known to work.)

[1] https://doc.qt.io/qt-6/qt.html#HighDpiScaleFactorRoundingPolicy-enum
[2] https://doc.qt.io/qt-6/highdpi.html#environment-variable-reference
[3] 
https://doc.qt.io/qt-6/qguiapplication.html#setHighDpiScaleFactorRoundingPolicy

Change-Id: I8eb6911d4dd5faf00912b8f15a58e0bdace1995a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164768
    Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 07688e864c913e005dcae366cf10702404a73d80)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164744
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index 4880c1bdec55..f87cdef9348e 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -708,6 +708,11 @@ std::unique_ptr 
QtInstance::CreateQApplication(int& nArgc, char**
 // for scaled icons in the native menus
 QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
 #endif
+// force Qt::HighDpiScaleFactorRoundingPolicy::Round, which is the Qt 5 
default
+// policy and prevents incorrect rendering with the Qt 6 default policy
+// Qt::HighDpiScaleFactorRoundingPolicy::PassThrough (tdf#159915)
+QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
+Qt::HighDpiScaleFactorRoundingPolicy::Round);
 
 FreeableCStr session_manager;
 if (getenv("SESSION_MANAGER") != nullptr)


core.git: 2 commits - sc/source vcl/qt5

2024-03-13 Thread Michael Weghorn (via logerrit)
 sc/source/filter/oox/workbookhelper.cxx |4 +
 sc/source/filter/xml/xmlimprt.cxx   |   73 
 sc/source/filter/xml/xmlimprt.hxx   |1 
 sc/source/ui/docshell/docsh.cxx |   56 
 sc/source/ui/inc/docsh.hxx  |2 
 vcl/qt5/QtInstance.cxx  |5 ++
 6 files changed, 68 insertions(+), 73 deletions(-)

New commits:
commit 86abb6fd8a8f680f9fc5ff1db775845c9f4e254b
Author: Michael Weghorn 
AuthorDate: Wed Mar 13 12:27:12 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Mar 13 14:31:35 2024 +0100

tdf#159915 qt: Force Qt::HighDpiScaleFactorRoundingPolicy::Round

For now, force `Qt::HighDpiScaleFactorRoundingPolicy::Round`
for the HighDPI-scale factor rounding policy [1], which is the default
for Qt 5, while Qt 6 defaults to 
`Qt::HighDpiScaleFactorRoundingPolicy::PassThrough`
(see [2]), which resulted in broken rendering (e.g. "Help" -> "About"
dialog not showing the whole content) when fractional display scaling like 
150 %
is configured in the KDE Plasma display settings (in contrast to manually 
setting the
`QT_SCALE_FACTOR=1.5` env variable to apply scaling, which was working
fine).

Quoting from [3]:

> The two principal options are whether fractional scale factors should be
> rounded to an integer or not. Keeping the scale factor as-is will make
> the user interface size match the OS setting exactly, but may cause
> painting errors, for example with the Windows style.

Manually setting the env variable `QT_SCALE_FACTOR_ROUNDING_POLICY="Round"`
has the same effect (and can be used with LO versions not yet
containing this fix).

(There might be a way to adjust the way that scaling happens
to make other policies work, but for now, just hard-code to
the policy that is known to work.)

[1] https://doc.qt.io/qt-6/qt.html#HighDpiScaleFactorRoundingPolicy-enum
[2] https://doc.qt.io/qt-6/highdpi.html#environment-variable-reference
[3] 
https://doc.qt.io/qt-6/qguiapplication.html#setHighDpiScaleFactorRoundingPolicy

Change-Id: I8eb6911d4dd5faf00912b8f15a58e0bdace1995a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164768
    Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index 6b3bd0cc301a..2801601115ec 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -740,6 +740,11 @@ std::unique_ptr 
QtInstance::CreateQApplication(int& nArgc, char**
 // for scaled icons in the native menus
 QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
 #endif
+// force Qt::HighDpiScaleFactorRoundingPolicy::Round, which is the Qt 5 
default
+// policy and prevents incorrect rendering with the Qt 6 default policy
+// Qt::HighDpiScaleFactorRoundingPolicy::PassThrough (tdf#159915)
+QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
+Qt::HighDpiScaleFactorRoundingPolicy::Round);
 
 FreeableCStr session_manager;
 if (getenv("SESSION_MANAGER") != nullptr)
commit 09d20ef6bd90d33a71b581d22d1312c5d26eb32b
Author: Justin Luth 
AuthorDate: Tue Mar 12 13:16:52 2024 -0400
Commit: Justin Luth 
CommitDate: Wed Mar 13 14:31:22 2024 +0100

tdf#123026: also use global config "RecalcOptimalRowHeightMode" for xlsx

24.8 commit 2d2974f22ab59ea7dab1aee778308c4f50ff5464 for tdf#124098
added a setting that prompts before recalculating optimal row height
on file open.  I can't think of any reason why that shouldn't apply
to all formats. It defaults to "always - without asking".

XLSX started optimal row height on file open for tdf#123026
with 24.2 commit d15c4caabaa21e0efe3a08ffbe145390e802bab9.

So this patch just moves the code to a more accessible location,
and then uses it for the XLSX case too.

Change-Id: Ia0c672c3aec788857dea09ac88e4395dcf6c2242
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164721
Tested-by: Jenkins
Reviewed-by: Balazs Varga 
Reviewed-by: Justin Luth 

diff --git a/sc/source/filter/oox/workbookhelper.cxx 
b/sc/source/filter/oox/workbookhelper.cxx
index 2361122e0bfe..270e5aca1dc6 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -639,7 +639,9 @@ void WorkbookGlobals::finalize()
 mpDoc->EnableExecuteLink(true);
 // #i79826# enable updating automatic row height after loading the document
 mpDoc->UnlockAdjustHeight();
-mpDocShell->UpdateAllRowHeights(/*bOnlyUsedRows=*/true);
+// check settings (potentially asking the user if optimal row height 
should be run now)
+if (mpDocShell->GetRecalcRowHeightsMode()) // default is to always update
+mpDocShell->UpdateAllRowHeights(/*bOnlyUsedRows=*/true);
 
 // #i7602

core.git: Branch 'libreoffice-7-6' - vcl/inc vcl/source vcl/unx

2024-03-12 Thread Michael Weghorn (via logerrit)
 vcl/inc/unx/desktops.hxx  |1 +
 vcl/source/app/IconThemeSelector.cxx  |1 +
 vcl/source/app/salplug.cxx|4 ++--
 vcl/unx/generic/desktopdetect/desktopdetector.cxx |   11 +++
 vcl/unx/kf5/KF5SalInstance.cxx|8 +---
 5 files changed, 20 insertions(+), 5 deletions(-)

New commits:
commit 4c836645eb0556a496c80e4604b63b47085020dd
Author: Michael Weghorn 
AuthorDate: Thu Jun 22 08:40:56 2023 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Mar 12 11:31:36 2024 +0100

Detect Plasma 6 desktop

Add detection for Plasma 6, which is currently in development stage.
With the following plasma-workspace commit [1] in place,
KDE_SESSION_VERSION is set to 6, so use that to detect it:

commit 4c2242d7dfafac161baec3ec316af24d7b48ef8b
Author: Michael Weghorn 
Date:   Thu Jun 22 07:47:31 2023 +0200

Set KDE_SESSION_VERSION to 6

Since the master branch is based on Qt6/KF6 and will
become Plasma 6, set KDE_SESSION_VERSION to "6".

This will allow other applications to detect they're
running in a (preview of a) Plasma 6 session and react
accordingly.
(E.g. LibreOffice can use this to choose to
use its upcoming kf6 integration by default instead of the
kf5 one.)

[1] 
https://invent.kde.org/plasma/plasma-workspace/-/commit/4c2242d7dfafac161baec3ec316af24d7b48ef8b

Change-Id: I5a15ad1fb177721fbfa016139c56a08b228f2e1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153437
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 8b0e1f2a914d672182d585d8cb2d4a815e88977e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164700
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/inc/unx/desktops.hxx b/vcl/inc/unx/desktops.hxx
index 0abb6aa71339..2056c2c37928 100644
--- a/vcl/inc/unx/desktops.hxx
+++ b/vcl/inc/unx/desktops.hxx
@@ -33,6 +33,7 @@ enum SAL_DLLPUBLIC_RTTI DesktopType
 DESKTOP_XFCE,
 DESKTOP_MATE,
 DESKTOP_PLASMA5,
+DESKTOP_PLASMA6,
 DESKTOP_LXQT
 }; // keep in sync with desktop_strings[] in salplug.cxx
 
diff --git a/vcl/source/app/IconThemeSelector.cxx 
b/vcl/source/app/IconThemeSelector.cxx
index 6b8dfc0f42c7..15eb4b7768fc 100644
--- a/vcl/source/app/IconThemeSelector.cxx
+++ b/vcl/source/app/IconThemeSelector.cxx
@@ -70,6 +70,7 @@ IconThemeSelector::GetIconThemeForDesktopEnvironment(const 
OUString& desktopEnvi
 #else
 OUString r;
 if ( desktopEnvironment.equalsIgnoreAsciiCase("plasma5") ||
+ desktopEnvironment.equalsIgnoreAsciiCase("plasma6") ||
  desktopEnvironment.equalsIgnoreAsciiCase("lxqt") ) {
 if (!bPreferDarkIconTheme)
 r = "breeze";
diff --git a/vcl/source/app/salplug.cxx b/vcl/source/app/salplug.cxx
index e51375b94ae5..fee5b7e33e6d 100644
--- a/vcl/source/app/salplug.cxx
+++ b/vcl/source/app/salplug.cxx
@@ -249,7 +249,7 @@ const char* const* autodetect_plugin_list()
   desktop == DESKTOP_XFCE  ||
   desktop == DESKTOP_MATE )
 pList = pStandardFallbackList;
-else if (desktop == DESKTOP_PLASMA5 || desktop == DESKTOP_LXQT)
+else if (desktop == DESKTOP_PLASMA5 || desktop == DESKTOP_PLASMA6 || 
desktop == DESKTOP_LXQT)
 pList = pKDEFallbackList;
 
 return pList;
@@ -426,7 +426,7 @@ const OUString& SalGetDesktopEnvironment()
 // Order to match desktops.hxx' DesktopType
 static const char * const desktop_strings[] = {
 "none", "unknown", "GNOME", "UNITY",
-"XFCE", "MATE", "PLASMA5", "LXQT" };
+"XFCE", "MATE", "PLASMA5", "PLASMA6", "LXQT" };
 static OUString aDesktopEnvironment;
 if( aDesktopEnvironment.isEmpty())
 {
diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx 
b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
index bad134fbdafd..8baeb303feed 100644
--- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx
+++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
@@ -117,6 +117,13 @@ static bool is_plasma5_desktop()
 return pFullVersion && pSessionVersion && (0 == strcmp(pSessionVersion, 
"5"));
 }
 
+static bool is_plasma6_desktop()
+{
+static const char* pFullVersion = getenv("KDE_FULL_SESSION");
+static const char* pSessionVersion = getenv("KDE_SESSION_VERSION");
+return pFullVersion && pSessionVersion && (0 == strcmp(pSessionVersion, 
"6"));
+}
+
 extern "C"
 {
 
@@ -132,6 +139,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType 
get_desktop_environment()
 return DESKTOP_LXQT;
 if (aOver.equalsI

Re: VCL selection

2024-03-07 Thread Michael Weghorn

On 2024-03-07 09:33, Caolán McNamara wrote:

On Wed, 2024-03-06 at 21:58 +, Gwyn Ciesla wrote:

Interesting. Would you recommend waiting to set gtk4 as default, or
would doing so spur correction of extant issues?


I don't really know. I'm not actively working on it anymore. IMO the
a11y issues are more of an upstream gtk issue in the sense of a lack of
a route to complete a11y integration, Michael Weghorn has far more of a
grasp of the current state of that.


For gtk4 a11y, as Caolán mentioned, this currently lacks upstream Gtk 
API to implement what's needed, see for example the discussion in these 
Gtk issues:


https://gitlab.gnome.org/GNOME/gtk/-/issues/6272
https://gitlab.gnome.org/GNOME/gtk/-/issues/6204
https://gitlab.gnome.org/GNOME/gtk/-/issues/6269
https://gitlab.gnome.org/GNOME/gtk/-/issues/6197

The latter mentions a potential approach (in my perspective this would 
feel more like a workaround ) to implement the low-level platform a11y 
API (AT-SPI) directly in LO for things like the document content instead 
of using (non-existing) Gtk API, but there are open questions for that 
approach also.


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: VCL selection

2024-03-07 Thread Michael Weghorn

On 2024-03-06 21:00, Gwyn Ciesla wrote:
Fedora is looking at changing the default VCL plugin used for 
the interface for various desktop environments, specifically gtk4 for 
GNOME and kf6 for KDE. I'm able to choose the plugin by settting 
SAL_USE_VCL_PLUGIN, but when I have several installed and remove gtk3 it 
defaults to X11, so I'm not sure how it makes that choice.


Julien's email contains a code pointer.

To explicitly mention it here: For KDE Plasma 6, the kf6 VCL plugin is 
already selected by default.


(see commit

commit 06dbdb0f5b618ce01a79f07dc78e8049c419cc5f
Author: Michael Weghorn 
Date:   Thu Jun 22 08:56:36 2023 +0200

Use kf6 VCL plugin by default on Plasma 6
)


OpenPGP_signature.asc
Description: OpenPGP digital signature


core.git: vcl/inc vcl/qt5

2024-02-29 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtAccessibleWidget.hxx |   12 +
 vcl/qt5/QtAccessibleWidget.cxx |   77 +
 2 files changed, 89 insertions(+)

New commits:
commit 1b6963cda0a209548249dd43c5c1fa705ef32bcd
Author: Michael Weghorn 
AuthorDate: Thu Feb 29 10:20:42 2024 +0100
Commit: Michael Weghorn 
CommitDate: Thu Feb 29 12:34:37 2024 +0100

tdf#158030 qt a11y: Implement new QAccessibleAttributesInterface

Implement the new `QAccessibleAttributesInterface`
just added upstream to Qt in qtbase commit [1]

commit fb5ffe862688a87cfc136113e067bcba0c49a7ae
Author: Michael Weghorn 
AuthorDate: Fri Nov 10 18:25:02 2023 +0100
Commit: Volker Hilsheimer 
CommitDate: Thu Feb 29 04:44:22 2024 +

a11y: Add new QAccessibleAttributesInterface

, see also QTBUG-119057. [2]
This API is available with Qt >= 6.8.

That interface makes it possible to report
object attributes that are bridged to the platform a11y
layers.
Use it to bridge the attributes retrieved from
the `XAccessibleExtendedAttributes` UNO interface.

Together with the pending upstream qtbase change that
implements the AT-SPI bridge for Linux [3], the "level"
AT-SPI object attribute for headings in Writer
is correctly reported to AT-SPI, making the
Orca screen reader announce "Heading level N" as expected.

For now, map not explicitly handled attributes
as key-value pairs to Qt via the special
`QAccessible::Attribute::Custom` attribute,
which causes them to be mapped to AT-SPI unchanged, and
can e.g. be used for testing the tdf#158030 scenario.

For common attributes - like those specified in the
Core Accessibility API Mappings specification [4] -
suggesting to add new enum values to the
`QAccessible::Attribute` enum to upstream Qt
and using those instead should be considered for the future.

Related commit for gtk4:

commit 3aca2d9776a871f15009a1aa70628ba3a03ee147
    Author: Michael Weghorn 
Date:   Thu Nov 9 15:31:57 2023 +0100

gtk4 a11y: Handle the "level" object attribute

[1] 
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=fb5ffe862688a87cfc136113e067bcba0c49a7ae
[2] https://bugreports.qt.io/browse/QTBUG-119057
[3] https://codereview.qt-project.org/c/qt/qtbase/+/517526
[4] https://www.w3.org/TR/core-aam-1.2/

Change-Id: Ibe357bfd72bb2dc6e44ad941e62737d5cac21e1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159309
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/QtAccessibleWidget.hxx 
b/vcl/inc/qt5/QtAccessibleWidget.hxx
index 8d71ecd0ea77..46d7be26582d 100644
--- a/vcl/inc/qt5/QtAccessibleWidget.hxx
+++ b/vcl/inc/qt5/QtAccessibleWidget.hxx
@@ -38,6 +38,9 @@ class QtWidget;
 
 class QtAccessibleWidget final : public QAccessibleInterface,
  public QAccessibleActionInterface,
+#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
+ public QAccessibleAttributesInterface,
+#endif
  public QAccessibleTextInterface,
  public QAccessibleEditableTextInterface,
 #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
@@ -85,6 +88,15 @@ public:
 void doAction(const QString& actionName) override;
 QStringList keyBindingsForAction(const QString& actionName) const override;
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
+// helper method for QAccessibleAttributesInterface
+QHash attributes() const;
+
+// QAccessibleAttributesInterface
+QList attributeKeys() const override;
+QVariant attributeValue(QAccessible::Attribute key) const override;
+#endif
+
 // QAccessibleTextInterface
 void addSelection(int startOffset, int endOffset) override;
 QString attributes(int offset, int* startOffset, int* endOffset) const 
override;
diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index 7eadc3313834..790e200929b1 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -741,6 +742,10 @@ void* 
QtAccessibleWidget::interface_cast(QAccessible::InterfaceType t)
 #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
 if (t == QAccessible::SelectionInterface && 
accessibleProvidesInterface())
 return static_cast(this);
+#endif
+#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
+if (t == QAccessible::AttributesInterface)
+return static_cast(this);
 #endif
 return nullptr;
 }
@@ -855,6 +860,78 @@ QStringList QtAccessibleWidget::keyBindingsForAction(const 
QString& actionName)
 return keyBindings;
 }
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
+
+// QAccessibleAt

core.git: Branch 'libreoffice-7-6' - toolkit/source vcl/source

2024-02-29 Thread Michael Weghorn (via logerrit)
 toolkit/source/awt/vclxwindow.cxx |1 -
 vcl/source/window/window.cxx  |1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 97a2f97bf994b9804fa509e06e352ce99b02007b
Author: Michael Weghorn 
AuthorDate: Wed Feb 28 12:18:40 2024 +0100
Commit: Michael Stahl 
CommitDate: Thu Feb 29 11:13:28 2024 +0100

tdf#159735 a11y: Dispose win accessible with VCLXWindow

`Window::dispose` takes care of disposing its
accessible as well.

However, `VCLXWindow::dispose` was explicitly unsetting
the accessible before disposing its `vcl::Window`, resulting
in it not getting disposed, in turn resulting in a crash on exit
for the tdf#159735 case.

Potentially related:

commit 5aa60be574ece81b27c8f63e6e809871c694dba0
Date:   Wed May 12 11:33:06 2021 +0200

fix leak in VCLXWindow

which is a little tricky because dispose() can be called from either
side (vcl::Window or VCLXWindow)

Before that commit, setting a nullptr accessible happened
in the `VCLXWindow` dtor, which is meant to get called after
the `vcl::Window` got disposed in `VCLXWindow::dispose`.
(In the Linux bibisect repo, the commit before that one is fine
and at that commit, the tdf#159735 comment 5 scenario even
crashes in step 3 already.)

Don't unset the `vcl::Window`'s accessible any more in
`VCLXWindow::dispose`, but do that after disposing it in
`vcl::Window::dispose` instead, which seems to be the
natural place to do that anyway.

Backtrace of crash:

Thread 1 received signal SIGSEGV, Segmentation fault.
0x7fd754ae6fe9 in 
comphelper::OInterfaceContainerHelper4::disposeAndClear
 (this=0x7ffccdc2b5b8, rGuard=..., rEvt=...) at 
include/comphelper/interfacecontainer4.hxx:397
397 aIt.next()->disposing(rEvt);
(gdb) bt
#0  0x7fd754ae6fe9 in 
comphelper::OInterfaceContainerHelper4::disposeAndClear(std::unique_lock&,
 com::sun::star::lang::EventObject const&)
(this=0x7ffccdc2b5b8, rGuard=..., rEvt=...) at 
include/comphelper/interfacecontainer4.hxx:397
#1  0x7fd754ae6014 in 
comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(unsigned int, 
com::sun::star::uno::Reference const&)
(_nClient=28, _rxEventSource=uno::Reference to 
(accessibility::AccessibleListBox *) 0x55bf49c0ad00) at 
.../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:204
#2  0x7fd754ae1424 in 
comphelper::OCommonAccessibleComponent::disposing() (this=0x55bf49c0ad00) at 
.../libreoffice/comphelper/source/misc/accessiblecomponenthelper.cxx:61
#3  0x7fd74e884512 in VCLXAccessibleComponent::disposing() 
(this=0x55bf49c0ad00) at 
.../libreoffice/toolkit/source/awt/vclxaccessiblecomponent.cxx:376
#4  0x7fd6a3d506b7 in accessibility::AccessibleListBox::disposing() 
(this=0x55bf49c0ad00) at 
.../libreoffice/accessibility/source/extended/accessiblelistbox.cxx:246
#5  0x7fd75453f544 in cppu::WeakComponentImplHelperBase::dispose() 
(this=0x55bf49c0ad00) at .../libreoffice/cppuhelper/source/implbase.cxx:104
#6  0x7fd6a3d45fd5 in 
cppu::PartialWeakComponentImplHelper::dispose() 
(this=0x55bf49c0ad00)
at include/cppuhelper/compbase.hxx:90
#7  0x7fd75453f1fe in cppu::WeakComponentImplHelperBase::release() 
(this=0x55bf49c0ad00) at .../libreoffice/cppuhelper/source/implbase.cxx:79
#8  0x7fd6a3d47d85 in 
cppu::PartialWeakComponentImplHelper::release() 
(this=0x55bf49c0ad00)
at include/cppuhelper/compbase.hxx:86
#9  0x7fd6a3d47ca5 in 
cppu::ImplInheritanceHelper::release() 
(this=0x55bf49c0ad00) at include/cppuhelper/implbase.hxx:171
#10 0x7fd6a3d47c85 in 
cppu::ImplInheritanceHelper::release() (this=0x55bf49c0ad00) at 
include/cppuhelper/implbase.hxx:171
#11 0x7fd6a3d45f55 in 
cppu::ImplInheritanceHelper::release() 
(this=0x55bf49c0ad00)
at include/cppuhelper/implbase.hxx:171
#12 0x7fd74282e13e in 
com::sun::star::uno::Reference::~Reference() 
(this=0x55bf49c0e860) at include/com/sun/star/uno/Reference.hxx:114
#13 0x7fd7428524c5 in 
std::destroy_at 
>(com::sun::star::uno::Reference*) 
(__location=0x55bf49c0e860)
at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
#14 0x7fd7428524a5 in 
std::_Destroy 
>(com::sun::star::uno::Reference*) 
(__pointer=0x55bf49c0e860)
at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149
#15 0x7fd742852477 in 
std::_Destroy_aux::__destroy*>(com::sun::star::uno::Reference*,
 com::sun::star::uno::Reference*) 
(__first=0x55bf49c0e860, __last=0x55bf49c0e868) at 
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/

  1   2   3   4   5   6   7   8   9   10   >