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)::SplashScreen::SplashScreen splash.cxx 145 

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 > > 
aSequence { getAccessibleChild( aPara + 1 ) };
+
css::uno::Sequence> 

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
+  
+
 
   
 
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
 
   
@@ -27,25 +27,25 @@
 
   
 True
-True
-True
-True
-True
-True
+True
+True
+True
+True
+True
 
   
 True
-False
+False
 
   
 True
-False
-pan-down-symbolic
+False
+pan-down-symbolic
   
   
 False
 False
-end
+end
 0
   
 
@@ -58,7 +58,7 @@
   
 False
 True
-end
+end
 2
   
 
@@ -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
 
   
 
commit b9f51395bd763d01c8ac2b957ac047ff07fbcdfc
Author: Michael Weghorn 
AuthorDate: Thu Apr 18 11:40:35 2024 +0200
Commit: Michael Weghorn 
CommitDate: Sat Apr 20 15:28:14 2024 +0200

tdf#159910 sw a11y: Set a11y name for Navigator combobox

Set a11y name for this combobox in the Navigator to
"Navigate By".
This is in line with the tooltip shown when hovering over
the combobox, which is set for the combobox's parent,
the panel.

This makes Orca with the qt6 VCL plugin now announce
the a11y name of the combobox with the corresponding
role, rather than the panel
("Navigator, panel, Navigate By, combobox" instead of
"Navigator, panel, Navigate by, panel, combobox").

For gtk3, Orca still 

core.git: winaccessibility/inc winaccessibility/source

 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

 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 

core.git: android/source

 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

 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

 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  0x778444b2 in __GI_abort () at ./stdlib/abort.c:79
#4  

core.git: 2 commits - vcl/source

 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::AccessibleRole::RADIO_BUTTON; 

core.git: 3 commits - offapi/com vcl/unx

 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])

To actually work, this 

core.git: solenv/clang-format vcl/inc vcl/unx

 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,
+const OString& rJobName, int& 
rNumOptions,
+ 

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

 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

 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

 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

 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

 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
attributes in `lo_accessible_text_get_attributes`.

 

core.git: Branch 'libreoffice-7-6-6' - vcl/inc vcl/source vcl/unx

 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 && pSessionVersion && (0 == strcmp(pSessionVersion, 
"6"));
+}
+
 extern "C"
 {
 
@@ -132,6 +139,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType 
get_desktop_environment()
 return DESKTOP_LXQT;
 if (aOver.equalsIgnoreAsciiCase("plasma5") || 

core.git: include/vcl

 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

 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

 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

 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);
 
 // #i76026# enable Undo after loading the document
 mpDoc->EnableUndo(true);
diff --git 

core.git: Branch 'libreoffice-7-6' - vcl/inc vcl/source vcl/unx

 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.equalsIgnoreAsciiCase("plasma5") || 
aOver.equalsIgnoreAsciiCase("plasma"))
 return DESKTOP_PLASMA5;
+if (aOver.equalsIgnoreAsciiCase("plasma6"))
+return DESKTOP_PLASMA6;
 if ( aOver.equalsIgnoreAsciiCase( "gnome" ) )
 return 

core.git: vcl/inc vcl/qt5

 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)
