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

List:       kde-commits
Subject:    KDE/kdeedu/kig/misc
From:       Maurizio Paolini <paolini () dmf ! unicatt ! it>
Date:       2008-03-11 7:34:23
Message-ID: 1205220863.552979.7199.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 784387 by paolini:

patched bug 157736 (not ideal, but...)



 M  +10 -4     object_hierarchy.cc  


--- trunk/KDE/kdeedu/kig/misc/object_hierarchy.cc #784386:784387
@@ -694,11 +694,17 @@
 // basically means: return the type that inherits the other type,
 // because if another type inherits the lowermost type, then it will
 // also inherit the other..
-const ObjectImpType* lowermost( const ObjectImpType* a, const ObjectImpType* b )
+// mp: if a and b are not directly comparable, as a last resort return c, 
+// which is the "actual" ImpType of the object (see bug #157736 on
+// bugs.kde.org)
+const ObjectImpType* lowermost( const ObjectImpType* a, const ObjectImpType* b,
+			        const ObjectImpType* c )
 {
   if ( a->inherits( b ) ) return a;
-  assert( b->inherits( a ) );
-  return b;
+  if ( b->inherits( a ) ) return b;
+  assert( c-> inherits( a ) );
+  assert( c-> inherits( b ) );
+  return c;  // this is a last resort!
 }
 
 // this function is part of the visit procedure really.  It is
@@ -736,7 +742,7 @@
 
       margrequirements[pl[i]] =
         lowermost( margrequirements[pl[i]],
-                   o->impRequirement( parent, opl ) );
+                   o->impRequirement( parent, opl ), parent->imp()->type() );
       musetexts[pl[i]] = margrequirements[pl[i]]->selectStatement();
     };
   };
[prev in list] [next in list] [prev in thread] [next in thread] 

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