incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1186168 - in /incubator/ooo/trunk/main: drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx sd/source/ui/view/drviews7.cxx svx/source/svdraw/svdedtv2.cxx svx/source/svdraw/svdograf.cxx
Date Wed, 19 Oct 2011 12:31:00 GMT
Author: hdu
Date: Wed Oct 19 12:31:00 2011
New Revision: 1186168

URL: http://svn.apache.org/viewvc?rev=1186168&view=rev
Log:
#118529# solve break converters and convert commands for OLEs and images (author=alg)

Modified:
    incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
    incubator/ooo/trunk/main/sd/source/ui/view/drviews7.cxx
    incubator/ooo/trunk/main/svx/source/svdraw/svdedtv2.cxx
    incubator/ooo/trunk/main/svx/source/svdraw/svdograf.cxx

Modified: incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx?rev=1186168&r1=1186167&r2=1186168&view=diff
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx (original)
+++ incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx Wed
Oct 19 12:31:00 2011
@@ -1608,9 +1608,20 @@ namespace drawinglayer
 				}
 				case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D :
 				{
-                    // direct draw of MetaFile, use default pocessing
-					RenderMetafilePrimitive2D(static_cast< const primitive2d::MetafilePrimitive2D&
>(rCandidate));
-					break;
+                    static bool bUseMetaFilePrimitiveDecomposition(true);
+                    
+                    if(bUseMetaFilePrimitiveDecomposition)
+                    {
+                        // use new Metafile decomposition
+    					process(rCandidate.get2DDecomposition(getViewInformation2D()));
+                    }
+                    else
+                    {
+                        // direct draw of MetaFile, use default pocessing
+					    RenderMetafilePrimitive2D(static_cast< const primitive2d::MetafilePrimitive2D&
>(rCandidate));
+                    }
+					
+                    break;
 				}
 				case PRIMITIVE2D_ID_MASKPRIMITIVE2D :
 				{

Modified: incubator/ooo/trunk/main/sd/source/ui/view/drviews7.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/view/drviews7.cxx?rev=1186168&r1=1186167&r2=1186168&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/view/drviews7.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/ui/view/drviews7.cxx Wed Oct 19 12:31:00 2011
@@ -1424,9 +1424,10 @@ void DrawViewShell::GetMenuState( SfxIte
 						bFoundNoGraphicObj = sal_True;
 						break;
 					case OBJ_OLE2 :
-						// #i118485# Allow Line, Area and Graphic (Metafile)
+						// #i118485# #i118525# Allow Line, Area and Graphic (Metafile, Bitmap)
 						bSingleGraphicSelected = nMarkCount == 1;
-    					bFoundMetafile = sal_True;
+    					bFoundBitmap = true;
+    					bFoundMetafile = true;
 						break;
 					case OBJ_GRAF :
 						bSingleGraphicSelected = nMarkCount == 1;

Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdedtv2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdedtv2.cxx?rev=1186168&r1=1186167&r2=1186168&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdedtv2.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdedtv2.cxx Wed Oct 19 12:31:00 2011
@@ -2075,31 +2075,67 @@ void SdrEditView::DoImportMarkedMtf(SvdP
 		SdrGrafObj*  pGraf=PTR_CAST(SdrGrafObj,pObj);
 		SdrOle2Obj*  pOle2=PTR_CAST(SdrOle2Obj,pObj);
 		sal_uIntPtr        nInsAnz=0;
+        Rectangle aLogicRect;
+
 		if (pGraf!=NULL && pGraf->HasGDIMetaFile())
 		{
 			ImpSdrGDIMetaFileImport aFilter(*pMod);
-			aFilter.SetScaleRect(pGraf->GetSnapRect());
+			
+            aLogicRect = pGraf->GetLogicRect();
+            aFilter.SetScaleRect(aLogicRect);
 			aFilter.SetLayer(pObj->GetLayer());
-			nInsAnz=aFilter.DoImport(pGraf->GetTransformedGraphic().GetGDIMetaFile(),*pOL,nInsPos,pProgrInfo);
+			
+            nInsAnz=aFilter.DoImport(pGraf->GetTransformedGraphic(
+                SDRGRAFOBJ_TRANSFORMATTR_COLOR|SDRGRAFOBJ_TRANSFORMATTR_MIRROR).GetGDIMetaFile(),
+                *pOL,nInsPos,pProgrInfo);
 		}
         if ( pOle2!=NULL && pOle2->GetGraphic() )
 		{
             //const GDIMetaFile* pMtf=pOle2->GetGDIMetaFile();
 			ImpSdrGDIMetaFileImport aFilter(*pMod);
-			aFilter.SetScaleRect(pOle2->GetLogicRect());
+			
+            aLogicRect = pOle2->GetLogicRect();
+            aFilter.SetScaleRect(aLogicRect);
 			aFilter.SetLayer(pObj->GetLayer());
+            
             nInsAnz=aFilter.DoImport(pOle2->GetGraphic()->GetGDIMetaFile(),*pOL,nInsPos,pProgrInfo);
 		}
 		if (nInsAnz!=0)
 		{
-			sal_uIntPtr nObj=nInsPos;
-			for (sal_uIntPtr i=0; i<nInsAnz; i++)
+            // transformation
+            GeoStat aGeoStat(pGraf ? pGraf->GetGeoStat() : pOle2->GetGeoStat());
+            sal_uIntPtr nObj=nInsPos;
+
+	        if(aGeoStat.nShearWink) 
+            {
+                aGeoStat.RecalcTan();
+            }
+	        
+            if(aGeoStat.nDrehWink) 
+            {
+	            aGeoStat.RecalcSinCos();
+            }
+
+            for (sal_uIntPtr i=0; i<nInsAnz; i++)
 			{
-				if( bUndo )
+                if( bUndo )
 					AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pOL->GetObj(nObj)));
 
 				// Neue MarkList pflegen
-				SdrMark aNewMark(pOL->GetObj(nObj), pPV);
+                SdrObject* pCandidate = pOL->GetObj(nObj);
+
+                // apply original transformation
+	            if(aGeoStat.nShearWink) 
+                {
+                    pCandidate->NbcShear(aLogicRect.TopLeft(), aGeoStat.nShearWink, aGeoStat.nTan,
false);
+                }
+
+	            if(aGeoStat.nDrehWink) 
+                {
+                    pCandidate->NbcRotate(aLogicRect.TopLeft(), aGeoStat.nDrehWink, aGeoStat.nSin,
aGeoStat.nCos);
+                }
+
+                SdrMark aNewMark(pCandidate, pPV);
 				aNewMarked.InsertEntry(aNewMark);
 
 				nObj++;

Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdograf.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdograf.cxx?rev=1186168&r1=1186167&r2=1186168&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdograf.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdograf.cxx Wed Oct 19 12:31:00 2011
@@ -1099,7 +1099,11 @@ SdrObject* SdrGrafObj::DoConvertToPolyOb
                 pRetval = pGrp;
 				pGrp->NbcSetLayer(GetLayer());
 				pGrp->SetModel(GetModel());
-				pRetval = ImpConvertAddText(pRetval, bBezier);
+                
+                if(bAddText)
+                {
+				    pRetval = ImpConvertAddText(pRetval, bBezier);
+                }
 
                 // convert all children
                 if( pRetval )



Mime
View raw message