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

List:       kde-commits
Subject:    koffice/kchart/shape
From:       Johannes Simon <johannes.simon () gmail ! com>
Date:       2008-07-31 21:35:35
Message-ID: 1217540135.275309.13561.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 840336 by jsimon:

o Only paint helper outline if frame has no border() property set
o Always pass KoShapeLoadingContext to loadOdf*() methods (instead of just the \
KoOdfStylesReader)


 M  +20 -8     ChartShape.cpp  
 M  +2 -4      ChartShape.h  


--- trunk/koffice/kchart/shape/ChartShape.cpp #840335:840336
@@ -58,6 +58,8 @@
 #include <KoShapeManager.h>
 #include <KoSelection.h>
 #include <KoShapeBackground.h>
+#include <KoInsets.h>
+#include <KoShapeBorderModel.h>
 
 // KDChart
 #include <KDChartChart>
@@ -747,6 +749,15 @@
     Q_ASSERT( canvas );
     if ( canvas->shapeManager()->selection()->selectedShapes().contains( this ) )
         return;
+    if ( border() )
+    {
+        KoInsets insets;
+        border()->borderInsets( this, insets );
+        if ( insets.top > 0.0 || insets.bottom > 0.0
+             || insets.left > 0.0 || insets.right > 0.0 )
+            return;
+    }
+    
     QRectF border = QRectF( QPointF( -1.5, -1.5 ),
                             converter.documentToView( size() ) + QSizeF( 1.5, 1.5 ) \
);  
@@ -872,12 +883,10 @@
     return res;
 }
 
-bool ChartShape::loadOdf( const KoXmlElement &chartElement, KoShapeLoadingContext \
&context ) +bool ChartShape::loadOdf( const KoXmlElement &element, \
KoShapeLoadingContext &context )  {
-    qDebug() << "+++ LOADING" << chartElement.tagName();
-    loadOdfAttributes( chartElement, context, OdfAllAttributes );
-    
-    return loadOdfFrame( chartElement, context );
+    loadOdfAttributes( element, context, OdfTransformation | OdfSize );
+    return loadOdfFrame( element, context );
 }
 
 bool ChartShape::loadOdfFrameElement( const KoXmlElement &element, \
KoShapeLoadingContext &context ) @@ -889,8 +898,11 @@
     return false;
 }
 
-bool ChartShape::loadOdfEmbedded( const KoXmlElement &chartElement, const \
KoOdfStylesReader &stylesReader ) +bool ChartShape::loadOdfEmbedded( const \
KoXmlElement &chartElement, KoShapeLoadingContext &context )  {
+    loadOdfAttributes( chartElement, context, OdfAdditionalAttributes | \
OdfMandatories | OdfCommonChildElements ); +    
+    KoOdfStylesReader &stylesReader = context.odfLoadingContext().stylesReader();
     // Check if we're loading an embedded document
     if ( !chartElement.hasAttributeNS( KoXmlNS::chart, "class" ) ) {
         qDebug() << "Error: Embedded document has no chart:class attribute.";
@@ -951,7 +963,7 @@
     KoXmlElement legendElem = KoXml::namedItemNS( chartElement, KoXmlNS::chart,
                           "legend" );
     if ( !legendElem.isNull() ) {
-    if ( !d->legend->loadOdf( legendElem, stylesReader ) )
+    if ( !d->legend->loadOdf( legendElem, context ) )
         return false;
     }
     d->legend->update();
@@ -968,7 +980,7 @@
     KoXmlElement  plotareaElem = KoXml::namedItemNS( chartElement,
                              KoXmlNS::chart, "plot-area" );
     if ( !plotareaElem.isNull() ) {
-    if ( !d->plotArea->loadOdf( plotareaElem, stylesReader ) )
+    if ( !d->plotArea->loadOdf( plotareaElem, context ) )
         return false;
     }
     
--- trunk/koffice/kchart/shape/ChartShape.h #840335:840336
@@ -140,14 +140,12 @@
     void paintDecorations( QPainter &painter, const KoViewConverter &converter, \
const KoCanvasBase *canvas );  
     /// reimplemented
-    bool loadOdf( const KoXmlElement &chartElement, KoShapeLoadingContext &context \
); +    bool loadOdf( const KoXmlElement &element, KoShapeLoadingContext &context );
     bool loadOdfFrameElement( const KoXmlElement &element, KoShapeLoadingContext \
                &context );
     bool loadOdfData( const KoXmlElement &tableElement, const KoOdfStylesReader \
&stylesReader );  
     bool loadEmbeddedDocument( KoStore *store, const KoXmlElement &objectElement, \
                const KoXmlDocument &manifestDocument );
-    
-    // FIXME: loadOdfFrame() should be called by KoLibs, not loadOdf()
-    bool loadOdfEmbedded( const KoXmlElement &chartElement, const KoOdfStylesReader \
&stylesReader ); +    bool loadOdfEmbedded( const KoXmlElement &chartElement, \
KoShapeLoadingContext &context );  /// reimplemented
     void saveOdf( KoShapeSavingContext &context ) const;
     void saveOdfData( KoXmlWriter &bodyWriter, KoGenStyles &mainStyles ) const;


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

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