incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1340955 - /incubator/ooo/trunk/main/svx/source/svdraw/svdfmtf.cxx
Date Mon, 21 May 2012 10:07:54 GMT
Author: alg
Date: Mon May 21 10:07:53 2012
New Revision: 1340955

URL: http://svn.apache.org/viewvc?rev=1340955&view=rev
Log:
WaE changes added

Modified:
    incubator/ooo/trunk/main/svx/source/svdraw/svdfmtf.cxx

Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdfmtf.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdfmtf.cxx?rev=1340955&r1=1340954&r2=1340955&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdfmtf.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdfmtf.cxx Mon May 21 10:07:53 2012
@@ -1277,6 +1277,29 @@ void ImpSdrGDIMetaFileImport::DoAction(M
     InsertObj(pGraf);
 }
 
+XGradientStyle getXGradientStyleFromGradientStyle(const GradientStyle& rGradientStyle)
+{
+    XGradientStyle aXGradientStyle(XGRAD_LINEAR);
+
+    switch(rGradientStyle)
+    {
+        case GRADIENT_LINEAR: aXGradientStyle = XGRAD_LINEAR; break;
+        case GRADIENT_AXIAL: aXGradientStyle = XGRAD_AXIAL; break;
+        case GRADIENT_RADIAL: aXGradientStyle = XGRAD_RADIAL; break;
+        case GRADIENT_ELLIPTICAL: aXGradientStyle = XGRAD_ELLIPTICAL; break;
+        case GRADIENT_SQUARE: aXGradientStyle = XGRAD_SQUARE; break;
+        case GRADIENT_RECT: aXGradientStyle = XGRAD_RECT; break;
+        
+        // Needed due to GRADIENT_FORCE_EQUAL_SIZE; this again is needed
+        // to force the enum defines in VCL to a defined size for the compilers,
+        // so despite it is never used it cannot be removed (would break the
+        // API implementation probably).
+        default: break; 
+    }
+
+    return aXGradientStyle;
+}
+
 void ImpSdrGDIMetaFileImport::DoAction(MetaGradientAction& rAct)
 {
     basegfx::B2DRange aRange(rAct.GetRect().Left(), rAct.GetRect().Top(), rAct.GetRect().Right(),
rAct.GetRect().Bottom());
@@ -1293,18 +1316,7 @@ void ImpSdrGDIMetaFileImport::DoAction(M
                 ceil(aRange.getMaxX()),
                 ceil(aRange.getMaxY())));
 		SfxItemSet aGradientAttr(mpModel->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE, XATTR_FILLGRADIENT,
XATTR_FILLGRADIENT, 0, 0);
-        XGradientStyle aXGradientStyle(XGRAD_LINEAR);
-
-        switch(rGradient.GetStyle())
-        {
-            case GRADIENT_LINEAR: aXGradientStyle = XGRAD_LINEAR; break;
-            case GRADIENT_AXIAL: aXGradientStyle = XGRAD_AXIAL; break;
-            case GRADIENT_RADIAL: aXGradientStyle = XGRAD_RADIAL; break;
-            case GRADIENT_ELLIPTICAL: aXGradientStyle = XGRAD_ELLIPTICAL; break;
-            case GRADIENT_SQUARE: aXGradientStyle = XGRAD_SQUARE; break;
-            case GRADIENT_RECT: aXGradientStyle = XGRAD_RECT; break;
-        }
-            
+        const XGradientStyle aXGradientStyle(getXGradientStyleFromGradientStyle(rGradient.GetStyle()));
         const XFillGradientItem aXFillGradientItem(
             &mpModel->GetItemPool(), 
             XGradient(
@@ -1328,7 +1340,7 @@ void ImpSdrGDIMetaFileImport::DoAction(M
 	}
 }
 
-void ImpSdrGDIMetaFileImport::DoAction(MetaWallpaperAction& rAct)
+void ImpSdrGDIMetaFileImport::DoAction(MetaWallpaperAction& /*rAct*/)
 {
     OSL_ENSURE(false, "Tried to construct SdrObject from MetaWallpaperAction: not supported
(!)");
 }
@@ -1350,12 +1362,12 @@ void ImpSdrGDIMetaFileImport::DoAction(M
 	}
 }
 
-void ImpSdrGDIMetaFileImport::DoAction(MetaEPSAction& rAct)
+void ImpSdrGDIMetaFileImport::DoAction(MetaEPSAction& /*rAct*/)
 {
     OSL_ENSURE(false, "Tried to construct SdrObject from MetaEPSAction: not supported (!)");
 }
 
-void ImpSdrGDIMetaFileImport::DoAction(MetaTextLineAction& rAct)
+void ImpSdrGDIMetaFileImport::DoAction(MetaTextLineAction& /*rAct*/)
 {
     OSL_ENSURE(false, "Tried to construct SdrObject from MetaTextLineAction: not supported
(!)");
 }
@@ -1374,18 +1386,7 @@ void ImpSdrGDIMetaFileImport::DoAction(M
         	const Gradient& rGradient = rAct.GetGradient();
             SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
 			SfxItemSet aGradientAttr(mpModel->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE,
XATTR_FILLGRADIENT, XATTR_FILLGRADIENT, 0, 0);
-            XGradientStyle aXGradientStyle(XGRAD_LINEAR);
-
-            switch(rGradient.GetStyle())
-            {
-                case GRADIENT_LINEAR: aXGradientStyle = XGRAD_LINEAR; break;
-                case GRADIENT_AXIAL: aXGradientStyle = XGRAD_AXIAL; break;
-                case GRADIENT_RADIAL: aXGradientStyle = XGRAD_RADIAL; break;
-                case GRADIENT_ELLIPTICAL: aXGradientStyle = XGRAD_ELLIPTICAL; break;
-                case GRADIENT_SQUARE: aXGradientStyle = XGRAD_SQUARE; break;
-                case GRADIENT_RECT: aXGradientStyle = XGRAD_RECT; break;
-            }
-            
+            const XGradientStyle aXGradientStyle(getXGradientStyleFromGradientStyle(rGradient.GetStyle()));
             const XFillGradientItem aXFillGradientItem(
                 &mpModel->GetItemPool(), 
                 XGradient(
@@ -1527,9 +1528,9 @@ void ImpSdrGDIMetaFileImport::DoAction(M
                         {
                             const double fOpNew(1.0 - fTransparence);
                             
-                            for(sal_uInt32 y(0); y < pOld->Height(); y++)
+                            for(sal_uInt32 y(0); y < static_cast< sal_uInt32 >(pOld->Height());
y++)
                             {
-                                for(sal_uInt32 x(0); x < pOld->Width(); x++)
+                                for(sal_uInt32 x(0); x < static_cast< sal_uInt32 >(pOld->Width());
x++)
                                 {
                                     const double fOpOld(1.0 - (pOld->GetPixel(y, x).GetIndex()
* fFactor));
                                     const sal_uInt8 aCol(basegfx::fround((1.0 - (fOpOld *
fOpNew)) * 255.0));
@@ -1546,9 +1547,9 @@ void ImpSdrGDIMetaFileImport::DoAction(M
                             {
                                 if(pOld->Width() == pNew->Width() && pOld->Height()
== pNew->Height())
                                 {
-                                    for(sal_uInt32 y(0); y < pOld->Height(); y++)
+                                    for(sal_uInt32 y(0); y < static_cast< sal_uInt32
>(pOld->Height()); y++)
                                     {
-                                        for(sal_uInt32 x(0); x < pOld->Width(); x++)
+                                        for(sal_uInt32 x(0); x < static_cast< sal_uInt32
>(pOld->Width()); x++)
                                         {
                                             const double fOpOld(1.0 - (pOld->GetPixel(y,
x).GetIndex() * fFactor));
                                             const double fOpNew(1.0 - (pNew->GetPixel(y,
x).GetIndex() * fFactor));



Mime
View raw message