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

List:       kde-commits
Subject:    kdeextragear-2/kst/kst
From:       George Staikos <staikos () kde ! org>
Date:       2004-10-22 14:22:22
Message-ID: 20041022142222.DC35816B8B () office ! kde ! org
[Download RAW message or body]

CVS commit by staikos: 

Now I know how to trigger this assert, but it doesn't look like there's an
easy way around it for now.  We just have to deal with null xVector in the
equation nodes for now.  This change -might- break loading of equations with
plugins that use "x".


  M +6 -0      enodes.cpp   1.27
  M +3 -1      kstequation.cpp   1.11


--- kdeextragear-2/kst/kst/enodes.cpp  #1.26:1.27
@@ -365,4 +365,9 @@ KstObject::UpdateType Function::update(i
         Identifier *pn = dynamic_cast<Identifier*>(_args->node(cnt + 1));
         if (pn && 0 == strcmp(pn->name(), "x")) {
+          if (!ctx->xVector) {
+            _outputIndex = -424242;
+            // Hope we recover later
+            return KstObject::NO_CHANGE;
+          }
           _inVectors[vitcnt] = ctx->xVector->value();
           _inArrayLens[vitcnt++] = ctx->xVector->length();
@@ -620,4 +625,5 @@ void Data::collectVectors(KstVectorList&
 
 KstObject::UpdateType Data::update(int counter, Context *ctx) {
+  Q_UNUSED(ctx)
   if (_vector) {
     return _vector->update(counter);

--- kdeextragear-2/kst/kst/kstequation.cpp  #1.10:1.11
@@ -226,6 +226,8 @@ void KstEquation::save(QTextStream &ts, 
 }
 
+
 void KstEquation::setEquation(const QString& in_fn) {
-  assert(*_xVector);
+  // assert(*_xVector); - ugly, we have to allow this here due to
+  // document loading with vector lazy-loading
   _equation = in_fn;
   VectorsUsed.clear();


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

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