summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-01-09 11:54:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-11 07:02:21 +0100
commit6e8c9bdf0a55141d3cbd181862aec89b788bb060 (patch)
treeb36cb65d9c5998d968fc0e576e5cbe3c694e675b /sw
parent743d5604c22e2c599ec22c1afd8c7c02388d575f (diff)
using ScopedVclPtr with StartExecuteAsync not good
Which doesn't actually make much of a difference in this case because this is a welded dialog, which currently does not preserve a VclPtr owner of such dialogs. Perhaps we should rather fix the SfxTabDialogController::runAsync infrastructure to temporarily (a) preserve an owner for such dialogs (b) disposeAndClear such dialogs at least until we are done with welding? Otherwise this is very confusing. Change-Id: I568eb6813925299663ac3f90749b64076d404d19 Reviewed-on: https://gerrit.libreoffice.org/65708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/app/docst.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index e57b4e50e0d7..3e738a838911 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -548,11 +548,11 @@ public:
SfxStyleFamily nFamily, SfxAbstractApplyTabDialog *pDlg,
rtl::Reference< SfxStyleSheetBasePool > const & xBasePool,
bool bModified)
- : m_rDocSh(rDocSh)
+ : m_pDlg(pDlg)
+ , m_rDocSh(rDocSh)
, m_bNew(bNew)
, m_xTmp(xTmp)
, m_nFamily(nFamily)
- , m_pDlg(pDlg)
, m_xBasePool(xBasePool)
, m_bModified(bModified)
{
@@ -562,12 +562,12 @@ public:
{
ApplyHdl(nullptr);
}
+ VclPtr<SfxAbstractApplyTabDialog> m_pDlg;
private:
SwDocShell &m_rDocSh;
bool const m_bNew;
rtl::Reference< SwDocStyleSheet > m_xTmp;
SfxStyleFamily const m_nFamily;
- VclPtr<SfxAbstractApplyTabDialog> m_pDlg;
rtl::Reference< SfxStyleSheetBasePool > m_xBasePool;
bool const m_bModified;
};
@@ -818,7 +818,7 @@ void SwDocShell::Edit(
FieldUnit eMetric = ::GetDfltMetric(0 != (HTMLMODE_ON&nHtmlMode));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractApplyTabDialog> pDlg(pFact->CreateTemplateDialog(GetView()->GetViewFrame()->GetWindow().GetFrameWeld(),
+ VclPtr<SfxAbstractApplyTabDialog> pDlg(pFact->CreateTemplateDialog(GetView()->GetViewFrame()->GetWindow().GetFrameWeld(),
*xTmp, nFamily, sPage, pCurrShell, bNew));
std::shared_ptr<ApplyStyle> pApplyStyleHelper(new ApplyStyle(*this, bNew, xTmp, nFamily, pDlg.get(), m_xBasePool, bModified));
pDlg->SetApplyHdl(LINK(pApplyStyleHelper.get(), ApplyStyle, ApplyHdl));
@@ -863,6 +863,7 @@ void SwDocShell::Edit(
pShell->SetWatermark(aWatermark);
}
+ pApplyStyleHelper->m_pDlg.disposeAndClear();
if (pRequest)
pRequest->Done();
});