summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-12-16 21:59:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-12-19 12:45:23 +0000
commit3ff01bfb98c6aba8095ff9c94b815e895b84ce6f (patch)
tree6bb837dd9d8cc4ae78638384f781561ef740b75b /svx
parent8b48c8d1ac7b2a4ef557b9e004a772fa0a6ade71 (diff)
SvxTextEditSourceImpl::Notify(): attempt to fix chart2_unoapi crash
Apparently SvxTextEditSourceImpl::mpView is not properly invalidated when the instance it points to is deleted; the SvxTextEditSourceImpl is registered as listener so try to handle this in Notify(); not sure if there isn't something that ought to have cleaned this up... Crash running with SAL_FORCE_IACCESSIBLE2=1: svxcorelo.dll!SdrPaintView::FindPaintWindow(const OutputDevice & rOut) Line 70 svxcorelo.dll!SvxTextEditSourceImpl::GetVisArea() Line 923 svxcorelo.dll!SvxTextEditSource::GetVisArea() Line 1113 svxlo.dll!accessibility::AccessibleTextHelper_Impl::UpdateVisibleChildren(bool bBroadcastEvents) Line 868 svxlo.dll!accessibility::AccessibleTextHelper_Impl::ProcessQueue() Line 1376 svxlo.dll!accessibility::AccessibleTextHelper_Impl::Notify(SfxBroadcaster & __formal, const SfxHint & rHint) Line 1530 svllo.dll!SfxBroadcaster::Broadcast(const SfxHint & rHint) Line 48 svxcorelo.dll!SvxTextEditSourceImpl::NotifyHdl(EENotify * aNotify) Line 1021 svxcorelo.dll!SvxTextEditSourceImpl::LinkStubNotifyHdl(void * pThis, void * pCaller) Line 1013 tllo.dll!Link::Call(void * pCaller) Line 123 editenglo.dll!Outliner::ImplBlockInsertionCallbacks(unsigned char b) Line 2098 editenglo.dll!Outliner::Clear() Line 2036 svxcorelo.dll!SdrOutlinerCache::disposeOutliner(SdrOutliner * pOutliner) Line 91 svxcorelo.dll!SdrModel::disposeOutliner(SdrOutliner * pOutliner) Line 1960 svxcorelo.dll!SvxTextEditSourceImpl::dispose() Line 489 svxcorelo.dll!SvxTextEditSourceImpl::Notify(SfxBroadcaster & __formal, const SfxHint & rHint) Line 458 svllo.dll!SfxBroadcaster::Broadcast(const SfxHint & rHint) Line 48 svxcorelo.dll!SdrModel::~SdrModel() Line 270 chartcorelo.dll!chart::DrawModelWrapper::~DrawModelWrapper() Line 191 chartcorelo.dll!chart::DrawModelWrapper::`vector deleting destructor'(unsigned int) chartcorelo.dll!boost::checked_delete<chart::DrawModelWrapper>(chart::DrawModelWrapper * x) Line 34 chartcorelo.dll!boost::detail::sp_counted_impl_p<chart::DrawModelWrapper>::dispose() Line 78 chartcorelo.dll!boost::detail::sp_counted_base::release() Line 104 chartcorelo.dll!boost::detail::shared_count::~shared_count() Line 381 chartcorelo.dll!boost::shared_ptr<chart::DrawModelWrapper>::~shared_ptr<chart::DrawModelWrapper>() chartcorelo.dll!boost::shared_ptr<chart::DrawModelWrapper>::reset() Line 626 chartcorelo.dll!chart::ChartView::~ChartView() Line 202 chartcorelo.dll!chart::ChartView::`scalar deleting destructor'(unsigned int) cppuhelper3MSC.dll!cppu::OWeakObject::release() Line 204 chartcorelo.dll!cppu::WeakImplHelper10<com::sun::star::lang::XInitialization,com::sun::star::lang::XServiceInfo,com::sun::star::datatransfer::XTransferable,com::sun::star::lang::XUnoTunnel,com::sun::star::util::XModifyListener,com::sun::star::util::XModeChangeBroadcaster,com::sun::star::util::XUpdatable,com::sun::star::beans::XPropertySet,com::sun::star::lang::XMultiServiceFactory,com::sun::star::qa::XDumper>::release() Line 115 chartcorelo.dll!com::sun::star::uno::Reference<com::sun::star::uno::XInterface>::~Reference<com::sun::star::uno::XInterface>() Line 106 chartcorelo.dll!chart::ChartModel::~ChartModel() Line 188 chartcorelo.dll!chart::ChartModel::`vector deleting destructor'(unsigned int) cppuhelper3MSC.dll!cppu::OWeakObject::release() Line 204 Change-Id: Ife6d6275eae74750858a7a7f57153c76a1a228a4 (cherry picked from commit 77378cde59bd9eb986f1ac8b071a5e853bc6805c) Reviewed-on: https://gerrit.libreoffice.org/7135 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/unodraw/unoshtxt.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index b4b2c62025e7..9181a6464930 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -331,15 +331,31 @@ void SvxTextEditSourceImpl::ChangeModel( SdrModel* pNewModel )
//------------------------------------------------------------------------
-void SvxTextEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
+void SvxTextEditSourceImpl::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
// #i105988 keep reference to this object
rtl::Reference< SvxTextEditSourceImpl > xThis( this );
const SdrHint* pSdrHint = PTR_CAST( SdrHint, &rHint );
const SvxViewHint* pViewHint = PTR_CAST( SvxViewHint, &rHint );
+ const SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
- if( pViewHint )
+ if (pSimpleHint)
+ {
+ if (SFX_HINT_DYING == pSimpleHint->GetId())
+ {
+ if (&rBC == mpView)
+ {
+ mpView = 0;
+ if (mpViewForwarder)
+ {
+ delete mpViewForwarder;
+ mpViewForwarder = 0;
+ }
+ }
+ }
+ }
+ else if( pViewHint )
{
switch( pViewHint->GetHintType() )
{