cid#1640468 Dereference after null check
[LibreOffice.git] / chart2 / source / controller / inc / uiobject.hxx
blob6de63f5d3fdf1d556105c197b1ce4973a1ede4a0
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/.
8 */
10 #pragma once
12 #include <memory>
13 #include <vcl/uitest/uiobject.hxx>
15 #include "ChartWindow.hxx"
17 class ChartUIObject final : public UIObject
19 public:
21 ChartUIObject(const VclPtr<chart::ChartWindow>& xChartWindow,
22 OUString aCID);
24 StringMap get_state() override;
26 virtual void execute(const OUString& rAction,
27 const StringMap& rParameters) override;
29 virtual std::unique_ptr<UIObject> get_child(const OUString& rID) override;
31 virtual std::set<OUString> get_children() const override;
33 virtual OUString get_type() const override;
35 virtual bool equals(const UIObject& rOther) const override;
37 private:
39 OUString maCID;
40 VclPtr<chart::ChartWindow> mxChartWindow;
41 std::vector<std::unique_ptr<OUString>> maCommands;
43 DECL_LINK(PostCommand, void*, void);
46 class ChartWindowUIObject final : public WindowUIObject
48 VclPtr<chart::ChartWindow> mxChartWindow;
50 public:
52 ChartWindowUIObject(const VclPtr<chart::ChartWindow>& xChartWindow);
54 virtual StringMap get_state() override;
56 virtual void execute(const OUString& rAction,
57 const StringMap& rParameters) override;
59 virtual std::unique_ptr<UIObject> get_child(const OUString& rID) override;
61 virtual std::set<OUString> get_children() const override;
63 static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
65 protected:
67 virtual OUString get_name() const override;
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */