summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-01-09 13:22:37 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-01-10 10:20:06 +0100
commit70e76596498e2fee17d0342c72d64c27f1e8fba2 (patch)
treea366261de0ae416171061b1bd8086b07f29906c0
parent5135a19c0cdc2937499e126dd5429eeb24a023a9 (diff)
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>
-rw-r--r--basctl/source/basicide/macrodlg.cxx20
1 files changed, 8 insertions, 12 deletions
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();