model_server/gala/src/SpreadSheet.cxx
// Save the contents of selected rows to clipboard
Save the contents of selected rows to clipboard
Save the contents of selected rows to clipboard
void  SelectionToClipBoard(gdSpreadSheet *sheet)
{
     int row, column, numDown, numAcross;
     sheet->GetList()->DetermineSelectionBounds(sheet->GetSelection(), &row, &column, &numDown, &numAcross);
     int i,j;
     int col =sheet->GetList()->GetColumnCount();
     if (col == 6) {
        PatternClipBoard_num = 0;
        for(i = row; i < row+numDown; i++) {
           j = 1;
           p_clipboard[PatternClipBoard_num].row = i;
           char *value = (char *)sheet->GetList()->GetCellValue(i, j++);
           if(!value || strcmp(value, "")==0) 
               p_clipboard[PatternClipBoard_num].criteria = -1;
           else
               p_clipboard[PatternClipBoard_num].criteria = (strcmp(value, "Include")==0? 1:0);
           value = (char *)sheet->GetList()->GetCellValue(i, j++);
           if(value)
              strcpy(p_clipboard[PatternClipBoard_num].basestring, value);
           else
              strcpy(p_clipboard[PatternClipBoard_num].basestring, "");
           value = (char *)sheet->GetList()->GetCellValue(i, j++);
           if(!value || strcmp(value, "")==0)
              p_clipboard[PatternClipBoard_num].sensitive = -1;
           else
              p_clipboard[PatternClipBoard_num].sensitive = (strcmp(value, "Yes")==0? 1:0);
           value = (char *)sheet->GetList()->GetCellValue(i, j++);
           if(!value || strcmp(value, "")==0)
              p_clipboard[PatternClipBoard_num].entities = -1;
           else
              p_clipboard[PatternClipBoard_num].entities = (strcmp(value, "Yes")==0? 1:0);
           value = (char *)sheet->GetList()->GetCellValue(i, j++);
           if(!value || strcmp(value, "")==0)
              p_clipboard[PatternClipBoard_num].strings = -1;
           else
              p_clipboard[PatternClipBoard_num].strings = (strcmp(value, "Yes")==0? 1:0);        
           PatternClipBoard_num++;
	}
     } else if (col == 4) {
	TypeClipBoard_num = 0;
        for(i = row; i < row+numDown; i++) {
           j = 1;
           t_clipboard[TypeClipBoard_num].row = i;
           char *value = (char *)sheet->GetList()->GetCellValue(i, j++);
           if(!value || strcmp(value, "")==0)
              t_clipboard[TypeClipBoard_num].criteria = -1;
           else
              t_clipboard[TypeClipBoard_num].criteria = (strcmp(value, "Include")==0? 1:0);
           value = (char *)sheet->GetList()->GetCellValue(i, j++);
           if (value)
              strcpy(t_clipboard[TypeClipBoard_num].type, value);
           else
              strcpy(t_clipboard[TypeClipBoard_num].type, "");
           value = (char *)sheet->GetList()->GetCellValue(i, j++);
           if (value)
              strcpy(t_clipboard[TypeClipBoard_num].size, value);
           else 
              strcpy(t_clipboard[TypeClipBoard_num].size, "");
           TypeClipBoard_num++;
        }
     }
}
void SelectionToClipBoard ( gdSpreadSheet * sheet ) { int row , column , numDown , numAcross ; sheet -> GetList ( ) -> DetermineSelectionBounds ( sheet -> GetSelection ( ) , & row , & column , & numDown , & numAcross ) ; int i , j ; int col = sheet -> GetList ( ) -> GetColumnCount ( ) ; if ( col == 6 ) { PatternClipBoard_num = 0 ; for ( i = row ; i < row + numDown ; i ++ ) { j = 1 ; p_clipboard [ PatternClipBoard_num ] . row = i ; char * value = ( char * ) sheet -> GetList ( ) -> GetCellValue ( i , j ++ ) ; if ( ! value || strcmp ( value , " " ) == 0 ) p_clipboard [ PatternClipBoard_num ] . criteria = -1 ; else p_clipboard [ PatternClipBoard_num ] . criteria = ( strcmp ( value , " " ) == 0 ? 1 : 0 ) ; value = ( char * ) sheet -> GetList ( ) -> GetCellValue ( i , j ++ ) ; if ( value ) strcpy ( p_clipboard [ PatternClipBoard_num ] . basestring , value ) ; else strcpy ( p_clipboard [ PatternClipBoard_num ] . basestring , " " ) ; value = ( char * ) sheet -> GetList ( ) -> GetCellValue ( i , j ++ ) ; if ( ! value || strcmp ( value , " " ) == 0 ) p_clipboard [ PatternClipBoard_num ] . sensitive = -1 ; else p_clipboard [ PatternClipBoard_num ] . sensitive = ( strcmp ( value , " " ) == 0 ? 1 : 0 ) ; value = ( char * ) sheet -> GetList ( ) -> GetCellValue ( i , j ++ ) ; if ( ! value || strcmp ( value , " " ) == 0 ) p_clipboard [ PatternClipBoard_num ] . entities = -1 ; else p_clipboard [ PatternClipBoard_num ] . entities = ( strcmp ( value , " " ) == 0 ? 1 : 0 ) ; value = ( char * ) sheet -> GetList ( ) -> GetCellValue ( i , j ++ ) ; if ( ! value || strcmp ( value , " " ) == 0 ) p_clipboard [ PatternClipBoard_num ] . strings = -1 ; else p_clipboard [ PatternClipBoard_num ] . strings = ( strcmp ( value , " " ) == 0 ? 1 : 0 ) ; PatternClipBoard_num ++ ; } } else if ( col == 4 ) { TypeClipBoard_num = 0 ; for ( i = row ; i < row + numDown ; i ++ ) { j = 1 ; t_clipboard [ TypeClipBoard_num ] . row = i ; char * value = ( char * ) sheet -> GetList ( ) -> GetCellValue ( i , j ++ ) ; if ( ! value || strcmp ( value , " " ) == 0 ) t_clipboard [ TypeClipBoard_num ] . criteria = -1 ; else t_clipboard [ TypeClipBoard_num ] . criteria = ( strcmp ( value , " " ) == 0 ? 1 : 0 ) ; value = ( char * ) sheet -> GetList ( ) -> GetCellValue ( i , j ++ ) ; if ( value ) strcpy ( t_clipboard [ TypeClipBoard_num ] . type , value ) ; else strcpy ( t_clipboard [ TypeClipBoard_num ] . type , " " ) ; value = ( char * ) sheet -> GetList ( ) -> GetCellValue ( i , j ++ ) ; if ( value ) strcpy ( t_clipboard [ TypeClipBoard_num ] . size , value ) ; else strcpy ( t_clipboard [ TypeClipBoard_num ] . size , " " ) ; TypeClipBoard_num ++ ; } } }
Save the contents of selected rows to clipboard
Save the contents of selected rows to clipboard