? i91963.patch ? model/main/ImplChartModel_1.cxx ? model/main/ImplChartModel_2.cxx Index: controller/dialogs/ChartTypeDialogController.cxx =================================================================== RCS file: /cvs/graphics/chart2/source/controller/dialogs/ChartTypeDialogController.cxx,v retrieving revision 1.6 diff -c -r1.6 ChartTypeDialogController.cxx *** controller/dialogs/ChartTypeDialogController.cxx 10 Apr 2008 19:41:41 -0000 1.6 --- controller/dialogs/ChartTypeDialogController.cxx 14 Nov 2008 10:54:30 -0000 *************** *** 41,46 **** --- 41,47 ---- #include "ChartModelHelper.hxx" #include "DiagramHelper.hxx" #include "ControllerLockGuard.hxx" + #include "AxisHelper.hxx" #include #include *************** *** 53,58 **** --- 54,61 ---- #include // header for class Bitmap #include + #include + #include //............................................................................. *************** *** 358,363 **** --- 361,368 ---- if( aTemplateWithService.first.is()) aTemplateWithService.first->resetStyles( xDiagram ); xTemplate->changeDiagram( xDiagram ); + if( Application::GetSettings().GetLayoutRTL() ) + AxisHelper::setRTLAxisLayout( AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 ) ); if( rParameter.b3DLook ) ThreeDHelper::setScheme( xDiagram, rParameter.eThreeDLookScheme ); Index: inc/AxisHelper.hxx =================================================================== RCS file: /cvs/graphics/chart2/source/inc/AxisHelper.hxx,v retrieving revision 1.4 diff -c -r1.4 AxisHelper.hxx *** inc/AxisHelper.hxx 10 Apr 2008 20:58:52 -0000 1.4 --- inc/AxisHelper.hxx 14 Nov 2008 10:54:30 -0000 *************** *** 210,215 **** --- 210,218 ---- ::com::sun::star::chart2::XChartType > getChartTypeByIndex( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem >& xCooSys, sal_Int32 nIndex ); + + static void setRTLAxisLayout( const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XCoordinateSystem >& xCooSys ); }; //............................................................................. Index: model/main/ImplChartModel.cxx =================================================================== RCS file: /cvs/graphics/chart2/source/model/main/ImplChartModel.cxx,v retrieving revision 1.17 diff -c -r1.17 ImplChartModel.cxx *** model/main/ImplChartModel.cxx 10 Apr 2008 21:41:19 -0000 1.17 --- model/main/ImplChartModel.cxx 14 Nov 2008 10:54:30 -0000 *************** *** 45,55 **** --- 45,57 ---- #include "DisposeHelper.hxx" #include "UndoManager.hxx" #include "ThreeDHelper.hxx" + #include "AxisHelper.hxx" // header for class SvNumberFormatter #include // header for class SvNumberFormatsSupplierObj #include + #include #include #include #include *************** *** 455,460 **** --- 457,467 ---- AppendDiagram( xDiagram ); + bool bIsRTL = Application::GetSettings().GetLayoutRTL(); + //reverse x axis for rtl charts + if( bIsRTL ) + AxisHelper::setRTLAxisLayout( AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 ) ); + // create and attach legend Reference< chart2::XLegend > xLegend( m_xContext->getServiceManager()->createInstanceWithContext( Index: tools/AxisHelper.cxx =================================================================== RCS file: /cvs/graphics/chart2/source/tools/AxisHelper.cxx,v retrieving revision 1.4 diff -c -r1.4 AxisHelper.cxx *** tools/AxisHelper.cxx 10 Apr 2008 22:00:53 -0000 1.4 --- tools/AxisHelper.cxx 14 Nov 2008 10:54:30 -0000 *************** *** 38,43 **** --- 38,45 ---- #include "AxisIndexDefines.hxx" #include "LineProperties.hxx" #include "ContainerHelper.hxx" + #include "servicenames_coosystems.hxx" + #include #include #include *************** *** 787,792 **** --- 789,862 ---- return xChartType; } + void AxisHelper::setRTLAxisLayout( const Reference< XCoordinateSystem >& xCooSys ) + { + if( xCooSys.is() ) + { + bool bCartesian = xCooSys->getViewServiceName().equals( CHART2_COOSYSTEM_CARTESIAN_VIEW_SERVICE_NAME ); + if( bCartesian ) + { + bool bVertical = false; + Reference< beans::XPropertySet > xCooSysProp( xCooSys, uno::UNO_QUERY ); + if( xCooSysProp.is() ) + xCooSysProp->getPropertyValue( C2U("SwapXAndYAxis") ) >>= bVertical; + + sal_Int32 nHorizontalAxisDimension = bVertical ? 1 : 0; + sal_Int32 nVerticalAxisDimension = bVertical ? 0 : 1; + + try + { + //reverse direction for horizontal main axis + Reference< chart2::XAxis > xHorizontalMainAxis( AxisHelper::getAxis( nHorizontalAxisDimension, MAIN_AXIS_INDEX, xCooSys ) ); + if( xHorizontalMainAxis.is() ) + { + chart2::ScaleData aScale = xHorizontalMainAxis->getScaleData(); + aScale.Orientation = chart2::AxisOrientation_REVERSE; + xHorizontalMainAxis->setScaleData(aScale); + } + + //mathematical direction for vertical main axis + Reference< chart2::XAxis > xVerticalMainAxis( AxisHelper::getAxis( nVerticalAxisDimension, MAIN_AXIS_INDEX, xCooSys ) ); + if( xVerticalMainAxis.is() ) + { + chart2::ScaleData aScale = xVerticalMainAxis->getScaleData(); + aScale.Orientation = chart2::AxisOrientation_MATHEMATICAL; + xVerticalMainAxis->setScaleData(aScale); + } + } + catch( uno::Exception & ex ) + { + ASSERT_EXCEPTION( ex ); + } + + try + { + //reverse direction for horizontal secondary axis + Reference< chart2::XAxis > xHorizontalSecondaryAxis( AxisHelper::getAxis( nHorizontalAxisDimension, SECONDARY_AXIS_INDEX, xCooSys ) ); + if( xHorizontalSecondaryAxis.is() ) + { + chart2::ScaleData aScale = xHorizontalSecondaryAxis->getScaleData(); + aScale.Orientation = chart2::AxisOrientation_REVERSE; + xHorizontalSecondaryAxis->setScaleData(aScale); + } + + //mathematical direction for vertical secondary axis + Reference< chart2::XAxis > xVerticalSecondaryAxis( AxisHelper::getAxis( nVerticalAxisDimension, SECONDARY_AXIS_INDEX, xCooSys ) ); + if( xVerticalSecondaryAxis.is() ) + { + chart2::ScaleData aScale = xVerticalSecondaryAxis->getScaleData(); + aScale.Orientation = chart2::AxisOrientation_MATHEMATICAL; + xVerticalSecondaryAxis->setScaleData(aScale); + } + } + catch( uno::Exception & ex ) + { + ASSERT_EXCEPTION( ex ); + } + } + } + } + //............................................................................. } //namespace chart //.............................................................................