LibreOffice Module sc (master)  1
columniterator.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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  */
9 
10 #ifndef INCLUDED_SC_INC_COLUMNITERATOR_HXX
11 #define INCLUDED_SC_INC_COLUMNITERATOR_HXX
12 
13 #include <stddef.h>
14 #include "address.hxx"
15 #include <mdds/multi_type_vector_types.hpp>
16 #include "mtvelements.hxx"
17 #include <sal/types.h>
18 #include "types.hxx"
19 class ScColumn;
20 class ScDocument;
21 struct ScRefCellValue;
22 
24 {
25  const size_t mnEnd;
26  size_t mnCurPos;
27  sc::CellTextAttrStoreType::iterator miBlockCur;
28  sc::CellTextAttrStoreType::iterator miBlockEnd;
29  sc::celltextattr_block::iterator miDataCur;
30  sc::celltextattr_block::iterator miDataEnd;
31 
32 public:
35  ScColumnTextWidthIterator(const ScDocument& rDoc, ScColumn& rCol, SCROW nStartRow,
36  SCROW nEndRow);
37 
46  ScColumnTextWidthIterator(const ScDocument& rDoc, const ScAddress& rStartPos, SCROW nEndRow);
47 
48  void next();
49  bool hasCell() const;
50  SCROW getPos() const;
51  sal_uInt16 getValue() const;
52  void setValue(sal_uInt16 nVal);
53 
54 private:
55  void init(const ScDocument& rDoc, SCROW nStartRow, SCROW nEndRow);
56  void getDataIterators(size_t nOffsetInBlock);
57  void checkEndRow();
58 };
59 
60 namespace sc
61 {
68 {
69  CellStoreType::const_position_type maPos;
70  CellStoreType::const_position_type maPosEnd;
71  bool mbComplete;
72 
73 public:
74  ColumnIterator(const CellStoreType& rCells, SCROW nRow1, SCROW nRow2);
76 
77  void next();
78 
79  SCROW getRow() const;
80 
81  bool hasCell() const;
82 
83  mdds::mtv::element_t getType() const;
84 
85  ScRefCellValue getCell() const;
86 };
87 }
88 
89 #endif
90 
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc::CellTextAttrStoreType::iterator miBlockEnd
bool hasCell() const
void setValue(sal_uInt16 nVal)
sc::celltextattr_block::iterator miDataCur
SCROW getRow() const
ScRefCellValue getCell() const
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:104
sc::celltextattr_block::iterator miDataEnd
mdds::multi_type_vector< CellFunc, CellStoreEvent > CellStoreType
sc::CellTextAttrStoreType::iterator miBlockCur
mdds::mtv::element_t getType() const
void init(const ScDocument &rDoc, SCROW nStartRow, SCROW nEndRow)
sal_uInt16 getValue() const
ColumnIterator(const CellStoreType &rCells, SCROW nRow1, SCROW nRow2)
sal_Int32 SCROW
Definition: types.hxx:18
CellStoreType::const_position_type maPosEnd
CellStoreType::const_position_type maPos
void getDataIterators(size_t nOffsetInBlock)
const ScColumnTextWidthIterator & operator=(const ScColumnTextWidthIterator &)=delete
This iterator lets you iterate over cells over specified range in a single column.
ScColumnTextWidthIterator(const ScColumnTextWidthIterator &)=delete