INTEGRATION: CWS cov2src (1.39.32); FILE MERGED

2005/10/18 12:38:51 rt 1.39.32.1: #126234# Join MWS COV680 m4 into SRC680
This commit is contained in:
Rüdiger Timm 2005-10-19 11:28:46 +00:00
parent fe4fdae3a9
commit f819730cfe

View file

@ -4,9 +4,9 @@
* *
* $RCSfile: viewshe2.cxx,v $ * $RCSfile: viewshe2.cxx,v $
* *
* $Revision: 1.39 $ * $Revision: 1.40 $
* *
* last change: $Author: rt $ $Date: 2005-09-09 07:19:50 $ * last change: $Author: rt $ $Date: 2005-10-19 12:28:46 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@ -171,14 +171,31 @@ void ViewShell::UpdateScrollBars()
{ {
long nH = (long)(mpContentWindow->GetVisibleHeight() * 32000); long nH = (long)(mpContentWindow->GetVisibleHeight() * 32000);
long nY = (long)(mpContentWindow->GetVisibleY() * 32000); long nY = (long)(mpContentWindow->GetVisibleY() * 32000);
mpVerticalScrollBar->SetVisibleSize(nH);
mpVerticalScrollBar->SetThumbPos(nY); if(IsPageFlipMode()) // ie in zoom mode where no panning
nH = 32000 - nH; {
long nLine = (long) (mpContentWindow->GetScrlLineHeight() * nH); SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage();
long nPage = (long) (mpContentWindow->GetScrlPageHeight() * nH); USHORT nCurPage = (pPage->GetPageNum() - 1) / 2;
mpVerticalScrollBar->SetLineSize(nLine); USHORT nTotalPages = GetDoc()->GetSdPageCount(pPage->GetPageKind());
mpVerticalScrollBar->SetPageSize(nPage); mpVerticalScrollBar->SetRange(Range(0,256*nTotalPages));
mpVerticalScrollBar->SetVisibleSize(256);
mpVerticalScrollBar->SetThumbPos(256*nCurPage);
mpVerticalScrollBar->SetLineSize(256);
mpVerticalScrollBar->SetPageSize(256);
}
else
{
mpVerticalScrollBar->SetRange(Range(0,32000));
mpVerticalScrollBar->SetVisibleSize(nH);
mpVerticalScrollBar->SetThumbPos(nY);
nH = 32000 - nH;
long nLine = (long) (mpContentWindow->GetScrlLineHeight() * nH);
long nPage = (long) (mpContentWindow->GetScrlPageHeight() * nH);
mpVerticalScrollBar->SetLineSize(nLine);
mpVerticalScrollBar->SetPageSize(nPage);
}
} }
if (mbHasRulers) if (mbHasRulers)
{ {
UpdateHRuler(); UpdateHRuler();
@ -269,9 +286,15 @@ IMPL_LINK_INLINE_END(ViewShell, VScrollHdl, ScrollBar *, pVScroll )
long ViewShell::VirtVScrollHdl(ScrollBar* pVScroll) long ViewShell::VirtVScrollHdl(ScrollBar* pVScroll)
{ {
long nDelta = pVScroll->GetDelta(); if(IsPageFlipMode())
{
if (nDelta != 0) SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage();
USHORT nCurPage = (pPage->GetPageNum() - 1) >> 1;
USHORT nNewPage = pVScroll->GetThumbPos()/256;
if( nCurPage != nNewPage )
static_cast<DrawViewShell*>(this)->SwitchPage(nNewPage);
}
else //panning mode
{ {
double fY = (double) pVScroll->GetThumbPos() / pVScroll->GetRange().Len(); double fY = (double) pVScroll->GetThumbPos() / pVScroll->GetRange().Len();