Coverage Report

Created: 2025-07-07 10:01

/src/libreoffice/chart2/source/controller/dialogs/res_BarGeometry.cxx
Line
Count
Source (jump to first uncovered line)
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 <res_BarGeometry.hxx>
21
#include <ResId.hxx>
22
#include <chart.hrc>
23
24
namespace chart
25
{
26
BarGeometryResources::BarGeometryResources(weld::Builder* pBuilder)
27
0
    : m_xFT_Geometry(pBuilder->weld_label(u"shapeft"_ustr))
28
0
    , m_xLB_Geometry(pBuilder->weld_tree_view(u"shape"_ustr))
29
0
{
30
0
    for (size_t i = 0; i < std::size(CHART_TYPE); ++i)
31
0
        m_xLB_Geometry->append_text(SchResId(CHART_TYPE[i]));
32
0
    m_xLB_Geometry->set_size_request(-1, m_xLB_Geometry->get_height_rows(std::size(CHART_TYPE)));
33
0
}
34
35
void BarGeometryResources::connect_changed(const Link<weld::TreeView&, void>& rLink)
36
0
{
37
0
    m_xLB_Geometry->connect_selection_changed(rLink);
38
0
}
39
40
void BarGeometryResources::set_visible(bool bShow)
41
0
{
42
0
    m_xFT_Geometry->set_visible(bShow);
43
0
    m_xLB_Geometry->set_visible(bShow);
44
0
}
45
46
void BarGeometryResources::set_sensitive(bool bEnable)
47
0
{
48
0
    m_xFT_Geometry->set_sensitive(bEnable);
49
0
    m_xLB_Geometry->set_sensitive(bEnable);
50
0
}
51
52
sal_Int32 BarGeometryResources::get_selected_index() const
53
0
{
54
0
    return m_xLB_Geometry->get_selected_index();
55
0
}
56
57
void BarGeometryResources::select(sal_Int32 nPos)
58
0
{
59
0
    if (nPos < m_xLB_Geometry->n_children())
60
0
        m_xLB_Geometry->select(nPos);
61
0
}
62
63
} //namespace chart
64
65
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */