incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1328271 - in /incubator/ooo/branches/alg/aw080/main: sc/source/ui/view/ sd/source/ui/func/ sd/source/ui/inc/ sd/source/ui/table/ sd/source/ui/toolpanel/ sd/source/ui/view/ svx/source/dialog/ svx/source/svdraw/ svx/source/tbxctrls/ sw/sourc...
Date Fri, 20 Apr 2012 09:21:15 GMT
Author: alg
Date: Fri Apr 20 09:21:14 2012
New Revision: 1328271

URL: http://svn.apache.org/viewvc?rev=1328271&view=rev
Log:
aw080: added convenience methods to vcl, adapted more view methods to double precision

Modified:
    incubator/ooo/branches/alg/aw080/main/sc/source/ui/view/tabvwshb.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/fuinsert.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/fuzoom.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/makefile.mk
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/inc/ViewShell.hxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/inc/Window.hxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/table/tablefunction.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/toolpanel/LayoutMenu.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/toolpanel/TestMenu.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviews4.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewsb.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewse.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/outlnvsh.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/outlview.cxx
    incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview2.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/sd/source/ui/view/viewshel.cxx
    incubator/ooo/branches/alg/aw080/main/svx/source/dialog/grfflt.cxx
    incubator/ooo/branches/alg/aw080/main/svx/source/dialog/swframeexample.cxx
    incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx
    incubator/ooo/branches/alg/aw080/main/svx/source/tbxctrls/linectrl.cxx
    incubator/ooo/branches/alg/aw080/main/sw/source/ui/index/cnttab.cxx
    incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/pview.cxx
    incubator/ooo/branches/alg/aw080/main/vcl/inc/vcl/outdev.hxx
    incubator/ooo/branches/alg/aw080/main/vcl/source/gdi/outmap.cxx

Modified: incubator/ooo/branches/alg/aw080/main/sc/source/ui/view/tabvwshb.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sc/source/ui/view/tabvwshb.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sc/source/ui/view/tabvwshb.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sc/source/ui/view/tabvwshb.cxx Fri Apr 20 09:21:14 2012
@@ -373,14 +373,15 @@ void ScTabViewShell::ExecDrawIns(SfxRequ
 
 						if(pNewDBField)
 						{
-							Rectangle aVisArea = pWin->PixelToLogic(Rectangle(Point(0,0), pWin->GetOutputSizePixel()));
-							Point aObjPos(aVisArea.Center());
-						    const Size aObjSize(sdr::legacy::GetLogicRect(*pNewDBField).GetSize());
-							aObjPos.X() -= aObjSize.Width() / 2;
-							aObjPos.Y() -= aObjSize.Height() / 2;
-							Rectangle aNewObjectRectangle(aObjPos, aObjSize);
+                            const basegfx::B2DPoint aOldCenter(pNewDBField->getSdrObjectTransformation() * basegfx::B2DPoint(0.5, 0.5));
+                            const basegfx::B2DPoint aNewCenter(pWin->GetLogicRange().getCenter());
 
-                            sdr::legacy::SetLogicRect(*pNewDBField, aNewObjectRectangle);
+                            if(!aOldCenter.equal(aNewCenter))
+                            {
+                                sdr::legacy::transformSdrObject(
+                                    *pNewDBField, 
+                                    basegfx::tools::createTranslateB2DHomMatrix(aNewCenter - aOldCenter));
+                            }
 
 							// controls must be on control layer, groups on front layer
 						    if ( dynamic_cast< SdrUnoObj* >(pNewDBField) )

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/fuinsert.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/fuinsert.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/fuinsert.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/fuinsert.cxx Fri Apr 20 09:21:14 2012
@@ -117,9 +117,10 @@ FunctionReference FuInsertGraphic::Creat
 	return xFunc;
 }
 
-#ifdef _MSC_VER
-#pragma optimize ( "", off )
-#endif
+// TTTT needed? Check!
+//#ifdef _MSC_VER
+//#pragma optimize ( "", off )
+//#endif
 
 void FuInsertGraphic::DoExecute( SfxRequest&  )
 {
@@ -127,27 +128,35 @@ void FuInsertGraphic::DoExecute( SfxRequ
 
 	if( aDlg.Execute() == GRFILTER_OK )
 	{
-		Graphic		aGraphic;
-		int nError = aDlg.GetGraphic(aGraphic);
-		if( nError == GRFILTER_OK )
+		Graphic aGraphic;
+		int nError(aDlg.GetGraphic(aGraphic));
+
+        if(GRFILTER_OK == nError)
 		{
-			if( mpViewShell && dynamic_cast< DrawViewShell* >(mpViewShell))
+			if(mpViewShell && dynamic_cast< DrawViewShell* >(mpViewShell))
 			{
-				sal_Int8	nAction = DND_ACTION_COPY;
-				SdrObject* pPickObj = mpView->GetEmptyPresentationObject( PRESOBJ_GRAPHIC );
-				if( pPickObj )
+				sal_Int8 nAction(DND_ACTION_COPY);
+				SdrObject* pPickObj = mpView->GetEmptyPresentationObject(PRESOBJ_GRAPHIC);
+				
+                if(pPickObj)
+                {
 					nAction = DND_ACTION_LINK;
+                }
 
-				const basegfx::B2DPoint aPos(mpWindow->GetInverseViewTransformation() * 
-					basegfx::B2DPoint(mpWindow->GetOutputSizePixel().Width() / 2, mpWindow->GetOutputSizePixel().Height() / 2));
-				SdrGrafObj* pGrafObj = mpView->InsertGraphic(aGraphic, nAction, aPos, pPickObj, NULL);
+				SdrGrafObj* pGrafObj = mpView->InsertGraphic(
+                    aGraphic, 
+                    nAction, 
+                    mpWindow->GetLogicRange().getCenter(), 
+                    pPickObj, 
+                    0);
 
 				if(pGrafObj && aDlg.IsAsLink())
 				{
 					// store link only?
 					String aFltName(aDlg.GetCurrentFilter());
 					String aPath(aDlg.GetPath());
-					pGrafObj->SetGraphicLink(aPath, aFltName);
+
+                    pGrafObj->SetGraphicLink(aPath, aFltName);
 				}
 			}
 		}
@@ -158,9 +167,10 @@ void FuInsertGraphic::DoExecute( SfxRequ
 	}
 }
 
-#ifdef _MSC_VER
-#pragma optimize ( "", on )
-#endif
+// TTTT needed? Check!
+//#ifdef _MSC_VER
+//#pragma optimize ( "", on )
+//#endif
 
 /*************************************************************************
 |*
@@ -214,11 +224,9 @@ void FuInsertClipboard::DoExecute( SfxRe
         if( nFormatId && aDataHelper.GetTransferable().is() )
         {
             sal_Int8 nAction = DND_ACTION_COPY;
-		    const basegfx::B2DPoint aPos(mpWindow->GetInverseViewTransformation() * 
-				basegfx::B2DPoint(mpWindow->GetOutputSizePixel().Width() / 2, mpWindow->GetOutputSizePixel().Height() / 2));
 
             if( !mpView->InsertData( aDataHelper,
-                                    aPos,
+                                    mpWindow->GetLogicRange().getCenter(),
                                     nAction, false, nFormatId ) &&
                 ( mpViewShell && dynamic_cast< DrawViewShell* >(mpViewShell) ) )
             {
@@ -320,33 +328,26 @@ void FuInsertOLE::DoExecute( SfxRequest&
 					// the default size will be set later
 				}
 
-				Size aSize( aSz.Width, aSz.Height );
+                basegfx::B2DVector aScale(aSz.Width, aSz.Height);
 
-				if (aSize.Height() == 0 || aSize.Width() == 0)
+				if(basegfx::fTools::equalZero(aScale.getX()) || basegfx::fTools::equalZero(aScale.getY()))
 				{
 					// Rechteck mit ausgewogenem Kantenverhaeltnis
-					aSize.Width()  = 14100;
-					aSize.Height() = 10000;
-					Size aTmp = OutputDevice::LogicToLogic( aSize, MAP_100TH_MM, aUnit );
-					aSz.Width = aTmp.Width();
-					aSz.Height = aTmp.Height();
-					xObj->setVisualAreaSize( nAspect, aSz );
+                    const double fFactor(OutputDevice::GetFactorLogicToLogic(MAP_100TH_MM, aUnit));
+
+                    aScale = basegfx::B2DVector(14100.0, 10000.0);
+					aSz.Width = basegfx::fround(fabs(aScale.getX() * fFactor));
+					aSz.Height = basegfx::fround(fabs(aScale.getY() * fFactor));
+                    xObj->setVisualAreaSize(nAspect, aSz);
 				}
 				else
 				{
-					aSize = OutputDevice::LogicToLogic(aSize, aUnit, MAP_100TH_MM);
+                    aScale *= OutputDevice::GetFactorLogicToLogic(aUnit, MAP_100TH_MM);
 				}
 
-				Point aPos;
-				const Rectangle aWinRect(aPos, mpWindow->GetOutputSizePixel());
-				aPos = aWinRect.Center();
-				aPos = mpWindow->PixelToLogic(aPos);
-				aPos.X() -= aSize.Width() / 2;
-				aPos.Y() -= aSize.Height() / 2;
-			
 				aObjTrans = basegfx::tools::createScaleTranslateB2DHomMatrix(
-					aSize.getWidth(), aSize.getHeight(),
-					aPos.X(), aPos.Y());
+                    aScale,
+                    mpWindow->GetLogicRange().getCenter() - (aScale * 0.5));
 			}
 
             SdrOle2Obj* pOleObj = new SdrOle2Obj(
@@ -747,33 +748,35 @@ void FuInsertAVMedia::DoExecute( SfxRequ
 		}
 		else
 		{
-			Point	    aPos;
-			Size	    aSize;
-			sal_Int8    nAction = DND_ACTION_COPY;
+            basegfx::B2DPoint aPosition(0.0, 0.0);
+            basegfx::B2DVector aScale(aPrefSize.Width(), aPrefSize.Height());
 
-			if( aPrefSize.Width() && aPrefSize.Height() )
+			if(basegfx::fTools::equalZero(aScale.getX()) || basegfx::fTools::equalZero(aScale.getY()))
+            {
+                aScale = basegfx::B2DVector(5000.0, 5000.0);
+            }
+            else
 			{
-				if( mpWindow )
-					aSize = mpWindow->PixelToLogic( aPrefSize, MAP_100TH_MM );
-				else
-					aSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MAP_100TH_MM );
+                aScale *= Application::GetDefaultDevice()->GetFactorLogicToLogic(MAP_PIXEL, MAP_100TH_MM);
 			}
-			else
-				aSize = Size( 5000, 5000 );
 
-			if( mpWindow )
+			if(mpWindow)
 			{
-				aPos = mpWindow->PixelToLogic( Rectangle( aPos, mpWindow->GetOutputSizePixel() ).Center() );
-				aPos.X() -= aSize.Width() >> 1;
-				aPos.Y() -= aSize.Height() >> 1;
+                aPosition = mpWindow->GetLogicRange().getCenter() - (aScale * 0.5);
 			}
 
-		    mpView->InsertMediaURL( aURL, nAction, 
-				basegfx::B2DPoint(aPos.X(), aPos.Y()), 
-				basegfx::B2DVector(aSize.getWidth(), aSize.getHeight()) ) ;
+			sal_Int8 nAction(DND_ACTION_COPY);
+		    
+            mpView->InsertMediaURL( 
+                aURL, 
+                nAction, 
+                aPosition, 
+                aScale);
 
-			if( mpWindow )
+			if(mpWindow)
+            {
 				mpWindow->LeaveWait();
+            }
 		}
 	}
 }

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/fuzoom.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/fuzoom.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/fuzoom.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/fuzoom.cxx Fri Apr 20 09:21:14 2012
@@ -200,20 +200,16 @@ bool FuZoom::MouseButtonUp(const MouseEv
 		if ( aZoomSizePixel.getX() < fTol && aZoomSizePixel.getY() < fTol )
 		{
 			// Klick auf der Stelle: Zoomfaktor verdoppeln
-			basegfx::B2DPoint aPos(mpWindow->GetInverseViewTransformation() * aPosPix);
-			basegfx::B2DVector aSize(mpWindow->GetInverseViewTransformation() * 
-				basegfx::B2DVector(mpWindow->GetOutputSizePixel().Width(), mpWindow->GetOutputSizePixel().Height()));
-
-			aSize *= 0.5;
-			aPos -= aSize * 0.5;
-			maZoomRange = basegfx::B2DRange(aPos, aPos + aSize);
+			const basegfx::B2DPoint aPos(mpWindow->GetInverseViewTransformation() * aPosPix);
+            const basegfx::B2DVector aScale(mpWindow->GetLogicVector() * 0.25);
+
+            maZoomRange = basegfx::B2DRange(aPos - aScale, aScale * 2.0);
 		}
 
 		mpViewShell->SetZoomRange(maZoomRange);
 	}
 
-	const basegfx::B2DRange aVisAreaWin(mpWindow->GetLogicRange());
-	mpViewShell->GetZoomList()->InsertZoomRange(aVisAreaWin);
+	mpViewShell->GetZoomList()->InsertZoomRange(mpWindow->GetLogicRange());
 
 	mbStartDrag = false;
 	mpWindow->ReleaseMouse();

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/makefile.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/makefile.mk?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/makefile.mk (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/func/makefile.mk Fri Apr 20 09:21:14 2012
@@ -58,7 +58,6 @@ SLOFILES = \
 		$(SLO)$/futransf.obj 	\
 		$(SLO)$/futext.obj		\
 		$(SLO)$/fuline.obj		\
-		$(SLO)$/sdundo.obj		\
 		$(SLO)$/sdundogr.obj 	\
 		$(SLO)$/fuoaprms.obj 	\
 		$(SLO)$/unoaprms.obj 	\
@@ -127,7 +126,6 @@ LIB1OBJFILES= \
 		$(SLO)$/futransf.obj 	\
 		$(SLO)$/futext.obj		\
 		$(SLO)$/fuline.obj		\
-		$(SLO)$/sdundo.obj		\
 		$(SLO)$/sdundogr.obj 	\
 		$(SLO)$/fuoaprms.obj 	\
 		$(SLO)$/unoaprms.obj 	\

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/inc/ViewShell.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/inc/ViewShell.hxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/inc/ViewShell.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/inc/ViewShell.hxx Fri Apr 20 09:21:14 2012
@@ -557,6 +557,10 @@ private:
     /** Create the rulers.
     */
     void SetupRulers (void);
+
+    /** Update VisAreaChanged by using size ouf OutDev
+    */
+    void UpdateVisAreaChanged();
 };
 
 

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/inc/Window.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/inc/Window.hxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/inc/Window.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/inc/Window.hxx Fri Apr 20 09:21:14 2012
@@ -142,8 +142,8 @@ public:
 	double	GetVisibleX();			// Interface fuer ScrollBars
 	double	GetVisibleY();
 	void	SetVisibleXY(double fX, double fY);
-	double	GetVisibleWidth();
-	double	GetVisibleHeight();
+	double	GetVisibleWidthRelativeToView();
+	double	GetVisibleHeightRelativeToView();
 	double	GetScrlLineWidth();
 	double	GetScrlLineHeight();
 	double	GetScrlPageWidth();

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/table/tablefunction.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/table/tablefunction.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/table/tablefunction.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/table/tablefunction.cxx Fri Apr 20 09:21:14 2012
@@ -160,18 +160,12 @@ void DrawViewShell::FuTable(SfxRequest& 
 		}
 		else
 		{
-			const Size aSize( 14100, 200 );
-			Point aPos;
-			const Rectangle aWinRect(aPos, GetActiveWindow()->GetOutputSizePixel());
-
-			aPos = aWinRect.Center();
-			aPos = GetActiveWindow()->PixelToLogic(aPos);
-			aPos.X() -= aSize.Width() / 2;
-			aPos.Y() -= aSize.Height() / 2;
-
-			aObjTrans = basegfx::tools::createScaleTranslateB2DHomMatrix(
-				aSize.getWidth(), aSize.getHeight(),
-				aPos.X(), aPos.Y());
+            const basegfx::B2DPoint aCenter(GetActiveWindow()->GetLogicRange().getCenter());
+            const basegfx::B2DVector aScale(14100.0, 200.0);
+
+            aObjTrans = basegfx::tools::createScaleTranslateB2DHomMatrix(
+                aScale,
+                aCenter - (aScale * 0.5));
 		}
 
 		::sdr::table::SdrTableObj* pObj = new ::sdr::table::SdrTableObj(

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/toolpanel/LayoutMenu.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/toolpanel/LayoutMenu.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/toolpanel/LayoutMenu.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/toolpanel/LayoutMenu.cxx Fri Apr 20 09:21:14 2012
@@ -603,7 +603,6 @@ int LayoutMenu::CalculateRowCount (const
     if (GetItemCount() > 0 && nColumnCount > 0)
     {
         nRowCount = (GetItemCount() + nColumnCount - 1) / nColumnCount;
-        //        nRowCount = GetOutputSizePixel().Height() / rItemSize.Height();
         if (nRowCount < 1)
             nRowCount = 1;
     }

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/toolpanel/TestMenu.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/toolpanel/TestMenu.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/toolpanel/TestMenu.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/toolpanel/TestMenu.cxx Fri Apr 20 09:21:14 2012
@@ -169,14 +169,11 @@ bool ColorMenu::IsResizable (void)
 void ColorMenu::Resize (void)
 {
     ::Window::Resize();
-    Size aWindowSize = GetOutputSizePixel();
+    const Size aWindowSize(GetOutputSizePixel());
     maSet.SetPosSizePixel (Point(0,0), aWindowSize);
+
     if (IsVisible() && aWindowSize.Width() > 0)
     {
-        //        maSet.SetPosSizePixel (
-        //            Point (0,0),
-        //            aWindowSize);
-
         // Calculate the number of rows and columns.
         if (maSet.GetItemCount() > 0)
         {

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviews4.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviews4.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviews4.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviews4.cxx Fri Apr 20 09:21:14 2012
@@ -443,7 +443,7 @@ void DrawViewShell::MouseButtonUp(const 
 				{
 					SdPage& rPage = (SdPage&) mpDrawView->GetSdrPageView()->getSdrPageFromSdrPageView();
 					const basegfx::B2DPoint aOrg(rPage.GetLeftPageBorder(), rPage.GetTopPageBorder());
-				mpDrawView->GetSdrPageView()->SetPageOrigin(aOrg);
+				    mpDrawView->GetSdrPageView()->SetPageOrigin(aOrg);
 				}
 
 				GetViewFrame()->GetBindings().Invalidate(SID_RULER_NULL_OFFSET);

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewsb.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewsb.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewsb.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewsb.cxx Fri Apr 20 09:21:14 2012
@@ -492,7 +492,7 @@ void DrawViewShell::FuTemp02(SfxRequest&
 		case SID_INSERT_FLD_PAGES:
 		case SID_INSERT_FLD_FILE:
 		{
-			sal_uInt16 nMul = 1;
+			double fMul(1.0);
 			SvxFieldItem* pFieldItem = 0;
 
 			switch( nSId )
@@ -527,14 +527,14 @@ void DrawViewShell::FuTemp02(SfxRequest&
 				case SID_INSERT_FLD_PAGE:
 				{
                     pFieldItem = new SvxFieldItem( SvxPageField(), EE_FEATURE_FIELD );
-					nMul = 3;
+					fMul = 3.0;
 				}
 				break;
 
                 case SID_INSERT_FLD_PAGES:
 				{
                     pFieldItem = new SvxFieldItem( SvxPagesField(), EE_FEATURE_FIELD );
-					nMul = 3;
+					fMul = 3.0;
 				}
 				break;
 
@@ -584,31 +584,28 @@ void DrawViewShell::FuTemp02(SfxRequest&
 				pOutl->QuickInsertField( *pFieldItem, ESelection() );
 				OutlinerParaObject* pOutlParaObject = pOutl->CreateParaObject();
 
-				SdrRectObj* pRectObj = new SdrRectObj(
-					*GetDoc(),
-					basegfx::B2DHomMatrix(),
-					OBJ_TEXT,
-					true);
-				pRectObj->SetMergedItem(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true));
 
 				pOutl->UpdateFields();
 				pOutl->SetUpdateMode( true );
-				Size aSize( pOutl->CalcTextSize() );
-				aSize.Width() *= nMul;
+                const Size aSize(pOutl->CalcTextSize());
 				pOutl->SetUpdateMode( false );
 
-				Point aPos;
-				Rectangle aRect( aPos, GetActiveWindow()->GetOutputSizePixel() );
-				aPos = aRect.Center();
-				aPos = GetActiveWindow()->PixelToLogic(aPos);
-				aPos.X() -= aSize.Width() / 2;
-				aPos.Y() -= aSize.Height() / 2;
-
-				Rectangle aLogicRect(aPos, aSize);
-				sdr::legacy::SetLogicRect(*pRectObj, aLogicRect);
-				pRectObj->SetOutlinerParaObject( pOutlParaObject );
+                const basegfx::B2DVector aScale(aSize.Width() * fMul, aSize.Height() * fMul);
+                const basegfx::B2DPoint aPos(GetActiveWindow()->GetLogicRange().getCenter());
+                const basegfx::B2DHomMatrix aObjTrans(
+                    basegfx::tools::createScaleTranslateB2DHomMatrix(
+                        aScale,
+                        aPos - (aScale * 0.5)));
+				SdrRectObj* pRectObj = new SdrRectObj(
+					*GetDoc(),
+					aObjTrans,
+					OBJ_TEXT,
+					true);
+
+                pRectObj->SetMergedItem(SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, true));
+				pRectObj->SetOutlinerParaObject(pOutlParaObject);
 				mpDrawView->InsertObjectAtView(*pRectObj);
-				pOutl->Init( nOutlMode );
+				pOutl->Init(nOutlMode);
 			}
 
 			delete pFieldItem;

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewse.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewse.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewse.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/drviewse.cxx Fri Apr 20 09:21:14 2012
@@ -828,11 +828,7 @@ void DrawViewShell::FuSupport(SfxRequest
 	        if( nFormat && aDataHelper.GetTransferable().is() )
 	        {
 		        sal_Int8 nAction = DND_ACTION_COPY;
-			    const basegfx::B2DPoint aPos(
-					GetActiveWindow()->GetInverseViewTransformation() * 
-						basegfx::B2DPoint(
-							GetActiveWindow()->GetOutputSizePixel().Width() * 0.5, 
-							GetActiveWindow()->GetOutputSizePixel().Height() * 0.5));
+			    const basegfx::B2DPoint aPos(GetActiveWindow()->GetLogicRange().getCenter());
 
                 if( !mpDrawView->InsertData( aDataHelper,
 						                  aPos,
@@ -1498,36 +1494,25 @@ void DrawViewShell::InsertURLField(const
 		pOutl->QuickInsertField( aURLItem, ESelection() );
 		OutlinerParaObject* pOutlParaObject = pOutl->CreateParaObject();
 
-		SdrRectObj* pRectObj = new SdrRectObj(
-			*GetDoc(),
-			basegfx::B2DHomMatrix(),
-			OBJ_TEXT,
-			true);
-
 		pOutl->UpdateFields();
 		pOutl->SetUpdateMode( true );
 		const Size aOldSize(pOutl->CalcTextSize());
-		const basegfx::B2DVector aSize(aOldSize.Width(), aOldSize.Height());
 		pOutl->SetUpdateMode( false );
 
-		basegfx::B2DPoint aPos;
-
-		if (pPos)
-		{
-			aPos = *pPos;
-		}
-		else
-		{
-			const Size aPixelSize(GetActiveWindow()->GetOutputSizePixel());
-			const basegfx::B2DPoint aPixelCenter(aPixelSize.Width(), aPixelSize.Height());
-
-			aPos = GetActiveWindow()->GetInverseViewTransformation() * aPixelCenter;
-			aPos -= aSize * 0.5;
-		}
-
-		const basegfx::B2DRange aLogicRange(aPos, aPos + aSize);
+        // originally when pPos it was taken as TopLeft of new object, not
+        // as center; I guess this was an error, all other inserters use center
+		const basegfx::B2DPoint aPos(pPos ? *pPos : GetActiveWindow()->GetLogicRange().getCenter());
+		const basegfx::B2DVector aSize(aOldSize.Width(), aOldSize.Height());
+        const basegfx::B2DHomMatrix aObjTrans(
+            basegfx::tools::createScaleTranslateB2DHomMatrix(
+                aSize,
+                aPos - (aSize * 0.5)));
+		SdrRectObj* pRectObj = new SdrRectObj(
+			*GetDoc(),
+			aObjTrans,
+			OBJ_TEXT,
+			true);
 		
-		sdr::legacy::SetLogicRange(*pRectObj, aLogicRange);
 		pRectObj->SetOutlinerParaObject( pOutlParaObject );
 		mpDrawView->InsertObjectAtView(*pRectObj);
 		pOutl->Init( nOutlMode );
@@ -1606,33 +1591,28 @@ void DrawViewShell::InsertURLButton(cons
 		if ( ::avmedia::MediaWindow::isMediaURL( rURL ) )
 			xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DispatchURLInternal" )), Any( sal_True ) );
 
-        basegfx::B2DPoint aPos;
+        const basegfx::B2DPoint aPos(pPos ? *pPos : GetActiveWindow()->GetLogicRange().getCenter());
+		const basegfx::B2DVector aSize(4000.0, 1000.0);
+        const basegfx::B2DHomMatrix aObjTrans(
+            basegfx::tools::createScaleTranslateB2DHomMatrix(
+                aSize,
+                aPos - (aSize * 0.5)));
+        sal_uLong nOptions(SDRINSERT_SETDEFLAYER);
 
-        if (pPos)
+        pUnoCtrl->setSdrObjectTransformation(aObjTrans);
+
+        if(GetViewShell())
         {
-            aPos = *pPos;
+            SfxInPlaceClient* pIpClient = GetViewShell()->GetIPClient();
+            
+            if(pIpClient && pIpClient->IsObjectInPlaceActive())
+            {
+                nOptions |= SDRINSERT_DONTMARK;
+            }
         }
         else
         {
-			const Size aPixelSize(GetActiveWindow()->GetOutputSizePixel());
-			const basegfx::B2DPoint aPixelCenter(aPixelSize.Width(), aPixelSize.Height());
-
-			aPos = GetActiveWindow()->GetInverseViewTransformation() * aPixelCenter;
-        }
-
-		basegfx::B2DVector aSize(4000.0, 1000.0);
-        
-		aPos -= aSize * 0.5;
-
-		sdr::legacy::SetLogicRange(*pUnoCtrl, basegfx::B2DRange(aPos, aPos + aSize));
-
-        sal_uLong nOptions = SDRINSERT_SETDEFLAYER;
-
-        OSL_ASSERT (GetViewShell()!=NULL);
-        SfxInPlaceClient* pIpClient = GetViewShell()->GetIPClient();
-        if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive())
-        {
-            nOptions |= SDRINSERT_DONTMARK;
+            OSL_ENSURE(false, "No ViewShell ?");
         }
 
         mpDrawView->InsertObjectAtView(*pUnoCtrl, nOptions);

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/outlnvsh.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/outlnvsh.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/outlnvsh.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/outlnvsh.cxx Fri Apr 20 09:21:14 2012
@@ -300,13 +300,9 @@ void OutlineViewShell::ArrangeGUIElement
     {
         pWindow->SetMinZoomAutoCalc(false);
 
-        // pWindow->SetPosSizePixel(rNewPos, Size(nSizeX, nSizeY));
-
         // OutputArea der OutlinerView aendern
         OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWindow);
-
         Rectangle aWin(Point(0,0), pWindow->GetOutputSizePixel());
-//		aWin.nLeft = pOlView->GetPageNumberWidthPixel();
 
         aWin = pWindow->PixelToLogic(aWin);
         pOutlinerView->SetOutputArea(aWin);

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/outlview.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/outlview.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/outlview.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/outlview.cxx Fri Apr 20 09:21:14 2012
@@ -965,8 +965,7 @@ IMPL_LINK( OutlineView, StatusEventHdl, 
 
 	if (!aVis.IsEmpty())		// nicht beim Oeffnen
 	{
-		const Rectangle aWin(pWin->PixelToLogic(Rectangle(Point(0,0), pWin->GetOutputSizePixel())));
-		const Size aTextSize(OUTLINE_PAPERWIDTH, mpOutliner->GetTextHeight() + aWin.GetHeight());
+		const Size aTextSize(OUTLINE_PAPERWIDTH, mpOutliner->GetTextHeight() + pWin->GetLogicVector().getY());
 
 		mpOutlineViewShell->InitWindows(
 			basegfx::B2DPoint(0.0, 0.0), 

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview2.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview2.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/sdview2.cxx Fri Apr 20 09:21:14 2012
@@ -369,22 +369,19 @@ void View::DoPaste (::Window* pWindow)
 	}
 	else
 	{
-        basegfx::B2DPoint aPos;
-		sal_Int8    nDnDAction = DND_ACTION_COPY;
+        DrawViewShell* pDrViewSh = dynamic_cast< DrawViewShell* >(mpDocSh->GetViewShell());
 
-	    if( pWindow )
-		{
-			aPos = pWindow->GetInverseViewTransformation() * 
-				basegfx::B2DPoint(
-					pWindow->GetOutputSizePixel().Width() * 0.5, 
-					pWindow->GetOutputSizePixel().Height() * 0.5);
-		}
+        if(pDrViewSh)
+        {
+            basegfx::B2DPoint aPos(0.0, 0.0);
+    		sal_Int8 nDnDAction(DND_ACTION_COPY);
 
-        DrawViewShell* pDrViewSh = (DrawViewShell*) mpDocSh->GetViewShell();
+	        if(pWindow)
+		    {
+                aPos = pWindow->GetLogicRange().getCenter();
+            }
 
-        if (pDrViewSh != NULL)
-        {
-            if( !InsertData( aDataHelper, aPos, nDnDAction, false ) )
+            if(!InsertData(aDataHelper, aPos, nDnDAction, false))
             {
 				INetBookmark	aINetBookmark( aEmptyStr, aEmptyStr );
 
@@ -1019,8 +1016,6 @@ bool View::GetExchangeList( List*& rpExc
 	return( bNameOK );
 }
 
-typedef std::vector< std::pair< sal_uInt32, sal_uInt32 > > PathSurrogateVector;
-
 void ImplProcessObjectList(SdrObject* pObj, SdrObjectVector& rVector )
 {
 	const bool bIsGroup(pObj->getChildrenOfSdrObject());

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=1328271&r1=1328270&r2=1328271&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 Fri Apr 20 09:21:14 2012
@@ -161,8 +161,7 @@ void Window::CalcMinZoom()
             // and calculate the scaling factors that would lead to the view
             // area (also called application area) to completely fill the
             // window.
-			const basegfx::B2DVector aDiscretePixels(GetOutputSizePixel().Width(), GetOutputSizePixel().Height());
-			const basegfx::B2DVector aWinSize(GetInverseViewTransformation() * aDiscretePixels);
+			const basegfx::B2DVector aWinSize(GetLogicVector());
 			const double fX(aWinSize.getX() / maViewSize.getX());
 			const double fY(aWinSize.getY() / maViewSize.getY());
 
@@ -496,8 +495,7 @@ void Window::SetZoomIntegral(double fZoo
 	}
 
     // Calculate the window's new origin.
-	const basegfx::B2DVector aDiscretePixels(GetOutputSizePixel().Width(), GetOutputSizePixel().Height());
-	const basegfx::B2DVector aWinSize(GetInverseViewTransformation() * aDiscretePixels);
+	const basegfx::B2DVector aWinSize(GetLogicVector());
 	const double fW(aWinSize.getX() * GetZoom() / fZoom);
 	const double fH(aWinSize.getY() * GetZoom() / fZoom);
 
@@ -532,8 +530,7 @@ double Window::GetZoomForRange(const bas
         // coordinate directions .
 		double fX(0.0);
 		double fY(0.0);
-		const basegfx::B2DVector aDiscretePixels(GetOutputSizePixel().Width(), GetOutputSizePixel().Height());
-		const basegfx::B2DVector aWinSize(GetInverseViewTransformation() * aDiscretePixels);
+		const basegfx::B2DVector aWinSize(GetLogicVector());
 
 		if(!basegfx::fTools::equalZero(aZoomScale.getY()))
 		{
@@ -599,12 +596,7 @@ double Window::SetZoomRange(const basegf
 		const basegfx::B2DPoint aPos(rZoomRange.getMinimum());
         // Transform the output area from pixel coordinates into logical
         // coordinates.
-		const basegfx::B2DVector aDiscretePixels(GetOutputSizePixel().Width(), GetOutputSizePixel().Height());
-		const basegfx::B2DVector aWinSize(GetInverseViewTransformation() * aDiscretePixels);
-        // Paranoia!  The degenerate case of zero width or height has been
-        // taken care of above.
-		DBG_ASSERT(aZoomScale.getX(), "ZoomRect-Breite = 0!");
-		DBG_ASSERT(aZoomScale.getY(), "ZoomRect-Hoehe = 0!");
+		const basegfx::B2DVector aWinSize(GetLogicVector());
 
         // Calculate the scale factors which will lead to the given
         // rectangle being fully visible (when translated accordingly) as
@@ -613,14 +605,14 @@ double Window::SetZoomRange(const basegf
 		double fX(0.0);
 		double fY(0.0);
 
-		if(!basegfx::fTools::equalZero(aZoomScale.getY()))
+		if(!basegfx::fTools::equalZero(aZoomScale.getX()))
 		{
-			fX = aWinSize.getY() / aZoomScale.getY();
+			fX = aWinSize.getX() / aZoomScale.getX();
 		}
 
-		if(!basegfx::fTools::equalZero(aZoomScale.getX()))
+		if(!basegfx::fTools::equalZero(aZoomScale.getY()))
 		{
-			fY = aWinSize.getX() / aZoomScale.getX();
+			fY = aWinSize.getY() / aZoomScale.getY();
 		}
 
         // Use the smaller one of both so that the zoom rectangle will be
@@ -697,8 +689,7 @@ void Window::UpdateMapOrigin(bool bInval
 
 	if ( mbCenterAllowed )
 	{
-		const basegfx::B2DVector aDiscretePixels(GetOutputSizePixel().Width(), GetOutputSizePixel().Height());
-		const basegfx::B2DVector aWinSize(GetInverseViewTransformation() * aDiscretePixels);
+		const basegfx::B2DVector aWinSize(GetLogicVector());
 
 		if(basegfx::fTools::more(maWinPos.getX(), maViewSize.getX() - aWinSize.getX()))
 		{
@@ -733,53 +724,21 @@ void Window::UpdateMapOrigin(bool bInval
     }
 }
 
-
-
-
-void Window::UpdateMapMode (void)
+void Window::UpdateMapMode(void)
 {
-    maWinPos -= maViewOrigin;
-    
-	basegfx::B2DPoint aDiscretePosition(GetViewTransformation() * maWinPos);
-    // Groesse muss vielfaches von BRUSH_SIZE sein, damit Muster
-    // richtig dargestellt werden
-    // #i2237#
-    // removed old stuff here which still forced zoom to be
-    // %BRUSH_SIZE which is outdated now
+    const Point aNewOffset(
+        basegfx::fround(maViewOrigin.getX() - maWinPos.getX()), 
+        basegfx::fround(maViewOrigin.getY() - maWinPos.getY()));
+	MapMode aMap(GetMapMode());
 
-    if (mpViewShell && dynamic_cast< DrawViewShell* >(mpViewShell))
+    if(aMap.GetOrigin() != aNewOffset)
     {
-        // Seite soll nicht am Fensterrand "kleben"
-        if(basegfx::fTools::equalZero(aDiscretePosition.getX()))
-        {
-            // #i2237#
-            // Since BRUSH_SIZE alignment is outdated now, i use the
-            // former constant here directly
-            aDiscretePosition.setX(aDiscretePosition.getX() - 8.0);
-        }
+        aMap.SetOrigin(aNewOffset);
 
-		if(basegfx::fTools::equalZero(aDiscretePosition.getY()))
-        {
-            // #i2237#
-            // Since BRUSH_SIZE alignment is outdated now, i use the
-            // former constant here directly
-            aDiscretePosition.setY(aDiscretePosition.getY() - 8.0);
-        }
+        SetMapMode(aMap);
     }
-    
-    maWinPos = GetInverseViewTransformation() * aDiscretePosition;
-	const Point aNewOrigin(basegfx::fround(-maWinPos.getX()), basegfx::fround(-maWinPos.getY()));
-
-    maWinPos += maViewOrigin;
-    
-	MapMode aMap(GetMapMode());
-    aMap.SetOrigin(aNewOrigin);
-    SetMapMode(aMap);
 }
 
-
-
-
 /*************************************************************************
 |*
 |* X-Position des sichtbaren Bereichs als Bruchteil (< 1)
@@ -841,10 +800,9 @@ void Window::SetVisibleXY(double fX, dou
 |*
 \************************************************************************/
 
-double Window::GetVisibleWidth()
+double Window::GetVisibleWidthRelativeToView()
 {
-	const basegfx::B2DVector aDiscretePixels(GetOutputSizePixel().Width(), GetOutputSizePixel().Height());
-	basegfx::B2DVector aWinSize(GetInverseViewTransformation() * aDiscretePixels);
+	basegfx::B2DVector aWinSize(GetLogicVector());
 
 	if(basegfx::fTools::more(aWinSize.getX(), maViewSize.getX()))
 	{
@@ -861,10 +819,9 @@ double Window::GetVisibleWidth()
 |*
 \************************************************************************/
 
-double Window::GetVisibleHeight()
+double Window::GetVisibleHeightRelativeToView()
 {
-	const basegfx::B2DVector aDiscretePixels(GetOutputSizePixel().Width(), GetOutputSizePixel().Height());
-	basegfx::B2DVector aWinSize(GetInverseViewTransformation() * aDiscretePixels);
+	basegfx::B2DVector aWinSize(GetLogicVector());
 
 	if(basegfx::fTools::more(aWinSize.getY(), maViewSize.getY()))
 	{
@@ -883,7 +840,7 @@ double Window::GetVisibleHeight()
 
 double Window::GetScrlLineWidth()
 {
-	return (GetVisibleWidth() * SCROLL_LINE_FACT);
+	return (GetVisibleWidthRelativeToView() * SCROLL_LINE_FACT);
 }
 
 /*************************************************************************
@@ -895,7 +852,7 @@ double Window::GetScrlLineWidth()
 
 double Window::GetScrlLineHeight()
 {
-	return (GetVisibleHeight() * SCROLL_LINE_FACT);
+	return (GetVisibleHeightRelativeToView() * SCROLL_LINE_FACT);
 }
 
 /*************************************************************************
@@ -907,7 +864,7 @@ double Window::GetScrlLineHeight()
 
 double Window::GetScrlPageWidth()
 {
-	return (GetVisibleWidth() * SCROLL_PAGE_FACT);
+	return (GetVisibleWidthRelativeToView() * SCROLL_PAGE_FACT);
 }
 
 /*************************************************************************
@@ -919,7 +876,7 @@ double Window::GetScrlPageWidth()
 
 double Window::GetScrlPageHeight()
 {
-	return (GetVisibleHeight() * SCROLL_PAGE_FACT);
+	return (GetVisibleHeightRelativeToView() * SCROLL_PAGE_FACT);
 }
 
 /*************************************************************************
@@ -1164,7 +1121,7 @@ void Window::SetUseDropScroll (bool bUse
 
 void Window::DropScroll(const basegfx::B2DPoint& rMousePos)
 {
-	const basegfx::B2DVector aDiscretePixels(GetOutputSizePixel().Width(), GetOutputSizePixel().Height());
+	const basegfx::B2DVector aDiscretePixels(GetDiscreteVector());
 	basegfx::B2DVector fDelta(0.0, 0.0);
 
 	if (aDiscretePixels.getX() > SCROLL_SENSITIVE * 3)
@@ -1202,8 +1159,8 @@ void Window::DropScroll(const basegfx::B
 		else 
 		{
             mnTicks ++;
-	}
-}
+	    }
+    }
 }
 
 

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=1328271&r1=1328270&r2=1328271&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 Fri Apr 20 09:21:14 2012
@@ -105,7 +105,7 @@ void ViewShell::UpdateScrollBars()
 {
 	if (mpHorizontalScrollBar.get() != NULL)
 	{
-		long nW = (long)(mpContentWindow->GetVisibleWidth() * 32000);
+		long nW = (long)(mpContentWindow->GetVisibleWidthRelativeToView() * 32000);
 		long nX = (long)(mpContentWindow->GetVisibleX() * 32000);
 		mpHorizontalScrollBar->SetVisibleSize(nW);
 		mpHorizontalScrollBar->SetThumbPos(nX);
@@ -118,7 +118,7 @@ void ViewShell::UpdateScrollBars()
 
 	if (mpVerticalScrollBar.get() != NULL)
 	{
-		long nH = (long)(mpContentWindow->GetVisibleHeight() * 32000);
+		long nH = (long)(mpContentWindow->GetVisibleHeightRelativeToView() * 32000);
 		long nY = (long)(mpContentWindow->GetVisibleY() * 32000);
 
 		if(IsPageFlipMode()) // ie in zoom mode where no panning
@@ -194,10 +194,7 @@ long ViewShell::VirtHScrollHdl(ScrollBar
         Point aVisAreaPos = GetActiveWindow()->PixelToLogic( Point(0,0) );
         aVisArea.SetPos(aVisAreaPos);
         GetDocSh()->SetVisArea(aVisArea);
-
-        Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
-        Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
-        VisAreaChanged(aVisAreaWin);
+        UpdateVisAreaChanged();
 
         if (pView)
         {
@@ -262,10 +259,7 @@ long ViewShell::VirtVScrollHdl(ScrollBar
         Point aVisAreaPos = GetActiveWindow()->PixelToLogic( Point(0,0) );
         aVisArea.SetPos(aVisAreaPos);
         GetDocSh()->SetVisArea(aVisArea);
-
-        Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
-        Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
-        VisAreaChanged(aVisAreaWin);
+        UpdateVisAreaChanged();
 
         if (pView)
         {
@@ -363,10 +357,7 @@ void ViewShell::Scroll(long nScrollX, lo
 	Point aVisAreaPos = GetActiveWindow()->PixelToLogic( Point(0,0) );
 	aVisArea.SetPos(aVisAreaPos);
 	GetDocSh()->SetVisArea(aVisArea);
-
-	Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
-	Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
-	VisAreaChanged(aVisAreaWin);
+    UpdateVisAreaChanged();
 
 	::sd::View* pView = GetView();
 	if (pView)
@@ -409,9 +400,7 @@ void ViewShell::SetZoom(long nZoom)
         mpContentWindow->Invalidate(INVALIDATE_CHILDREN);
     }
 
-	Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
-	Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
-	VisAreaChanged(aVisAreaWin);
+    UpdateVisAreaChanged();
 
 	::sd::View* pView = GetView();
 	if (pView)
@@ -456,9 +445,7 @@ void ViewShell::SetZoomRange(const baseg
         mpContentWindow->Invalidate(INVALIDATE_CHILDREN);
     }
 
-	Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
-	Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
-	VisAreaChanged(aVisAreaWin);
+    UpdateVisAreaChanged();
 
 	::sd::View* pView = GetView();
 	if (pView)
@@ -490,9 +477,7 @@ void ViewShell::InitWindows(const basegf
         }
     }
 
-	Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
-	Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
-	VisAreaChanged(aVisAreaWin);
+    UpdateVisAreaChanged();
 
 	::sd::View* pView = GetView();
 	if (pView)
@@ -1181,10 +1166,7 @@ void ViewShell::SetWinViewPos(const base
 	}
 
 	UpdateScrollBars();
-
-	Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
-	Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
-	VisAreaChanged(aVisAreaWin);
+    UpdateVisAreaChanged();
 
 	::sd::View* pView = GetView();
 	if (pView)
@@ -1232,4 +1214,11 @@ void ViewShell::AdaptDefaultsForChart(
     }
 }
 
+void ViewShell::UpdateVisAreaChanged()
+{
+	Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
+	Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
+	VisAreaChanged(aVisAreaWin);
+}
+
 } // end of namespace sd

Modified: incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/viewshel.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/viewshel.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/viewshel.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/ui/view/viewshel.cxx Fri Apr 20 09:21:14 2012
@@ -136,7 +136,7 @@ static const int DELTA_ZOOM = 10;
 bool ViewShell::IsPageFlipMode(void) const
 {
 	return dynamic_cast< const DrawViewShell* >(this) && mpContentWindow.get() != NULL &&
-		mpContentWindow->GetVisibleHeight() >= 1.0;
+		mpContentWindow->GetVisibleHeightRelativeToView() >= 1.0;
 }
 
 SfxViewFrame* ViewShell::GetViewFrame (void) const
@@ -809,26 +809,11 @@ void ViewShell::Resize (void)
 		return;
 
     // Remember the new position and size.
-	maViewPos = Point(0,0); //mpParentWindow->GetPosPixel();
+	maViewPos = Point(0,0);
 	maViewSize = aSize;
 
     // Rearrange the UI elements to take care of the new position and size.
     ArrangeGUIElements ();
-    // end of included AdjustPosSizePixel.
-
-    Size aS (GetParentWindow()->GetOutputSizePixel());
-	Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
-	Rectangle aVisArea = GetParentWindow()->PixelToLogic(
-        Rectangle( Point(0,0), aVisSizePixel));
-    Rectangle aCurrentVisArea (GetDocSh()->GetVisArea(ASPECT_CONTENT));
-    Rectangle aWindowRect = GetActiveWindow()->LogicToPixel(aCurrentVisArea);
-	if (GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED
-        && IsMainViewShell())
-	{
-        //        GetDocSh()->SetVisArea(aVisArea);
-	}
-
-    //	VisAreaChanged(aVisArea);
 
 	::sd::View* pView = GetView();
 

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/dialog/grfflt.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/dialog/grfflt.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/dialog/grfflt.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/dialog/grfflt.cxx Fri Apr 20 09:21:14 2012
@@ -346,444 +346,5 @@ void SvxGraphicFilter::DisableGraphicFil
 	if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( SID_GRFFILTER_SOLARIZE ) )
 		rSet.DisableItem( SID_GRFFILTER_SOLARIZE );
 };
-/* CHINA001 move to cuigrfflt.cxx
-// --------------------------------------
-// - GraphicFilterDialog::PreviewWindow -
-// --------------------------------------
 
-GraphicFilterDialog::PreviewWindow::PreviewWindow( Window* pParent, const ResId& rResId ) :
-	Control( pParent, rResId )
-{
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterDialog::PreviewWindow::~PreviewWindow()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-void GraphicFilterDialog::PreviewWindow::Paint( const Rectangle& rRect )
-{
-	Control::Paint( rRect );
-
-	const Size	aGrfSize( LogicToPixel( maGraphic.GetPrefSize(), maGraphic.GetPrefMapMode() ) );
-	const Size	aOutSize( GetOutputSizePixel() );
-	const Point aGrfPos( ( aOutSize.Width() - aGrfSize.Width() ) >> 1,
-						 ( aOutSize.Height() - aGrfSize.Height() ) >> 1 );
-
-	if( maGraphic.IsAnimated() )
-		maGraphic.StartAnimation( this , aGrfPos, aGrfSize );
-	else
-		maGraphic.Draw( this, aGrfPos, aGrfSize );
-}
-
-// -----------------------------------------------------------------------------
-
-void GraphicFilterDialog::PreviewWindow::SetGraphic( const Graphic& rGraphic )
-{
-	maGraphic = rGraphic;
-
-	if( maGraphic.IsAnimated() || maGraphic.IsTransparent() )
-		Invalidate();
-	else
-		Paint( Rectangle( Point(), GetOutputSizePixel() ) );
-}
-
-// -----------------------
-// - GraphicFilterDialog -
-// -----------------------
-
-GraphicFilterDialog::GraphicFilterDialog( Window* pParent, const ResId& rResId, const Graphic& rGraphic ) :
-	ModalDialog		( pParent, rResId ),
-	mfScaleX		( 0.0 ),
-	mfScaleY		( 0.0 ),
-	maSizePixel		( LogicToPixel( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode() ) ),
-	maModifyHdl		( LINK( this, GraphicFilterDialog, ImplModifyHdl ) ),
-	maPreview		( this, SVX_RES( CTL_PREVIEW ) ),
-	maFlParameter	( this, SVX_RES( FL_PARAMETER ) ),
-	maBtnOK			( this, SVX_RES( BTN_OK ) ),
-	maBtnCancel		( this, SVX_RES( BTN_CANCEL ) ),
-	maBtnHelp		( this, SVX_RES( BTN_HELP ) )
-{
-	const Size	aPreviewSize( maPreview.GetOutputSizePixel() );
-	Size		aGrfSize( maSizePixel );
-
-	if( rGraphic.GetType() == GRAPHIC_BITMAP &&
-		aPreviewSize.Width() && aPreviewSize.Height() &&
-		aGrfSize.Width() && aGrfSize.Height() )
-	{
-		const double fGrfWH = (double) aGrfSize.Width() / aGrfSize.Height();
-		const double fPreWH = (double) aPreviewSize.Width() / aPreviewSize.Height();
-
-		if( fGrfWH < fPreWH )
-		{
-			aGrfSize.Width() = (long) ( aPreviewSize.Height() * fGrfWH );
-			aGrfSize.Height()= aPreviewSize.Height();
-		}
-		else
-		{
-			aGrfSize.Width() = aPreviewSize.Width();
-			aGrfSize.Height()= (long) ( aPreviewSize.Width() / fGrfWH);
-		}
-
-		mfScaleX = (double) aGrfSize.Width() / maSizePixel.Width();
-		mfScaleY = (double) aGrfSize.Height() / maSizePixel.Height();
-
-		if( !rGraphic.IsAnimated() )
-		{
-			BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
-			if( aBmpEx.Scale( aGrfSize, BMP_SCALE_INTERPOLATE ) )
-				maGraphic = aBmpEx;
-		}
-	}
-
-	maTimer.SetTimeoutHdl( LINK( this, GraphicFilterDialog, ImplPreviewTimeoutHdl ) );
-	maTimer.SetTimeout( 100 );
-	ImplModifyHdl( NULL );
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterDialog::~GraphicFilterDialog()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-IMPL_LINK( GraphicFilterDialog, ImplPreviewTimeoutHdl, Timer*, pTimer )
-{
-	maTimer.Stop();
-	maPreview.SetGraphic( GetFilteredGraphic( maGraphic, mfScaleX, mfScaleY ) );
-
-	return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-IMPL_LINK( GraphicFilterDialog, ImplModifyHdl, void*, p )
-{
-	if( maGraphic.GetType() == GRAPHIC_BITMAP )
-	{
-		maTimer.Stop();
-		maTimer.Start();
-	}
-
-	return 0;
-}
-
-// ----------------
-// - FilterMosaic -
-// ----------------
-
-GraphicFilterMosaic::GraphicFilterMosaic( Window* pParent, const Graphic& rGraphic,
-										  sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, sal_Bool bEnhanceEdges ) :
-	GraphicFilterDialog( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_MOSAIC ), rGraphic ),
-	maFtWidth	( this, SVX_RES( DLG_FILTERMOSAIC_FT_WIDTH ) ),
-	maMtrWidth	( this, SVX_RES( DLG_FILTERMOSAIC_MTR_WIDTH ) ),
-	maFtHeight	( this, SVX_RES( DLG_FILTERMOSAIC_FT_HEIGHT ) ),
-	maMtrHeight ( this, SVX_RES( DLG_FILTERMOSAIC_MTR_HEIGHT ) ),
-	maCbxEdges	( this, SVX_RES( DLG_FILTERMOSAIC_CBX_EDGES ) )
-{
-	FreeResource();
-
-	maMtrWidth.SetValue( nTileWidth );
-	maMtrWidth.SetLast( GetGraphicSizePixel().Width() );
-	maMtrWidth.SetModifyHdl( GetModifyHdl() );
-
-	maMtrHeight.SetValue( nTileHeight );
-	maMtrHeight.SetLast( GetGraphicSizePixel().Height() );
-	maMtrHeight.SetModifyHdl( GetModifyHdl() );
-
-	maCbxEdges.Check( bEnhanceEdges );
-	maCbxEdges.SetToggleHdl( GetModifyHdl() );
-
-	maMtrWidth.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterMosaic::~GraphicFilterMosaic()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic	GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
-												 double fScaleX, double fScaleY )
-{
-	Graphic			aRet;
-	const Size		aSize( Max( FRound( GetTileWidth() * fScaleX ), 1L ),
-						   Max( FRound( GetTileHeight() * fScaleY ), 1L ) );
-	BmpFilterParam	aParam( aSize );
-
-	if( rGraphic.IsAnimated() )
-	{
-		Animation aAnim( rGraphic.GetAnimation() );
-
-		if( aAnim.Filter( BMP_FILTER_MOSAIC, &aParam ) )
-		{
-			if( IsEnhanceEdges() )
-				aAnim.Filter( BMP_FILTER_SHARPEN );
-
-			aRet = aAnim;
-		}
-	}
-	else
-	{
-		BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
-		if( aBmpEx.Filter( BMP_FILTER_MOSAIC, &aParam ) )
-		{
-			if( IsEnhanceEdges() )
-				aBmpEx.Filter( BMP_FILTER_SHARPEN );
-
-			aRet = aBmpEx;
-		}
-	}
-
-	return aRet;
-}
-
-// ------------------
-// - GraphicFilterSolarize -
-// ------------------
-
-GraphicFilterSolarize::GraphicFilterSolarize( Window* pParent, const Graphic& rGraphic,
-											  sal_uInt8 cGreyThreshold, sal_Bool bInvert ) :
-	GraphicFilterDialog	( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_SOLARIZE ), rGraphic ),
-	maFtThreshold	( this, SVX_RES( DLG_FILTERSOLARIZE_FT_THRESHOLD ) ),
-	maMtrThreshold	( this, SVX_RES( DLG_FILTERSOLARIZE_MTR_THRESHOLD ) ),
-	maCbxInvert		( this, SVX_RES( DLG_FILTERSOLARIZE_CBX_INVERT ) )
-{
-	FreeResource();
-
-	maMtrThreshold.SetValue( FRound( cGreyThreshold / 2.55 ) );
-	maMtrThreshold.SetModifyHdl( GetModifyHdl() );
-
-	maCbxInvert.Check( bInvert );
-	maCbxInvert.SetToggleHdl( GetModifyHdl() );
-
-	maMtrThreshold.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterSolarize::~GraphicFilterSolarize()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic	GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic,
-												   double fScaleX, double fScaleY )
-{
-	Graphic			aRet;
-	BmpFilterParam	aParam( GetGreyThreshold() );
-
-	if( rGraphic.IsAnimated() )
-	{
-		Animation aAnim( rGraphic.GetAnimation() );
-
-		if( aAnim.Filter( BMP_FILTER_SOLARIZE, &aParam ) )
-		{
-			if( IsInvert() )
-				aAnim.Invert();
-
-			aRet = aAnim;
-		}
-	}
-	else
-	{
-		BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
-		if( aBmpEx.Filter( BMP_FILTER_SOLARIZE, &aParam ) )
-		{
-			if( IsInvert() )
-				aBmpEx.Invert();
-
-			aRet = aBmpEx;
-		}
-	}
-
-	return aRet;
-}
-
-// ----------------------
-// - GraphicFilterSepia -
-// ----------------------
-
-GraphicFilterSepia::GraphicFilterSepia( Window* pParent, const Graphic& rGraphic,
-										sal_uInt16 nSepiaPercent ) :
-	GraphicFilterDialog	( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_SEPIA ), rGraphic ),
-	maFtSepia		( this, SVX_RES( DLG_FILTERSEPIA_FT_SEPIA ) ),
-	maMtrSepia		( this, SVX_RES( DLG_FILTERSEPIA_MTR_SEPIA ) )
-{
-	FreeResource();
-
-	maMtrSepia.SetValue( nSepiaPercent );
-	maMtrSepia.SetModifyHdl( GetModifyHdl() );
-
-	maMtrSepia.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterSepia::~GraphicFilterSepia()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic	GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic,
-												double fScaleX, double fScaleY )
-{
-	Graphic			aRet;
-	BmpFilterParam	aParam( GetSepiaPercent() );
-
-	if( rGraphic.IsAnimated() )
-	{
-		Animation aAnim( rGraphic.GetAnimation() );
-
-		if( aAnim.Filter( BMP_FILTER_SEPIA, &aParam ) )
-			aRet = aAnim;
-	}
-	else
-	{
-		BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
-		if( aBmpEx.Filter( BMP_FILTER_SEPIA, &aParam ) )
-			aRet = aBmpEx;
-	}
-
-	return aRet;
-}
-
-// -----------------------
-// - GraphicFilterPoster -
-// -----------------------
-
-GraphicFilterPoster::GraphicFilterPoster( Window* pParent, const Graphic& rGraphic,
-										  sal_uInt16 nPosterCount ) :
-	GraphicFilterDialog	( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_POSTER ), rGraphic ),
-	maFtPoster		( this, SVX_RES( DLG_FILTERPOSTER_FT_POSTER ) ),
-	maNumPoster		( this, SVX_RES( DLG_FILTERPOSTER_NUM_POSTER ) )
-{
-	FreeResource();
-
-	maNumPoster.SetFirst( 2 );
-	maNumPoster.SetLast( rGraphic.GetBitmapEx().GetBitCount() );
-	maNumPoster.SetValue( nPosterCount );
-	maNumPoster.SetModifyHdl( GetModifyHdl() );
-	maNumPoster.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterPoster::~GraphicFilterPoster()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic	GraphicFilterPoster::GetFilteredGraphic( const Graphic& rGraphic, 
-												 double fScaleX, double fScaleY )
-{
-	Graphic			aRet;
-	const sal_uInt16	nPosterCount = GetPosterColorCount();
-
-	if( rGraphic.IsAnimated() )
-	{
-		Animation aAnim( rGraphic.GetAnimation() );
-
-		if( aAnim.ReduceColors( nPosterCount, BMP_REDUCE_POPULAR ) )
-			aRet = aAnim;
-	}
-	else
-	{
-		BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
-		if( aBmpEx.ReduceColors( nPosterCount, BMP_REDUCE_POPULAR ) )
-			aRet = aBmpEx;
-	}
-
-	return aRet;
-}
-
-// -----------------------
-// - GraphicFilterEmboss -
-// -----------------------
-
-void GraphicFilterEmboss::EmbossControl::MouseButtonDown( const MouseEvent& rEvt )
-{
-	const RECT_POINT eOldRP = GetActualRP();
-
-	SvxRectCtl::MouseButtonDown( rEvt );
-
-	if( GetActualRP() != eOldRP )
-		maModifyHdl.Call( this );
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterEmboss::GraphicFilterEmboss( Window* pParent, const Graphic& rGraphic,
-										  RECT_POINT eLightSource ) :
-	GraphicFilterDialog	( pParent, SVX_RES( RID_SVX_GRFFILTER_DLG_EMBOSS ), rGraphic ),
-	maFtLight		( this, SVX_RES( DLG_FILTEREMBOSS_FT_LIGHT ) ),
-	maCtlLight		( this, SVX_RES( DLG_FILTEREMBOSS_CTL_LIGHT ), eLightSource )
-{
-	FreeResource();
-
-	maCtlLight.SetModifyHdl( GetModifyHdl() );
-	maCtlLight.GrabFocus();
-}
-
-// -----------------------------------------------------------------------------
-
-GraphicFilterEmboss::~GraphicFilterEmboss()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-Graphic	GraphicFilterEmboss::GetFilteredGraphic( const Graphic& rGraphic, 
-												 double fScaleX, double fScaleY )
-{
-	Graphic	aRet;
-	sal_uInt16	nAzim, nElev;
-
-	switch( maCtlLight.GetActualRP() )
-	{
-		case( RP_LT ): nAzim = 4500,	nElev = 4500; break;
-		case( RP_MT ): nAzim = 9000,	nElev = 4500; break;
-		case( RP_RT ): nAzim = 13500,	nElev = 4500; break;
-		case( RP_LM ): nAzim = 0,		nElev = 4500; break;
-		case( RP_MM ): nAzim = 0,		nElev = 9000; break;
-		case( RP_RM ): nAzim = 18000,	nElev = 4500; break;
-		case( RP_LB ): nAzim = 31500,	nElev = 4500; break;
-		case( RP_MB ): nAzim = 27000,	nElev = 4500; break;
-		case( RP_RB ): nAzim = 22500,	nElev = 4500; break;
-	}
-
-	BmpFilterParam aParam( nAzim, nElev );
-
-	if( rGraphic.IsAnimated() )
-	{
-		Animation aAnim( rGraphic.GetAnimation() );
-
-		if( aAnim.Filter( BMP_FILTER_EMBOSS_GREY, &aParam ) )
-			aRet = aAnim;
-	}
-	else
-	{
-		BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
-
-		if( aBmpEx.Filter( BMP_FILTER_EMBOSS_GREY, &aParam ) )
-			aRet = aBmpEx;
-	}
-
-	return aRet;
-}
-*/
+// eof

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/dialog/swframeexample.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/dialog/swframeexample.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/dialog/swframeexample.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/dialog/swframeexample.cxx Fri Apr 20 09:21:14 2012
@@ -94,10 +94,7 @@ void SvxSwFrameExample::DataChanged( con
 
 void SvxSwFrameExample::InitAllRects_Impl()
 {
-//    const Size aSz(GetOutputSizePixel());
-
 	// Seite
-//    aPage.SetPageScale(basegfx::B2DVector(aSz.Width() - 3, aSz.Height() - 3));
     aPage.SetSize( Size( GetOutputSizePixel().Width() - 3, GetOutputSizePixel().Height() - 3 ) );
 
 	sal_uIntPtr nOutWPix = aPage.GetWidth();

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx Fri Apr 20 09:21:14 2012
@@ -76,8 +76,7 @@ basegfx::B2DPoint SdrExchangeView::GetVi
 
 	if(pOut) 
     {
-		aCenter = basegfx::B2DPoint(pOut->GetOutputSizePixel().getWidth(), pOut->GetOutputSizePixel().getHeight()) * 0.5;
-		aCenter *= pOut->GetInverseViewTransformation();
+		aCenter = pOut->GetLogicRange().getCenter();
 	}
 	
 	return aCenter;

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/tbxctrls/linectrl.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/tbxctrls/linectrl.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/tbxctrls/linectrl.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/tbxctrls/linectrl.cxx Fri Apr 20 09:21:14 2012
@@ -56,23 +56,6 @@ using namespace ::com::sun::star::lang;
 
 // STATIC DATA -----------------------------------------------------------
 
-#define RESIZE_VALUE_POPUP(value_set)	\
-{														\
-    Size aSize = GetOutputSizePixel();					\
-    aSize.Width()  -= 4;								\
-    aSize.Height() -= 4;								\
-    (value_set).SetPosSizePixel( Point(2,2), aSize );	\
-}
-
-#define CALCSIZE_VALUE_POPUP(value_set,item_size) \
-{																	\
-    Size aSize = (value_set).CalcWindowSizePixel( (item_size) );	\
-    aSize.Width()  += 4;											\
-    aSize.Height() += 4;											\
-    SetOutputSizePixel( aSize );									\
-}
-
-
 SFX_IMPL_TOOLBOX_CONTROL( SvxLineStyleToolBoxControl, XLineStyleItem );
 SFX_IMPL_TOOLBOX_CONTROL( SvxLineWidthToolBoxControl, XLineWidthItem );
 SFX_IMPL_TOOLBOX_CONTROL( SvxLineColorToolBoxControl, XLineColorItem );

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/index/cnttab.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/index/cnttab.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/index/cnttab.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/index/cnttab.cxx Fri Apr 20 09:21:14 2012
@@ -3495,7 +3495,7 @@ void	SwTokenWindow::InsertAtSelection(
 		pButton->SetText(sTmp.Copy(0, 2));
 	}
 
- Size aEditSize(GetOutputSizePixel());
+    Size aEditSize(GetOutputSizePixel());
 	aEditSize.Width() = pButton->GetTextWidth(rText) + 5;
 	pButton->SetSizePixel(aEditSize);
 	pButton->Check(sal_True);
@@ -3802,14 +3802,11 @@ sal_Bool SwTokenWindow::CreateQuickHelp(
  ---------------------------------------------------------------------------*/
 void SwTokenWindow::Resize()
 {
- Size aCompleteSize(GetOutputSizePixel());
-
- Point aRightPos(aRightScrollWin.GetPosPixel());
- Size aRightSize(aRightScrollWin.GetSizePixel());
-
- Size aMiddleSize(aCtrlParentWin.GetSizePixel());
-
-	long nMove = aCompleteSize.Width() - aRightSize.Width() - aRightPos.X();
+    const Size aCompleteSize(GetOutputSizePixel());
+    Point aRightPos(aRightScrollWin.GetPosPixel());
+    const Size aRightSize(aRightScrollWin.GetSizePixel());
+    Size aMiddleSize(aCtrlParentWin.GetSizePixel());
+	long nMove(aCompleteSize.Width() - aRightSize.Width() - aRightPos.X());
 
 	aRightPos.X() += nMove;
 	aRightScrollWin.SetPosPixel(aRightPos);

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/pview.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/pview.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/pview.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/pview.cxx Fri Apr 20 09:21:14 2012
@@ -1977,30 +1977,6 @@ Size  SwPagePreView::GetOptimalSizePixel
 {
     ASSERT( false, "overloaded virtual method <SwPagePreView::GetOptimalSizePixel()> needed ??" )
     return Size( -1, -1 );
-/*
-    //JP 09.06.99: was wird hier errechnet ?????
-// ALT:
-//   SfxApplicationWindow* pWin = SFX_APPWINDOW ;
-//   Rectangle aRect = pWin->GetClientAreaPixel();
-
-	Window& rWin = GetViewFrame()->GetWindow();
-	Rectangle aRect( Point(0, 0), rWin.GetOutputSizePixel() );
-	Size aMaxSize( aRect.GetWidth(), aRect.GetHeight() );
-	Size aInSize = rWin.GetOutputSizePixel();
-	Size aOutSize = rWin.GetSizePixel();
-	sal_uInt16 nXBorder = sal_uInt16(aOutSize.Width() - aInSize.Width());
-	sal_uInt16 nYBorder = sal_uInt16(aOutSize.Height() - aInSize.Height());
-	aMaxSize.Width() -= nXBorder;
-	//'auf Verdacht' etwas vom Border abziehen (Menue)
-	nYBorder -= (nYBorder - nXBorder) / 2;
-	aMaxSize.Height() -= nYBorder;
-	//mit der max. moeglichen Outputsize guenstigstes Verhaeltnis ausrechnen
-	aViewWin.GetOptimalSize(aMaxSize);
-	// Border wieder dazuzaehlen
-	aMaxSize.Height() += nYBorder;
-	aMaxSize.Width() += nXBorder;
-	return aMaxSize;
-*/
 }
 
 /*--------------------------------------------------------------------

Modified: incubator/ooo/branches/alg/aw080/main/vcl/inc/vcl/outdev.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/vcl/inc/vcl/outdev.hxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/vcl/inc/vcl/outdev.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/vcl/inc/vcl/outdev.hxx Fri Apr 20 09:21:14 2012
@@ -939,18 +939,30 @@ public:
     const Point&        GetRefPoint() const { return maRefPoint; }
     sal_Bool                IsRefPoint() const { return mbRefPoint; }
 
- 	// #i75163#
+ 	// Get the MapMode (which actually is the ViewTransformation) as
+    // basegfx::B2DHomMatrix for better and more precise processing.
 	basegfx::B2DHomMatrix GetViewTransformation() const;
 	basegfx::B2DHomMatrix GetInverseViewTransformation() const;
 
+ 	// Same as above, but do not use the current MapMode, but the given
+    // one. Unfortunately this cannot be static since some other aspects
+    // of the OutDev have to be used (the DPI and OutOffOrigX).
 	basegfx::B2DHomMatrix GetViewTransformation( const MapMode& rMapMode ) const;
 	basegfx::B2DHomMatrix GetInverseViewTransformation( const MapMode& rMapMode ) const;
 
+    // Convenience method which creates the full transform from
+    // source to dest MapMode
 	basegfx::B2DHomMatrix GetTransformLogicToLogic(const MapMode& rMapModeSource, const MapMode& rMapModeDest) const;
+
+    // Convenience method to just get the scaling between the given MapUnits
     static double GetFactorLogicToLogic(MapUnit eUnitSource, MapUnit eUnitDest);
 
+    // Get the discrete (pixel) and logic range/vector of this OutDev.
+    // getMinimum() of the discrete range will always be (0,0)
 	basegfx::B2DRange GetLogicRange() const;
+    basegfx::B2DVector GetLogicVector() const;
 	basegfx::B2DRange GetDiscreteRange() const;
+    basegfx::B2DVector GetDiscreteVector() const;
 
 	/** Set an offset in pixel
 

Modified: incubator/ooo/branches/alg/aw080/main/vcl/source/gdi/outmap.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/vcl/source/gdi/outmap.cxx?rev=1328271&r1=1328270&r2=1328271&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/vcl/source/gdi/outmap.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/vcl/source/gdi/outmap.cxx Fri Apr 20 09:21:14 2012
@@ -2461,6 +2461,13 @@ basegfx::B2DRange OutputDevice::GetLogic
 
 // -----------------------------------------------------------------------
 
+basegfx::B2DVector OutputDevice::GetLogicVector() const
+{
+    return GetInverseViewTransformation() * GetDiscreteVector();
+}
+
+// -----------------------------------------------------------------------
+
 basegfx::B2DRange OutputDevice::GetDiscreteRange() const
 {
 	return basegfx::B2DRange(0.0, 0.0, GetOutputSizePixel().Width(), GetOutputSizePixel().Height());
@@ -2468,6 +2475,13 @@ basegfx::B2DRange OutputDevice::GetDiscr
 
 // -----------------------------------------------------------------------
 
+basegfx::B2DVector OutputDevice::GetDiscreteVector() const
+{
+    return basegfx::B2DVector(GetOutputSizePixel().Width(), GetOutputSizePixel().Height());
+}
+
+// -----------------------------------------------------------------------
+
 void OutputDevice::SetPixelOffset( const Size& rOffset )
 {
     mnOutOffOrigX  = rOffset.Width();



Mime
View raw message