include/sfx2/request.hxx | 2 +- sfx2/source/control/request.cxx | 5 ++--- sw/source/ui/misc/glossary.cxx | 6 +++--- sw/source/uibase/shells/basesh.cxx | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-)
New commits: commit 3e36caa1ec24a465a0918dd63976dfd970a41c1d Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Feb 16 10:50:36 2023 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Feb 16 19:18:29 2023 +0000 HasMacroRecorder can take a reference, never passed null Change-Id: I213f2d93e49f03e88a5357af8fead32b97b2c37b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147149 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/sfx2/request.hxx b/include/sfx2/request.hxx index 5a97cb9e61b8..2d5939758eec 100644 --- a/include/sfx2/request.hxx +++ b/include/sfx2/request.hxx @@ -99,7 +99,7 @@ public: const SfxPoolItem* GetReturnValue() const; static css::uno::Reference< css::frame::XDispatchRecorder > GetMacroRecorder( SfxViewFrame const * pFrame ); - static bool HasMacroRecorder( SfxViewFrame const * pFrame ); + static bool HasMacroRecorder(const SfxViewFrame& rFrame); SfxCallMode GetCallMode() const; void AllowRecording( bool ); bool AllowsRecording() const; diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx index b43d1dd991bc..e7757adc82ef 100644 --- a/sfx2/source/control/request.cxx +++ b/sfx2/source/control/request.cxx @@ -709,12 +709,11 @@ css::uno::Reference< css::frame::XDispatchRecorder > SfxRequest::GetMacroRecorde return xRecorder; } -bool SfxRequest::HasMacroRecorder( SfxViewFrame const * pView ) +bool SfxRequest::HasMacroRecorder(const SfxViewFrame& rView) { - return GetMacroRecorder( pView ).is(); + return GetMacroRecorder(&rView).is(); } - bool SfxRequest::IsAPI() const /* [Description] diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index e76702250033..aa7b83caf1c5 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -413,7 +413,7 @@ IMPL_LINK(SwGlossaryDlg, GrpSelect, weld::TreeView&, rBox, void) ShowAutoText("", ""); // update controls NameModify(*m_xShortNameEdit); - if( SfxRequest::HasMacroRecorder( &m_pShell->GetView().GetViewFrame() ) ) + if (SfxRequest::HasMacroRecorder(m_pShell->GetView().GetViewFrame())) { SfxRequest aReq( &m_pShell->GetView().GetViewFrame(), FN_SET_ACT_GLOSSARY ); aReq.AppendItem(SfxStringItem(FN_SET_ACT_GLOSSARY, getCurrentGlossary())); @@ -436,7 +436,7 @@ void SwGlossaryDlg::Apply() { m_pGlossaryHdl->InsertGlossary(aGlosName); } - if( SfxRequest::HasMacroRecorder( &m_pShell->GetView().GetViewFrame() ) ) + if (SfxRequest::HasMacroRecorder(m_pShell->GetView().GetViewFrame())) { SfxRequest aReq( &m_pShell->GetView().GetViewFrame(), FN_INSERT_GLOSSARY ); aReq.AppendItem(SfxStringItem(FN_INSERT_GLOSSARY, getCurrentGlossary())); @@ -593,7 +593,7 @@ IMPL_LINK(SwGlossaryDlg, MenuHdl, const OString&, rItemIdent, void) m_xShortNameEdit->set_text(aShortName); NameModify(*m_xNameED); // for toggling the buttons - if( SfxRequest::HasMacroRecorder( &m_pShell->GetView().GetViewFrame() ) ) + if (SfxRequest::HasMacroRecorder(m_pShell->GetView().GetViewFrame())) { SfxRequest aReq(&m_pShell->GetView().GetViewFrame(), FN_NEW_GLOSSARY); aReq.AppendItem(SfxStringItem(FN_NEW_GLOSSARY, getCurrentGlossary())); diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 922e1c4c31ae..88cfb135ef84 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -1272,7 +1272,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) bool bInserted = false; //recording: SfxViewFrame& rViewFrame = GetView().GetViewFrame(); - if( SfxRequest::HasMacroRecorder(&rViewFrame) ) + if (SfxRequest::HasMacroRecorder(rViewFrame)) { SfxRequest aReq( &rViewFrame, nSlot); aReq.AppendItem( SfxStringItem( FN_PARAM_1, OUString(cDelim) ));