[rkward-cvs] SF.net SVN: rkward:[2434] branches/release_branch_0.4.9

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Mar 31 17:33:48 UTC 2009


Revision: 2434
          http://rkward.svn.sourceforge.net/rkward/?rev=2434&view=rev
Author:   tfry
Date:     2009-03-31 17:33:48 +0000 (Tue, 31 Mar 2009)

Log Message:
-----------
Merge 2433 from trunk

Modified Paths:
--------------
    branches/release_branch_0.4.9/ChangeLog
    branches/release_branch_0.4.9/rkward/core/rkvariable.cpp
    branches/release_branch_0.4.9/rkward/core/rkvariable.h

Property Changed:
----------------
    branches/release_branch_0.4.9/rkward/

Modified: branches/release_branch_0.4.9/ChangeLog
===================================================================
--- branches/release_branch_0.4.9/ChangeLog	2009-03-31 16:48:27 UTC (rev 2433)
+++ branches/release_branch_0.4.9/ChangeLog	2009-03-31 17:33:48 UTC (rev 2434)
@@ -1,8 +1,10 @@
---- Version 0.4.9?? - Feb-20-2009
-- Extended Boxplot
-- little code change in Barplot
+--- Version 0.4.9b - ???????????
+- Fix crash while inserting rows in a data.frame with string variables
+- Fix immediate crash issue with R 2.9.0 (requires recompilation against R 2.9)
 - Fix device window capturing with R 2.8.0
-- added bunch of irt analysis an plot plug-ins by meik michalke
+- Extended boxplot plugin
+- Support data.frames in barplot plugin
+- New set of plugins: Item Response Theory (by Meik Michalke)
 
 --- Version 0.4.9a - Apr-20-2008
 - Support from compilation with R 2.7


Property changes on: branches/release_branch_0.4.9/rkward
___________________________________________________________________
Added: svn:mergeinfo
   + /trunk/rkward/rkward:2433

Modified: branches/release_branch_0.4.9/rkward/core/rkvariable.cpp
===================================================================
--- branches/release_branch_0.4.9/rkward/core/rkvariable.cpp	2009-03-31 16:48:27 UTC (rev 2433)
+++ branches/release_branch_0.4.9/rkward/core/rkvariable.cpp	2009-03-31 17:33:48 UTC (rev 2434)
@@ -408,7 +408,7 @@
 		RK_ASSERT (myData ()->cell_doubles == 0);
 		QString *new_data = new QString[target];
 		if (myData ()->allocated_length) {		// if not yet allocated, don't mem-move
-			qmemmove (new_data, myData ()->cell_strings, myData ()->allocated_length * sizeof (QString));
+			memMoveQStrings (new_data, myData ()->cell_strings, myData ()->allocated_length);
 		}
 		delete [] (myData ()->cell_strings);
 		myData ()->cell_strings = new_data;
@@ -712,7 +712,7 @@
 
 	if (to_row < (myData ()->allocated_length - 1)) {	// not the last rows
 		if (myData ()->cell_strings) {
-			qmemmove (&(myData ()->cell_strings[from_row]), &(myData ()->cell_strings[to_row+1]), (myData ()->allocated_length - to_row - 1) * sizeof (QString));
+			memMoveQStrings (&(myData ()->cell_strings[from_row]), &(myData ()->cell_strings[to_row+1]), myData ()->allocated_length - to_row - 1);
 		} else {
 			qmemmove (&(myData ()->cell_doubles[from_row]), &(myData ()->cell_doubles[to_row+1]), (myData ()->allocated_length - to_row - 1) * sizeof (double));
 		}
@@ -764,7 +764,7 @@
 		if (myData ()->cell_doubles) myData ()->cell_doubles[row+count] = 0.0;
 		myData ()->cell_states[row+count] = RKVarEditData::NA;
 	} else {
-		if (myData ()->cell_strings) qmemmove (&(myData ()->cell_strings[row+count]), &(myData ()->cell_strings[row]), (myData ()->allocated_length - (row + count) - 1) * sizeof (QString));
+		if (myData ()->cell_strings) memMoveQStrings (&(myData ()->cell_strings[row+count]), &(myData ()->cell_strings[row]), myData ()->allocated_length - (row + count) - 1);
 		if (myData ()->cell_doubles) qmemmove (&(myData ()->cell_doubles[row+count]), &(myData ()->cell_doubles[row]), (myData ()->allocated_length - (row + count) - 1) * sizeof (double));
 		qmemmove (&(myData ()->cell_states[row+count]), &(myData ()->cell_states[row]), (myData ()->allocated_length - (row + count) - 1) * sizeof (int));
 	}

Modified: branches/release_branch_0.4.9/rkward/core/rkvariable.h
===================================================================
--- branches/release_branch_0.4.9/rkward/core/rkvariable.h	2009-03-31 16:48:27 UTC (rev 2433)
+++ branches/release_branch_0.4.9/rkward/core/rkvariable.h	2009-03-31 17:33:48 UTC (rev 2434)
@@ -193,6 +193,19 @@
 	FormattingOptions *parseFormattingOptionsString (const QString &string);
 /** tries to match a value-label to the value in the given cell. Returns the label, or - if there is no label - the original value in textual representation */
 	QString getLabeled (int row);
+
+/** TODO: QStrings can't be memmoved. We should use QVector/QList instead. */
+	void memMoveQStrings (QString *dst, QString *src, int count) {
+		if (dst > src) {
+			for (int i = count - 1; i >= 0; --i) {
+				dst[i] = src[i];
+			}
+		} else {
+			for (int i = 0; i < count; ++i) {
+				dst[i] = src[i];
+			}
+		}
+	};
 /////////////////// END: data-handling //////////////////////
 };
 


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