LibreOffice Module sc (master) 1
refupdatecontext.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 "global.hxx"
13#include "address.hxx"
14#include "columnset.hxx"
15
16#include <unordered_map>
17#include <unordered_set>
18
19class ScDocument;
20
21namespace sc
22{
23struct ColumnBlockPosition;
24class ColumnBlockPositionSet;
25
33{
34public:
35 typedef std::unordered_set<sal_uInt16> NameIndicesType;
36
37 void setUpdatedName(SCTAB nTab, sal_uInt16 nIndex);
38 bool isNameUpdated(SCTAB nTab, sal_uInt16 nIndex) const;
40 bool isEmpty(SCTAB nTab) const;
41
42private:
43 typedef std::unordered_map<SCTAB, NameIndicesType> UpdatedNamesType;
44
46};
47
53{
55
62
70
73
80
83
85
86 RefUpdateContext(ScDocument& rDoc, ScDocument* pClipdoc = nullptr);
87
88 bool isInserted() const;
89 bool isDeleted() const;
90
93};
94
96{
103
109
115
117};
118
120{
125
126 RefUpdateInsertTabContext(ScDocument& rDoc, SCTAB nInsertPos, SCTAB nSheets);
127};
128
130{
135
136 RefUpdateDeleteTabContext(ScDocument& rDoc, SCTAB nInsertPos, SCTAB nSheets);
137};
138
140{
145
146 RefUpdateMoveTabContext(ScDocument& rDoc, SCTAB nOldPos, SCTAB nNewPos);
147
148 SCTAB getNewTab(SCTAB nOldTab) const;
149};
150
152{
155
161
163};
164}
165
166/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Simple container to keep track of sheet - column pair.
Definition: columnset.hxx:24
Keep track of all named expressions that have been updated during reference update.
UpdatedNamesType maUpdatedNames
std::unordered_set< sal_uInt16 > NameIndicesType
std::unordered_map< SCTAB, NameIndicesType > UpdatedNamesType
NameIndicesType getUpdatedNames(SCTAB nTab) const
bool isNameUpdated(SCTAB nTab, sal_uInt16 nIndex) const
void setUpdatedName(SCTAB nTab, sal_uInt16 nIndex)
bool isEmpty(SCTAB nTab) const
UpdateRefMode
Definition: global.hxx:301
CAUTION! The following defines must be in the same namespace as the respective type.
Definition: broadcast.cxx:15
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
Store position data for column array storage.
Context for reference update during shifting, moving or copying of cell ranges.
ColumnBlockPosition * getBlockPosition(SCTAB nTab, SCCOL nCol)
SCROW mnRowDelta
Amount and direction of movement in the row direction.
UpdateRefMode meMode
update mode - insert/delete, copy, or move.
RefUpdateContext(ScDocument &rDoc, ScDocument *pClipdoc=nullptr)
void setBlockPositionReference(ColumnBlockPositionSet *blockPos)
SCCOL mnColDelta
Amount and direction of movement in the column direction.
bool mbTransposed
Are the data transposed?
SCTAB mnTabDelta
Amount and direction of movement in the sheet direction.
ColumnBlockPositionSet * mpBlockPos
ScRange maRange
Range of cells that are about to be moved for insert/delete/move modes.
UpdatedRangeNames maUpdatedNames
RefUpdateMoveTabContext(ScDocument &rDoc, SCTAB nOldPos, SCTAB nNewPos)
SCTAB getNewTab(SCTAB nOldTab) const
bool mbReferenceModified
This flag indicates whether any reference in the token array has been modified.
bool mbValueChanged
When this flag is true, the result of the formula needs to be re-calculated either because it contain...
bool mbNameModified
When this flag is true, it indicates that the token array contains a range name that's been updated.
bool mbClearTabDeletedFlag
When true, go through all reference tokens and clears "sheet deleted" flag if its corresponding index...
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17