| 382 | */ |
| 383 | |
| 384 | void QtTableView::setTopLeftCell( int row, int col ) |
| 385 | { |
| 386 | int newX = xOffs; |
| 387 | int newY = yOffs; |
| 388 | |
| 389 | if ( col >= 0 ) { |
| 390 | if ( cellW ) { |
| 391 | newX = col*cellW; |
| 392 | if ( newX > maxXOffset() ) |
| 393 | newX = maxXOffset(); |
| 394 | } else { |
| 395 | newX = 0; |
| 396 | while ( col ) |
| 397 | newX += cellWidth( --col ); // optimize using current! ### |
| 398 | } |
| 399 | } |
| 400 | if ( row >= 0 ) { |
| 401 | if ( cellH ) { |
| 402 | newY = row*cellH; |
| 403 | if ( newY > maxYOffset() ) |
| 404 | newY = maxYOffset(); |
| 405 | } else { |
| 406 | newY = 0; |
| 407 | while ( row ) |
| 408 | newY += cellHeight( --row ); // optimize using current! ### |
| 409 | } |
| 410 | } |
| 411 | setOffset( newX, newY ); |
| 412 | } |
| 413 | |
| 414 | |
| 415 | /*! |
nothing calls this directly
no outgoing calls
no test coverage detected