diff options
author | Herbert Dürr <hdu@apache.org> | 2011-10-19 11:31:00 +0000 |
---|---|---|
committer | Herbert Dürr <hdu@apache.org> | 2011-10-19 11:31:00 +0000 |
commit | 011dd73794e28949053a9f4cd2d1039157007326 (patch) | |
tree | a5ebcfd02558c7c39eb0b7a45c1f58456cda8e78 | |
parent | c13162c59402230bdd8f46300bbfa8142c4e01b7 (diff) |
#118529# solve break converters and convert commands for OLEs and images (author=alg)
-rw-r--r-- | drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 15 | ||||
-rwxr-xr-x | sd/source/ui/view/drviews7.cxx | 5 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv2.cxx | 44 | ||||
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 6 |
4 files changed, 61 insertions, 9 deletions
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index ed2b6e2e8244..51520b49b7f9 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -1608,8 +1608,19 @@ namespace drawinglayer } case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D : { - // direct draw of MetaFile, use default pocessing - RenderMetafilePrimitive2D(static_cast< const primitive2d::MetafilePrimitive2D& >(rCandidate)); + 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/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 0386b62b64c7..1b2d4d46683e 100755 --- a/sd/source/ui/view/drviews7.cxx +++ b/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/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 7af96024cb5e..41a5be3c6802 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/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) { + // 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 ) 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++; diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 0cc7e04ec494..ffa2f6701c71 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/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 ) |