diff options
author | Christian Lippka <christian.lippka@sun.com> | 2010-06-01 14:04:07 +0200 |
---|---|---|
committer | Christian Lippka <christian.lippka@sun.com> | 2010-06-01 14:04:07 +0200 |
commit | 3340586932a3eaaa382efb9b456f68b884fba5e7 (patch) | |
tree | 2b8061500ea2878e3e406958f40a3fb8e26cc90c /chart2 | |
parent | b96dff3f4b212fe4eea98f6f2c6744f2ef8d1cfc (diff) | |
parent | a24ed4a9d146127a698669b23635ba565c0f2e2f (diff) |
cws renaissance2: rebase m80
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/prj/build.lst | 1 | ||||
-rw-r--r-- | chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx | 8 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Window.cxx | 10 | ||||
-rw-r--r-- | chart2/source/controller/main/ShapeToolbarController.cxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/main/UndoManager.cxx | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | chart2/source/model/main/ChartModel.cxx | 6 | ||||
-rw-r--r-- | chart2/source/model/main/ChartModel_Persistence.cxx | 13 | ||||
-rw-r--r-- | chart2/source/model/main/DataSeries.cxx | 14 | ||||
-rw-r--r-- | chart2/source/model/template/ChartTypeTemplate.cxx | 4 | ||||
-rw-r--r-- | chart2/source/tools/LifeTime.cxx | 6 | ||||
-rw-r--r-- | chart2/source/tools/RangeHighlighter.cxx | 6 | ||||
-rw-r--r-- | chart2/source/view/axes/VCartesianAxis.cxx | 6 | ||||
-rw-r--r-- | chart2/source/view/main/ChartView.cxx | 6 | ||||
-rw-r--r-- | chart2/source/view/main/VLegend.cxx | 11 |
14 files changed, 65 insertions, 34 deletions
diff --git a/chart2/prj/build.lst b/chart2/prj/build.lst index 370eacebe0c2..3cdc9a26e3f5 100644 --- a/chart2/prj/build.lst +++ b/chart2/prj/build.lst @@ -24,4 +24,3 @@ ch chart2\source\controller\chartapiwrapper nmake - all ch_source_controlle ch chart2\source\controller\main nmake - all ch_source_controller_main ch_inc NULL ch chart2\source\controller\menus nmake - all ch_source_controller_menus ch_inc NULL ch chart2\prj get - all ch_prj NULL -ch chart2\qa\unoapi nmake - all ch_qa_unoapi NULL diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx index 253699f4595c..062dcc1a129d 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx @@ -303,7 +303,9 @@ ChartDataWrapper::ChartDataWrapper( ::boost::shared_ptr< Chart2ModelContact > sp m_spChart2ModelContact( spChart2ModelContact ), m_aEventListenerContainer( m_aMutex ) { + osl_incrementInterlockedCount( &m_refCount ); initDataAccess(); + osl_decrementInterlockedCount( &m_refCount ); } ChartDataWrapper::ChartDataWrapper( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact, @@ -311,8 +313,10 @@ ChartDataWrapper::ChartDataWrapper( ::boost::shared_ptr< Chart2ModelContact > sp m_spChart2ModelContact( spChart2ModelContact ), m_aEventListenerContainer( m_aMutex ) { + osl_incrementInterlockedCount( &m_refCount ); lcl_AllOperator aOperator( xNewData ); applyData( aOperator ); + osl_decrementInterlockedCount( &m_refCount ); } ChartDataWrapper::~ChartDataWrapper() @@ -482,7 +486,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 ); } } @@ -547,6 +552,7 @@ void ChartDataWrapper::applyData( lcl_Operator& rDataOperator ) if( !bHasCategories && rDataOperator.setsCategories( bUseColumns ) ) bHasCategories = true; + aRangeString = C2U("all"); uno::Sequence< beans::PropertyValue > aArguments( DataSourceHelper::createArguments( aRangeString, aSequenceMapping, bUseColumns, bFirstCellAsLabel, bHasCategories ) ); diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index 7822c8c1cc21..6049be7e3199 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -774,6 +774,7 @@ void ChartController::execute_Tracking( const TrackingEvent& /* rTEvt */ ) void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt ) { ControllerLockGuard aCLGuard( m_aModel->getModel()); + bool bMouseUpWithoutMouseDown = !m_bWaitingForMouseUp; m_bWaitingForMouseUp = false; bool bNotifySelectionChange = false; { @@ -907,9 +908,8 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt ) else m_aSelection.resetPossibleSelectionAfterSingleClickWasEnsured(); } - else if( isDoubleClick(rMEvt) ) + else if( isDoubleClick(rMEvt) && !bMouseUpWithoutMouseDown /*#i106966#*/ ) { - // #i12587# support for shapes in chart Point aMousePixel = rMEvt.GetPosPixel(); execute_DoubleClick( &aMousePixel ); } @@ -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/ShapeToolbarController.cxx b/chart2/source/controller/main/ShapeToolbarController.cxx index a8a6cfba20ff..9c6ed747e1d5 100644 --- a/chart2/source/controller/main/ShapeToolbarController.cxx +++ b/chart2/source/controller/main/ShapeToolbarController.cxx @@ -56,7 +56,7 @@ namespace chart ::rtl::OUString ShapeToolbarController::getImplementationName_Static() throw (uno::RuntimeException) { - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.comp.ShapeToolbarController" ) ); + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.ShapeToolbarController" ) ); } Sequence< ::rtl::OUString > ShapeToolbarController::getSupportedServiceNames_Static() throw (uno::RuntimeException) 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 dc0931f41fc4..2a34844c169d 100644..100755 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -230,7 +230,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 4f864ae0fd1c..113be99915cb 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/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx index 4faca33e936c..bdb46665004f 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() ); 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/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index caadaa554091..8ec895fbd452 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -451,7 +451,7 @@ void VCartesianAxis::createAllTickInfosFromComplexCategories( ::std::vector< ::s sal_Int32 nCount = aCat.Count; if( nCatIndex + 0.5 + nCount >= m_aScale.Maximum ) { - nCount = m_aScale.Maximum - 0.5 - nCatIndex; + nCount = static_cast<sal_Int32>(m_aScale.Maximum - 0.5 - nCatIndex); if( nCount <= 0 ) nCount = 1; } @@ -1519,7 +1519,7 @@ void SAL_CALL VCartesianAxis::createShapes() ::std::vector<TickmarkProperties> aTickmarkPropertiesList; static bool bIncludeSpaceBetweenTickAndText = false; - sal_Int32 nOffset = pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties, false, bIncludeSpaceBetweenTickAndText ).getLength(); + sal_Int32 nOffset = static_cast<sal_Int32>(pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties, false, bIncludeSpaceBetweenTickAndText ).getLength()); sal_Int32 nTextLevelCount = getTextLevelCount(); for( sal_Int32 nTextLevel=0; nTextLevel<nTextLevelCount; nTextLevel++ ) { @@ -1527,7 +1527,7 @@ void SAL_CALL VCartesianAxis::createShapes() if( apTickIter.get() ) { B2DVector aLabelsDistance( lcl_getLabelsDistance( *apTickIter.get(), pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties, false ) ) ); - sal_Int32 nCurrentLength = aLabelsDistance.getLength(); + sal_Int32 nCurrentLength = static_cast<sal_Int32>(aLabelsDistance.getLength()); aTickmarkPropertiesList.push_back( m_aAxisProperties.makeTickmarkPropertiesForComplexCategories( nOffset + nCurrentLength, 0, nTextLevel ) ); nOffset += nCurrentLength; } diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 549ef0273595..c5ba0c38ab05 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -2829,7 +2829,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) diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index f0bcc12c0440..7101a984ee24 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -714,11 +714,16 @@ void VLegend::createShapes( LegendExpansion eExpansion = LegendExpansion_HIGH; if( xLegendProp.is()) { - lcl_getProperties( xLegendProp, aLineFillProperties, aTextProperties, nMaxLabelWidth, - rPageSize ); - // get Expansion property xLegendProp->getPropertyValue( C2U( "Expansion" )) >>= eExpansion; + if( eExpansion == LegendExpansion_WIDE ) + { + //#i80377# + nMaxLabelWidth = (rAvailableSpace.Width * 5) / 6;//completely correct would be available width minus symbol size minus distances to page ... + } + + lcl_getProperties( xLegendProp, aLineFillProperties, aTextProperties, nMaxLabelWidth, + rPageSize ); } if( xBorder.is()) |