summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-05-17 21:01:02 -0400
committerKohei Yoshida <kyoshida@novell.com>2011-05-17 23:56:10 -0400
commit952801a7d56368301cd2bf21b6f9afe946e8e8dd (patch)
tree74685ae966856e80a4d61d424cc068decc256aa8
parenta9a66f3dc0e3ce1a8d05ae8a17a3bdb8c4bab4bb (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>
-rw-r--r--formula/source/ui/dlg/formula.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index f50feca7c9..dde3a1c809 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());