diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-05-15 20:59:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-05-17 09:13:14 +0100 |
commit | 61964fc19da92ad5ff988fc071a94da61434fb7d (patch) | |
tree | 21e80ba2f88ccddd9dc8f7a99b2f224f31fe4a0a /svtools/source/misc | |
parent | 1c90deaa3f03978fcd31e8cf5c71e39cea455326 (diff) |
weld SvxJavaClassPathDlg
Change-Id: I3938a05d96cb1fc171611e54fa34f780ba569268
Diffstat (limited to 'svtools/source/misc')
-rw-r--r-- | svtools/source/misc/imagemgr.cxx | 201 |
1 files changed, 108 insertions, 93 deletions
diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx index 31357e2558c5..ed6ee671ef7c 100644 --- a/svtools/source/misc/imagemgr.cxx +++ b/svtools/source/misc/imagemgr.cxx @@ -479,104 +479,104 @@ static const char* GetFolderDescriptionId_Impl( const OUString& rURL ) return pRet; } -static Image GetImageFromList_Impl( SvImageId nImageId, bool bBig ) +static OUString GetImageNameFromList_Impl( SvImageId nImageId, bool bBig ) { if (bBig) { switch (nImageId) { case SvImageId::Impress: - return Image(BitmapEx(BMP_IMPRESS_LC)); + return OUString(BMP_IMPRESS_LC); case SvImageId::Bitmap: - return Image(BitmapEx(BMP_BITMAP_LC)); + return OUString(BMP_BITMAP_LC); case SvImageId::Calc: - return Image(BitmapEx(BMP_CALC_LC)); + return OUString(BMP_CALC_LC); case SvImageId::CalcTemplate: - return Image(BitmapEx(BMP_CALCTEMPLATE_LC)); + return OUString(BMP_CALCTEMPLATE_LC); case SvImageId::Database: - return Image(BitmapEx(BMP_DATABASE_LC)); + return OUString(BMP_DATABASE_LC); case SvImageId::ImpressTemplate: - return Image(BitmapEx(BMP_IMPRESSTEMPLATE_LC)); + return OUString(BMP_IMPRESSTEMPLATE_LC); case SvImageId::GIF: - return Image(BitmapEx(BMP_GIF_LC)); + return OUString(BMP_GIF_LC); case SvImageId::HTML: - return Image(BitmapEx(BMP_HTML_LC)); + return OUString(BMP_HTML_LC); case SvImageId::JPG: - return Image(BitmapEx(BMP_JPG_LC)); + return OUString(BMP_JPG_LC); case SvImageId::Math: - return Image(BitmapEx(BMP_MATH_LC)); + return OUString(BMP_MATH_LC); case SvImageId::MathTemplate: - return Image(BitmapEx(BMP_MATHTEMPLATE_LC)); + return OUString(BMP_MATHTEMPLATE_LC); case SvImageId::File: - return Image(BitmapEx(BMP_FILE_LC)); + return OUString(BMP_FILE_LC); case SvImageId::PCD: - return Image(BitmapEx(BMP_PCD_LC)); + return OUString(BMP_PCD_LC); case SvImageId::PCT: - return Image(BitmapEx(BMP_PCT_LC)); + return OUString(BMP_PCT_LC); case SvImageId::PCX: - return Image(BitmapEx(BMP_PCX_LC)); + return OUString(BMP_PCX_LC); case SvImageId::SIM: - return Image(BitmapEx(BMP_SIM_LC)); + return OUString(BMP_SIM_LC); case SvImageId::TextFile: - return Image(BitmapEx(BMP_TEXTFILE_LC)); + return OUString(BMP_TEXTFILE_LC); case SvImageId::TIFF: - return Image(BitmapEx(BMP_TIFF_LC)); + return OUString(BMP_TIFF_LC); case SvImageId::WMF: - return Image(BitmapEx(BMP_WMF_LC)); + return OUString(BMP_WMF_LC); case SvImageId::Writer: - return Image(BitmapEx(BMP_WRITER_LC)); + return OUString(BMP_WRITER_LC); case SvImageId::WriterTemplate: - return Image(BitmapEx(BMP_WRITERTEMPLATE_LC)); + return OUString(BMP_WRITERTEMPLATE_LC); case SvImageId::FixedDevice: - return Image(BitmapEx(BMP_FIXEDDEV_LC)); + return OUString(BMP_FIXEDDEV_LC); case SvImageId::RemoveableDevice: - return Image(BitmapEx(BMP_REMOVABLEDEV_LC)); + return OUString(BMP_REMOVABLEDEV_LC); case SvImageId::CDRomDevice: - return Image(BitmapEx(BMP_CDROMDEV_LC)); + return OUString(BMP_CDROMDEV_LC); case SvImageId::NetworkDevice: - return Image(BitmapEx(BMP_NETWORKDEV_LC)); + return OUString(BMP_NETWORKDEV_LC); case SvImageId::Table: - return Image(BitmapEx(BMP_TABLE_LC)); + return OUString(BMP_TABLE_LC); case SvImageId::Folder: - return Image(BitmapEx(BMP_FOLDER_LC)); + return OUString(BMP_FOLDER_LC); case SvImageId::DXF: - return Image(BitmapEx(BMP_DXF_LC)); + return OUString(BMP_DXF_LC); case SvImageId::MET: - return Image(BitmapEx(BMP_MET_LC)); + return OUString(BMP_MET_LC); case SvImageId::PNG: - return Image(BitmapEx(BMP_PNG_LC)); + return OUString(BMP_PNG_LC); case SvImageId::SVM: - return Image(BitmapEx(BMP_SVM_LC)); + return OUString(BMP_SVM_LC); case SvImageId::GlobalDoc: - return Image(BitmapEx(BMP_GLOBAL_DOC_LC)); + return OUString(BMP_GLOBAL_DOC_LC); case SvImageId::Draw: - return Image(BitmapEx(BMP_DRAW_LC)); + return OUString(BMP_DRAW_LC); case SvImageId::DrawTemplate: - return Image(BitmapEx(BMP_DRAWTEMPLATE_LC)); + return OUString(BMP_DRAWTEMPLATE_LC); case SvImageId::OO_DatabaseDoc: - return Image(BitmapEx(BMP_OO_DATABASE_DOC_LC)); + return OUString(BMP_OO_DATABASE_DOC_LC); case SvImageId::OO_DrawDoc: - return Image(BitmapEx(BMP_OO_DRAW_DOC_LC)); + return OUString(BMP_OO_DRAW_DOC_LC); case SvImageId::OO_MathDoc: - return Image(BitmapEx(BMP_OO_MATH_DOC_LC)); + return OUString(BMP_OO_MATH_DOC_LC); case SvImageId::OO_GlobalDoc: - return Image(BitmapEx(BMP_OO_GLOBAL_DOC_LC)); + return OUString(BMP_OO_GLOBAL_DOC_LC); case SvImageId::OO_ImpressDoc: - return Image(BitmapEx(BMP_OO_IMPRESS_DOC_LC)); + return OUString(BMP_OO_IMPRESS_DOC_LC); case SvImageId::OO_CalcDoc: - return Image(BitmapEx(BMP_OO_CALC_DOC_LC)); + return OUString(BMP_OO_CALC_DOC_LC); case SvImageId::OO_WriterDoc: - return Image(BitmapEx(BMP_OO_WRITER_DOC_LC)); + return OUString(BMP_OO_WRITER_DOC_LC); case SvImageId::OO_DrawTemplate: - return Image(BitmapEx(BMP_OO_DRAW_TEMPLATE_LC)); + return OUString(BMP_OO_DRAW_TEMPLATE_LC); case SvImageId::OO_ImpressTemplate: - return Image(BitmapEx(BMP_OO_IMPRESS_TEMPLATE_LC)); + return OUString(BMP_OO_IMPRESS_TEMPLATE_LC); case SvImageId::OO_CalcTemplate: - return Image(BitmapEx(BMP_OO_CALC_TEMPLATE_LC)); + return OUString(BMP_OO_CALC_TEMPLATE_LC); case SvImageId::OO_WriterTemplate: - return Image(BitmapEx(BMP_OO_WRITER_TEMPLATE_LC)); + return OUString(BMP_OO_WRITER_TEMPLATE_LC); case SvImageId::Extension: - return Image(BitmapEx(BMP_EXTENSION_LC)); + return OUString(BMP_EXTENSION_LC); default: break; } } @@ -585,102 +585,110 @@ static Image GetImageFromList_Impl( SvImageId nImageId, bool bBig ) switch (nImageId) { case SvImageId::Impress: - return Image(BitmapEx(BMP_IMPRESS_SC)); + return OUString(BMP_IMPRESS_SC); case SvImageId::Bitmap: - return Image(BitmapEx(BMP_BITMAP_SC)); + return OUString(BMP_BITMAP_SC); case SvImageId::Calc: - return Image(BitmapEx(BMP_CALC_SC)); + return OUString(BMP_CALC_SC); case SvImageId::CalcTemplate: - return Image(BitmapEx(BMP_CALCTEMPLATE_SC)); + return OUString(BMP_CALCTEMPLATE_SC); case SvImageId::Database: - return Image(BitmapEx(BMP_DATABASE_SC)); + return OUString(BMP_DATABASE_SC); case SvImageId::ImpressTemplate: - return Image(BitmapEx(BMP_IMPRESSTEMPLATE_SC)); + return OUString(BMP_IMPRESSTEMPLATE_SC); case SvImageId::GIF: - return Image(BitmapEx(BMP_GIF_SC)); + return OUString(BMP_GIF_SC); case SvImageId::HTML: - return Image(BitmapEx(BMP_HTML_SC)); + return OUString(BMP_HTML_SC); case SvImageId::JPG: - return Image(BitmapEx(BMP_JPG_SC)); + return OUString(BMP_JPG_SC); case SvImageId::Math: - return Image(BitmapEx(BMP_MATH_SC)); + return OUString(BMP_MATH_SC); case SvImageId::MathTemplate: - return Image(BitmapEx(BMP_MATHTEMPLATE_SC)); + return OUString(BMP_MATHTEMPLATE_SC); case SvImageId::File: - return Image(BitmapEx(BMP_FILE_SC)); + return OUString(BMP_FILE_SC); case SvImageId::PCD: - return Image(BitmapEx(BMP_PCD_SC)); + return OUString(BMP_PCD_SC); case SvImageId::PCT: - return Image(BitmapEx(BMP_PCT_SC)); + return OUString(BMP_PCT_SC); case SvImageId::PCX: - return Image(BitmapEx(BMP_PCX_SC)); + return OUString(BMP_PCX_SC); case SvImageId::SIM: - return Image(BitmapEx(BMP_SIM_SC)); + return OUString(BMP_SIM_SC); case SvImageId::TextFile: - return Image(BitmapEx(BMP_TEXTFILE_SC)); + return OUString(BMP_TEXTFILE_SC); case SvImageId::TIFF: - return Image(BitmapEx(BMP_TIFF_SC)); + return OUString(BMP_TIFF_SC); case SvImageId::WMF: - return Image(BitmapEx(BMP_WMF_SC)); + return OUString(BMP_WMF_SC); case SvImageId::Writer: - return Image(BitmapEx(BMP_WRITER_SC)); + return OUString(BMP_WRITER_SC); case SvImageId::WriterTemplate: - return Image(BitmapEx(BMP_WRITERTEMPLATE_SC)); + return OUString(BMP_WRITERTEMPLATE_SC); case SvImageId::FixedDevice: - return Image(BitmapEx(BMP_FIXEDDEV_SC)); + return OUString(BMP_FIXEDDEV_SC); case SvImageId::RemoveableDevice: - return Image(BitmapEx(BMP_REMOVABLEDEV_SC)); + return OUString(BMP_REMOVABLEDEV_SC); case SvImageId::CDRomDevice: - return Image(BitmapEx(BMP_CDROMDEV_SC)); + return OUString(BMP_CDROMDEV_SC); case SvImageId::NetworkDevice: - return Image(BitmapEx(BMP_NETWORKDEV_SC)); + return OUString(BMP_NETWORKDEV_SC); case SvImageId::Table: - return Image(BitmapEx(BMP_TABLE_SC)); + return OUString(BMP_TABLE_SC); case SvImageId::Folder: // if not bBig, then return our new small folder image (256 colors) - return Image(BitmapEx(RID_BMP_FOLDER)); + return OUString(RID_BMP_FOLDER); case SvImageId::DXF: - return Image(BitmapEx(BMP_DXF_SC)); + return OUString(BMP_DXF_SC); case SvImageId::MET: - return Image(BitmapEx(BMP_MET_SC)); + return OUString(BMP_MET_SC); case SvImageId::PNG: - return Image(BitmapEx(BMP_PNG_SC)); + return OUString(BMP_PNG_SC); case SvImageId::SVM: - return Image(BitmapEx(BMP_SVM_SC)); + return OUString(BMP_SVM_SC); case SvImageId::GlobalDoc: - return Image(BitmapEx(BMP_GLOBAL_DOC_SC)); + return OUString(BMP_GLOBAL_DOC_SC); case SvImageId::Draw: - return Image(BitmapEx(BMP_DRAW_SC)); + return OUString(BMP_DRAW_SC); case SvImageId::DrawTemplate: - return Image(BitmapEx(BMP_DRAWTEMPLATE_SC)); + return OUString(BMP_DRAWTEMPLATE_SC); case SvImageId::OO_DatabaseDoc: - return Image(BitmapEx(BMP_OO_DATABASE_DOC_SC)); + return OUString(BMP_OO_DATABASE_DOC_SC); case SvImageId::OO_DrawDoc: - return Image(BitmapEx(BMP_OO_DRAW_DOC_SC)); + return OUString(BMP_OO_DRAW_DOC_SC); case SvImageId::OO_MathDoc: - return Image(BitmapEx(BMP_OO_MATH_DOC_SC)); + return OUString(BMP_OO_MATH_DOC_SC); case SvImageId::OO_GlobalDoc: - return Image(BitmapEx(BMP_OO_GLOBAL_DOC_SC)); + return OUString(BMP_OO_GLOBAL_DOC_SC); case SvImageId::OO_ImpressDoc: - return Image(BitmapEx(BMP_OO_IMPRESS_DOC_SC)); + return OUString(BMP_OO_IMPRESS_DOC_SC); case SvImageId::OO_CalcDoc: - return Image(BitmapEx(BMP_OO_CALC_DOC_SC)); + return OUString(BMP_OO_CALC_DOC_SC); case SvImageId::OO_WriterDoc: - return Image(BitmapEx(BMP_OO_WRITER_DOC_SC)); + return OUString(BMP_OO_WRITER_DOC_SC); case SvImageId::OO_DrawTemplate: - return Image(BitmapEx(BMP_OO_DRAW_TEMPLATE_SC)); + return OUString(BMP_OO_DRAW_TEMPLATE_SC); case SvImageId::OO_ImpressTemplate: - return Image(BitmapEx(BMP_OO_IMPRESS_TEMPLATE_SC)); + return OUString(BMP_OO_IMPRESS_TEMPLATE_SC); case SvImageId::OO_CalcTemplate: - return Image(BitmapEx(BMP_OO_CALC_TEMPLATE_SC)); + return OUString(BMP_OO_CALC_TEMPLATE_SC); case SvImageId::OO_WriterTemplate: - return Image(BitmapEx(BMP_OO_WRITER_TEMPLATE_SC)); + return OUString(BMP_OO_WRITER_TEMPLATE_SC); case SvImageId::Extension: - return Image(BitmapEx(BMP_EXTENSION_SC)); + return OUString(BMP_EXTENSION_SC); default: break; } } + return OUString(); +} + +static Image GetImageFromList_Impl( SvImageId nImageId, bool bBig ) +{ + OUString sImageName(GetImageNameFromList_Impl(nImageId, bBig)); + if (!sImageName.isEmpty()) + return Image(BitmapEx(sImageName)); return Image(); } @@ -749,6 +757,13 @@ OUString SvFileInformationManager::GetDescription_Impl( const INetURLObject& rOb return sDescription; } +OUString SvFileInformationManager::GetImageId(const INetURLObject& rObject, bool bBig) +{ + SvImageId nImage = GetImageId_Impl( rObject, true ); + DBG_ASSERT( nImage != SvImageId::NONE, "invalid ImageId" ); + return GetImageNameFromList_Impl(nImage, bBig); +} + Image SvFileInformationManager::GetImage( const INetURLObject& rObject, bool bBig ) { SvImageId nImage = GetImageId_Impl( rObject, true ); |