diff options
author | Gregor Hartmann <gh@openoffice.org> | 2001-03-14 10:33:54 +0000 |
---|---|---|
committer | Gregor Hartmann <gh@openoffice.org> | 2001-03-14 10:33:54 +0000 |
commit | 52e0621b24941693a66ba1deebd47647bbf242ab (patch) | |
tree | 483a1f3aa280554111f13d05a7226d56b374ecc2 /basic | |
parent | eb688ab17961582153818439dcebc00860d3c0d2 (diff) |
#84356# Fix roblems in errorhandling
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/app/app.cxx | 15 | ||||
-rw-r--r-- | basic/source/app/app.hxx | 5 | ||||
-rw-r--r-- | basic/source/app/appbased.cxx | 5 | ||||
-rw-r--r-- | basic/source/app/mybasic.cxx | 16 |
4 files changed, 30 insertions, 11 deletions
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx index 3f1b3d0a7e0c..1770f6d28e96 100644 --- a/basic/source/app/app.cxx +++ b/basic/source/app/app.cxx @@ -2,9 +2,9 @@ * * $RCSfile: app.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: gh $ $Date: 2001-03-13 15:55:46 $ + * last change: $Author: gh $ $Date: 2001-03-14 11:33:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1485,6 +1485,17 @@ AppWin* BasicFrame::FindWin( USHORT nWinId ) return NULL; } +AppWin* BasicFrame::IsWinValid( AppWin* pMaybeWin ) +{ + AppWin* p; + for( p = pList->First(); p; p = pList->Next() ) + { + if( p == pMaybeWin ) + return p; + } + return NULL; +} + class NewFileDialog : public FileDialog { private: diff --git a/basic/source/app/app.hxx b/basic/source/app/app.hxx index c65a6f126abd..4a22c3f28823 100644 --- a/basic/source/app/app.hxx +++ b/basic/source/app/app.hxx @@ -2,9 +2,9 @@ * * $RCSfile: app.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * last change: $Author: gh $ $Date: 2001-03-14 11:33:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -208,6 +208,7 @@ public: AppError* FindErrorWin( const String& ); AppWin* FindWin( const String& ); AppWin* FindWin( USHORT nWinId ); + AppWin* IsWinValid( AppWin* pMaybeWin ); USHORT BreakHandler(); // Break-Handler-Callback void SetEditVar( SbxVariable *pVar ){ pEditVar = pVar;} diff --git a/basic/source/app/appbased.cxx b/basic/source/app/appbased.cxx index 47b22bd795cb..6ea0fe312550 100644 --- a/basic/source/app/appbased.cxx +++ b/basic/source/app/appbased.cxx @@ -2,9 +2,9 @@ * * $RCSfile: appbased.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * last change: $Author: gh $ $Date: 2001-03-14 11:33:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -307,6 +307,7 @@ void AppBasEd::Disassemble() void AppBasEd::Run() { + pFrame->Basic().Reset(); SbxArray* pAllModules = pFrame->Basic().GetModules(); for (USHORT i = 0; i < pAllModules->Count(); i++) { diff --git a/basic/source/app/mybasic.cxx b/basic/source/app/mybasic.cxx index d176220619f1..ab2f677fdda8 100644 --- a/basic/source/app/mybasic.cxx +++ b/basic/source/app/mybasic.cxx @@ -2,9 +2,9 @@ * * $RCSfile: mybasic.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: gh $ $Date: 2000-11-07 14:03:46 $ + * last change: $Author: gh $ $Date: 2001-03-14 11:33:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -204,10 +204,15 @@ MyBasic::~MyBasic() } } -BOOL MyBasic::Compile( SbModule* p ) +void MyBasic::Reset() { aErrors.Clear(); nError = 0; +} + +BOOL MyBasic::Compile( SbModule* p ) +{ + Reset(); return StarBASIC::Compile( p ); } @@ -222,9 +227,10 @@ BOOL MyBasic::ErrorHdl() if ( aModName.Copy(0,2).CompareToAscii("--") == COMPARE_EQUAL ) aModName.Erase(0,2); GetActiveModule()->SetName(aModName); - AppWin* p = new AppBasEd( aBasicApp.pFrame, GetActiveModule() ); + AppBasEd* p = new AppBasEd( aBasicApp.pFrame, GetActiveModule() ); p->Show(); p->GrabFocus(); + pCurrWin = p; } if( IsCompilerError() ) { @@ -323,7 +329,7 @@ BasicError::BasicError void BasicError::Show() { - if( pWin ) { + if( pWin && aBasicApp.pFrame->IsWinValid( pWin ) ) { pWin->Highlight( nLine, nCol1, nCol2 ); aBasicApp.pFrame->pStatus->Message( aText ); } else MessBox( aBasicApp.pFrame, WB_OK, aBasicApp.pFrame->GetText(), |