--- sc/source/ui/view/tabvwsha.cxx 2005-10-17 23:13:34.000000000 +0530 +++ sc/source/ui/view/tabvwsha.cxx 2006-10-27 00:16:17.000000000 +0530 @@ -497,7 +497,43 @@ void ScTabViewShell::ExecuteCellFormatDl void ScTabViewShell::ExecuteInputDirect() { ScModule* pScMod = SC_MOD(); - if( !pScMod->IsFormulaMode() ) + BOOL bFormulaMode = FALSE; + + if( pScMod->IsFormulaMode() ) + { + ScInputHandler *pHdl = pScMod->GetInputHdl(); + String sString = pHdl->GetEditString(); + bFormulaMode = TRUE; + + if(!pHdl->GetSelIsRef() && sString.Len() > 1) + { + switch(sString.GetChar(0)) + { + case '=': + case '+': + case '-': + switch(sString.GetChar(sString.Len()-1)) + { + case '+':case '-':case '*':case '/': + case '>':case '<':case '=':case '.': + case ':':case '(':case '[':case '|': + case '{':case '!':case '@':case '%': + case '^':case '&':case ',':case '\'': + case '"':case ';':case '`':case '$': + case '_':case '#': + break; + default: + bFormulaMode = FALSE; + break; + } + break; + default: + break; + } + } + } + + if(!bFormulaMode) pScMod->InputEnterHandler(); }