Kaydet (Commit) 3e8ae241 authored tarafından Kohei Yoshida's avatar Kohei Yoshida Kaydeden (comit) Tor Lillqvist

Prevent a crash during multiple operations.

Signed-off-by: 's avatarTor Lillqvist <tlillqvist@novell.com>
üst 445aa9fa
......@@ -3397,6 +3397,20 @@ sal_Bool ScInterpreter::SetSbxVariable( SbxVariable* pVar, const ScAddress& rPos
return bOk;
}
namespace {
class FindByPointer : ::std::unary_function<ScInterpreterTableOpParams, bool>
{
const ScInterpreterTableOpParams* mpTableOp;
public:
FindByPointer(const ScInterpreterTableOpParams* p) : mpTableOp(p) {}
bool operator() (const ScInterpreterTableOpParams& val) const
{
return &val == mpTableOp;
}
};
}
void ScInterpreter::ScTableOp()
{
......@@ -3456,7 +3470,11 @@ void ScInterpreter::ScTableOp()
PushString( aCellString );
}
pTableOp = pDok->aTableOpList.release( pDok->aTableOpList.end() ).release();
boost::ptr_vector< ScInterpreterTableOpParams >::iterator itr =
::std::find_if(pDok->aTableOpList.begin(), pDok->aTableOpList.end(), FindByPointer(pTableOp));
if (itr != pDok->aTableOpList.end())
pTableOp = pDok->aTableOpList.release(itr).release();
// set dirty again once more to be able to recalculate original
for ( ::std::vector< ScFormulaCell* >::const_iterator iBroadcast(
pTableOp->aNotifiedFormulaCells.begin() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment