diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-10-16 06:57:26 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-10-16 06:57:26 +0000 |
commit | fda73e51b2876312f9f85f0aa9789a69598993e5 (patch) | |
tree | 763dfe697d8c84244b2b226ea1791e5d84887ab1 /basctl | |
parent | f1fc86b9572c9321d912afc1c606ac10c1faceda (diff) |
CWS-TOOLING: integrate CWS odbmacros3
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/basidesh.cxx | 62 | ||||
-rw-r--r-- | basctl/source/basicide/bastypes.cxx | 19 | ||||
-rw-r--r-- | basctl/source/inc/bastypes.hxx | 4 |
3 files changed, 41 insertions, 44 deletions
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index b58502066a03..e6b147cc46c8 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: basidesh.cxx,v $ - * $Revision: 1.50 $ + * $Revision: 1.49.26.2 $ * * This file is part of OpenOffice.org. * @@ -261,51 +261,37 @@ void BasicIDEShell::onDocumentClosed( const ScriptDocument& _rDocument ) return; bool bSetCurWindow = false; - bool bSetCurLib = false; + bool bSetCurLib = ( _rDocument == m_aCurDocument ); - Sequence< ::rtl::OUString > aLibNames = _rDocument.getLibraryNames();; - sal_Int32 nLibCount = aLibNames.getLength(); - const ::rtl::OUString* pLibNames = aLibNames.getConstArray(); - - for ( sal_Int32 i = 0 ; i < nLibCount ; ++i ) + // remove all windows which belong to this document + for ( ULONG nWin = aIDEWindowTable.Count(); nWin; ) { - String aLibName = pLibNames[ i ]; - if ( !aLibName.Len() ) - continue; - - // remove all windows which belong to this library - for ( ULONG nWin = aIDEWindowTable.Count(); nWin; ) + IDEBaseWindow* pWin = aIDEWindowTable.GetObject( --nWin ); + if ( pWin->IsDocument( _rDocument ) ) { - IDEBaseWindow* pWin = aIDEWindowTable.GetObject( --nWin ); - if ( pWin->IsDocument( _rDocument ) && pWin->GetLibName() == aLibName ) + if ( pWin->GetStatus() & (BASWIN_RUNNINGBASIC|BASWIN_INRESCHEDULE) ) { - if ( pWin->GetStatus() & (BASWIN_RUNNINGBASIC|BASWIN_INRESCHEDULE) ) - { - pWin->AddStatus( BASWIN_TOBEKILLED ); - pWin->Hide(); - StarBASIC::Stop(); - // there's no notify - pWin->BasicStopped(); - } - else - { - pWin->StoreData(); - if ( pWin == pCurWin ) - bSetCurWindow = true; - RemoveWindow( pWin, TRUE, FALSE ); - } + pWin->AddStatus( BASWIN_TOBEKILLED ); + pWin->Hide(); + StarBASIC::Stop(); + // there's no notify + pWin->BasicStopped(); + } + else + { + pWin->StoreData(); + if ( pWin == pCurWin ) + bSetCurWindow = true; + RemoveWindow( pWin, TRUE, FALSE ); } } - - // remove lib info - BasicIDEData* pData = IDE_DLL()->GetExtraData(); - if ( pData ) - pData->GetLibInfos().RemoveInfo( LibInfoKey( _rDocument, aLibName ) ); - - if ( _rDocument == m_aCurDocument && aLibName == m_aCurLibName ) - bSetCurLib = true; } + // remove lib info + BasicIDEData* pData = IDE_DLL()->GetExtraData(); + if ( pData ) + pData->GetLibInfos().RemoveInfoFor( _rDocument ); + if ( bSetCurLib ) SetCurLib( ScriptDocument::getApplicationScriptDocument(), String::CreateFromAscii( "Standard" ), true, false ); else if ( bSetCurWindow ) diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index f42866b84d39..33d6f5af4961 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: bastypes.cxx,v $ - * $Revision: 1.32 $ + * $Revision: 1.32.30.1 $ * * This file is part of OpenOffice.org. * @@ -900,13 +900,24 @@ void LibInfos::InsertInfo( LibInfoItem* pItem ) m_aLibInfoMap.insert( LibInfoMap::value_type( aKey, pItem ) ); } -void LibInfos::RemoveInfo( const LibInfoKey& rKey ) +void LibInfos::RemoveInfoFor( const ScriptDocument& _rDocument ) { - LibInfoMap::iterator it = m_aLibInfoMap.find( rKey ); - if ( it != m_aLibInfoMap.end() ) + for ( LibInfoMap::iterator it = m_aLibInfoMap.begin(); + it != m_aLibInfoMap.end(); + ) { + if ( it->first.GetDocument() != _rDocument ) + { + ++it; + continue; + } + LibInfoItem* pItem = it->second; + + LibInfoMap::iterator next_it = it; ++next_it; m_aLibInfoMap.erase( it ); + it = next_it; + delete pItem; } } diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx index 6edaf5560704..ba1ac9c57068 100644 --- a/basctl/source/inc/bastypes.hxx +++ b/basctl/source/inc/bastypes.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: bastypes.hxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.30.1 $ * * This file is part of OpenOffice.org. * @@ -323,7 +323,7 @@ public: ~LibInfos(); void InsertInfo( LibInfoItem* pItem ); - void RemoveInfo( const LibInfoKey& rKey ); + void RemoveInfoFor( const ScriptDocument& _rDocument ); LibInfoItem* GetInfo( const LibInfoKey& rKey ); }; |