summaryrefslogtreecommitdiff
path: root/chart2/source/model
diff options
context:
space:
mode:
authorIngrid Halama <iha@openoffice.org>2010-06-01 11:40:18 +0200
committerIngrid Halama <iha@openoffice.org>2010-06-01 11:40:18 +0200
commit675696c68217bac964cd6823aca4007832a6f005 (patch)
tree886480df5e83f0505b8ca84ff7f48f1987e36a36 /chart2/source/model
parentdbafc22792c13d5f909447d84525a9d923430266 (diff)
parenta24ed4a9d146127a698669b23635ba565c0f2e2f (diff)
chart47: merge with DEV300_m80
Diffstat (limited to 'chart2/source/model')
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/ChartModel.cxx6
-rw-r--r--chart2/source/model/main/ChartModel_Persistence.cxx13
-rw-r--r--chart2/source/model/main/DataSeries.cxx14
-rw-r--r--chart2/source/model/template/ChartTypeTemplate.cxx4
4 files changed, 19 insertions, 18 deletions
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 94550e1d40b2..950169395c95 100644..100755
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -243,7 +243,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 f098793b3f1a..1868c38e094f 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -695,7 +695,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 );
+ }
}
}
@@ -825,8 +829,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/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx
index e14f244862b7..89197aa5ba3f 100644
--- a/chart2/source/model/main/DataSeries.cxx
+++ b/chart2/source/model/main/DataSeries.cxx
@@ -116,13 +116,6 @@ void lcl_CloneAttributedDataPoints(
}
}
-bool lcl_isInternalData( const Reference< chart2::data::XLabeledDataSequence > & xLSeq )
-{
- Reference< lang::XServiceInfo > xServiceInfo( xLSeq, uno::UNO_QUERY );
- return ( xServiceInfo.is() && xServiceInfo->getImplementationName().equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM("com.sun.star.comp.chart2.LabeledDataSequence")));
-}
-
} // anonymous namespace
// ----------------------------------------
@@ -146,11 +139,8 @@ DataSeries::DataSeries( const DataSeries & rOther ) :
{
if( ! rOther.m_aDataSequences.empty())
{
- if( lcl_isInternalData( rOther.m_aDataSequences.front()))
- CloneHelper::CloneRefVector< tDataSequenceContainer::value_type >(
- rOther.m_aDataSequences, m_aDataSequences );
- else
- m_aDataSequences = rOther.m_aDataSequences;
+ CloneHelper::CloneRefVector< tDataSequenceContainer::value_type >(
+ rOther.m_aDataSequences, m_aDataSequences );
ModifyListenerHelper::addListenerToAllElements( m_aDataSequences, m_xModifyEventForwarder );
}
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index 393321a19d55..e3943e9eb45f 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -86,7 +86,7 @@ void lcl_applyDefaultStyle(
void lcl_ensureCorrectLabelPlacement( const Reference< beans::XPropertySet >& xProp, const uno::Sequence < sal_Int32 >& rAvailablePlacements )
{
sal_Int32 nLabelPlacement=0;
- if( xProp->getPropertyValue( C2U( "LabelPlacement" ) ) >>= nLabelPlacement )
+ if( xProp.is() && (xProp->getPropertyValue( C2U( "LabelPlacement" ) ) >>= nLabelPlacement) )
{
bool bValid = false;
for( sal_Int32 nN = 0; nN < rAvailablePlacements.getLength(); nN++ )
@@ -112,7 +112,7 @@ void lcl_resetLabelPlacementIfDefault( const Reference< beans::XPropertySet >& x
{
sal_Int32 nLabelPlacement=0;
- if( xProp->getPropertyValue( C2U( "LabelPlacement" ) ) >>= nLabelPlacement )
+ if( xProp.is() && (xProp->getPropertyValue( C2U( "LabelPlacement" ) ) >>= nLabelPlacement) )
{
if( nDefaultPlacement == nLabelPlacement )
xProp->setPropertyValue( C2U("LabelPlacement"), uno::Any() );