[Libreoffice-commits] .: Branch 'libreoffice-3-4' - formula/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue May 17 20:56:33 PDT 2011


 formula/source/ui/dlg/formula.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 952801a7d56368301cd2bf21b6f9afe946e8e8dd
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue May 17 21:01:02 2011 -0400

    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 at gmail.com>

diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index f50feca..dde3a1c 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());


More information about the Libreoffice-commits mailing list