ooo-build r12413 - in trunk: . patches/dev300



Author: thorstenb
Date: Thu May  1 10:43:45 2008
New Revision: 12413
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12413&view=rev

Log:
	* patches/dev300/sd-view-zoom-fix.diff: first stab at fixing the
	view-position-randomly-off issue in Impress, by always trying to
	center on the current view position



Added:
   trunk/patches/dev300/sd-view-zoom-fix.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Thu May  1 10:43:45 2008
@@ -2152,6 +2152,8 @@
 cairocanvas-fix-image-cache.diff, rodo
 vcl-limited-bmp-subset-fix.diff, i#88818, thorsten
 
+sd-view-zoom-fix.diff, n#380013, thorsten
+
 [ InternalMesaHeaders ]
 internal-mesa-headers-config_office.diff, fridrich
 internal-mesa-headers-slideshow.diff, fridrich

Added: trunk/patches/dev300/sd-view-zoom-fix.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/sd-view-zoom-fix.diff	Thu May  1 10:43:45 2008
@@ -0,0 +1,64 @@
+--- sd/source/ui/inc/Window.hxx	2008-04-10 22:56:52.000000000 +0200
++++ sd/source/ui/inc/Window.hxx	2008-05-01 03:51:10.000000000 +0200
+@@ -171,7 +171,8 @@
+ 	::sd::Window* mpShareWin;
+ 	Point maWinPos;
+ 	Point maViewOrigin;
+-	Size maViewSize;
++	Size maViewSize; 
++	Size maPrevSize; // contains previous window size in logical coords
+ 	USHORT mnMinZoom;
+ 	USHORT mnMaxZoom;
+     /** This flag tells whether to re-calculate the minimal zoom factor
+--- sd/source/ui/view/sdwindow.cxx	2008-04-11 01:19:01.000000000 +0200
++++ sd/source/ui/view/sdwindow.cxx	2008-05-01 03:50:12.000000000 +0200
+@@ -77,6 +77,7 @@
+       maWinPos(0, 0),			// vorsichtshalber; die Werte sollten aber
+       maViewOrigin(0, 0),		// vom Besitzer des Fensters neu gesetzt
+       maViewSize(1000, 1000),	// werden
++      maPrevSize(-1,-1),
+       mnMinZoom(MIN_ZOOM),
+       mnMaxZoom(MAX_ZOOM),
+ 	  mbMinZoomAutoCalc(false),
+@@ -490,6 +491,9 @@
+ 	aMap.SetScaleY(Fraction(nZoom, 100));
+ 	SetMapMode(aMap);
+ 
++    // invalidate previous size - it was relative to the old scaling
++    maPrevSize = Size(-1,-1);
++
+     // Update the map mode's origin (to what effect?).
+ 	UpdateMapOrigin();
+ 
+@@ -634,11 +639,20 @@
+ 
+ void Window::UpdateMapOrigin(BOOL bInvalidate)
+ {
+-	BOOL	bChanged = FALSE;
+-	Size	aWinSize = PixelToLogic(GetOutputSizePixel());
++	BOOL	   bChanged = FALSE;
++	const Size aWinSize = PixelToLogic(GetOutputSizePixel());
+ 
+ 	if ( mbCenterAllowed )
+ 	{
++        if( maPrevSize != Size(-1,-1) )
++        {
++            // keep view centered around current pos, when window
++            // resizes
++            maWinPos.X() -= (aWinSize.Width() - maPrevSize.Width()) / 2;
++            maWinPos.Y() -= (aWinSize.Height() - maPrevSize.Height()) / 2;
++			bChanged = TRUE;
++        }
++
+ 		if ( maWinPos.X() > maViewSize.Width() - aWinSize.Width() )
+ 		{
+ 			maWinPos.X() = maViewSize.Width() - aWinSize.Width();
+@@ -663,6 +677,8 @@
+ 
+     UpdateMapMode ();
+ 
++    maPrevSize = aWinSize;
++
+     if (bChanged && bInvalidate)
+         Invalidate();
+ }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]