diff --git a/include/sfx2/templatelocalview.hxx b/include/sfx2/templatelocalview.hxx index 4284c74b334f..c1b488bcc317 100644 --- a/include/sfx2/templatelocalview.hxx +++ b/include/sfx2/templatelocalview.hxx @@ -150,11 +150,11 @@ public: bool IsBuiltInRegion(const OUString& rRegionName); - static BitmapEx scaleImg (const BitmapEx &rImg, tools::Long width, tools::Long height); + static Bitmap scaleImg (const Bitmap &rImg, tools::Long width, tools::Long height); static BitmapEx getDefaultThumbnail( std::u16string_view rPath ); - static BitmapEx fetchThumbnail (const OUString &msURL, tools::Long width, tools::Long height); + static Bitmap fetchThumbnail (const OUString &msURL, tools::Long width, tools::Long height); static bool IsDefaultTemplate(const OUString& rPath); diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx index ca309f494dc1..0035db9bd81e 100644 --- a/include/sfx2/thumbnailview.hxx +++ b/include/sfx2/thumbnailview.hxx @@ -18,7 +18,7 @@ #include -class BitmapEx; +class Bitmap; class ThumbnailViewItem; typedef ::std::vector< ThumbnailViewItem* > ThumbnailValueItemList; class ThumbnailViewAcc; @@ -232,7 +232,7 @@ public: virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; - static BitmapEx readThumbnail(const OUString &msURL); + static Bitmap readThumbnail(const OUString &msURL); protected: diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 117bd8a078a4..110c805380dd 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -242,10 +242,9 @@ public: nothing had to be done, e.g. because one of the rectangles are empty. */ - SAL_DLLPRIVATE bool CopyPixel( - const tools::Rectangle& rRectDst, - const tools::Rectangle& rRectSrc, - const Bitmap& rBmpSrc ); + bool CopyPixel( const tools::Rectangle& rRectDst, + const tools::Rectangle& rRectSrc, + const Bitmap& rBmpSrc ); /** Copy a rectangular area inside this bitmap. diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index 31152e4b9e23..ab9102b769de 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -147,7 +147,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView &rView, const OUStri if (aTitle.isEmpty()) aTitle = aURLObj.GetLastName(INetURLObject::DecodeMechanism::WithCharset); - BitmapEx aThumbnail; + Bitmap aThumbnail; //fdo#74834: only load thumbnail if the corresponding option is not disabled in the configuration if (officecfg::Office::Common::History::RecentDocsThumbnail::get()) @@ -159,20 +159,20 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView &rView, const OUStri SvMemoryStream aStream(aDecoded.getArray(), aDecoded.getLength(), StreamMode::READ); vcl::PngImageReader aReader(aStream); - aThumbnail = aReader.read(); + aThumbnail = Bitmap(aReader.read()); } else if (sfx2::RecentDocsView::typeMatchesExtension(sfx2::ApplicationType::TYPE_DATABASE, aURLObj.getExtension())) { aThumbnail - = BitmapEx(nThumbnailSize > 192 ? SFX_THUMBNAIL_BASE_256 : SFX_THUMBNAIL_BASE_192); + = Bitmap(BitmapEx(nThumbnailSize > 192 ? SFX_THUMBNAIL_BASE_256 : SFX_THUMBNAIL_BASE_192)); } } if (aThumbnail.IsEmpty()) { // 1. Thumbnail absent: get the default thumbnail, checking for encryption. - BitmapEx aExt(getDefaultThumbnail(rURL)); + Bitmap aExt(getDefaultThumbnail(rURL)); Size aExtSize(aExt.GetSizePixel()); // attempt to make it appear as if it is on a piece of paper @@ -202,8 +202,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView &rView, const OUStri } // create empty, and copy the default thumbnail in - sal_uInt8 nAlpha = 255; - aThumbnail = BitmapEx(Bitmap(aThumbnailSize, vcl::PixelFormat::N24_BPP), AlphaMask(aThumbnailSize, &nAlpha)); + aThumbnail = Bitmap(aThumbnailSize, vcl::PixelFormat::N32_BPP); aThumbnail.CopyPixel( ::tools::Rectangle(Point((aThumbnailSize.Width() - aExtSize.Width()) / 2, (aThumbnailSize.Height() - aExtSize.Height()) / 2), aExtSize), diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx index b90a259e4f8d..6a74cd41ec26 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -819,9 +819,9 @@ void TemplateLocalView::setExportTemplateHdl(const Link &rLink) maExportTemplateHdl = rLink; } -BitmapEx TemplateLocalView::scaleImg (const BitmapEx &rImg, tools::Long width, tools::Long height) +Bitmap TemplateLocalView::scaleImg (const Bitmap &rImg, tools::Long width, tools::Long height) { - BitmapEx aImg = rImg; + Bitmap aImg = rImg; if (!rImg.IsEmpty()) { @@ -883,7 +883,7 @@ BitmapEx TemplateLocalView::getDefaultThumbnail( std::u16string_view rPath ) return aImg; } -BitmapEx TemplateLocalView::fetchThumbnail (const OUString &msURL, tools::Long width, tools::Long height) +Bitmap TemplateLocalView::fetchThumbnail (const OUString &msURL, tools::Long width, tools::Long height) { return TemplateLocalView::scaleImg(ThumbnailView::readThumbnail(msURL), width, height); } diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index bd0c6adb96d7..c2b072e7af0d 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -132,7 +132,7 @@ getFirstStreamByRelType(const OUString& URL, std::initializer_list typ return {}; } -BitmapEx ThumbnailView::readThumbnail(const OUString &msURL) +Bitmap ThumbnailView::readThumbnail(const OUString &msURL) { using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -185,7 +185,7 @@ BitmapEx ThumbnailView::readThumbnail(const OUString &msURL) // Note that the preview is returned without scaling it to the desired // width. This gives the caller the chance to take advantage of a // possibly larger resolution then was asked for. - return aThumbnail; + return Bitmap(aThumbnail); } ThumbnailView::ThumbnailView(std::unique_ptr xWindow, std::unique_ptr xMenu)