converts scrollbar pos to doc pos
| 4455 | |
| 4456 | /// converts scrollbar pos to doc pos |
| 4457 | int LVDocView::scrollPosToDocPos(int scrollpos) { |
| 4458 | if (m_view_mode == DVM_SCROLL) { |
| 4459 | int n = scrollpos << m_scrollinfo.scale; |
| 4460 | if (n < 0) |
| 4461 | n = 0; |
| 4462 | int fh = GetFullHeight(); |
| 4463 | if (n > fh) |
| 4464 | n = fh; |
| 4465 | return n; |
| 4466 | } else { |
| 4467 | int vpc = getVisiblePageCount(); |
| 4468 | int n = scrollpos * vpc; |
| 4469 | if (!m_pages.length()) |
| 4470 | return 0; |
| 4471 | if (n >= m_pages.length()) |
| 4472 | n = m_pages.length() - 1; |
| 4473 | if (n < 0) |
| 4474 | n = 0; |
| 4475 | return m_pages[n]->start; |
| 4476 | } |
| 4477 | } |
| 4478 | |
| 4479 | /// get list of links |
| 4480 | void LVDocView::getCurrentPageLinks(ldomXRangeList & list) { |