[rkward-cvs] SF.net SVN: rkward:[2873] trunk/rkward/rkward/core
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Wed Jun 2 16:14:14 UTC 2010
Revision: 2873
http://rkward.svn.sourceforge.net/rkward/?rev=2873&view=rev
Author: tfry
Date: 2010-06-02 16:14:14 +0000 (Wed, 02 Jun 2010)
Log Message:
-----------
Clean up some more code cruft
Modified Paths:
--------------
trunk/rkward/rkward/core/rkvariable.cpp
trunk/rkward/rkward/core/rkvariable.h
Modified: trunk/rkward/rkward/core/rkvariable.cpp
===================================================================
--- trunk/rkward/rkward/core/rkvariable.cpp 2010-06-02 15:49:16 UTC (rev 2872)
+++ trunk/rkward/rkward/core/rkvariable.cpp 2010-06-02 16:14:14 UTC (rev 2873)
@@ -380,17 +380,6 @@
RKGlobals::tracker ()->objectDataChanged (this, set);
}
-void RKVariable::cellChanged (int row) {
- RK_TRACE (OBJECTS);
- if (data->immediate_sync) {
- writeData (row, row);
- } else {
- RK_ASSERT (data->changes);
- if ((data->changes->from_index > row) || (data->changes->from_index == -1)) data->changes->from_index = row;
- if (data->changes->to_index < row) data->changes->to_index = row;
- }
-}
-
void RKVariable::cellsChanged (int from_row, int to_row) {
RK_TRACE (OBJECTS);
if (data->immediate_sync) {
@@ -570,7 +559,7 @@
}
}
}
- cellChanged (row);
+ cellsChanged (row, row);
}
QString RKVariable::getLabeled (int row) const {
@@ -660,32 +649,17 @@
void RKVariable::setCharacter (int from_row, int to_row, QString *txtdata) {
RK_TRACE (OBJECTS);
RK_ASSERT (to_row < getLength ());
-
- if (getDataType () == DataCharacter) {
- int i=0;
- for (int row=from_row; row <= to_row; ++row) {
- if (data->cell_states[row] & RKVarEditData::Invalid) data->cell_states[row] = RKVarEditData::UnsyncedInvalidState;
- else data->cell_states[row] = 0;
- if (txtdata[i].isNull ()) data->cell_states[row] |= RKVarEditData::NA;
- else data->cell_states[row] |= RKVarEditData::Valid;
-
- data->cell_strings[row] = txtdata[i++];
- }
- } else {
- bool old_sync = data->immediate_sync;
- setSyncing (false);
- int i=0;
- for (int row=from_row; row <= to_row; ++row) {
- setText (row, txtdata[i++]);
- }
- if (old_sync) {
- syncDataToR ();
- setSyncing (true);
- }
- return;
+ bool old_sync = data->immediate_sync;
+ setSyncing (false);
+ int i=0;
+ for (int row=from_row; row <= to_row; ++row) {
+ setText (row, txtdata[i++]);
}
- cellsChanged (from_row, to_row);
+ if (old_sync) {
+ syncDataToR ();
+ setSyncing (true);
+ }
}
void RKVariable::setUnknown (int from_row, int to_row) {
Modified: trunk/rkward/rkward/core/rkvariable.h
===================================================================
--- trunk/rkward/rkward/core/rkvariable.h 2010-06-02 15:49:16 UTC (rev 2872)
+++ trunk/rkward/rkward/core/rkvariable.h 2010-06-02 16:14:14 UTC (rev 2873)
@@ -180,8 +180,6 @@
void extendToLength (int length);
/** changes the allocated storage to contain a least getLength elements. More data may be allocated than acutally needed. This function only ever does downsizing. */
void downSize ();
-/** takes care of syncing the given cell */
- void cellChanged (int row);
/** takes care of syncing the given range of cells */
void cellsChanged (int from_row, int to_row);
/** writes the given range of cells to the backend (regardless of whether syncing should be immediate) */
@@ -212,6 +210,4 @@
/////////////////// END: data-handling //////////////////////
};
-typedef RKVariable* RKVarPtr;
-
#endif
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