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 |
aString += GetEditString(); |
1803 |
EditView* pActiveView = pTopView ? pTopView : pTableView; |
1804 |
if (pActiveView) |
1805 |
{ |
1806 |
ESelection aSel = pActiveView->GetSelection(); |
1807 |
if(aSel.nStartPos != aSel.nEndPos) |
1808 |
{ |
1809 |
aString = String(aString, 0, aSel.nStartPos); |
1810 |
} |
1811 |
} |
1812 |
if ( !GetSelIsRef() && aString.Len() > 2 && |
1813 |
( aString.GetChar(0) == '+' || aString.GetChar(0) == '-' ) ) |
1814 |
{ |
1815 |
String aStr('='); |
1816 |
aStr += aString; |
1817 |
aString = aStr; |
1818 |
} |
1819 |
if(pActiveViewSh) |
1820 |
{ |
1821 |
ScViewData* pViewData = pActiveViewSh->GetViewData(); |
1822 |
ScDocument* pDoc = pViewData->GetDocument(); |
1823 |
ScAddress aPos( pViewData->GetCurPos() ); |
1824 |
ScCompiler aComp( pDoc, aPos ); |
1825 |
aComp.SetCloseBrackets( false ); |
1826 |
ScTokenArray* pArr = aComp.CompileString( aString ); |
1827 |
if ( pArr->MayReferenceFollow() ) |
1828 |
{ |
1829 |
bRefMode = true; |
1830 |
} |
1831 |
} |
1832 |
} |
1833 |
|
1834 |
if ( pEngine->GetParagraphCount() == 1 && |
1835 |
( bRefMode == true ) && |
1800 |
!bProtected ) |
1836 |
!bProtected ) |
1801 |
{ |
1837 |
{ |
1802 |
if (!bFormulaMode) |
1838 |
if (!bFormulaMode) |
1803 |
{ |
1839 |
{ |
1804 |
bFormulaMode = TRUE; |
1840 |
bFormulaMode = TRUE; |