diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-12-02 10:09:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-12-02 10:58:04 +0000 |
commit | 2d2329f441aa67e8be9f77dcfa3d048e50651357 (patch) | |
tree | 0b4d6c1f21ea1ffe15bffaee1f71eeb847043de0 /svx | |
parent | d596053eeebe04bce7d96b3fda698e9df96c1c3d (diff) |
coverity#1371200 Missing move assignment operator
adjust things to not need one
Change-Id: I1079f50d8813f86c4828be602687b4cbffe61415
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/_bmpmask.cxx | 18 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv2.cxx | 26 | ||||
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 23 |
3 files changed, 33 insertions, 34 deletions
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index 5eec4f8f7e8a..b7e194854c4f 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -608,7 +608,6 @@ sal_uInt16 SvxBmpMask::InitColorArrays( Color* pSrcCols, Color* pDstCols, sal_uI return nCount; } - Bitmap SvxBmpMask::ImpMask( const Bitmap& rBitmap ) { Bitmap aBitmap( rBitmap ); @@ -624,7 +623,6 @@ Bitmap SvxBmpMask::ImpMask( const Bitmap& rBitmap ) return aBitmap; } - BitmapEx SvxBmpMask::ImpMaskTransparent( const BitmapEx& rBitmapEx, const Color& rColor, const long nTol ) { EnterWait(); @@ -979,6 +977,13 @@ GDIMetaFile SvxBmpMask::ImpReplaceTransparency( const GDIMetaFile& rMtf, const C return aMtf; } +GDIMetaFile SvxBmpMask::GetMetaFile(const Graphic& rGraphic) +{ + // Replace transparency? + if (m_pCbxTrans->IsChecked()) + return ImpReplaceTransparency(rGraphic.GetGDIMetaFile(), m_pLbColorTrans->GetSelectEntryColor()); + return ImpMask(rGraphic.GetGDIMetaFile()); +} Graphic SvxBmpMask::Mask( const Graphic& rGraphic ) { @@ -1054,14 +1059,7 @@ Graphic SvxBmpMask::Mask( const Graphic& rGraphic ) case GraphicType::GdiMetafile: { - GDIMetaFile aMtf( aGraphic.GetGDIMetaFile() ); - - // Replace transparency? - if( m_pCbxTrans->IsChecked() ) - aMtf = ImpReplaceTransparency( aMtf, aReplColor ); - else - aMtf = ImpMask( aMtf ); - + GDIMetaFile aMtf(GetMetaFile(rGraphic)); Size aSize( aMtf.GetPrefSize() ); if ( aSize.Width() && aSize.Height() ) aGraphic = Graphic( aMtf ); diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index d0a15ece7dc6..9ed2ef55029f 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -2003,10 +2003,18 @@ void SdrEditView::ConvertMarkedToPolyObj() ImpConvertTo(false, false/*bLineToArea*/); } +namespace +{ + GDIMetaFile GetMetaFile(SdrGrafObj* pGraf) + { + if (pGraf->HasGDIMetaFile()) + return pGraf->GetTransformedGraphic(SdrGrafObjTransformsAttrs::COLOR|SdrGrafObjTransformsAttrs::MIRROR).GetGDIMetaFile(); + assert(pGraf->isEmbeddedSvg()); + return pGraf->getMetafileFromEmbeddedSvg(); + } +} // Metafile Import - - void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo) { const bool bUndo = IsUndoEnabled(); @@ -2040,19 +2048,9 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo) sal_uIntPtr nInsAnz=0; Rectangle aLogicRect; - if(pGraf && (pGraf->HasGDIMetaFile() || pGraf->isEmbeddedSvg())) + if (pGraf && (pGraf->HasGDIMetaFile() || pGraf->isEmbeddedSvg())) { - GDIMetaFile aMetaFile; - - if(pGraf->HasGDIMetaFile()) - { - aMetaFile = pGraf->GetTransformedGraphic(SdrGrafObjTransformsAttrs::COLOR|SdrGrafObjTransformsAttrs::MIRROR).GetGDIMetaFile(); - } - else if(pGraf->isEmbeddedSvg()) - { - aMetaFile = pGraf->getMetafileFromEmbeddedSvg(); - } - + GDIMetaFile aMetaFile(GetMetaFile(pGraf)); if(aMetaFile.GetActionSize()) { aLogicRect = pGraf->GetLogicRect(); diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 90f91f11fbb7..0103498ca4af 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -1044,27 +1044,30 @@ GDIMetaFile SdrGrafObj::getMetafileFromEmbeddedSvg() const return aRetval; } -SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const +GDIMetaFile SdrGrafObj::GetMetaFile(GraphicType &rGraphicType) const { - SdrObject* pRetval = nullptr; - GraphicType aGraphicType(GetGraphicType()); - GDIMetaFile aMtf; - - if(isEmbeddedSvg()) + if (isEmbeddedSvg()) { // Embedded Svg // There is currently no helper to create SdrObjects from primitives (even if I'm thinking // about writing one for some time). To get the roundtrip to SdrObjects it is necessary to // use the old converter path over the MetaFile mechanism. Create Metafile from Svg // primitives here pretty directly - aMtf = getMetafileFromEmbeddedSvg(); - aGraphicType = GraphicType::GdiMetafile; + rGraphicType = GraphicType::GdiMetafile; + return getMetafileFromEmbeddedSvg(); } - else if(GraphicType::GdiMetafile == aGraphicType) + else if (GraphicType::GdiMetafile == rGraphicType) { - aMtf = GetTransformedGraphic(SdrGrafObjTransformsAttrs::COLOR|SdrGrafObjTransformsAttrs::MIRROR).GetGDIMetaFile(); + return GetTransformedGraphic(SdrGrafObjTransformsAttrs::COLOR|SdrGrafObjTransformsAttrs::MIRROR).GetGDIMetaFile(); } + return GDIMetaFile(); +} +SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const +{ + SdrObject* pRetval = nullptr; + GraphicType aGraphicType(GetGraphicType()); + GDIMetaFile aMtf(GetMetaFile(aGraphicType)); switch(aGraphicType) { case GraphicType::GdiMetafile: |