Avoid potential negative array index access to cached text.
[LibreOffice.git] / sc / inc / filterentries.hxx
blob1ec3f22a324bded67c88b93e1eec89ca0bc56316
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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 <sal/config.h>
13 #include "typedstrdata.hxx"
14 #include <vector>
15 #include <tools/color.hxx>
17 struct ScFilterEntries
19 std::vector<ScTypedStrData> maStrData;
20 bool mbHasDates;
21 bool mbHasHiddenEmpties;
22 bool mbHasUnHiddenEmpties;
23 std::set<Color> maTextColors;
24 std::set<Color> maBackgroundColors;
26 ScFilterEntries() : mbHasDates(false),
27 mbHasHiddenEmpties(false),
28 mbHasUnHiddenEmpties(false) {}
30 std::vector<ScTypedStrData>::iterator begin() { return maStrData.begin(); }
31 std::vector<ScTypedStrData>::iterator end() { return maStrData.end(); }
32 std::vector<ScTypedStrData>::const_iterator begin() const { return maStrData.begin(); }
33 std::vector<ScTypedStrData>::const_iterator end() const { return maStrData.end(); }
34 std::vector<ScTypedStrData>::size_type size() const { return maStrData.size(); }
35 ScTypedStrData& front() { return maStrData.front(); }
36 const ScTypedStrData& front() const { return maStrData.front(); }
37 bool empty() const { return maStrData.empty(); }
38 void push_back( const ScTypedStrData& r ) { maStrData.push_back(r); }
39 void push_back( ScTypedStrData&& r ) { maStrData.push_back(r); }
40 std::set<Color>& getTextColors() { return maTextColors; };
41 void addTextColor(const Color& aTextColor) { maTextColors.emplace(aTextColor); }
42 std::set<Color>& getBackgroundColors() { return maBackgroundColors; };
43 void addBackgroundColor(const Color& aBackgroundColor)
45 maBackgroundColors.emplace(aBackgroundColor);
49 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */