diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-06-01 11:58:32 +0100 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2022-06-01 18:56:35 +0200 |
commit | cd4a3750ca5473f7dc45250f686c75cdc6a59f83 (patch) | |
tree | 7e6766bd281ff0515b10adb6980bda7b0fda1661 | |
parent | 06fb42fbb3edc5dbabbaf87590e58761247c9e9e (diff) |
Related: tdf#149408 various crashes seen in redline panel
with this writer in calc ole case
Change-Id: I1ecd7725703674cc1bcfc9b3d411ec890bfe4bcc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135238
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 31b4e6df39687f4366ff1ac36bb6a727dfa41b10)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135260
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r-- | sw/source/uibase/misc/redlndlg.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index b3ca574b492d..e78460dcf410 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -206,7 +206,8 @@ SwRedlineAcceptDlg::~SwRedlineAcceptDlg() void SwRedlineAcceptDlg::Init(SwRedlineTable::size_type nStart) { - SwWait aWait( *::GetActiveView()->GetDocShell(), false ); + SwView *pView = ::GetActiveView(); + std::unique_ptr<SwWait> xWait(pView ? new SwWait(*pView->GetDocShell(), false) : nullptr); weld::TreeView& rTreeView = m_pTable->GetWidget(); m_aUsedSeqNo.clear(); @@ -234,18 +235,19 @@ void SwRedlineAcceptDlg::Init(SwRedlineTable::size_type nStart) void SwRedlineAcceptDlg::InitAuthors() { - SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr(); - if (!m_xTabPagesCTRL) return; + SwView *pView = ::GetActiveView(); + SwWrtShell* pSh = pView ? pView->GetWrtShellPtr() : nullptr; + SvxTPFilter *pFilterPage = m_xTabPagesCTRL->GetFilterPage(); std::vector<OUString> aStrings; OUString sOldAuthor(pFilterPage->GetSelectedAuthor()); pFilterPage->ClearAuthors(); - SwRedlineTable::size_type nCount = pSh->GetRedlineCount(); + SwRedlineTable::size_type nCount = pSh ? pSh->GetRedlineCount() : 0; m_bOnlyFormatedRedlines = true; bool bIsNotFormated = false; @@ -276,7 +278,7 @@ void SwRedlineAcceptDlg::InitAuthors() pFilterPage->SelectAuthor(aStrings[0]); weld::TreeView& rTreeView = m_pTable->GetWidget(); - bool bEnable = rTreeView.n_children() != 0 && !pSh->getIDocumentRedlineAccess().GetRedlinePassword().hasElements(); + bool bEnable = rTreeView.n_children() != 0 && pSh && !pSh->getIDocumentRedlineAccess().GetRedlinePassword().hasElements(); bool bSel = rTreeView.get_selected(nullptr); rTreeView.selected_foreach([this, pSh, &bIsNotFormated](weld::TreeIter& rEntry){ @@ -705,7 +707,10 @@ void SwRedlineAcceptDlg::RemoveParents(SwRedlineTable::size_type nStart, SwRedli void SwRedlineAcceptDlg::InsertParents(SwRedlineTable::size_type nStart, SwRedlineTable::size_type nEnd) { - SwView *pView = ::GetActiveView(); + SwView *pView = ::GetActiveView(); + if (!pView) + return; + SwWrtShell* pSh = pView->GetWrtShellPtr(); bool bHasRedlineAutoFormat = HasRedlineAutoFormat(); |