+
+// QAccessibleAttributesInterface helpers
+namespace
+{
+void lcl_insertAttribute(QHash& 

core.git: Branch 'libreoffice-7-6' - toolkit/source vcl/source

 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/bits/stl_construct.h:163

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

 toolkit/source/awt/vclxwindow.cxx |1 -
 vcl/source/window/window.cxx  |1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1c64b4ebd16ee301bcfaa12c659e7baad7b8e519
Author: Michael Weghorn 
AuthorDate: Wed Feb 28 12:18:40 2024 +0100
Commit: Michael Stahl 
CommitDate: Thu Feb 29 11:13:08 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/bits/stl_construct.h:163

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

 accessibility/inc/standard/vclxaccessiblelist.hxx|2 ++
 accessibility/source/standard/vclxaccessiblelist.cxx |   10 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 5cb1fa2a98f61f161ff8b3c19919dad539b36d87
Author: Michael Weghorn 
AuthorDate: Tue Feb 27 21:42:42 2024 +0100
Commit: Michael Stahl 
CommitDate: Thu Feb 29 11:12:09 2024 +0100

tdf#159910 a11y: Dispose VCLXAccessibleList children

In `VCLXAccessibleList::HandleChangedItemList`,
don't just clear the vector of list items, but
dispose them first.

To avoid code duplication, extract a helper method
from `VCLXAccessibleList::disposing` which already
disposes the children since

commit 51de048ae97cbd371457dbc07120e30db9ee4187
Author: Michael Weghorn 
Date:   Mon Sep 4 17:19:03 2023 +0200

tdf#157088 a11y: Dispose list items with list

This fixes a similar crash/assert on exit, seen after using the
Navigator in Writer (in particular the combo/listboxes in
there) with the qt6 VCL plugin and the Orca screen reader
running.

stderr showed this:

soffice.bin: 
.../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:142: bool 
(anonymous namespace)::implLookupClient(const 
AccessibleEventNotifier::TClientId, ClientMap::iterator &): Assertion 
`rClients.end() != rPos && "AccessibleEventNotifier::implLookupClient: invalid 
client id " "(did you register your client?)!"' failed.
Aborted

Backtrace:

1 __pthread_kill_implementation pthread_kill.c 44 0x7f0e1a4a816c
2 __pthread_kill_internal pthread_kill.c 78 0x7f0e1a4a81cf
3 __GI_raise raise.c 26 0x7f0e1a45a472
4 __GI_abort abort.c 79 0x7f0e1ab2
5 __assert_fail_base assert.c 92 0x7f0e1a4443d5
6 __assert_fail assert.c 101 0x7f0e1a4533a2
7 (anonymous namespace)::implLookupClient accessibleeventnotifier.cxx 
140 0x7f0e18ce59ac
8 comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing 
accessibleeventnotifier.cxx 185 0x7f0e18ce5e68
9 VCLXAccessibleListItem::disposing vclxaccessiblelistitem.cxx 164 
0x7f0ddf7d237f
10 cppu::WeakComponentImplHelperBase::dispose implbase.cxx 104 
0x7f0e1873f544
11 
cppu::PartialWeakComponentImplHelper::dispose compbase.hxx 90 0x7f0ddf7cb7c5
12 cppu::WeakComponentImplHelperBase::release implbase.cxx 79 
0x7f0e1873f1fe
13 
cppu::PartialWeakComponentImplHelper::release compbase.hxx 86 0x7f0ddf7cd0c5
14 
com::sun::star::uno::Reference::~Reference
 Reference.hxx 114 0x7f0e06bbccbe
15 QtAccessibleWidget::~QtAccessibleWidget QtAccessibleWidget.hxx 39 
0x7f0e06bd618d
16 QtAccessibleWidget::~QtAccessibleWidget QtAccessibleWidget.hxx 39 
0x7f0e06bd6219
17 QAccessibleCache::deleteInterface qaccessiblecache.cpp 173 
0x7f0e05545319
18 QAccessibleCache::~QAccessibleCache qaccessiblecache.cpp 31 
0x7f0e0554492a
19 QAccessibleCache::~QAccessibleCache qaccessiblecache.cpp 32 
0x7f0e055449b0
20 cleanupAccessibleCache qaccessiblecache.cpp 24 0x7f0e05544896
21 qt_call_post_routines qcoreapplication.cpp 332 0x7f0e05faf826
22 QApplication::~QApplication qapplication.cpp 665 0x7f0e0419e24a
23 QApplication::~QApplication qapplication.cpp 722 0x7f0e0419e55c
24 std::default_delete::operator() unique_ptr.h 99 
0x7f0e06c5d63c
25 std::__uniq_ptr_impl>::reset unique_ptr.h 211 0x7f0e06c5df7c
26 std::unique_ptr>::reset unique_ptr.h 509 0x7f0e06c58bfd
27 QtInstance::~QtInstance QtInstance.cxx 305 0x7f0e06c51184
28 QtInstance::~QtInstance QtInstance.cxx 302 0x7f0e06c51279
29 DestroySalInstance salplug.cxx 368 0x7f0e114c0a18
30 DeInitVCL svmain.cxx 625 0x7f0e115c5e7d
31 ImplSVMain svmain.cxx 254 0x7f0e115c4031
32 SVMain svmain.cxx 261 0x7f0e115c5f79
33 soffice_main sofficemain.cxx 94 0x7f0e1a7a4ba3
34 sal_main main.c 51 0x559ce9c67a5d
35 main main.c 49 0x559ce9c67a37

Change-Id: Ic5121645a6920a8ac35154dda1dcfa1974ab9d4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164062
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit b5f943fabbd73aa8a0c972ca8c37d6fda56a7385)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163983
Reviewed-by: Michael Stahl 

diff --git a/accessibility/inc/standard/vclxaccessiblelist.hxx 
b/accessibility/inc/standard/vclxaccessiblelist.hxx
index f668e75d7cda..7bfb83c7e386 100644
--- a/accessibility/inc/standard/vclxaccessiblelist.hxx
+++ b/accessibility/inc/standard/vclxaccessiblelist.hxx
@@ -136,6 +136,8 @@ private:
 */
 virtual void SAL_CALL disposing() override;
 
+void disposeChildren();
+
 /** This method adds the states
 AccessibleStateType::FOCUSABLE and possibly
 AccessibleStateType::MULTI_SELECTABLE to the 

core.git: toolkit/source vcl/source

 toolkit/source/awt/vclxwindow.cxx |1 -
 vcl/source/window/window.cxx  |1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9c64ae31a7e7b6dc369b820d087527a1db29e2c7
Author: Michael Weghorn 
AuthorDate: Wed Feb 28 12:18:40 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Feb 28 13:42: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/bits/stl_construct.h:163
  

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

 accessibility/inc/standard/vclxaccessiblelist.hxx|2 
 accessibility/source/standard/vclxaccessiblebox.cxx  |   57 +++
 accessibility/source/standard/vclxaccessiblelist.cxx |   10 ++-
 3 files changed, 31 insertions(+), 38 deletions(-)

New commits:
commit 8f88aff98c6089140c73437e567e6d78da5f563e
Author: Michael Weghorn 
AuthorDate: Tue Feb 27 21:42:42 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Feb 28 09:02:46 2024 +0100

tdf#159910 a11y: Dispose VCLXAccessibleList children

In `VCLXAccessibleList::HandleChangedItemList`,
don't just clear the vector of list items, but
dispose them first.

To avoid code duplication, extract a helper method
from `VCLXAccessibleList::disposing` which already
disposes the children since

commit 51de048ae97cbd371457dbc07120e30db9ee4187
Author: Michael Weghorn 
Date:   Mon Sep 4 17:19:03 2023 +0200

tdf#157088 a11y: Dispose list items with list

This fixes a similar crash/assert on exit, seen after using the
Navigator in Writer (in particular the combo/listboxes in
there) with the qt6 VCL plugin and the Orca screen reader
running.

stderr showed this:

soffice.bin: 
.../libreoffice/comphelper/source/misc/accessibleeventnotifier.cxx:142: bool 
(anonymous namespace)::implLookupClient(const 
AccessibleEventNotifier::TClientId, ClientMap::iterator &): Assertion 
`rClients.end() != rPos && "AccessibleEventNotifier::implLookupClient: invalid 
client id " "(did you register your client?)!"' failed.
Aborted

Backtrace:

1 __pthread_kill_implementation pthread_kill.c 44 0x7f0e1a4a816c
2 __pthread_kill_internal pthread_kill.c 78 0x7f0e1a4a81cf
3 __GI_raise raise.c 26 0x7f0e1a45a472
4 __GI_abort abort.c 79 0x7f0e1ab2
5 __assert_fail_base assert.c 92 0x7f0e1a4443d5
6 __assert_fail assert.c 101 0x7f0e1a4533a2
7 (anonymous namespace)::implLookupClient accessibleeventnotifier.cxx 
140 0x7f0e18ce59ac
8 comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing 
accessibleeventnotifier.cxx 185 0x7f0e18ce5e68
9 VCLXAccessibleListItem::disposing vclxaccessiblelistitem.cxx 164 
0x7f0ddf7d237f
10 cppu::WeakComponentImplHelperBase::dispose implbase.cxx 104 
0x7f0e1873f544
11 
cppu::PartialWeakComponentImplHelper::dispose compbase.hxx 90 0x7f0ddf7cb7c5
12 cppu::WeakComponentImplHelperBase::release implbase.cxx 79 
0x7f0e1873f1fe
13 
cppu::PartialWeakComponentImplHelper::release compbase.hxx 86 0x7f0ddf7cd0c5
14 
com::sun::star::uno::Reference::~Reference
 Reference.hxx 114 0x7f0e06bbccbe
15 QtAccessibleWidget::~QtAccessibleWidget QtAccessibleWidget.hxx 39 
0x7f0e06bd618d
16 QtAccessibleWidget::~QtAccessibleWidget QtAccessibleWidget.hxx 39 
0x7f0e06bd6219
17 QAccessibleCache::deleteInterface qaccessiblecache.cpp 173 
0x7f0e05545319
18 QAccessibleCache::~QAccessibleCache qaccessiblecache.cpp 31 
0x7f0e0554492a
19 QAccessibleCache::~QAccessibleCache qaccessiblecache.cpp 32 
0x7f0e055449b0
20 cleanupAccessibleCache qaccessiblecache.cpp 24 0x7f0e05544896
21 qt_call_post_routines qcoreapplication.cpp 332 0x7f0e05faf826
22 QApplication::~QApplication qapplication.cpp 665 0x7f0e0419e24a
23 QApplication::~QApplication qapplication.cpp 722 0x7f0e0419e55c
24 std::default_delete::operator() unique_ptr.h 99 
0x7f0e06c5d63c
25 std::__uniq_ptr_impl>::reset unique_ptr.h 211 0x7f0e06c5df7c
26 std::unique_ptr>::reset unique_ptr.h 509 0x7f0e06c58bfd
27 QtInstance::~QtInstance QtInstance.cxx 305 0x7f0e06c51184
28 QtInstance::~QtInstance QtInstance.cxx 302 0x7f0e06c51279
29 DestroySalInstance salplug.cxx 368 0x7f0e114c0a18
30 DeInitVCL svmain.cxx 625 0x7f0e115c5e7d
31 ImplSVMain svmain.cxx 254 0x7f0e115c4031
32 SVMain svmain.cxx 261 0x7f0e115c5f79
33 soffice_main sofficemain.cxx 94 0x7f0e1a7a4ba3
34 sal_main main.c 51 0x559ce9c67a5d
35 main main.c 49 0x559ce9c67a37

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

diff --git a/accessibility/inc/standard/vclxaccessiblelist.hxx 
b/accessibility/inc/standard/vclxaccessiblelist.hxx
index f668e75d7cda..7bfb83c7e386 100644
--- a/accessibility/inc/standard/vclxaccessiblelist.hxx
+++ b/accessibility/inc/standard/vclxaccessiblelist.hxx
@@ -136,6 +136,8 @@ private:
 */
 virtual void SAL_CALL disposing() override;
 
+void disposeChildren();
+
 /** This method adds the states
 AccessibleStateType::FOCUSABLE and possibly
 AccessibleStateType::MULTI_SELECTABLE to the state set
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx 

core.git: sw/uiconfig

 sw/uiconfig/swriter/ui/navigatorpanel.ui |   19 +++
 1 file changed, 19 insertions(+)

New commits:
commit d31c0fd5ed9fe563386cf317b366a0e739302dd2
Author: Michael Weghorn 
AuthorDate: Tue Feb 27 13:42:01 2024 +0100
Commit: Michael Weghorn 
CommitDate: Tue Feb 27 19:35:02 2024 +0100

tdf#159910 sw a11y: Set a11y names for Navigator items

Set accessible names for the items (mostly toolbar items)
in the Navigator.

This makes the Orca screen reader with the gtk3 VCL plugin
announce these as expected when they receive focus.

For now, take over the existing tooltip text for the
accessible name. This can be further tweaked if necessary.

With the previous commit

Change-Id: I45b87839dda90083ceba1c43fdb4d4ec460fce3d
Author: Michael Weghorn 
Date:   Tue Feb 27 13:12:43 2024 +0100

tdf#159910 a11y VclBuilder: Apply tool item's a11y name to itself

, these a11y names are now also used for the VCL implementation
(s. `VCLXAccessibleToolBoxItem::implGetAccessibleName`).
The accessible name there remains the same for now, as the
previous fallback was the tooltip name, which at least
currently still has the same text.

It seems reasonable to align the gtk3 and VCL implementation
more with each other and support the default mechanism
of explicitly setting an accessible name on the corresponding
widget in the .ui file.

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

diff --git a/sw/uiconfig/swriter/ui/navigatorpanel.ui 
b/sw/uiconfig/swriter/ui/navigatorpanel.ui
index e7c3020cdbdf..18599af36c90 100644
--- a/sw/uiconfig/swriter/ui/navigatorpanel.ui
+++ b/sw/uiconfig/swriter/ui/navigatorpanel.ui
@@ -234,6 +234,7 @@
 sw/res/sc20244.png
 
   
+Toggle Master 
View
 Switches between master 
view and normal view if a master document is open.
   
 
@@ -347,6 +348,7 @@
 True
 
   
+Go to page
 Enter a page that you want to go 
to and press enter or use the buttons to move to the previous or next 
page.
   
 
@@ -384,6 +386,7 @@
 sw/res/sc20234.png
 
   
+Content 
Navigation View
 Switches between 
the display of all categories in the Navigator and the selected 
category.
   
 
@@ -411,6 +414,7 @@
 sw/res/sc20179.png
 
   
+Header
 Moves the 
cursor to the header, or from the header to the document text area.
   
 
@@ -428,6 +432,7 @@
 sw/res/sc20177.png
 
   
+Footer
 Moves the 
cursor to the footer, or from the footer to the document text area.
   
 
@@ -445,6 +450,7 @@
 sw/res/sc20182.png
 
   
+Anchor-Text
 Jumps between 
the footnote text and the footnote anchor.
   
 
@@ -462,6 +468,7 @@
 sw/res/sc20183.png
 
   
+Set 
Reminder
 Click here to 
set a reminder at the current cursor position. You can define up to five 
reminders. To jump to a reminder, click the Navigation icon, in the Navigation 
window click the Reminder icon, and then click the Previous or Next 
button.
   
 
@@ -489,6 +496,7 @@
 sw/res/sc20236.png
 
   
+Show Up to 
Outline Level
 Use this 
option to control what headings in the document structure are displayed in the 
Navigator window. Click the icon, and choose an outline level number. Any 
heading with an outline number less than or equal to the selected number will 
be displayed.
   
 
@@ -518,6 +526,7 @@
 

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

 accessibility/source/standard/vclxaccessibletoolboxitem.cxx |6 ++
 include/vcl/builder.hxx |   12 +++--
 include/vcl/toolbox.hxx |4 +
 vcl/inc/toolbox.h   |1 
 vcl/source/window/builder.cxx   |   25 
 vcl/source/window/toolbox2.cxx  |   17 
 6 files changed, 53 insertions(+), 12 deletions(-)

New commits:
commit ad1167b92b8b8fdabf6b21e945682c0bafc80946
Author: Michael Weghorn 
AuthorDate: Tue Feb 27 13:12:43 2024 +0100
Commit: Michael Weghorn 
CommitDate: Tue Feb 27 19:34:55 2024 +0100

tdf#159910 a11y VclBuilder: Apply tool item's a11y name to itself

For the VCL `ToolBox` implementation of a toolbar, the items
are not represented by own widgets (`vcl::Window`s), but handled
by the `ToolBox`.

As a consequence, the `vcl::Window` passed to
`VclBuilder::applyAtkProperties` cannot be the tool item
itself (e.g. a `GtkToolButton` in the .ui file), but is the
`ToolBox`, i.e. the (VCL builder implementation of the
`GtkToolbar` parent widget in the .ui file).

So far, the ATK properties set for the tool item were
just applied to the parent instead.

For example, with the upcoming

Change-Id: I852503e849651bb7be4daa419ec2379568623f0f
Author: Michael Weghorn 
Date:   Tue Feb 27 11:51:55 2024 +0100

tdf#159910 sw a11y: Set a11y names for Navigator items

, this would result in the toolbars getting the name of their
last item (one of the toolbars in the Navigator would
get the a11y name "Show Up to Outline Level") and the
toolbar items would only have an a11y name set because
they still fall back to the tooltip text for the a11y name.

Adjust that to set the accessible name for the
actual toolbar item when a toolbar item is
processed. (Add a bool param to indicate that).

See also `VclBuilder::applyPackingProperty` which
already had a similar way to determine and handle that
case.

With this in place, the accessible name set in the .ui
file is now applied to the toolbar item as expected.

(The accessible description could be handled similarly,
but I'm a bit more hesitant to add that right away because
the accessible description is currently also used for the
extended tooltip text and the NVDA screen reader on Windows
announces the description in addition to the name by default.)

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

diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 37fbfbe97e16..59202ba34062 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -353,9 +353,12 @@ private:
 voidextractMnemonicWidget(const OUString , stringmap );
 
 // either pParent or pAtkProps must be set, pParent for a child of a 
widget, pAtkProps for
-// collecting the atk info for a GtkMenuItem
-voidhandleChild(vcl::Window *pParent, stringmap *pAtkProps, 
xmlreader::XmlReader );
-VclPtr handleObject(vcl::Window *pParent, stringmap 
*pAtkProps, xmlreader::XmlReader );
+// collecting the atk info for a GtkMenuItem,
+// if bToolbarItem=true, pParent is the ToolBox that the item belongs to, 
since there's no widget for the item itself
+voidhandleChild(vcl::Window *pParent, stringmap *pAtkProps, 
xmlreader::XmlReader , bool bToolbarItem = false);
+// if bToolbarItem=true, pParent is the ToolBox that the item belongs to, 
since there's no widget for the item itself
+VclPtr handleObject(vcl::Window *pParent, stringmap 
*pAtkProps, xmlreader::XmlReader , bool bToolbarItem);
+
 voidhandlePacking(vcl::Window *pCurrent, vcl::Window *pParent, 
xmlreader::XmlReader );
 static std::vector 
handleStyle(xmlreader::XmlReader , int );
 static OUString getStyleClass(xmlreader::XmlReader );
@@ -385,7 +388,8 @@ private:
 
 stringmap   handleAtkObject(xmlreader::XmlReader ) const;
 
-static void applyAtkProperties(vcl::Window *pWindow, const stringmap& 
rProperties);
+// if bToolbarItem=true, pParent is the ToolBox that the item belongs to, 
since there's no widget for the item itself
+void applyAtkProperties(vcl::Window *pWindow, const stringmap& 
rProperties, bool bToolbarItem);
 
 voidhandleActionWidget(xmlreader::XmlReader );
 
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 0fcf7d6b65fd..7c77fad75a53 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2796,7 +2796,7 @@ void VclBuilder::tweakInsertedChild(vcl::Window *pParent, 
vcl::Window* pCurrentC
 }
 }
 
-void VclBuilder::handleChild(vcl::Window 

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

 accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx|6 -
 accessibility/inc/standard/vclxaccessibletabpage.hxx  |5 -
 accessibility/inc/standard/vclxaccessibletoolboxitem.hxx  |6 -
 accessibility/source/standard/vclxaccessiblestatusbaritem.cxx |2 
 accessibility/source/standard/vclxaccessibletabpage.cxx   |2 
 accessibility/source/standard/vclxaccessibletoolboxitem.cxx   |   45 +-
 6 files changed, 31 insertions(+), 35 deletions(-)

New commits:
commit 4b3d6fadf0b984e7e1c438c682e15a99124b9642
Author: Michael Weghorn 
AuthorDate: Mon Feb 26 16:54:55 2024 +0100
Commit: Michael Weghorn 
CommitDate: Mon Feb 26 22:55:02 2024 +0100

a11y: Drop some AccessibleTextHelper_BASE typedefs

Just use `comphelper::OAccessibleTextHelper` directly
where `AccessibleTextHelper_BASE` is a typedef for that.

There are other `AccessibleTextHelper_BASE` typedefs with
a different meaning elsewhere in the codebase, which are left unchanged.

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

diff --git a/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx 
b/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx
index 0ab119fe19eb..9556f961d140 100644
--- a/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx
+++ b/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx
@@ -28,12 +28,8 @@
 #include 
 
 
-
-
-typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE;
-
 class VCLXAccessibleStatusBarItem final : public cppu::ImplInheritanceHelper<
-  AccessibleTextHelper_BASE,
+  
comphelper::OAccessibleTextHelper,
   css::accessibility::XAccessible,
   css::lang::XServiceInfo>
 {
diff --git a/accessibility/inc/standard/vclxaccessibletabpage.hxx 
b/accessibility/inc/standard/vclxaccessibletabpage.hxx
index bb3d720055a0..efdc75e2c677 100644
--- a/accessibility/inc/standard/vclxaccessibletabpage.hxx
+++ b/accessibility/inc/standard/vclxaccessibletabpage.hxx
@@ -30,11 +30,8 @@
 class TabControl;
 
 
-
-typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE;
-
 class VCLXAccessibleTabPage final : public cppu::ImplInheritanceHelper<
-AccessibleTextHelper_BASE,
+comphelper::OAccessibleTextHelper,
 css::accessibility::XAccessible,
 css::lang::XServiceInfo>
 {
diff --git a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx 
b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx
index 4ba54023f163..6fbfc1e55138 100644
--- a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx
+++ b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx
@@ -30,10 +30,8 @@
 #include 
 
 
-typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE;
-
 class VCLXAccessibleToolBoxItem final : public cppu::ImplInheritanceHelper<
-AccessibleTextHelper_BASE,
+comphelper::OAccessibleTextHelper,
 css::accessibility::XAccessible,
 
css::accessibility::XAccessibleAction,
 
css::accessibility::XAccessibleValue,
diff --git a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx 
b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx
index eab26ee708d3..db5e6cf140fe 100644
--- a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx
+++ b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx
@@ -181,7 +181,7 @@ void VCLXAccessibleStatusBarItem::implGetSelection( 
sal_Int32& nStartIndex, sal_
 
 void VCLXAccessibleStatusBarItem::disposing()
 {
-AccessibleTextHelper_BASE::disposing();
+comphelper::OAccessibleTextHelper::disposing();
 
 m_pStatusBar = nullptr;
 m_sItemName.clear();
diff --git a/accessibility/source/standard/vclxaccessibletabpage.cxx 
b/accessibility/source/standard/vclxaccessibletabpage.cxx
index ff37087366d5..dad454ab0021 100644
--- a/accessibility/source/standard/vclxaccessibletabpage.cxx
+++ b/accessibility/source/standard/vclxaccessibletabpage.cxx
@@ -224,7 +224,7 @@ void VCLXAccessibleTabPage::implGetSelection( sal_Int32& 
nStartIndex, sal_Int32&
 
 void VCLXAccessibleTabPage::disposing()
 {
-AccessibleTextHelper_BASE::disposing();
+comphelper::OAccessibleTextHelper::disposing();
 
 m_pTabControl = nullptr;
 m_sPageText.clear();
diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx 

core.git: accessibility/inc accessibility/source

 accessibility/inc/standard/vclxaccessibletoolboxitem.hxx|1 
 accessibility/source/standard/vclxaccessibletoolboxitem.cxx |   57 +---
 2 files changed, 26 insertions(+), 32 deletions(-)

New commits:
commit 86dff3ca4e994f69bf9ba6656ac3e1164a29ca11
Author: Michael Weghorn 
AuthorDate: Mon Feb 26 15:55:42 2024 +0100
Commit: Michael Weghorn 
CommitDate: Mon Feb 26 22:38:31 2024 +0100

tdf#159910 a11y: Merge VCLXAccessibleToolBoxItem::{,impl}GetText

`VCLXAccessibleToolBoxItem::implGetText` was just calling
`VCLXAccessibleToolBoxItem::GetText`, and both of them
were used from different places.

Just move the implementation to `VCLXAccessibleToolBoxItem::implGetText`
right away, drop `VCLXAccessibleToolBoxItem::implGetText` and adjust
callers to unify this.

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

diff --git a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx 
b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx
index 5bff8ef95374..9676762d54bb 100644
--- a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx
+++ b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx
@@ -50,7 +50,6 @@ private:
 boolm_bIndeterminate;
 
 css::uno::Reference< css::accessibility::XAccessible >m_xChild;
-OUString GetText() const;
 
 public:
 sal_Int32getIndexInParent() const{ return 
m_nIndexInParent; }
diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx 
b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
index 63ec17cdff7c..f8545eacc422 100644
--- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
@@ -69,7 +69,7 @@ VCLXAccessibleToolBoxItem::VCLXAccessibleToolBoxItem( 
ToolBox* _pToolBox, sal_In
 {
 assert( m_pToolBox );
 m_nItemId = m_pToolBox->GetItemId( m_nIndexInParent );
-m_sOldName = GetText();
+m_sOldName = implGetText();
 m_bIsChecked = m_pToolBox->IsItemChecked( m_nItemId );
 m_bIndeterminate = ( m_pToolBox->GetItemState( m_nItemId ) == 
TRISTATE_INDET );
 ToolBoxItemType eType = m_pToolBox->GetItemType( m_nIndexInParent );
@@ -114,29 +114,6 @@ VCLXAccessibleToolBoxItem::~VCLXAccessibleToolBoxItem()
 {
 }
 
-OUString VCLXAccessibleToolBoxItem::GetText() const
-{
-// no text for separators and spaces
-if (!m_pToolBox || m_nItemId <= ToolBoxItemId(0))
-return OUString();
-
-OUString sRet = m_pToolBox->GetItemText( m_nItemId );
-if (!sRet.isEmpty())
-return sRet;
-
-sRet = m_pToolBox->GetQuickHelpText( m_nItemId );
-if (!sRet.isEmpty())
-return sRet;
-
-vcl::Window* pItemWindow = m_pToolBox->GetItemWindow( m_nItemId );
-if ( m_nRole == AccessibleRole::PANEL && pItemWindow && 
pItemWindow->GetAccessible().is() &&
- pItemWindow->GetAccessible()->getAccessibleContext().is() )
-{
-sRet = 
pItemWindow->GetAccessible()->getAccessibleContext()->getAccessibleName();
-}
-return sRet;
-}
-
 void VCLXAccessibleToolBoxItem::SetFocus( bool _bFocus )
 {
 if ( m_bHasFocus != _bFocus )
@@ -238,7 +215,25 @@ awt::Rectangle VCLXAccessibleToolBoxItem::implGetBounds(  )
 
 OUString VCLXAccessibleToolBoxItem::implGetText()
 {
-return GetText();
+// no text for separators and spaces
+if (!m_pToolBox || m_nItemId <= ToolBoxItemId(0))
+return OUString();
+
+OUString sRet = m_pToolBox->GetItemText( m_nItemId );
+if (!sRet.isEmpty())
+return sRet;
+
+sRet = m_pToolBox->GetQuickHelpText( m_nItemId );
+if (!sRet.isEmpty())
+return sRet;
+
+vcl::Window* pItemWindow = m_pToolBox->GetItemWindow( m_nItemId );
+if ( m_nRole == AccessibleRole::PANEL && pItemWindow && 
pItemWindow->GetAccessible().is() &&
+pItemWindow->GetAccessible()->getAccessibleContext().is() )
+{
+sRet = 
pItemWindow->GetAccessible()->getAccessibleContext()->getAccessibleName();
+}
+return sRet;
 }
 
 Locale VCLXAccessibleToolBoxItem::implGetLocale()
@@ -362,7 +357,7 @@ OUString SAL_CALL 
VCLXAccessibleToolBoxItem::getAccessibleName(  )
 OExternalLockGuard aGuard( this );
 
 // entry text == accessible name
-return GetText();
+return implGetText();
 }
 
 Reference< XAccessibleRelationSet > SAL_CALL 
VCLXAccessibleToolBoxItem::getAccessibleRelationSet(  )
@@ -411,26 +406,26 @@ OUString VCLXAccessibleToolBoxItem::getText()
 {
 OExternalLockGuard aGuard( this );
 
-return GetText();
+return implGetText();
 }
 
 sal_Int32 VCLXAccessibleToolBoxItem::getCharacterCount()
 {
-return GetText().getLength();
+return implGetText().getLength();
 }
 
 sal_Unicode VCLXAccessibleToolBoxItem::getCharacter( sal_Int32 nIndex )
 {
  OExternalLockGuard aGuard( this );
 
- 

core.git: include/vcl vcl/source

 include/vcl/builder.hxx   |1 +
 vcl/source/window/builder.cxx |   10 --
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 625d22600d41a70f5c4a65bc75ef02b17c6cfae2
Author: Michael Weghorn 
AuthorDate: Mon Feb 26 14:26:03 2024 +0100
Commit: Michael Weghorn 
CommitDate: Mon Feb 26 22:38:06 2024 +0100

tdf#159910 VclBuilder: Add helper to identify toolbar item class

Extract a new helper method `BuilderBase::isToolbarItemClass`
to identify whether a widget class is one of those used for
toolbar items.

Related: Gtk's GtkToolItem doc [1].
(But this commit just moves the existing logic without
looking into that Gtk doc further.)

[1] https://docs.gtk.org/gtk3/class.ToolItem.html

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

diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 6071b80087a1..37fbfbe97e16 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -75,6 +75,7 @@ protected:
 static void collectAtkRelationAttribute(xmlreader::XmlReader& reader, 
stringmap& rMap);
 static void collectAtkRoleAttribute(xmlreader::XmlReader& reader, 
stringmap& rMap);
 static void collectAccelerator(xmlreader::XmlReader& reader, accelmap& 
rMap);
+static bool isToolbarItemClass(std::u16string_view sClass);
 };
 
 /// Creates a hierarchy of vcl::Windows (widgets) from a .ui file for dialogs, 
sidebar, etc.
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 88e82ac52138..0fcf7d6b65fd 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2105,8 +2105,7 @@ VclPtr VclBuilder::makeObject(vcl::Window 
*pParent, const OUString
 NotebookBarAddonsMerger::MergeNotebookBarAddons(pParent, 
pFunction, m_xFrame, *m_pNotebookBarAddonsItem, rMap);
 return nullptr;
 }
-else if (name == "GtkToolButton" || name == "GtkMenuToolButton" ||
- name == "GtkToggleToolButton" || name == "GtkRadioToolButton" || 
name == "GtkToolItem")
+else if (isToolbarItemClass(name))
 {
 if (pToolBox)
 {
@@ -4036,6 +4035,13 @@ void 
BuilderBase::collectAccelerator(xmlreader::XmlReader& reader, accelmap& rMa
 }
 }
 
+bool BuilderBase::isToolbarItemClass(std::u16string_view sClass)
+{
+return sClass == u"GtkToolButton" || sClass == u"GtkMenuToolButton"
+   || sClass == u"GtkToggleToolButton" || sClass == 
u"GtkRadioToolButton"
+   || sClass == u"GtkToolItem";
+}
+
 vcl::Window *VclBuilder::get_widget_root()
 {
 return m_aChildren.empty() ? nullptr : m_aChildren[0].m_pWindow.get();


core.git: accessibility/source

 accessibility/source/standard/vclxaccessibletoolboxitem.cxx |   34 +---
 1 file changed, 15 insertions(+), 19 deletions(-)

New commits:
commit 492a683c70d98d005bcb472770be33d3277499d7
Author: Michael Weghorn 
AuthorDate: Mon Feb 26 15:13:19 2024 +0100
Commit: Michael Weghorn 
CommitDate: Mon Feb 26 22:37:34 2024 +0100

tdf#159910 a11y: Slightly simplify VCLXAccessibleToolBoxItem::GetText

* Avoid deep nesting by returning non-empty value right away.
* Drop the `if (!sWinText.isEmpty())` before the last assignment.
  At this point, `sRet` is already empty, so reassigning an empty
  string makes no difference.

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

diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx 
b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
index 3b6bad772162..63ec17cdff7c 100644
--- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
@@ -116,27 +116,23 @@ VCLXAccessibleToolBoxItem::~VCLXAccessibleToolBoxItem()
 
 OUString VCLXAccessibleToolBoxItem::GetText() const
 {
-OUString sRet;
 // no text for separators and spaces
-if ( m_pToolBox && m_nItemId > ToolBoxItemId(0) )
-{
-sRet = m_pToolBox->GetItemText( m_nItemId );
-if (sRet.isEmpty())
-{
-sRet = m_pToolBox->GetQuickHelpText( m_nItemId );
-if (sRet.isEmpty())
-{
-vcl::Window* pItemWindow = m_pToolBox->GetItemWindow( 
m_nItemId );
-if ( m_nRole == AccessibleRole::PANEL && pItemWindow && 
pItemWindow->GetAccessible().is() &&
- pItemWindow->GetAccessible()->getAccessibleContext().is() 
)
-{
-OUString sWinText = 
pItemWindow->GetAccessible()->getAccessibleContext()->getAccessibleName();
-if (!sWinText.isEmpty())
-sRet = sWinText;
-}
-}
-}
+if (!m_pToolBox || m_nItemId <= ToolBoxItemId(0))
+return OUString();
+
+OUString sRet = m_pToolBox->GetItemText( m_nItemId );
+if (!sRet.isEmpty())
+return sRet;
 
+sRet = m_pToolBox->GetQuickHelpText( m_nItemId );
+if (!sRet.isEmpty())
+return sRet;
+
+vcl::Window* pItemWindow = m_pToolBox->GetItemWindow( m_nItemId );
+if ( m_nRole == AccessibleRole::PANEL && pItemWindow && 
pItemWindow->GetAccessible().is() &&
+ pItemWindow->GetAccessible()->getAccessibleContext().is() )
+{
+sRet = 
pItemWindow->GetAccessible()->getAccessibleContext()->getAccessibleName();
 }
 return sRet;
 }


core.git: 3 commits - vcl/Library_vclplug_gtk4.mk vcl/unx

 vcl/Library_vclplug_gtk4.mk |1 
 vcl/unx/gtk4/a11y.cxx   |   11 +-
 vcl/unx/gtk4/a11y.hxx   |4 
 vcl/unx/gtk4/gtkaccessibleeventlistener.cxx |   40 +++
 vcl/unx/gtk4/gtkaccessibletext.cxx  |  145 
 vcl/unx/gtk4/gtkaccessibletext.hxx  |   20 +++
 6 files changed, 216 insertions(+), 5 deletions(-)

New commits:
commit 255853c7979657c38339c42f42e245f712cb9e65
Author: Michael Weghorn 
AuthorDate: Thu Feb 22 13:55:01 2024 +0100
Commit: Michael Weghorn 
CommitDate: Thu Feb 22 15:20:42 2024 +0100

gtk4 a11y: Forward text change events

Bridge text-related a11y change events for the gtk4 VCL plugin
by using the new functions to notify about text, text caret
and text selection changes recently introduced in Gtk
in commit [1]

commit 0ca8d74842837b1ad5dc42c1fcff8b1270e5750b
Author: Matthias Clasen 
Date:   Tue Feb 20 12:18:27 2024 -0500

a11y: Add GtkAccessibleText interface

With this in place, having a Writer paragraph selected in
Accerciser's treeview, the text in the "Text" section of the
"Interface Viewer" tab in Accerciser now updates when typing
in LibreOffice (i.e. text changes are propagated there right
away as expected).

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

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

diff --git a/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx 
b/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx
index 4211340d7ee3..6e50b854d16e 100644
--- a/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx
+++ b/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include "gtkaccessibleeventlistener.hxx"
@@ -40,6 +41,14 @@ void GtkAccessibleEventListener::notifyEvent(
 {
 switch (rEvent.EventId)
 {
+#if GTK_CHECK_VERSION(4, 13, 8)
+case css::accessibility::AccessibleEventId::CARET_CHANGED:
+{
+if (GTK_IS_ACCESSIBLE_TEXT(m_pLoAccessible))
+
gtk_accessible_text_update_caret_position(GTK_ACCESSIBLE_TEXT(m_pLoAccessible));
+break;
+}
+#endif
 case css::accessibility::AccessibleEventId::STATE_CHANGED:
 {
 sal_Int64 nState;
@@ -62,6 +71,37 @@ void GtkAccessibleEventListener::notifyEvent(
 }
 break;
 }
+#if GTK_CHECK_VERSION(4, 13, 8)
+case css::accessibility::AccessibleEventId::TEXT_CHANGED:
+{
+if (!GTK_IS_ACCESSIBLE_TEXT(m_pLoAccessible))
+break;
+
+GtkAccessibleText* pText = GTK_ACCESSIBLE_TEXT(m_pLoAccessible);
+
+css::accessibility::TextSegment aDeletedText;
+css::accessibility::TextSegment aInsertedText;
+if (rEvent.OldValue >>= aDeletedText)
+{
+gtk_accessible_text_update_contents(
+pText, GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_REMOVE, 
aDeletedText.SegmentStart,
+aDeletedText.SegmentEnd);
+}
+if (rEvent.NewValue >>= aInsertedText)
+{
+gtk_accessible_text_update_contents(
+pText, GTK_ACCESSIBLE_TEXT_CONTENT_CHANGE_INSERT, 
aInsertedText.SegmentStart,
+aInsertedText.SegmentEnd);
+}
+return;
+}
+case css::accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED:
+{
+if (GTK_IS_ACCESSIBLE_TEXT(m_pLoAccessible))
+
gtk_accessible_text_update_selection_bound(GTK_ACCESSIBLE_TEXT(m_pLoAccessible));
+break;
+}
+#endif
 default:
 break;
 }
commit e268efd612d12ae9a459d6b9d0cb23220f025163
Author: Michael Weghorn 
AuthorDate: Thu Feb 22 11:58:08 2024 +0100
Commit: Michael Weghorn 
CommitDate: Thu Feb 22 15:20:36 2024 +0100

gtk4 a11y: Implement new GtkAccessibleTextInterface

Implement most of the methods of the
`GtkAccessibleInterface` newly added to Gtk 4 in
Gtk commit [1]

commit 0ca8d74842837b1ad5dc42c1fcff8b1270e5750b
Author: Matthias Clasen 
Date:   Tue Feb 20 12:18:27 2024 -0500

a11y: Add GtkAccessibleText interface

The AccessibleText interface is meant to be implemented by widgets 
and
other accessible objects that expose selectable, navigatable, or 
rich
text to assistive technologies.

This kind of text is not covered by the plain accessible name and
description, as it contains things like a caret, or text attributes.

This commit adds a stub GtkAccessibleText with its basic virtual

core.git: Branch 'libreoffice-7-6' - sw/source

 sw/source/uibase/dochdl/swdtflvr.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 7f8f7f36ebc2c43f209b49ff093c4eb65948bd86
Author: Michael Weghorn 
AuthorDate: Fri Feb 9 21:02:59 2024 +0100
Commit: Xisco Fauli 
CommitDate: Thu Feb 22 11:21:56 2024 +0100

tdf#158947 sw: Don't unrelatedly overwrite system clipboard on paste

In `SwTransferable::RemoveDDELinkFormat`, only update the
clipboard content with this `SwTransferable` after removing
the `SotClipboardFormatId::LINK` from the supported formats
if the `SwTransferable` was the clipboard content before
already.

Doing so always would unrelatedly overwrite what was previously
copied from another application to the clipboard for the
tdf#158947 scenario of pasting clipboard content of another
application over a selection when using the Qt-based VCL plugins
on Wayland (s. backtrace below that shows how the clipboard content
was overwritten, frame #17 is the method changed in this
commit).

My assumption why the clipboard content is explicitly overwritten
at all is to make sure that the system clipboard on some platforms
gets notified about the change in supported formats/mime
types after removing one. But that isn't necessary when the
transfer data modified here aren't the current clipboard content
in the first place.

Backtrace for how clipboard content was previously overwritten
for the tdf#158947 scenario with the qt6 VCL plugin on Wayland:

~"#0  QtClipboard::handleChanged(QClipboard::Mode) 
(this=0x557f90457770, aMode=QClipboard::Clipboard) at 
.../libreoffice/vcl/qt6/../qt5/QtClipboard.cxx:156
"
~"#1  0x7f26f08844ff in 
QtPrivate::FunctorCall, 
QtPrivate::List, void, void 
(QtClipboard::*)(QClipboard::Mode)>::call(void 
(QtClipboard::*)(QClipboard::Mode), QtClipboard*, 
void**)::{lambda()#1}::operator()() const (__closure=0x7ffe889a2c20) at 
.../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:153
"
~"#2  0x7f26f0884ffb in 
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}&&) 
(args=0x7ffe889a2ed0, fn=...) at 
.../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:72
"
~"#3  0x7f26f088456f in 
QtPrivate::FunctorCall, 
QtPrivate::List, void, void 
(QtClipboard::*)(QClipboard::Mode)>::call(void 
(QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void 
(QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e 
, o=0x557f90457770, 
arg=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:152
"
~"#4  0x7f26f08833de in QtPrivate::FunctionPointer::call, 
void>(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void 
(QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e 
, o=0x557f90457770, 
arg=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:200
"
~"#5  0x7f26f0881f71 in QtPrivate::QCallableObject, 
void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) 
(which=1, this_=0x557f904555f0, r=0x557f90457770, a=0x7ffe889a2ed0, ret=0x0) at 
.../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:571
"
~"#6  0x7f26efdb863f in QtPrivate::QSlotObjectBase::call(QObject*, 
void**) (this=0x557f904555f0, r=0x557f90457770, a=0x7ffe889a2ed0) at 
.../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:487
"
~"#7  0x7f26efe5772e in doActivate(QObject*, int, void**) 
(sender=0x557f8d510fd0, signal_index=3, argv=0x7ffe889a2ed0) at 
.../qt5/qtbase/src/corelib/kernel/qobject.cpp:4116
"
~"#8  0x7f26efe4cdef in QMetaObject::activate(QObject*, QMetaObject 
const*, int, void**) (sender=0x557f8d510fd0, m=0x7f26efa47cc0 
, local_signal_index=0, argv=0x7ffe889a2ed0) at 
.../qt5/qtbase/src/corelib/kernel/qobject.cpp:4176
"
~"#9  0x7f26eede9fcc in QClipboard::changed(QClipboard::Mode) 
(this=0x557f8d510fd0, _t1=QClipboard::Clipboard) at 
.../qt5/qtbase/src/gui/Gui_autogen/include/moc_qclipboard.cpp:182
"
~"#10 0x7f26eede9bc1 in QClipboard::emitChanged(QClipboard::Mode) 
(this=0x557f8d510fd0, mode=QClipboard::Clipboard) at 
.../qt5/qtbase/src/gui/kernel/qclipboard.cpp:558
"
~"#11 0x7f26eee4ed69 in 
QPlatformClipboard::emitChanged(QClipboard::Mode) (this=0x557f88019c20, 
mode=QClipboard::Clipboard) at 
.../qt5/qtbase/src/gui/kernel/qplatformclipboard.cpp:89
"
~"#12 0x7f26ed78809e in 
QtWaylandClient::QWaylandClipboard::setMimeData(QMimeData*, QClipboard::Mode) 
(this=0x557f88019c20, data=0x557f8fb87930, mode=QClipboard::Clipboard) at 

core.git: vcl/source

 vcl/source/window/builder.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 6a4b9bf503204b5770ad314eae0bfed18c5d84c7
Author: Michael Weghorn 
AuthorDate: Sat Feb 17 23:42:55 2024 +0100
Commit: Michael Weghorn 
CommitDate: Sun Feb 18 10:28:58 2024 +0100

tdf#130857 VclBuilder: Use VclPtr instead of raw vcl::Window*

`VclBuilder::handleObject` returns a `VclPtr`.
Use the same for the local variable `pCurrentChild` that the
return value of the former is assigned to.

There's no reason to use a raw pointer here and explicitly calling
`VclPtr::get()` also makes it harder to reuse/share
the existing code for an upcoming `QtBuilder`, s. Omkar's comment
in his pending Gerrit change [1].

While at it, also move the declaration of `pCurrentChild` closer
to its first use.

[1] 
https://gerrit.libreoffice.org/c/core/+/163103/comments/f37a6add_b0f00eb1

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

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index ff20cd07be2b..28d789f64b8f 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2799,8 +2799,6 @@ void VclBuilder::tweakInsertedChild(vcl::Window *pParent, 
vcl::Window* pCurrentC
 
 void VclBuilder::handleChild(vcl::Window *pParent, stringmap* pAtkProps, 
xmlreader::XmlReader )
 {
-vcl::Window *pCurrentChild = nullptr;
-
 xmlreader::Span name;
 int nsId;
 OString sType, sInternalChild;
@@ -2825,6 +2823,7 @@ void VclBuilder::handleChild(vcl::Window *pParent, 
stringmap* pAtkProps, xmlread
 return;
 }
 
+VclPtr pCurrentChild;
 int nLevel = 1;
 while(true)
 {
@@ -2835,7 +2834,7 @@ void VclBuilder::handleChild(vcl::Window *pParent, 
stringmap* pAtkProps, xmlread
 {
 if (name == "object" || name == "placeholder")
 {
-pCurrentChild = handleObject(pParent, pAtkProps, reader).get();
+pCurrentChild = handleObject(pParent, pAtkProps, reader);
 
 bool bObjectInserted = pCurrentChild && pParent != 
pCurrentChild;
 if (bObjectInserted)


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

 sw/source/uibase/docvw/SidebarWinAcc.cxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit cc88d26c8ebcf1dd828469eead40d7747f2b9129
Author: Michael Weghorn 
AuthorDate: Wed Feb 14 15:57:54 2024 +0100
Commit: Xisco Fauli 
CommitDate: Fri Feb 16 11:08:56 2024 +0100

tdf#92389 sw a11y: Use SolarMutex in SidebarWinAccessibleContext

Hold the SolarMutex instead of of using a custom mutex,
since `SwAccessibleMap` methods that get called require
the SolarMutex to be held.

Fixes a crash/assert when interacting with Writer comments
using the mouse while the Orca screen reader is running
when using the qt6 VCL plugin.

Backtrace:

Thread 1 received signal SIGABRT, Aborted.
__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  0x7f0a462a81cf in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7f0a4625a472 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x7f0a462444b2 in __GI_abort () at ./stdlib/abort.c:79
#4  0x7f0a462443d5 in __assert_fail_base
(fmt=0x7f0a463b8dc8 "%s%s%s:%u: %s%sAssertion `%s' failed.
%n", assertion=assertion@entry=0x7f0a3d775838 
"ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && \"SolarMutex 
not owned!\"", file=file@entry=0x7f0a3d7757f0 
".../libreoffice/vcl/source/app/dbggui.cxx", line=line@entry=35, 
function=function@entry=0x7f0a3d7757cc "void ImplDbgTestSolarMutex()") at 
./assert/assert.c:92
#5  0x7f0a462533a2 in __assert_fail
(assertion=0x7f0a3d775838 
"ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && \"SolarMutex 
not owned!\"", file=0x7f0a3d7757f0 ".../libreoffice/vcl/source/app/dbggui.cxx", 
line=35, function=0x7f0a3d7757cc "void ImplDbgTestSolarMutex()") at 
./assert/assert.c:101
#6  0x7f0a3ca733b4 in ImplDbgTestSolarMutex() () at 
.../libreoffice/vcl/source/app/dbggui.cxx:35
#7  0x7f0a452ccfbb in DbgTestSolarMutex() () at 
.../libreoffice/tools/source/debug/debug.cxx:54
#8  0x7f09f8fd3903 in SwAccessibleMap::GetContext(SwFrame const*, 
bool) (this=0x55fa8fd89930, pFrame=0x55fa8ecddb00, bCreate=false) at 
.../libreoffice/sw/source/core/access/accmap.cxx:1777
#9  0x7f09f906f684 in sw::sidebarwindows::(anonymous 
namespace)::SidebarWinAccessibleContext::getAccessibleParent() 
(this=0x55fa8f83e600) at 
.../libreoffice/sw/source/uibase/docvw/SidebarWinAcc.cxx:65
#10 0x7f0a31e6244c in QtAccessibleWidget::parent() const 
(this=0x7f0a280b6150) at 
.../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:322
#11 0x7f0a3095b51a in 
AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, 
QDBusMessage const&, QDBusConnection const&) (this=0x55fa884876c0, 
interface=0x7f0a280b6150, function=..., message=..., connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1592
#12 0x7f0a30959934 in AtSpiAdaptor::handleMessage(QDBusMessage 
const&, QDBusConnection const&) (this=0x55fa884876c0, message=..., 
connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1460
#13 0x7f0a2ee88ad3 in 
QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, 
QDBusMessage const&, int) (this=0x7f0a28010b60, node=..., msg=..., 
pathStartPos=27)
at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
#14 0x7f0a2ee897b8 in 
QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f0a280b8400) at 
.../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
#15 0x7f0a31445095 in QObject::event(QEvent*) (this=0x55fa884876c0, 
e=0x7f0a280b8400) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447
#16 0x7f0a2f5a696c in QApplicationPrivate::notify_helper(QObject*, 
QEvent*) (this=0x55fa872f63e0, receiver=0x55fa884876c0, e=0x7f0a280b8400) at 
.../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298
#17 0x7f0a2f5a677d in QApplication::notify(QObject*, QEvent*) 
(this=0x55fa873956b0, receiver=0x55fa884876c0, e=0x7f0a280b8400) at 
.../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3249
#18 0x7f0a313b1162 in QCoreApplication::notifyInternal2(QObject*, 
QEvent*) (receiver=0x55fa884876c0, event=0x7f0a280b8400) at 
.../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1138
#19 0x7f0a313b1d0b in QCoreApplication::sendEvent(QObject*, 
QEvent*) (receiver=0x55fa884876c0, event=0x7f0a280b8400) at 
.../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1581
#20 0x7f0a313b33c4 in 

core.git: sw/source

 sw/source/uibase/docvw/SidebarWinAcc.cxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 512b09ec51cfbe9bb0ce1a7f229b443dc427f6f3
Author: Michael Weghorn 
AuthorDate: Wed Feb 14 15:57:54 2024 +0100
Commit: Michael Weghorn 
CommitDate: Fri Feb 16 09:10:54 2024 +0100

tdf#92389 sw a11y: Use SolarMutex in SidebarWinAccessibleContext

Hold the SolarMutex instead of of using a custom mutex,
since `SwAccessibleMap` methods that get called require
the SolarMutex to be held.

Fixes a crash/assert when interacting with Writer comments
using the mouse while the Orca screen reader is running
when using the qt6 VCL plugin.

Backtrace:

Thread 1 received signal SIGABRT, Aborted.
__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  0x7f0a462a81cf in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7f0a4625a472 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x7f0a462444b2 in __GI_abort () at ./stdlib/abort.c:79
#4  0x7f0a462443d5 in __assert_fail_base
(fmt=0x7f0a463b8dc8 "%s%s%s:%u: %s%sAssertion `%s' failed.
%n", assertion=assertion@entry=0x7f0a3d775838 
"ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && \"SolarMutex 
not owned!\"", file=file@entry=0x7f0a3d7757f0 
".../libreoffice/vcl/source/app/dbggui.cxx", line=line@entry=35, 
function=function@entry=0x7f0a3d7757cc "void ImplDbgTestSolarMutex()") at 
./assert/assert.c:92
#5  0x7f0a462533a2 in __assert_fail
(assertion=0x7f0a3d775838 
"ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && \"SolarMutex 
not owned!\"", file=0x7f0a3d7757f0 ".../libreoffice/vcl/source/app/dbggui.cxx", 
line=35, function=0x7f0a3d7757cc "void ImplDbgTestSolarMutex()") at 
./assert/assert.c:101
#6  0x7f0a3ca733b4 in ImplDbgTestSolarMutex() () at 
.../libreoffice/vcl/source/app/dbggui.cxx:35
#7  0x7f0a452ccfbb in DbgTestSolarMutex() () at 
.../libreoffice/tools/source/debug/debug.cxx:54
#8  0x7f09f8fd3903 in SwAccessibleMap::GetContext(SwFrame const*, 
bool) (this=0x55fa8fd89930, pFrame=0x55fa8ecddb00, bCreate=false) at 
.../libreoffice/sw/source/core/access/accmap.cxx:1777
#9  0x7f09f906f684 in sw::sidebarwindows::(anonymous 
namespace)::SidebarWinAccessibleContext::getAccessibleParent() 
(this=0x55fa8f83e600) at 
.../libreoffice/sw/source/uibase/docvw/SidebarWinAcc.cxx:65
#10 0x7f0a31e6244c in QtAccessibleWidget::parent() const 
(this=0x7f0a280b6150) at 
.../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:322
#11 0x7f0a3095b51a in 
AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, 
QDBusMessage const&, QDBusConnection const&) (this=0x55fa884876c0, 
interface=0x7f0a280b6150, function=..., message=..., connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1592
#12 0x7f0a30959934 in AtSpiAdaptor::handleMessage(QDBusMessage 
const&, QDBusConnection const&) (this=0x55fa884876c0, message=..., 
connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1460
#13 0x7f0a2ee88ad3 in 
QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, 
QDBusMessage const&, int) (this=0x7f0a28010b60, node=..., msg=..., 
pathStartPos=27)
at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
#14 0x7f0a2ee897b8 in 
QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f0a280b8400) at 
.../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
#15 0x7f0a31445095 in QObject::event(QEvent*) (this=0x55fa884876c0, 
e=0x7f0a280b8400) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447
#16 0x7f0a2f5a696c in QApplicationPrivate::notify_helper(QObject*, 
QEvent*) (this=0x55fa872f63e0, receiver=0x55fa884876c0, e=0x7f0a280b8400) at 
.../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298
#17 0x7f0a2f5a677d in QApplication::notify(QObject*, QEvent*) 
(this=0x55fa873956b0, receiver=0x55fa884876c0, e=0x7f0a280b8400) at 
.../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3249
#18 0x7f0a313b1162 in QCoreApplication::notifyInternal2(QObject*, 
QEvent*) (receiver=0x55fa884876c0, event=0x7f0a280b8400) at 
.../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1138
#19 0x7f0a313b1d0b in QCoreApplication::sendEvent(QObject*, 
QEvent*) (receiver=0x55fa884876c0, event=0x7f0a280b8400) at 
.../qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1581
#20 0x7f0a313b33c4 in 

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

 accessibility/source/standard/vclxaccessiblebox.cxx |3 ++-
 svx/source/accessibility/AccessibleTextHelper.cxx   |   15 +--
 2 files changed, 7 insertions(+), 11 deletions(-)

New commits:
commit 0b3158e64e70a53528155eee38c2ea0ba1d3bf93
Author: Michael Weghorn 
AuthorDate: Thu Feb 15 10:14:51 2024 +0100
Commit: Michael Weghorn 
CommitDate: Fri Feb 16 09:10:19 2024 +0100

svx a11y: Drop AccessibleTextHelper_Impl::GotPropertyEvent

Use `AccessibleTextHelper_Impl::FireEvent` directly instead,
which is in my opinion more readable, in particular since
2 of the 3 uses were sending an `AccessibleEventId::CHILD`
event, which is not really about any property.

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

diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx 
b/svx/source/accessibility/AccessibleTextHelper.cxx
index e87232a4f6df..8dddb606876d 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -159,9 +159,6 @@ namespace accessibility
 // Process event queue
 void ProcessQueue();
 
-// syntactic sugar for FireEvent
-void GotPropertyEvent( const uno::Any& rNewValue, const sal_Int16 
nEventId ) const { FireEvent( nEventId, rNewValue ); }
-
 // shutdown usage of current edit source on myself and the children.
 void ShutdownEditSource();
 
@@ -407,7 +404,7 @@ namespace accessibility
 {
 AccessibleCell* pAccessibleCell = dynamic_cast< 
AccessibleCell* > ( mxFrontEnd.get() );
 if ( !pAccessibleCell )
-GotPropertyEvent( uno::Any(AccessibleStateType::FOCUSED), 
AccessibleEventId::STATE_CHANGED );
+FireEvent(AccessibleEventId::STATE_CHANGED, 
uno::Any(AccessibleStateType::FOCUSED));
 else// the focus event on cell should be fired on table 
directly
 {
 AccessibleTableShape* pAccTable = 
pAccessibleCell->GetParentTable();
@@ -768,9 +765,8 @@ namespace accessibility
 // child not yet created?
 if (!maParaManager.HasCreatedChild(nCurrPara))
 {
-GotPropertyEvent( uno::Any( maParaManager.CreateChild( 
nCurrPara - mnFirstVisibleChild,
-   
mxFrontEnd, GetEditSource(), nCurrPara ).first ),
-  AccessibleEventId::CHILD );
+FireEvent(AccessibleEventId::CHILD, 
uno::Any(maParaManager.CreateChild(nCurrPara - mnFirstVisibleChild,
+   
mxFrontEnd, GetEditSource(), nCurrPara).first));
 }
 }
 }
@@ -1054,9 +1050,8 @@ namespace accessibility
 // #109864# Enforce creation of this paragraph
 try
 {
-GotPropertyEvent( uno::Any( getAccessibleChild( 
aFunctor.GetParaIndex() -
-
mnFirstVisibleChild + GetStartIndex() ) ),
-  AccessibleEventId::CHILD );
+FireEvent(AccessibleEventId::CHILD, 
uno::Any(getAccessibleChild(aFunctor.GetParaIndex() -
+   
 mnFirstVisibleChild + GetStartIndex(;
 }
 catch( const uno::Exception& )
 {
commit 694670e13143f41e211dd0e183516d08008dd12b
Author: Michael Weghorn 
AuthorDate: Thu Feb 15 09:43:54 2024 +0100
Commit: Michael Weghorn 
CommitDate: Fri Feb 16 09:10:10 2024 +0100

tdf#159213 a11y: Only send child event if there's a child

When reviewing all the places sending an `AccessibleEventId::CHILD`
event as described in tdf#159213 comment 8, this here looks
like one where the child might not be set.
Add a corresponding check to avoid sending an invalid event.

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

diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx 
b/accessibility/source/standard/vclxaccessiblebox.cxx
index 84855ca096cf..93e49f90c285 100644
--- a/accessibility/source/standard/vclxaccessiblebox.cxx
+++ b/accessibility/source/standard/vclxaccessiblebox.cxx
@@ -70,7 +70,8 @@ void VCLXAccessibleBox::ProcessWindowChildEvent( const 
VclWindowEvent& rVclWindo
 if (m_aBoxType==COMBOBOX)
 {
 VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
-if (pComboBox 

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

 accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx |1 
 accessibility/source/standard/vclxaccessiblebox.cxx   |   35 ++
 svtools/source/brwbox/brwbox1.cxx |   58 
+-
 svtools/source/brwbox/editbrowsebox.cxx   |7 -
 4 files changed, 50 insertions(+), 51 deletions(-)

New commits:
commit 9572354fedf3d521c8fe123c402ccab20b824815
Author: Michael Weghorn 
AuthorDate: Thu Feb 15 09:41:55 2024 +0100
Commit: Michael Weghorn 
CommitDate: Fri Feb 16 09:10:01 2024 +0100

a11y: Drop extra nesting level

These checks can all be done in a single if condition
rather than having two nested ones.

(Use `git show -w` to ignore whitespace change.)

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

diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx 
b/accessibility/source/standard/vclxaccessiblebox.cxx
index cbc68fb2d19a..84855ca096cf 100644
--- a/accessibility/source/standard/vclxaccessiblebox.cxx
+++ b/accessibility/source/standard/vclxaccessiblebox.cxx
@@ -70,26 +70,25 @@ void VCLXAccessibleBox::ProcessWindowChildEvent( const 
VclWindowEvent& rVclWindo
 if (m_aBoxType==COMBOBOX)
 {
 VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
-if ( ( pComboBox != nullptr ) && ( pChildWindow != nullptr ) )
-if (pChildWindow == pComboBox->GetSubEdit())
+if (pComboBox && pChildWindow && pChildWindow == 
pComboBox->GetSubEdit())
+{
+if (rVclWindowEvent.GetId() == VclEventId::WindowShow)
+{
+// Instantiate text field.
+getAccessibleChild (0);
+aNewValue <<= m_xText;
+}
+else
 {
-if (rVclWindowEvent.GetId() == VclEventId::WindowShow)
-{
-// Instantiate text field.
-getAccessibleChild (0);
-aNewValue <<= m_xText;
-}
-else
-{
-// Release text field.
-aOldValue <<= m_xText;
-m_xText = nullptr;
-}
-// Tell the listeners about the new/removed child.
-NotifyAccessibleEvent (
-AccessibleEventId::CHILD,
-aOldValue, aNewValue);
+// Release text field.
+aOldValue <<= m_xText;
+m_xText = nullptr;
 }
+// Tell the listeners about the new/removed child.
+NotifyAccessibleEvent (
+AccessibleEventId::CHILD,
+aOldValue, aNewValue);
+}
 
 }
 }
commit 9b3b747e164c4eab056f65bb29baa04ab1770bb2
Author: Michael Weghorn 
AuthorDate: Thu Feb 15 09:29:56 2024 +0100
Commit: Michael Weghorn 
CommitDate: Fri Feb 16 09:09:52 2024 +0100

a11y: Drop 'using namespace 
com::sun::star::accessibility::AccessibleEventId"

This e.g. makes it easier to grep where a certain
kind of event is sent.

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

diff --git a/accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx 
b/accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx
index f5d47b0a30f8..fa91719e78d5 100644
--- a/accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx
@@ -27,7 +27,6 @@ namespace accessibility
 {
 using namespace com::sun::star::accessibility;
 using namespace com::sun::star::uno;
-using namespace com::sun::star::accessibility::AccessibleEventId;
 
 AccessibleCheckBoxCell::AccessibleCheckBoxCell(const Reference& _rxParent,
 vcl::IAccessibleTableProvider& _rBrowseBox,
diff --git a/svtools/source/brwbox/brwbox1.cxx 
b/svtools/source/brwbox/brwbox1.cxx
index cc78b514f7a6..ce32f324bd42 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -40,9 +40,9 @@
 
 #define SCROLL_FLAGS (ScrollFlags::Clip | ScrollFlags::NoChildren)
 
-using namespace com::sun::star::accessibility::AccessibleEventId;
 using namespace com::sun::star::accessibility::AccessibleTableModelChangeType;
 using com::sun::star::accessibility::AccessibleTableModelChange;
+using namespace 

core.git: vcl/qt5

 vcl/qt5/QtTransferable.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 8d98f231fa2d3f4386a842d0f45a9ceeea4ab8e1
Author: Michael Weghorn 
AuthorDate: Thu Feb 15 08:52:25 2024 +0100
Commit: Michael Weghorn 
CommitDate: Fri Feb 16 09:09:28 2024 +0100

tdf#156562 qt: Don't crash on null clipboard content

Since

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

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

, mime data are updated from the system clipboard when there's
a mismatch.

Quoting Stephan Bergmann's [1]:

> PS2, Line 174: setMimeData(pCurrentClipboardData);
> At least for my Qt6-based Emscripten build, `pCurrentClipboardData`
> can be null here, so setting `QtTransferable::m_pMimeData` to null here,
> and a later call to `QtTransferable::getTransferDataFlavors` will
> call `m_pMimeData->formats()` and crash.

Add a corresponding null check.

From what I can see, other methods shouldn't need an explicit check,
as they use the result of `QtTransferable::getTransferData`
(e.g. `QtTransferable::getTransferData` returns early if
`QtTransferable::isDataFlavorSupported` returns false, which in
turn calls `QtTransferable::getTransferData` that now has this
null check).

[1] https://gerrit.libreoffice.org/c/core/+/163304/comment/8872708d_1abdef81

Change-Id: Ibec756c2b073b1e19a3b4761e57c35576b44adc3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163423
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/qt5/QtTransferable.cxx b/vcl/qt5/QtTransferable.cxx
index 41c2c58392ef..18c2583e2e63 100644
--- a/vcl/qt5/QtTransferable.cxx
+++ b/vcl/qt5/QtTransferable.cxx
@@ -50,6 +50,9 @@ QtTransferable::QtTransferable(const QMimeData* pMimeData)
 
 css::uno::Sequence SAL_CALL 
QtTransferable::getTransferDataFlavors()
 {
+if (!m_pMimeData)
+return css::uno::Sequence();
+
 QStringList aFormatList(m_pMimeData->formats());
 // we might add the UTF-16 mime text variant later
 const int nMimeTypeSeqSize = aFormatList.size() + 1;


core.git: Branch 'libreoffice-24-2' - scp2/InstallScript_setup_osl.mk scp2/Module_scp2.mk

 scp2/InstallScript_setup_osl.mk |2 +-
 scp2/Module_scp2.mk |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8bd9f9fb1e31740eee922e6832030ef8d404e61c
Author: Michael Weghorn 
AuthorDate: Tue Feb 13 16:25:35 2024 +0100
Commit: Caolán McNamara 
CommitDate: Thu Feb 15 18:33:28 2024 +0100

scp2: Take ENABLE_{KF,QT}6 into account

The qt6 and kf6 VCL plugins are also part
of the kde install set, so take
`ENABLE_QT6` and `ENABLE_KF6` into
account when deciding whether to install
it.

This makes packaging these VCL plugins work
when building with `--enable-qt6` and/or
`--enable-kf6`, but without `--enable-qt5`
and `--enable-kf5`.

Command that can be used for testing:

make DESTDIR=/tmp/dummy distro-pack-install -o build -o check

(Then, check whether the "installation" in /tmp/dummy
contains the VCL plugins as expected.)

Thanks to Andreas Sturmlechner for reporting
the issue on IRC #libreoffice-dev on 2024-02-12.

Change-Id: Ieea67468e3388f8b7b66f53221574c6225516b44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163313
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit b57013086fa71f398ade34154f2f46b7ac6a79a9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163341
Reviewed-by: Caolán McNamara 

diff --git a/scp2/InstallScript_setup_osl.mk b/scp2/InstallScript_setup_osl.mk
index 6f7b58204225..cf69165c1b60 100644
--- a/scp2/InstallScript_setup_osl.mk
+++ b/scp2/InstallScript_setup_osl.mk
@@ -36,7 +36,7 @@ $(eval $(call gb_InstallScript_use_modules,setup_osl,\
$(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GIO) $(ENABLE_GTK3)),\
scp2/gnome \
) \
-   $(if $(filter TRUE,$(ENABLE_QT5) $(ENABLE_KF5) $(ENABLE_GTK3_KDE5)),\
+   $(if $(filter TRUE,$(ENABLE_QT5) $(ENABLE_QT6) $(ENABLE_KF5) 
$(ENABLE_KF6) $(ENABLE_GTK3_KDE5)),\
scp2/kde \
) \
$(if $(filter TRUE,$(ENABLE_ONLINE_UPDATE)),\
diff --git a/scp2/Module_scp2.mk b/scp2/Module_scp2.mk
index 25ae8167df56..651413fa2c17 100644
--- a/scp2/Module_scp2.mk
+++ b/scp2/Module_scp2.mk
@@ -40,7 +40,7 @@ $(eval $(call gb_Module_add_targets,scp2,\
$(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GIO) $(ENABLE_GTK3)),\
InstallModule_gnome \
) \
-   $(if $(filter TRUE,$(ENABLE_QT5) $(ENABLE_KF5) $(ENABLE_GTK3_KDE5)),\
+   $(if $(filter TRUE,$(ENABLE_QT5) $(ENABLE_QT6) $(ENABLE_KF5) 
$(ENABLE_KF6) $(ENABLE_GTK3_KDE5)),\
InstallModule_kde \
) \
 ))


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

 vcl/qt5/QtFrame.cxx |   14 ++
 1 file changed, 14 insertions(+)

New commits:
commit eb9db0cd2f25a20e0efd756af3e34d4fb09b8e39
Author: Michael Weghorn 
AuthorDate: Mon Feb 12 14:09:45 2024 +0100
Commit: Caolán McNamara 
CommitDate: Thu Feb 15 18:33:04 2024 +0100

tdf#125934 qt: Support module-specific window icons on Wayland

As discussed in QTBUG-77182 [1], Qt currently doesn't provide
API to directly set the app_id for a single window/toplevel on Wayland,
but the one set for the application is used when the window gets shown.

Make use of that by temporarily setting the app's desktop file
name and doing a hide/show cycle in `QtFrame::SetIcon` on
Wayland.

A big thanks for David Redondo for mentioning that possibility
in QTBUG-77182!

An alternative would be to use private Qt API and low-level wayland API to
set the app_id directly, s. discussion in QTBUG-77182.

[1] https://bugreports.qt.io/browse/QTBUG-77182

Change-Id: I2a93cd39756e2ebf55b91486927d73d3896245b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163249
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 413138c9178d4def463c4844297832b75dcea689)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163273
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index 24dcb5ff6f61..6aff814aacd2 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -376,6 +376,20 @@ void QtFrame::SetIcon(sal_uInt16 nIcon)
 
 QIcon aIcon = QIcon::fromTheme(appicon);
 m_pQWidget->window()->setWindowIcon(aIcon);
+
+if (QGuiApplication::platformName() == "wayland" && 
m_pQWidget->window()->isVisible())
+{
+// Qt currently doesn't provide API to directly set the app_id for a 
single
+// window/toplevel on Wayland, but the one set for the application is 
picked up
+// on hide/show, so do that.
+// An alternative would be to use private Qt API and low-level wayland 
API to set the
+// app_id directly, s. discussion in QTBUG-77182.
+const QString sOrigDesktopFileName = 
QGuiApplication::desktopFileName();
+QGuiApplication::setDesktopFileName(appicon);
+m_pQWidget->window()->hide();
+m_pQWidget->window()->show();
+QGuiApplication::setDesktopFileName(sOrigDesktopFileName);
+}
 }
 
 void QtFrame::SetMenu(SalMenu*) {}


core.git: vcl/qt5

 vcl/qt5/QtInstance.cxx |   16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 9e40fc8c9458b937200ea56c96b89113c74b67f5
Author: Michael Weghorn 
AuthorDate: Wed Feb 14 10:54:59 2024 +0100
Commit: Michael Weghorn 
CommitDate: Thu Feb 15 08:08:05 2024 +0100

tdf#130857 qt weld: Set msg dialog parent

If a parent is passed to `QtInstance::CreateMessageDialog`,
also set a parent for the `QMessageBox` that gets created
there:

If the passed parent is a native Qt one, use that one.
Otherwise, fall back to using the current active top-level
window, which is what usually makes most sense and is better
than having no parent at all.

With this change in place, the message dialog shown
when doing

1) start Writer
2) "File" -> "Properties" -> "Security" -> "Protect"
3) type 2 different passwords and confirm

is now modal and centered on top of the "Enter Password"
dialog on KDE Plasma Wayland when using the qt6 VCL plugin,
while it used to open at the top left of the screen and was
non-modal before.

The new behavior is in line with how it behaves for the
SAL_VCL_QT_NO_WELDED_WIDGETS=1 case.

Change-Id: Ibe95c2f0407edeba0fd9f76744bc087be7df6437
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163362
Tested-by: Jenkins
Reviewed-by: Omkar Acharekar  
Reviewed-by: Michael Weghorn 

diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index f2f8caa6b86a..6b3bd0cc301a 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -792,7 +792,21 @@ weld::MessageDialog* 
QtInstance::CreateMessageDialog(weld::Widget* pParent,
 }
 else
 {
-QMessageBox* pMessageBox = new QMessageBox();
+QWidget* pQtParent = nullptr;
+if (pParent)
+{
+if (QtInstanceWidget* pQtInstanceWidget = 
dynamic_cast(pParent))
+{
+pQtParent = pQtInstanceWidget->getQWidget();
+}
+else
+{
+// the parent is not welded/not a native Qt widget; fall back 
to currently active window
+pQtParent = QApplication::activeWindow();
+}
+}
+
+QMessageBox* pMessageBox = new QMessageBox(pQtParent);
 pMessageBox->setText(toQString(rPrimaryMessage));
 pMessageBox->setIcon(vclMessageTypeToQtIcon(eMessageType));
 pMessageBox->setWindowTitle(vclMessageTypeToQtTitle(eMessageType));


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

 vcl/inc/qt5/QtInstanceContainer.hxx |2 ++
 vcl/inc/qt5/QtInstanceDialog.hxx|2 +-
 vcl/inc/qt5/QtInstanceWidget.hxx|6 ++
 vcl/inc/qt5/QtInstanceWindow.hxx|2 --
 vcl/qt5/QtInstanceContainer.cxx |5 +
 vcl/qt5/QtInstanceDialog.cxx|4 ++--
 vcl/qt5/QtInstanceWidget.cxx|6 ++
 vcl/qt5/QtInstanceWindow.cxx|7 +++
 8 files changed, 25 insertions(+), 9 deletions(-)

New commits:
commit 6712963e231e7ab50a3d11b8a8c75e54e0c79b32
Author: Michael Weghorn 
AuthorDate: Wed Feb 14 10:54:00 2024 +0100
Commit: Michael Weghorn 
CommitDate: Thu Feb 15 08:07:42 2024 +0100

tdf#130857 qt weld: Implement QtInstanceDialog::{g,s}et_modal

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

diff --git a/vcl/inc/qt5/QtInstanceDialog.hxx b/vcl/inc/qt5/QtInstanceDialog.hxx
index 04b45d57a31f..303206be7194 100644
--- a/vcl/inc/qt5/QtInstanceDialog.hxx
+++ b/vcl/inc/qt5/QtInstanceDialog.hxx
@@ -37,7 +37,7 @@ public:
 
 virtual void add_button(const OUString&, int, const OUString& rHelpId = 
{}) override;
 
-virtual void set_modal(bool) override;
+virtual void set_modal(bool bModal) override;
 
 virtual bool get_modal() const override;
 
diff --git a/vcl/qt5/QtInstanceDialog.cxx b/vcl/qt5/QtInstanceDialog.cxx
index e65e4b749e13..cdd75cd9675f 100644
--- a/vcl/qt5/QtInstanceDialog.cxx
+++ b/vcl/qt5/QtInstanceDialog.cxx
@@ -41,9 +41,9 @@ void QtInstanceDialog::response(int) {}
 
 void QtInstanceDialog::add_button(const OUString&, int, const OUString&) {}
 
-void QtInstanceDialog::set_modal(bool) {}
+void QtInstanceDialog::set_modal(bool bModal) { m_pDialog->setModal(bModal); }
 
-bool QtInstanceDialog::get_modal() const { return true; }
+bool QtInstanceDialog::get_modal() const { return m_pDialog->isModal(); }
 
 weld::Button* QtInstanceDialog::weld_widget_for_response(int) { return 
nullptr; }
 
commit 092bcd7133c30c0614056928a16baea44704735e
Author: Michael Weghorn 
AuthorDate: Wed Feb 14 10:32:11 2024 +0100
Commit: Michael Weghorn 
CommitDate: Thu Feb 15 08:07:33 2024 +0100

tdf#130857 qt weld: Move QWidget* member to QtInstanceWidget

Move the `m_pWidget` member from `QtInstanceWindow`
to the base class `QtInstanceWidget` and add a getter
for it.

This allows to get the `QWidget` directly from the
base class, which will be used in an upcoming commit.

Change-Id: I9c41b48936e5a6051afb9721dae2fac5add22e4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163360
Tested-by: Jenkins
Reviewed-by: Omkar Acharekar  
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/QtInstanceContainer.hxx 
b/vcl/inc/qt5/QtInstanceContainer.hxx
index 87a89c48bd46..a0cd31869dc6 100644
--- a/vcl/inc/qt5/QtInstanceContainer.hxx
+++ b/vcl/inc/qt5/QtInstanceContainer.hxx
@@ -14,6 +14,8 @@
 class QtInstanceContainer : public QtInstanceWidget, public virtual 
weld::Container
 {
 public:
+QtInstanceContainer(QWidget* pWidget);
+
 virtual void move(weld::Widget*, weld::Container*) override;
 
 virtual css::uno::Reference CreateChildFrame() override;
diff --git a/vcl/inc/qt5/QtInstanceWidget.hxx b/vcl/inc/qt5/QtInstanceWidget.hxx
index ee0c5b8c451d..f5038ee5ad66 100644
--- a/vcl/inc/qt5/QtInstanceWidget.hxx
+++ b/vcl/inc/qt5/QtInstanceWidget.hxx
@@ -21,7 +21,13 @@
 
 class QtInstanceWidget : public virtual weld::Widget
 {
+QWidget* m_pWidget;
+
 public:
+QtInstanceWidget(QWidget* pWidget);
+
+QWidget* getQWidget() const { return m_pWidget; }
+
 virtual void set_sensitive(bool) override;
 
 virtual bool get_sensitive() const override;
diff --git a/vcl/inc/qt5/QtInstanceWindow.hxx b/vcl/inc/qt5/QtInstanceWindow.hxx
index c29863da4f67..db80a6e71458 100644
--- a/vcl/inc/qt5/QtInstanceWindow.hxx
+++ b/vcl/inc/qt5/QtInstanceWindow.hxx
@@ -13,8 +13,6 @@
 
 class QtInstanceWindow : public QtInstanceContainer, public virtual 
weld::Window
 {
-QWidget* m_pWidget;
-
 public:
 QtInstanceWindow(QWidget* pWidget);
 
diff --git a/vcl/qt5/QtInstanceContainer.cxx b/vcl/qt5/QtInstanceContainer.cxx
index e22b1afb2a55..35f0a4bbaa69 100644
--- a/vcl/qt5/QtInstanceContainer.cxx
+++ b/vcl/qt5/QtInstanceContainer.cxx
@@ -9,6 +9,11 @@
 
 #include 
 
+QtInstanceContainer::QtInstanceContainer(QWidget* pWidget)
+: QtInstanceWidget(pWidget)
+{
+}
+
 void QtInstanceContainer::move(weld::Widget*, weld::Container*) {}
 
 css::uno::Reference QtInstanceContainer::CreateChildFrame()
diff --git a/vcl/qt5/QtInstanceWidget.cxx b/vcl/qt5/QtInstanceWidget.cxx
index cbccac8799db..9c17ebe6cb1d 100644
--- a/vcl/qt5/QtInstanceWidget.cxx
+++ b/vcl/qt5/QtInstanceWidget.cxx
@@ -9,6 +9,12 @@
 
 #include 
 
+QtInstanceWidget::QtInstanceWidget(QWidget* pWidget)
+: m_pWidget(pWidget)
+{
+assert(pWidget);
+}
+
 void QtInstanceWidget::set_sensitive(bool) {}
 
 

core.git: scp2/InstallScript_setup_osl.mk scp2/Module_scp2.mk

 scp2/InstallScript_setup_osl.mk |2 +-
 scp2/Module_scp2.mk |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ec69b448f4b6296edb6b28ced5ecb710be82438b
Author: Michael Weghorn 
AuthorDate: Tue Feb 13 16:25:35 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Feb 14 09:42:53 2024 +0100

scp2: Take ENABLE_{KF,QT}6 into account

The qt6 and kf6 VCL plugins are also part
of the kde install set, so take
`ENABLE_QT6` and `ENABLE_KF6` into
account when deciding whether to install
it.

This makes packaging these VCL plugins work
when building with `--enable-qt6` and/or
`--enable-kf6`, but without `--enable-qt5`
and `--enable-kf5`.

Command that can be used for testing:

make DESTDIR=/tmp/dummy distro-pack-install -o build -o check

(Then, check whether the "installation" in /tmp/dummy
contains the VCL plugins as expected.)

Thanks to Andreas Sturmlechner for reporting
the issue on IRC #libreoffice-dev on 2024-02-12.

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

diff --git a/scp2/InstallScript_setup_osl.mk b/scp2/InstallScript_setup_osl.mk
index 6f7b58204225..cf69165c1b60 100644
--- a/scp2/InstallScript_setup_osl.mk
+++ b/scp2/InstallScript_setup_osl.mk
@@ -36,7 +36,7 @@ $(eval $(call gb_InstallScript_use_modules,setup_osl,\
$(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GIO) $(ENABLE_GTK3)),\
scp2/gnome \
) \
-   $(if $(filter TRUE,$(ENABLE_QT5) $(ENABLE_KF5) $(ENABLE_GTK3_KDE5)),\
+   $(if $(filter TRUE,$(ENABLE_QT5) $(ENABLE_QT6) $(ENABLE_KF5) 
$(ENABLE_KF6) $(ENABLE_GTK3_KDE5)),\
scp2/kde \
) \
$(if $(filter TRUE,$(ENABLE_ONLINE_UPDATE)),\
diff --git a/scp2/Module_scp2.mk b/scp2/Module_scp2.mk
index 25ae8167df56..651413fa2c17 100644
--- a/scp2/Module_scp2.mk
+++ b/scp2/Module_scp2.mk
@@ -40,7 +40,7 @@ $(eval $(call gb_Module_add_targets,scp2,\
$(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GIO) $(ENABLE_GTK3)),\
InstallModule_gnome \
) \
-   $(if $(filter TRUE,$(ENABLE_QT5) $(ENABLE_KF5) $(ENABLE_GTK3_KDE5)),\
+   $(if $(filter TRUE,$(ENABLE_QT5) $(ENABLE_QT6) $(ENABLE_KF5) 
$(ENABLE_KF6) $(ENABLE_GTK3_KDE5)),\
InstallModule_kde \
) \
 ))


core.git: Branch 'libreoffice-24-2' - configure.ac

 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9de87f990e6d9e48495bd6970a25eb1823d5b2ef
Author: Michael Weghorn 
AuthorDate: Mon Feb 12 10:38:03 2024 +0100
Commit: Taichi Haradaguchi <20001...@ymail.ne.jp>
CommitDate: Tue Feb 13 23:09:01 2024 +0100

kf6: Add missing include path to fix build

Many thanks to Andreas Sturmlechner for pointing
this out on #libreoffice-dev on 2024-02-12:

> [10:27]  michaelweghorn: I also had to apply a trivial
>  openmandriva patch to get it to build in the first place,
>  
https://github.com/gentoo/gentoo/blob/master/app-office/libreoffice/files/libreoffice-24.2-kf6-buildfix.patch

Change-Id: If86220e258336d84ffc30fd5da0f5d99dda59aff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163237
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 30ec42fad4c0c61de93bea23e9f7d98acc6db0e6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163272
Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>

diff --git a/configure.ac b/configure.ac
index a5d9287e0808..b7042e9ee312 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13493,7 +13493,7 @@ then
 AC_MSG_ERROR([KF6 libraries not found.  Please specify the root of 
your KF6 installation by exporting KF6DIR before running "configure".])
 fi
 
-KF6_CFLAGS="-I$kf6_incdir -I$kf6_incdir/KCoreAddons -I$kf6_incdir/KI18n 
-I$kf6_incdir/KConfigCore -I$kf6_incdir/KWindowSystem -I$kf6_incdir/KIO 
-I$kf6_incdir/KIOCore -I$kf6_incdir/KIOWidgets -I$kf6_incdir/KIOFileWidgets 
-I$qt6_incdir -I$qt6_incdir/QtCore -I$qt6_incdir/QtGui -I$qt6_incdir/QtWidgets 
-I$qt6_incdir/QtNetwork -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT 
-DQT_NO_VERSION_TAGGING"
+KF6_CFLAGS="-I$kf6_incdir -I$kf6_incdir/KCoreAddons -I$kf6_incdir/KI18n 
-I$kf6_incdir/KConfig -I$kf6_incdir/KConfigCore -I$kf6_incdir/KWindowSystem 
-I$kf6_incdir/KIO -I$kf6_incdir/KIOCore -I$kf6_incdir/KIOWidgets 
-I$kf6_incdir/KIOFileWidgets -I$qt6_incdir -I$qt6_incdir/QtCore 
-I$qt6_incdir/QtGui -I$qt6_incdir/QtWidgets -I$qt6_incdir/QtNetwork 
-DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -DQT_NO_VERSION_TAGGING"
 KF6_LIBS="-L$kf6_libdir -lKF6CoreAddons -lKF6I18n -lKF6ConfigCore 
-lKF6WindowSystem -lKF6KIOCore -lKF6KIOWidgets -lKF6KIOFileWidgets 
-L$qt6_libdir -lQt6Core -lQt6Gui -lQt6Widgets -lQt6Network"
 KF6_CFLAGS=$(printf '%s' "$KF6_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
 


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

 vcl/inc/qt5/QtTransferable.hxx |   20 +---
 vcl/qt5/QtTransferable.cxx |   37 +++--
 2 files changed, 28 insertions(+), 29 deletions(-)

New commits:
commit 1db5b87fe69c2375f1d66974dafcd563303c76db
Author: Michael Weghorn 
AuthorDate: Tue Feb 13 13:23:17 2024 +0100
Commit: Michael Weghorn 
CommitDate: Tue Feb 13 17:19:19 2024 +0100

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::QWaylandDataDevice::data_device_selection 

core.git: 2 commits - bridges/IwyuFilter_bridges.yaml vcl/qt5

 bridges/IwyuFilter_bridges.yaml |3 +++
 vcl/qt5/QtFrame.cxx |   14 ++
 2 files changed, 17 insertions(+)

New commits:
commit cea0371ac77145ad1f3db7e558c279aeed6f4d00
Author: Michael Weghorn 
AuthorDate: Mon Feb 12 14:09:45 2024 +0100
Commit: Michael Weghorn 
CommitDate: Mon Feb 12 18:19:03 2024 +0100

tdf#125934 qt: Support module-specific window icons on Wayland

As discussed in QTBUG-77182 [1], Qt currently doesn't provide
API to directly set the app_id for a single window/toplevel on Wayland,
but the one set for the application is used when the window gets shown.

Make use of that by temporarily setting the app's desktop file
name and doing a hide/show cycle in `QtFrame::SetIcon` on
Wayland.

A big thanks for David Redondo for mentioning that possibility
in QTBUG-77182!

An alternative would be to use private Qt API and low-level wayland API to
set the app_id directly, s. discussion in QTBUG-77182.

[1] https://bugreports.qt.io/browse/QTBUG-77182

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

diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index 24dcb5ff6f61..6aff814aacd2 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -376,6 +376,20 @@ void QtFrame::SetIcon(sal_uInt16 nIcon)
 
 QIcon aIcon = QIcon::fromTheme(appicon);
 m_pQWidget->window()->setWindowIcon(aIcon);
+
+if (QGuiApplication::platformName() == "wayland" && 
m_pQWidget->window()->isVisible())
+{
+// Qt currently doesn't provide API to directly set the app_id for a 
single
+// window/toplevel on Wayland, but the one set for the application is 
picked up
+// on hide/show, so do that.
+// An alternative would be to use private Qt API and low-level wayland 
API to set the
+// app_id directly, s. discussion in QTBUG-77182.
+const QString sOrigDesktopFileName = 
QGuiApplication::desktopFileName();
+QGuiApplication::setDesktopFileName(appicon);
+m_pQWidget->window()->hide();
+m_pQWidget->window()->show();
+QGuiApplication::setDesktopFileName(sOrigDesktopFileName);
+}
 }
 
 void QtFrame::SetMenu(SalMenu*) {}
commit 9d994e7ba64588d144f028d8873bedae42f3d021
Author: Gabor Kelemen 
AuthorDate: Fri Feb 9 12:49:02 2024 +0100
Commit: Gabor Kelemen 
CommitDate: Mon Feb 12 18:18:59 2024 +0100

Fix IwyuFilter in bridges

after commit b3fa6e6e65031f92d7f13b44f8422fe4aa07e2f9

Change-Id: I79e99d13d982f2190473904db4d63886c479b4f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163167
Tested-by: Gabor Kelemen 
Reviewed-by: Gabor Kelemen 

diff --git a/bridges/IwyuFilter_bridges.yaml b/bridges/IwyuFilter_bridges.yaml
index 071db0504370..00fbd47b3e87 100644
--- a/bridges/IwyuFilter_bridges.yaml
+++ b/bridges/IwyuFilter_bridges.yaml
@@ -7,6 +7,9 @@ excludelist:
 bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx:
 # No .hxx -> .h replacement in URE headers
 - typelib/typedescription.hxx
+bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx:
+# Actually needed for ifdefs to work in all cases
+- share.hxx
 bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:
 # Actually needed
 - callvirtualmethod.hxx


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

 sw/source/uibase/dochdl/swdtflvr.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 0750cacbb165b733ab76bb54a6c0116e8266a01f
Author: Michael Weghorn 
AuthorDate: Fri Feb 9 21:02:59 2024 +0100
Commit: Michael Stahl 
CommitDate: Mon Feb 12 12:14:07 2024 +0100

tdf#158947 sw: Don't unrelatedly overwrite system clipboard on paste

In `SwTransferable::RemoveDDELinkFormat`, only update the
clipboard content with this `SwTransferable` after removing
the `SotClipboardFormatId::LINK` from the supported formats
if the `SwTransferable` was the clipboard content before
already.

Doing so always would unrelatedly overwrite what was previously
copied from another application to the clipboard for the
tdf#158947 scenario of pasting clipboard content of another
application over a selection when using the Qt-based VCL plugins
on Wayland (s. backtrace below that shows how the clipboard content
was overwritten, frame #17 is the method changed in this
commit).

My assumption why the clipboard content is explicitly overwritten
at all is to make sure that the system clipboard on some platforms
gets notified about the change in supported formats/mime
types after removing one. But that isn't necessary when the
transfer data modified here aren't the current clipboard content
in the first place.

Backtrace for how clipboard content was previously overwritten
for the tdf#158947 scenario with the qt6 VCL plugin on Wayland:

~"#0  QtClipboard::handleChanged(QClipboard::Mode) 
(this=0x557f90457770, aMode=QClipboard::Clipboard) at 
.../libreoffice/vcl/qt6/../qt5/QtClipboard.cxx:156
"
~"#1  0x7f26f08844ff in 
QtPrivate::FunctorCall, 
QtPrivate::List, void, void 
(QtClipboard::*)(QClipboard::Mode)>::call(void 
(QtClipboard::*)(QClipboard::Mode), QtClipboard*, 
void**)::{lambda()#1}::operator()() const (__closure=0x7ffe889a2c20) at 
.../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:153
"
~"#2  0x7f26f0884ffb in 
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}&&) 
(args=0x7ffe889a2ed0, fn=...) at 
.../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:72
"
~"#3  0x7f26f088456f in 
QtPrivate::FunctorCall, 
QtPrivate::List, void, void 
(QtClipboard::*)(QClipboard::Mode)>::call(void 
(QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void 
(QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e 
, o=0x557f90457770, 
arg=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:152
"
~"#4  0x7f26f08833de in QtPrivate::FunctionPointer::call, 
void>(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void 
(QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e 
, o=0x557f90457770, 
arg=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:200
"
~"#5  0x7f26f0881f71 in QtPrivate::QCallableObject, 
void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) 
(which=1, this_=0x557f904555f0, r=0x557f90457770, a=0x7ffe889a2ed0, ret=0x0) at 
.../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:571
"
~"#6  0x7f26efdb863f in QtPrivate::QSlotObjectBase::call(QObject*, 
void**) (this=0x557f904555f0, r=0x557f90457770, a=0x7ffe889a2ed0) at 
.../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:487
"
~"#7  0x7f26efe5772e in doActivate(QObject*, int, void**) 
(sender=0x557f8d510fd0, signal_index=3, argv=0x7ffe889a2ed0) at 
.../qt5/qtbase/src/corelib/kernel/qobject.cpp:4116
"
~"#8  0x7f26efe4cdef in QMetaObject::activate(QObject*, QMetaObject 
const*, int, void**) (sender=0x557f8d510fd0, m=0x7f26efa47cc0 
, local_signal_index=0, argv=0x7ffe889a2ed0) at 
.../qt5/qtbase/src/corelib/kernel/qobject.cpp:4176
"
~"#9  0x7f26eede9fcc in QClipboard::changed(QClipboard::Mode) 
(this=0x557f8d510fd0, _t1=QClipboard::Clipboard) at 
.../qt5/qtbase/src/gui/Gui_autogen/include/moc_qclipboard.cpp:182
"
~"#10 0x7f26eede9bc1 in QClipboard::emitChanged(QClipboard::Mode) 
(this=0x557f8d510fd0, mode=QClipboard::Clipboard) at 
.../qt5/qtbase/src/gui/kernel/qclipboard.cpp:558
"
~"#11 0x7f26eee4ed69 in 
QPlatformClipboard::emitChanged(QClipboard::Mode) (this=0x557f88019c20, 
mode=QClipboard::Clipboard) at 
.../qt5/qtbase/src/gui/kernel/qplatformclipboard.cpp:89
"
~"#12 0x7f26ed78809e in 
QtWaylandClient::QWaylandClipboard::setMimeData(QMimeData*, QClipboard::Mode) 
(this=0x557f88019c20, data=0x557f8fb87930, mode=QClipboard::Clipboard) at 

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

 sw/source/uibase/dochdl/swdtflvr.cxx |3 ++-
 vcl/qt5/QtInstance.cxx   |2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 49111fe70fec5a5f074e6c1b1dd60f6b57139a25
Author: Michael Weghorn 
AuthorDate: Fri Feb 9 21:57:11 2024 +0100
Commit: Michael Weghorn 
CommitDate: Sat Feb 10 09:16:10 2024 +0100

qt: Set desktop file name without ".desktop" suffix

This fixes this warning when starting LO with the qt6
VCL plugin on Wayland (using a local qtbase dev build):

> QGuiApplication::setDesktopFileName: the specified desktop file name 
ends with .desktop.
> For compatibility reasons, the .desktop suffix will be removed. 
Please specify a desktop file name without .desktop suffix

The icon is also still shown fine with qt5/kf5
(qtbase at 5.15.10+dfsg-6 from Debian testing).

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

diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index 43af2541a7ce..f2f8caa6b86a 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -310,7 +310,7 @@ void QtInstance::AfterAppInit()
 // set the default application icon via desktop file just on Wayland,
 // as this otherwise overrides the individual desktop icons on X11.
 if (QGuiApplication::platformName() == "wayland")
-
QGuiApplication::setDesktopFileName(QStringLiteral("libreoffice-startcenter.desktop"));
+
QGuiApplication::setDesktopFileName(QStringLiteral("libreoffice-startcenter"));
 QGuiApplication::setLayoutDirection(AllSettings::GetLayoutRTL() ? 
Qt::RightToLeft
 : 
Qt::LeftToRight);
 }
commit cb9513c74502144a480494e0c6a32ac6173ae0a3
Author: Michael Weghorn 
AuthorDate: Fri Feb 9 21:02:59 2024 +0100
Commit: Michael Weghorn 
CommitDate: Sat Feb 10 09:15:56 2024 +0100

tdf#158947 sw: Don't unrelatedly overwrite system clipboard on paste

In `SwTransferable::RemoveDDELinkFormat`, only update the
clipboard content with this `SwTransferable` after removing
the `SotClipboardFormatId::LINK` from the supported formats
if the `SwTransferable` was the clipboard content before
already.

Doing so always would unrelatedly overwrite what was previously
copied from another application to the clipboard for the
tdf#158947 scenario of pasting clipboard content of another
application over a selection when using the Qt-based VCL plugins
on Wayland (s. backtrace below that shows how the clipboard content
was overwritten, frame #17 is the method changed in this
commit).

My assumption why the clipboard content is explicitly overwritten
at all is to make sure that the system clipboard on some platforms
gets notified about the change in supported formats/mime
types after removing one. But that isn't necessary when the
transfer data modified here aren't the current clipboard content
in the first place.

Backtrace for how clipboard content was previously overwritten
for the tdf#158947 scenario with the qt6 VCL plugin on Wayland:

~"#0  QtClipboard::handleChanged(QClipboard::Mode) 
(this=0x557f90457770, aMode=QClipboard::Clipboard) at 
.../libreoffice/vcl/qt6/../qt5/QtClipboard.cxx:156
"
~"#1  0x7f26f08844ff in 
QtPrivate::FunctorCall, 
QtPrivate::List, void, void 
(QtClipboard::*)(QClipboard::Mode)>::call(void 
(QtClipboard::*)(QClipboard::Mode), QtClipboard*, 
void**)::{lambda()#1}::operator()() const (__closure=0x7ffe889a2c20) at 
.../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:153
"
~"#2  0x7f26f0884ffb in 
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}&&) 
(args=0x7ffe889a2ed0, fn=...) at 
.../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:72
"
~"#3  0x7f26f088456f in 
QtPrivate::FunctorCall, 
QtPrivate::List, void, void 
(QtClipboard::*)(QClipboard::Mode)>::call(void 
(QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void 
(QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e 
, o=0x557f90457770, 
arg=0x7ffe889a2ed0) at .../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:152
"
~"#4  0x7f26f08833de in QtPrivate::FunctionPointer::call, 
void>(void (QtClipboard::*)(QClipboard::Mode), QtClipboard*, void**) (f=(void 
(QtClipboard::*)(QtClipboard * const, QClipboard::Mode)) 0x7f26f087a76e 
, o=0x557f90457770, 
arg=0x7ffe889a2ed0) at 

core.git: include/vcl vcl/source

 include/vcl/builder.hxx   |3 ++-
 vcl/source/window/builder.cxx |   15 +--
 2 files changed, 11 insertions(+), 7 deletions(-)

New commits:
commit ad4a06692b05c4312c1c7c8a8ff38cf12422e692
Author: Michael Weghorn 
AuthorDate: Tue Jan 30 12:16:05 2024 +0100
Commit: Michael Weghorn 
CommitDate: Thu Feb 8 22:49:50 2024 +0100

tdf#130857 VclBuilder: Move VCL MenuBar specifics to handleMenu()

Move this handling specific to the VCL-implementation
for the "GtkMenuBar" from `VclBuilder::handleObject`
to `VclBuilder::handleMenu` which is already very
specific for those VCL classes.

The idea is to prepare the current `VclBuilder::handleObject`
for reuse with other welded menu bar implementations
in the future.

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

diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 95105f8cc7ec..1d2d9618372e 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -382,7 +382,8 @@ private:
 voidhandleListStore(xmlreader::XmlReader , const OUString 
, std::u16string_view rClass);
 voidhandleRow(xmlreader::XmlReader , const OUString );
 voidhandleTabChild(vcl::Window *pParent, xmlreader::XmlReader 
);
-VclPtr handleMenu(xmlreader::XmlReader , const OUString , 
bool bMenuBar);
+void handleMenu(xmlreader::XmlReader& reader, vcl::Window* pParent, const 
OUString& rID,
+bool bMenuBar);
 std::vector handleItems(xmlreader::XmlReader ) 
const;
 
 voidhandleSizeGroup(xmlreader::XmlReader );
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 82cdf7a1b0eb..ff20cd07be2b 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -3184,7 +3184,8 @@ std::vector 
VclBuilder::handleItems(xmlreader::XmlReader 
 return aItems;
 }
 
-VclPtr VclBuilder::handleMenu(xmlreader::XmlReader , const 
OUString , bool bMenuBar)
+void VclBuilder::handleMenu(xmlreader::XmlReader& reader, vcl::Window* 
pParent, const OUString& rID,
+bool bMenuBar)
 {
 VclPtr pCurrentMenu;
 if (bMenuBar)
@@ -3234,7 +3235,11 @@ VclPtr VclBuilder::handleMenu(xmlreader::XmlReader 
, const OUString
 
 m_aMenus.emplace_back(rID, pCurrentMenu);
 
-return pCurrentMenu;
+if (bMenuBar && pParent)
+{
+if (SystemWindow* pTopLevel = pParent->GetSystemWindow())
+pTopLevel->SetMenuBar(dynamic_cast(pCurrentMenu.get()));
+}
 }
 
 void VclBuilder::handleMenuChild(Menu *pParent, xmlreader::XmlReader )
@@ -3594,14 +3599,12 @@ VclPtr 
VclBuilder::handleObject(vcl::Window *pParent, stringmap *pA
 }
 else if (sClass == "GtkMenu")
 {
-handleMenu(reader, sID, false);
+handleMenu(reader, pParent, sID, false);
 return nullptr;
 }
 else if (sClass == "GtkMenuBar")
 {
-VclPtr xMenu = handleMenu(reader, sID, true);
-if (SystemWindow* pTopLevel = pParent ? pParent->GetSystemWindow() : 
nullptr)
-pTopLevel->SetMenuBar(dynamic_cast(xMenu.get()));
+handleMenu(reader, pParent, sID, true);
 return nullptr;
 }
 else if (sClass == "GtkSizeGroup")


core.git: 2 commits - include/vcl vcl/source

 include/vcl/builder.hxx   |   23 +--
 vcl/source/window/builder.cxx |  135 +-
 2 files changed, 86 insertions(+), 72 deletions(-)

New commits:
commit 4353b73fb343115ab25d242d11896e153a91a9d3
Author: Michael Weghorn 
AuthorDate: Tue Jan 30 11:43:29 2024 +0100
Commit: Michael Weghorn 
CommitDate: Thu Feb 8 22:49:40 2024 +0100

tdf#130857 VclBuilder: Extract helper method for tweaking new child

Extract the post-processing to apply specific tweaks
to a newly inserted/created `vcl::Window` child from
`VclBuilder::handleChild` into a new helper method
`VclBuilder::tweakInsertedChild`.

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

diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index e53a89321095..95105f8cc7ec 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -332,6 +332,10 @@ private:
 css::uno::Reference m_xFrame;
 
 private:
+// tweak newly inserted child depending on window type
+void tweakInsertedChild(vcl::Window *pParent, vcl::Window* pCurrentChild,
+std::string_view sType, std::string_view 
sInternalChild);
+
 VclPtr insertObject(vcl::Window *pParent,
 const OUString , const OUString ,
 stringmap , stringmap ,
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index f3d16da17b8c..82cdf7a1b0eb 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2733,6 +2733,70 @@ bool 
VclBuilder::sortIntoBestTabTraversalOrder::operator()(const vcl::Window *pA
 return false;
 }
 
+void VclBuilder::tweakInsertedChild(vcl::Window *pParent, vcl::Window* 
pCurrentChild,
+std::string_view sType, std::string_view 
sInternalChild)
+{
+//Internal-children default in glade to not having their visible bits set
+//even though they are visible (generally anyway)
+if (!sInternalChild.empty())
+pCurrentChild->Show();
+
+//Select the first page if it's a notebook
+if (pCurrentChild->GetType() == WindowType::TABCONTROL)
+{
+TabControl *pTabControl = static_cast(pCurrentChild);
+pTabControl->SetCurPageId(pTabControl->GetPageId(0));
+
+//To-Do add reorder capability to the TabControl
+}
+else
+{
+// We want to sort labels before contents of frames
+// for keyboard traversal, especially if there
+// are multiple widgets using the same mnemonic
+if (sType == "label")
+{
+if (VclFrame *pFrameParent = dynamic_cast(pParent))
+pFrameParent->designate_label(pCurrentChild);
+}
+if (sInternalChild.starts_with("vbox") || 
sInternalChild.starts_with("messagedialog-vbox"))
+{
+if (Dialog *pBoxParent = dynamic_cast(pParent))
+
pBoxParent->set_content_area(static_cast(pCurrentChild)); // 
FIXME-VCLPTR
+}
+else if (sInternalChild.starts_with("action_area") || 
sInternalChild.starts_with("messagedialog-action_area"))
+{
+vcl::Window *pContentArea = pCurrentChild->GetParent();
+if (Dialog *pBoxParent = dynamic_cast(pContentArea ? 
pContentArea->GetParent() : nullptr))
+{
+
pBoxParent->set_action_area(static_cast(pCurrentChild)); // 
FIXME-VCLPTR
+}
+}
+
+bool bIsButtonBox = dynamic_cast(pCurrentChild) != 
nullptr;
+
+//To-Do make reorder a virtual in Window, move this foo
+//there and see above
+std::vector aChilds;
+for (vcl::Window* pChild = 
pCurrentChild->GetWindow(GetWindowType::FirstChild); pChild;
+ pChild = pChild->GetWindow(GetWindowType::Next))
+{
+if (bIsButtonBox)
+{
+if (PushButton* pPushButton = 
dynamic_cast(pChild))
+pPushButton->setAction(true);
+}
+
+aChilds.push_back(pChild);
+}
+
+//sort child order within parent so that tabbing
+//between controls goes in a visually sensible sequence
+std::stable_sort(aChilds.begin(), aChilds.end(), 
sortIntoBestTabTraversalOrder(this));
+BuilderUtils::reorderWithinParent(aChilds, bIsButtonBox);
+}
+}
+
 void VclBuilder::handleChild(vcl::Window *pParent, stringmap* pAtkProps, 
xmlreader::XmlReader )
 {
 vcl::Window *pCurrentChild = nullptr;
@@ -2774,69 +2838,8 @@ void VclBuilder::handleChild(vcl::Window *pParent, 
stringmap* pAtkProps, xmlread
 pCurrentChild = handleObject(pParent, pAtkProps, reader).get();
 
 bool bObjectInserted = pCurrentChild && pParent != 
pCurrentChild;
-
 if (bObjectInserted)
-{
-//Internal-children 

core.git: vcl/CustomTarget_qt5_moc.mk vcl/CustomTarget_qt6_moc.mk vcl/inc vcl/qt5

 vcl/CustomTarget_qt5_moc.mk |1 
 vcl/CustomTarget_qt6_moc.mk |1 
 vcl/inc/qt5/QtInstanceMessageDialog.hxx |   19 +
 vcl/qt5/QtInstanceMessageDialog.cxx |   63 
 4 files changed, 83 insertions(+), 1 deletion(-)

New commits:
commit a54abf77c40c59e5a4d8a70e1b129b1e420265a3
Author: Michael Weghorn 
AuthorDate: Sat Feb 3 11:35:33 2024 +0100
Commit: Michael Weghorn 
CommitDate: Sun Feb 4 07:01:14 2024 +0100

tdf#130857 qt weld: Support asnyc running of msg dialogs

Implement methods required to run a welded Qt message dialog
asynchronously: `QtInstanceMessageDialog::runAsync` and
`QtInstanceMessageDialog::response`.

Run the dialog asynchronously using `QDialog::open` and
connect to the `QDialog::finished` signal to be notified
when the dialog gets closed.

Similar to how the gtk-based implementation, use local
variables for the `std::shared_ptr`s and reset the members
right away, not only at the end of the slot, since resetting
the relevant one set in the corresponding `runAsync` overload
will result in the object getting deallocated, thus the members
can no longer be accessed safely.

Take the solar mutex before calling the callback function
as that seems to be expected (e.g. otherwise triggers an assert
for the below example where the callback functions
modifies VCL widgets).

With this in place, running welded Qt message dialogs
asynchronously works instead of not showing up at all, e.g.

1) start Writer with qt6 VCL plugin and without
   `SAL_VCL_QT_NO_WELDED_WIDGETS` set
2) open "File" -> "Properties" -> "Security"
3) click the "Protect..." button
4) enter 2 different passwords and press "OK" button

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

diff --git a/vcl/CustomTarget_qt5_moc.mk b/vcl/CustomTarget_qt5_moc.mk
index 5fb4f482e778..136741320e9d 100644
--- a/vcl/CustomTarget_qt5_moc.mk
+++ b/vcl/CustomTarget_qt5_moc.mk
@@ -14,6 +14,7 @@ $(call gb_CustomTarget_get_target,vcl/qt5) : \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/QtFilePicker.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/QtFrame.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/QtInstance.moc \
+   $(call gb_CustomTarget_get_workdir,vcl/qt5)/QtInstanceMessageDialog.moc 
\
$(call gb_CustomTarget_get_workdir,vcl/qt5)/QtMainWindow.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/QtMenu.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/QtObject.moc \
diff --git a/vcl/CustomTarget_qt6_moc.mk b/vcl/CustomTarget_qt6_moc.mk
index 77aab947164d..c544490d4398 100644
--- a/vcl/CustomTarget_qt6_moc.mk
+++ b/vcl/CustomTarget_qt6_moc.mk
@@ -14,6 +14,7 @@ $(call gb_CustomTarget_get_target,vcl/qt6) : \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtFilePicker.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtFrame.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtInstance.moc \
+   $(call gb_CustomTarget_get_workdir,vcl/qt6)/QtInstanceMessageDialog.moc 
\
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtMainWindow.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtMenu.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt6)/QtObject.moc \
diff --git a/vcl/inc/qt5/QtInstanceMessageDialog.hxx 
b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
index ae353268833c..c12243b5945c 100644
--- a/vcl/inc/qt5/QtInstanceMessageDialog.hxx
+++ b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
@@ -12,11 +12,20 @@
 #include "QtInstanceDialog.hxx"
 #include 
 
-class QtInstanceMessageDialog : public QtInstanceDialog, public virtual 
weld::MessageDialog
+class QtInstanceMessageDialog : public QObject,
+public QtInstanceDialog,
+public virtual weld::MessageDialog
 {
+Q_OBJECT;
+
 private:
 QMessageBox* m_pMessageDialog;
 
+// the DialogController/Dialog/function passed to the runAsync variants
+std::shared_ptr m_xRunAsyncDialogController;
+std::shared_ptr m_xRunAsyncDialog;
+std::function m_aRunAsyncFunc;
+
 public:
 QtInstanceMessageDialog(QMessageBox* pMessageDialog);
 
@@ -35,6 +44,14 @@ public:
 const OUString& rHelpId = {}) override;
 virtual void set_default_response(int nResponse) override;
 virtual int run() override;
+virtual bool runAsync(std::shared_ptr const& 
rxOwner,
+  const std::function& func) override;
+virtual bool runAsync(std::shared_ptr const& rxSelf,
+  const std::function& func) override;
+virtual void response(int nResponse) override;
+
+private slots:
+void dialogFinished(int nResult);
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: 

core.git: 2 commits - sw/source

 sw/source/uibase/dochdl/swdtflvr.cxx |   10 ++---
 sw/source/uibase/inc/swdtflvr.hxx|   10 ++---
 sw/source/uibase/shells/basesh.cxx   |   64 ++-
 3 files changed, 43 insertions(+), 41 deletions(-)

New commits:
commit ffe0f40bd70f96f9b57a8bde1625dd56534a149e
Author: Michael Weghorn 
AuthorDate: Thu Feb 1 13:58:29 2024 +0100
Commit: Michael Weghorn 
CommitDate: Fri Feb 2 07:32:11 2024 +0100

sw: Use a const TransferableDataHelper (ref) here

All these methods don't modify the object, so
can use a const reference.

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

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index 0a6d9f5cadba..64d1d6fe5a9b 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -1688,7 +1688,7 @@ bool SwTransferable::Paste(SwWrtShell& rSh, 
TransferableDataHelper& rData, RndSt
 nDestination, false, false, nullptr, 
0, false, nAnchorType, bIgnoreComments, , ePasteTable);
 }
 
-bool SwTransferable::PasteData( TransferableDataHelper& rData,
+bool SwTransferable::PasteData( const TransferableDataHelper& rData,
 SwWrtShell& rSh, sal_uInt8 nAction, 
SotExchangeActionFlags nActionFlags,
 SotClipboardFormatId nFormat,
 SotExchangeDest nDestination, bool bIsPasteFormat,
@@ -2237,7 +2237,7 @@ bool SwTransferable::PasteFileContent( const 
TransferableDataHelper& rData,
 return bRet;
 }
 
-bool SwTransferable::PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
+bool SwTransferable::PasteOLE( const TransferableDataHelper& rData, 
SwWrtShell& rSh,
 SotClipboardFormatId nFormat, 
SotExchangeActionFlags nActionFlags, bool bMsg )
 {
 bool bRet = false;
@@ -3096,7 +3096,7 @@ bool SwTransferable::PasteAsHyperlink( const 
TransferableDataHelper& rData,
 return bRet;
 }
 
-bool SwTransferable::PasteFileName( TransferableDataHelper& rData,
+bool SwTransferable::PasteFileName( const TransferableDataHelper& rData,
 SwWrtShell& rSh, SotClipboardFormatId 
nFormat,
 SwPasteSdr nAction, const Point* pPt,
 SotExchangeActionFlags nActionFlags,
@@ -3376,7 +3376,7 @@ bool SwTransferable::IsPasteOwnFormat( const 
TransferableDataHelper& rData )
 }
 
 bool SwTransferable::PasteFormat( SwWrtShell& rSh,
-TransferableDataHelper& rData,
+const TransferableDataHelper& rData,
 SotClipboardFormatId nFormat )
 {
 SwWait aWait( *rSh.GetView().GetDocShell(), false );
@@ -3465,7 +3465,7 @@ bool SwTransferable::PasteUnformatted( SwWrtShell& rSh, 
TransferableDataHelper&
 return SwTransferable::PasteFormat( rSh, rData, 
SotClipboardFormatId::STRING );
 }
 
-void SwTransferable::PrePasteSpecial( const SwWrtShell& rSh, 
TransferableDataHelper& rData, const VclPtr& pDlg )
+void SwTransferable::PrePasteSpecial( const SwWrtShell& rSh, const 
TransferableDataHelper& rData, const VclPtr& pDlg )
 {
 DataFlavorExVector aFormats( rData.GetDataFlavorExVector() );
 TransferableObjectDescriptor aDesc;
diff --git a/sw/source/uibase/inc/swdtflvr.hxx 
b/sw/source/uibase/inc/swdtflvr.hxx
index 6234bd37294b..18c9bc0c44b9 100644
--- a/sw/source/uibase/inc/swdtflvr.hxx
+++ b/sw/source/uibase/inc/swdtflvr.hxx
@@ -114,7 +114,7 @@ class SW_DLLPUBLIC SwTransferable final : public 
TransferableHelper
 
 static bool PasteFileContent( const TransferableDataHelper&,
 SwWrtShell& rSh, SotClipboardFormatId 
nFormat, bool bMsg, bool bIgnoreComments = false );
-static bool PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
+static bool PasteOLE( const TransferableDataHelper& rData, SwWrtShell& rSh,
 SotClipboardFormatId nFormat, 
SotExchangeActionFlags nActionFlags, bool bMsg );
 static bool PasteTargetURL( const TransferableDataHelper& rData, 
SwWrtShell& rSh,
 SwPasteSdr nAction, const Point* pPt, bool bInsertGRF 
);
@@ -136,7 +136,7 @@ class SW_DLLPUBLIC SwTransferable final : public 
TransferableHelper
 static bool PasteAsHyperlink( const TransferableDataHelper& rData,
 SwWrtShell& rSh, SotClipboardFormatId 
nFormat );
 
-static bool PasteFileName( TransferableDataHelper& rData,
+static bool PasteFileName( const TransferableDataHelper& rData,
 SwWrtShell& rSh, SotClipboardFormatId nFormat, 
SwPasteSdr nAction,
 const Point* pPt, SotExchangeActionFlags 
nActionFlags, bool * 

core.git: bin/gbuild-to-ide

 bin/gbuild-to-ide |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit d7586471cdccaac742a69d53bc299875f02309cd
Author: Michael Weghorn 
AuthorDate: Wed Jan 31 14:45:09 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 31 22:48:25 2024 +0100

qtcreator: Fix generating .pro files for externals

Since

commit 3460799175e6c5795aa07c784e16d10ba9081d49
Date:   Thu Jan 25 23:41:52 2024 +0600

Clear gb_GbuildToJson_DENYLISTEDMODULES, allow these modules

, externals are taken into account in the generation of IDE integrations,
causing errors like this when running `make qtcreator-ide-integration`
to generate the *.pro files for the QtCreator IDE integration:

cd /home/michi/development/git/libreoffice &&  bin/gbuild-to-ide --ide 
qtcreator --make make
ERROR : creating pro 
file=/home/michi/development/git/libreoffice/clucene/clucene.pro
[Errno 2] No such file or directory: 
'/home/michi/development/git/libreoffice/clucene/clucene.pro'
Traceback (most recent call last):
  File "/home/michi/development/git/libreoffice/bin/gbuild-to-ide", 
line 1787, in emit
with open(qt_pro_file, mode) as fpro:
 ^^^
FileNotFoundError: [Errno 2] No such file or directory: 
'/home/michi/development/git/libreoffice/clucene/clucene.pro'

Fix this by creating the .pro files in a directory that has the same
relative path to the $(BUILDDIR) as the corresponding .mk files have
in the $(SRCDIR) rather than in $(BUILDDIR)/$(LIBNAME)/.

While both are the same for LO's internal modules,
the latter directory does not exist for externals, since
they're located underneath a top-level directory called "external".

For the simple case of an in-tree build, this now e.g.
creates a file `external/clucene/clucene.pro` instead
of failing to create a `clucene/clucene.pro` because there's
no top-level "clucene" directory.

An alternative approach might to just ignore the externals,
as this commit implemented it for the codelite integration:

commit 41c8e0957369b7b53a3b9cf4b4cf1e49a982a414
Date:   Sat Jan 27 21:54:10 2024 +0200

fix codelite-ide-integration

externals seems to be part of the list of modules now, but I
don't know how to deal with that, so just ignore them.

(In that case, they wouldn't be part of the project, speeding
up update of the clang code model after changes, but then not providing
features like code navigation and autocompletion etc.)

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

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index ab4f947dc7d6..d4627707ecb8 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1778,8 +1778,9 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 cxxstdversion = cxxstdversionflag[5:]
 
 # create .pro file
-subdirs_meta_pro.append(lib_name)
-qt_pro_file = os.path.join(self.base_folder, lib_name, lib_name + 
'.pro')
+relative_subdir_path = os.path.relpath(lib_loc, 
self.gbuildparser.srcdir)
+subdirs_meta_pro.append(relative_subdir_path)
+qt_pro_file = os.path.join(self.base_folder, relative_subdir_path, 
lib_name + '.pro')
 try:
 content = QtCreatorIntegrationGenerator.pro_template % 
{'sources': sources, 'headers': headers, 'cxxstdversionflag': cxxstdversionflag,
 
'cxxstdversion': cxxstdversion, 'objcxx_sources': objcxx_sources,
@@ -1796,7 +1797,7 @@ class 
QtCreatorIntegrationGenerator(IdeIntegrationGenerator):
 print("

", file=sys.stderr)
 
 # create .pro.shared file
-qt_pro_shared_file = os.path.join(self.base_folder, lib_name, 
lib_name + '.pro.shared')
+qt_pro_shared_file = os.path.join(self.base_folder, 
relative_subdir_path, lib_name + '.pro.shared')
 try:
 with open(qt_pro_shared_file, mode) as fproshared:
 
fproshared.write(self.generate_pro_shared_content(lib_folder))


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

 vcl/inc/qt5/QtTools.hxx |1 
 vcl/qt5/QtInstance.cxx  |   34 +-
 vcl/qt5/QtInstanceMessageDialog.cxx |   85 +---
 vcl/qt5/QtTools.cxx |   29 
 4 files changed, 44 insertions(+), 105 deletions(-)

New commits:
commit 053b88c371461cda49e99ab2fc060eb1f1ded580
Author: Michael Weghorn 
AuthorDate: Thu Jan 25 10:28:48 2024 +0100
Commit: Michael Weghorn 
CommitDate: Sun Jan 28 16:42:12 2024 +0100

tdf#159323 qt weld: Remember VCL response code, don't try to map

Set the VCL return code of a button as a property
"response-code" for the `QPushButton` and use that instead of
trying to map the VCL response code for a
button to a `QMessageBox::ButtonRole` and then
mapping that back to the original VCL return code.

While the previous approach worked fine for return codes
from the `VclResponseType` enum, it turns out that
any arbitrary int can be used, and supporting that
needs a different approach.

One example (s. tdf#159323 comment 7) is `SbRtl_MsgBox`
(in basic/source/runtime/methods.cxx) which uses
values from the `BasicResponse` enum defined in there
that has a `BasicResponse::Yes = 6`, but the
`VclResponseType` enum has nothing for the value 6.

Just use `QMessageBox::ButtonRole::ActionRole` for
all buttons, since there's no clear way to map from
the VCL response code to the `QMessageBox::ButtonRole::ActionRole`
in general.

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

diff --git a/vcl/qt5/QtInstanceMessageDialog.cxx 
b/vcl/qt5/QtInstanceMessageDialog.cxx
index ed48c5298a6c..7e505aff7cd0 100644
--- a/vcl/qt5/QtInstanceMessageDialog.cxx
+++ b/vcl/qt5/QtInstanceMessageDialog.cxx
@@ -11,68 +11,11 @@
 
 #include 
 
-namespace
-{
-QMessageBox::ButtonRole lcl_vclResponseTypeToQtMessageBoxButtonRole(int 
nResponseType)
-{
-// RET_CANCEL, RET_HELP, RET_YES, RET_NO and RET_OK have a matching 
equivalent
-// in Qt, the others are a bit more arbitrary; what really matters about 
these
-// is only that the mapping here and the other way around
-// (in lcl_qtMessageBoxButtonRoleToVclResponseType) is consistent
-switch (nResponseType)
-{
-case RET_CANCEL:
-return QMessageBox::ButtonRole::RejectRole;
-case RET_HELP:
-return QMessageBox::ButtonRole::HelpRole;
-case RET_YES:
-return QMessageBox::ButtonRole::YesRole;
-case RET_NO:
-return QMessageBox::ButtonRole::NoRole;
-case RET_OK:
-return QMessageBox::ButtonRole::AcceptRole;
-case RET_RETRY:
-return QMessageBox::ButtonRole::ResetRole;
-case RET_IGNORE:
-return QMessageBox::ButtonRole::ActionRole;
-case RET_CLOSE:
-return QMessageBox::ButtonRole::DestructiveRole;
-default:
-assert(false && "Unhandled vcl response type");
-return QMessageBox::InvalidRole;
-}
-}
-
-VclResponseType lcl_qtMessageBoxButtonRoleToVclResponseType(int nRet)
-{
-// AcceptRole, HelpRole, NoRole, RejectRole and YesRole have a matching 
equivalent
-// in VCL, the others are a bit more arbitrary; what really matters about 
these
-// is only that the mapping here and the other way around
-// (in lcl_vclResponseTypeToQtMessageBoxButtonRole) is consistent
-switch (nRet)
-{
-case QMessageBox::ButtonRole::AcceptRole:
-return RET_OK;
-case QMessageBox::ButtonRole::HelpRole:
-return RET_HELP;
-case QMessageBox::ButtonRole::NoRole:
-return RET_NO;
-case QMessageBox::ButtonRole::RejectRole:
-return RET_CANCEL;
-case QMessageBox::ButtonRole::YesRole:
-return RET_YES;
-case QMessageBox::ButtonRole::ResetRole:
-return RET_RETRY;
-case QMessageBox::ButtonRole::ActionRole:
-return RET_IGNORE;
-case QMessageBox::ButtonRole::DestructiveRole:
-return RET_CLOSE;
-default:
-assert(false && "Unhandled QMessageBox::ButtonRole");
-return RET_CANCEL;
-}
-}
-}
+/**
+ * Name of the property to set on a QPushButton that holds the
+ * VCL response code of that button.
+ */
+const char* const PROPERTY_VCL_RESPONSE_CODE = "response-code";
 
 QtInstanceMessageDialog::QtInstanceMessageDialog(QMessageBox* pMessageDialog)
 : QtInstanceDialog(pMessageDialog)
@@ -107,8 +50,9 @@ OUString QtInstanceMessageDialog::get_secondary_text() const
 void QtInstanceMessageDialog::add_button(const OUString& rText, int nResponse, 
const OUString&)
 {
 assert(m_pMessageDialog);
-m_pMessageDialog->addButton(vclToQtStringWithAccelerator(rText),
-

core.git: sw/inc sw/source

 sw/inc/accmap.hxx|7 ++-
 sw/source/core/access/accmap.cxx |   17 ++---
 2 files changed, 8 insertions(+), 16 deletions(-)

New commits:
commit 2cedb1a19ad605df4e148589e9027512e4dd9265
Author: Michael Weghorn 
AuthorDate: Fri Jan 26 18:37:11 2024 +0100
Commit: Michael Weghorn 
CommitDate: Fri Jan 26 22:12:22 2024 +0100

sw a11y: Return MapMode instead of using out param

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

diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx
index 9daf15b8ae07..d99d8dc16c7a 100644
--- a/sw/inc/accmap.hxx
+++ b/sw/inc/accmap.hxx
@@ -297,12 +297,9 @@ private:
 input parameter - constant reference to point to determine the mapping
 mode adjustments for page/print preview.
 
-@param _orMapMode
-output parameter - reference to the mapping mode, which is determined
-by the method
+@return mapping mode, which is determined by the method
 */
-void GetMapMode( const Point& _rPoint,
- MapMode& _orMapMode ) const;
+MapMode GetMapMode(const Point& _rPoint) const;
 public:
 virtual bool IsDocumentSelAll() override;
 };
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index aa34fdf2d568..704dac005566 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2949,8 +2949,7 @@ Point SwAccessibleMap::LogicToPixel( const Point& rPoint 
) const
 Point aPoint = o3tl::toTwips( rPoint, o3tl::Length::mm100 );
 if (const vcl::Window* pWin = GetShell()->GetWin())
 {
-MapMode aMapMode;
-GetMapMode( aPoint, aMapMode );
+const MapMode aMapMode = GetMapMode(aPoint);
 aPoint = pWin->LogicToPixel( aPoint, aMapMode );
 aPoint = Point(pWin->OutputToAbsoluteScreenPixel( aPoint ));
 }
@@ -2963,8 +2962,7 @@ Size SwAccessibleMap::LogicToPixel( const Size& rSize ) 
const
 Size aSize( o3tl::toTwips( rSize, o3tl::Length::mm100 ) );
 if (const OutputDevice* pWin = GetShell()->GetWin()->GetOutDev())
 {
-MapMode aMapMode;
-GetMapMode( Point(0,0), aMapMode );
+const MapMode aMapMode = GetMapMode(Point(0, 0));
 aSize = pWin->LogicToPixel( aSize, aMapMode );
 }
 
@@ -3073,8 +3071,7 @@ Point SwAccessibleMap::PixelToCore( const Point& rPoint ) 
const
 Point aPoint;
 if (const OutputDevice* pWin = GetShell()->GetWin()->GetOutDev())
 {
-MapMode aMapMode;
-GetMapMode( rPoint, aMapMode );
+const MapMode aMapMode = GetMapMode(rPoint);
 aPoint = pWin->PixelToLogic( rPoint, aMapMode );
 }
 return aPoint;
@@ -3118,8 +3115,7 @@ tools::Rectangle SwAccessibleMap::CoreToPixel( const 
SwRect& rRect ) const
 tools::Rectangle aRect;
 if (const OutputDevice* pWin = GetShell()->GetWin()->GetOutDev())
 {
-MapMode aMapMode;
-GetMapMode( rRect.TopLeft(), aMapMode );
+const MapMode aMapMode = GetMapMode(rRect.TopLeft());
 aRect = pWin->LogicToPixel( rRect.SVRect(), aMapMode );
 
 tools::Rectangle aTmpRect = pWin->PixelToLogic( aRect, aMapMode );
@@ -3137,8 +3133,7 @@ tools::Rectangle SwAccessibleMap::CoreToPixel( const 
SwRect& rRect ) const
 output device for mapping logic document positions to page preview window
 positions and vice versa and doesn't take care to recover its changes.
 */
-void SwAccessibleMap::GetMapMode( const Point& _rPoint,
-  MapMode& _orMapMode ) const
+MapMode SwAccessibleMap::GetMapMode(const Point& _rPoint) const
 {
 MapMode aMapMode = GetShell()->GetWin()->GetMapMode();
 if( GetShell()->IsPreview() )
@@ -3146,7 +3141,7 @@ void SwAccessibleMap::GetMapMode( const Point& _rPoint,
 assert(mpPreview != nullptr);
 mpPreview->AdjustMapMode( aMapMode, _rPoint );
 }
-_orMapMode = aMapMode;
+return aMapMode;
 }
 
 Size SwAccessibleMap::GetPreviewPageSize(sal_uInt16 const nPreviewPageNum) 
const


core.git: Branch 'libreoffice-7-6' - svx/source

 svx/source/accessibility/AccessibleShape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9388cfca3db302694d5ec582da942876046eb139
Author: Michael Weghorn 
AuthorDate: Wed Jan 24 10:19:58 2024 +0100
Commit: Michael Stahl 
CommitDate: Thu Jan 25 11:33:58 2024 +0100

svx a11y: Notify listeners when disposing shape

In `AccessibleShape::disposing`, call the same method
of the base class, i.e. `AccessibleContextBase::disposing`,
not `AccessibleContextBase::dispose`.

The code was moved from `AccessibleShape::dispose` to
`AccessibleShape::disposing` in

commit f11b151dc08ccfcb7e78bfd9a24c77670942ea63
Date:   Tue Apr 30 13:30:10 2002 +

#95585# Moved code from dispose to disposing().

and it seems likely that adjusting the base class method to call
was just forgotten/missed.

This resulted in the accessible getting disposed without listeners
getting notified (since `AccessibleContextBase::disposing` takes
care of that).

This resulted in a crash for the following scenario with the qt6
VCL plugin when the Orca screen reader is running:

1) start LO Writer
2) click on the "Basic shapes" toolbar button
3) click + drag to insert a shape into the document
4) click somewhere else

