Coverage Report

Created: 2026-06-30 11:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sc/source/ui/cctrl/TableStylesControl.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
10
#include <TableStylesControl.hxx>
11
#include <TableStylesBox.hxx>
12
#include <svl/intitem.hxx>
13
#include <vcl/toolbox.hxx>
14
#include <dbdata.hxx>
15
16
using namespace sc;
17
18
SFX_IMPL_TOOLBOX_CONTROL(TableStylesControl, ScDatabaseSettingItem);
19
20
TableStylesControl::TableStylesControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx)
21
0
    : SfxToolBoxControl(nSlotId, nId, rTbx)
22
0
{
23
0
}
Unexecuted instantiation: sc::TableStylesControl::TableStylesControl(unsigned short, o3tl::strong_int<unsigned short, ToolBoxItemIdTag>, ToolBox&)
Unexecuted instantiation: sc::TableStylesControl::TableStylesControl(unsigned short, o3tl::strong_int<unsigned short, ToolBoxItemIdTag>, ToolBox&)
24
25
0
TableStylesControl::~TableStylesControl() {}
26
27
void TableStylesControl::StateChangedAtToolBoxControl(sal_uInt16, SfxItemState eState,
28
                                                      const SfxPoolItem* pState)
29
0
{
30
0
    ToolBoxItemId nId = GetId();
31
0
    ToolBox& rToolBox = GetToolBox();
32
0
    TableStylesBox* pTableStylesBox = static_cast<TableStylesBox*>(rToolBox.GetItemWindow(nId));
33
34
0
    if (SfxItemState::DISABLED == eState)
35
0
        pTableStylesBox->Disable();
36
0
    else
37
0
        pTableStylesBox->Enable();
38
39
0
    rToolBox.EnableItem(nId, SfxItemState::DISABLED != eState);
40
41
0
    switch (eState)
42
0
    {
43
0
        case SfxItemState::DEFAULT:
44
0
        {
45
0
            const ScDatabaseSettingItem* pDBItem
46
0
                = static_cast<const ScDatabaseSettingItem*>(pState);
47
0
            if (pDBItem)
48
0
                pTableStylesBox->Update(pDBItem);
49
0
            break;
50
0
        }
51
52
0
        default:
53
0
            break;
54
0
    }
55
0
}
56
57
VclPtr<InterimItemWindow> TableStylesControl::CreateItemWindow(vcl::Window* pParent)
58
0
{
59
0
    VclPtr<TableStylesBox> pControl = VclPtr<TableStylesBox>::Create(pParent);
60
0
    pControl->Show();
61
62
0
    return pControl;
63
0
}
64
65
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */