diff options
Diffstat (limited to 'dbaccess/source/ui/app/AppIconControl.cxx')
| -rw-r--r-- | dbaccess/source/ui/app/AppIconControl.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx index ff9e35ab9cd3..bd6e86dcb8b7 100644 --- a/dbaccess/source/ui/app/AppIconControl.cxx +++ b/dbaccess/source/ui/app/AppIconControl.cxx @@ -22,7 +22,7 @@ #include <strings.hrc> #include <bitmaps.hlst> #include <sfx2/thumbnailviewitem.hxx> -#include <vcl/bitmapex.hxx> +#include <vcl/bitmap.hxx> #include <vcl/event.hxx> #include <vcl/i18nhelp.hxx> #include <vcl/mnemonic.hxx> @@ -69,27 +69,26 @@ OApplicationIconControl::OApplicationIconControl(std::unique_ptr<weld::ScrolledW void OApplicationIconControl::Fill() { - static const struct CategoryDescriptor + static constexpr struct CategoryDescriptor { TranslateId pLabelResId; ElementType eType; - const char* aImageResId; + OUString aImageResId; } aCategories[] = { { RID_STR_TABLES_CONTAINER, E_TABLE, BMP_TABLEFOLDER_TREE_L }, { RID_STR_QUERIES_CONTAINER, E_QUERY, BMP_QUERYFOLDER_TREE_L }, { RID_STR_FORMS_CONTAINER, E_FORM, BMP_FORMFOLDER_TREE_L }, { RID_STR_REPORTS_CONTAINER, E_REPORT, BMP_REPORTFOLDER_TREE_L } }; - for (const CategoryDescriptor& aCategorie : aCategories) + for (const CategoryDescriptor& aCategory : aCategories) { // E_TABLE is 0, but 0 means void so use id of enum + 1 - std::unique_ptr<ThumbnailViewItem> xItem( - new ThumbnailViewItem(*this, aCategorie.eType + 1)); + std::unique_ptr<ThumbnailViewItem> xItem(new ThumbnailViewItem(*this, aCategory.eType + 1)); xItem->mbBorder = false; - xItem->maPreview1 = BitmapEx(OUString::createFromAscii(aCategorie.aImageResId)); - const Size& rSize = xItem->maPreview1.GetSizePixel(); - m_nMaxWidth = std::max(m_nMaxWidth, rSize.Width()); - m_nMaxHeight = std::max(m_nMaxHeight, rSize.Height()); - xItem->maTitle = DBA_RES(aCategorie.pLabelResId); + xItem->maPreview = Bitmap(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)); } |