Backtrace is below.
`AtSpiAdaptor::handleMessage` (frame #12 in the bt) checks
whether the accessible is valid and returns early otherwise.
But since listeners were not notified when the object got disposed,
`QtAccessibleEventListener::disposing` wasn't called, which would
have taken care of invalidating the `QtAccessibleWidget`, in which
case this early return would have happened instead of the crash.

This behaves as expected now with this commit in place.

stderr output of the crash:

terminate called after throwing an instance of 
'com::sun::star::lang::DisposedException'

Backtrace:

Thread 1 received signal SIGABRT, Aborted.
__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  0x7f5bc1ca815f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7f5bc1c5a472 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x7f5bc1c444b2 in __GI_abort () at ./stdlib/abort.c:79
#4  0x7f5bc18a09eb in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x7f5bc18affca in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x7f5bc18b0035 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x7f5bc18b0288 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x7f5bc02b4550 in 
accessibility::AccessibleContextBase::ThrowIfDisposed() (this=0x55a6fc7e7da0) 
at .../libreoffice/editeng/source/accessibility/AccessibleContextBase.cxx:494
#9  0x7f5bbcf7d54e in 
accessibility::AccessibleShape::getAccessibleName() (this=0x55a6fc7e7da0) at 
.../libreoffice/svx/source/accessibility/AccessibleShape.cxx:280
#10 0x7f5bada62107 in QtAccessibleWidget::text(QAccessible::Text) 
const (this=0x55a6fad4fe20, text=QAccessible::Name) at 
.../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:362
#11 0x7f5bac5552d2 in 
AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, 
QDBusMessage const&, QDBusConnection const&) (this=0x55a6f769bce0, 
interface=0x55a6fad4fe20, function=..., message=..., connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1545
#12 0x7f5bac553cce in AtSpiAdaptor::handleMessage(QDBusMessage 
const&, QDBusConnection const&) (this=0x55a6f769bce0, message=..., 
connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1432
#13 0x7f5baaa88943 in 
QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, 
QDBusMessage const&, int) (this=0x7f5ba4010f30, node=..., msg=..., 
pathStartPos=27)
at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
#14 0x7f5baaa89628 in 
QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f5ba4026980) at 
.../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
#15 0x7f5bad044013 in QObject::event(QEvent*) (this=0x55a6f769bce0, 
e=0x7f5ba4026980) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447
#16 0x7f5bab1a6986 in QApplicationPrivate::notify_helper(QObject*, 
QEvent*) (this=0x55a6f631c3e0, receiver=0x55a6f769bce0, e=0x7f5ba4026980) at 
.../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298
#17 0x7f5bab1a6797 in QApplication::notify(QObject*, QEvent*) 

