summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-11-02 19:58:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-11-03 09:55:54 +0100
commit04144ecb1bb2ecb0233a43db1e3263dcb6c84571 (patch)
tree57efa39274cb66579c49f42dfa58cd5fd1726979
parent7bcee97c48026b8cc41b5c83dd43ed8aa1cd205d (diff)
Related: rhbz#1893846 GetActiveWrtShell can return null
Change-Id: I862f562d0f799defde49a3a0eefcdc11b925a404 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105203 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx17
-rw-r--r--sw/source/uibase/inc/swuiidxmrk.hxx2
2 files changed, 9 insertions, 10 deletions
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index f4b1f8007f62..3ea8bb755bbc 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -66,7 +66,7 @@ using namespace ::comphelper;
// dialog to insert a directory selection
SwIndexMarkPane::SwIndexMarkPane(const std::shared_ptr<weld::Dialog>& rDialog, weld::Builder& rBuilder, bool bNewDlg,
- SwWrtShell& rWrtShell)
+ SwWrtShell* pWrtShell)
: m_xDialog(rDialog)
, m_bDel(false)
, m_bNewMark(bNewDlg)
@@ -76,7 +76,7 @@ SwIndexMarkPane::SwIndexMarkPane(const std::shared_ptr<weld::Dialog>& rDialog, w
, m_bPhoneticED2_ChangedByUser(false)
, m_nLangForPhoneticReading(LANGUAGE_CHINESE_SIMPLIFIED)
, m_bIsPhoneticReadingEnabled(false)
- , m_pSh(&rWrtShell)
+ , m_pSh(pWrtShell)
, m_xTypeFT(rBuilder.weld_label("typeft"))
, m_xTypeDCB(rBuilder.weld_combo_box("typecb"))
, m_xNewBT(rBuilder.weld_button("new"))
@@ -938,7 +938,7 @@ SwIndexMarkPane::~SwIndexMarkPane()
{
}
-void SwIndexMarkPane::ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark const * pCurTOXMark)
+void SwIndexMarkPane::ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark const * pCurTOXMark)
{
m_pSh = &rWrtShell;
m_pTOXMgr.reset( new SwTOXMgr(m_pSh) );
@@ -959,10 +959,10 @@ SwIndexMarkFloatDlg::SwIndexMarkFloatDlg(SfxBindings* _pBindings,
SfxChildWinInfo const * pInfo, bool bNew)
: SfxModelessDialogController(_pBindings, pChild, pParent,
"modules/swriter/ui/indexentry.ui", "IndexEntryDialog")
- , m_aContent(m_xDialog, *m_xBuilder, bNew, *::GetActiveWrtShell())
+ , m_aContent(m_xDialog, *m_xBuilder, bNew, ::GetActiveWrtShell())
{
- if (SwWrtShell* pSh = ::GetActiveWrtShell())
- m_aContent.ReInitDlg(*pSh);
+ if (SwWrtShell* pWrtShell = ::GetActiveWrtShell())
+ m_aContent.ReInitDlg(*pWrtShell);
Initialize(pInfo);
}
@@ -980,7 +980,7 @@ void SwIndexMarkFloatDlg::ReInitDlg(SwWrtShell& rWrtShell)
SwIndexMarkModalDlg::SwIndexMarkModalDlg(weld::Window *pParent, SwWrtShell& rSh, SwTOXMark const * pCurTOXMark)
: SfxDialogController(pParent, "modules/swriter/ui/indexentry.ui",
"IndexEntryDialog")
- , m_aContent(m_xDialog, *m_xBuilder, false, rSh)
+ , m_aContent(m_xDialog, *m_xBuilder, false, &rSh)
{
m_aContent.ReInitDlg(rSh, pCurTOXMark);
}
@@ -1677,8 +1677,7 @@ SwAuthMarkFloatDlg::SwAuthMarkFloatDlg(SfxBindings* _pBindings,
, m_aContent(*this, *m_xBuilder, bNew)
{
Initialize(pInfo);
- SwWrtShell* pWrtShell = ::GetActiveWrtShell();
- if (pWrtShell)
+ if (SwWrtShell* pWrtShell = ::GetActiveWrtShell())
m_aContent.ReInitDlg(*pWrtShell);
}
diff --git a/sw/source/uibase/inc/swuiidxmrk.hxx b/sw/source/uibase/inc/swuiidxmrk.hxx
index 2bd2fb4e4fa9..ee738021fc13 100644
--- a/sw/source/uibase/inc/swuiidxmrk.hxx
+++ b/sw/source/uibase/inc/swuiidxmrk.hxx
@@ -125,7 +125,7 @@ class SwIndexMarkPane
public:
SwIndexMarkPane(const std::shared_ptr<weld::Dialog>& rDialog, weld::Builder& rBuilder,
- bool bNewDlg, SwWrtShell& rWrtShell);
+ bool bNewDlg, SwWrtShell* pWrtShell);
~SwIndexMarkPane();