From 0d9a7d03e325d8b7487c08e9448c8a6890821866 Mon Sep 17 00:00:00 2001 From: Pierre Lepage Date: Sat, 5 Nov 2016 14:12:56 -0400 Subject: tdf#96717: The macro name desired by the user is now took into account. Change-Id: I3949ffed6dcf85e01bc5fc24a27a04265e54fe44 Reviewed-on: https://gerrit.libreoffice.org/30592 Reviewed-by: jan iversen Tested-by: jan iversen --- basctl/source/basicide/macrodlg.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'basctl') 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( 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; } -- cgit