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 
19 class ScDocument;
20 
21 namespace sc
22 {
23 struct ColumnBlockPosition;
24 class ColumnBlockPositionSet;
25 
33 {
34 public:
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;
39  NameIndicesType getUpdatedNames(SCTAB nTab) const;
40  bool isEmpty(SCTAB nTab) const;
41 
42 private:
43  typedef std::unordered_map<SCTAB, NameIndicesType> UpdatedNamesType;
44 
45  UpdatedNamesType maUpdatedNames;
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 
116  RefUpdateResult();
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: */
SCROW mnRowDelta
Amount and direction of movement in the row direction.
void setBlockPositionReference(ColumnBlockPositionSet *blockPos)
UpdatedNamesType maUpdatedNames
Simple container to keep track of sheet - column pair.
Definition: columnset.hxx:23
bool mbValueChanged
When this flag is true, the result of the formula needs to be re-calculated either because it contain...
Context for reference update during shifting, moving or copying of cell ranges.
SCTAB getNewTab(SCTAB nOldTab) const
Store position data for column array storage.
bool mbClearTabDeletedFlag
When true, go through all reference tokens and clears "sheet deleted" flag if its corresponding index...
RefUpdateContext(ScDocument &rDoc, ScDocument *pClipdoc=nullptr)
std::unordered_set< sal_uInt16 > NameIndicesType
void setUpdatedName(SCTAB nTab, sal_uInt16 nIndex)
bool isEmpty(SCTAB nTab) const
bool isNameUpdated(SCTAB nTab, sal_uInt16 nIndex) const
ColumnBlockPositionSet * mpBlockPos
ColumnBlockPosition * getBlockPosition(SCTAB nTab, SCCOL nCol)
bool mbNameModified
When this flag is true, it indicates that the token array contains a range name that's been updated...
Keep track of all named expressions that have been updated during reference update.
UpdateRefMode meMode
update mode - insert/delete, copy, or move.
sal_Int16 SCCOL
Definition: types.hxx:21
std::unordered_map< SCTAB, NameIndicesType > UpdatedNamesType
ScRange maRange
Range of cells that are about to be moved for insert/delete/move modes.
NameIndicesType getUpdatedNames(SCTAB nTab) const
UpdateRefMode
Definition: global.hxx:309
sal_Int32 SCROW
Definition: types.hxx:17
SCTAB mnTabDelta
Amount and direction of movement in the sheet direction.
RefUpdateMoveTabContext(ScDocument &rDoc, SCTAB nOldPos, SCTAB nNewPos)
bool mbReferenceModified
This flag indicates whether any reference in the token array has been modified.
bool mbTransposed
Are the data transposed?
SCCOL mnColDelta
Amount and direction of movement in the column direction.
UpdatedRangeNames maUpdatedNames
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
sal_Int16 SCTAB
Definition: types.hxx:22