Coverage Report

Created: 2026-05-16 09:25

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/vcl/source/accessibility/accessibletablistbox.cxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
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
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
11
 *   Licensed to the Apache Software Foundation (ASF) under one or more
12
 *   contributor license agreements. See the NOTICE file distributed
13
 *   with this work for additional information regarding copyright
14
 *   ownership. The ASF licenses this file to you under the Apache
15
 *   License, Version 2.0 (the "License"); you may not use this file
16
 *   except in compliance with the License. You may obtain a copy of
17
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
 */
19
20
#include <SvHeaderTabListBox.hxx>
21
#include <accessibility/accessibletablistbox.hxx>
22
#include <accessibility/accessibletablistboxtable.hxx>
23
24
#include <svtabbx.hxx>
25
26
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
27
28
// class AccessibleTabListBox -----------------------------------------------------
29
30
using namespace ::com::sun::star::accessibility;
31
using namespace ::com::sun::star::uno;
32
using namespace ::com::sun::star::lang;
33
using namespace ::com::sun::star;
34
35
36
// Ctor() and Dtor()
37
38
AccessibleTabListBox::AccessibleTabListBox(const rtl::Reference<comphelper::OAccessible>& rpParent,
39
                                           SvHeaderTabListBox& rBox)
40
0
    : AccessibleBrowseBox(rpParent, rBox)
41
0
    , m_pTabListBox(&rBox)
42
0
{
43
0
}
44
45
46
AccessibleTabListBox::~AccessibleTabListBox()
47
0
{
48
0
    if ( isAlive() )
49
0
    {
50
        // increment ref count to prevent double call of Dtor
51
0
        osl_atomic_increment( &m_refCount );
52
0
        dispose();
53
0
    }
54
0
}
55
56
rtl::Reference<AccessibleBrowseBoxTable> AccessibleTabListBox::createAccessibleTable()
57
0
{
58
0
    return new AccessibleTabListBoxTable( this, *m_pTabListBox );
59
0
}
60
61
// XAccessibleContext ---------------------------------------------------------
62
63
sal_Int64 SAL_CALL AccessibleTabListBox::getAccessibleChildCount()
64
0
{
65
    // only the table; header is handled by HeaderBar (which is a sibling of the SvHeaderTabListBox)
66
0
    return 1;
67
0
}
68
69
Reference< XAccessible > SAL_CALL
70
AccessibleTabListBox::getAccessibleChild( sal_Int64 nChildIndex )
71
0
{
72
0
    SolarMethodGuard aGuard(getMutex());
73
0
    ensureIsAlive();
74
75
0
    if (nChildIndex != 0)
76
0
        throw IndexOutOfBoundsException();
77
78
0
    return getTable();
79
0
}
80
81
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */