Coverage Report

Created: 2025-07-07 10:01

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