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 
77 
80 
82 
84 
85  bool isInserted() const;
86  bool isDeleted() const;
87 
90 };
91 
93 {
100 
106 
112 
113  RefUpdateResult();
114 };
115 
117 {
122 
123  RefUpdateInsertTabContext(ScDocument& rDoc, SCTAB nInsertPos, SCTAB nSheets);
124 };
125 
127 {
132 
133  RefUpdateDeleteTabContext(ScDocument& rDoc, SCTAB nInsertPos, SCTAB nSheets);
134 };
135 
137 {
142 
143  RefUpdateMoveTabContext(ScDocument& rDoc, SCTAB nOldPos, SCTAB nNewPos);
144 
145  SCTAB getNewTab(SCTAB nOldTab) const;
146 };
147 
149 {
152 
158 
160 };
161 }
162 
163 /* 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: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.
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