summaryrefslogtreecommitdiff
path: root/basctl/source/basicide/basides3.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-03-20 10:03:56 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-03-22 06:39:52 +0100
commit000bb6af72e934d7f0fd2291cea919437cfd5e2f (patch)
tree96350eb6657a92afbd9b59e36ccc1437a46d869c /basctl/source/basicide/basides3.cxx
parente55595d0e081ccdca41f621177e1b32eb9a649e3 (diff)
Convert tools/table.hxx usage to std::map in Basic IDE module
Diffstat (limited to 'basctl/source/basicide/basides3.cxx')
-rw-r--r--basctl/source/basicide/basides3.cxx27
1 files changed, 17 insertions, 10 deletions
diff --git a/basctl/source/basicide/basides3.cxx b/basctl/source/basicide/basides3.cxx
index b00d8e6dcbbe..ea0d2886ee28 100644
--- a/basctl/source/basicide/basides3.cxx
+++ b/basctl/source/basicide/basides3.cxx
@@ -110,13 +110,7 @@ DialogWindow* BasicIDEShell::CreateDlgWin( const ScriptDocument& rDocument, cons
else
{
pWin->SetStatus( pWin->GetStatus() & ~BASWIN_SUSPENDED );
- IDEBaseWindow* pTmp = aIDEWindowTable.First();
- while ( pTmp && !nKey )
- {
- if ( pTmp == pWin )
- nKey = aIDEWindowTable.GetCurKey();
- pTmp = aIDEWindowTable.Next();
- }
+ nKey = GetIDEWindowId( pWin );
DBG_ASSERT( nKey, "CreateDlgWin: Kein Key - Fenster nicht gefunden!" );
}
@@ -136,17 +130,22 @@ DialogWindow* BasicIDEShell::CreateDlgWin( const ScriptDocument& rDocument, cons
DialogWindow* BasicIDEShell::FindDlgWin( const ScriptDocument& rDocument, const ::rtl::OUString& rLibName, const ::rtl::OUString& rDlgName, sal_Bool bCreateIfNotExist, sal_Bool bFindSuspended )
{
DialogWindow* pDlgWin = 0;
- IDEBaseWindow* pWin = aIDEWindowTable.First();
- while ( pWin && !pDlgWin )
+ for( IDEWindowTable::const_iterator it = aIDEWindowTable.begin(); it != aIDEWindowTable.end(); ++it )
{
+ IDEBaseWindow* pWin = it->second;
if ( ( !pWin->IsSuspended() || bFindSuspended ) && pWin->IsA( TYPE( DialogWindow ) ) )
{
if ( rLibName.isEmpty() )
+ {
pDlgWin = (DialogWindow*)pWin;
+ break;
+ }
else if ( pWin->IsDocument( rDocument ) && pWin->GetLibName() == rLibName && pWin->GetName() == rDlgName )
+ {
pDlgWin = (DialogWindow*)pWin;
+ break;
+ }
}
- pWin = aIDEWindowTable.Next();
}
if ( !pDlgWin && bCreateIfNotExist )
pDlgWin = CreateDlgWin( rDocument, rLibName, rDlgName );
@@ -154,6 +153,14 @@ DialogWindow* BasicIDEShell::FindDlgWin( const ScriptDocument& rDocument, const
return pDlgWin;
}
+sal_uInt16 BasicIDEShell::GetIDEWindowId(const IDEBaseWindow* pWin) const
+{
+ for( IDEWindowTable::const_iterator it = aIDEWindowTable.begin(); it != aIDEWindowTable.end(); ++it )
+ if ( it->second == pWin )
+ return it->first;
+ return 0;
+}
+
SdrView* BasicIDEShell::GetCurDlgView() const
{
if ( !pCurWin || !pCurWin->IsA( TYPE( DialogWindow ) ) )