core.git: sw/source

 sw/source/core/access/accmap.cxx |   23 ++-
 1 file changed, 14 insertions(+), 9 deletions(-)

New commits:
commit 18e930165086fa08a91e1ba890ac3f52badbbf53
Author: Michael Weghorn 
AuthorDate: Wed Jan 24 15:32:35 2024 +0100
Commit: Michael Weghorn 
CommitDate: Thu Jan 25 09:42:46 2024 +0100

sw a11y: Send SELECTION_CHANGED_{ADD,REMOVE} event for doc

`AccessibleEventId::SELECTION_CHANGED_ADD` and
`AccessibleEventId::SELECTION_CHANGED_REMOVE` events
need to be sent for the selection container whose
selection changed, not the child that was (un)selected.
The latter should be set as the `NewValue` of the event,
see the doc in
offapi/com/sun/star/accessibility/AccessibleEventId.idl .

Therefore, adjust the handling for (un)selected shapes
in Writer: Set the doc view's a11y object as the source,
just as it is already done for the
`AccessibleEventId::SELECTION_CHANGED_WITHIN` case,
and set the (un)selected shape as the `NewValue`.

With a Writer doc having two shapes and the first
one selected, clicking on the other one to switch
selection to that one would previously result in
this warning when using the qt6 VCL plugin with
Orca running:


