View | Details | Raw Unified | Return to issue 48995
Collapse All | Expand All

(-)sd/source/ui/inc/ViewShell.hxx (-1 / +1 lines)
Lines 279-285 Link Here
279
	virtual void	SetZoom(long nZoom);
279
	virtual void	SetZoom(long nZoom);
280
	virtual void	SetZoomRect(const Rectangle& rZoomRect);
280
	virtual void	SetZoomRect(const Rectangle& rZoomRect);
281
	void	InitWindows(const Point& rViewOrigin, const Size& rViewSize,
281
	void	InitWindows(const Point& rViewOrigin, const Size& rViewSize,
282
						const Point& rWinPos, BOOL bUpdate = FALSE);
282
						const Point& rWinPos, BOOL bUpdate = FALSE , BOOL isNormalView = FALSE);
283
	void	InvalidateWindows();
283
	void	InvalidateWindows();
284
	void	UpdateWindows();
284
	void	UpdateWindows();
285
    /** This method is still used by the OutlineViewShell to update the
285
    /** This method is still used by the OutlineViewShell to update the
(-)sd/source/ui/view/viewshel.cxx (-1 / +1 lines)
Lines 819-825 Link Here
819
                if( mpContentWindow.get() == pWin )
819
                if( mpContentWindow.get() == pWin )
820
                {
820
                {
821
		  ULONG nScrollLines = pData->GetScrollLines();
821
		  ULONG nScrollLines = pData->GetScrollLines();
822
		  if(IsPageFlipMode())
822
		  if(IsPageFlipMode() || mpVerticalScrollBar->GetThumbPos()%256 == 0)
823
			nScrollLines = COMMAND_WHEEL_PAGESCROLL;
823
			nScrollLines = COMMAND_WHEEL_PAGESCROLL;
824
		  CommandWheelData aWheelData( pData->GetDelta(),pData->GetNotchDelta(),
824
		  CommandWheelData aWheelData( pData->GetDelta(),pData->GetNotchDelta(),
825
			nScrollLines,pData->GetMode(),pData->GetModifier(),pData->IsHorz() );
825
			nScrollLines,pData->GetMode(),pData->GetModifier(),pData->IsHorz() );
(-)sd/source/ui/view/viewshe2.cxx (-24 / +24 lines)
Lines 195-209 Link Here
195
195
196
	if (mpVerticalScrollBar.get() != NULL)
196
	if (mpVerticalScrollBar.get() != NULL)
197
	{
197
	{
198
		long nH = (long)(mpContentWindow->GetVisibleHeight() * 32000);
198
		long nH =  (long)(mpContentWindow->GetVisibleHeight()*256);
199
		long nY = (long)(mpContentWindow->GetVisibleY() * 32000);
199
		long nY =  (long)(mpContentWindow->GetVisibleY()*256);
200
200
		USHORT nCurPage ,nTotalPages;
201
		USHORT nCurPage ,nTotalPages;
201
		if(IsPageFlipMode()) // ie in zoom mode where no panning
202
		{
203
			SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage();
202
			SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage();
204
                	nCurPage = (pPage->GetPageNum() - 1) / 2;
203
                	nCurPage = (pPage->GetPageNum() - 1) / 2;
205
			nTotalPages = GetDoc()->GetSdPageCount(pPage->GetPageKind());		  	 						
204
			nTotalPages = GetDoc()->GetSdPageCount(pPage->GetPageKind());		  	 						
206
			mpVerticalScrollBar->SetRange(Range(0,256*nTotalPages));	
205
			mpVerticalScrollBar->SetRange(Range(0,256*nTotalPages));	
206
207
		if(IsPageFlipMode()) // ie in zoom fit mode where there is no page panning
208
		{
207
			mpVerticalScrollBar->SetVisibleSize(256);
209
			mpVerticalScrollBar->SetVisibleSize(256);
208
			mpVerticalScrollBar->SetThumbPos(256*nCurPage);
210
			mpVerticalScrollBar->SetThumbPos(256*nCurPage);
209
			mpVerticalScrollBar->SetLineSize(256);
211
			mpVerticalScrollBar->SetLineSize(256);
Lines 211-220 Link Here
211
		}	
213
		}	
212
		else 
214
		else 
213
		{			
215
		{			
214
			mpVerticalScrollBar->SetRange(Range(0,32000));	
215
			mpVerticalScrollBar->SetVisibleSize(nH);
216
			mpVerticalScrollBar->SetVisibleSize(nH);
216
			mpVerticalScrollBar->SetThumbPos(nY);
217
			mpVerticalScrollBar->SetThumbPos(256*nCurPage + nY);
217
			nH = 32000 - nH;
218
			nH = 256 - nH;
218
			long nLine = (long) (mpContentWindow->GetScrlLineHeight() * nH);
219
			long nLine = (long) (mpContentWindow->GetScrlLineHeight() * nH);
219
			long nPage = (long) (mpContentWindow->GetScrlPageHeight() * nH);
220
			long nPage = (long) (mpContentWindow->GetScrlPageHeight() * nH);
220
			mpVerticalScrollBar->SetLineSize(nLine);
221
			mpVerticalScrollBar->SetLineSize(nLine);
Lines 311-318 Link Here
311
312
312
long ViewShell::VirtVScrollHdl(ScrollBar* pVScroll)
313
long ViewShell::VirtVScrollHdl(ScrollBar* pVScroll)
313
{
314
{
314
	if(IsPageFlipMode())
315
	{ 
316
	   SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage();
315
	   SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage();
317
           USHORT nCurPage = (pPage->GetPageNum() - 1) / 2;
316
           USHORT nCurPage = (pPage->GetPageNum() - 1) / 2;
318
	   USHORT nNewPage = pVScroll->GetThumbPos()/256;	
317
	   USHORT nNewPage = pVScroll->GetThumbPos()/256;	
Lines 316-328 Link Here
316
	   SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage();
315
	   SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage();
317
           USHORT nCurPage = (pPage->GetPageNum() - 1) / 2;
316
           USHORT nCurPage = (pPage->GetPageNum() - 1) / 2;
318
	   USHORT nNewPage = pVScroll->GetThumbPos()/256;	
317
	   USHORT nNewPage = pVScroll->GetThumbPos()/256;	
318
319
	   if( nCurPage != nNewPage )
319
	   if( nCurPage != nNewPage )
320
		 static_cast<DrawViewShell*>(this)->SwitchPage(nNewPage);
320
		 static_cast<DrawViewShell*>(this)->SwitchPage(nNewPage);
321
	}
322
321
323
	else //panning mode
322
	double fY = ( pVScroll->GetThumbPos() - nNewPage*256) / (double) 256;
324
	{ 		
323
	fY 	 *= (256 - pVScroll->GetVisibleSize())/(double)256; //slower down slide updation in order to scroll constantly from 0 to 256
325
		double fY = (double) pVScroll->GetThumbPos() / pVScroll->GetRange().Len();
326
324
327
        ::sd::View* pView = GetView();
325
        ::sd::View* pView = GetView();
328
        OutlinerView* pOLV = NULL;
326
        OutlinerView* pOLV = NULL;
Lines 355-361 Link Here
355
		if (mbHasRulers)
353
		if (mbHasRulers)
356
			UpdateVRuler();
354
			UpdateVRuler();
357
355
358
	}
359
356
360
	return 0;
357
	return 0;
361
}
358
}
Lines 518-529 Link Here
518
\************************************************************************/
515
\************************************************************************/
519
516
520
void ViewShell::InitWindows(const Point& rViewOrigin, const Size& rViewSize,
517
void ViewShell::InitWindows(const Point& rViewOrigin, const Size& rViewSize,
521
							  const Point& rWinPos, BOOL bUpdate)
518
							  const Point& rWinPos, BOOL bUpdate ,BOOL isNormalView)
