incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1327856 - in /incubator/ooo/branches/alg/aw080/main: sd/source/ui/view/ svx/source/sdr/contact/ svx/source/sdr/overlay/
Date Thu, 19 Apr 2012 08:04:51 GMT
Author: alg
Date: Thu Apr 19 08:04:51 2012
New Revision: 1327856

URL: http://svn.apache.org/viewvc?rev=1327856&view=rev
Log:
aw080: fixes in svx, sd, stabilizing

Modified:
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviews5.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewsh.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdwindow.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/viewshe2.cxx
    incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
    incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/objectcontactofpageview.cxx
    incubator/ooo/branches/alg/aw080/main/svx/source/sdr/overlay/overlaymanager.cxx

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviews5.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviews5.cxx?rev=1327856&r1=1327855&r2=1327856&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviews5.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviews5.cxx Thu Apr 19 08:04:51
2012
@@ -516,16 +516,16 @@ Size DrawViewShell::GetOptimalSizePixel(
 	{
 		SdPage& rPage = (SdPage&) pPV->getSdrPageFromSdrPageView();
 
-			if (!mbZoomOnPage)
-			{
-				// Gegenwaertigen MapMode beruecksichtigen
-			const basegfx::B2DVector aDiscreteScale(GetActiveWindow()->GetInverseViewTransformation()
* rPage.GetPageScale());
+		if (!mbZoomOnPage)
+		{
+			// Gegenwaertigen MapMode beruecksichtigen
+    		const basegfx::B2DVector aDiscreteScale(GetActiveWindow()->GetInverseViewTransformation()
* rPage.GetPageScale());
 				
-			aSize = Size(basegfx::fround(aDiscreteScale.getX()), basegfx::fround(aDiscreteScale.getY()));
-			}
-			else
-			{
-				// 1:1 Darstellung
+	    	aSize = Size(basegfx::fround(aDiscreteScale.getX()), basegfx::fround(aDiscreteScale.getY()));
+		}
+		else
+		{
+			// 1:1 Darstellung
 			const MapMode aMapMode(MAP_100TH_MM);
 			const basegfx::B2DVector aDiscreteScale(GetActiveWindow()->GetInverseViewTransformation(aMapMode)
* rPage.GetPageScale());
 

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewsh.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewsh.cxx?rev=1327856&r1=1327855&r2=1327856&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewsh.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewsh.cxx Thu Apr 19 08:04:51
2012
@@ -80,109 +80,104 @@ bool DrawViewShell::GotoBookmark(const S
 |*
 \************************************************************************/
 
-void DrawViewShell::MakeVisibleAtView(const basegfx::B2DRange& rRange, ::Window&
rWin)
+void DrawViewShell::MakeVisibleAtView(const basegfx::B2DRange& rToMakeVisibleRange, ::Window&
rWin)
 {
-	// #98568# In older versions, if in X or Y the size of the object was
-	// smaller than the visible area, the user-defined zoom was
-	// changed. This was decided to be a bug for 6.x, thus I developed a
-	// version which instead handles X/Y bigger/smaller and visibility
-	// questions seperately. The new behaviour is triggered with the
-	// bZoomAllowed parameter which for old behaviour should be set to
-	// sal_True. I looked at all uses of MakeVisibleAtView() in the application
-	// and found no valid reason for really changing the zoom factor, thus I
-	// decided to NOT expand (incompatible) this virtual method to get one
-	// more parameter. If this is wanted in later versions, feel free to add
-	// that bool to the parameter list.
-	sal_Bool bZoomAllowed(sal_False);
-	const basegfx::B2DVector aLogicSize(rRange.getRange());
-
-	// Sichtbarer Bereich
-	const Size aVisSizePixel(rWin.GetOutputSizePixel());
-	basegfx::B2DRange aVisArea(rWin.GetInverseViewTransformation() *
-		basegfx::B2DRange(0.0, 0.0, aVisSizePixel.Width(), aVisSizePixel.Height()));
-
-	if(!aVisArea.isInside(rRange) && !SlideShow::IsRunning( GetViewShellBase() ) )
-	{
-		// Objekt liegt nicht komplett im sichtbaren Bereich
-		basegfx::B2DVector aFreeSpace(aVisArea.getRange() - aLogicSize);
-
-		if(bZoomAllowed && (aFreeSpace.getX() < 0.0 || aFreeSpace.getY() < 0.0))
-		{
-			// Objekt passt nicht in sichtbaren Bereich -> auf Objektgroesse zoomen
-			SetZoomRange(rRange);
-		}
-		else
-		{
-			// #98568# allow a mode for move-only visibility without zooming.
-			const double fPercentBorder(30.0 / 200.0);
-			const basegfx::B2DRange aInnerRange(
-				aVisArea.getMinX() + (aVisArea.getWidth() * fPercentBorder),
-				aVisArea.getMinY() + (aVisArea.getHeight() * fPercentBorder),
-				aVisArea.getMaxX() - (aVisArea.getWidth() * fPercentBorder),
-				aVisArea.getMaxY() - (aVisArea.getHeight() * fPercentBorder));
-			basegfx::B2DPoint aNewPos(aVisArea.getMinimum());
-
-			if(aFreeSpace.getX() < 0.0)
-			{
-				if(aInnerRange.getMinX() > rRange.getMaxX())
-				{
-					// object moves out to the left
-					aNewPos.setX(aNewPos.getX() - (aVisArea.getWidth() * 0.5));
-				}
-
-				if(aInnerRange.getMaxX() < rRange.getMinX())
-				{
-					// object moves out to the right
-					aNewPos.setX(aNewPos.getX() + (aVisArea.getWidth() * 0.5));
-				}
-			}
-			else
-			{
-				if(aFreeSpace.getX() > rRange.getWidth())
-					aFreeSpace.setX(rRange.getWidth());
-
-				while(rRange.getMaxX() > aNewPos.getX() + aVisArea.getWidth())
-					aNewPos.setX(aNewPos.getX() + aFreeSpace.getX());
-				
-				while(rRange.getMinX() < aNewPos.getX())
-					aNewPos.setX(aNewPos.getX() - aFreeSpace.getX());
-			}
-
-			if(aFreeSpace.getY() < 0.0)
-			{
-				if(aInnerRange.getMinY() > rRange.getMaxY())
-				{
-					// object moves out to the top
-					aNewPos.setY(aNewPos.getY() - (aVisArea.getHeight() * 0.5));
-				}
-
-				if(aInnerRange.getMaxY() < rRange.getMinY())
-				{
-					// object moves out to the right
-					aNewPos.setY(aNewPos.getY() + (aVisArea.getHeight() * 0.5));
-				}
-			}
-			else
-			{
-				if(aFreeSpace.getX() > rRange.getHeight())
-					aFreeSpace.setY(rRange.getHeight());
-
-				while(rRange.getMaxY() > aNewPos.getY() + aVisArea.getHeight())
-					aNewPos.setY(aNewPos.getY() + aFreeSpace.getY());
-				
-				while(rRange.getMinY() < aNewPos.getY())
-					aNewPos.setY(aNewPos.getY() - aFreeSpace.getY());
-			}
-
-			// did position change? Does it need to be set?
-			if(!aNewPos.equal(aVisArea.getMinimum()))
-			{
-				aVisArea = basegfx::B2DRange(aNewPos, aNewPos + aVisArea.getRange());
-
-				SetZoomRange(aVisArea);
-			}
-		}
-	}
+    if(!rToMakeVisibleRange.isEmpty() && !SlideShow::IsRunning(GetViewShellBase()))
+    {
+    	const basegfx::B2DRange aVisibleLogic(rWin.GetLogicRange());
+
+        if(!aVisibleLogic.isInside(rToMakeVisibleRange))
+	    {
+            // object is not completely inside. Calc target area with border
+		    const double fPercentBorder(0.15); // 15%
+
+            // default new top-left is current top-left
+		    basegfx::B2DPoint aNewPos(aVisibleLogic.getMinimum());
+
+            if(rToMakeVisibleRange.getWidth() > aVisibleLogic.getWidth())
+            {
+                // object is wider than target range
+                if(rToMakeVisibleRange.getMaxX() < aVisibleLogic.getMinX())
+                {
+                    // object is outside left, move view to show right side of object
+                    aNewPos.setX(rToMakeVisibleRange.getMaxX() - (aVisibleLogic.getWidth()
* (1.0 - fPercentBorder)));
+                }
+                else if(rToMakeVisibleRange.getMinX() > aVisibleLogic.getMaxX())
+                {
+                    // object is outside right
+                    aNewPos.setX(rToMakeVisibleRange.getMinX() - (aVisibleLogic.getWidth()
* fPercentBorder));
+                }
+                else
+                {
+                    // object is partially in visible range, nothing to do
+                }
+            }
+            else
+            {
+                // object is equal or taller than target range
+                if(rToMakeVisibleRange.getMinX() < aVisibleLogic.getMinX())
+                {
+                    // left side of object not completely visible
+                    aNewPos.setX(rToMakeVisibleRange.getMinX() - (aVisibleLogic.getWidth()
* fPercentBorder));
+                }
+                else if(rToMakeVisibleRange.getMaxX() > aVisibleLogic.getMaxX())
+                {
+                    // right side of object not completely visible
+                    aNewPos.setX(rToMakeVisibleRange.getMaxX() - (aVisibleLogic.getWidth()
* (1.0 - fPercentBorder)));
+                }
+                else
+                {
+                    // both sides visible, should not happen since already checked by isInside
+                }
+            }
+
+            if(rToMakeVisibleRange.getHeight() > aVisibleLogic.getHeight())
+            {
+                // object is higher than target range
+                if(rToMakeVisibleRange.getMaxY() < aVisibleLogic.getMinY())
+                {
+                    // object is above, move view to show lower side of object
+                    aNewPos.setY(rToMakeVisibleRange.getMaxY() - (aVisibleLogic.getHeight()
* (1.0 - fPercentBorder)));
+                }
+                else if(rToMakeVisibleRange.getMinY() > aVisibleLogic.getMaxY())
+                {
+                    // object is below
+                    aNewPos.setY(rToMakeVisibleRange.getMinY() - (aVisibleLogic.getHeight()
* fPercentBorder));
+                }
+                else
+                {
+                    // object is partially in visible range, nothing to do
+                }
+            }
+            else
+            {
+                // object is equal or taller than target range
+                if(rToMakeVisibleRange.getMinY() < aVisibleLogic.getMinY())
+                {
+                    // upper side of object not completely visible
+                    aNewPos.setY(rToMakeVisibleRange.getMinY() - (aVisibleLogic.getHeight()
* fPercentBorder));
+                }
+                else if(rToMakeVisibleRange.getMaxY() > aVisibleLogic.getMaxY())
+                {
+                    // bottom of object not completely visible
+                    aNewPos.setY(rToMakeVisibleRange.getMaxY() - (aVisibleLogic.getHeight()
* (1.0 - fPercentBorder)));
+                }
+                else
+                {
+                    // both sides visible, should not happen since already checked by isInside
+                }
+            }
+
+		    if(!aNewPos.equal(aVisibleLogic.getMinimum()))
+		    {
+                // set new zoom if top-left has to be changed
+			    SetZoomRange(
+                    basegfx::B2DRange(
+                        aNewPos, 
+                        aNewPos + aVisibleLogic.getRange()));
+		    }
+        }
+    }
 }
 
 }

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdwindow.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdwindow.cxx?rev=1327856&r1=1327855&r2=1327856&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdwindow.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdwindow.cxx Thu Apr 19 08:04:51
2012
@@ -725,12 +725,12 @@ void Window::UpdateMapOrigin(bool bInval
 		}
     }
 
-    UpdateMapMode ();
+    UpdateMapMode();
 
-    if (bChanged && bInvalidate)
+    if(bChanged && bInvalidate)
 	{
         Invalidate();
-}
+    }
 }
 
 

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/viewshe2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/viewshe2.cxx?rev=1327856&r1=1327855&r2=1327856&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/viewshe2.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/viewshe2.cxx Thu Apr 19 08:04:51
2012
@@ -431,23 +431,25 @@ void ViewShell::SetZoom(long nZoom)
 
 void ViewShell::SetZoomRange(const basegfx::B2DRange& rZoomRange)
 {
-	long nZoom = GetActiveWindow()->SetZoomRange(rZoomRange);
-	Fraction aUIScale(nZoom, 100);
-	aUIScale *= GetDoc()->GetUIScale();
+	double fZoom(GetActiveWindow()->SetZoomRange(rZoomRange));
 
-    if (mpHorizontalRuler.get() != NULL)
-        mpHorizontalRuler->SetZoom(aUIScale);
+    if(mpHorizontalRuler.get())
+    {
+        mpHorizontalRuler->SetZoom(Fraction(fZoom * 0.01 * double(GetDoc()->GetUIScale())));
+    }
 
-    if (mpVerticalRuler.get() != NULL)
-        mpVerticalRuler->SetZoom(aUIScale);
+    if(mpVerticalRuler.get())
+    {
+        mpVerticalRuler->SetZoom(Fraction(fZoom * 0.01 * double(GetDoc()->GetUIScale())));
+    }
 
-    if (mpContentWindow.get() != NULL)
+    if(mpContentWindow.get())
     {
-		// WinViewPos is rescued over the SetZoomIntegral call indirectly in the
-		// old code, doing the same here
-        const basegfx::B2DPoint aWinViewPos(mpContentWindow->GetWinViewPos());
-        mpContentWindow->SetZoomIntegral(nZoom);
-        mpContentWindow->SetWinViewPos(aWinViewPos);
+//TTTT		// WinViewPos is rescued over the SetZoomIntegral call indirectly in the
+//		// old code, doing the same here
+//        const basegfx::B2DPoint aWinViewPos(mpContentWindow->GetWinViewPos());
+        mpContentWindow->SetZoomIntegral(fZoom);
+//        mpContentWindow->SetWinViewPos(aWinViewPos);
         mpContentWindow->UpdateMapOrigin();
 
 		// #i74769# see above

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx?rev=1327856&r1=1327855&r2=1327856&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
(original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
Thu Apr 19 08:04:51 2012
@@ -104,10 +104,8 @@ namespace sdr
 					// create ViewRange
 					if(!bOutputToRecordingMetaFile)
 					{
-						// use visible pixels, but transform to world coordinates
-						const Size aOutputSizePixel(pTargetDevice->GetOutputSizePixel());
-						aViewRange = pTargetDevice->GetInverseViewTransformation() *
-							::basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
+                        // use logic visible range
+                        aViewRange = pTargetDevice->GetLogicRange();
 					}
 
 					// upate local ViewInformation2D

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/objectcontactofpageview.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/objectcontactofpageview.cxx?rev=1327856&r1=1327855&r2=1327856&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/objectcontactofpageview.cxx
(original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/objectcontactofpageview.cxx
Thu Apr 19 08:04:51 2012
@@ -202,8 +202,7 @@ namespace sdr
             else
 			{
 				// use visible pixels, but transform to world coordinates
-				const Size aOutputSizePixel(rTargetOutDev.GetOutputSizePixel());
-				aViewRange = basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
+				aViewRange = rTargetOutDev.GetDiscreteRange();
 
 				// if a clip region is set, use it
 				if(!rDisplayInfo.GetRedrawArea().IsEmpty())
@@ -337,9 +336,7 @@ namespace sdr
 			else
 			{
 				const OutputDevice& rTargetOutDev = GetPageWindow().GetPaintWindow().GetTargetOutputDevice();
-				const Size aOutputSizePixel(rTargetOutDev.GetOutputSizePixel());
-				const basegfx::B2DRange aLogicViewRange(rTargetOutDev.GetInverseViewTransformation()
*
-					basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight()));
+                const basegfx::B2DRange aLogicViewRange(rTargetOutDev.GetLogicRange());
 
 				if(!aLogicViewRange.isEmpty() && !aLogicViewRange.overlaps(rRange))
 				{

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/overlay/overlaymanager.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/overlay/overlaymanager.cxx?rev=1327856&r1=1327855&r2=1327856&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/overlay/overlaymanager.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/overlay/overlaymanager.cxx Thu Apr
19 08:04:51 2012
@@ -156,9 +156,7 @@ namespace sdr
 
 				if(OUTDEV_WINDOW == getOutputDevice().GetOutDevType())
 				{
-					const Size aOutputSizePixel(getOutputDevice().GetOutputSizePixel());
-					aViewRange = getOutputDevice().GetInverseViewTransformation() *
-						basegfx::B2DRange(0.0, 0.0, aOutputSizePixel.getWidth(), aOutputSizePixel.getHeight());
+                    aViewRange = getOutputDevice().GetLogicRange();
 				}
 
                 OverlayManager* pThis = const_cast< OverlayManager* >(this);



Mime
View raw message