summaryrefslogtreecommitdiff
path: root/sw/source/uibase/misc/redlndlg.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-06-01 11:58:32 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-06-01 16:02:52 +0200
commitfc5833b86016b0a940dd87d43dbe490ba1308dfe (patch)
tree09dc90a011f4d5c24076e6079d831bec9243b0b9 /sw/source/uibase/misc/redlndlg.cxx
parent1fe266c22fb7d277ae612cffd6cc89ef4dcb4269 (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/+/135237 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/uibase/misc/redlndlg.cxx')
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 9cc010c288ec..2b12439494b8 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -207,7 +207,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();
@@ -235,18 +236,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;
@@ -277,7 +279,7 @@ void SwRedlineAcceptDlg::InitAuthors()
pFilterPage->SelectAuthor(aStrings[0]);
weld::TreeView& rTreeView = m_pTable->GetWidget();
- bool const bEnable = !pSh->GetDoc()->GetDocShell()->IsReadOnly()
+ bool const bEnable = pSh && !pSh->GetDoc()->GetDocShell()->IsReadOnly()
&& rTreeView.n_children() != 0
&& !pSh->getIDocumentRedlineAccess().GetRedlinePassword().hasElements();
bool bSel = rTreeView.get_selected(nullptr);
@@ -725,7 +727,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();