warn:vcl.qt:114611:114611:vcl/qt6/../qt5/QtAccessibleEventListener.cxx:363: 
Selection add/remove event without the (un)selected accessible set

warn:vcl.qt:114611:114611:vcl/qt6/../qt5/QtAccessibleEventListener.cxx:363: 
Selection add/remove event without the (un)selected accessible set

Using gtk3 and this pyatspi script:

#!/usr/bin/python3
import pyatspi
def listener(e):
try:
if e.host_application.name != 'soffice':
return
except:
return
print(e)
pyatspi.Registry.registerEventListener(listener, 
'object:state-changed:selected')
pyatspi.Registry.registerEventListener(listener, 
'object:selection-changed')
pyatspi.Registry.start()

would previously give this output for that case:

object:state-changed:selected(0, 0, 0)
source: [panel | Shape 1]
host_application: [application | soffice]
sender: [application | soffice]
object:selection-changed(0, 0, 0)
source: [panel | Shape 1]
host_application: [application | soffice]
sender: [application | soffice]
object:state-changed:selected(1, 0, 0)
source: [panel | Shape 2]
host_application: [application | soffice]
sender: [application | soffice]
object:selection-changed(0, 0, 0)
source: [panel | Shape 2]
host_application: [application | soffice]
sender: [application | soffice]

(i.e. both, the "state-changed:selected" as well as the "selection-changed"
AT-SPI events were previously sent for the shapes.)

With this change in place, this gives the expected output:

object:state-changed:selected(0, 0, 0)
source: [panel | Shape 1]
host_application: [application | soffice]
sender: [application | soffice]
object:selection-changed(0, 0, 0)
source: [document text | Untitled 1 - LibreOfficeDev Document]
host_application: [application | soffice]
sender: [application | soffice]
object:state-changed:selected(1, 0, 0)
source: [panel | Shape 2]
host_application: [application | soffice]
sender: [application | soffice]
object:selection-changed(0, 0, 0)
source: [document text | Untitled 1 - LibreOfficeDev Document]
host_application: [application | soffice]
sender: [application | soffice]

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

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index bb0f209bb049..aa34fdf2d568 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -1517,12 +1517,17 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool 
bInvalidateFocusMode /*=fa
 ++pShape;
 }
 
+rtl::Reference xDocView = GetDocumentView_(false);
+assert(xDocView.is());
+
 for (const auto& rpShape : vecxShapeRemove)
 {
-::accessibility::AccessibleShape *pAccShape = rpShape.get();
-if (pAccShape)
+if (rpShape.is())
 {
-
pAccShape->CommitChange(AccessibleEventId::SELECTION_CHANGED_REMOVE, 
uno::Any(), uno::Any(), -1);
+AccessibleEventObject aEvent;
+aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
+  

core.git: sw/source

 sw/source/core/access/accmap.cxx |9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

New commits:
commit c965b4f6fb1e59d05b26930d5fa24df2e7c0e0b5
Author: Michael Weghorn 
AuthorDate: Wed Jan 24 14:24:42 2024 +0100
Commit: Michael Weghorn 
CommitDate: Thu Jan 25 09:42:20 2024 +0100

sw a11y: Drop special event handling for single selected shape

If shape selecion changed, just send the same
`AccessibleEventId::SELECTION_CHANGED_ADD` event(s)
regardless of whether only a single or multiple shapes
are selected.

This unifies the handling and also prepares for sending the
event with the correct source and `NewValue` set.

The `AccessibleEventId::SELECTION_CHANGED` doc doesn't
expclicitly mention whether the source should be the
selection container (i.e. the parent, which is the doc view
in the case here) or the selected object, and this is
currently handled inconsistently across the codebase.
I tend to think that this event should have the
container as the source (just as for the
`AccessibleEventId::SELECTION_CHANGED_ADD` case,
that will be fixed in an upcoming commit), and this
is at least what the handling e.g. in the gtk3 a11y
bridge assumes (s. `AtkListener::notifyEvent`), but
there seems to be no added value in handling the
case of a single selected shape specially here in the
first place.

This may have been inspired by the MSAA/IAccessible
equivalent, `EVENT_OBJECT_SELECTION` [1]:

> The selection within a container object has changed. (...) This event
> signals a single selection: either a child is selected in a container
> that previously did not contain any selected children, or the selection
> has changed from one child to another.

But then, the selection taking place here might also be from
multiple objects being selected to just a single one, and
`SELECTION_CHANGED_REMOVE` is sent for any previously selected
but now unselected shape anyway, so using
`AccessibleEventId::SELECTION_CHANGED_ADD` seems more
consistent to me anyway.

[1] https://learn.microsoft.com/en-us/windows/win32/winauto/event-constants

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

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 38c9233ec018..bb0f209bb049 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -1495,7 +1495,6 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool 
bInvalidateFocusMode /*=fa
 
 std::vector<::rtl::Reference<::accessibility::AccessibleShape>> 
vecxShapeAdd;
 std::vector<::rtl::Reference<::accessibility::AccessibleShape>> 
vecxShapeRemove;
-int nCountSelectedShape=0;
 
 vcl::Window *pWin = GetShell()->GetWin();
 bool bFocused = pWin && pWin->HasFocus();
@@ -1545,7 +1544,6 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool 
bInvalidateFocusMode /*=fa
 {
 vecxShapeAdd.push_back(pShape->second);
 }
-++nCountSelectedShape;
 }
 }
 
@@ -1564,17 +1562,12 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool 
bInvalidateFocusMode /*=fa
 }
 else
 {
-short nEventID = AccessibleEventId::SELECTION_CHANGED_ADD;
-if (nCountSelectedShape <= 1 && vecxShapeAdd.size() == 1 )
-{
-nEventID = AccessibleEventId::SELECTION_CHANGED;
-}
 for (const auto& rpShape : vecxShapeAdd)
 {
 ::accessibility::AccessibleShape *pAccShape = rpShape.get();
 if (pAccShape)
 {
-pAccShape->CommitChange(nEventID, uno::Any(), uno::Any(), -1);
+
pAccShape->CommitChange(AccessibleEventId::SELECTION_CHANGED_ADD, uno::Any(), 
uno::Any(), -1);
 }
 }
 }


core.git: sw/source

 sw/source/core/access/accmap.cxx |   13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

New commits:
commit 08b7a0eb45c8816c6cf093d9a7405ce9b6d3f990
Author: Michael Weghorn 
AuthorDate: Wed Jan 24 12:28:34 2024 +0100
Commit: Michael Weghorn 
CommitDate: Thu Jan 25 09:42:04 2024 +0100

sw a11y: Drop unnecessary cast to SwAccessiblePreview

With

Change-Id: I32d5bd2f81e7a69eacf92af1cf24249eb3a9f2a0
Author: Michael Weghorn 
Date:   Wed Jan 24 12:10:32 2024 +0100

sw a11y: Return SwAccessibleContext to avoid casting

in place, `SwAccessibleMap::GetDocumentView_` returns the
more concrete `rtl::Reference`, and
`SwAccessibleContext::InvalidateFocus` is what gets
called here, so there's no need to cast to
`SwAccessiblePreview` here.

(The previous `static_cast` wasn't type-safe, so the
extra null check after the cast didn't really add much
value.)

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

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 0a6da3f501b8..38c9233ec018 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2671,16 +2671,9 @@ void SwAccessibleMap::InvalidateFocus()
 
 if(GetShell()->IsPreview())
 {
-uno::Reference xAcc = GetDocumentView_( true );
-if (xAcc)
-{
-SwAccessiblePreview *pAccPreview = static_cast(xAcc.get());
-if (pAccPreview)
-{
-pAccPreview->InvalidateFocus();
-return ;
-}
-}
+rtl::Reference xDocView = GetDocumentView_(true);
+assert(xDocView.is());
+xDocView->InvalidateFocus();
 }
 
 rtl::Reference < SwAccessibleContext > xAcc = mxCursorContext;


core.git: sw/inc sw/source

 sw/inc/accmap.hxx|3 +--
 sw/source/core/access/accmap.cxx |   15 ++-
 2 files changed, 7 insertions(+), 11 deletions(-)

New commits:
commit 8479bbecd2434d65eb6c26100a783ecf96f6da12
Author: Michael Weghorn 
AuthorDate: Wed Jan 24 12:10:32 2024 +0100
Commit: Michael Weghorn 
CommitDate: Thu Jan 25 09:41:38 2024 +0100

sw a11y: Return SwAccessibleContext to avoid casting

Let `SwAccessibleMap::GetDocumentView_` return the
more concrete `rtl::Reference`
instead of `uno::Reference`, which
avoids having to cast in one place in
`SwAccessibleMap::DoInvalidateShapeSelection`
(and more places in upcoming changes).

Replace the null check by an assert, as
`SwAccessibleMap::GetDocumentView_` never
returns an empty reference.

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

diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx
index 6e5c189a97b4..9daf15b8ae07 100644
--- a/sw/inc/accmap.hxx
+++ b/sw/inc/accmap.hxx
@@ -131,8 +131,7 @@ class SwAccessibleMap final : public 
::accessibility::IAccessibleViewForwarder,
 
 void InvalidateRelationSet_( const SwFrame* pFrame, bool bFrom );
 
-css::uno::Reference
-GetDocumentView_( bool bPagePreview );
+rtl::Reference GetDocumentView_(bool bPagePreview);
 
 /** method to build up a new data structure of the accessible paragraphs,
 which have a selection
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index ebc877601efc..0a6da3f501b8 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -1556,14 +1556,11 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool 
bInvalidateFocusMode /*=fa
 const unsigned int SELECTION_WITH_NUM = 10;
 if (vecxShapeAdd.size() > SELECTION_WITH_NUM )
 {
- uno::Reference< XAccessible > xDoc = GetDocumentView( );
- SwAccessibleContext * pCont = static_cast(xDoc.get());
- if (pCont)
- {
- AccessibleEventObject aEvent;
- aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
- pCont->FireAccessibleEvent(aEvent);
- }
+rtl::Reference xDoc = GetDocumentView_(false);
+assert(xDoc.is());
+AccessibleEventObject aEvent;
+aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
+xDoc->FireAccessibleEvent(aEvent);
 }
 else
 {
@@ -1696,7 +1693,7 @@ SwAccessibleMap::~SwAccessibleMap()
 mpVSh->GetLayout()->RemoveAccessibleShell();
 }
 
-uno::Reference< XAccessible > SwAccessibleMap::GetDocumentView_(
+rtl::Reference SwAccessibleMap::GetDocumentView_(
 bool bPagePreview )
 {
 DBG_TESTSOLARMUTEX();


core.git: sw/source

 sw/source/core/access/accmap.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 25bda5d887b12015e0f7d32753408b20544b5566
Author: Michael Weghorn 
AuthorDate: Wed Jan 24 10:52:18 2024 +0100
Commit: Michael Weghorn 
CommitDate: Thu Jan 25 09:40:58 2024 +0100

sw a11y: Drop VEC_SHAPE typedef

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

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index bbb88a10a59b..ebc877601efc 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -1493,9 +1493,8 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool 
bInvalidateFocusMode /*=fa
 if( !pShapes )
 return;
 
-typedef std::vector< ::rtl::Reference < ::accessibility::AccessibleShape > 
 >  VEC_SHAPE;
-VEC_SHAPE vecxShapeAdd;
-VEC_SHAPE vecxShapeRemove;
+std::vector<::rtl::Reference<::accessibility::AccessibleShape>> 
vecxShapeAdd;
+std::vector<::rtl::Reference<::accessibility::AccessibleShape>> 
vecxShapeRemove;
 int nCountSelectedShape=0;
 
 vcl::Window *pWin = GetShell()->GetWin();


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

 svx/source/accessibility/AccessibleShape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit df266f613bc12c18ec8d1c9cdc250fda1bc6c45b
Author: Michael Weghorn 
AuthorDate: Wed Jan 24 10:19:58 2024 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jan 24 21:35:13 2024 +0100

svx a11y: Notify listeners when disposing shape

In `AccessibleShape::disposing`, call the same method
of the base class, i.e. `AccessibleContextBase::disposing`,
not `AccessibleContextBase::dispose`.

The code was moved from `AccessibleShape::dispose` to
`AccessibleShape::disposing` in

commit f11b151dc08ccfcb7e78bfd9a24c77670942ea63
Date:   Tue Apr 30 13:30:10 2002 +

#95585# Moved code from dispose to disposing().

and it seems likely that adjusting the base class method to call
was just forgotten/missed.

This resulted in the accessible getting disposed without listeners
getting notified (since `AccessibleContextBase::disposing` takes
care of that).

This resulted in a crash for the following scenario with the qt6
VCL plugin when the Orca screen reader is running:

1) start LO Writer
2) click on the "Basic shapes" toolbar button
3) click + drag to insert a shape into the document
4) click somewhere else

Backtrace is below.
`AtSpiAdaptor::handleMessage` (frame #12 in the bt) checks
whether the accessible is valid and returns early otherwise.
But since listeners were not notified when the object got disposed,
`QtAccessibleEventListener::disposing` wasn't called, which would
have taken care of invalidating the `QtAccessibleWidget`, in which
case this early return would have happened instead of the crash.

This behaves as expected now with this commit in place.

stderr output of the crash:

terminate called after throwing an instance of 
'com::sun::star::lang::DisposedException'

Backtrace:

Thread 1 received signal SIGABRT, Aborted.
__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  0x7f5bc1ca815f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7f5bc1c5a472 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x7f5bc1c444b2 in __GI_abort () at ./stdlib/abort.c:79
#4  0x7f5bc18a09eb in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x7f5bc18affca in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x7f5bc18b0035 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x7f5bc18b0288 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x7f5bc02b4550 in 
accessibility::AccessibleContextBase::ThrowIfDisposed() (this=0x55a6fc7e7da0) 
at .../libreoffice/editeng/source/accessibility/AccessibleContextBase.cxx:494
#9  0x7f5bbcf7d54e in 
accessibility::AccessibleShape::getAccessibleName() (this=0x55a6fc7e7da0) at 
.../libreoffice/svx/source/accessibility/AccessibleShape.cxx:280
#10 0x7f5bada62107 in QtAccessibleWidget::text(QAccessible::Text) 
const (this=0x55a6fad4fe20, text=QAccessible::Name) at 
.../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:362
#11 0x7f5bac5552d2 in 
AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, 
QDBusMessage const&, QDBusConnection const&) (this=0x55a6f769bce0, 
interface=0x55a6fad4fe20, function=..., message=..., connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1545
#12 0x7f5bac553cce in AtSpiAdaptor::handleMessage(QDBusMessage 
const&, QDBusConnection const&) (this=0x55a6f769bce0, message=..., 
connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1432
#13 0x7f5baaa88943 in 
QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, 
QDBusMessage const&, int) (this=0x7f5ba4010f30, node=..., msg=..., 
pathStartPos=27)
at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
#14 0x7f5baaa89628 in 
QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f5ba4026980) at 
.../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
#15 0x7f5bad044013 in QObject::event(QEvent*) (this=0x55a6f769bce0, 
e=0x7f5ba4026980) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447
#16 0x7f5bab1a6986 in QApplicationPrivate::notify_helper(QObject*, 
QEvent*) (this=0x55a6f631c3e0, receiver=0x55a6f769bce0, e=0x7f5ba4026980) at 
.../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298
#17 0x7f5bab1a6797 in QApplication::notify(QObject*, QEvent*) 

core.git: svx/source

 svx/source/accessibility/AccessibleShape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 38f98c60e797753fa54bf3649520995df9861b45
Author: Michael Weghorn 
AuthorDate: Wed Jan 24 10:19:58 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 17:34:58 2024 +0100

svx a11y: Notify listeners when disposing shape

In `AccessibleShape::disposing`, call the same method
of the base class, i.e. `AccessibleContextBase::disposing`,
not `AccessibleContextBase::dispose`.

The code was moved from `AccessibleShape::dispose` to
`AccessibleShape::disposing` in

commit f11b151dc08ccfcb7e78bfd9a24c77670942ea63
Date:   Tue Apr 30 13:30:10 2002 +

#95585# Moved code from dispose to disposing().

and it seems likely that adjusting the base class method to call
was just forgotten/missed.

This resulted in the accessible getting disposed without listeners
getting notified (since `AccessibleContextBase::disposing` takes
care of that).

This resulted in a crash for the following scenario with the qt6
VCL plugin when the Orca screen reader is running:

1) start LO Writer
2) click on the "Basic shapes" toolbar button
3) click + drag to insert a shape into the document
4) click somewhere else

Backtrace is below.
`AtSpiAdaptor::handleMessage` (frame #12 in the bt) checks
whether the accessible is valid and returns early otherwise.
But since listeners were not notified when the object got disposed,
`QtAccessibleEventListener::disposing` wasn't called, which would
have taken care of invalidating the `QtAccessibleWidget`, in which
case this early return would have happened instead of the crash.

This behaves as expected now with this commit in place.

stderr output of the crash:

terminate called after throwing an instance of 
'com::sun::star::lang::DisposedException'

Backtrace:

Thread 1 received signal SIGABRT, Aborted.
__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  0x7f5bc1ca815f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7f5bc1c5a472 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x7f5bc1c444b2 in __GI_abort () at ./stdlib/abort.c:79
#4  0x7f5bc18a09eb in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x7f5bc18affca in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x7f5bc18b0035 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x7f5bc18b0288 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x7f5bc02b4550 in 
accessibility::AccessibleContextBase::ThrowIfDisposed() (this=0x55a6fc7e7da0) 
at .../libreoffice/editeng/source/accessibility/AccessibleContextBase.cxx:494
#9  0x7f5bbcf7d54e in 
accessibility::AccessibleShape::getAccessibleName() (this=0x55a6fc7e7da0) at 
.../libreoffice/svx/source/accessibility/AccessibleShape.cxx:280
#10 0x7f5bada62107 in QtAccessibleWidget::text(QAccessible::Text) 
const (this=0x55a6fad4fe20, text=QAccessible::Name) at 
.../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:362
#11 0x7f5bac5552d2 in 
AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, 
QDBusMessage const&, QDBusConnection const&) (this=0x55a6f769bce0, 
interface=0x55a6fad4fe20, function=..., message=..., connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1545
#12 0x7f5bac553cce in AtSpiAdaptor::handleMessage(QDBusMessage 
const&, QDBusConnection const&) (this=0x55a6f769bce0, message=..., 
connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1432
#13 0x7f5baaa88943 in 
QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, 
QDBusMessage const&, int) (this=0x7f5ba4010f30, node=..., msg=..., 
pathStartPos=27)
at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
#14 0x7f5baaa89628 in 
QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f5ba4026980) at 
.../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
#15 0x7f5bad044013 in QObject::event(QEvent*) (this=0x55a6f769bce0, 
e=0x7f5ba4026980) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447
#16 0x7f5bab1a6986 in QApplicationPrivate::notify_helper(QObject*, 
QEvent*) (this=0x55a6f631c3e0, receiver=0x55a6f769bce0, e=0x7f5ba4026980) at 
.../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298
#17 0x7f5bab1a6797 in QApplication::notify(QObject*, QEvent*) 

core.git: vcl/inc vcl/qt5

 vcl/inc/qt5/QtInstanceMessageDialog.hxx |1 +
 vcl/qt5/QtInstanceMessageDialog.cxx |   20 
 2 files changed, 21 insertions(+)

New commits:
commit e44a322fd00e017ea6494d836f66e5ddf6cfa9d5
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 14:04:54 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 17:24:08 2024 +0100

tdf#154381 qt weld: Allow setting message box default button

Implement `QtInstanceMessageDialog::set_default_response`
by identifying the `QPushButton` in the `QMessageBox` that
has the `QMessageBox::ButtonRole` corresponding to the
given VCL return type and setting that as the default
button in the `QMessageBox`.

With this in place, the qt6 welded message dialog that
shows up when opening a file that's already open in another
instance of LibreOffice (s. `AlreadyOpenQueryBox::AlreadyOpenQueryBox`)
has initial focus on the "Open Read-Only" button when it opens,
just as is the case for the non-welded one
(whose use can be forced by setting env var
`SAL_VCL_QT_NO_WELDED_WIDGETS=1`).

Change-Id: I6d543b43cb6adec2dde9646e1452aa03bdcbf331
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162441
Tested-by: Jenkins
Reviewed-by: Omkar Acharekar  
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/QtInstanceMessageDialog.hxx 
b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
index 0c585a9ed916..ae353268833c 100644
--- a/vcl/inc/qt5/QtInstanceMessageDialog.hxx
+++ b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
@@ -33,6 +33,7 @@ public:
 // weld::Dialog overrides
 virtual void add_button(const OUString& rText, int nResponse,
 const OUString& rHelpId = {}) override;
+virtual void set_default_response(int nResponse) override;
 virtual int run() override;
 };
 
diff --git a/vcl/qt5/QtInstanceMessageDialog.cxx 
b/vcl/qt5/QtInstanceMessageDialog.cxx
index 6f252c79c816..ed48c5298a6c 100644
--- a/vcl/qt5/QtInstanceMessageDialog.cxx
+++ b/vcl/qt5/QtInstanceMessageDialog.cxx
@@ -9,6 +9,8 @@
 
 #include 
 
+#include 
+
 namespace
 {
 QMessageBox::ButtonRole lcl_vclResponseTypeToQtMessageBoxButtonRole(int 
nResponseType)
@@ -109,6 +111,24 @@ void QtInstanceMessageDialog::add_button(const OUString& 
rText, int nResponse, c
 
lcl_vclResponseTypeToQtMessageBoxButtonRole(nResponse));
 }
 
+void QtInstanceMessageDialog::set_default_response(int nResponse)
+{
+assert(m_pMessageDialog);
+
+const QList aButtons = m_pMessageDialog->buttons();
+for (QAbstractButton* pAbstractButton : aButtons)
+{
+QPushButton* pButton = dynamic_cast(pAbstractButton);
+assert(pButton);
+const QMessageBox::ButtonRole eRole = 
m_pMessageDialog->buttonRole(pButton);
+if (lcl_qtMessageBoxButtonRoleToVclResponseType(eRole) == nResponse)
+{
+m_pMessageDialog->setDefaultButton(pButton);
+return;
+}
+}
+}
+
 int QtInstanceMessageDialog::run()
 {
 // cannot use the QMessageBox::exec() return value right away, because it 
returns the


core.git: vcl/inc vcl/qt5

 vcl/inc/qt5/QtInstanceMessageDialog.hxx |5 +
 vcl/qt5/QtInstanceMessageDialog.cxx |   83 
 2 files changed, 88 insertions(+)

New commits:
commit bb0c0e422788b6c461387491c59911ad84c27b83
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 13:47:21 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 17:15:07 2024 +0100

tdf#154381 qt weld: Add button handling for message box

Override the `QtInstanceDialog` methods `add_button`
and `run` in `QtInstanceMessageDialog`, and implement
handling for these buttons with the native
`QMessageBox` that is used internally:

Implement `QtInstanceMessageDialog::add_button` to
make adding buttons to the welded message dialog
work.
Map the VCL response type to a corresponding
`QMessageBox::ButtonRole`. Some mappings are
straightforward, others are a bit more arbitrary,
but the only essential thing is that the mapping
back to the VCL response code is consistent.

`QMessageBox::exec` [1] overrides `QDialog::exec` [2],
and while the int returned by the latter corresponds
to a `QDialog::DialogCode` code, the int returned by
the former corresponds to a `QMessageBox::StandardButton`
value. Since the current `QtInstanceDialog::run` implementation
relies on the `QDialog` behaviour, override it for the
message dialog case. Since the `QMessageBox::ButtonRole`
is set in `QtInstanceMessageDialog::add_button`, retrieve
the corresponding role from the clicked button instead
of using the return value of the `QMessageBox::exec`
to be able to get the correct VCL return code again.

With this in place, the qt6 welded message dialog that
shows up when opening a file that's already open in another
instance of LibreOffice (s. `AlreadyOpenQueryBox::AlreadyOpenQueryBox`)
shows buttons and clicking any of them
behaves as expected, just as is the case for the non-welded one
(whose use can be forced by setting env var
`SAL_VCL_QT_NO_WELDED_WIDGETS=1`).

[1] https://doc.qt.io/qt-6/qmessagebox.html#exec`
[2] https://doc.qt.io/qt-6/qdialog.html#exec

Change-Id: Ie37573951302f13eab758f889d478dc9351e9c07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162440
Tested-by: Jenkins
Reviewed-by: Omkar Acharekar  
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/QtInstanceMessageDialog.hxx 
b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
index 68d2010cb1fa..0c585a9ed916 100644
--- a/vcl/inc/qt5/QtInstanceMessageDialog.hxx
+++ b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
@@ -29,6 +29,11 @@ public:
 virtual OUString get_primary_text() const override;
 
 virtual OUString get_secondary_text() const override;
+
+// weld::Dialog overrides
+virtual void add_button(const OUString& rText, int nResponse,
+const OUString& rHelpId = {}) override;
+virtual int run() override;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/QtInstanceMessageDialog.cxx 
b/vcl/qt5/QtInstanceMessageDialog.cxx
index 2ba386ded5c5..6f252c79c816 100644
--- a/vcl/qt5/QtInstanceMessageDialog.cxx
+++ b/vcl/qt5/QtInstanceMessageDialog.cxx
@@ -9,6 +9,69 @@
 
 #include 
 
+namespace
+{
+QMessageBox::ButtonRole lcl_vclResponseTypeToQtMessageBoxButtonRole(int 
nResponseType)
+{
+// RET_CANCEL, RET_HELP, RET_YES, RET_NO and RET_OK have a matching 
equivalent
+// in Qt, the others are a bit more arbitrary; what really matters about 
these
+// is only that the mapping here and the other way around
+// (in lcl_qtMessageBoxButtonRoleToVclResponseType) is consistent
+switch (nResponseType)
+{
+case RET_CANCEL:
+return QMessageBox::ButtonRole::RejectRole;
+case RET_HELP:
+return QMessageBox::ButtonRole::HelpRole;
+case RET_YES:
+return QMessageBox::ButtonRole::YesRole;
+case RET_NO:
+return QMessageBox::ButtonRole::NoRole;
+case RET_OK:
+return QMessageBox::ButtonRole::AcceptRole;
+case RET_RETRY:
+return QMessageBox::ButtonRole::ResetRole;
+case RET_IGNORE:
+return QMessageBox::ButtonRole::ActionRole;
+case RET_CLOSE:
+return QMessageBox::ButtonRole::DestructiveRole;
+default:
+assert(false && "Unhandled vcl response type");
+return QMessageBox::InvalidRole;
+}
+}
+
+VclResponseType lcl_qtMessageBoxButtonRoleToVclResponseType(int nRet)
+{
+// AcceptRole, HelpRole, NoRole, RejectRole and YesRole have a matching 
equivalent
+// in VCL, the others are a bit more arbitrary; what really matters about 
these
+// is only that the mapping here and the other way around
+// (in lcl_vclResponseTypeToQtMessageBoxButtonRole) is consistent
+switch (nRet)
+{
+case QMessageBox::ButtonRole::AcceptRole:
+return 

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

 vcl/inc/qt5/QtMenu.hxx  |1 -
 vcl/inc/qt5/QtTools.hxx |5 +
 vcl/qt5/QtMenu.cxx  |   21 +
 vcl/qt5/QtTools.cxx |9 -
 4 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit ae910722fcd778d71c9e73a860a9ad94eb449608
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 13:47:07 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 17:14:56 2024 +0100

qt: Move VCL -> Qt accelerator text handling to QtTools

Move the functionality to convert a string (potentially)
containing a VCL-style accelerator ('~') to the Qt equivalent
from `QtMenu::NativeItemText` to a new helper function
`vclToQtStringtWithAccelerator` in QtTools.hxx

This will be reused for button text in welded message dialogs
in an upcoming commit.

Change-Id: Ibedabb7937b97d195244045799c092463810d766
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162439
Tested-by: Jenkins
Reviewed-by: Omkar Acharekar  
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/QtMenu.hxx b/vcl/inc/qt5/QtMenu.hxx
index 587e1cfea8d1..28e5ac57146b 100644
--- a/vcl/inc/qt5/QtMenu.hxx
+++ b/vcl/inc/qt5/QtMenu.hxx
@@ -57,7 +57,6 @@ private:
 static OUString m_sCurrentHelpId;
 
 void DoFullMenuUpdate(Menu* pMenuBar);
-static void NativeItemText(OUString& rItemText);
 
 void InsertMenuItem(QtMenuItem* pSalMenuItem, unsigned nPos);
 
diff --git a/vcl/inc/qt5/QtTools.hxx b/vcl/inc/qt5/QtTools.hxx
index 20e0452188af..b419c1fd3da9 100644
--- a/vcl/inc/qt5/QtTools.hxx
+++ b/vcl/inc/qt5/QtTools.hxx
@@ -158,6 +158,11 @@ QString vclMessageTypeToQtTitle(VclMessageType eType);
 QMessageBox::StandardButtons vclButtonsTypeToQtButton(VclButtonsType 
eButtonType);
 int qtResponseTypeToVclResponseType(int ret);
 
+/** Converts a string potentially containing a '~' character to indicate an 
accelerator
+ *  to the Qt variant using '&' for the accelerator.
+ */
+QString vclToQtStringWithAccelerator(const OUString& rText);
+
 template 
 inline std::basic_ostream& operator<<(std::basic_ostream& stream,
  const QString& rString)