522
{
519
{
520
   	
523
    if (mpContentWindow.get() != NULL)
521
    if (mpContentWindow.get() != NULL)
524
    {
522
    {
525
        mpContentWindow->SetViewOrigin(rViewOrigin);
523
	long hBorder = rViewSize.Width()  * 0.2 * (int)isNormalView; ;
526
        mpContentWindow->SetViewSize(rViewSize);
524
	long vBorder = rViewSize.Height() * 0.2 * (int)isNormalView; 
525
	long nWidth  = rViewSize.Width() ;
526
	long nHeight = rViewSize.Height(); 
527
	Point aViewOrigin = Point(hBorder/2 , vBorder/2); 
528
	Size  aViewSize   = Size (nWidth + hBorder, nHeight + vBorder);
529
	mpContentWindow->SetViewOrigin(aViewOrigin);
530
       	mpContentWindow->SetViewSize(aViewSize);
527
        mpContentWindow->SetWinViewPos(rWinPos);
531
        mpContentWindow->SetWinViewPos(rWinPos);
528
532
529
        if ( bUpdate )
533
        if ( bUpdate )
Lines 737-749 Link Here
737
	pViewShell->GetViewFrame()->GetObjectShell()
741
	pViewShell->GetViewFrame()->GetObjectShell()
738
        ->GetUndoManager()->AddUndoAction(pUndoGroup);
742
        ->GetUndoManager()->AddUndoAction(pUndoGroup);
739
743
740
	long nWidth = pPage->GetSize().Width();
744
	Size aPageSize = pPage->GetSize();
741
	long nHeight = pPage->GetSize().Height();
742
743
	Point aPageOrg = Point(nWidth, nHeight / 2);
744
	Size aViewSize = Size(nWidth * 3, nHeight * 2);
745
745
746
	InitWindows(aPageOrg, aViewSize, Point(-1, -1), TRUE);
746
	InitWindows(Point(0,0), aPageSize , Point(-1, -1), TRUE , TRUE);
747
747
748
	Point aVisAreaPos;
748
	Point aVisAreaPos;
749
749
Lines 755-761 Link Here
755
	::sd::View* pView = GetView();
755
	::sd::View* pView = GetView();
756
	if (pView)
756
	if (pView)
757
	{
757
	{
758
		pView->SetWorkArea(Rectangle(Point() - aVisAreaPos - aPageOrg, aViewSize));
758
		pView->SetWorkArea(Rectangle(Point() - aVisAreaPos - Point(0,0), aPageSize));
759
	}
759
	}
760
760
761
	UpdateScrollBars();
761
	UpdateScrollBars();
(-)sd/source/ui/view/drviewsa.cxx (-13 / +6 lines)
Lines 452-460 Link Here
452
    }
452
    }
453
453
454
	Size aPageSize = GetDoc()->GetSdPage(0, ePageKind)->GetSize();
454
	Size aPageSize = GetDoc()->GetSdPage(0, ePageKind)->GetSize();
455
	Point aPageOrg = Point(aPageSize.Width(), aPageSize.Height() / 2);
455
	InitWindows(Point(0,0), aPageSize, Point(-1, -1) , FALSE , TRUE);
456
	Size aViewSize = Size(aPageSize.Width() * 3, aPageSize.Height() * 2);
457
	InitWindows(aPageOrg, aViewSize, Point(-1, -1));
458
456
459
	Point aVisAreaPos;
457
	Point aVisAreaPos;
460
458
Lines 463-472 Link Here
463
		aVisAreaPos = pDocSh->GetVisArea(ASPECT_CONTENT).TopLeft();
461
		aVisAreaPos = pDocSh->GetVisArea(ASPECT_CONTENT).TopLeft();
464
	}
462
	}
