diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-09-04 20:38:17 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-09-04 20:47:59 +0200 |
commit | 1146b889325fd01f24c6aacf557d3940dd147936 (patch) | |
tree | f5480c70d913726bea4ad9b1634ad330a086aef8 /reportdesign | |
parent | installer: Remove copy_complete_directory_without_cvs (diff) | |
download | core-1146b889325fd01f24c6aacf557d3940dd147936.tar.gz core-1146b889325fd01f24c6aacf557d3940dd147936.zip |
fdo#53872: reportdesign: fix section drawpage crash:
In order to wrap the SdrPage's UNO object completely, set its mxUnoPage
member to the OSection wrapper instance in OSection::init; only OSection
should have access to it.
Also initialize m_xDrawPage_Tunnel (thanks Lionel for the hint).
(regression from 05218c101df486302bf4cfe8be23ad840daa3f73)
Change-Id: I048ddafc31e946853e56e6a403ddc9487cfbcf0e
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/core/api/Section.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx index 0bde01b827cf..71aeef5ffc59 100644 --- a/reportdesign/source/core/api/Section.cxx +++ b/reportdesign/source/core/api/Section.cxx @@ -165,6 +165,12 @@ void SAL_CALL OSection::dispose() throw(uno::RuntimeException) { OSL_ENSURE(!rBHelper.bDisposed,"Already disposed!"); SectionPropertySet::dispose(); + uno::Reference<lang::XComponent> const xPageComponent(m_xDrawPage, + uno::UNO_QUERY); + if (xPageComponent.is()) + { + xPageComponent->dispose(); + } cppu::WeakComponentImplHelperBase::dispose(); } @@ -208,11 +214,15 @@ void OSection::init() if ( pModel ) { uno::Reference<report::XSection> const xSection(this); - m_xDrawPage.set(pModel->createNewPage(xSection)->getUnoPage(), - uno::UNO_QUERY_THROW); + SdrPage & rSdrPage(*pModel->createNewPage(xSection)); + m_xDrawPage.set(rSdrPage.getUnoPage(), uno::UNO_QUERY_THROW); m_xDrawPage_ShapeGrouper.set(m_xDrawPage, uno::UNO_QUERY_THROW); // apparently we may also get OReportDrawPage which doesn't support this m_xDrawPage_FormSupplier.set(m_xDrawPage, uno::UNO_QUERY); + m_xDrawPage_Tunnel.set(m_xDrawPage, uno::UNO_QUERY_THROW); + // fdo#53872: now also exchange the XDrawPage in the SdrPage so that + // rSdrPage.getUnoPage returns this + rSdrPage.SetUnoPage(this); // createNewPage _should_ have stored away 2 uno::References to this, // so our ref count cannot be 1 here, so this isn't destroyed here assert(m_refCount > 1); |