summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-01-17 10:25:54 +0000
committerCaolán McNamara <caolanm@redhat.com>2023-01-18 10:50:27 +0000
commite444fe6febf11b66d765b2011884a59e627b59cd (patch)
tree28156331c614fbdab06c579c6bf0ece045be72e4
parenttdf#152990 set the font after the MapMode is (potentially) set (diff)
downloadcore-e444fe6febf11b66d765b2011884a59e627b59cd.tar.gz
core-e444fe6febf11b66d765b2011884a59e627b59cd.zip
Resolves: tdf#153059 after ChangeHeaderOrFooter the control can be disposed
If the cursor is still on page one then when a header, via a control on another page, is added it jumps back to that page, so the widget on the now hidden page is removed, but the click handler hasn't completed so the follow up action to change it from a "plus" button to a dropdown menubutton was on a disposed widget. Change-Id: I981126412a0ee6a667d77fb97a3db2f2b0a0363c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145586 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/uibase/docvw/HeaderFooterWin.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 0e79e1481012..539a310b08aa 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -549,8 +549,13 @@ IMPL_LINK_NOARG(SwHeaderFooterWin, ClickHdl, weld::Button&, void)
const SwPageFrame* pPageFrame = SwFrameMenuButtonBase::GetPageFrame(m_pFrame);
const OUString& rStyleName = pPageFrame->GetPageDesc()->GetName();
- rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, true, false );
-
+ {
+ VclPtr<SwHeaderFooterWin> xThis(this);
+ rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, true, false );
+ //tdf#153059 after ChangeHeaderOrFooter is it possible that "this" is disposed
+ if (xThis->isDisposed())
+ return;
+ }
m_xPushButton->hide();
m_xMenuButton->show();
PaintButton();