core.git: accessibility/source vcl/source

2024-03-07 Thread Michael Stahl (via logerrit)
 accessibility/source/standard/vclxaccessibletoolbox.cxx |   11 ---
 vcl/source/window/accessibility.cxx |2 +-
 2 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 825dde03999a55d02e4d5bc88a4d5beacb65e67f
Author: Michael Stahl 
AuthorDate: Tue Mar 5 19:21:21 2024 +0100
Commit: Michael Stahl 
CommitDate: Thu Mar 7 10:52:12 2024 +0100

vcl,accessibility: try to fix a crash while disposing SvxFontNameBox_Impl

This happened in a 6.3 based branch, no idea how to reproduce it.
Clearly the SvxFontNameBox_Impl is being disposed and in its base class
Window::dispose() when a call to SvxFontNameBox_Impl::CreateAccessible()
happens, which seems very suspicious; try to prevent that.

mergedlo.dll!ImplListBox::InsertEntry(long nPos, const rtl::OUString & 
rStr) Zeile 2225
unter d:\lomergedlo.dll!ComboBox::InsertEntry(const 
rtl::OUString & rStr, long nPos) Zeile 886
unter d:\lomergedlo.dll!FontNameBox::Fill(const FontList * 
pList) Zeile 447
unter d:\lo[Inlineframe] 
mergedlo.dll!SvxFontNameBox_Impl::Fill(const FontList * pList) Zeile 236
unter d:\lomergedlo.dll!lcl_GetDocFontList(const FontList * * 
ppFontList, SvxFontNameBox_Impl * pBox) Zeile 1290
unter d:\lomergedlo.dll!SvxFontNameBox_Impl::FillList() Zeile 
1331
unter d:\lomergedlo.dll!SvxFontNameBox_Impl::CreateAccessible() 
Zeile 3739
unter d:\lomergedlo.dll!vcl::Window::GetAccessible(bool 
bCreate) Zeile 129
unter d:\lo
acclo.dll!VCLXAccessibleToolBox::getAccessibleChild(long i) Zeile 733
unter d:\lo
acclo.dll!VCLXAccessibleToolBox::GetItemWindowAccessible(const VclWindowEvent & 
rVclWindowEvent) Zeile 784
unter d:\lo
acclo.dll!VCLXAccessibleToolBox::GetChildAccessible(const VclWindowEvent & 
rVclWindowEvent) Zeile 795
unter d:\lo
mergedlo.dll!VCLXAccessibleComponent::ProcessWindowChildEvent(const 
VclWindowEvent & rVclWindowEvent) Zeile 165
unter d:\lo
acclo.dll!VCLXAccessibleToolBox::ProcessWindowChildEvent(const VclWindowEvent & 
rVclWindowEvent) Zeile 657
unter d:\lo
mergedlo.dll!VCLXAccessibleComponent::WindowChildEventListener(VclWindowEvent & 
rEvent) Zeile 129
unter d:\lo
mergedlo.dll!VCLXAccessibleComponent::LinkStubWindowChildEventListener(void * 
instance, VclWindowEvent & data) Zeile 118
unter d:\lo[Inlineframe] mergedlo.dll!Link::Call(VclWindowEvent &) Zeile 84
unter d:\lo
mergedlo.dll!vcl::Window::CallEventListeners(VclEventId nEvent, void * pData) 
Zeile 280
unter d:\lomergedlo.dll!vcl::Window::ImplResetReallyVisible() 
Zeile 735
unter d:\lomergedlo.dll!vcl::Window::ImplResetReallyVisible() 
Zeile 747
unter d:\lomergedlo.dll!vcl::Window::Show(bool bVisible, 
ShowFlags nFlags) Zeile 2198
unter d:\lomergedlo.dll!vcl::Window::Show(bool bVisible, 
ShowFlags nFlags) Zeile 2176
unter d:\lo[Inlineframe] mergedlo.dll!vcl::Window::Hide() Zeile 
925
unter d:\lomergedlo.dll!vcl::Window::dispose() Zeile 402
unter d:\lomergedlo.dll!Edit::dispose() Zeile 258
unter d:\lomergedlo.dll!ComboBox::dispose() Zeile 132
unter d:\lomergedlo.dll!SvxFontNameBox_Impl::dispose() Zeile 
1322
unter d:\lo[Inlineframe] 
mergedlo.dll!VclPtr::disposeAndClear() Zeile 206
unter d:\lomergedlo.dll!SvxFontNameToolBoxControl::dispose() 
Zeile 3309
unter d:\lo
mergedlo.dll!framework::ToolBarManager::RemoveControllers() Zeile 651
unter d:\lomergedlo.dll!framework::ToolBarManager::dispose() 
Zeile 468
unter d:\lomergedlo.dll!framework::ToolBarWrapper::dispose() 
Zeile 105
unter d:\lo
mergedlo.dll!framework::ToolbarLayoutManager::destroyToolbars() Zeile 666
unter d:\lo
mergedlo.dll!framework::ToolbarLayoutManager::reset() Zeile 364
unter d:\lo
mergedlo.dll!framework::LayoutManager::implts_reset(bool bAttached) Zeile 458
unter d:\lo
mergedlo.dll!framework::LayoutManager::frameAction(const 
com::sun::star::frame::FrameActionEvent & aEvent) Zeile 2757
unter d:\lomergedlo.dll!`anonymous 
namespace'::XFrameImpl::implts_sendFrameActionEvent(const 
com::sun::star::frame::FrameAction & aAction) Zeile 2952
unter d:\lomergedlo.dll!`anonymous 
namespace'::XFrameImpl::setComponent(const 
com::sun::star::uno::Reference & 
xComponentWindow, const 
com::sun::star::uno::Reference & 
xController) Zeile 1470
unter d:\lomergedlo.dll!`anonymous 
namespace'::XFrameImpl::close(unsigned char bDeliverOwnership) Zeile 1701
unter d:\lo
mergedlo.dll!framework::pattern::frame::closeIt(const 
com::sun::star::uno::Reference & 

[Libreoffice-commits] core.git: accessibility/source vcl/source

2023-10-24 Thread Michael Weghorn (via logerrit)
 accessibility/source/extended/accessiblelistboxentry.cxx |   17 +++
 vcl/source/treelist/svimpbox.cxx |8 +++
 2 files changed, 25 insertions(+)

New commits:
commit eafef8fd195654f0e7dbd007bcc7fa0f6d29b599
Author: Michael Weghorn 
AuthorDate: Tue Oct 24 10:03:44 2023 +0200
Commit: Michael Weghorn 
CommitDate: Tue Oct 24 12:58:14 2023 +0200

tdf#135921 a11y Send event when toggling listbox checkbox

When toggling the state of the checkbox in a listbox/
treelist entry using the mouse or the keyboard, emit
a `VclEventId::CheckboxToggle` event and process
that in the a11y class that's used for the case
where there's just a single checkbox (like in the
spelling options dialog), `AccessibleListBoxEntry`
by sending a corresponding STATE_CHANGED event
on the a11y layer.

This makes Orca with the qt6 VCL plugin and NVDA on Windows
announce the new value when toggling a checkbox in the
Spelling options dialog using either the mouse or the
keyboard.

As mentioned in the previous commit,

   Change-Id Ic78f9052d166be0da17a76261a09da02b8a11cd7
   tdf#135921 a11y: Toggle listbox item checkbox on space

, the case where a listbox entry has multiple checkboxes
(like the autocorrect options dialog in Writer)
uses different a11y classes and toggling a checkbox there
still doesn't result in the new value being announced.

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

diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx 
b/accessibility/source/extended/accessiblelistboxentry.cxx
index 69feac418805..10433d882730 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -84,6 +85,22 @@ namespace accessibility
 
 switch ( rEvent.GetId() )
 {
+case VclEventId::CheckboxToggle:
+{
+// assert this object is represented as a checkbox on a11y 
layer (LABEL role is used for
+// SvButtonState::Tristate, s. 
AccessibleListBoxEntry::getAccessibleRole)
+assert(getAccessibleRole() == AccessibleRole::CHECK_BOX
+   || getAccessibleRole() == AccessibleRole::LABEL);
+Any aOldValue;
+Any aNewValue;
+if (getAccessibleStateSet() & AccessibleStateType::CHECKED)
+aNewValue <<= AccessibleStateType::CHECKED;
+else
+aOldValue <<= AccessibleStateType::CHECKED;
+
+NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, 
aOldValue, aNewValue);
+break;
+}
 case  VclEventId::ObjectDying :
 {
 if ( m_pTreeListBox )
diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index 559882560a12..0deea8f69820 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -1849,7 +1849,12 @@ bool SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& 
rMEvt )
 m_pActiveButton->SetStateHilighted( false );
 tools::Long nMouseX = rMEvt.GetPosPixel().X();
 if (pEntry == m_pActiveEntry && m_pView->GetItem(m_pActiveEntry, 
nMouseX) == m_pActiveButton)
+{
+const bool bChecked = m_pActiveButton->IsStateChecked();
 m_pActiveButton->ClickHdl(m_pActiveEntry);
+if (m_pActiveButton->IsStateChecked() != bChecked)
+CallEventListeners(VclEventId::CheckboxToggle, m_pActiveEntry);
+}
 InvalidateEntry(m_pActiveEntry);
 if (m_pCursor == m_pActiveEntry)
 ShowCursor(true);
@@ -2333,8 +2338,11 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
 if (pButtonItem)
 {
 SvLBoxButton* pButton = 
static_cast(pButtonItem);
+const bool bChecked = pButton->IsStateChecked();
 pButton->ClickHdl(m_pCursor);
 InvalidateEntry(m_pCursor);
+if (pButton->IsStateChecked() != bChecked)
+CallEventListeners(VclEventId::CheckboxToggle, 
m_pActiveEntry);
 }
 else
 bKeyUsed = false;


[Libreoffice-commits] core.git: accessibility/source vcl/source

2015-01-27 Thread Niklas Johansson
 accessibility/source/standard/vclxaccessibletoolbox.cxx |7 +++
 vcl/source/window/toolbox2.cxx  |3 +--
 2 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 9b7b1774459edb93f2d3a11b2441851f4355a613
Author: Niklas Johansson sleeping.pil...@gmail.com
Date:   Mon Jan 26 23:16:07 2015 +0100

tdf#88702 ACCESSIBILITY Toggle buttons state not reliably updated

We need to adapt the accessibility code to handle 
VCLEVENT_TOOLBOX_ITEMUPDATED,
since it is now sent from vcl/source/window/toolbox2.cxx.
I have tested the patch successfully on Windows and Fedora.

Change-Id: Ia4328d3c34547cc28ce9a3946f90223442ee84e3
Reviewed-on: https://gerrit.libreoffice.org/14190
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx 
b/accessibility/source/standard/vclxaccessibletoolbox.cxx
index c3042fb..a8a7cdf 100644
--- a/accessibility/source/standard/vclxaccessibletoolbox.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx
@@ -551,18 +551,17 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const 
VclWindowEvent rVclWindow
 case VCLEVENT_TOOLBOX_DEACTIVATE:
 //case VCLEVENT_TOOLBOX_SELECT:
 break;
-// IA2 CWS. MT: Still using VCLEVENT_TOOLBOX_CLICK, see comment in 
vcl/source/window/toolbox2.cxx
-/*
+
 case VCLEVENT_TOOLBOX_ITEMUPDATED:
 {
 if ( rVclWindowEvent.GetData() )
 {
 UpdateChecked_Impl( TOOLBOX_ITEM_NOTFOUND );
-UpdateIndeterminate_Impl( (sal_Int32)rVclWindowEvent.GetData() 
);
+UpdateIndeterminate_Impl( 
(sal_Int32)reinterpret_castsal_IntPtr(rVclWindowEvent.GetData()) );
 }
 break;
 }
-*/
+
 case VCLEVENT_TOOLBOX_HIGHLIGHT:
 UpdateFocus_Impl();
 break;
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index e1cad51..247aaef 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1458,8 +1458,7 @@ void ToolBox::SetItemState( sal_uInt16 nItemId, TriState 
eState )
 // Notify button changed event to prepare accessibility bridge
 CallEventListeners( VCLEVENT_TOOLBOX_BUTTONSTATECHANGED, 
reinterpret_cast void* ( nPos ) );
 
-// Notify
-//Solution:Call accessible listener to notify state_changed event
+// Call accessible listener to notify state_changed event
 CallEventListeners( VCLEVENT_TOOLBOX_ITEMUPDATED, 
reinterpret_cast void* (nPos) );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits