Avoid potential negative array index access to cached text.
[LibreOffice.git] / chart2 / source / tools / RegressionEquation.hxx
blob8a500cd1d73cb56ec41861453093a3cbb470f7cc
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 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #pragma once
21 #include <com/sun/star/lang/XServiceInfo.hpp>
22 #include <com/sun/star/util/XCloneable.hpp>
23 #include <com/sun/star/chart2/XTitle.hpp>
25 #include <OPropertySet.hxx>
27 #include <cppuhelper/implbase.hxx>
28 #include <comphelper/uno3.hxx>
29 #include <ModifyListenerHelper.hxx>
31 namespace chart
34 namespace impl
36 typedef ::cppu::WeakImplHelper<
37 css::lang::XServiceInfo,
38 css::util::XCloneable,
39 css::util::XModifyBroadcaster,
40 css::util::XModifyListener,
41 css::chart2::XTitle >
42 RegressionEquation_Base;
45 class RegressionEquation final :
46 public impl::RegressionEquation_Base,
47 public ::property::OPropertySet
49 public:
50 explicit RegressionEquation();
51 virtual ~RegressionEquation() override;
53 virtual OUString SAL_CALL
54 getImplementationName()
55 override;
56 virtual sal_Bool SAL_CALL
57 supportsService( const OUString& ServiceName )
58 override;
59 virtual css::uno::Sequence< OUString > SAL_CALL
60 getSupportedServiceNames()
61 override;
63 /// merge XInterface implementations
64 DECLARE_XINTERFACE()
66 private:
67 explicit RegressionEquation( const RegressionEquation & rOther );
69 // ____ OPropertySet ____
70 virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override;
72 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
74 // ____ XPropertySet ____
75 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
76 getPropertySetInfo() override;
78 // ____ XCloneable ____
79 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
81 // ____ XModifyBroadcaster ____
82 virtual void SAL_CALL addModifyListener(
83 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
84 virtual void SAL_CALL removeModifyListener(
85 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
87 // ____ XModifyListener ____
88 virtual void SAL_CALL modified(
89 const css::lang::EventObject& aEvent ) override;
91 // ____ XEventListener (base of XModifyListener) ____
92 virtual void SAL_CALL disposing(
93 const css::lang::EventObject& Source ) override;
95 // ____ XTitle ____
96 virtual css::uno::Sequence<
97 css::uno::Reference< css::chart2::XFormattedString > > SAL_CALL getText() override;
98 virtual void SAL_CALL setText( const css::uno::Sequence<
99 css::uno::Reference<
100 css::chart2::XFormattedString > >& Strings ) override;
102 using ::cppu::OPropertySetHelper::disposing;
104 // ____ OPropertySet ____
105 virtual void firePropertyChangeEvent() override;
107 void fireModifyEvent();
109 css::uno::Sequence< css::uno::Reference< css::chart2::XFormattedString > > m_aStrings;
111 rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
114 } // namespace chart
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */