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 #ifndef INCLUDED_SC_INC_REFUPDATECONTEXT_HXX
11 #define INCLUDED_SC_INC_REFUPDATECONTEXT_HXX
12 
13 #include "global.hxx"
14 #include "address.hxx"
15 #include "columnset.hxx"
16 
17 #include <unordered_map>
18 #include <unordered_set>
19 
20 class ScDocument;
21 
22 namespace sc
23 {
24 struct ColumnBlockPosition;
25 class ColumnBlockPositionSet;
26 
34 {
35 public:
36  typedef std::unordered_set<sal_uInt16> NameIndicesType;
37 
38  void setUpdatedName(SCTAB nTab, sal_uInt16 nIndex);
39  bool isNameUpdated(SCTAB nTab, sal_uInt16 nIndex) const;
40  NameIndicesType getUpdatedNames(SCTAB nTab) const;
41  bool isEmpty(SCTAB nTab) const;
42 
43 private:
44  typedef std::unordered_map<SCTAB, NameIndicesType> UpdatedNamesType;
45 
46  UpdatedNamesType maUpdatedNames;
47 };
48 
54 {
56 
63 
71 
78 
81 
83 
85 
86  bool isInserted() const;
87  bool isDeleted() const;
88 
91 };
92 
94 {
101 
107 
113 
114  RefUpdateResult();
115 };
116 
118 {
123 
124  RefUpdateInsertTabContext(ScDocument& rDoc, SCTAB nInsertPos, SCTAB nSheets);
125 };
126 
128 {
133 
134  RefUpdateDeleteTabContext(ScDocument& rDoc, SCTAB nInsertPos, SCTAB nSheets);
135 };
136 
138 {
143 
144  RefUpdateMoveTabContext(ScDocument& rDoc, SCTAB nOldPos, SCTAB nNewPos);
145 
146  SCTAB getNewTab(SCTAB nOldTab) const;
147 };
148 
150 {
153 
159 
161 };
162 }
163 
164 #endif
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)
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:22
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:310
sal_Int32 SCROW
Definition: types.hxx:18
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.
SCCOL mnColDelta
Amount and direction of movement in the column direction.
UpdatedRangeNames maUpdatedNames
#define SC_DLLPUBLIC
Definition: scdllapi.h:28
sal_Int16 SCTAB
Definition: types.hxx:23