Avoid potential negative array index access to cached text.
[LibreOffice.git] / chart2 / source / controller / sidebar / ChartErrorBarPanel.hxx
blob92f7afb0ad5365d1ecf1aa4a3b0465a6a4227dcb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 */
11 #pragma once
13 #include <sfx2/sidebar/ControllerItem.hxx>
14 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
15 #include <sfx2/sidebar/SidebarModelUpdate.hxx>
16 #include <sfx2/sidebar/PanelLayout.hxx>
17 #include "ChartSidebarModifyListener.hxx"
19 namespace com::sun::star::util { class XModifyListener; }
21 namespace chart {
23 class ChartController;
24 class ChartModel;
26 namespace sidebar {
28 class ChartErrorBarPanel : public PanelLayout,
29 public ::sfx2::sidebar::IContextChangeReceiver,
30 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface,
31 public sfx2::sidebar::SidebarModelUpdate,
32 public ChartSidebarModifyListenerParent
34 public:
35 static std::unique_ptr<PanelLayout> Create(
36 weld::Widget* pParent,
37 ChartController* pController);
39 virtual void DataChanged(
40 const DataChangedEvent& rEvent) override;
42 virtual void HandleContextChange(
43 const vcl::EnumContext& rContext) override;
45 virtual void NotifyItemUpdate(
46 const sal_uInt16 nSId,
47 const SfxItemState eState,
48 const SfxPoolItem* pState) override;
50 virtual void GetControlState(
51 const sal_uInt16 /*nSId*/,
52 boost::property_tree::ptree& /*rState*/) override {};
54 // constructor/destructor
55 ChartErrorBarPanel(
56 weld::Widget* pParent,
57 ChartController* pController);
58 virtual ~ChartErrorBarPanel() override;
60 virtual void updateData() override;
61 virtual void modelInvalid() override;
63 virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) override;
65 private:
66 //ui controls
67 std::unique_ptr<weld::RadioButton> mxRBPosAndNeg;
68 std::unique_ptr<weld::RadioButton> mxRBPos;
69 std::unique_ptr<weld::RadioButton> mxRBNeg;
71 std::unique_ptr<weld::ComboBox> mxLBType;
73 std::unique_ptr<weld::SpinButton> mxMFPos;
74 std::unique_ptr<weld::SpinButton> mxMFNeg;
76 rtl::Reference<::chart::ChartModel> mxModel;
77 css::uno::Reference<css::util::XModifyListener> mxListener;
79 bool mbModelValid;
81 void Initialize();
82 void doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel);
84 DECL_LINK(RadioBtnHdl, weld::Toggleable&, void);
85 DECL_LINK(ListBoxHdl, weld::ComboBox&, void);
86 DECL_LINK(NumericFieldHdl, weld::SpinButton&, void);
89 } } // end of namespace ::chart::sidebar
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */