Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / inc / columniterator.hxx
blob4e8c951be750cdd8cbf770912cc32c896dbf90e8
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 */
10 #ifndef INCLUDED_SC_INC_COLUMNITERATOR_HXX
11 #define INCLUDED_SC_INC_COLUMNITERATOR_HXX
13 #include "column.hxx"
15 class ScColumnTextWidthIterator
17 sc::CellTextAttrStoreType& mrCellTextAttrs;
18 const size_t mnEnd;
19 size_t mnCurPos;
20 sc::CellTextAttrStoreType::iterator miBlockCur;
21 sc::CellTextAttrStoreType::iterator miBlockEnd;
22 sc::celltextattr_block::iterator miDataCur;
23 sc::celltextattr_block::iterator miDataEnd;
25 public:
26 ScColumnTextWidthIterator(const ScColumnTextWidthIterator&) = delete;
27 const ScColumnTextWidthIterator& operator=(const ScColumnTextWidthIterator&) = delete;
28 ~ScColumnTextWidthIterator() = default;
29 ScColumnTextWidthIterator(ScColumn& rCol, SCROW nStartRow, SCROW nEndRow);
31 /**
32 * @param rDoc document instance.
33 * @param rStartPos position of the first cell from which to start
34 * iteration. Note that the caller must ensure that this
35 * position is valid; the constructor does not check its
36 * validity.
37 * @param nEndRow end row position.
39 ScColumnTextWidthIterator(ScDocument& rDoc, const ScAddress& rStartPos, SCROW nEndRow);
41 void next();
42 bool hasCell() const;
43 SCROW getPos() const;
44 sal_uInt16 getValue() const;
45 void setValue(sal_uInt16 nVal);
47 private:
48 void init(SCROW nStartRow, SCROW nEndRow);
49 void getDataIterators(size_t nOffsetInBlock);
50 void checkEndRow();
53 #endif
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */