diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-13 22:53:14 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-13 23:01:21 -0400 |
commit | c4d26f327605b77c8395bdb512d8ddcd8c11bfd1 (patch) | |
tree | a86a61a45d24aef8c8b6e0346ef5c3cee4819da5 /sc/inc | |
parent | Try to re-group without ungrouping all cells. (diff) | |
download | core-c4d26f327605b77c8395bdb512d8ddcd8c11bfd1.tar.gz core-c4d26f327605b77c8395bdb512d8ddcd8c11bfd1.zip |
Regroup formula cells later in columns where references are updated.
Change-Id: I4dd6ade18e72d8f57583180463f9dda3603be4c2
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/column.hxx | 2 | ||||
-rw-r--r-- | sc/inc/columnset.hxx | 40 | ||||
-rw-r--r-- | sc/inc/refupdatecontext.hxx | 2 | ||||
-rw-r--r-- | sc/inc/table.hxx | 5 |
4 files changed, 46 insertions, 3 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 22bb9bdfa2d0..14d0bfee12fd 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -329,7 +329,7 @@ public: * @return true if reference of at least one formula cell has been * updated, false otherwise. */ - bool UpdateReference( const sc::RefUpdateContext& rCxt, ScDocument* pUndoDoc = NULL ); + bool UpdateReference( sc::RefUpdateContext& rCxt, ScDocument* pUndoDoc = NULL ); void UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt ); void UpdateInsertTabOnlyCells( sc::RefUpdateInsertTabContext& rCxt ); diff --git a/sc/inc/columnset.hxx b/sc/inc/columnset.hxx new file mode 100644 index 000000000000..fb56303c1049 --- /dev/null +++ b/sc/inc/columnset.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef SC_COLUMNSET_HXX +#define SC_COLUMNSET_HXX + +#include "address.hxx" + +#include <vector> +#include <boost/unordered_set.hpp> +#include <boost/unordered_map.hpp> + +namespace sc { + +/** + * Simple container to keep track of sheet - column pair. + */ +class ColumnSet +{ + typedef boost::unordered_set<SCCOL> ColsType; + typedef boost::unordered_map<SCTAB, ColsType> TabsType; + TabsType maTabs; + +public: + void set(SCTAB nTab, SCCOL nCol); + bool has(SCTAB nTab, SCCOL nCol) const; + void getColumns(SCTAB nTab, std::vector<SCCOL>& rCols) const; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/inc/refupdatecontext.hxx b/sc/inc/refupdatecontext.hxx index f5ca4d03c4be..ba0beedbc161 100644 --- a/sc/inc/refupdatecontext.hxx +++ b/sc/inc/refupdatecontext.hxx @@ -12,6 +12,7 @@ #include "global.hxx" #include "address.hxx" +#include "columnset.hxx" #include <boost/unordered_map.hpp> #include <boost/unordered_set.hpp> @@ -66,6 +67,7 @@ struct RefUpdateContext SCTAB mnTabDelta; UpdatedRangeNames maUpdatedNames; + ColumnSet maRegroupCols; RefUpdateContext(ScDocument& rDoc); diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index a95f2bc3b66c..fa6247cb6312 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -58,6 +58,7 @@ namespace sc { class CopyToDocContext; class MixDocContext; class ColumnSpanSet; + class ColumnSet; struct ColumnBlockPosition; struct RefUpdateContext; struct RefUpdateInsertTabContext; @@ -388,8 +389,8 @@ public: bool TestInsertCol( SCROW nStartRow, SCROW nEndRow, SCSIZE nSize ) const; void InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize ); - void DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize, - bool* pUndoOutline = NULL ); + void DeleteCol( + const sc::ColumnSet& rRegroupCols, SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE nSize, bool* pUndoOutline = NULL ); void DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt16 nDelFlag); void CopyToClip( sc::CopyToClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pTable ); |