Files
odfstudio/sc/source/ui/cctrl/TableStylesControl.cxx
Balazs Varga 8f928fa25c Table Styles: Add NoteBookBar implementation for table styles
New ui file for the notebookbars which includes all the database
settings options.

Also fix some view shell issue when we deselect a table context
and Insert Table is not active

Since JSCheckButton is kind of a button which can have a default
state (false) always need to send Update to online for registering
the api call connecting to the checkbutton.

Change-Id: Ie9701d2897b389c2a0192650a2f907e5fae59673
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194917
Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196772
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
Tested-by: Balazs Varga <balazs.varga@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197998
Tested-by: Jenkins
2026-01-29 09:32:39 +01:00

66 lines
1.8 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <TableStylesControl.hxx>
#include <TableStylesBox.hxx>
#include <svl/intitem.hxx>
#include <vcl/toolbox.hxx>
#include <dbdata.hxx>
using namespace sc;
SFX_IMPL_TOOLBOX_CONTROL(TableStylesControl, ScDatabaseSettingItem);
TableStylesControl::TableStylesControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx)
: SfxToolBoxControl(nSlotId, nId, rTbx)
{
}
TableStylesControl::~TableStylesControl() {}
void TableStylesControl::StateChangedAtToolBoxControl(sal_uInt16, SfxItemState eState,
const SfxPoolItem* pState)
{
ToolBoxItemId nId = GetId();
ToolBox& rToolBox = GetToolBox();
TableStylesBox* pTableStylesBox = static_cast<TableStylesBox*>(rToolBox.GetItemWindow(nId));
if (SfxItemState::DISABLED == eState)
pTableStylesBox->Disable();
else
pTableStylesBox->Enable();
rToolBox.EnableItem(nId, SfxItemState::DISABLED != eState);
switch (eState)
{
case SfxItemState::DEFAULT:
{
const ScDatabaseSettingItem* pDBItem
= static_cast<const ScDatabaseSettingItem*>(pState);
if (pDBItem)
pTableStylesBox->Update(pDBItem);
break;
}
default:
break;
}
}
VclPtr<InterimItemWindow> TableStylesControl::CreateItemWindow(vcl::Window* pParent)
{
VclPtr<TableStylesBox> pControl = VclPtr<TableStylesBox>::Create(pParent);
pControl->Show();
return pControl;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */