Avoid potential negative array index access to cached text.
[LibreOffice.git] / sfx2 / inc / sidebar / UnoPanels.hxx
blob36b98c8c50c1b078291d391f3bb9062efd7c1689
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 */
9 #pragma once
12 #include <com/sun/star/ui/XPanels.hpp>
14 #include <cppuhelper/implbase.hxx>
16 namespace com::sun::star::frame { class XFrame; }
17 namespace sfx2::sidebar { class SidebarController; }
19 /** get the decks
21 class SfxUnoPanels final : public cppu::WeakImplHelper<css::ui::XPanels>
24 public:
26 SfxUnoPanels(css::uno::Reference<css::frame::XFrame>, const OUString&);
28 // XPanels
29 virtual OUString SAL_CALL getDeckId() override;
31 // XNameAccess
33 virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
35 virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override;
37 virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
39 // XIndexAccess
41 virtual sal_Int32 SAL_CALL getCount() override;
43 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
45 // XElementAccess
46 virtual css::uno::Type SAL_CALL getElementType() override;
47 virtual sal_Bool SAL_CALL hasElements() override;
49 private:
51 const css::uno::Reference<css::frame::XFrame> xFrame;
52 sfx2::sidebar::SidebarController* getSidebarController();
53 const OUString& mDeckId;
57 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */