Kaydet (Commit) 1ccab525 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

fix lifetime problems of ChartView

Change-Id: I99b24b026c50a05f8f3803348c76277e29a45ec7
üst 7070318e
......@@ -120,6 +120,7 @@ private:
sal_Int32 m_nInLoad;
sal_Bool volatile m_bUpdateNotificationsPending;
com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xChartView; // for the ref count
ChartView* mpChartView;
OUString m_aResource;
......
......@@ -185,8 +185,6 @@ ChartModel::~ChartModel()
OSL_TRACE( "ChartModel: DTOR called" );
if( m_xOldModelAgg.is())
m_xOldModelAgg->setDelegator( NULL );
delete mpChartView;
}
void SAL_CALL ChartModel::initialize( const Sequence< Any >& /*rArguments*/ )
......@@ -1199,7 +1197,10 @@ Reference< uno::XInterface > SAL_CALL ChartModel::createInstance( const OUString
case SERVICE_MARKER_TABLE:
{
if(!mpChartView)
{
mpChartView = new ChartView( m_xContext, *this);
xChartView = static_cast< ::cppu::OWeakObject* >( mpChartView );
}
return mpChartView->createInstance( rServiceSpecifier );
}
break;
......@@ -1210,7 +1211,10 @@ Reference< uno::XInterface > SAL_CALL ChartModel::createInstance( const OUString
else if(rServiceSpecifier == CHART_VIEW_SERVICE_NAME)
{
if(!mpChartView)
{
mpChartView = new ChartView( m_xContext, *this);
xChartView = static_cast< ::cppu::OWeakObject* >( mpChartView );
}
return static_cast< ::cppu::OWeakObject* >( mpChartView );
}
......
......@@ -680,6 +680,7 @@ int oglErrorHandler( unx::Display* /*dpy*/, unx::XErrorEvent* /*evnt*/ )
bool DummyChart::initOpengl()
{
initWindow();
mpWindow->setPosSizePixel(0,0,0,0);
GLWin.Width = 0;
GLWin.Height = 0;
......@@ -804,7 +805,7 @@ DummyChart::DummyChart():
void DummyChart::createGLContext()
{
initOpengl();
}
void DummyChart::setPosition( const awt::Point& aPosition )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment