Resolves: tdf#122598 avoid crash on macro recording end

Change-Id: Ie9f9fc8b4a4a7852a5da37c7d190ca020391012e
Reviewed-on: https://gerrit.libreoffice.org/66028
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2019-01-09 13:22:37 +00:00
parent 5135a19c0c
commit 70e7659649

View File

@@ -225,21 +225,17 @@ void MacroChooser::EnableButton(weld::Button& rButton, bool bEnable)
SbMethod* MacroChooser::GetMacro()
{
SbMethod* pMethod = nullptr;
m_xBasicBox->get_cursor(m_xBasicBoxIter.get());
if (!m_xBasicBox->get_cursor(m_xBasicBoxIter.get()))
return nullptr;
SbModule* pModule = m_xBasicBox->FindModule(m_xBasicBoxIter.get());
if (pModule)
{
if (m_xMacroBox->get_selected(m_xMacroBoxIter.get()))
{
OUString aMacroName(m_xMacroBox->get_text(*m_xMacroBoxIter));
pMethod = pModule->FindMethod(aMacroName, SbxClassType::Method);
}
}
return pMethod;
if (!pModule)
return nullptr;
if (!m_xMacroBox->get_selected(m_xMacroBoxIter.get()))
return nullptr;
OUString aMacroName(m_xMacroBox->get_text(*m_xMacroBoxIter));
return pModule->FindMethod(aMacroName, SbxClassType::Method);
}
void MacroChooser::DeleteMacro()
{
SbMethod* pMethod = GetMacro();