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

Kohei Yoshida kohei at kemper.freedesktop.org
Wed May 18 06:50:15 PDT 2011


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

New commits:
commit 1b415cb8895817c0d742ef2860714c989c397314
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>
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>
    Signed-off-by: Tor Lillqvist <tlillqvist at novell.com>
    Signed-off-by: Katarina Machalkova <kmachalkova at suse.cz>

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