Avoid potential negative array index access to cached text.
[LibreOffice.git] / sc / inc / ChartTools.hxx
blob4f1accb1bbf81931f259f8d349f3703e05d5c38f
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 */
11 #pragma once
13 #include <string_view>
14 #include <memory>
15 #include <vector>
17 #include <svx/svditer.hxx>
18 #include <tools/long.hxx>
19 #include "types.hxx"
20 #include <optional>
22 class ScDocShell;
23 class SdrOle2Obj;
25 namespace sc::tools {
27 enum class ChartSourceType
29 CELL_RANGE,
30 PIVOT_TABLE
33 class ChartIterator
35 private:
36 std::optional<SdrObjListIter> m_oIterator;
37 ChartSourceType m_eChartSourceType;
38 public:
39 ChartIterator(ScDocShell* pDocShell, SCTAB nTab, ChartSourceType eChartSourceType);
40 SdrOle2Obj* next();
43 SdrOle2Obj* findChartsByName(ScDocShell* pDocShell, SCTAB nTab,
44 std::u16string_view rName,
45 ChartSourceType eChartSourceType);
47 SdrOle2Obj* getChartByIndex(ScDocShell* pDocShell, SCTAB nTab,
48 ::tools::Long nIndex, ChartSourceType eChartSourceType);
50 std::vector<SdrOle2Obj*> getAllPivotChartsConnectedTo(std::u16string_view sPivotTableName, ScDocShell* pDocShell);
52 } // end sc::tools
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */