[Libreoffice-commits] core.git: 2 commits - include/ucbhelper svx/source ucbhelper/source vcl/source
Noel Grandin
noel.grandin at collabora.co.uk
Mon Jan 16 11:54:05 UTC 2017
include/ucbhelper/interactionrequest.hxx | 4 ---
svx/source/gallery2/galbrws1.cxx | 28 +++++++++++------------
svx/source/gallery2/galbrws1.hxx | 3 +-
ucbhelper/source/provider/interactionrequest.cxx | 17 +------------
vcl/source/window/dialog.cxx | 2 -
5 files changed, 20 insertions(+), 34 deletions(-)
New commits:
commit cd9d8315141c3070f43e145ed4ee390e837eb73f
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon Jan 16 13:53:00 2017 +0200
tdf#105017 Crash when click a "New Theme..." in Gallery on detached SideBar
caused by VclPtr fixes which meant instead of the dialog staying in an
always-zero ref-count state, it went up to a ref-count of 1, then down
to zero, which triggered a delete before the dialog had finished
displaying.
And revert my fix in commit 0c1cd678f71e519f5a4e623d93442e046485005a
which just worked around the underlying problem
Change-Id: Icb35535dd06a2d1db1016d00d106760847d87430
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index c995723..7201c6e 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -148,6 +148,7 @@ GalleryBrowser1::~GalleryBrowser1()
void GalleryBrowser1::dispose()
{
EndListening( *mpGallery );
+ mpThemePropertiesDialog.clear();
mpThemes.disposeAndClear();
delete mpExchangeData;
mpExchangeData = nullptr;
@@ -265,24 +266,24 @@ void GalleryBrowser1::ImplGalleryThemeProperties( const OUString & rThemeName, b
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
assert(pFact && "Got no AbstractDialogFactory!");
- VclPtr<VclAbstractDialog2> pThemeProps = pFact->CreateGalleryThemePropertiesDialog( mpExchangeData, mpThemePropsDlgItemSet );
- assert(pThemeProps && "Got no GalleryThemePropertiesDialog!");
+ mpThemePropertiesDialog = pFact->CreateGalleryThemePropertiesDialog( mpExchangeData, mpThemePropsDlgItemSet );
+ assert(mpThemePropertiesDialog && "Got no GalleryThemePropertiesDialog!");
if ( bCreateNew )
{
- pThemeProps->StartExecuteModal(
+ mpThemePropertiesDialog->StartExecuteModal(
LINK( this, GalleryBrowser1, EndNewThemePropertiesDlgHdl ) );
}
else
{
- pThemeProps->StartExecuteModal(
+ mpThemePropertiesDialog->StartExecuteModal(
LINK( this, GalleryBrowser1, EndThemePropertiesDlgHdl ) );
}
}
-void GalleryBrowser1::ImplEndGalleryThemeProperties(Dialog* pDialog, bool bCreateNew)
+void GalleryBrowser1::ImplEndGalleryThemeProperties(Dialog* /*pDialog*/, bool bCreateNew)
{
- long nRet = pDialog->GetResult();
+ long nRet = mpThemePropertiesDialog->GetResult();
if( nRet == RET_OK )
{
@@ -319,23 +320,22 @@ void GalleryBrowser1::ImplEndGalleryThemeProperties(Dialog* pDialog, bool bCreat
}
// destroy mpThemeProps asynchronously
- Application::PostUserEvent( LINK( this, GalleryBrowser1, DestroyThemePropertiesDlgHdl ), pDialog, true );
+ Application::PostUserEvent( LINK( this, GalleryBrowser1, DestroyThemePropertiesDlgHdl ), nullptr, true );
}
-IMPL_LINK( GalleryBrowser1, EndNewThemePropertiesDlgHdl, Dialog&, rDialog, void )
+IMPL_LINK( GalleryBrowser1, EndNewThemePropertiesDlgHdl, Dialog&, /*rDialog*/, void )
{
- ImplEndGalleryThemeProperties(&rDialog, true);
+ ImplEndGalleryThemeProperties(nullptr, true);
}
-IMPL_LINK( GalleryBrowser1, EndThemePropertiesDlgHdl, Dialog&, rDialog, void )
+IMPL_LINK( GalleryBrowser1, EndThemePropertiesDlgHdl, Dialog&, /*rDialog*/, void )
{
- ImplEndGalleryThemeProperties(&rDialog, false);
+ ImplEndGalleryThemeProperties(nullptr, false);
}
-IMPL_LINK( GalleryBrowser1, DestroyThemePropertiesDlgHdl, void*, p, void )
+IMPL_LINK( GalleryBrowser1, DestroyThemePropertiesDlgHdl, void*, /*p*/, void )
{
- VclPtr<VclAbstractDialog2> pDialog = static_cast<VclAbstractDialog2*>(p);
- pDialog.disposeAndClear();
+ mpThemePropertiesDialog.disposeAndClear();
delete mpThemePropsDlgItemSet;
mpThemePropsDlgItemSet = nullptr;
}
diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx
index 896fca1..294623c 100644
--- a/svx/source/gallery2/galbrws1.hxx
+++ b/svx/source/gallery2/galbrws1.hxx
@@ -76,8 +76,9 @@ class GalleryBrowser1 : public Control, public SfxListener
private:
- VclPtr<GalleryButton> maNewTheme;
+ VclPtr<GalleryButton> maNewTheme;
VclPtr<GalleryThemeListBox> mpThemes;
+ VclPtr<VclAbstractDialog2> mpThemePropertiesDialog; // to keep it alive during execution
Gallery* mpGallery;
ExchangeData* mpExchangeData;
SfxItemSet* mpThemePropsDlgItemSet;
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index e17b66b..4e0fd97 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1037,7 +1037,7 @@ void Dialog::SetModalInputMode( bool bModal )
// Disable the prev Modal Dialog, because our dialog must close at first,
// before the other dialog can be closed (because the other dialog
// is on stack since our dialog returns)
- if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->isDisposed() && !mpPrevExecuteDlg->IsWindowOrChild( this, true ) )
+ if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, true ) )
mpPrevExecuteDlg->EnableInput( false, this );
// determine next overlap dialog parent
commit 26b0e86405b27a0342a5b42f82a944559f3a1358
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon Jan 16 11:12:59 2017 +0200
inline InteractionContinuation_Impl
since it only contains one field, and does nothing special with it
Change-Id: Ie1c099a4507a6b99af28be5852793ccaa557aa72
diff --git a/include/ucbhelper/interactionrequest.hxx b/include/ucbhelper/interactionrequest.hxx
index 4bf10bc..f0d3fec 100644
--- a/include/ucbhelper/interactionrequest.hxx
+++ b/include/ucbhelper/interactionrequest.hxx
@@ -139,8 +139,6 @@ public:
};
-struct InteractionContinuation_Impl;
-
/**
* This class is the base for implementations of the interface
* XInteractionContinuation. Classes derived from this bas class work together
@@ -152,7 +150,7 @@ struct InteractionContinuation_Impl;
*/
class UCBHELPER_DLLPUBLIC InteractionContinuation : public cppu::OWeakObject
{
- std::unique_ptr<InteractionContinuation_Impl> m_pImpl;
+ InteractionRequest* m_pRequest;
protected:
/**
diff --git a/ucbhelper/source/provider/interactionrequest.cxx b/ucbhelper/source/provider/interactionrequest.cxx
index 52bc3b4..c8d0858b 100644
--- a/ucbhelper/source/provider/interactionrequest.cxx
+++ b/ucbhelper/source/provider/interactionrequest.cxx
@@ -187,23 +187,10 @@ InteractionRequest::getContinuations()
// InteractionContinuation Implementation.
-namespace ucbhelper
-{
-
-struct InteractionContinuation_Impl
-{
- InteractionRequest * m_pRequest;
-
- explicit InteractionContinuation_Impl( InteractionRequest * pRequest )
- : m_pRequest( pRequest ) {}
-};
-
-}
-
InteractionContinuation::InteractionContinuation(
InteractionRequest * pRequest )
-: m_pImpl( new InteractionContinuation_Impl( pRequest ) )
+: m_pRequest( pRequest )
{
}
@@ -216,7 +203,7 @@ InteractionContinuation::~InteractionContinuation()
void InteractionContinuation::recordSelection()
{
- m_pImpl->m_pRequest->setSelection( this );
+ m_pRequest->setSelection( this );
}
More information about the Libreoffice-commits
mailing list