dbaccess/source/ui/app/AppIconControl.cxx | 8 ++++---- include/sfx2/templatelocalview.hxx | 2 +- include/sfx2/templateproperties.hxx | 2 +- include/sfx2/thumbnailviewitem.hxx | 2 +- sfx2/source/control/recentdocsviewitem.cxx | 2 +- sfx2/source/control/templatelocalview.cxx | 18 +++++++++--------- sfx2/source/control/templateviewitem.cxx | 4 ++-- sfx2/source/control/thumbnailviewitem.cxx | 6 +++--- 8 files changed, 22 insertions(+), 22 deletions(-)
New commits: commit 6e001cf2a1032e0199d4ad2babc4790989767128 Author: Noel Grandin <[email protected]> AuthorDate: Tue Aug 5 13:25:09 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Aug 5 15:51:01 2025 +0200 BitmapEx->Bitmap in ThumbnailViewItem now that Bitmap can handle transparency Change-Id: Ibe7f96247253a3fe9ca38fd09224ce85d0802d84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188955 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx index 0483ab38f4dd..d0a0a237dd19 100644 --- a/dbaccess/source/ui/app/AppIconControl.cxx +++ b/dbaccess/source/ui/app/AppIconControl.cxx @@ -84,10 +84,10 @@ void OApplicationIconControl::Fill() // E_TABLE is 0, but 0 means void so use id of enum + 1 std::unique_ptr<ThumbnailViewItem> xItem(new ThumbnailViewItem(*this, aCategory.eType + 1)); xItem->mbBorder = false; - xItem->maPreview1 = BitmapEx(aCategory.aImageResId); - const Size& rSize = xItem->maPreview1.GetSizePixel(); - m_nMaxWidth = std::max(m_nMaxWidth, rSize.Width()); - m_nMaxHeight = std::max(m_nMaxHeight, rSize.Height()); + xItem->maPreview = Bitmap(BitmapEx(aCategory.aImageResId)); + const Size aSize = xItem->maPreview.GetSizePixel(); + m_nMaxWidth = std::max(m_nMaxWidth, aSize.Width()); + m_nMaxHeight = std::max(m_nMaxHeight, aSize.Height()); xItem->maTitle = DBA_RES(aCategory.pLabelResId); m_nMaxWidth = std::max<tools::Long>(m_nMaxWidth, GetTextWidth(xItem->maTitle)); AppendItem(std::move(xItem)); diff --git a/include/sfx2/templatelocalview.hxx b/include/sfx2/templatelocalview.hxx index c1b488bcc317..c724f0c19707 100644 --- a/include/sfx2/templatelocalview.hxx +++ b/include/sfx2/templatelocalview.hxx @@ -152,7 +152,7 @@ public: static Bitmap scaleImg (const Bitmap &rImg, tools::Long width, tools::Long height); - static BitmapEx getDefaultThumbnail( std::u16string_view rPath ); + static Bitmap getDefaultThumbnail( std::u16string_view rPath ); static Bitmap fetchThumbnail (const OUString &msURL, tools::Long width, tools::Long height); diff --git a/include/sfx2/templateproperties.hxx b/include/sfx2/templateproperties.hxx index 2c1de01257e3..2a4ebd1099e2 100644 --- a/include/sfx2/templateproperties.hxx +++ b/include/sfx2/templateproperties.hxx @@ -21,7 +21,7 @@ struct TemplateItemProperties OUString aName; OUString aPath; OUString aRegionName; - BitmapEx aThumbnail; + Bitmap aThumbnail; }; #endif // INCLUDED_SFX2_TEMPLATEPROPERTIES_HXX diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx index 834955082c0d..25db05a05a34 100644 --- a/include/sfx2/thumbnailviewitem.hxx +++ b/include/sfx2/thumbnailviewitem.hxx @@ -71,7 +71,7 @@ public: bool mbBorder; bool mbSelected; bool mbHover; - BitmapEx maPreview1; + Bitmap maPreview; OUString maTitle; OUString maHelpText; rtl::Reference< ThumbnailViewItemAcc > mxAcc; diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx index ab9102b769de..a2defa9d9ffd 100644 --- a/sfx2/source/control/recentdocsviewitem.cxx +++ b/sfx2/source/control/recentdocsviewitem.cxx @@ -232,7 +232,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView &rView, const OUStri } maTitle = aTitle; - maPreview1 = aThumbnail; + maPreview = aThumbnail; } ::tools::Rectangle RecentDocsViewItem::updateHighlight(bool bVisible, const Point& rPoint) diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx index 237d1adfa538..4085da25b973 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -491,7 +491,7 @@ void TemplateLocalView::moveTemplates(const std::set<const ThumbnailViewItem*, s aTemplateItem.aName = pViewItem->maTitle; aTemplateItem.aPath = mpDocTemplates->GetPath(nTargetRegion,nTargetIdx); aTemplateItem.aRegionName = pViewItem->maHelpText; - aTemplateItem.aThumbnail = pViewItem->maPreview1; + aTemplateItem.aThumbnail = pViewItem->maPreview; pTarget->maTemplates.push_back(aTemplateItem); @@ -672,7 +672,7 @@ void TemplateLocalView::insertItems(const std::vector<TemplateItemProperties> &r pChild->setHelpText(sHelpText); } - pChild->maPreview1 = pCur->aThumbnail; + pChild->maPreview = pCur->aThumbnail; if(IsDefaultTemplate(pCur->aPath)) pChild->showDefaultIcon(true); @@ -680,7 +680,7 @@ void TemplateLocalView::insertItems(const std::vector<TemplateItemProperties> &r if ( pCur->aThumbnail.IsEmpty() ) { // Use the default thumbnail if we have nothing else - pChild->maPreview1 = TemplateLocalView::getDefaultThumbnail(pCur->aPath); + pChild->maPreview = TemplateLocalView::getDefaultThumbnail(pCur->aPath); } aItems[i] = std::move(pChild); @@ -865,20 +865,20 @@ void TemplateLocalView::RemoveDefaultTemplateIcon(std::u16string_view rPath) } } -BitmapEx TemplateLocalView::getDefaultThumbnail( std::u16string_view rPath ) +Bitmap TemplateLocalView::getDefaultThumbnail( std::u16string_view rPath ) { - BitmapEx aImg; + Bitmap aImg; INetURLObject aUrl(rPath); OUString aExt = aUrl.getExtension(); if ( ViewFilter_Application::isFilteredExtension( FILTER_APPLICATION::WRITER, aExt) ) - aImg = BitmapEx(SFX_THUMBNAIL_TEXT); + aImg = Bitmap(BitmapEx(SFX_THUMBNAIL_TEXT)); else if ( ViewFilter_Application::isFilteredExtension( FILTER_APPLICATION::CALC, aExt) ) - aImg = BitmapEx(SFX_THUMBNAIL_SHEET); + aImg = Bitmap(BitmapEx(SFX_THUMBNAIL_SHEET)); else if ( ViewFilter_Application::isFilteredExtension( FILTER_APPLICATION::IMPRESS, aExt) ) - aImg = BitmapEx(SFX_THUMBNAIL_PRESENTATION); + aImg = Bitmap(BitmapEx(SFX_THUMBNAIL_PRESENTATION)); else if ( ViewFilter_Application::isFilteredExtension( FILTER_APPLICATION::DRAW, aExt) ) - aImg = BitmapEx(SFX_THUMBNAIL_DRAWING); + aImg = Bitmap(BitmapEx(SFX_THUMBNAIL_DRAWING)); return aImg; } diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx index 3a77dac11a64..d0dd8533ee6d 100644 --- a/sfx2/source/control/templateviewitem.cxx +++ b/sfx2/source/control/templateviewitem.cxx @@ -77,7 +77,7 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces true); // Draw thumbnail - Size aImageSize = maPreview1.GetSizePixel(); + Size aImageSize = maPreview.GetSizePixel(); float fWidth = aImageSize.Width(); float fHeight = aImageSize.Height(); @@ -96,7 +96,7 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces aSeq[2] = new FillGraphicPrimitive2D( createTranslateB2DHomMatrix(maPrev1Pos.X(),maPrev1Pos.Y()), - FillGraphicAttribute(Graphic(maPreview1), + FillGraphicAttribute(Graphic(maPreview), B2DRange( B2DPoint(0,0), B2DPoint(aImageSize.Width(),aImageSize.Height())), diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx index 8deaa8897df5..12eca81125e4 100644 --- a/sfx2/source/control/thumbnailviewitem.cxx +++ b/sfx2/source/control/thumbnailviewitem.cxx @@ -133,7 +133,7 @@ void ThumbnailViewItem::calculateItemsPosition (const tools::Long nThumbnailHeig pAttrs->aFontSize.getX(), pAttrs->aFontSize.getY(), css::lang::Locale() ); - Size aImageSize = maPreview1.GetSizePixel(); + Size aImageSize = maPreview.GetSizePixel(); // Calculate thumbnail position const Point aPos = maDrawArea.TopCenter(); @@ -173,11 +173,11 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc // Draw thumbnail Point aPos = maPrev1Pos; - Size aImageSize = maPreview1.GetSizePixel(); + Size aImageSize = maPreview.GetSizePixel(); aSeq[nPrimitive++] = new FillGraphicPrimitive2D( createTranslateB2DHomMatrix(aPos.X(),aPos.Y()), - FillGraphicAttribute(Graphic(maPreview1), + FillGraphicAttribute(Graphic(maPreview), B2DRange( B2DPoint(0,0), B2DPoint(aImageSize.Width(),aImageSize.Height())),
