diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-06-03 14:33:05 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-06-03 14:33:05 +0200 |
commit | 1b37b4dae7604e9c41d7aceb189c18d43703698b (patch) | |
tree | d51492bb787b1a4529848181a41d49bc244e7e32 /chart2 | |
parent | bd2e9bfe7f5b4beb227e09f8a1f1d0e49c34bf1f (diff) | |
parent | a24ed4a9d146127a698669b23635ba565c0f2e2f (diff) |
slidecopy: merged latest DEV300.m80 changes
Diffstat (limited to 'chart2')
21 files changed, 136 insertions, 80 deletions
diff --git a/chart2/qa/unoapi/Test.java b/chart2/qa/unoapi/Test.java new file mode 100644 index 000000000000..c1b6fd05983d --- /dev/null +++ b/chart2/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.chart2.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "sch.sce", "-xcl", "knownissues.xcl", "-tdoc", + "testdocuments", "-cs", connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/chart2/qa/unoapi/makefile.mk b/chart2/qa/unoapi/makefile.mk index 517327aab0bf..de494ead5449 100644 --- a/chart2/qa/unoapi/makefile.mk +++ b/chart2/qa/unoapi/makefile.mk @@ -1,7 +1,6 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -22,21 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -EXTERNAL_WARNINGS_NOT_ERRORS := TRUE +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJ=..$/.. +PRJ = ../.. +PRJNAME = chart2 +TARGET = qa_unoapi -PRJNAME=sch -TARGET=qa_unoapi +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/chart2/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END .INCLUDE: settings.mk - .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce sch.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END 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/controller.map b/chart2/source/controller/controller.map deleted file mode 100644 index ac2c3750bfe0..000000000000 --- a/chart2/source/controller/controller.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; 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/controller/makefile.mk b/chart2/source/controller/makefile.mk index 8fdd6000fbe1..b8a256181045 100644 --- a/chart2/source/controller/makefile.mk +++ b/chart2/source/controller/makefile.mk @@ -100,7 +100,7 @@ SHL1STDLIBS= $(CHARTTOOLS) \ #specifies the exported symbols for Windows only: SHL1DEF= $(MISC)$/$(SHL1TARGET).def -SHL1VERSIONMAP = controller.map +SHL1VERSIONMAP = $(SOLARENV)/src/component.map #--------definition file 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/makefile.mk b/chart2/source/model/makefile.mk index 701f47fb94b5..dfb5522a7879 100644 --- a/chart2/source/model/makefile.mk +++ b/chart2/source/model/makefile.mk @@ -86,7 +86,7 @@ SHL1STDLIBS= $(CHARTTOOLS) \ #specifies the exported symbols for Windows only: SHL1DEF= $(MISC)$/$(SHL1TARGET).def -SHL1VERSIONMAP = model.map +SHL1VERSIONMAP = $(SOLARENV)/src/component.map #--------definition file diff --git a/chart2/source/model/model.map b/chart2/source/model/model.map deleted file mode 100644 index 07b1790d5754..000000000000 --- a/chart2/source/model/model.map +++ /dev/null @@ -1,8 +0,0 @@ -CHART_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; 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/tools/tools.map b/chart2/source/tools/tools.map deleted file mode 100644 index 07b1790d5754..000000000000 --- a/chart2/source/tools/tools.map +++ /dev/null @@ -1,8 +0,0 @@ -CHART_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; 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()) diff --git a/chart2/source/view/view.map b/chart2/source/view/view.map deleted file mode 100644 index d86ffaa9bdd4..000000000000 --- a/chart2/source/view/view.map +++ /dev/null @@ -1,9 +0,0 @@ -CHART_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - - local: - *; -}; |