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

List:       kde-commits
Subject:    [calligra/frameworks] filters/libmsooxml: fix compile error
From:       Sven Langkamp <sven.langkamp () gmail ! com>
Date:       2015-03-28 22:04:48
Message-ID: E1YbyqW-0007v9-HV () scm ! kde ! org
[Download RAW message or body]

Git commit e33f0050cd737e5e6db023b64540ace9c60b2d13 by Sven Langkamp.
Committed on 28/03/2015 at 22:03.
Pushed by langkamp into branch 'frameworks'.

fix compile error

M  +30   -17   filters/libmsooxml/MsooXmlDiagramReader_p.cpp

http://commits.kde.org/calligra/e33f0050cd737e5e6db023b64540ace9c60b2d13

diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp \
b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp index 427e0c1..eb0c28d 100644
--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
@@ -911,26 +911,35 @@ void LayoutNodeAtom::writeAtom(Context* context, KoXmlWriter* \
xmlWriter, KoGenSt  QList< QExplicitlySharedDataPointer<ConstraintAtom> > \
LayoutNodeAtom::constraints() const {  QList< \
                QExplicitlySharedDataPointer<ConstraintAtom> > result;
     foreach( QExplicitlySharedDataPointer<AbstractAtom> atom, m_children )
-        if ( dynamic_cast< ConstraintAtom* >( atom.data() ) ) {
-            result.append(atom);
+    {
+        ConstraintAtom* constraintAtom = dynamic_cast< ConstraintAtom* >( \
atom.data() ); +        if ( constraintAtom ) {
+            result.append( \
                QExplicitlySharedDataPointer<ConstraintAtom>(constraintAtom));
         } else if (ListAtom *list = dynamic_cast< ListAtom* >( atom.data() ) ) {
-            foreach( QExplicitlySharedDataPointer<AbstractAtom> val, \
                list->children() )
-                if ( dynamic_cast< ConstraintAtom* >( val.data() ) )
-                    result.append(val);
+            foreach( QExplicitlySharedDataPointer<AbstractAtom> val, \
list->children() ) { +                constraintAtom =  dynamic_cast< ConstraintAtom* \
>( val.data() ); +                if ( constraintAtom )
+                    \
result.append(QExplicitlySharedDataPointer<ConstraintAtom>(constraintAtom)); +        \
}  }
+    }
     return result;
 }
 
 QList< QExplicitlySharedDataPointer<ShapeAtom> > LayoutNodeAtom::shapes() const {
     QList< QExplicitlySharedDataPointer<ShapeAtom> > result;
-    foreach( QExplicitlySharedDataPointer<AbstractAtom> atom, m_children )
-        if ( dynamic_cast< ShapeAtom* >( atom.data() ) ) {
-            result.append(atom);
+    foreach( QExplicitlySharedDataPointer<AbstractAtom> atom, m_children ) {
+        ShapeAtom* shapeAtom = dynamic_cast< ShapeAtom* >( atom.data() );
+        if ( shapeAtom ) {
+            result.append(QExplicitlySharedDataPointer<ShapeAtom>(dynamic_cast< \
                ShapeAtom* >( atom.data() )));
         } else if (ListAtom *list = dynamic_cast< ListAtom* >( atom.data() ) ) {
-            foreach( QExplicitlySharedDataPointer<AbstractAtom> val, \
                list->children() )
-                if ( dynamic_cast< ShapeAtom* >( val.data() ) )
-                    result.append(val);
+            foreach( QExplicitlySharedDataPointer<AbstractAtom> val, \
list->children() ) { +                shapeAtom = dynamic_cast< ShapeAtom* >( \
val.data() ); +                if ( shapeAtom )
+                    \
result.append(QExplicitlySharedDataPointer<ShapeAtom>(shapeAtom)); +            }
         }
+    }
     return result;
 }
 
@@ -1607,14 +1616,18 @@ ShapeAtom* ShapeAtom::clone(Context* context) {
 
 QList< QExplicitlySharedDataPointer<AdjustAtom> > ShapeAtom::adjustments() const {
     QList< QExplicitlySharedDataPointer<AdjustAtom> > result;
-    foreach( QExplicitlySharedDataPointer<AbstractAtom> atom, m_children )
-        if ( dynamic_cast< AdjustAtom* >( atom.data() ) ) {
-            result.append(atom);
+    foreach( QExplicitlySharedDataPointer<AbstractAtom> atom, m_children ) {
+        AdjustAtom* adjustedAtom = dynamic_cast< AdjustAtom* >( atom.data() );
+        if ( adjustedAtom ) {
+            result.append(QExplicitlySharedDataPointer<AdjustAtom>(adjustedAtom));
         } else if (ListAtom *list = dynamic_cast< ListAtom* >( atom.data() ) ) {
-            foreach( QExplicitlySharedDataPointer<AbstractAtom> val, \
                list->children() )
-                if ( dynamic_cast< AdjustAtom* >( val.data() ) )
-                    result.append(val);
+            foreach( QExplicitlySharedDataPointer<AbstractAtom> val, \
list->children() ) { +                adjustedAtom = dynamic_cast< AdjustAtom* >( \
val.data() ); +                if ( adjustedAtom )
+                    \
result.append(QExplicitlySharedDataPointer<AdjustAtom>(adjustedAtom)); +	    }
         }
+    }
     return result;
 }
 


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

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