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#pragma once
11
12#include <stddef.h>
13#include "address.hxx"
14#include <mdds/multi_type_vector/types.hpp>
15#include "mtvelements.hxx"
16#include <sal/types.h>
17#include "types.hxx"
18class ScColumn;
19class ScDocument;
20struct ScRefCellValue;
21
23{
24 const size_t mnEnd;
25 size_t mnCurPos;
26 sc::CellTextAttrStoreType::iterator miBlockCur;
27 sc::CellTextAttrStoreType::iterator miBlockEnd;
28 sc::celltextattr_block::iterator miDataCur;
29 sc::celltextattr_block::iterator miDataEnd;
30
31public:
34 ScColumnTextWidthIterator(const ScDocument& rDoc, ScColumn& rCol, SCROW nStartRow,
35 SCROW nEndRow);
36
45 ScColumnTextWidthIterator(const ScDocument& rDoc, const ScAddress& rStartPos, SCROW nEndRow);
46
47 void next();
48 bool hasCell() const;
49 SCROW getPos() const;
50 sal_uInt16 getValue() const;
51 void setValue(sal_uInt16 nVal);
52
53private:
54 void init(const ScDocument& rDoc, SCROW nStartRow, SCROW nEndRow);
55 void getDataIterators(size_t nOffsetInBlock);
56 void checkEndRow();
57};
58
59namespace sc
60{
67{
68 CellStoreType::const_position_type maPos;
69 CellStoreType::const_position_type maPosEnd;
71
72public:
73 ColumnIterator(const CellStoreType& rCells, SCROW nRow1, SCROW nRow2);
74
75 void next();
76
77 SCROW getRow() const;
78
79 bool hasCell() const;
80
81 mdds::mtv::element_t getType() const;
82
83 ScRefCellValue getCell() const;
84};
85}
86
87/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc::CellTextAttrStoreType::iterator miBlockEnd
void setValue(sal_uInt16 nVal)
ScColumnTextWidthIterator(const ScColumnTextWidthIterator &)=delete
sal_uInt16 getValue() const
sc::celltextattr_block::iterator miDataCur
const ScColumnTextWidthIterator & operator=(const ScColumnTextWidthIterator &)=delete
void getDataIterators(size_t nOffsetInBlock)
void init(const ScDocument &rDoc, SCROW nStartRow, SCROW nEndRow)
sc::CellTextAttrStoreType::iterator miBlockCur
sc::celltextattr_block::iterator miDataEnd
This iterator lets you iterate over cells over specified range in a single column.
ColumnIterator(const CellStoreType &rCells, SCROW nRow1, SCROW nRow2)
SCROW getRow() const
CellStoreType::const_position_type maPos
CellStoreType::const_position_type maPosEnd
ScRefCellValue getCell() const
mdds::mtv::element_t getType() const
CAUTION! The following defines must be in the same namespace as the respective type.
mdds::mtv::soa::multi_type_vector< CellStoreTraits > CellStoreType
Cell container.
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:108
sal_Int32 SCROW
Definition: types.hxx:17