From 429ad592843d3aa415608cb17d1a7f5116152852 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Wed, 27 Feb 2013 17:54:45 +0000 Subject: [PATCH] Method for moving cells in the cell cache without needing to access the cell itself TODO Sqlite cell cache needs equivalent method for updating cache database rather than simply the indexed cache array --- .../CachedObjectStorage/CacheBase.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Classes/PHPExcel/CachedObjectStorage/CacheBase.php b/Classes/PHPExcel/CachedObjectStorage/CacheBase.php index 0651b4a3..b6cf4be0 100644 --- a/Classes/PHPExcel/CachedObjectStorage/CacheBase.php +++ b/Classes/PHPExcel/CachedObjectStorage/CacheBase.php @@ -106,6 +106,26 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase { } // function isDataSet() + /** + * Move a cell object from one address to another + * + * @param string $fromAddress Current address of the cell to move + * @param string $toAddress Destination address of the cell to move + * @return boolean + */ + public function moveCell($fromAddress, $toAddress) { + if ($fromAddress === $this->_currentObjectID) { + $this->_currentObjectID = $toAddress; + } + if (isset($this->_cellCache[$fromAddress])) { + $this->_cellCache[$toAddress] = &$this->_cellCache[$fromAddress]; + unset($this->_cellCache[$fromAddress]); + } + + return TRUE; + } // function isDataSet() + + /** * Add or Update a cell in cache *