diff --git a/vcl/qt5/QtMenu.cxx b/vcl/qt5/QtMenu.cxx
index 93f3d6f5a378..e3494356fc8b 100644
--- a/vcl/qt5/QtMenu.cxx
+++ b/vcl/qt5/QtMenu.cxx
@@ -71,8 +71,7 @@ bool QtMenu::VisibleMenuBar() { return true; }
 void QtMenu::InsertMenuItem(QtMenuItem* pSalMenuItem, unsigned nPos)
 {
 sal_uInt16 nId = pSalMenuItem->mnId;
-OUString aText = mpVCLMenu->GetItemText(nId);
-NativeItemText(aText);
+const QString aText = 
vclToQtStringWithAccelerator(mpVCLMenu->GetItemText(nId));
 vcl::KeyCode nAccelKey = mpVCLMenu->GetAccelKey(nId);
 
 pSalMenuItem->mpAction.reset();
@@ -83,7 +82,7 @@ void QtMenu::InsertMenuItem(QtMenuItem* pSalMenuItem, 
unsigned nPos)
 // top-level menu
 if (validateQMenuBar())
 {
-QMenu* pQMenu = new QMenu(toQString(aText), nullptr);
+QMenu* pQMenu = new QMenu(aText, nullptr);
 connectHelpSignalSlots(pQMenu, pSalMenuItem);
 pSalMenuItem->mpMenu.reset(pQMenu);
 
@@ -122,7 +121,7 @@ void QtMenu::InsertMenuItem(QtMenuItem* pSalMenuItem, 
unsigned nPos)
 if (pSalMenuItem->mpSubMenu)
 {
 // submenu
-QMenu* pQMenu = new QMenu(toQString(aText), nullptr);
+QMenu* pQMenu = new QMenu(aText, nullptr);
 connectHelpSignalSlots(pQMenu, pSalMenuItem);
 pSalMenuItem->mpMenu.reset(pQMenu);
 
@@ -172,7 +171,7 @@ void QtMenu::InsertMenuItem(QtMenuItem* pSalMenuItem, 
unsigned nPos)
 else
 {
 // leaf menu
-QAction* pAction = new QAction(toQString(aText), nullptr);
+QAction* pAction = new QAction(aText, nullptr);
 pSalMenuItem->mpAction.reset(pAction);
 
 if ((nPos != MENU_APPEND)
@@ -556,9 +555,7 @@ void QtMenu::SetItemText(unsigned, SalMenuItem* pItem, 
const OUString& rText)
 QAction* pAction = pSalMenuItem->getAction();
 if (pAction)
 {
-OUString aText(rText);
-NativeItemText(aText);
-pAction->setText(toQString(aText));
+pAction->setText(vclToQtStringWithAccelerator(rText));
 }
 }
 
@@ -683,14 +680,6 @@ void QtMenu::slotMenuAboutToHide(QtMenuItem* pQItem)
 }
 }
 
-void QtMenu::NativeItemText(OUString& rItemText)
-{
-// preserve literal '&'s in menu texts
-rItemText = rItemText.replaceAll("&", "&&");
-
-rItemText = rItemText.replace('~', '&');
-}
-
 void QtMenu::slotCloseDocument()
 {
 MenuBar* pVclMenuBar = static_cast(mpVCLMenu.get());
diff --git a/vcl/qt5/QtTools.cxx b/vcl/qt5/QtTools.cxx
index 0f8af934d2fa..e4000f9a99c1 100644
--- a/vcl/qt5/QtTools.cxx
+++ b/vcl/qt5/QtTools.cxx
@@ -212,4 +212,10 @@ int qtResponseTypeToVclResponseType(int ret)
 return ret;
 }
 
+QString vclToQtStringWithAccelerator(const OUString& rText)
+{
+

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

 vcl/inc/qt5/QtInstanceDialog.hxx |4 ++--
 vcl/inc/qt5/QtInstanceWindow.hxx |7 ++-
 vcl/qt5/QtInstanceDialog.cxx |3 ++-
 vcl/qt5/QtInstanceWindow.cxx |   13 +++--
 4 files changed, 21 insertions(+), 6 deletions(-)

New commits:
commit d76d4df7ea1db0fdd27d350119ff7c0b2024b6e1
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 13:45:48 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 17:14:37 2024 +0100

tdf#154381 qt weld: Implement QtInstanceWindow::{g,s}et_title

Implement methods to set and get the window title.

In order to do that, add a `m_pWidget` member to
`QtInstanceWindow`. For the `QtInstanceDialog` case, that widget
is a pointer to the same dialog that `QtInstanceDialog::m_pDialog`
points to, which is a unique_ptr and thus takes care of the memory
management.

The non-dialog case is not supported yet, s.a. this commit
adding support for simple welded message dialogs initially:

commit 1ace23443b85d4a81b94656844f1b27e2987
Date:   Wed Dec 20 19:13:50 2023 +0530

tdf#130857 Use native qt widgets - simple message dialog

With this in place, the qt6 welded message dialog that
shows up when opening a file that's already open in another
instance of LO has the correct title ("Document in Use"),
just as is the case for the non-welded one
(whose use can be forced by setting env var
`SAL_VCL_QT_NO_WELDED_WIDGETS=1`).

Change-Id: I35f323cdfa70fb953b6bc73aaf726fb1f3098c45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162437
Tested-by: Jenkins
Reviewed-by: Omkar Acharekar  
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/QtInstanceWindow.hxx b/vcl/inc/qt5/QtInstanceWindow.hxx
index be6aec6623cd..c29863da4f67 100644
--- a/vcl/inc/qt5/QtInstanceWindow.hxx
+++ b/vcl/inc/qt5/QtInstanceWindow.hxx
@@ -13,7 +13,12 @@
 
 class QtInstanceWindow : public QtInstanceContainer, public virtual 
weld::Window
 {
-virtual void set_title(const OUString&) override;
+QWidget* m_pWidget;
+
+public:
+QtInstanceWindow(QWidget* pWidget);
+
+virtual void set_title(const OUString& rTitle) override;
 virtual OUString get_title() const override;
 virtual void window_move(int, int) override;
 virtual void set_modal(bool) override;
diff --git a/vcl/qt5/QtInstanceDialog.cxx b/vcl/qt5/QtInstanceDialog.cxx
index 8d884688e247..e65e4b749e13 100644
--- a/vcl/qt5/QtInstanceDialog.cxx
+++ b/vcl/qt5/QtInstanceDialog.cxx
@@ -10,7 +10,8 @@
 #include 
 
 QtInstanceDialog::QtInstanceDialog(QDialog* pDialog)
-: m_pDialog(pDialog)
+: QtInstanceWindow(pDialog)
+, m_pDialog(pDialog)
 {
 }
 
diff --git a/vcl/qt5/QtInstanceWindow.cxx b/vcl/qt5/QtInstanceWindow.cxx
index e0bf4bfdd2af..0e74c8d6f873 100644
--- a/vcl/qt5/QtInstanceWindow.cxx
+++ b/vcl/qt5/QtInstanceWindow.cxx
@@ -9,9 +9,18 @@
 
 #include 
 
-void QtInstanceWindow::set_title(const OUString&) {}
+QtInstanceWindow::QtInstanceWindow(QWidget* pWidget)
+: m_pWidget(pWidget)
+{
+assert(m_pWidget);
+}
+
+void QtInstanceWindow::set_title(const OUString& rTitle)
+{
+m_pWidget->setWindowTitle(toQString(rTitle));
+}
 
-OUString QtInstanceWindow::get_title() const { return OUString(); }
+OUString QtInstanceWindow::get_title() const { return 
toOUString(m_pWidget->windowTitle()); }
 
 void QtInstanceWindow::window_move(int, int) {}
 
commit 8efcb80c95ab173a3931da3b35fc1b5bf1e4e0d2
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 13:43:48 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 17:14:29 2024 +0100

qt weld: Make QtInstanceDialog::m_pDialog private

Change-Id: I757849beb06d0ce986be352feb34af463430333b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162436
Tested-by: Jenkins
Reviewed-by: Omkar Acharekar  
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/QtInstanceDialog.hxx b/vcl/inc/qt5/QtInstanceDialog.hxx
index 1eb7e5f63eb5..04b45d57a31f 100644
--- a/vcl/inc/qt5/QtInstanceDialog.hxx
+++ b/vcl/inc/qt5/QtInstanceDialog.hxx
@@ -13,9 +13,9 @@
 
 class QtInstanceDialog : public QtInstanceWindow, public virtual weld::Dialog
 {
-public:
 std::unique_ptr m_pDialog;
 
+public:
 QtInstanceDialog(QDialog* pDialog);
 
 virtual bool runAsync(std::shared_ptr const&,
@@ -48,4 +48,4 @@ public:
 virtual weld::Container* weld_content_area() override;
 };
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: Branch 'libreoffice-7-6' - vcl/qt5

 vcl/qt5/QtWidget.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 33c646b5044f77de2f1740f6e6b8c951139a96eb
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 09:32:07 2024 +0100
Commit: Michael Stahl 
CommitDate: Wed Jan 24 12:15:25 2024 +0100

tdf#159333 qt a11y: Process shortcuts only once

As described in

commit 69e708868f6046cada955a16bca966370ce3218a
Author: Michael Weghorn 
Date:   Thu Feb 20 08:14:36 2020 +0100

tdf#130794 qt5: Actually, ignore non-spontaneous 
QEvent::ShortcutOverride

and the previous

commit 034f56015c1c7a61faede33fb5306f63b5585632
Author: Michael Weghorn 
Date:   Mon Feb 17 10:38:15 2020 +0100

tdf#126785 qt5: Ignore external QEvent::ShortcutOverride

it refers to, duplicate events of type
`QEvent::ShortcutOverride` are received when a11y is
active, so those commits introduced ignoring of the
non-spontaneous one, and leaving processing for the
spontaneous event only, thus preventing duplication of
typed text.

However, keyboard shortcuts like Ctrl+V were still
processed twice: While they're only processed once
in `QtWidget::handleEvent` (for the spontaneous
event of type `QEvent::ShortcutOverride`), the keyboard
shortcut was additionally handled as the shortcut to
activate the action that's used for the menu entries,
e.g. the "Edit" -> "Paste" menu entry for Ctrl+V
(s. class `QtMenu`, where those are set).

Accept the non-spontaneous `QEvent::ShortcutOverride`
event to prevent that from happening.

Quoting the `QEvent::ShortcutOverride` doc [1]:

> Key press in child, for overriding shortcut key handling (QKeyEvent).
> When a shortcut is about to trigger, ShortcutOverride is sent to the
> active window. This allows clients (e.g. widgets) to signal that they
> will handle the shortcut themselves, by accepting the event. If the
> shortcut override is accepted, the event is delivered as a normal key
> press to the focus widget. Otherwise, it triggers the shortcut action,
> if one exists.

With this commit in place, the shortcut is only
processed once, as expected.

Potentially, this should ideally be addressed on Qt
side in the future, see the discussion in tdf#126785.

The duplication happens since this qtbase commit
(no longer with a local revert of it): [2]

commit 7c532891e0be2cf78c89738e175b3d312d305e4e
Date:   Tue Apr 17 16:45:09 2018 +0200

Send ShortcutOverride event when receiving a non-spontaneous key 
press

Since 2020, there a pending Qt change by Alexander Volkov
suggesting to avoid the duplicate events by filtering them
out in `QSpiApplicationAdaptor::eventFilter` on qtbase
side: [3]

With that change not being merged yet, fix this on LO side
for now.

[1] https://doc.qt.io/qt-6/qevent.html#Type-enum
[2] 
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=7c532891e0be2cf78c89738e175b3d312d305e4e
[3] https://codereview.qt-project.org/c/qt/qtbase/+/295892

Change-Id: I28cb11914ae81284e050bff0deb39d95e8073ce0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162430
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 6e20e58270c88c8c77f156be75c23c66e1169e44)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162454
Reviewed-by: Michael Stahl 

diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index 83ada7866f2b..f8fa70886cb2 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -641,6 +641,9 @@ bool QtWidget::handleEvent(QtFrame& rFrame, QWidget& 
rWidget, QEvent* pEvent)
 // is called below (s. tdf#122053)
 if (!pEvent->spontaneous())
 {
+// accept event so shortcut action (from menu) isn't triggered in 
addition
+// to the processing for the spontaneous event further below
+pEvent->accept();
 return false;
 }
 


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

 vcl/qt5/QtWidget.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit ac136a069ef69fd7e9c71256a93499475631794b
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 09:32:07 2024 +0100
Commit: Michael Stahl 
CommitDate: Wed Jan 24 12:15:05 2024 +0100

tdf#159333 qt a11y: Process shortcuts only once

As described in

commit 69e708868f6046cada955a16bca966370ce3218a
Author: Michael Weghorn 
Date:   Thu Feb 20 08:14:36 2020 +0100

tdf#130794 qt5: Actually, ignore non-spontaneous 
QEvent::ShortcutOverride

and the previous

commit 034f56015c1c7a61faede33fb5306f63b5585632
Author: Michael Weghorn 
Date:   Mon Feb 17 10:38:15 2020 +0100

tdf#126785 qt5: Ignore external QEvent::ShortcutOverride

it refers to, duplicate events of type
`QEvent::ShortcutOverride` are received when a11y is
active, so those commits introduced ignoring of the
non-spontaneous one, and leaving processing for the
spontaneous event only, thus preventing duplication of
typed text.

However, keyboard shortcuts like Ctrl+V were still
processed twice: While they're only processed once
in `QtWidget::handleEvent` (for the spontaneous
event of type `QEvent::ShortcutOverride`), the keyboard
shortcut was additionally handled as the shortcut to
activate the action that's used for the menu entries,
e.g. the "Edit" -> "Paste" menu entry for Ctrl+V
(s. class `QtMenu`, where those are set).

Accept the non-spontaneous `QEvent::ShortcutOverride`
event to prevent that from happening.

Quoting the `QEvent::ShortcutOverride` doc [1]:

> Key press in child, for overriding shortcut key handling (QKeyEvent).
> When a shortcut is about to trigger, ShortcutOverride is sent to the
> active window. This allows clients (e.g. widgets) to signal that they
> will handle the shortcut themselves, by accepting the event. If the
> shortcut override is accepted, the event is delivered as a normal key
> press to the focus widget. Otherwise, it triggers the shortcut action,
> if one exists.

With this commit in place, the shortcut is only
processed once, as expected.

Potentially, this should ideally be addressed on Qt
side in the future, see the discussion in tdf#126785.

The duplication happens since this qtbase commit
(no longer with a local revert of it): [2]

commit 7c532891e0be2cf78c89738e175b3d312d305e4e
Date:   Tue Apr 17 16:45:09 2018 +0200

Send ShortcutOverride event when receiving a non-spontaneous key 
press

Since 2020, there a pending Qt change by Alexander Volkov
suggesting to avoid the duplicate events by filtering them
out in `QSpiApplicationAdaptor::eventFilter` on qtbase
side: [3]

With that change not being merged yet, fix this on LO side
for now.

[1] https://doc.qt.io/qt-6/qevent.html#Type-enum
[2] 
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=7c532891e0be2cf78c89738e175b3d312d305e4e
[3] https://codereview.qt-project.org/c/qt/qtbase/+/295892

Change-Id: I28cb11914ae81284e050bff0deb39d95e8073ce0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162430
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit f4cc37c06ae15923df6b15777f2526008c2b4ca6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162453
Reviewed-by: Michael Stahl 

diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index a7c4f32e9243..996a0a7cc9ce 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -697,6 +697,9 @@ bool QtWidget::handleEvent(QtFrame& rFrame, QWidget& 
rWidget, QEvent* pEvent)
 // is called below (s. tdf#122053)
 if (!pEvent->spontaneous())
 {
+// accept event so shortcut action (from menu) isn't triggered in 
addition
+// to the processing for the spontaneous event further below
+pEvent->accept();
 return false;
 }
 


core.git: vcl/qt5

 vcl/qt5/QtWidget.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 6e20e58270c88c8c77f156be75c23c66e1169e44
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 09:32:07 2024 +0100
Commit: Michael Weghorn 
CommitDate: Tue Jan 23 14:25:20 2024 +0100

tdf#159333 qt a11y: Process shortcuts only once

As described in

commit 69e708868f6046cada955a16bca966370ce3218a
Author: Michael Weghorn 
Date:   Thu Feb 20 08:14:36 2020 +0100

tdf#130794 qt5: Actually, ignore non-spontaneous 
QEvent::ShortcutOverride

and the previous

commit 034f56015c1c7a61faede33fb5306f63b5585632
Author: Michael Weghorn 
Date:   Mon Feb 17 10:38:15 2020 +0100

tdf#126785 qt5: Ignore external QEvent::ShortcutOverride

it refers to, duplicate events of type
`QEvent::ShortcutOverride` are received when a11y is
active, so those commits introduced ignoring of the
non-spontaneous one, and leaving processing for the
spontaneous event only, thus preventing duplication of
typed text.

However, keyboard shortcuts like Ctrl+V were still
processed twice: While they're only processed once
in `QtWidget::handleEvent` (for the spontaneous
event of type `QEvent::ShortcutOverride`), the keyboard
shortcut was additionally handled as the shortcut to
activate the action that's used for the menu entries,
e.g. the "Edit" -> "Paste" menu entry for Ctrl+V
(s. class `QtMenu`, where those are set).

Accept the non-spontaneous `QEvent::ShortcutOverride`
event to prevent that from happening.

Quoting the `QEvent::ShortcutOverride` doc [1]:

> Key press in child, for overriding shortcut key handling (QKeyEvent).
> When a shortcut is about to trigger, ShortcutOverride is sent to the
> active window. This allows clients (e.g. widgets) to signal that they
> will handle the shortcut themselves, by accepting the event. If the
> shortcut override is accepted, the event is delivered as a normal key
> press to the focus widget. Otherwise, it triggers the shortcut action,
> if one exists.

With this commit in place, the shortcut is only
processed once, as expected.

Potentially, this should ideally be addressed on Qt
side in the future, see the discussion in tdf#126785.

The duplication happens since this qtbase commit
(no longer with a local revert of it): [2]

commit 7c532891e0be2cf78c89738e175b3d312d305e4e
Date:   Tue Apr 17 16:45:09 2018 +0200

Send ShortcutOverride event when receiving a non-spontaneous key 
press

Since 2020, there a pending Qt change by Alexander Volkov
suggesting to avoid the duplicate events by filtering them
out in `QSpiApplicationAdaptor::eventFilter` on qtbase
side: [3]

With that change not being merged yet, fix this on LO side
for now.

[1] https://doc.qt.io/qt-6/qevent.html#Type-enum
[2] 
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=7c532891e0be2cf78c89738e175b3d312d305e4e
[3] https://codereview.qt-project.org/c/qt/qtbase/+/295892

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

diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index a7c4f32e9243..996a0a7cc9ce 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -697,6 +697,9 @@ bool QtWidget::handleEvent(QtFrame& rFrame, QWidget& 
rWidget, QEvent* pEvent)
 // is called below (s. tdf#122053)
 if (!pEvent->spontaneous())
 {
+// accept event so shortcut action (from menu) isn't triggered in 
addition
+// to the processing for the spontaneous event further below
+pEvent->accept();
 return false;
 }
 


core.git: android/source

 android/source/gradle/wrapper/gradle-wrapper.jar|binary
 android/source/gradle/wrapper/gradle-wrapper.properties |5 +-
 android/source/gradlew  |   30 +++-
 android/source/gradlew.bat  |   15 
 4 files changed, 34 insertions(+), 16 deletions(-)

New commits:
commit 89e7c04ba48dab824e9f291d7db38dac6ffd6b19
Author: Michael Weghorn 
AuthorDate: Mon Jan 15 11:34:32 2024 +0100
Commit: Michael Weghorn 
CommitDate: Tue Jan 16 17:27:54 2024 +0100

android: Update gradle + wrapper to 8.5

Commit the result of running

./gradlew wrapper --distribution-type all --gradle-version 8.5 
--gradle-distribution-sha256-sum=c16d517b50dd28b3f5838f0e844b7520b8f1eb610f2f29de7e4e04a1b7c9c79b

(minus the automatically added `networkTimeout=1` in
`android/source/gradle/wrapper/gradle-wrapper.properties`).

This includes the following upstream change for gradle
to port from the use of `which` to the more portable
`command -v`: [1]

Thanks to Eli Schwartz for pointing this out in his previous
Gerrit change [2] that was suggesting to only backport
that particular change to the wrapper script.

[1] https://github.com/gradle/gradle/pull/23961
[2] https://gerrit.libreoffice.org/c/core/+/160667

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

diff --git a/android/source/gradle/wrapper/gradle-wrapper.jar 
b/android/source/gradle/wrapper/gradle-wrapper.jar
index 41d9927a4d4f..033e24c4cdf4 100644
Binary files a/android/source/gradle/wrapper/gradle-wrapper.jar and 
b/android/source/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/android/source/gradle/wrapper/gradle-wrapper.properties 
b/android/source/gradle/wrapper/gradle-wrapper.properties
index ec719b3ea19d..cdea548c75ee 100644
--- a/android/source/gradle/wrapper/gradle-wrapper.properties
+++ b/android/source/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,7 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionSha256Sum=5022b0b25fe182b0e50867e77f484501dba44feeea88f5c1f13b6b4660463640
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
+distributionSha256Sum=c16d517b50dd28b3f5838f0e844b7520b8f1eb610f2f29de7e4e04a1b7c9c79b
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
+validateDistributionUrl=true
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
diff --git a/android/source/gradlew b/android/source/gradlew
index 1b6c787337ff..fcb6fca147c0 100755
--- a/android/source/gradlew
+++ b/android/source/gradlew
@@ -55,7 +55,7 @@
 #   Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#   
https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#   
https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #   within the Gradle project.
 #
 #   You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,10 @@ do
 esac
 done
 
-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
-
-APP_NAME="Gradle"
+# This is normally unused
+# shellcheck disable=SC2034
 APP_BASE_NAME=${0##*/}
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to 
pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
 
 # Use the maximum available, or set MAX_FD != -1 to use that value.
 MAX_FD=maximum
@@ -133,22 +130,29 @@ location of your Java installation."
 fi
 else
 JAVACMD=java
-which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 
'java' command could be found in your PATH.
+if ! command -v java >/dev/null 2>&1
+then
+die "ERROR: JAVA_HOME is not set and no 'java' command could be found 
in your PATH.
 
 Please set the JAVA_HOME variable in your environment to match the
 location of your Java installation."
+fi
 fi
 
 # Increase the maximum file descriptors if we can.
 if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
 case $MAX_FD in #(
   max*)
+# In POSIX sh, ulimit -H is undefined. That's why the result is 
checked to see if it worked.
+# shellcheck disable=SC3045
 MAX_FD=$( ulimit -H -n ) ||
 warn "Could not query maximum file descriptor limit"
 esac
 case $MAX_FD in  #(
   '' | soft) :;; #(
   *)
+# In POSIX sh, ulimit -n is undefined. That's why the result is 
checked to see if it worked.
+# shellcheck disable=SC3045
 ulimit -n "$MAX_FD" ||
 warn "Could not set maximum file descriptor limit to $MAX_FD"
 esac
@@ -193,6 

core.git: 2 commits - android/source

 android/source/build.gradle  |2 +-
 android/source/res/drawable-hdpi/ic_keyboard.xml |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit ca931f4762eb7a47802270689b665b472908740d
Author: Michael Weghorn 
AuthorDate: Wed Jan 10 10:54:20 2024 +0100
Commit: Michael Weghorn 
CommitDate: Mon Jan 15 11:15:17 2024 +0100

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

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

diff --git a/android/source/build.gradle b/android/source/build.gradle
index 69c7785c0179..090d73f49bfb 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.10.0'
+implementation 'com.google.android.material:material:1.11.0'
 implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
 implementation "androidx.multidex:multidex:2.0.1"
 }
commit c0a10888ab966b34cea1bf9a079725f89f133dcd
Author: Michael Weghorn 
AuthorDate: Wed Jan 10 13:13:39 2024 +0100
Commit: Michael Weghorn 
CommitDate: Mon Jan 15 11:15:09 2024 +0100

android: Avoid icon name clash with material library

Rename the file for the keyboard icon from
`ic_keyboard_black_24dp.png` to
`ic_keyboard_black__24dp.png` (note the extra underscore)
to avoid a name clash with an icon of the same name
in the Material components: [1]

Keeping the same name would result in this lint error when
upgrading to material 1.11.0 (which an upcoming commit will
do):

> 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/res/drawable-hdpi/ic_keyboard.xml:4:
 Error: The resource @drawable/ic_keyboard_black_24dp is marked as private in 
com.google.android.material:material:1.11.0 [PrivateResource]
android:src="@drawable/ic_keyboard_black_24dp"
 

   Explanation for issues of type "PrivateResource":
   Private resources should not be referenced; the may not be present
   everywhere, and even where they are they may disappear without 
notice.

   To fix this, copy the resource into your own project instead.

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

(For the currently-used material 1.10.0, this warning was previously
ignored since it's already listed in the lint-baseline.xml file, but that 
doesn't
apply any more after an update.)

[1] 
https://github.com/material-components/material-components-android/blob/bb351291a360319df31d5cee27e091c3e64f65a4/lib/java/com/google/android/material/timepicker/res/drawable/ic_keyboard_black_24dp.xml

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

diff --git a/android/source/res/drawable-hdpi/ic_keyboard.xml 
b/android/source/res/drawable-hdpi/ic_keyboard.xml
index 00902169d505..2aea0f7597a7 100644
--- a/android/source/res/drawable-hdpi/ic_keyboard.xml
+++ b/android/source/res/drawable-hdpi/ic_keyboard.xml
@@ -1,5 +1,5 @@
 
 
 http://schemas.android.com/apk/res/android;
-android:src="@drawable/ic_keyboard_black_24dp"
-android:tint="@color/toolbar_foreground"/>
\ No newline at end of file
+android:src="@drawable/ic_keyboard_black__24dp"
+android:tint="@color/toolbar_foreground"/>
diff --git a/android/source/res/drawable-xxxhdpi/ic_keyboard_black_24dp.png 
b/android/source/res/drawable-xxxhdpi/ic_keyboard_black__24dp.png
similarity index 100%
rename from android/source/res/drawable-xxxhdpi/ic_keyboard_black_24dp.png
rename to android/source/res/drawable-xxxhdpi/ic_keyboard_black__24dp.png


core.git: android/source

 android/source/build.gradle |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 15eda65d04250434c099f953b2fea9a5325c5fb5
Author: Michael Weghorn 
AuthorDate: Wed Jan 10 10:22:42 2024 +0100
Commit: Michael Weghorn 
CommitDate: Mon Jan 15 11:14:53 2024 +0100

android: Update Android Gradle Plugin to 8.2.1

This was suggested by Android Studio.

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

diff --git a/android/source/build.gradle b/android/source/build.gradle
index 009e9b59a742..69c7785c0179 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.0'
+classpath 'com.android.tools.build:gradle:8.2.1'
 }
 }
 


core.git: Branch 'libreoffice-7-6' - android/Bootstrap android/source

 android/Bootstrap/Makefile.shared|4 +
 android/source/src/java/org/libreoffice/AboutDialogFragment.java |   24 
+++---
 2 files changed, 12 insertions(+), 16 deletions(-)

New commits:
commit 1aa6a12f4d963b6949b6958c165c47bc059ab974
Author: Michael Weghorn 
AuthorDate: Thu Nov 30 13:16:26 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jan 5 15:59:37 2024 +0100

android: Separate build ID and vendor from versionName

So far, the versionName for the LibreOffice APK/app bundle
included the build ID and vendor, was e.g.
"24.2.0.0.alpha1+/2972af9045a5/The Document Foundation".

That versionName would be split again to extract the build ID
and vendor to display them in the about dialog.

No longer include build ID and vendor in the `versionName`,
but use separate build config variables, similar to what
is done for the privacy policy.

This slightly simplifies the code for the about dialog.

