Coverage Report

Created: 2026-04-09 11:41

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/chart2/source/controller/dialogs/tp_DataPointOption.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 "tp_DataPointOption.hxx"
21
22
#include <chartview/ChartSfxItemIds.hxx>
23
#include <svl/eitem.hxx>
24
#include <vcl/weld/Builder.hxx>
25
26
namespace chart
27
{
28
DataPointOptionTabPage::DataPointOptionTabPage(weld::Container* pPage,
29
                                               weld::DialogController* pController,
30
                                               const SfxItemSet& rInAttrs)
31
0
    : SfxTabPage(pPage, pController, u"modules/schart/ui/tp_DataPointOption.ui"_ustr,
32
0
                 u"tp_DataPointOption"_ustr, &rInAttrs)
33
0
    , m_xCBHideLegendEntry(m_xBuilder->weld_check_button(u"CB_LEGEND_ENTRY_HIDDEN"_ustr))
34
0
{
35
0
}
36
37
0
DataPointOptionTabPage::~DataPointOptionTabPage() {}
38
39
std::unique_ptr<SfxTabPage> DataPointOptionTabPage::Create(weld::Container* pPage,
40
                                                           weld::DialogController* pController,
41
                                                           const SfxItemSet* rOutAttrs)
42
0
{
43
0
    return std::make_unique<DataPointOptionTabPage>(pPage, pController, *rOutAttrs);
44
0
}
45
46
bool DataPointOptionTabPage::FillItemSet(SfxItemSet* rOutAttrs)
47
0
{
48
0
    if (m_xCBHideLegendEntry->get_visible())
49
0
        rOutAttrs->Put(
50
0
            SfxBoolItem(SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY, m_xCBHideLegendEntry->get_active()));
51
52
0
    return true;
53
0
}
54
55
void DataPointOptionTabPage::Reset(const SfxItemSet* rInAttrs)
56
0
{
57
0
    if (const SfxBoolItem* pEntryItem
58
0
        = rInAttrs->GetItemIfSet(SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY))
59
0
    {
60
0
        bool bVal = pEntryItem->GetValue();
61
0
        m_xCBHideLegendEntry->set_active(bVal);
62
0
    }
63
0
}
64
65
} //namespace chart
66
67
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */