diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-09-02 19:57:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-03 08:58:38 +0200 |
commit | d2ba1d72c047a31321cf4c510c8c4a729c3706e9 (patch) | |
tree | 49f4a9688795e6321b4b1675d5073a3a2e5d1043 /emfio | |
parent | 46cafe6c7fb9b16bc508663d775fe90deccbf460 (diff) |
no need to allocate BSaveStruct separately
Change-Id: Id14f525e84c22caa8f974f2f1d9f398f8d8e2df8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121532
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'emfio')
-rw-r--r-- | emfio/inc/mtftools.hxx | 4 | ||||
-rw-r--r-- | emfio/source/reader/emfreader.cxx | 8 | ||||
-rw-r--r-- | emfio/source/reader/mtftools.cxx | 10 | ||||
-rw-r--r-- | emfio/source/reader/wmfreader.cxx | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/emfio/inc/mtftools.hxx b/emfio/inc/mtftools.hxx index 1ee6efd68f26..b0945f7806ef 100644 --- a/emfio/inc/mtftools.hxx +++ b/emfio/inc/mtftools.hxx @@ -562,7 +562,7 @@ namespace emfio SvStream* mpInputStream; // the WMF/EMF file to be read sal_uInt32 mnStartPos; sal_uInt32 mnEndPos; - std::vector<std::unique_ptr<BSaveStruct>> maBmpSaveList; + std::vector<BSaveStruct> maBmpSaveList; // tdf#127471 always try to detect - only used with ScaledText ScaledFontDetectCorrectHelper maScaledFontHelper; @@ -680,7 +680,7 @@ namespace emfio bool bRecordPath = false, sal_Int32 nGraphicsMode = GM_COMPATIBLE); - void ResolveBitmapActions(std::vector<std::unique_ptr<BSaveStruct>>& rSaveList); + void ResolveBitmapActions(std::vector<BSaveStruct>& rSaveList); void IntersectClipRect(const tools::Rectangle& rRect); void ExcludeClipRect(const tools::Rectangle& rRect); diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx index af09ed2799cd..15ea08f8d51c 100644 --- a/emfio/source/reader/emfreader.cxx +++ b/emfio/source/reader/emfreader.cxx @@ -519,7 +519,7 @@ namespace emfio aGraphic.getVectorGraphicData()->setSizeHint(maSizeHint); maBmpSaveList.emplace_back( - new BSaveStruct(aGraphic.GetBitmapEx(), aOutputRect, SRCCOPY, /*bForceAlpha=*/true)); + aGraphic.GetBitmapEx(), aOutputRect, SRCCOPY, /*bForceAlpha=*/true); const std::shared_ptr<VectorGraphicData> pVectorGraphicData = aGraphic.getVectorGraphicData(); if (!pVectorGraphicData) @@ -1640,7 +1640,7 @@ namespace emfio aPNGWriter.Write(aNew); } #endif - maBmpSaveList.emplace_back(new BSaveStruct(aBitmapEx, aRect, SRCAND|SRCINVERT)); + maBmpSaveList.emplace_back(aBitmapEx, aRect, SRCAND|SRCINVERT); } } } @@ -1720,7 +1720,7 @@ namespace emfio aBitmap.Crop( aCropRect ); } - maBmpSaveList.emplace_back(new BSaveStruct(aBitmap, aRect, dwRop)); + maBmpSaveList.emplace_back(aBitmap, aRect, dwRop); } } } @@ -1805,7 +1805,7 @@ namespace emfio tools::Rectangle aCropRect( Point( xSrc, ySrc ), Size( cxSrc, cySrc ) ); aBitmap.Crop( aCropRect ); } - maBmpSaveList.emplace_back(new BSaveStruct(aBitmap, aRect, dwRop)); + maBmpSaveList.emplace_back(aBitmap, aRect, dwRop); } } } diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx index 590fddd9e508..aaefec7eb6e4 100644 --- a/emfio/source/reader/mtftools.cxx +++ b/emfio/source/reader/mtftools.cxx @@ -1912,7 +1912,7 @@ namespace emfio mpGDIMetaFile->AddAction( new MetaBmpScaleAction( rPos, rSize, aBmpEx.GetBitmap() ) ); } - void MtfTools::ResolveBitmapActions( std::vector<std::unique_ptr<BSaveStruct>>& rSaveList ) + void MtfTools::ResolveBitmapActions( std::vector<BSaveStruct>& rSaveList ) { UpdateClipRegion(); @@ -1925,7 +1925,7 @@ namespace emfio size_t nObjectsOfSameSize = 0; size_t nObjectStartIndex = nObjects - nObjectsLeft; - BSaveStruct* pSave = rSaveList[nObjectStartIndex].get(); + BSaveStruct* pSave = &rSaveList[nObjectStartIndex]; tools::Rectangle aRect( pSave->aOutRect ); for ( i = nObjectStartIndex; i < nObjects; ) @@ -1933,7 +1933,7 @@ namespace emfio nObjectsOfSameSize++; if ( ++i < nObjects ) { - pSave = rSaveList[i].get(); + pSave = &rSaveList[i]; if ( pSave->aOutRect != aRect ) break; } @@ -1943,7 +1943,7 @@ namespace emfio for ( i = nObjectStartIndex; i < ( nObjectStartIndex + nObjectsOfSameSize ); i++ ) { - pSave = rSaveList[i].get(); + pSave = &rSaveList[i]; sal_uInt32 nWinRop = pSave->nWinRop; sal_uInt8 nRasterOperation = static_cast<sal_uInt8>( nWinRop >> 16 ); @@ -1971,7 +1971,7 @@ namespace emfio { if ( nObjectsOfSameSize == 2 ) { - BSaveStruct* pSave2 = rSaveList[i + 1].get(); + BSaveStruct* pSave2 = &rSaveList[i + 1]; if ( ( pSave->aBmpEx.GetPrefSize() == pSave2->aBmpEx.GetPrefSize() ) && ( pSave->aBmpEx.GetPrefMapMode() == pSave2->aBmpEx.GetPrefMapMode() ) ) { diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx index 552896e892dd..82c6210acbbf 100644 --- a/emfio/source/reader/wmfreader.cxx +++ b/emfio/source/reader/wmfreader.cxx @@ -857,7 +857,7 @@ namespace emfio aBitmap.Crop( aCropRect ); } tools::Rectangle aDestRect( aPoint, Size( nSxe, nSye ) ); - maBmpSaveList.emplace_back(new BSaveStruct(aBitmap, aDestRect, nRasterOperation)); + maBmpSaveList.emplace_back(aBitmap, aDestRect, nRasterOperation); } } break; @@ -922,7 +922,7 @@ namespace emfio aBmp.Crop( aCropRect ); } - maBmpSaveList.emplace_back(new BSaveStruct(aBmp, aDestRect, nRasterOperation)); + maBmpSaveList.emplace_back(aBmp, aDestRect, nRasterOperation); } } break; |