*** orig/xmloff/source/chart/SchXMLPlotAreaContext.cxx Fri Jun 6 16:49:06 2008 --- new/xmloff/source/chart/SchXMLPlotAreaContext.cxx Fri Aug 29 11:23:24 2008 *************** *** 513,518 **** --- 513,519 ---- { bool bAddMissingXAxisForNetCharts = false; bool bAdaptWrongPercentScaleValues = false; + bool bAdaptAxisOrientationForBarCharts = false; if( SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan2_3( GetImport().GetModel() ) ) { //correct errors from older versions *************** *** 525,534 **** //Issue 59288 if( mbPercentStacked ) bAdaptWrongPercentScaleValues = true; } ! pContext = new SchXMLAxisContext( mrImportHelper, GetImport(), rLocalName, ! mxDiagram, maAxes, mrCategoriesAddress, bAddMissingXAxisForNetCharts, bAdaptWrongPercentScaleValues ); } break; --- 526,539 ---- //Issue 59288 if( mbPercentStacked ) bAdaptWrongPercentScaleValues = true; + + //issue74660 + if( maChartTypeServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.ColumnChartType" )) ) + bAdaptAxisOrientationForBarCharts = true; } ! pContext = new SchXMLAxisContext( mrImportHelper, GetImport(), rLocalName, mxDiagram, maAxes, mrCategoriesAddress, ! bAddMissingXAxisForNetCharts, bAdaptWrongPercentScaleValues, bAdaptAxisOrientationForBarCharts ); } break; *************** *** 692,705 **** std::vector< SchXMLAxis >& aAxes, ::rtl::OUString & rCategoriesAddress, bool bAddMissingXAxisForNetCharts, ! bool bAdaptWrongPercentScaleValues ) : SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ), mrImportHelper( rImpHelper ), mxDiagram( xDiagram ), maAxes( aAxes ), mrCategoriesAddress( rCategoriesAddress ), mbAddMissingXAxisForNetCharts( bAddMissingXAxisForNetCharts ), ! mbAdaptWrongPercentScaleValues( bAdaptWrongPercentScaleValues ) { } --- 697,712 ---- std::vector< SchXMLAxis >& aAxes, ::rtl::OUString & rCategoriesAddress, bool bAddMissingXAxisForNetCharts, ! bool bAdaptWrongPercentScaleValues, ! bool bAdaptAxisOrientationForBarCharts ) : SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ), mrImportHelper( rImpHelper ), mxDiagram( xDiagram ), maAxes( aAxes ), mrCategoriesAddress( rCategoriesAddress ), mbAddMissingXAxisForNetCharts( bAddMissingXAxisForNetCharts ), ! mbAdaptWrongPercentScaleValues( bAdaptWrongPercentScaleValues ), ! mbAdaptAxisOrientationForBarCharts( bAdaptAxisOrientationForBarCharts ) { } *************** *** 1167,1172 **** --- 1174,1215 ---- , uno::makeAny(drawing::LineStyle_NONE)); } } + + if( mbAdaptAxisOrientationForBarCharts && maCurrentAxis.eClass == SCH_XML_AXIS_X ) + { + bool bIs3DChart = false; + uno::Reference< beans::XPropertySet > xProp( mxDiagram, uno::UNO_QUERY ); + if( xProp.is() && ( xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dim3D"))) >>= bIs3DChart ) + && !bIs3DChart ) + { + uno::Reference< chart2::XChartDocument > xChart2Document( GetImport().GetModel(), uno::UNO_QUERY ); + if( xChart2Document.is() ) + { + uno::Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xChart2Document->getFirstDiagram(), uno::UNO_QUERY ); + if( xCooSysCnt.is() ) + { + uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() ); + if( aCooSysSeq.getLength() ) + { + bool bSwapXandYAxis = false; + uno::Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] ); + uno::Reference< beans::XPropertySet > xCooSysProp( xCooSys, uno::UNO_QUERY ); + if( xCooSysProp.is() && ( xCooSysProp->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SwapXAndYAxis"))) >>= bSwapXandYAxis ) + && bSwapXandYAxis ) + { + uno::Reference< chart2::XAxis > xAxis = xCooSys->getAxisByDimension( 0, maCurrentAxis.nIndexInCategory ); + if( xAxis.is() ) + { + chart2::ScaleData aScaleData; + aScaleData.Orientation = chart2::AxisOrientation_REVERSE; + xAxis->setScaleData( aScaleData ); + } + } + } + } + } + } + } } } } *** orig/xmloff/source/chart/SchXMLPlotAreaContext.hxx Fri Apr 11 05:24:20 2008 --- new/xmloff/source/chart/SchXMLPlotAreaContext.hxx Thu Aug 28 16:55:20 2008 *************** *** 146,151 **** --- 146,152 ---- rtl::OUString& mrCategoriesAddress; bool mbAddMissingXAxisForNetCharts; //to correct errors from older versions bool mbAdaptWrongPercentScaleValues; //to correct errors from older versions + bool mbAdaptAxisOrientationForBarCharts; //to correct errors from older versions ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getTitleShape(); void CreateGrid( ::rtl::OUString sAutoStyleName, sal_Bool bIsMajor ); *************** *** 159,165 **** std::vector< SchXMLAxis >& aAxes, ::rtl::OUString& rCategoriesAddress, bool bAddMissingXAxisForNetCharts, ! bool bAdaptWrongPercentScaleValues ); virtual ~SchXMLAxisContext(); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); --- 160,167 ---- std::vector< SchXMLAxis >& aAxes, ::rtl::OUString& rCategoriesAddress, bool bAddMissingXAxisForNetCharts, ! bool bAdaptWrongPercentScaleValues, ! bool bAdaptAxisOrientationForBarCharts ); virtual ~SchXMLAxisContext(); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );