tdf#144132 Crash when insert formula object in Writer
regression from
commit ec01d43e0a8fa560d7cd8c76c0d609b18a60cddb
Date: Wed Jul 21 14:24:28 2021 +0200
pass SfxChildWinFactory around by value
Change-Id: I88bc6c8bfd35d0a653512b064c9ee0d59b1e8b38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122520
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index b00f70a..51f58a4 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -51,7 +51,7 @@
{
css::uno::Reference< css::frame::XFrame > xFrame;
css::uno::Reference< css::lang::XEventListener > xListener;
SfxChildWinFactory* pFact;
SfxChildWinFactory aFact = { nullptr, 0, 0 };
bool bHideNotDelete;
bool bVisible;
bool bWantsFocus;
@@ -147,7 +147,6 @@
, eChildAlignment(SfxChildAlignment::NOALIGNMENT)
, nType(nId)
{
pImpl->pFact = nullptr;
pImpl->bHideNotDelete = false;
pImpl->bWantsFocus = true;
pImpl->bVisible = true;
@@ -291,7 +290,7 @@
aWinOpt.SetUserData( aSeq );
// ... but save status at runtime!
pImpl->pFact->aInfo = rInfo;
pImpl->aFact.aInfo = rInfo;
}
void SfxChildWindow::SetAlignment(SfxChildAlignment eAlign)
@@ -301,7 +300,7 @@
SfxChildWinInfo SfxChildWindow::GetInfo() const
{
SfxChildWinInfo aInfo(pImpl->pFact->aInfo);
SfxChildWinInfo aInfo(pImpl->aFact.aInfo);
if (xController)
{
weld::Dialog* pDialog = xController->getDialog();
@@ -343,7 +342,7 @@
sal_uInt16 SfxChildWindow::GetPosition() const
{
return pImpl->pFact->nPos;
return pImpl->aFact.nPos;
}
void SfxChildWindow::InitializeChildWinFactory_Impl(sal_uInt16 nId, SfxChildWinInfo& rInfo)
@@ -423,7 +422,7 @@
void SfxChildWindow::SetFactory_Impl( SfxChildWinFactory *pF )
{
pImpl->pFact = pF;
pImpl->aFact = *pF;
}
void SfxChildWindow::SetHideNotDelete( bool bOn )