[Libreoffice-commits] core.git: sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 3 08:56:41 UTC 2020


 sw/source/ui/index/swuiidxmrk.cxx   |   17 ++++++++---------
 sw/source/uibase/inc/swuiidxmrk.hxx |    2 +-
 2 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 04144ecb1bb2ecb0233a43db1e3263dcb6c84571
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Nov 2 19:58:20 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Nov 3 09:55:54 2020 +0100

    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 at redhat.com>

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();
 


More information about the Libreoffice-commits mailing list