diff options
author | Thomas Benisch <tbe@openoffice.org> | 2001-06-28 14:26:41 +0000 |
---|---|---|
committer | Thomas Benisch <tbe@openoffice.org> | 2001-06-28 14:26:41 +0000 |
commit | 475d993d5ecec15fde78030d18b4916c42aec059 (patch) | |
tree | 347471291ec702c41221e1663f3cbd5707640b37 /basctl/source/basicide/baside2.cxx | |
parent | 230c9326e8b436a501b719f5e3aab6049911d4cb (diff) |
#88565# change module management from sbx to library container
Diffstat (limited to 'basctl/source/basicide/baside2.cxx')
-rw-r--r-- | basctl/source/basicide/baside2.cxx | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 1d4fb4a71b69..04c8e09fbe34 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: baside2.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: tbe $ $Date: 2001-05-21 09:57:57 $ + * last change: $Author: tbe $ $Date: 2001-06-28 15:26:41 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -245,6 +245,25 @@ ModulWindow::ModulWindow( ModulWindowLayout* pParent, StarBASIC* pBas, SbModule* SetBackground(); } +// new CTOR +ModulWindow::ModulWindow( ModulWindowLayout* pParent, StarBASIC* pBas, + SfxObjectShell* pShell, String aLibName, String aModName, ::rtl::OUString& aModule ) + :IDEBaseWindow( pParent, pBas ) + ,aXEditorWindow( this ) + ,m_pShell( pShell ) + ,m_aLibName( aLibName ) + ,m_aModName( aModName ) + ,m_aModule( aModule ) +{ + DBG_CTOR( ModulWindow, 0 ); + nValid = VALIDWINDOW; + pLayout = pParent; + aXEditorWindow.Show(); + xModule = (SbModule*)pBas->FindModule( aModName ); + SetBackground(); +} + + __EXPORT ModulWindow::~ModulWindow() { DBG_DTOR( ModulWindow, 0 ); @@ -1106,13 +1125,29 @@ void __EXPORT ModulWindow::DoScroll( ScrollBar* pCurScrollBar ) } - -void ModulWindow::RenameModule( const String& rNewName ) +BOOL ModulWindow::RenameModule( const String& rNewName ) { - DBG_ASSERT( xModule.Is(), "Kein Modul!" ); - xModule->SetName( rNewName ); -} + BOOL bDone = TRUE; + + try + { + BasicIDE::RenameModule( m_pShell, m_aLibName, m_aModName, rNewName ); + BasicIDE::GetBindings().Invalidate( SID_DOC_MODIFIED ); + } + catch ( container::ElementExistException& ) + { + ErrorBox( this, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_SBXNAMEALLREADYUSED2 ) ) ).Execute(); + bDone = FALSE; + } + catch ( container::NoSuchElementException& e ) + { + ByteString aBStr( String(e.Message), RTL_TEXTENCODING_ASCII_US ); + DBG_ERROR( aBStr.GetBuffer() ); + bDone = FALSE; + } + return bDone; +} BOOL __EXPORT ModulWindow::IsModified() |