Backend/Database/GTable.cpp
/*!
 * @brief move GTable column
 * @details move column from index to index2
 * @param index the index of the column to be moved
 * @param index2 the new index of the column
 */
@brief move GTable column
@details move column from index to index2
@param index the index of the column to be moved
@param index2 the new index of the column
@brief move GTable column @details move column from index to index2 @param index the index of the column to be moved @param index2 the new index of the column
void GTable::moveCol(unsigned int index, unsigned int index2)
{
	if (index >= numberOfCols())
		return;
	if (index2 >= numberOfCols())
		return;
	GString cHeader1 = "";
	if (!(index >= header.size()))
		cHeader1 = header[index];
	GString cHeader2 = "";
	if (!(index2 >= header.size()))
		cHeader2 = header[index2];
	if (index == index2)
		return;
	addCol(cHeader1, getCol(index), index2);
	if (index > index2)
		removeCol(index + 1);
	else
		removeCol(index);
}
void GTable :: moveCol ( unsigned int index , unsigned int index2 ) { if ( index >= numberOfCols ( ) ) return ; if ( index2 >= numberOfCols ( ) ) return ; GString cHeader1 = " " ; if ( ! ( index >= header . size ( ) ) ) cHeader1 = header [ index ] ; GString cHeader2 = " " ; if ( ! ( index2 >= header . size ( ) ) ) cHeader2 = header [ index2 ] ; if ( index == index2 ) return ; addCol ( cHeader1 , getCol ( index ) , index2 ) ; if ( index > index2 ) removeCol ( index + 1 ) ; else removeCol ( index ) ; }
@brief move GTable column
 @details move column from index to index2
 @param index the index of the column to be moved
 @param index2 the new index of the column
@brief move GTable column @details move column from index to index2 @param index the index of the column to be moved @param index2 the new index of the column
// error checking // swap headers // goes nowhere // copy the column // which way did it shift, remove the old