465
463
466
	pDrView->SetWorkArea(Rectangle(Point() - aVisAreaPos - aPageOrg, aViewSize));
464
	pDrView->SetWorkArea(Rectangle(Point() - aVisAreaPos - Point(0,0), aPageSize));
467
465
468
	// Objekte koennen max. so gross wie die ViewSize werden
466
	// Objekte koennen max. so gross wie die ViewSize werden
469
	GetDoc()->SetMaxObjSize(aViewSize);
467
	GetDoc()->SetMaxObjSize(aPageSize);
470
468
471
	// Split-Handler fuer TabControls
469
	// Split-Handler fuer TabControls
472
	aTabControl.SetSplitHdl( LINK( this, DrawViewShell, TabSplitHdl ) );
470
	aTabControl.SetSplitHdl( LINK( this, DrawViewShell, TabSplitHdl ) );
Lines 829-841 Link Here
829
		pHandoutPage->CreateTitleAndLayout(TRUE);
827
		pHandoutPage->CreateTitleAndLayout(TRUE);
830
	}
828
	}
831
829
832
	long nWidth = pActualPage->GetSize().Width();
830
	Size aPageSize = pActualPage->GetSize();
833
	long nHeight = pActualPage->GetSize().Height();
831
	InitWindows(Point(0,0),aPageSize,Point(-1, -1), TRUE , TRUE);
834
835
	Point aPageOrg = Point(nWidth, nHeight / 2);
836
	Size aViewSize = Size(nWidth * 3, nHeight * 2);
837
838
	InitWindows(aPageOrg, aViewSize, Point(-1, -1), TRUE);
839
//	  GetView()->SetWorkArea(Rectangle(Point(0,0) - aPageOrg, aViewSize));
832
//	  GetView()->SetWorkArea(Rectangle(Point(0,0) - aPageOrg, aViewSize));
840
833
841
	Point aVisAreaPos;
834
	Point aVisAreaPos;
Lines 845-851 Link Here
845
		aVisAreaPos = GetDocSh()->GetVisArea(ASPECT_CONTENT).TopLeft();
838
		aVisAreaPos = GetDocSh()->GetVisArea(ASPECT_CONTENT).TopLeft();
846
	}
839
	}
847
840
848
	GetView()->SetWorkArea(Rectangle(Point() - aVisAreaPos - aPageOrg, aViewSize));
841
	GetView()->SetWorkArea(Rectangle(Point() - aVisAreaPos - Point(0,0), aPageSize));
849
842
850
	UpdateScrollBars();
843
	UpdateScrollBars();
851
844
(-)sd/source/ui/view/drawview.cxx (-3 / +1 lines)
Lines 873-881 Link Here
873
		* Windows initialisieren und auf Seitengoesse zoomen
873
		* Windows initialisieren und auf Seitengoesse zoomen
874
		**********************************************************************/
874
		**********************************************************************/
875
		Size aPageSize = pDrawViewShell->GetActualPage()->GetSize();
875
		Size aPageSize = pDrawViewShell->GetActualPage()->GetSize();
876
		Point aPageOrg = Point(aPageSize.Width(), aPageSize.Height() / 2);
876
		pViewSh->InitWindows(Point(0,0), aPageSize, Point(-1, -1) , FALSE , TRUE);
877
		Size aViewSize = Size(aPageSize.Width() * 3, aPageSize.Height() * 2);
878
		pViewSh->InitWindows(aPageOrg, aViewSize, Point(-1, -1));
879
		pViewSh->GetViewFrame()->GetDispatcher()->Execute(SID_SIZE_PAGE);
877
		pViewSh->GetViewFrame()->GetDispatcher()->Execute(SID_SIZE_PAGE);
880
	}
878
	}
881
}
879
}
(-)sd/source/ui/unoidl/unopage.cxx (-9 / +2 lines)
Lines 1582-1596 Link Here
1582
				static_cast< ::sd::DrawViewShell*>(pViewSh)->ResetActualPage();
1582
				static_cast< ::sd::DrawViewShell*>(pViewSh)->ResetActualPage();
1583
1583
1584
			Size aPageSize = pDoc->GetSdPage(0, ePageKind)->GetSize();
1584
			Size aPageSize = pDoc->GetSdPage(0, ePageKind)->GetSize();
1585
			const long nWidth = aPageSize.Width();
1585
			pDoc->SetMaxObjSize(aPageSize);
1586
			const long nHeight = aPageSize.Height();
1586
			pViewSh->InitWindows(Point(0,0), aPageSize, Point(-1, -1), TRUE , TRUE);
1587
1588
			Point aPageOrg = Point(nWidth, nHeight / 2);
1589
			Size aViewSize = Size(nWidth * 3, nHeight * 2);
1590
1591
			pDoc->SetMaxObjSize(aViewSize);
1592
1593
			pViewSh->InitWindows(aPageOrg, aViewSize, Point(-1, -1), TRUE);
1594
1587
1595
			pViewSh->UpdateScrollBars();
1588
			pViewSh->UpdateScrollBars();
1596
		}
1589
		}

Return to issue 48995