basctl/source/basicide/macrodlg.cxx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
New commits: commit 70e76596498e2fee17d0342c72d64c27f1e8fba2 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Jan 9 13:22:37 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Jan 10 10:20:06 2019 +0100 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 <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 7f2ad1fb7d67..4ce9619c8e21 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits