diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-05-17 21:01:02 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-05-18 09:44:58 -0400 |
commit | f99a75ada5167dbcd984db8d74a8a8fdaf82d38a (patch) | |
tree | 3423fccc2a1aac296f68ee440b5ba9485573754e /formula/source | |
parent | 904022ce758bbf340540f2487fb939f5bbbb83e6 (diff) |
fdo#37252: Don't assume you'll always find a match.
The original code assumed that the find call always returns a match.
Apparently that assumption is not always true.
Signed-off-by: Norbert Thiebaud <nthiebaud@gmail.com>
Signed-off-by: Michael Meeks <michael.meeks@novell.com>
Signed-off-by: Tor Lillqvist <tlillqvist@novell.com>
Signed-off-by: Katarina Machalkova <kmachalkova@suse.cz>
Diffstat (limited to 'formula/source')
-rw-r--r-- | formula/source/ui/dlg/formula.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index ab266ddd9b7e..5e695de116fc 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -669,7 +669,11 @@ void FormulaDlg_Impl::MakeTree(IStructHelper* _pTree,SvLBoxEntry* pParent,Formul // #i101512# for output, the original token is needed FormulaToken* pOrigToken = (_pToken->GetType() == svFAP) ? _pToken->GetFAPOrigToken() : _pToken; uno::Sequence<sheet::FormulaToken> aArgs(1); - aArgs[0] = m_aTokenMap.find(pOrigToken)->second; + ::std::map<FormulaToken*,sheet::FormulaToken>::const_iterator itr = m_aTokenMap.find(pOrigToken); + if (itr == m_aTokenMap.end()) + return; + + aArgs[0] = itr->second; try { const table::CellAddress aRefPos(m_pHelper->getReferencePosition()); |