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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Jan 12 11:55:13 UTC 2011


Revision: 3360
          http://rkward.svn.sourceforge.net/rkward/?rev=3360&view=rev
Author:   tfry
Date:     2011-01-12 11:55:13 +0000 (Wed, 12 Jan 2011)

Log Message:
-----------
Fix offset in column insertion.

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2011-01-12 11:46:19 UTC (rev 3359)
+++ trunk/rkward/ChangeLog	2011-01-12 11:55:13 UTC (rev 3360)
@@ -1,3 +1,4 @@
+- Fixed: New columns would be always be added to the right, instead of to the left, in the data editor
 - Fixed: Would crash when trying to edit 0 row data.frame
 - Fixed: Output generated by external processes (system()) was not shown on the console
 - Fixed: Converting a variable to factor in the editor would drop existing levels, silently, and lead to NAs

Modified: trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp
===================================================================
--- trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp	2011-01-12 11:46:19 UTC (rev 3359)
+++ trunk/rkward/rkward/dataeditor/rkvareditmodel.cpp	2011-01-12 11:55:13 UTC (rev 3360)
@@ -806,11 +806,11 @@
 	if (column > trueCols ()) column = trueCols ();
 	if (column < var_col_offset) column = var_col_offset;
 	for (int col = column; col < (column + count); ++col) {
-		RObject *obj = dataframe->createPendingChild (dataframe->validizeName (QString ()), col);
+		RObject *obj = dataframe->createPendingChild (dataframe->validizeName (QString ()), col-var_col_offset);
 		RK_ASSERT (obj->isVariable ());
 //		addObject (col, obj);	// the object will be added via RKModificationTracker::addObject -> this::childAdded. That will also take care of calling beginInsertColumns()/endInsertColumns()
 	
-		RKGlobals::rInterface ()->issueCommand (new RCommand (".rk.data.frame.insert.column (" + dataframe->getFullName () + ", \"" + obj->getShortName () + "\", " + QString::number (col+1) + ")", RCommand::App | RCommand::Sync));
+		RKGlobals::rInterface ()->issueCommand (new RCommand (".rk.data.frame.insert.column (" + dataframe->getFullName () + ", \"" + obj->getShortName () + "\", " + QString::number (col+1-var_col_offset) + ")", RCommand::App | RCommand::Sync));
 	}
 
 	return true;


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