Avoid potential negative array index access to cached text.
[LibreOffice.git] / chart2 / source / controller / inc / uiobject.hxx
blob917ba322bf5e636b882350c4c718cfd6e5cff26c
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 private:
37 OUString maCID;
38 VclPtr<chart::ChartWindow> mxChartWindow;
39 std::vector<std::unique_ptr<OUString>> maCommands;
41 DECL_LINK(PostCommand, void*, void);
44 class ChartWindowUIObject final : public WindowUIObject
46 VclPtr<chart::ChartWindow> mxChartWindow;
48 public:
50 ChartWindowUIObject(const VclPtr<chart::ChartWindow>& xChartWindow);
52 virtual StringMap get_state() override;
54 virtual void execute(const OUString& rAction,
55 const StringMap& rParameters) override;
57 virtual std::unique_ptr<UIObject> get_child(const OUString& rID) override;
59 virtual std::set<OUString> get_children() const override;
61 static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
63 protected:
65 virtual OUString get_name() const override;
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */