summaryrefslogtreecommitdiff
path: root/reportdesign/inc/RptObject.hxx
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2013-05-16 15:27:08 +0200
committerDavid Tardon <dtardon@redhat.com>2013-05-24 12:47:13 +0200
commit02d03eb4ad6e64744659c5fe04282b25b66c28d8 (patch)
tree6bf0d1ca1157276a340a0018bd2227967c9ca162 /reportdesign/inc/RptObject.hxx
parent9ae9b2f665b3caa9cc584512c26dfa899e1d2d45 (diff)
fdo#64279 do not crash opening report for editing
There are two problems: 1) The classes derived from SdrObject cache their SvxShape, but do not implement impl_setUnoShape(). 2) There is a lifetime issue in association of a SdrObject and its SvxShape. SvxDrawPage::CreateSdrObject not only creates a new SdrObject for a shape, but also inserts it into the page. At this point, the shape has not been attached to the object yet. That means that the object creates another shape at one point during the InsertObject call, which is then destroyed again. But reportdesign shapes own their objects, which means that destuction of the shape causes destruction of the object too... My first idea was to disable the insertion in SvxDrawPage::CreateSdrObject, but it has been there since the dawn of time, so I did not gather the courage to do that. Instead, I put in a hack to allow to skip the insertion. Change-Id: I888a54067be1934578434d8b476a13a7ff8d02b3
Diffstat (limited to 'reportdesign/inc/RptObject.hxx')
-rw-r--r--reportdesign/inc/RptObject.hxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx
index ac22e47d4f45..9de4b13fb163 100644
--- a/reportdesign/inc/RptObject.hxx
+++ b/reportdesign/inc/RptObject.hxx
@@ -169,6 +169,9 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape();
virtual sal_uInt16 GetObjIdentifier() const;
virtual sal_uInt32 GetObjInventor() const;
+
+private:
+ virtual void impl_setUnoShape( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxUnoShape );
};
//============================================================================
@@ -182,6 +185,8 @@ class REPORTDESIGN_DLLPUBLIC OOle2Obj: public SdrOle2Obj , public OObjectBase
sal_uInt16 m_nType;
bool m_bOnlyOnce;
void impl_createDataProvider_nothrow( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& _xModel);
+ virtual void impl_setUnoShape( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxUnoShape );
+
public:
static OOle2Obj* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent,sal_uInt16 _nType )
{
@@ -271,6 +276,7 @@ public:
OUnoObject& operator=(const OUnoObject& rObj);
private:
+ virtual void impl_setUnoShape( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxUnoShape );
void impl_setReportComponent_nothrow();
void impl_initializeModel_nothrow();
};