Kaydet (Commit) 8a20bf4a authored tarafından Mike Kaganski's avatar Mike Kaganski Kaydeden (comit) Szymon Kłos

tdf#118546: GetNotebookBar() may return nullptr

Change-Id: I411ea0abcb5fd5fac0db7fe0c4bad16a0c1b9d77
Reviewed-on: https://gerrit.libreoffice.org/57006Reviewed-by: 's avatarKshitij Pathania <kshitijpathania@gmail.com>
Tested-by: Jenkins
Reviewed-by: 's avatarSzymon Kłos <szymon.klos@collabora.com>
üst 25b74c5b
...@@ -1164,7 +1164,8 @@ SwPagePreview::SwPagePreview(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh): ...@@ -1164,7 +1164,8 @@ SwPagePreview::SwPagePreview(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh):
SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Printpreview)); SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Printpreview));
SfxShell::BroadcastContextForActivation(true); SfxShell::BroadcastContextForActivation(true);
//removelisteners for notebookbar //removelisteners for notebookbar
SfxViewFrame::Current()->GetWindow().GetSystemWindow()->GetNotebookBar()->ControlListener(true); if (auto& pBar = SfxViewFrame::Current()->GetWindow().GetSystemWindow()->GetNotebookBar())
pBar->ControlListener(true);
SfxObjectShell* pObjShell = pViewFrame->GetObjectShell(); SfxObjectShell* pObjShell = pViewFrame->GetObjectShell();
if ( !pOldSh ) if ( !pOldSh )
...@@ -1230,7 +1231,8 @@ SwPagePreview::~SwPagePreview() ...@@ -1230,7 +1231,8 @@ SwPagePreview::~SwPagePreview()
delete pVShell; delete pVShell;
m_pViewWin.disposeAndClear(); m_pViewWin.disposeAndClear();
SfxViewFrame::Current()->GetWindow().GetSystemWindow()->GetNotebookBar()->ControlListener(false); if (auto& pBar = SfxViewFrame::Current()->GetWindow().GetSystemWindow()->GetNotebookBar())
pBar->ControlListener(false);
m_pScrollFill.disposeAndClear(); m_pScrollFill.disposeAndClear();
m_pHScrollbar.disposeAndClear(); m_pHScrollbar.disposeAndClear();
m_pVScrollbar.disposeAndClear(); m_pVScrollbar.disposeAndClear();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment