LCOV - code coverage report
Current view: top level - sc/inc - refupdatecontext.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 5 0.0 %
Date: 2014-04-14 Functions: 0 6 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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 SC_REFUPDATECONTEXT_HXX
      11             : #define SC_REFUPDATECONTEXT_HXX
      12             : 
      13             : #include "global.hxx"
      14             : #include "address.hxx"
      15             : #include "columnset.hxx"
      16             : 
      17             : #include <boost/unordered_map.hpp>
      18             : #include <boost/unordered_set.hpp>
      19             : 
      20             : class ScDocument;
      21             : 
      22             : namespace sc {
      23             : 
      24             : /**
      25             :  * Keep track of all named expressions that have been updated during
      26             :  * reference update.
      27             :  */
      28           0 : class UpdatedRangeNames
      29             : {
      30             :     typedef boost::unordered_set<sal_uInt16> NameIndicesType;
      31             :     typedef boost::unordered_map<SCTAB, NameIndicesType> UpdatedNamesType;
      32             : 
      33             :     UpdatedNamesType maUpdatedNames;
      34             : 
      35             : public:
      36             :     void setUpdatedName(SCTAB nTab, sal_uInt16 nIndex);
      37             :     bool isNameUpdated(SCTAB nTab, sal_uInt16 nIndex) const;
      38             : };
      39             : 
      40             : /**
      41             :  * Context for reference update during shifting, moving or copying of cell
      42             :  * ranges.
      43             :  */
      44           0 : struct RefUpdateContext
      45             : {
      46             :     ScDocument& mrDoc;
      47             : 
      48             :     /**
      49             :      * update mode - insert/delete, copy, or move. The reorder mode (which
      50             :      * corresponds with the reordering of sheets) is not used with this
      51             :      * context.
      52             :      */
      53             :     UpdateRefMode meMode;
      54             : 
      55             :     /**
      56             :      * Range of cells that are about to be moved for insert/delete/move modes.
      57             :      * For copy mode, it's the destination range of cells that are about to be
      58             :      * pasted.  When moving a range of cells, it's the destination range, not
      59             :      * the source range.
      60             :      */
      61             :     ScRange maRange;
      62             : 
      63             :     /** Amount and direction of movement in the column direction. */
      64             :     SCCOL mnColDelta;
      65             :     /** Amount and direction of movement in the row direction. */
      66             :     SCROW mnRowDelta;
      67             :     /** Amount and direction of movement in the sheet direction. */
      68             :     SCTAB mnTabDelta;
      69             : 
      70             :     UpdatedRangeNames maUpdatedNames;
      71             :     ColumnSet maRegroupCols;
      72             : 
      73             :     RefUpdateContext(ScDocument& rDoc);
      74             : 
      75             :     bool isInserted() const;
      76             :     bool isDeleted() const;
      77             : };
      78             : 
      79             : struct RefUpdateResult
      80             : {
      81             :     /**
      82             :      * When this flag is true, the result of the formula needs to be
      83             :      * re-calculated either because it contains a reference that's been
      84             :      * deleted, or the size of a range reference has changed.
      85             :      */
      86             :     bool mbValueChanged;
      87             : 
      88             :     /**
      89             :      * This flag indicates whether any reference in the token array has been
      90             :      * modified.
      91             :      */
      92             :     bool mbReferenceModified;
      93             : 
      94             :     /**
      95             :      * When this flag is true, it indicates that the token array contains a
      96             :      * range name that's been updated.
      97             :      */
      98             :     bool mbNameModified;
      99             : 
     100             :     RefUpdateResult();
     101             :     RefUpdateResult(const RefUpdateResult& r);
     102             : };
     103             : 
     104           0 : struct RefUpdateInsertTabContext
     105             : {
     106             :     SCTAB mnInsertPos;
     107             :     SCTAB mnSheets;
     108             :     UpdatedRangeNames maUpdatedNames;
     109             : 
     110             :     RefUpdateInsertTabContext(SCTAB nInsertPos, SCTAB nSheets);
     111             : };
     112             : 
     113           0 : struct RefUpdateDeleteTabContext
     114             : {
     115             :     SCTAB mnDeletePos;
     116             :     SCTAB mnSheets;
     117             :     UpdatedRangeNames maUpdatedNames;
     118             : 
     119             :     RefUpdateDeleteTabContext(SCTAB nInsertPos, SCTAB nSheets);
     120             : };
     121             : 
     122           0 : struct RefUpdateMoveTabContext
     123             : {
     124             :     SCTAB mnOldPos;
     125             :     SCTAB mnNewPos;
     126             :     UpdatedRangeNames maUpdatedNames;
     127             : 
     128             :     RefUpdateMoveTabContext(SCTAB nOldPos, SCTAB nNewPos);
     129             : 
     130             :     SCTAB getNewTab(SCTAB nOldTab) const;
     131             : };
     132             : 
     133             : struct SetFormulaDirtyContext
     134             : {
     135             :     SCTAB mnTabDeletedStart;
     136             :     SCTAB mnTabDeletedEnd;
     137             : 
     138             :     /**
     139             :      * When true, go through all reference tokens and clears "sheet deleted"
     140             :      * flag if its corresponding index falls within specified sheet range.
     141             :      */
     142             :     bool mbClearTabDeletedFlag;
     143             : 
     144             :     SetFormulaDirtyContext();
     145             : };
     146             : 
     147             : }
     148             : 
     149             : #endif
     150             : 
     151             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10