diff --git a/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 65c23a8..1446d53 100644 --- a/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -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 : { diff --git a/main/sd/source/ui/view/drviews7.cxx b/main/sd/source/ui/view/drviews7.cxx index dbe4b1d..bd04afa 100755 --- a/main/sd/source/ui/view/drviews7.cxx +++ b/main/sd/source/ui/view/drviews7.cxx @@ -1424,9 +1424,10 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) 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; diff --git a/main/svx/source/svdraw/svdedtv2.cxx b/main/svx/source/svdraw/svdedtv2.cxx index 4942ba1..129826c 100644 --- a/main/svx/source/svdraw/svdedtv2.cxx +++ b/main/svx/source/svdraw/svdedtv2.cxx @@ -2075,31 +2075,67 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo) 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; iGetGeoStat() : pOle2->GetGeoStat()); + sal_uIntPtr nObj=nInsPos; + + if(aGeoStat.nShearWink) + { + aGeoStat.RecalcTan(); + } + + if(aGeoStat.nDrehWink) + { + aGeoStat.RecalcSinCos(); + } + + for (sal_uIntPtr i=0; iGetSdrUndoFactory().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++; diff --git a/main/svx/source/svdraw/svdograf.cxx b/main/svx/source/svdraw/svdograf.cxx index 677ec6a..bf0fc88 100644 --- a/main/svx/source/svdraw/svdograf.cxx +++ b/main/svx/source/svdraw/svdograf.cxx @@ -1099,7 +1099,11 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const pRetval = pGrp; pGrp->NbcSetLayer(GetLayer()); pGrp->SetModel(GetModel()); - pRetval = ImpConvertAddText(pRetval, bBezier); + + if(bAddText) + { + pRetval = ImpConvertAddText(pRetval, bBezier); + } // convert all children if( pRetval )