But more importantly, the previous `versionName` scheme
would make it impossible to automate the F-Droid update
of the app, because the scheme is not compatible with
the expectations of F-Droid's update mechanism, see the
F-Droid merge request to update LibreOffice Viewer to 7.6.3 [1]
for more details, in particular the (eventually not merged)
commit [2] mentioning what manual steps would still be needed
when trying to semi-automate the update at least.

[1] https://gitlab.com/fdroid/fdroiddata/-/merge_requests/14080
[2] 
https://gitlab.com/fdroid/fdroiddata/-/merge_requests/14080/diffs?commit_id=bfc062a358dc574326a29f08e01c0e80cadd80cb

Change-Id: Ibede06d13095d8e83dcc88ee09a8a610d6a9de0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160150
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 35b7aa3a865eda90bec945ac2e11b20a75a37bd6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160154
Reviewed-by: Caolán McNamara 

diff --git a/android/Bootstrap/Makefile.shared 
b/android/Bootstrap/Makefile.shared
index d1177edc1694..73621c1c39ff 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -113,6 +113,8 @@ liboSettings.gradle: $(BUILDDIR)/config_build.mk 
$(BUILDDIR)/config_host.mk $(SR
&& echo "archivesBaseName = 'LibreOfficeViewer'" \
&& echo "minSdkVersion = $(ANDROID_API_LEVEL)" \
&& echo "versionCode project.hasProperty('cmdVersionCode') 
? cmdVersionCode.toInteger() : $(if $(versionCode),$(versionCode),1)" \
-   && echo "versionName 
'$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)/$(shell
 cd $(SRCDIR) && git log -1 --format=%h)/$(OOO_VENDOR)'" \
+   && echo "versionName 
'$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)'"
 \
+   && echo "buildConfigField('String', 'BUILD_ID_SHORT', 
'\"$(shell cd $(SRCDIR) && git log -1 --format=%h)\"')" \
+   && echo "buildConfigField('String', 'VENDOR', 
'\"$(OOO_VENDOR)\"')" \
&& echo "}" \
) > $@
diff --git a/android/source/src/java/org/libreoffice/AboutDialogFragment.java 
b/android/source/src/java/org/libreoffice/AboutDialogFragment.java
index 17c636629f61..c699adb61bc6 100644
--- a/android/source/src/java/org/libreoffice/AboutDialogFragment.java
+++ b/android/source/src/java/org/libreoffice/AboutDialogFragment.java
@@ -45,21 +45,15 @@ public class AboutDialogFragment extends DialogFragment {
 {
 String versionName = getActivity().getPackageManager()
 .getPackageInfo(getActivity().getPackageName(), 
0).versionName;
-String[] tokens = versionName.split("/");
-if (tokens.length == 3)
-{
-String version = 
String.format(getString(R.string.app_version), tokens[0], tokens[1]);
-@SuppressWarnings("deprecation") // since 24 with additional 
option parameter
-Spanned versionString = Html.fromHtml(version);
-TextView versionView = 
messageView.findViewById(R.id.about_version);
-versionView.setText(versionString);
-
versionView.setMovementMethod(LinkMovementMethod.getInstance());
-TextView vendorView = 
messageView.findViewById(R.id.about_vendor);
-String vendor = 
getString(R.string.app_vendor).replace("$VENDOR", tokens[2]);
-vendorView.setText(vendor);
-}
-else
-throw new PackageManager.NameNotFoundException();
+String version = String.format(getString(R.string.app_version), 
versionName, BuildConfig.BUILD_ID_SHORT);
+

core.git: vcl/README.vars.md

 vcl/README.vars.md |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7606097a734ec1f32bb2e3968b44305649523053
Author: Michael Weghorn 
AuthorDate: Sun Dec 24 00:23:39 2023 +0100
Commit: Michael Weghorn 
CommitDate: Sun Dec 24 10:16:41 2023 +0100

vcl/README.vars: SAL_FORCEDPI works for all Linux vcl plugins

Running any of the Linux VCL plugins with
SAL_FORCEDPI=192 resulted in a scaled UI for all of them
in a quick test, so update the README accordingly.

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

diff --git a/vcl/README.vars.md b/vcl/README.vars.md
index 5d16941aaa6b..44764cbb0a14 100644
--- a/vcl/README.vars.md
+++ b/vcl/README.vars.md
@@ -7,7 +7,7 @@ These are the general environment variables used in the VCL:
 * `SAL_USE_VCLPLUGIN` - use a VCL plugin
 * `SAL_RTL_ENABLED` - Enable RTL UI
 * `SAL_NO_NWF` - disable native widgets
-* `SAL_FORCEDPI` - force a specific DPI (gtk3 & qt5/kf5 plugins only)
+* `SAL_FORCEDPI` - force a specific DPI (gen, gtk3/gtk4, qt5/qt6/kf5/kf6 
plugins only)
 * `SAL_FORCE_HC` - force high-contrast mode
 * `SAL_USE_SYSTEM_LOOP` - calls std::abort on nested event loop calls. 
Currently just for Qt with many crashes. WIP.
 


core.git: 2 commits - vcl/qt5 vcl/README.vars.md

 vcl/README.vars.md  |4 ++--
 vcl/qt5/QtData.cxx  |5 +
 vcl/qt5/QtGraphics_Text.cxx |2 +-
 3 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 792b6fec15099242ad93e0b6a341c02035f049fe
Author: Michael Weghorn 
AuthorDate: Sun Dec 24 00:18:40 2023 +0100
Commit: Michael Weghorn 
CommitDate: Sun Dec 24 10:16:29 2023 +0100

qt: Rename SAL_VCL_{QT5 -> QT}_NO_NATIVE

Similar to

Change-Id: I01b427648ef14f918cc692b30c80a7427455324f
Author: Michael Weghorn 
Date:   Sun Dec 24 00:13:25 2023 +0100

qt: Rename SAL_VCL_QT5_NO_NATIVE and use for all Qt-based VCLs

, drop the version name in the env var to evaluate to
decide whether to use fontconfig or not, since there's
no reason this should only apply for qt5-based VCLs
and not qt6-based ones.
(Other than for the above-mentioned commit, the env
variable would already be evaluated for all Qt-based
VCL plugins, not just the qt5 one.)

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

diff --git a/vcl/README.vars.md b/vcl/README.vars.md
index 72fa32cd8ae5..5d16941aaa6b 100644
--- a/vcl/README.vars.md
+++ b/vcl/README.vars.md
@@ -65,7 +65,7 @@ will be used to write the log under `instdir/uitest/`.
 ## Qt
 
 * `QT_SCALE_FACTOR=2` - for HiDPI testing (also supports float)
-* `SAL_VCL_QT5_NO_FONTCONFIG` - ignore fontconfig provided font substitutions
+* `SAL_VCL_QT_NO_FONTCONFIG` - ignore fontconfig provided font substitutions
 * `SAL_VCL_QT_NO_NATIVE` - disable `QStyle`'d controls
 * `SAL_VCL_QT_USE_QFONT` - use `QFont` for text layout and rendering (default 
is to use cairo)
 
diff --git a/vcl/qt5/QtGraphics_Text.cxx b/vcl/qt5/QtGraphics_Text.cxx
index 19837d510f13..55613a625a3b 100644
--- a/vcl/qt5/QtGraphics_Text.cxx
+++ b/vcl/qt5/QtGraphics_Text.cxx
@@ -85,7 +85,7 @@ bool QtGraphics::GetFontCapabilities(vcl::FontCapabilities& 
rFontCapabilities) c
 
 void QtGraphics::GetDevFontList(vcl::font::PhysicalFontCollection* pPFC)
 {
-static const bool bUseFontconfig = (nullptr == 
getenv("SAL_VCL_QT5_NO_FONTCONFIG"));
+static const bool bUseFontconfig = (nullptr == 
getenv("SAL_VCL_QT_NO_FONTCONFIG"));
 
 if (pPFC->Count())
 return;
commit 0b3e088d4888307c0beb3d4e670560e45459f4b2
Author: Michael Weghorn 
AuthorDate: Sun Dec 24 00:13:25 2023 +0100
Commit: Michael Weghorn 
CommitDate: Sun Dec 24 10:16:21 2023 +0100

qt: Rename SAL_VCL_QT5_NO_NATIVE and use for all Qt-based VCLs

Instead of evaluating a `SAL_VCL_QT5_NO_NATIVE` environment
variable to determine whether to disable drawing of widgets
using the `QStyle`, evaluate `SAL_VCL_QT_NO_NATIVE` (i.e. without
a Qt version number in the name), and do this for all Qt-based
VCL plugins (qt5, qt6, kf5, kf6), not only qt5.

I don't see a reason why this should be qt5-specific.

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

diff --git a/vcl/README.vars.md b/vcl/README.vars.md
index 92931b51f170..72fa32cd8ae5 100644
--- a/vcl/README.vars.md
+++ b/vcl/README.vars.md
@@ -66,7 +66,7 @@ will be used to write the log under `instdir/uitest/`.
 
 * `QT_SCALE_FACTOR=2` - for HiDPI testing (also supports float)
 * `SAL_VCL_QT5_NO_FONTCONFIG` - ignore fontconfig provided font substitutions
-* `SAL_VCL_QT5_NO_NATIVE` - disable `QStyle`'d controls
+* `SAL_VCL_QT_NO_NATIVE` - disable `QStyle`'d controls
 * `SAL_VCL_QT_USE_QFONT` - use `QFont` for text layout and rendering (default 
is to use cairo)
 
 ## Mac
diff --git a/vcl/qt5/QtData.cxx b/vcl/qt5/QtData.cxx
index cc2883ae80ca..2df26d05481e 100644
--- a/vcl/qt5/QtData.cxx
+++ b/vcl/qt5/QtData.cxx
@@ -217,10 +217,7 @@ bool QtData::ErrorTrapPop(bool /*bIgnoreError*/) { return 
false; }
 
 bool QtData::noNativeControls()
 {
-static const bool bNoNative
-= ((nullptr != getenv("SAL_VCL_QT5_NO_NATIVE")) && (nullptr != 
ImplGetSVData())
-   && ImplGetSVData()->maAppData.mxToolkitName
-   && ImplGetSVData()->maAppData.mxToolkitName->match("qt5"));
+static const bool bNoNative = (getenv("SAL_VCL_QT_NO_NATIVE") != nullptr);
 return bNoNative;
 }
 


core.git: vcl/unx

 vcl/unx/gtk4/gtkaccessibleeventlistener.cxx |4 
 vcl/unx/gtk4/gtkaccessibleregistry.cxx  |4 
 2 files changed, 8 insertions(+)

New commits:
commit f557e22a675164a1b9b0286a263a81d634959733
Author: Michael Weghorn 
AuthorDate: Fri Dec 22 08:45:26 2023 +0100
Commit: Michael Weghorn 
CommitDate: Fri Dec 22 10:14:47 2023 +0100

gtk4 a11y: Fix build for Gtk < 4.9

The code in `vcl/unx/gtk4/a11y.cxx` is

#if GTK_CHECK_VERSION(4, 9, 0)

, so should the code using that be.

Should fix this issue reported in [1]:

> Hi, building on Linux (Debian 12) breaks with the following error:
>
> [LNK] Library/libvclplug_gtk4lo.so
> ld.lld: error: undefined symbol: lo_accessible_new(_GdkDisplay*, 
_GtkAccessible*, 
com::sun::star::uno::Reference 
const&)
> >>> referenced by gtkaccessibleregistry.cxx
> >>>   
/home/etna/Tmpdir/libreoffice/build/workdir/CxxObject/vcl/unx/gtk4/gtkaccessibleregistry.o:(GtkAccessibleRegistry::getLOAccessible(com::sun::star::uno::Reference,
 _GdkDisplay*, _GtkAccessible*))
> clang-15: error: linker command failed with exit code 1 (use -v to see 
invocation)
> make[1]: *** 
[/home/etna/Tmpdir/libreoffice/vcl/Library_vclplug_gtk4.mk:20: 
/home/etna/Tmpdir/libreoffice/build/instdir/program/libvclplug_gtk4lo.so] Error 
1
> make[1]: *** Waiting for unfinished jobs
>
> I was able to get the build to succeed by rolling back commit 70ef230 ( 
https://github.com/LibreOffice/core/commit/70ef230aae4f961c8197cc11a7ff5feaf1d96c20
 )

[1] 
https://lists.freedesktop.org/archives/libreoffice/2023-December/091330.html

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

diff --git a/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx 
b/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx
index 256073805e7c..4211340d7ee3 100644
--- a/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx
+++ b/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx
@@ -14,6 +14,8 @@
 #include "gtkaccessibleeventlistener.hxx"
 #include "gtkaccessibleregistry.hxx"
 
+#if GTK_CHECK_VERSION(4, 9, 0)
+
 GtkAccessibleEventListener::GtkAccessibleEventListener(LoAccessible* 
pLoAccessible)
 : m_pLoAccessible(pLoAccessible)
 {
@@ -65,4 +67,6 @@ void GtkAccessibleEventListener::notifyEvent(
 }
 }
 
+#endif
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk4/gtkaccessibleregistry.cxx 
b/vcl/unx/gtk4/gtkaccessibleregistry.cxx
index 3f5df43ed40e..e29a86bdb648 100644
--- a/vcl/unx/gtk4/gtkaccessibleregistry.cxx
+++ b/vcl/unx/gtk4/gtkaccessibleregistry.cxx
@@ -12,6 +12,8 @@
 
 #include 
 
+#if GTK_CHECK_VERSION(4, 9, 0)
+
 std::map 
GtkAccessibleRegistry::m_aMapping = {};
 
 LoAccessible*
@@ -38,4 +40,6 @@ void 
GtkAccessibleRegistry::remove(css::uno::Reference

core.git: vcl/unx

 vcl/unx/gtk4/a11y.cxx |   20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 1a81fd69e10ad1ce7193fe7231ff29b2b94f67c7
Author: Michael Weghorn 
AuthorDate: Wed Dec 20 08:14:24 2023 +0100
Commit: Michael Weghorn 
CommitDate: Wed Dec 20 22:29:50 2023 +0100

gtk4 a11y: Take SELECTABLE/EXPANDABLE states into account

The Gtk API has no direct equivalent for the selectable
and expandable states, but sets them on the AT-SPI layer
whenever a value for the selected/expanded states is
explicitly set.
Therefore, only explicitly set values for these
if the selectable/expandable state is present,
to avoid the expandable/selectable state being
set on AT-SPI layer when it shouldn't.

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

diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index 48c22beb21ee..6bc89f15c401 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -296,11 +296,7 @@ static void applyStates(GtkAccessible* pGtkAccessible,
 pGtkAccessible, GTK_ACCESSIBLE_STATE_BUSY,
 bool(nStates & 
com::sun::star::accessibility::AccessibleStateType::BUSY),
 GTK_ACCESSIBLE_STATE_DISABLED,
-bool(!(nStates & 
com::sun::star::accessibility::AccessibleStateType::ENABLED)),
-GTK_ACCESSIBLE_STATE_EXPANDED,
-bool(nStates & 
com::sun::star::accessibility::AccessibleStateType::EXPANDED),
-GTK_ACCESSIBLE_STATE_SELECTED,
-bool(nStates & 
com::sun::star::accessibility::AccessibleStateType::SELECTED), -1);
+bool(!(nStates & 
com::sun::star::accessibility::AccessibleStateType::ENABLED)), -1);
 
 // when explicitly setting any value for GTK_ACCESSIBLE_STATE_CHECKED,
 // Gtk will also report ATSPI_STATE_CHECKABLE on the AT-SPI layer
@@ -314,6 +310,20 @@ static void applyStates(GtkAccessible* pGtkAccessible,
 gtk_accessible_update_state(pGtkAccessible, 
GTK_ACCESSIBLE_STATE_CHECKED, eState, -1);
 }
 
+if (nStates & 
com::sun::star::accessibility::AccessibleStateType::EXPANDABLE)
+{
+gtk_accessible_update_state(
+pGtkAccessible, GTK_ACCESSIBLE_STATE_EXPANDED,
+bool(nStates & 
com::sun::star::accessibility::AccessibleStateType::EXPANDED), -1);
+}
+
+if (nStates & 
com::sun::star::accessibility::AccessibleStateType::SELECTABLE)
+{
+gtk_accessible_update_state(
+pGtkAccessible, GTK_ACCESSIBLE_STATE_SELECTED,
+bool(nStates & 
com::sun::star::accessibility::AccessibleStateType::SELECTED), -1);
+}
+
 const sal_Int16 nRole = xContext->getAccessibleRole();
 if (nRole == com::sun::star::accessibility::AccessibleRole::TOGGLE_BUTTON)
 {


core.git: vcl/Library_vclplug_gtk4.mk vcl/unx

 vcl/Library_vclplug_gtk4.mk |1 
 vcl/unx/gtk4/a11y.cxx   |   23 +--
 vcl/unx/gtk4/a11y.hxx   |   15 +-
 vcl/unx/gtk4/gtkaccessibleeventlistener.cxx |7 
 vcl/unx/gtk4/gtkaccessibleeventlistener.hxx |2 -
 vcl/unx/gtk4/gtkaccessibleregistry.cxx  |   41 
 vcl/unx/gtk4/gtkaccessibleregistry.hxx  |   32 +
 7 files changed, 103 insertions(+), 18 deletions(-)

New commits:
commit 70ef230aae4f961c8197cc11a7ff5feaf1d96c20
Author: Michael Weghorn 
AuthorDate: Wed Dec 20 11:12:58 2023 +0100
Commit: Michael Weghorn 
CommitDate: Wed Dec 20 17:38:08 2023 +0100

gtk4 a11y: Remember LoAccessible for XAccessible

Don't create a new `LoAccessible` for an `XAccessible`
each time, but add a `GtkAccessibleRegistry` class that
remembers the corresponding `LoAccessible` for
an `XAccessible` in a map.

Remove the entry from the map again in
`GtkAccessibleEventListener::disposing`.

This prevents Libreoffice from becoming unresponsive
in local WIP branches of both, gtk and LO that add
handling for changes to the focused state, when used
with the Orca screen reader.

This commit is very similar to what was added for the Qt-based
VCL plugins in

commit 812fe185fba48b439fb1229517d62aa67c209016
Author: Michael Weghorn 
Date:   Wed Aug 24 11:42:04 2022 +0200

qt a11y: Remember and reuse existing QObject for XAccessible

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

diff --git a/vcl/Library_vclplug_gtk4.mk b/vcl/Library_vclplug_gtk4.mk
index a288e5151aa6..72ffeb08e267 100644
--- a/vcl/Library_vclplug_gtk4.mk
+++ b/vcl/Library_vclplug_gtk4.mk
@@ -89,6 +89,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gtk4,\
 vcl/unx/gtk4/convert3to4 \
 vcl/unx/gtk4/customcellrenderer \
 vcl/unx/gtk4/gtkaccessibleeventlistener \
+vcl/unx/gtk4/gtkaccessibleregistry \
 vcl/unx/gtk4/gtkdata \
 vcl/unx/gtk4/gtkinst \
 vcl/unx/gtk4/gtksys \
diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index 4107c7ff0b79..48c22beb21ee 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -22,6 +22,7 @@
 
 #include "a11y.hxx"
 #include "gtkaccessibleeventlistener.hxx"
+#include "gtkaccessibleregistry.hxx"
 
 #define OOO_TYPE_FIXED (ooo_fixed_get_type())
 #define OOO_FIXED(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OOO_TYPE_FIXED, 
OOoFixed))
@@ -383,15 +384,6 @@ applyObjectAttributes(GtkAccessible* pGtkAccessible,
 #define LO_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), 
LO_TYPE_ACCESSIBLE, LoAccessible))
 // #define LO_IS_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
LO_TYPE_ACCESSIBLE))
 
-struct LoAccessible
-{
-GObject parent_instance;
-GdkDisplay* display;
-GtkAccessible* parent;
-GtkATContext* at_context;
-css::uno::Reference uno_accessible;
-};
-
 struct LoAccessibleClass
 {
 GObjectClass parent_class;
@@ -590,7 +582,7 @@ static void lo_accessible_class_init(LoAccessibleClass* 
klass)
 g_object_class_override_property(object_class, PROP_ACCESSIBLE_ROLE, 
"accessible-role");
 }
 
-static LoAccessible*
+LoAccessible*
 lo_accessible_new(GdkDisplay* pDisplay, GtkAccessible* pParent,
   const css::uno::Reference& 
rAccessible)
 {
@@ -684,7 +676,8 @@ static GtkAccessible* 
lo_accessible_get_first_accessible_child(GtkAccessible* se
 if (!xFirstChild)
 return nullptr;
 
-LoAccessible* child_accessible = lo_accessible_new(pAccessible->display, 
self, xFirstChild);
+LoAccessible* child_accessible
+= GtkAccessibleRegistry::getLOAccessible(xFirstChild, 
pAccessible->display, self);
 return GTK_ACCESSIBLE(g_object_ref(child_accessible));
 }
 
@@ -711,8 +704,8 @@ static GtkAccessible* 
lo_accessible_get_next_accessible_sibling(GtkAccessible* s
 if (!xNextChild)
 return nullptr;
 
-LoAccessible* child_accessible
-= lo_accessible_new(pAccessible->display, pAccessible->parent, 
xNextChild);
+LoAccessible* child_accessible = GtkAccessibleRegistry::getLOAccessible(
+xNextChild, pAccessible->display, pAccessible->parent);
 return GTK_ACCESSIBLE(g_object_ref(child_accessible));
 }
 
@@ -846,8 +839,8 @@ static GtkAccessible* 
get_first_accessible_child(GtkAccessible* accessible)
 return nullptr;
 css::uno::Reference xFirstChild(
 xContext->getAccessibleChild(0));
-LoAccessible* child_accessible
-= lo_accessible_new(gtk_widget_get_display(GTK_WIDGET(pFixed)), 
accessible, xFirstChild);
+LoAccessible* child_accessible = GtkAccessibleRegistry::getLOAccessible(
+xFirstChild, gtk_widget_get_display(GTK_WIDGET(pFixed)), accessible);
 return 

core.git: vcl/unx

 vcl/unx/gtk4/a11y.cxx |   16 
 vcl/unx/gtk4/a11y.hxx |2 --
 2 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 552a0a0e4daaac6896995b1ce63a44df6582ade2
Author: Michael Weghorn 
AuthorDate: Wed Dec 20 10:45:39 2023 +0100
Commit: Michael Weghorn 
CommitDate: Wed Dec 20 17:37:27 2023 +0100

gtk4 a11y: Silence loplugin:unreffun a different way

Including the `a11y.hxx` header in another source file
would result in an `--enable-werror` gcc 13.2.0-7
build on Debian testing failing like this
(real use case is in a following commit, but this is
also reproducible by including the header in
`vcl/unx/gtk4/gtkaccessibleeventlistener.cxx`):

In file included from 
.../vcl/unx/gtk4/gtkaccessibleeventlistener.cxx:15:
.../vcl/unx/gtk4/a11y.hxx:19:24: error: ‘void* 
lo_accessible_get_instance_private(LoAccessible*)’ declared ‘static’ but never 
defined [-Werror=unused-function]
   19 | static inline gpointer 
lo_accessible_get_instance_private(LoAccessible*);
  |^~
.../vcl/unx/gtk4/a11y.hxx:21:24: error: ‘void* 
ooo_fixed_get_instance_private(OOoFixed*)’ declared ‘static’ but never defined 
[-Werror=unused-function]
   21 | static inline gpointer 
ooo_fixed_get_instance_private(OOoFixed*);
  |^~
cc1plus: all warnings being treated as errors
make[1]: *** [.../solenv/gbuild/LinkTarget.mk:337: 
.../workdir/CxxObject/vcl/unx/gtk4/gtkaccessibleeventlistener.o] Error 1
make: *** [Makefile:290: build] Error 2

However, just removing the declarations would make loplugin:unreffun 
unhappy:

 .../vcl/unx/gtk4/a11y.cxx:568:1: error: Unreferenced externally 
invisible function definition [loplugin:unreffun]
G_DEFINE_TYPE_WITH_CODE(LoAccessible, lo_accessible, G_TYPE_OBJECT,
^~~
/usr/include/glib-2.0/gobject/gtype.h:1842:56: note: expanded from 
macro 'G_DEFINE_TYPE_WITH_CODE'
#define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_)  
_G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} 
_G_DEFINE_TYPE_EXTENDED_END()

^~~
/usr/include/glib-2.0/gobject/gtype.h:2325:3: note: expanded from macro 
'_G_DEFINE_TYPE_EXTENDED_BEGIN'
  _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name, TYPE_PARENT) \
  ^~~
/usr/include/glib-2.0/gobject/gtype.h:2280:24: note: expanded from 
macro '_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE'
static inline gpointer \
~~~^
:101:1: note: expanded from here
lo_accessible_get_instance_private
^
.../vcl/unx/gtk4/a11y.cxx:857:1: error: Unreferenced externally 
invisible function definition [loplugin:unreffun]
G_DEFINE_TYPE_WITH_CODE(OOoFixed, ooo_fixed, GTK_TYPE_FIXED,
^~~~
/usr/include/glib-2.0/gobject/gtype.h:1842:56: note: expanded from 
macro 'G_DEFINE_TYPE_WITH_CODE'
#define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_)  
_G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} 
_G_DEFINE_TYPE_EXTENDED_END()

^~~
/usr/include/glib-2.0/gobject/gtype.h:2325:3: note: expanded from macro 
'_G_DEFINE_TYPE_EXTENDED_BEGIN'
  _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name, TYPE_PARENT) \
  ^~~
/usr/include/glib-2.0/gobject/gtype.h:2280:24: note: expanded from 
macro '_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE'
static inline gpointer \
~~~^
:131:1: note: expanded from here
ooo_fixed_get_instance_private
^
2 errors generated.
make[1]: *** [.../solenv/gbuild/LinkTarget.mk:337: 
.../workdir/CxxObject/vcl/unx/gtk4/a11y.o] Error 1
make: *** [Makefile:290: build] Error 2

Silence these 2 loplugin:unreffun errors using a different
approach instead, as suggested by Stephan Bergmann in [1].

[1] 
https://gerrit.libreoffice.org/c/core/+/161060/comments/3e6ccbd5_87243200

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

diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index 2b5e64e03947..4107c7ff0b79 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -565,8 +565,16 @@ static void 

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

 vcl/qa/cppunit/a11y/atspi2/atspi2.cxx |   11 +++
 vcl/unx/gtk3/a11y/atklistener.cxx |2 +-
 vcl/unx/gtk3/a11y/atkwrapper.cxx  |   12 
 vcl/unx/gtk3/a11y/atkwrapper.hxx  |2 +-
 4 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit e8d18c73dbbf8cfcd972072510985d6bd18b2cca
Author: Michael Weghorn 
AuthorDate: Mon Nov 13 11:45:06 2023 +0100
Commit: Xisco Fauli 
CommitDate: Wed Dec 20 17:10:08 2023 +0100

tdf#123864 gtk3 a11y: Consider states when mapping BUTTON_DROPDOWN

Take the checkable state into account when mapping the
`AccessibleRole::BUTTON_DROPDOWN` role.

There is no direct ATK equivalent for
`AccessibleRole::BUTTON_DROPDOWN`.
Don't always use ATK_ROLE_PUSH_BUTTON, but
use ATK_ROLE_TOGGLE_BUTTON when the button is CHECKABLE,
i.e. it can be toggled.

With this in place, Orca now announces the state of
the underline button (on/off) when using the gtk3
VCL plugin.

Related Orca source code that requires the toggle button
role: [1]

The state is not announced when using the qt6 VCL
plugin yet, and Qt currently doesn't have a toggle button
role, so that would have to be added there first to
do something similar there.

For gtk4, mapping could probably be done similarly,
but more is missing for Orca to announce things in
custom widgets (e.g. event handling),
so leave that for later.

[1] 
https://gitlab.gnome.org/GNOME/orca/-/blob/b80bb951a651f5f12a5ddfb2a5b1c151568d045b/src/orca/scripts/apps/soffice/speech_generator.py#L177

Change-Id: If69e08d2e4939cc709d44e89cc2fd1d01691a70b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160904
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161039

diff --git a/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx 
b/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx
index e24bf8078613..04d885d623c3 100644
--- a/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx
+++ b/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx
@@ -25,7 +25,7 @@
 using namespace css;
 
 // from gtk3/a11y/atkwrapper.cxx
