1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #include <QtAccessibleRegistry.hxx>
11 #include <QtXAccessible.hxx>
15 std::map
<XAccessible
*, QObject
*> QtAccessibleRegistry::m_aMapping
= {};
17 QObject
* QtAccessibleRegistry::getQObject(css::uno::Reference
<XAccessible
> xAcc
)
22 // look for existing entry in the map
23 auto entry
= m_aMapping
.find(xAcc
.get());
24 if (entry
!= m_aMapping
.end())
27 // create a new object and remember it in the map
28 QtXAccessible
* pQtAcc
= new QtXAccessible(xAcc
);
29 m_aMapping
.emplace(xAcc
.get(), pQtAcc
);
33 void QtAccessibleRegistry::insert(css::uno::Reference
<XAccessible
> xAcc
, QObject
* pQObject
)
36 m_aMapping
.emplace(xAcc
.get(), pQObject
);
39 void QtAccessibleRegistry::remove(css::uno::Reference
<XAccessible
> xAcc
)
42 m_aMapping
.erase(xAcc
.get());
45 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */