[rkward-cvs] SF.net SVN: rkward:[2880] trunk/rkward/rkward/core

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Jun 15 16:25:12 UTC 2010


Revision: 2880
          http://rkward.svn.sourceforge.net/rkward/?rev=2880&view=rev
Author:   tfry
Date:     2010-06-15 16:25:12 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
some corrections

Modified Paths:
--------------
    trunk/rkward/rkward/core/renvironmentobject.cpp
    trunk/rkward/rkward/core/rkrownames.cpp

Modified: trunk/rkward/rkward/core/renvironmentobject.cpp
===================================================================
--- trunk/rkward/rkward/core/renvironmentobject.cpp	2010-06-15 12:51:19 UTC (rev 2879)
+++ trunk/rkward/rkward/core/renvironmentobject.cpp	2010-06-15 16:25:12 UTC (rev 2880)
@@ -117,7 +117,7 @@
 	for (int i = childmap.size () - 1; i >= 0; --i) {
 		RObject *object = childmap[i];
 		if (!current_symbols.contains (object->getShortName ())) {
-			if (!object->isPending ()) if (!(RKGlobals::tracker ()->removeObject (object, 0, true))) debug_baseline++;
+			if (object->isPending () || (!(RKGlobals::tracker ()->removeObject (object, 0, true)))) debug_baseline++;
 		}
 	}
 

Modified: trunk/rkward/rkward/core/rkrownames.cpp
===================================================================
--- trunk/rkward/rkward/core/rkrownames.cpp	2010-06-15 12:51:19 UTC (rev 2879)
+++ trunk/rkward/rkward/core/rkrownames.cpp	2010-06-15 16:25:12 UTC (rev 2880)
@@ -36,6 +36,8 @@
 	setDataType (RObject::DataCharacter);
 	check_duplicates = true;
 	is_sequential_up_to_row = -1;
+
+	name = i18n ("row names");
 }
 
 RKRowNames::~RKRowNames () {
@@ -78,7 +80,7 @@
 
 	lockSyncing (true);
 
-	RKVariable::setText (row, QString());	// don't get in the way of duplicate checking!
+	data->cell_strings[row] = QString ();	// don't get in the way of duplicate checking!
 	QString real_text = text;
 	if (real_text.isEmpty ()) {
 		if (isSequential ()) {
@@ -88,16 +90,26 @@
 		}
 	}
 
+	bool was_sequential_row = false;
 	if (is_sequential_up_to_row >= (row - 1)) {
 		if (real_text == QString::number (row + 1)) {
 			if (makeUnique (&real_text, true)) {
 				is_sequential_up_to_row = qMax (row, is_sequential_up_to_row);
+				was_sequential_row = true;
+				if (is_sequential_up_to_row == row) {
+					// even more sequential numbers after this?
+					for (int i = row + 1; i < getLength (); ++i) {
+						if (data->cell_strings[i] != QString::number (i + 1)) break;
+						is_sequential_up_to_row = i;
+					}
+				}
 			}
 		}
 	}
 
-	if (is_sequential_up_to_row < row) {
+	if (!was_sequential_row) {
 		makeUnique (&real_text, false);
+		is_sequential_up_to_row = qMin (row - 1, is_sequential_up_to_row);
 	}
 	RKVariable::setText (row, real_text);
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list