SVN commit 1109734 by clicea: Don't keep around the default axes when loading from ODF. ccmail:boud@valdyas.org M +24 -1 PlotArea.cpp --- trunk/koffice/kchart/shape/PlotArea.cpp #1109733:1109734 @@ -547,7 +547,16 @@ // First step is to load the axis. Datasets are attached to an // axis and we need the axis to check for categories. - d->initAxes(); + + //remove the default axes first + while( !d->axes.isEmpty() ) { + Axis *axis = d->axes.takeLast(); + Q_ASSERT( axis ); + if ( axis->title() ) + d->automaticallyHiddenAxisTitles.removeAll( axis->title() ); + delete axis; + } + KoXmlElement n; forEachElement ( n, plotAreaElement ) { if ( n.namespaceURI() != KoXmlNS::chart ) @@ -560,6 +569,20 @@ } } + //2 axes are mandatory, check that we have them + if( !xAxis() ) { + Axis *xAxis = new Axis( this ); + xAxis->setPosition( BottomAxisPosition ); + xAxis->setVisible( false ); + addAxis( xAxis ); + } + if( !yAxis() ) { + Axis *yAxis = new Axis( this ); + yAxis->setPosition( LeftAxisPosition ); + yAxis->setVisible( false ); + addAxis( yAxis ); + } + CellRegion cellRangeAddress; if ( plotAreaElement.hasAttributeNS( KoXmlNS::table, "cell-range-address" ) ) {