LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / accessibility / source / extended / AccessibleIconView.cxx
blob6bc5c99e92434e452e463c296070eea3f48eab99
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <sal/config.h>
12 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
14 #include <toolkit/helper/convert.hxx>
15 #include <vcl/event.hxx>
17 #include <extended/AccessibleIconView.hxx>
19 namespace accessibility
21 AccessibleIconView::AccessibleIconView(
22 SvTreeListBox const& _rListBox,
23 const css::uno::Reference<css::accessibility::XAccessible>& _xParent)
24 : AccessibleListBox(_rListBox, _xParent)
28 void AccessibleIconView::ProcessWindowEvent(const VclWindowEvent& rVclWindowEvent)
30 if (!isAlive())
31 return;
33 switch (rVclWindowEvent.GetId())
35 case VclEventId::WindowMouseMove:
36 if (MouseEvent* pMouseEvt = static_cast<MouseEvent*>(rVclWindowEvent.GetData()))
38 if (auto xChild = getAccessibleAtPoint(AWTPoint(pMouseEvt->GetPosPixel())))
40 // Allow announcing the element on mouse hover
41 css::uno::Any aNew(xChild);
42 NotifyAccessibleEvent(
43 css::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, {}, aNew);
46 break;
47 default:
48 AccessibleListBox::ProcessWindowEvent(rVclWindowEvent);
51 } // namespace accessibility
53 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */