Avoid potential negative array index access to cached text.
[LibreOffice.git] / chart2 / source / controller / inc / DataPointItemConverter.hxx
blob3c6e276ff763c1f2c113a86a40dc8de28f603bb4
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 "ItemConverter.hxx"
22 #include "GraphicPropertyItemConverter.hxx"
23 #include <com/sun/star/uno/Sequence.h>
25 #include <tools/color.hxx>
26 #include <rtl/ref.hxx>
28 #include <vector>
30 namespace com::sun::star::awt { struct Size; }
31 namespace com::sun::star::chart2 { class XDataSeries; }
32 namespace com::sun::star::frame { class XModel; }
33 namespace com::sun::star::uno { class XComponentContext; }
34 namespace chart { class ChartModel; }
35 namespace chart { class DataSeries; }
36 class SdrModel;
38 namespace chart::wrapper {
40 class DataPointItemConverter final : public ItemConverter
42 public:
43 DataPointItemConverter(
44 const rtl::Reference<::chart::ChartModel>& xChartModel,
45 const css::uno::Reference<css::uno::XComponentContext>& xContext,
46 const css::uno::Reference<css::beans::XPropertySet>& rPropertySet,
47 const rtl::Reference<::chart::DataSeries>& xSeries,
48 SfxItemPool& rItemPool,
49 SdrModel& rDrawModel,
50 const css::uno::Reference<css::lang::XMultiServiceFactory>& xNamedPropertyContainerFactory,
51 GraphicObjectType eMapTo,
52 const css::awt::Size* pRefSize = nullptr,
53 bool bDataSeries = false,
54 bool bUseSpecialFillColor = false,
55 sal_Int32 nSpecialFillColor = 0,
56 bool bOverwriteLabelsForAttributedDataPointsAlso = false,
57 sal_Int32 nNumberFormat = 0,
58 sal_Int32 nPercentNumberFormat = 0,
59 sal_Int32 nPointIndex = -1 );
61 virtual ~DataPointItemConverter() override;
63 virtual void FillItemSet( SfxItemSet & rOutItemSet ) const override;
64 virtual bool ApplyItemSet( const SfxItemSet & rItemSet ) override;
66 protected:
67 virtual const WhichRangesContainer& GetWhichPairs() const override;
68 virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const override;
70 virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const override;
71 virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) override;
73 private:
74 std::vector< std::unique_ptr<ItemConverter> > m_aConverters;
75 bool m_bDataSeries;
76 bool m_bOverwriteLabelsForAttributedDataPointsAlso;
77 bool m_bUseSpecialFillColor;
78 Color m_nSpecialFillColor;
79 sal_Int32 m_nNumberFormat;
80 sal_Int32 m_nPercentNumberFormat;
81 css::uno::Sequence<sal_Int32> m_aAvailableLabelPlacements;
82 bool m_bForbidPercentValue;
83 bool m_bHideLegendEntry;
84 sal_Int32 m_nPointIndex;
85 rtl::Reference<::chart::DataSeries> m_xSeries;
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */