View | Details | Raw Unified | Return to issue 87974
Collapse All | Expand All

(-)sc/source/ui/app/inputhdl.cxx (-4 / +47 lines)
Lines 1792-1804 void ScInputHandler::DataChanged( BOOL b Link Here
1792
void ScInputHandler::UpdateFormulaMode()
1792
void ScInputHandler::UpdateFormulaMode()
1793
{
1793
{
1794
	SfxApplication* pSfxApp = SFX_APP();
1794
	SfxApplication* pSfxApp = SFX_APP();
1795
    bool bRefMode=false;
1795
1796
1796
    if ( pEngine->GetParagraphCount() == 1 &&
1797
    if( pEngine->GetText((USHORT)0).GetChar(0) == '=' ||
1797
         ( pEngine->GetText((USHORT)0).GetChar(0) == '=' ||
1798
           pEngine->GetText((USHORT)0).GetChar(0) == '+' ||
1798
           pEngine->GetText((USHORT)0).GetChar(0) == '+' ||
1799
           pEngine->GetText((USHORT)0).GetChar(0) == '-' ) &&
1799
           pEngine->GetText((USHORT)0).GetChar(0) == '-' )
1800
    {
1801
        String aString = GetEditString();
1802
        EditView* pActiveView = pTopView ? pTopView : pTableView;
1803
        if (pActiveView)
1804
        {
1805
            ESelection aSel = pActiveView->GetSelection();
1806
            if(aSel.nStartPos != aSel.nEndPos)
1807
            {
1808
                aString = String(aString, 0, aSel.nStartPos);
1809
            }
1810
        }
1811
1812
        if(aString.Len() == 1)
1813
        {
1814
            bRefMode=true;
1815
        }
1816
        else
1817
        {
1818
            if ( !GetSelIsRef() && aString.Len() > 2 &&
1819
                    ( aString.GetChar(0) == '+' || aString.GetChar(0) == '-' ) )
1820
            {
1821
                String aStr('=');
1822
                aStr += aString;
1823
                aString = aStr;
1824
            }
1825
            if(pActiveViewSh)
1826
            {
1827
                ScViewData* pViewData = pActiveViewSh->GetViewData();
1828
                ScDocument* pDoc = pViewData->GetDocument();
1829
                ScAddress aPos( pViewData->GetCurPos() );
1830
                ScCompiler aComp( pDoc, aPos );
1831
                aComp.SetCloseBrackets( false );
1832
                ScTokenArray* pArr = aComp.CompileString( aString );
1833
                if ( pArr->MayReferenceFollow() )
1834
                {
1835
                    bRefMode = true;
1836
                }
1837
            }
1838
        }
1839
    }
1840
1841
    if ( pEngine->GetParagraphCount() == 1 &&
1842
         ( bRefMode == true ) &&
1800
         !bProtected )
1843
         !bProtected )
1801
	{
1844
    {
1802
		if (!bFormulaMode)
1845
		if (!bFormulaMode)
1803
		{
1846
		{
1804
			bFormulaMode = TRUE;
1847
			bFormulaMode = TRUE;
(-)sc/source/ui/view/tabvwsha.cxx (-27 / +1 lines)
Lines 469-503 void ScTabViewShell::ExecuteCellFormatDl Link Here
469
//------------------------------------------------------------------
469
//------------------------------------------------------------------
470
void ScTabViewShell::ExecuteInputDirect()
470
void ScTabViewShell::ExecuteInputDirect()
471
{
471
{
472
    bool bRefInputMode = false;
473
    ScModule* pScMod = SC_MOD();
472
    ScModule* pScMod = SC_MOD();
474
473
475
    if ( pScMod->IsFormulaMode() )
474
    if ( !pScMod->IsFormulaMode() )
476
    {
477
        ScInputHandler* pHdl = pScMod->GetInputHdl();
478
        String aString = pHdl->GetEditString();
479
480
        if ( !pHdl->GetSelIsRef() && aString.Len() > 1 &&
481
             ( aString.GetChar(0) == '+' || aString.GetChar(0) == '-' ) )
482
        {
483
            ScViewData* pViewData = GetViewData();
484
            ScDocument* pDoc = pViewData->GetDocument();
485
            ScAddress aPos( pViewData->GetCurPos() );
486
            ScCompiler aComp( pDoc, aPos );
487
            aComp.SetCloseBrackets( false );
488
            ScTokenArray* pArr = aComp.CompileString( aString );
489
            if ( pArr->MayReferenceFollow() )
490
            {
491
                bRefInputMode = true;
492
            }
493
        }
494
        else
495
        {
496
            bRefInputMode = true;
497
        }
498
    }
499
500
    if ( !bRefInputMode )
501
    {
475
    {
502
        pScMod->InputEnterHandler();
476
        pScMod->InputEnterHandler();
503
    }
477
    }

Return to issue 87974