-static AtspiRole mapToAtspiRole(sal_Int16 nRole)
+static AtspiRole mapToAtspiRole(sal_Int16 nRole, sal_Int64 nStates)
 {
 switch (nRole)
 {
@@ -103,7 +103,6 @@ static AtspiRole mapToAtspiRole(sal_Int16 nRole)
 MAP_DIRECT(TREE);
 MAP(VIEW_PORT, VIEWPORT);
 MAP_DIRECT(WINDOW);
-MAP(BUTTON_DROPDOWN, PUSH_BUTTON);
 #if ATSPI_ROLE_COUNT > 130 /* ATSPI_ROLE_PUSH_BUTTON_MENU is 129 */
 MAP(BUTTON_MENU, PUSH_BUTTON_MENU);
 #else
@@ -130,7 +129,10 @@ static AtspiRole mapToAtspiRole(sal_Int16 nRole)
 
 #undef MAP_DIRECT
 #undef MAP
-
+case css::accessibility::AccessibleRole::BUTTON_DROPDOWN:
+if (nStates & css::accessibility::AccessibleStateType::CHECKABLE)
+return ATSPI_ROLE_TOGGLE_BUTTON;
+return ATSPI_ROLE_PUSH_BUTTON;
 default:
 SAL_WARN("vcl.gtk", "Unmapped accessible role: " << nRole);
 return ATSPI_ROLE_UNKNOWN;
@@ -265,7 +267,8 @@ void Atspi2TestTree::compareObjects(const 
uno::ReferencegetAccessibleRole());
+const AtspiRole nLORole
+= mapToAtspiRole(xLOContext->getAccessibleRole(), 
xLOContext->getAccessibleStateSet());
 const auto nAtspiRole = pAtspiAccessible.getRole();
 CPPUNIT_ASSERT_EQUAL(nLORole, nAtspiRole);
 /* name (no need to worry about debugging suffixes as 
AccessibilityTools::nameEquals does, as
diff --git a/vcl/unx/gtk3/a11y/atklistener.cxx 
b/vcl/unx/gtk3/a11y/atklistener.cxx
index b9a053d83a7b..b826ea03061a 100644
--- a/vcl/unx/gtk3/a11y/atklistener.cxx
+++ b/vcl/unx/gtk3/a11y/atklistener.cxx
@@ -759,7 +759,7 @@ void AtkListener::notifyEvent( const 
accessibility::AccessibleEventObject& aEven
 case accessibility::AccessibleEventId::ROLE_CHANGED:
 {
 uno::Reference< accessibility::XAccessibleContext > xContext = 
getAccessibleContextFromSource( aEvent.Source );
-atk_object_wrapper_set_role( mpWrapper, 
xContext->getAccessibleRole() );
+atk_object_wrapper_set_role(mpWrapper, 
xContext->getAccessibleRole(), xContext->getAccessibleStateSet());
 break;
 }
 
diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx
index 49b1d371ae12..c946a6e3daaf 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -167,7 +167,7 @@ AtkStateType mapAtkState( sal_Int64 nState )
 return type;
 }
 
-static AtkRole mapToAtkRole( sal_Int16 nRole )
+static AtkRole mapToAtkRole(sal_Int16 nRole, sal_Int64 nStates)
 {
 switch (nRole)
 {
@@ -310,7 +310,11 @@ static AtkRole mapToAtkRole( sal_Int16 nRole )
 case accessibility::AccessibleRole::WINDOW:
 return ATK_ROLE_WINDOW;
 case accessibility::AccessibleRole::BUTTON_DROPDOWN:
+{
+

core.git: Branch 'libreoffice-24-2' - 2 commits - accessibility/inc accessibility/source framework/source include/vcl vcl/source

 accessibility/inc/standard/vclxaccessiblemenuitem.hxx|1 +
 accessibility/source/standard/vclxaccessiblemenuitem.cxx |   10 ++
 framework/source/uielement/toolbarmanager.cxx|   10 +-
 include/vcl/menu.hxx |1 +
 vcl/source/window/menu.cxx   |   11 +++
 5 files changed, 28 insertions(+), 5 deletions(-)

New commits:
commit b88198c183dfb10c97409e83ea5ad7793811e7fb
Author: Michael Weghorn 
AuthorDate: Mon Dec 18 09:30:02 2023 +0100
Commit: Xisco Fauli 
CommitDate: Wed Dec 20 17:10:00 2023 +0100

tdf#123864 a11y: Evaluate checkable/toggle flag for more toolbar items

commit 4342408a8359e590f57b016baaf7d8dcfdebdbd4
Author: Carsten Driesner 
Date:   Thu May 6 18:15:21 2010 +0200

fwk142: #i104293 Use Commands.xcu files to mark commands which 
support a toggle state

introduced a `UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON` state
to mark commands that can be toggled, see `framework/inc/properties.h`.

Despite that one being set for the `.uno:Underline` command in
`officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu`,
the underline button in Writer's formatting toolbar would not expose
the CHECKABLE a11y state even after

commit 78241a40628e5721aa50cb0fa13a6343f766
Author: Michael Weghorn 
Date:   Mon Dec 18 08:48:12 2023 +0100

tdf#123864 a11y: Handle new CHECKABLE state in misc places

because the state set in the .xcu file was only applied
in `ToolBarManager::CreateControllers` in the code path where
no controller is set.

There seems to be no particular reason for that, so move this
out of that block so this gets run for other items, too.

With this in place, the underline button in Writer's formatting
toolbar now has the checkable AT-SPI state when using the gtk3
VCL plugin.

(Orca still doesn't announce the button as checked when it is,
despite the checked state also being set then, but that's another
aspect that will be addressed in a separate commit.)

Change-Id: Ib9200077a95feea3ce7c0380b9b8f31c96632223
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160903
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161038

diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index 51855edd6402..cde8b89f41bb 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1121,15 +1121,15 @@ void ToolBarManager::CreateControllers()
 xController.set( new GenericToolbarController( 
m_xContext, m_xFrame, m_pToolBar, nId, aCommandURL ));
 else
 xController.set( new GenericToolbarController( 
m_xContext, m_xFrame, *m_pWeldedToolBar, aCommandURL ));
-
-// Accessibility support: Set toggle button role for 
specific commands
-sal_Int32 nProps = 
vcl::CommandInfoProvider::GetPropertiesForCommand(aCommandURL, 
m_aModuleIdentifier);
-if ( nProps & UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 
)
-m_pImpl->SetItemCheckable( nId );
 }
 }
 }
 
+// Accessibility support: Set toggle button role for specific commands
+const sal_Int32 nProps = 
vcl::CommandInfoProvider::GetPropertiesForCommand(aCommandURL, 
m_aModuleIdentifier);
+if (nProps & UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON)
+m_pImpl->SetItemCheckable(nId);
+
 // Associate ID and controller to be able to retrieve
 // the controller from the ID later.
 m_aControllerMap[ nId ] = xController;
commit 2bd0e347f15c50f354386b775d681243a5dd52a8
Author: Michael Weghorn 
AuthorDate: Mon Dec 18 09:10:36 2023 +0100
Commit: Xisco Fauli 
CommitDate: Wed Dec 20 17:09:52 2023 +0100

tdf#123864 a11y: Handle new checkable state for VCLXAccessibleMenuItem

Add reporting for the new CHECKABLE a11y state introduced in

commit d6c6472bbe1c90b733a4d69c4c8528f4de3750d3
Author: Michael Weghorn 
Date:   Mon Nov 13 15:53:44 2023 +0100

tdf#123864 a11y: Add new AccessibleStateType::CHECKABLE

for `VCLXAccessibleMenuItem`.

`MenuItemData::HasCheck` looks like it already provides
what's needed to say whether an item is checkable, therefore
add a `Menu::IsItemCheckable` that makes use of this and
and a `VCLXAccessibleMenuItem::IsCheckable` that
makes use of that in turn.

Extend `VCLXAccessibleMenuItem::FillAccessibleStateSet` to
use the latter to report the CHECKABLE state accordingly.

Change-Id: 

core.git: Branch 'libreoffice-24-2' - accessibility/source offapi/com sfx2/source test/source toolkit/source toolkit/test vcl/qa vcl/qt5 vcl/source

 accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx |1 +
 accessibility/source/standard/vclxaccessiblebutton.cxx|3 +++
 accessibility/source/standard/vclxaccessiblecheckbox.cxx  |1 +
 accessibility/source/standard/vclxaccessibleradiobutton.cxx   |1 +
 accessibility/source/standard/vclxaccessibletoolboxitem.cxx   |2 ++
 offapi/com/sun/star/awt/AccessibleButton.idl  |2 ++
 offapi/com/sun/star/awt/AccessibleCheckBox.idl|2 ++
 offapi/com/sun/star/awt/AccessibleMenu.idl|2 ++
 offapi/com/sun/star/awt/AccessibleMenuItem.idl|2 ++
 offapi/com/sun/star/awt/AccessibleRadioButton.idl |2 ++
 offapi/com/sun/star/awt/AccessibleToolBoxItem.idl |2 ++
 offapi/com/sun/star/awt/AccessibleTreeListBoxEntry.idl|2 ++
 sfx2/source/view/viewsh.cxx   |6 +++---
 test/source/a11y/AccessibilityTools.cxx   |3 +++
 toolkit/source/awt/vclxaccessiblecomponent.cxx|1 +
 toolkit/test/accessibility/tools/NameProvider.java|1 +
 vcl/qa/cppunit/a11y/atspi2/atspi2.cxx |1 +
 vcl/qt5/QtAccessibleEventListener.cxx |3 +++
 vcl/source/treelist/treelistbox.cxx   |2 ++
 19 files changed, 36 insertions(+), 3 deletions(-)

New commits:
commit f098ba6579fb1992c0db86b19b22eb8532ab1ba6
Author: Michael Weghorn 
AuthorDate: Mon Dec 18 08:48:12 2023 +0100
Commit: Xisco Fauli 
CommitDate: Wed Dec 20 09:27:27 2023 +0100

tdf#123864 a11y: Handle new CHECKABLE state in misc places

Add reporting/handling of the CHECKABLE a11y state
added in

commit d6c6472bbe1c90b733a4d69c4c8528f4de3750d3
Author: Michael Weghorn 
Date:   Mon Nov 13 15:53:44 2023 +0100

tdf#123864 a11y: Add new AccessibleStateType::CHECKABLE

in various places where it seems pretty straightforward.
`VCLXAccessibleMenuItem` is a bit more complex and will be
handled separately.

Change-Id: I212b8439609d34410413959973163aa7d809cbf1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160901
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161036

diff --git a/accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx 
b/accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx
index 645b544176d2..e5975624 100644
--- a/accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx
@@ -57,6 +57,7 @@ namespace accessibility
 sal_Int64 nStateSet = AccessibleBrowseBoxCell::implCreateStateSet();
 if( isAlive() )
 {
+nStateSet |= AccessibleStateType::CHECKABLE;
 mpBrowseBox->FillAccessibleStateSetForCell(
 nStateSet, getRowPos(), static_cast< sal_uInt16 >( 
getColumnPos() ) );
 if ( m_eState == TRISTATE_TRUE )
diff --git a/accessibility/source/standard/vclxaccessiblebutton.cxx 
b/accessibility/source/standard/vclxaccessiblebutton.cxx
index 31c8188b99ab..eb4d1f0821fe 100644
--- a/accessibility/source/standard/vclxaccessiblebutton.cxx
+++ b/accessibility/source/standard/vclxaccessiblebutton.cxx
@@ -78,6 +78,9 @@ void VCLXAccessibleButton::FillAccessibleStateSet( sal_Int64& 
rStateSet )
 
 rStateSet |= AccessibleStateType::FOCUSABLE;
 
+if (pButton->isToggleButton())
+rStateSet |= AccessibleStateType::CHECKABLE;
+
 if ( pButton->GetState() == TRISTATE_TRUE )
 rStateSet |= AccessibleStateType::CHECKED;
 
diff --git a/accessibility/source/standard/vclxaccessiblecheckbox.cxx 
b/accessibility/source/standard/vclxaccessiblecheckbox.cxx
index 8a0ea492911e..cf75db3fa7b6 100644
--- a/accessibility/source/standard/vclxaccessiblecheckbox.cxx
+++ b/accessibility/source/standard/vclxaccessiblecheckbox.cxx
@@ -127,6 +127,7 @@ void VCLXAccessibleCheckBox::FillAccessibleStateSet( 
sal_Int64& rStateSet )
 {
 VCLXAccessibleTextComponent::FillAccessibleStateSet( rStateSet );
 
+rStateSet |= AccessibleStateType::CHECKABLE;
 rStateSet |= AccessibleStateType::FOCUSABLE;
 
 if ( IsChecked() )
diff --git a/accessibility/source/standard/vclxaccessibleradiobutton.cxx 
b/accessibility/source/standard/vclxaccessibleradiobutton.cxx
index 0e66dde4c300..c81dead7562f 100644
--- a/accessibility/source/standard/vclxaccessibleradiobutton.cxx
+++ b/accessibility/source/standard/vclxaccessibleradiobutton.cxx
@@ -99,6 +99,7 @@ void VCLXAccessibleRadioButton::FillAccessibleStateSet( 
sal_Int64& rStateSet )
 VCLXRadioButton* pVCLXRadioButton = static_cast< VCLXRadioButton* >( 
GetVCLXWindow() );
 if ( pVCLXRadioButton )
 

core.git: vcl/qa vcl/unx

 vcl/qa/cppunit/a11y/atspi2/atspi2.cxx |   11 +++
 vcl/unx/gtk3/a11y/atklistener.cxx |2 +-
 vcl/unx/gtk3/a11y/atkwrapper.cxx  |   12 
 vcl/unx/gtk3/a11y/atkwrapper.hxx  |2 +-
 4 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit a30f8ee1121aa2448be047f104a099b3272e6bde
Author: Michael Weghorn 
AuthorDate: Mon Nov 13 11:45:06 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Dec 19 22:33:22 2023 +0100

tdf#123864 gtk3 a11y: Consider states when mapping BUTTON_DROPDOWN

Take the checkable state into account when mapping the
`AccessibleRole::BUTTON_DROPDOWN` role.

There is no direct ATK equivalent for
`AccessibleRole::BUTTON_DROPDOWN`.
Don't always use ATK_ROLE_PUSH_BUTTON, but
use ATK_ROLE_TOGGLE_BUTTON when the button is CHECKABLE,
i.e. it can be toggled.

With this in place, Orca now announces the state of
the underline button (on/off) when using the gtk3
VCL plugin.

Related Orca source code that requires the toggle button
role: [1]

The state is not announced when using the qt6 VCL
plugin yet, and Qt currently doesn't have a toggle button
role, so that would have to be added there first to
do something similar there.

For gtk4, mapping could probably be done similarly,
but more is missing for Orca to announce things in
custom widgets (e.g. event handling),
so leave that for later.

[1] 
https://gitlab.gnome.org/GNOME/orca/-/blob/b80bb951a651f5f12a5ddfb2a5b1c151568d045b/src/orca/scripts/apps/soffice/speech_generator.py#L177

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

diff --git a/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx 
b/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx
index e24bf8078613..04d885d623c3 100644
--- a/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx
+++ b/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx
@@ -25,7 +25,7 @@
 using namespace css;
 
 // from gtk3/a11y/atkwrapper.cxx
-static AtspiRole mapToAtspiRole(sal_Int16 nRole)
+static AtspiRole mapToAtspiRole(sal_Int16 nRole, sal_Int64 nStates)
 {
 switch (nRole)
 {
@@ -103,7 +103,6 @@ static AtspiRole mapToAtspiRole(sal_Int16 nRole)
 MAP_DIRECT(TREE);
 MAP(VIEW_PORT, VIEWPORT);
 MAP_DIRECT(WINDOW);
-MAP(BUTTON_DROPDOWN, PUSH_BUTTON);
 #if ATSPI_ROLE_COUNT > 130 /* ATSPI_ROLE_PUSH_BUTTON_MENU is 129 */
 MAP(BUTTON_MENU, PUSH_BUTTON_MENU);
 #else
@@ -130,7 +129,10 @@ static AtspiRole mapToAtspiRole(sal_Int16 nRole)
 
 #undef MAP_DIRECT
 #undef MAP
-
+case css::accessibility::AccessibleRole::BUTTON_DROPDOWN:
+if (nStates & css::accessibility::AccessibleStateType::CHECKABLE)
+return ATSPI_ROLE_TOGGLE_BUTTON;
+return ATSPI_ROLE_PUSH_BUTTON;
 default:
 SAL_WARN("vcl.gtk", "Unmapped accessible role: " << nRole);
 return ATSPI_ROLE_UNKNOWN;
@@ -265,7 +267,8 @@ void Atspi2TestTree::compareObjects(const 
uno::ReferencegetAccessibleRole());
+const AtspiRole nLORole
+= mapToAtspiRole(xLOContext->getAccessibleRole(), 
xLOContext->getAccessibleStateSet());
 const auto nAtspiRole = pAtspiAccessible.getRole();
 CPPUNIT_ASSERT_EQUAL(nLORole, nAtspiRole);
 /* name (no need to worry about debugging suffixes as 
AccessibilityTools::nameEquals does, as
diff --git a/vcl/unx/gtk3/a11y/atklistener.cxx 
b/vcl/unx/gtk3/a11y/atklistener.cxx
index 3ba088c8..f647c52a5c36 100644
--- a/vcl/unx/gtk3/a11y/atklistener.cxx
+++ b/vcl/unx/gtk3/a11y/atklistener.cxx
@@ -630,7 +630,7 @@ void AtkListener::notifyEvent( const 
accessibility::AccessibleEventObject& aEven
 case accessibility::AccessibleEventId::ROLE_CHANGED:
 {
 uno::Reference< accessibility::XAccessibleContext > xContext = 
getAccessibleContextFromSource( aEvent.Source );
-atk_object_wrapper_set_role( mpWrapper, 
xContext->getAccessibleRole() );
+atk_object_wrapper_set_role(mpWrapper, 
xContext->getAccessibleRole(), xContext->getAccessibleStateSet());
 break;
 }
 
diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx
index 49b1d371ae12..c946a6e3daaf 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -167,7 +167,7 @@ AtkStateType mapAtkState( sal_Int64 nState )
 return type;
 }
 
-static AtkRole mapToAtkRole( sal_Int16 nRole )
+static AtkRole mapToAtkRole(sal_Int16 nRole, sal_Int64 nStates)
 {
 switch (nRole)
 {
@@ -310,7 +310,11 @@ static AtkRole mapToAtkRole( sal_Int16 nRole )
 case accessibility::AccessibleRole::WINDOW:
 return ATK_ROLE_WINDOW;
 case accessibility::AccessibleRole::BUTTON_DROPDOWN:
+{
+if (nStates & css::accessibility::AccessibleStateType::CHECKABLE)
+

core.git: vcl/unx

 vcl/unx/gtk4/a11y.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit ff527c41a04c38aa88a665e669f19729cf68fd54
Author: Michael Weghorn 
AuthorDate: Tue Dec 19 09:13:36 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Dec 19 11:22:53 2023 +0100

gtk4 a11y: Map COMMENT role to new gtk equivalent

Map `AccessibleRole::COMMENT` to the Gtk 4
equivalent `GTK_ACCESSIBLE_ROLE_COMMENT` newly
added in upstream gtk commit [1]

commit ab7592ee4f8ded4c3990cff5daf7f28ef26ac41f
Author: Michael Weghorn 
Date:   Wed Dec 6 14:34:43 2023 +0100

a11y: Add article and comment roles

[1] 
https://gitlab.gnome.org/GNOME/gtk/-/commit/ab7592ee4f8ded4c3990cff5daf7f28ef26ac41f

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

diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index 37b54bae0475..2b5e64e03947 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -214,6 +214,11 @@ map_accessible_role(const 
css::uno::Reference&
 case css::accessibility::AccessibleRole::SHAPE:
 eRole = GTK_ACCESSIBLE_ROLE_IMG;
 break;
+case css::accessibility::AccessibleRole::COMMENT:
+#if GTK_CHECK_VERSION(4, 13, 4)
+eRole = GTK_ACCESSIBLE_ROLE_COMMENT;
+break;
+#endif
 default:
 SAL_WARN("vcl.gtk",
  "unmapped GtkAccessibleRole: " << 
xContext->getAccessibleRole());


core.git: 3 commits - accessibility/inc accessibility/source include/vcl offapi/com sfx2/source test/source toolkit/source toolkit/test vcl/qa vcl/qt5 vcl/source vcl/unx

 accessibility/inc/standard/vclxaccessiblemenuitem.hxx |1 
 accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx |1 
 accessibility/source/standard/vclxaccessiblebutton.cxx|3 
 accessibility/source/standard/vclxaccessiblecheckbox.cxx  |1 
 accessibility/source/standard/vclxaccessiblemenuitem.cxx  |   10 
 accessibility/source/standard/vclxaccessibleradiobutton.cxx   |1 
 accessibility/source/standard/vclxaccessibletoolboxitem.cxx   |2 
 include/vcl/menu.hxx  |1 
 offapi/com/sun/star/awt/AccessibleButton.idl  |2 
 offapi/com/sun/star/awt/AccessibleCheckBox.idl|2 
 offapi/com/sun/star/awt/AccessibleMenu.idl|2 
 offapi/com/sun/star/awt/AccessibleMenuItem.idl|2 
 offapi/com/sun/star/awt/AccessibleRadioButton.idl |2 
 offapi/com/sun/star/awt/AccessibleToolBoxItem.idl |2 
 offapi/com/sun/star/awt/AccessibleTreeListBoxEntry.idl|2 
 sfx2/source/view/viewsh.cxx   |6 
 test/source/a11y/AccessibilityTools.cxx   |3 
 toolkit/source/awt/vclxaccessiblecomponent.cxx|1 
 toolkit/test/accessibility/tools/NameProvider.java|1 
 vcl/qa/cppunit/a11y/atspi2/atspi2.cxx |1 
 vcl/qt5/QtAccessibleEventListener.cxx |3 
 vcl/source/treelist/treelistbox.cxx   |2 
 vcl/source/window/menu.cxx|   11 
 vcl/unx/gtk3/a11y/atklistener.cxx |  129 
--
 24 files changed, 59 insertions(+), 132 deletions(-)

New commits:
commit eef4d5cbd10a042bd3b5fb555e0bf9b0dd7d1215
Author: Michael Weghorn 
AuthorDate: Mon Dec 18 09:10:36 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Dec 19 09:30:23 2023 +0100

tdf#123864 a11y: Handle new checkable state for VCLXAccessibleMenuItem

Add reporting for the new CHECKABLE a11y state introduced in

commit d6c6472bbe1c90b733a4d69c4c8528f4de3750d3
Author: Michael Weghorn 
Date:   Mon Nov 13 15:53:44 2023 +0100

tdf#123864 a11y: Add new AccessibleStateType::CHECKABLE

for `VCLXAccessibleMenuItem`.

`MenuItemData::HasCheck` looks like it already provides
what's needed to say whether an item is checkable, therefore
add a `Menu::IsItemCheckable` that makes use of this and
and a `VCLXAccessibleMenuItem::IsCheckable` that
makes use of that in turn.

Extend `VCLXAccessibleMenuItem::FillAccessibleStateSet` to
use the latter to report the CHECKABLE state accordingly.

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

diff --git a/accessibility/inc/standard/vclxaccessiblemenuitem.hxx 
b/accessibility/inc/standard/vclxaccessiblemenuitem.hxx
index ddc50a8f3577..4eec5fa6746e 100644
--- a/accessibility/inc/standard/vclxaccessiblemenuitem.hxx
+++ b/accessibility/inc/standard/vclxaccessiblemenuitem.hxx
@@ -41,6 +41,7 @@ class VCLXAccessibleMenuItem :  public 
cppu::ImplInheritanceHelper<
 protected:
 virtual boolIsFocused() override;
 virtual boolIsSelected() override;
+virtual boolIsCheckable();
 virtual boolIsChecked() override;
 
 virtual boolIsHighlighted() override;
diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx 
b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
index 2c4e8043c00b..03bdc88c93c5 100644
--- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx
+++ b/accessibility/source/standard/vclxaccessiblemenuitem.cxx
@@ -66,6 +66,14 @@ bool VCLXAccessibleMenuItem::IsSelected()
 return IsHighlighted();
 }
 
+bool VCLXAccessibleMenuItem::IsCheckable()
+{
+if (!m_pParent)
+return false;
+
+const sal_uInt16 nItemId = m_pParent->GetItemId(m_nItemPos);
+return m_pParent->IsItemCheckable(nItemId);
+}
 
 bool VCLXAccessibleMenuItem::IsChecked()
 {
@@ -107,6 +115,8 @@ void VCLXAccessibleMenuItem::FillAccessibleStateSet( 
sal_Int64& rStateSet )
 if ( IsSelected() )
 rStateSet |= AccessibleStateType::SELECTED;
 
+if (IsCheckable())
+rStateSet |= AccessibleStateType::CHECKABLE;
 if ( IsChecked() )
 rStateSet |= AccessibleStateType::CHECKED;
 }
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 2442eef9202f..a28182e51fe2 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -275,6 +275,7 @@ public:
 
 void CheckItem( sal_uInt16 nItemId, bool bCheck = true );
 void CheckItem( std::u16string_view rIdent, bool bCheck = true );
+   

core.git: vcl/Library_vclplug_gtk4.mk vcl/unx

 vcl/Library_vclplug_gtk4.mk |1 
 vcl/unx/gtk4/a11y.cxx   |   12 +
 vcl/unx/gtk4/gtkaccessibleeventlistener.cxx |   63 
 vcl/unx/gtk4/gtkaccessibleeventlistener.hxx |   35 +++
 4 files changed, 111 insertions(+)

New commits:
commit c24ed12d1098bb0a3faf1774fd8bd5f686fb49ab
Author: Michael Weghorn 
AuthorDate: Mon Dec 18 13:50:39 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Dec 19 09:29:09 2023 +0100

gtk4 a11y: Add initial event handling

Add a `GtkAccessibleEventListener` that is in
charge of handling a11y events for the gtk4
VCL plugin.

This is inspired by how the Qt-based VCL plugins
do it (see `QtAccessibleEventListener`).

Initially, only handle the
`css::accessibility::AccessibleEventId::STATE_CHANGED`
for the `AccessibleStateType::CHECKED` state by updating
the value for the corresponding Gtk state.

With this in place, toggling e.g. the "Bold"
toggle button in Writer's formatting toolbar
now properly updates the "checked" state of
the corresponding a11y object in Accerciser's
tree view of LO's a11y hierarchy.

Gtk takes care of sending a corresponding
"state-changed" event on the AT-SPI layer:

10.8 object:state-changed:checked(1, 0, 0)
source: [toggle button | Bold]
application: [application | soffice]

Handling state changes to other states that map to a
`GtkAccessibleState` should be possible in a similar
way.

However, other states - like the FOCUSED state - map
to a `GtkAccessiblePlatformState` in Gtk 4, and the
function `gtk_accessible_platform_changed` to update these
that is used by Gtk's own widgets is private API for now,
so cannot be used by LibreOffice, so I currently don't
see a way to handle these without changes on Gtk side
(see [1]).

[1] https://gitlab.gnome.org/GNOME/gtk/-/issues/6272

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

diff --git a/vcl/Library_vclplug_gtk4.mk b/vcl/Library_vclplug_gtk4.mk
index bb9d82ad570f..a288e5151aa6 100644
--- a/vcl/Library_vclplug_gtk4.mk
+++ b/vcl/Library_vclplug_gtk4.mk
@@ -88,6 +88,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gtk4,\
 vcl/unx/gtk4/a11y \
 vcl/unx/gtk4/convert3to4 \
 vcl/unx/gtk4/customcellrenderer \
+vcl/unx/gtk4/gtkaccessibleeventlistener \
 vcl/unx/gtk4/gtkdata \
 vcl/unx/gtk4/gtkinst \
 vcl/unx/gtk4/gtksys \
diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index c8103471b085..37b54bae0475 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -20,6 +21,7 @@
 #if GTK_CHECK_VERSION(4, 9, 0)
 
 #include "a11y.hxx"
+#include "gtkaccessibleeventlistener.hxx"
 
 #define OOO_TYPE_FIXED (ooo_fixed_get_type())
 #define OOO_FIXED(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OOO_TYPE_FIXED, 
OOoFixed))
@@ -617,6 +619,16 @@ lo_accessible_new(GdkDisplay* pDisplay, GtkAccessible* 
pParent,
GTK_ACCESSIBLE_PROPERTY_VALUE_MAX, 
fMaxValue, -1);
 }
 
+// register event listener
+css::uno::Reference 
xBroadcaster(
+xContext, css::uno::UNO_QUERY);
+if (xBroadcaster.is())
+{
+css::uno::Reference 
xListener(
+new GtkAccessibleEventListener(ret));
+xBroadcaster->addAccessibleEventListener(xListener);
+}
+
 return ret;
 }
 
diff --git a/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx 
b/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx
new file mode 100644
index ..1bfa69530be3
--- /dev/null
+++ b/vcl/unx/gtk4/gtkaccessibleeventlistener.cxx
@@ -0,0 +1,63 @@
+/* -*- 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/.
+ */
+
+#include 
+#include 
+#include 
+
+#include "gtkaccessibleeventlistener.hxx"
+
+GtkAccessibleEventListener::GtkAccessibleEventListener(LoAccessible* 
pLoAccessible)
+: m_pLoAccessible(pLoAccessible)
+{
+assert(m_pLoAccessible);
+g_object_ref(m_pLoAccessible);
+}
+
+GtkAccessibleEventListener::~GtkAccessibleEventListener()
+{
+assert(m_pLoAccessible);
+g_object_unref(m_pLoAccessible);
+}
+
+void GtkAccessibleEventListener::disposing(const 
com::sun::star::lang::EventObject&) {}
+
+void GtkAccessibleEventListener::notifyEvent(
+const com::sun::star::accessibility::AccessibleEventObject& rEvent)
+{
+switch (rEvent.EventId)
+{
+case 

core.git: framework/source

 framework/source/uielement/toolbarmanager.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit b7ba91311abaf1af4d97822e5c8eccc53b1e11fa
Author: Michael Weghorn 
AuthorDate: Mon Dec 18 09:30:02 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Dec 19 09:30:31 2023 +0100

tdf#123864 a11y: Evaluate checkable/toggle flag for more toolbar items

commit 4342408a8359e590f57b016baaf7d8dcfdebdbd4
Author: Carsten Driesner 
Date:   Thu May 6 18:15:21 2010 +0200

fwk142: #i104293 Use Commands.xcu files to mark commands which 
support a toggle state

introduced a `UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON` state
to mark commands that can be toggled, see `framework/inc/properties.h`.

Despite that one being set for the `.uno:Underline` command in
`officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu`,
the underline button in Writer's formatting toolbar would not expose
the CHECKABLE a11y state even after

commit 78241a40628e5721aa50cb0fa13a6343f766
Author: Michael Weghorn 
Date:   Mon Dec 18 08:48:12 2023 +0100

tdf#123864 a11y: Handle new CHECKABLE state in misc places

because the state set in the .xcu file was only applied
in `ToolBarManager::CreateControllers` in the code path where
no controller is set.

There seems to be no particular reason for that, so move this
out of that block so this gets run for other items, too.

With this in place, the underline button in Writer's formatting
toolbar now has the checkable AT-SPI state when using the gtk3
VCL plugin.

(Orca still doesn't announce the button as checked when it is,
despite the checked state also being set then, but that's another
aspect that will be addressed in a separate commit.)

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

diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index bdc4627c2c8d..0ef5ea3c723e 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1120,15 +1120,15 @@ void ToolBarManager::CreateControllers()
 xController.set( new GenericToolbarController( 
m_xContext, m_xFrame, m_pToolBar, nId, aCommandURL ));
 else
 xController.set( new GenericToolbarController( 
m_xContext, m_xFrame, *m_pWeldedToolBar, aCommandURL ));
-
-// Accessibility support: Set toggle button role for 
specific commands
-sal_Int32 nProps = 
vcl::CommandInfoProvider::GetPropertiesForCommand(aCommandURL, 
m_aModuleIdentifier);
-if ( nProps & UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 
)
-m_pImpl->SetItemCheckable( nId );
 }
 }
 }
 
+// Accessibility support: Set toggle button role for specific commands
+const sal_Int32 nProps = 
vcl::CommandInfoProvider::GetPropertiesForCommand(aCommandURL, 
m_aModuleIdentifier);
+if (nProps & UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON)
+m_pImpl->SetItemCheckable(nId);
+
 // Associate ID and controller to be able to retrieve
 // the controller from the ID later.
 m_aControllerMap[ nId ] = xController;


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

 cui/source/options/optupdt.cxx |2 ++
 cui/uiconfig/ui/optonlineupdatepage.ui |8 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 5397aa0a268c747c204517c6fc59fba9b45bf388
Author: Michael Weghorn 
AuthorDate: Fri Dec 15 14:31:12 2023 +0100
Commit: Michael Weghorn 
CommitDate: Fri Dec 15 17:36:47 2023 +0100

Fix placement for --enable-online-update-mar UI

* Resave with glade 3.40, which did all the
  changes to the .ui file
* to be safe, explicitly hide the UI in the C++
  code when building without `--enable-online-update-mar`
  (UI wasn't shown in a quick test with qt6 even
  without that, but better be safe)

Addresses this issue mentioned in [1]:

> - Online Update".  (For non-GTK VCL backends, there's still a bug that
> the "Automatic Update" section on that options page is mixed into the
> traditional --enable-online-update options at the top of the page,
> instead of down at the bottom; fixing of
> cui/uiconfig/ui/optonlineupdatepage.ui welcome...)

[1] 
https://lists.freedesktop.org/archives/libreoffice/2023-December/091309.html

Change-Id: I2fadbb3b93206834b8c2c17cb540fb0b0687742b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160830
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins
(cherry picked from commit 42637c62c314aaed7587fb1ece2841f644bb7149)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160851
Reviewed-by: Michael Weghorn 

diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index 8ce74bb1fa52..e8f4ee21c214 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -124,6 +124,8 @@ 
SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage(weld::Container* pPage, weld::Dia
 #if HAVE_FEATURE_UPDATE_MAR
 m_xMar->show();
 
m_xEnableMar->set_sensitive(!officecfg::Office::Update::Update::Enabled::isReadOnly());
+#else
+m_xMar->hide();
 #endif
 }
 
diff --git a/cui/uiconfig/ui/optonlineupdatepage.ui 
b/cui/uiconfig/ui/optonlineupdatepage.ui
index 74a76e8a7510..e49181627560 100644
--- a/cui/uiconfig/ui/optonlineupdatepage.ui
+++ b/cui/uiconfig/ui/optonlineupdatepage.ui
@@ -1,5 +1,5 @@
 
-
+
 
   
   
@@ -520,7 +520,6 @@
 
 
   
-False
 False
 0
 none
@@ -551,6 +550,11 @@
   
 
   
+  
+False
+True
+4
+  
 
   
 


core.git: android/source

 android/source/res/layout/about.xml |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit d942b4a7d187f106dfb1f5085e7c655bf13974bf
Author: Michael Weghorn 
AuthorDate: Fri Dec 15 12:37:39 2023 +0100
Commit: Michael Weghorn 
CommitDate: Fri Dec 15 17:28:28 2023 +0100

android: Set sample texts for design view

As cloph suggested in [1], set sample texts for the
version and vendor information in the About dialog,
using the `tools:text` attribute as described at [2].

These are displayed when viewing the layout in
Android Studio's layout preview. With these placeholder
texts, this gives a better impression at design time
what the actual result will look like at runtime.

The actual texts for the view are set at runtime, s.
`AboutDialogFragment#onCreateDialog`.

[1] 
https://gerrit.libreoffice.org/c/core/+/160047/comments/52584e2e_50869bef
[2] 
https://developer.android.com/studio/write/tool-attributes#design-time_view_attributes

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

diff --git a/android/source/res/layout/about.xml 
b/android/source/res/layout/about.xml
index 30f1ed3d95ae..f37482b82a0c 100644
--- a/android/source/res/layout/about.xml
+++ b/android/source/res/layout/about.xml
@@ -1,9 +1,10 @@
 
 
 http://schemas.android.com/apk/res/android;
+xmlns:tools="http://schemas.android.com/tools;
 android:layout_width="match_parent"
 android:layout_height="match_parent">
-http://schemas.android.com/apk/res/android;
+
+android:textSize="18sp"
+tools:text="Version: x.x.x.x\nBuild ID: " />
 
 
+android:textSize="18sp"
+tools:text="@string/app_vendor" />
 
 


  1   2   3   4   5   6   7   8   9   10   >