diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-02-03 14:42:30 -0500 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2014-02-06 14:37:42 +0000 |
commit | 25cb5355ce259c29d481eb9c76a4fab53d03e4cb (patch) | |
tree | ea50e4f943a441cd139778e0872a679d9c03dd47 | |
parent | 99a835ca644d69241cba9d7e4c4a315a4a3ea652 (diff) |
fdo#72470: Correctly calculate the first edit cell row position.
Else it could go into an infinite loop.
Change-Id: I269cd118dcb3ab83ea8a2243576a360d3d4bc142
(cherry picked from commit 3e2ffb053f9749c6f6990c5ce8f47dc63ea7c148)
Reviewed-on: https://gerrit.libreoffice.org/7831
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r-- | sc/inc/mtvfunctions.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/column.cxx | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sc/inc/mtvfunctions.hxx b/sc/inc/mtvfunctions.hxx index 3c2a94010589..6955d21c3c5a 100644 --- a/sc/inc/mtvfunctions.hxx +++ b/sc/inc/mtvfunctions.hxx @@ -618,7 +618,7 @@ FindElement2( break; default: { - ElseRetType aRet = rFuncElse(it->type, nTopRow, nDataSize); + ElseRetType aRet = rFuncElse(*it, nOffset); if (aRet.second) return PositionType(it, aRet.first); } diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 0b1032873786..e35858842202 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -2966,16 +2966,16 @@ public: return const_cast<ScFormulaCell*>(p)->IsMultilineResult(); } - std::pair<size_t,bool> operator() (mdds::mtv::element_t type, size_t nTopRow, size_t nDataSize) + std::pair<size_t,bool> operator() (const sc::CellStoreType::value_type& node, size_t nOffset) { typedef std::pair<size_t,bool> RetType; - if (type == sc::element_type_empty) + if (node.type == sc::element_type_empty) return RetType(0, false); - for (size_t i = 0; i < nDataSize; ++i) + for (size_t i = nOffset; i < node.size; ++i) { - SCROW nRow = nTopRow + i; + SCROW nRow = node.position + i; sal_uInt8 nScriptType = mrColumn.GetRangeScriptType(miAttrPos, nRow, nRow, miCellPos); if (IsAmbiguousScriptNonZero(nScriptType)) // Return the offset from the first row. |