[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kchart/shape
From:       Carlos Licea <carlos_licea () hotmail ! com>
Date:       2010-03-31 22:25:07
Message-ID: 20100331222507.4401FAC888 () svn ! kde ! org
[Download RAW message or body]

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" ) )
     {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic