*** Orig\chart2\source\view\main\ChartView.cxx Fri Mar 6 09:14:30 2009 --- New\chart2\source\view\main\ChartView.cxx Thu Mar 5 15:40:16 2009 *************** *** 1790,1795 **** --- 1790,1842 ---- } } } + + if( !nNumberFormatKey ) + { + Reference< XChartTypeContainer > xCTCnt( xCorrespondingCoordinateSystem, uno::UNO_QUERY_THROW ); + if( xCTCnt.is() ) + { + bool bSeriesAttachedToThisAxis = false; + sal_Int32 nAttachedAxisIndex = -1; + sal_Int32 nDimensionIndex = 1; + sal_Int32 nAxisIndex = 0; + AxisHelper::getIndicesForAxis( xAxis, xCorrespondingCoordinateSystem, nDimensionIndex, nAxisIndex ); + Sequence< Reference< XChartType > > aChartTypes( xCTCnt->getChartTypes()); + for( sal_Int32 nCTIdx=0; nCTIdx xDSCnt( aChartTypes[nCTIdx], uno::UNO_QUERY_THROW ); + Sequence< Reference< XDataSeries > > aDataSeriesSeq( xDSCnt->getDataSeries()); + for( sal_Int32 nSeriesIdx=0; nSeriesIdx xDataSeries(aDataSeriesSeq[nSeriesIdx]); + if( nDimensionIndex == 1 ) + { + sal_Int32 nCurrentIndex = DataSeriesHelper::getAttachedAxisIndex( xDataSeries ); + if( nAxisIndex == nCurrentIndex ) + { + bSeriesAttachedToThisAxis = true; + break; + } + else if( nAttachedAxisIndex<0 || nAttachedAxisIndex>nCurrentIndex ) + nAttachedAxisIndex = nCurrentIndex; + } + } + } + + if( !bSeriesAttachedToThisAxis && nAttachedAxisIndex >= 0 ) + { + Reference< XAxis > xAxisSource( AxisHelper::getAxis( 1, nAttachedAxisIndex, xCorrespondingCoordinateSystem ) ); + if( xAxisSource.is() ) + { + sal_Int32 nNumberFormatKeySource(0); + nNumberFormatKeySource = getExplicitNumberFormatKeyForAxis( xAxisSource, xCorrespondingCoordinateSystem, xNumberFormatsSupplier ); + if( nNumberFormatKeySource ) + nNumberFormatKey = nNumberFormatKeySource; + } + } + } + } + return nNumberFormatKey; }