summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/macrodlg.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index 84273aed8cf4..88dd8e6c46c8 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -364,13 +364,16 @@ SbMethod* MacroChooser::CreateMacro()
else if ( !pBasic->GetModules().empty() )
pModule = pBasic->GetModules().front().get();
+ // Retain the desired macro name before the macro dialog box is forced to close
+ // by opening the module name dialog window when no module exists in the current library.
+ OUString aSubName = m_pMacroNameEdit->GetText();
+
if ( !pModule )
{
pModule = createModImpl( static_cast<vcl::Window*>( this ),
aDocument, *m_pBasicBox, aLibName, aModName, false );
}
- OUString aSubName = m_pMacroNameEdit->GetText();
DBG_ASSERT( !pModule || !pModule->FindMethod( aSubName, SbxClassType::Method ), "Macro existiert schon!" );
pMethod = pModule ? basctl::CreateMacro( pModule, aSubName ) : nullptr;
}