Files
odfstudio/include/svx/ThemeColorsToolBoxControl.hxx
T
Caolán McNamara 42cfdea1b5 remove optimize svx::ThemeColorsPaneBase::initColorSets cost
19.17% of

https://github.com/CollaboraOnline/online/issues/15054#issuecomment-4213614352

this is fired too often, make the broadcast/listen more direct and avoid
the spurious wakeup on generic invalidate-all that it can't filter out.

Change-Id: I9476591a5feefa5e47de5f8098eaa152fc8b10ac
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/870
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 92ae69bd1c8a8bc7f8fafc2dddec000182c6fb6d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207074
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-06-21 22:16:28 +02:00

77 lines
2.6 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* 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/.
*/
#pragma once
#include <svx/svxdllapi.h>
#include <svtools/toolboxcontroller.hxx>
#include <svl/lstner.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <vcl/vclptr.hxx>
#include <vcl/InterimItemWindow.hxx>
#include <svx/dialog/ThemeColorsPaneBase.hxx>
// Used to put theme colors pane to the notebookbar
class SVX_DLLPUBLIC ThemeColorsPaneWrapper final : public InterimItemWindow,
public svx::ThemeColorsPaneBase,
public SfxListener
{
private:
css::uno::Reference<css::frame::XFrame> m_xFrame;
public:
ThemeColorsPaneWrapper(vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame);
virtual ~ThemeColorsPaneWrapper() override;
virtual void dispose() override;
void SetOptimalSize();
void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
DECL_LINK(SelectionChangedHdl, weld::ItemView&, void);
protected:
void onColorSetActivated() override;
};
using ThemeColorsToolBoxControl_Base
= cppu::ImplInheritanceHelper<svt::ToolboxController, css::lang::XServiceInfo>;
class SVX_DLLPUBLIC ThemeColorsToolBoxControl final : public ThemeColorsToolBoxControl_Base
{
VclPtr<ThemeColorsPaneWrapper> m_xVclBox;
public:
ThemeColorsToolBoxControl();
virtual ~ThemeColorsToolBoxControl() override;
// XStatusListener
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& rEvent) override;
// XToolbarController
virtual css::uno::Reference<css::awt::XWindow>
SAL_CALL createItemWindow(const css::uno::Reference<css::awt::XWindow>& rParent) override;
// WeakComponentImplHelperBase
using ThemeColorsToolBoxControl_Base::disposing;
virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
// XUpdatable
virtual void SAL_CALL update() override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() override;
virtual sal_Bool SAL_CALL supportsService(const OUString& rServiceName) override;
virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */