summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorIngrid Halama <iha@openoffice.org>2010-03-26 10:43:05 +0100
committerIngrid Halama <iha@openoffice.org>2010-03-26 10:43:05 +0100
commit94f617bf9883284bb3c7db8a6004c39975d66bbc (patch)
treeb0a64aeb5512080d1bc8cb88b0a6756f5c957aed /chart2/source
parentfe03f2e6f1779db3e08bac64a3e3bed1562d0a24 (diff)
chart45: make more failsafe
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx3
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx6
-rw-r--r--chart2/source/controller/main/UndoManager.cxx6
-rwxr-xr-xchart2/source/model/main/ChartModel.cxx6
-rw-r--r--chart2/source/model/main/ChartModel_Persistence.cxx13
-rw-r--r--chart2/source/tools/LifeTime.cxx6
-rw-r--r--chart2/source/tools/RangeHighlighter.cxx6
-rw-r--r--chart2/source/view/main/ChartView.cxx6
8 files changed, 42 insertions, 10 deletions
diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
index 253699f4595c..cad005b9c06a 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
@@ -482,7 +482,8 @@ void ChartDataWrapper::fireChartDataChangeEvent(
uno::Reference<
::com::sun::star::chart::XChartDataChangeEventListener > xListener(
aIter.next(), uno::UNO_QUERY );
- xListener->chartDataChanged( aEvent );
+ if( xListener.is() )
+ xListener->chartDataChanged( aEvent );
}
}
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 22ac22cd7c73..6049be7e3199 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -1714,7 +1714,11 @@ bool ChartController::requestQuickHelp(
lang::EventObject aEvent( xSelectionSupplier );
::cppu::OInterfaceIteratorHelper aIt( *pIC );
while( aIt.hasMoreElements() )
- (static_cast< view::XSelectionChangeListener*>(aIt.next()))->selectionChanged( aEvent );
+ {
+ uno::Reference< view::XSelectionChangeListener > xListener( aIt.next(), uno::UNO_QUERY );
+ if( xListener.is() )
+ xListener->selectionChanged( aEvent );
+ }
}
}
diff --git a/chart2/source/controller/main/UndoManager.cxx b/chart2/source/controller/main/UndoManager.cxx
index 34157503e629..21e27922b1c8 100644
--- a/chart2/source/controller/main/UndoManager.cxx
+++ b/chart2/source/controller/main/UndoManager.cxx
@@ -108,7 +108,11 @@ void ModifyBroadcaster::fireEvent()
lang::EventObject aEvent( static_cast< lang::XComponent* >( this ) );
::cppu::OInterfaceIteratorHelper aIt( *pIC );
while( aIt.hasMoreElements() )
- (static_cast< util::XModifyListener*>(aIt.next()))->modified( aEvent );
+ {
+ uno::Reference< util::XModifyListener > xListener( aIt.next(), uno::UNO_QUERY );
+ if( xListener.is() )
+ xListener->modified( aEvent );
+ }
}
}
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 77533ec1306b..6d848e8c5c9c 100755
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -231,7 +231,11 @@ void SAL_CALL ChartModel::impl_notifyCloseListeners()
lang::EventObject aEvent( static_cast< lang::XComponent*>(this) );
::cppu::OInterfaceIteratorHelper aIt( *pIC );
while( aIt.hasMoreElements() )
- (static_cast< util::XCloseListener*>(aIt.next()))->notifyClosing( aEvent );
+ {
+ uno::Reference< util::XCloseListener > xListener( aIt.next(), uno::UNO_QUERY );
+ if( xListener.is() )
+ xListener->notifyClosing( aEvent );
+ }
}
}
diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx
index b7b8f380ceea..dba8ea930b9f 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -697,7 +697,11 @@ void SAL_CALL ChartModel::impl_notifyModifiedListeners()
lang::EventObject aEvent( static_cast< lang::XComponent*>(this) );
::cppu::OInterfaceIteratorHelper aIt( *pIC );
while( aIt.hasMoreElements() )
- (static_cast< util::XModifyListener*>(aIt.next()))->modified( aEvent );
+ {
+ uno::Reference< util::XModifyListener > xListener( aIt.next(), uno::UNO_QUERY );
+ if( xListener.is() )
+ xListener->modified( aEvent );
+ }
}
}
@@ -827,8 +831,11 @@ void SAL_CALL ChartModel::impl_notifyStorageChangeListeners()
{
::cppu::OInterfaceIteratorHelper aIt( *pIC );
while( aIt.hasMoreElements() )
- (static_cast< document::XStorageChangeListener* >(aIt.next()))->notifyStorageChange(
- static_cast< ::cppu::OWeakObject* >( this ), m_xStorage );
+ {
+ uno::Reference< document::XStorageChangeListener > xListener( aIt.next(), uno::UNO_QUERY );
+ if( xListener.is() )
+ xListener->notifyStorageChange( static_cast< ::cppu::OWeakObject* >( this ), m_xStorage );
+ }
}
}
diff --git a/chart2/source/tools/LifeTime.cxx b/chart2/source/tools/LifeTime.cxx
index 68ed06208d11..38aa07718d4a 100644
--- a/chart2/source/tools/LifeTime.cxx
+++ b/chart2/source/tools/LifeTime.cxx
@@ -371,7 +371,11 @@ CloseableLifeTimeManager::~CloseableLifeTimeManager()
lang::EventObject aEvent( xCloseable );
::cppu::OInterfaceIteratorHelper aIt( *pIC );
while( aIt.hasMoreElements() )
- (static_cast< util::XCloseListener*>(aIt.next()))->notifyClosing( aEvent );
+ {
+ uno::Reference< util::XCloseListener > xListener( aIt.next(), uno::UNO_QUERY );
+ if( xListener.is() )
+ xListener->notifyClosing( aEvent );
+ }
}
}
}
diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx
index 20359bfa6b4c..1565344923b1 100644
--- a/chart2/source/tools/RangeHighlighter.cxx
+++ b/chart2/source/tools/RangeHighlighter.cxx
@@ -348,7 +348,11 @@ void RangeHighlighter::fireSelectionEvent()
lang::EventObject aEvent( static_cast< lang::XComponent* >( this ) );
::cppu::OInterfaceIteratorHelper aIt( *pIC );
while( aIt.hasMoreElements() )
- (static_cast< view::XSelectionChangeListener*>(aIt.next()))->selectionChanged( aEvent );
+ {
+ uno::Reference< view::XSelectionChangeListener > xListener( aIt.next(), uno::UNO_QUERY );
+ if( xListener.is() )
+ xListener->selectionChanged( aEvent );
+ }
}
}
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index da8798fe31b6..9e39ffae0fe4 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -2776,7 +2776,11 @@ void ChartView::impl_notifyModeChangeListener( const rtl::OUString& rNewMode )
util::ModeChangeEvent aEvent( static_cast< uno::XWeak* >( this ), rNewMode );
::cppu::OInterfaceIteratorHelper aIt( *pIC );
while( aIt.hasMoreElements() )
- (static_cast< util::XModeChangeListener*>(aIt.next()))->modeChanged( aEvent );
+ {
+ uno::Reference< util::XModeChangeListener > xListener( aIt.next(), uno::UNO_QUERY );
+ if( xListener.is() )
+ xListener->modeChanged( aEvent );
+ }
}
}
catch( uno::Exception& ex)