summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-10-30 00:50:45 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-10-30 23:13:20 +0100
commite7f3330c98d83282f957513941fd7b5a7b9c00b7 (patch)
tree9f92ab40047011944d4cb3cbd989c09511d969d3
parentWindows: Drop obsolete stuff (diff)
downloadcore-e7f3330c98d83282f957513941fd7b5a7b9c00b7.tar.gz
core-e7f3330c98d83282f957513941fd7b5a7b9c00b7.zip
use positional hint for UpdateScript, fdo#69006
Change-Id: Ie1bdc905e869d56625440e2a52d48993fa2fda9d
-rw-r--r--sc/inc/column.hxx2
-rw-r--r--sc/source/core/data/column2.cxx6
-rw-r--r--sc/source/core/data/column3.cxx8
3 files changed, 10 insertions, 6 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 44ddf38e7215..61af67cd5b48 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -544,7 +544,7 @@ private:
void ActivateNewFormulaCell( const sc::CellStoreType::iterator& itPos, SCROW nRow, ScFormulaCell& rCell, bool bJoin = true );
void ActivateNewFormulaCell( const sc::CellStoreType::position_type& aPos, ScFormulaCell& rCell, bool bJoin = true );
void BroadcastNewCell( SCROW nRow );
- bool UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow );
+ bool UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow, sc::CellStoreType::iterator& itr );
const ScFormulaCell* FetchFormulaCell( SCROW nRow ) const;
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index c7b8f263fca6..207718c3ce7b 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -2056,13 +2056,14 @@ sal_uInt8 ScColumn::GetRangeScriptType(
sc::celltextattr_block::iterator it = sc::celltextattr_block::begin(*itPos->data);
sc::celltextattr_block::iterator itEnd = sc::celltextattr_block::end(*itPos->data);
std::advance(it, aRet.second);
+ sc::CellStoreType::iterator itr = maCells.position(nRow).first;
for (; it != itEnd; ++it, ++nRow)
{
if (nRow > nRow2)
return nScriptType;
sc::CellTextAttr& rVal = *it;
- if (UpdateScriptType(rVal, nRow))
+ if (UpdateScriptType(rVal, nRow, itr))
bUpdated = true;
nScriptType |= rVal.mnScriptType;
}
@@ -2073,6 +2074,7 @@ sal_uInt8 ScColumn::GetRangeScriptType(
nRow += itPos->size - aRet.second;
}
+ sc::CellStoreType::iterator itr = maCells.position(nRow).first;
while (nRow <= nRow2)
{
++itPos;
@@ -2094,7 +2096,7 @@ sal_uInt8 ScColumn::GetRangeScriptType(
return nScriptType;
sc::CellTextAttr& rVal = *it;
- if (UpdateScriptType(rVal, nRow))
+ if (UpdateScriptType(rVal, nRow, itr))
bUpdated = true;
nScriptType |= rVal.mnScriptType;
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index e1cb2a1ba8e0..685a8df95206 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -430,7 +430,7 @@ void ScColumn::BroadcastNewCell( SCROW nRow )
Broadcast(nRow);
}
-bool ScColumn::UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow )
+bool ScColumn::UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow, sc::CellStoreType::iterator& itr )
{
if (rAttr.mnScriptType != SC_SCRIPTTYPE_UNKNOWN)
// Already updated. Nothing to do.
@@ -442,9 +442,11 @@ bool ScColumn::UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow )
if (!pPattern)
return false;
- ScRefCellValue aCell;
+ sc::CellStoreType::position_type pos = maCells.position(itr, nRow);
+ itr = pos.first;
+ size_t nOffset = pos.second;
+ ScRefCellValue aCell = GetCellValue( itr, nOffset );
ScAddress aPos(nCol, nRow, nTab);
- aCell.assign(*pDocument, aPos);
const SfxItemSet* pCondSet = NULL;
ScConditionalFormatList* pCFList = pDocument->GetCondFormList(nTab);