diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-07 10:29:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-08 19:15:09 +0100 |
commit | 15f0d61206dddee12159b68aeab5c860e3d5aff4 (patch) | |
tree | 9eee7e6918281ba7e5ffd3e06d74a2fa4fe28de3 /sfx2 | |
parent | ceb32911f07b63fda074facba377eeb4d5946cdf (diff) |
use Image(OUString) instead of Image(Bitmap(OUString))
which benefits LOOL since we can delay creating the image until
we know the dpi setting of the display we are going to write to.
Achieved by
perl -pi -w -e "s/\bImage\s*\(\s*BitmapEx\s*\((\w+)\s*\)\s*\)/Image\(\1\)/g" $( git grep -lw "BitmapEx" )
followed by
git grep -nP '\bImage\s*\(\s*BitmapEx\s*\('
followed by commenting out the BitmapEx(OUString) constructor and seeing
what needed adjusting.
Change-Id: I3224e11937d720fa484b0d659d25673a9e809267
Reviewed-on: https://gerrit.libreoffice.org/64760
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 44 | ||||
-rw-r--r-- | sfx2/source/control/recentdocsview.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/infobar.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/titledockwin.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 4 |
7 files changed, 32 insertions, 33 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 92a558285efc..7a269a09d8a4 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -266,9 +266,9 @@ struct ContentEntry_Impl ContentListBox_Impl::ContentListBox_Impl(vcl::Window* pParent, WinBits nStyle) : SvTreeListBox(pParent, nStyle) - , aOpenBookImage(BitmapEx(BMP_HELP_CONTENT_BOOK_OPEN)) - , aClosedBookImage(BitmapEx(BMP_HELP_CONTENT_BOOK_CLOSED)) - , aDocumentImage(BitmapEx(BMP_HELP_CONTENT_DOC)) + , aOpenBookImage(StockImage::Yes, BMP_HELP_CONTENT_BOOK_OPEN) + , aClosedBookImage(StockImage::Yes, BMP_HELP_CONTENT_BOOK_CLOSED) + , aDocumentImage(StockImage::Yes, BMP_HELP_CONTENT_DOC) { SetStyle( GetStyle() | WB_HIDESELECTION | WB_HSCROLL ); @@ -1851,8 +1851,8 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) : aToolBox ( VclPtr<ToolBox>::Create(this, 0) ), aOnStartupCB ( VclPtr<CheckBox>::Create(this, WB_HIDE | WB_TABSTOP) ), aSelectIdle ( "sfx2 appl SfxHelpTextWindow_Impl Select" ), - aIndexOnImage (BitmapEx(BMP_HELP_TOOLBOX_INDEX_ON)), - aIndexOffImage (BitmapEx(BMP_HELP_TOOLBOX_INDEX_OFF)), + aIndexOnImage (StockImage::Yes, BMP_HELP_TOOLBOX_INDEX_ON), + aIndexOffImage (StockImage::Yes, BMP_HELP_TOOLBOX_INDEX_OFF), aIndexOnText ( SfxResId( STR_HELP_BUTTON_INDEX_ON ) ), aIndexOffText ( SfxResId( STR_HELP_BUTTON_INDEX_OFF ) ), aOnStartupText ( SfxResId( RID_HELP_ONSTARTUP_TEXT ) ), @@ -1947,33 +1947,33 @@ void SfxHelpTextWindow_Impl::InitToolBoxImages() { bool bLarge = SvtMiscOptions().AreCurrentSymbolsLarge(); - aIndexOnImage = Image(BitmapEx(bLarge ? OUString(BMP_HELP_TOOLBOX_L_INDEX_ON) : OUString(BMP_HELP_TOOLBOX_INDEX_ON))); - aIndexOffImage = Image(BitmapEx(bLarge ? OUString(BMP_HELP_TOOLBOX_L_INDEX_OFF) : OUString(BMP_HELP_TOOLBOX_INDEX_OFF))); + aIndexOnImage = Image(StockImage::Yes, bLarge ? OUString(BMP_HELP_TOOLBOX_L_INDEX_ON) : OUString(BMP_HELP_TOOLBOX_INDEX_ON)); + aIndexOffImage = Image(StockImage::Yes, bLarge ? OUString(BMP_HELP_TOOLBOX_L_INDEX_OFF) : OUString(BMP_HELP_TOOLBOX_INDEX_OFF)); aToolBox->SetItemImage( TBI_INDEX, bIsIndexOn ? aIndexOffImage : aIndexOnImage ); aToolBox->SetItemImage( TBI_BACKWARD, - Image(BitmapEx(bLarge ? OUString(BMP_HELP_TOOLBOX_L_PREV) : OUString(BMP_HELP_TOOLBOX_PREV))) + Image(StockImage::Yes, bLarge ? OUString(BMP_HELP_TOOLBOX_L_PREV) : OUString(BMP_HELP_TOOLBOX_PREV)) ); aToolBox->SetItemImage( TBI_FORWARD, - Image(BitmapEx(bLarge ? OUString(BMP_HELP_TOOLBOX_L_NEXT) : OUString(BMP_HELP_TOOLBOX_NEXT))) + Image(StockImage::Yes, bLarge ? OUString(BMP_HELP_TOOLBOX_L_NEXT) : OUString(BMP_HELP_TOOLBOX_NEXT)) ); aToolBox->SetItemImage( TBI_START, - Image(BitmapEx(bLarge ? OUString(BMP_HELP_TOOLBOX_L_START) : OUString(BMP_HELP_TOOLBOX_START))) + Image(StockImage::Yes, bLarge ? OUString(BMP_HELP_TOOLBOX_L_START) : OUString(BMP_HELP_TOOLBOX_START)) ); aToolBox->SetItemImage( TBI_PRINT, - Image(BitmapEx(bLarge ? OUString(BMP_HELP_TOOLBOX_L_PRINT) : OUString(BMP_HELP_TOOLBOX_PRINT))) + Image(StockImage::Yes, bLarge ? OUString(BMP_HELP_TOOLBOX_L_PRINT) : OUString(BMP_HELP_TOOLBOX_PRINT)) ); aToolBox->SetItemImage( TBI_BOOKMARKS, - Image(BitmapEx(bLarge ? OUString(BMP_HELP_TOOLBOX_L_BOOKMARKS) : OUString(BMP_HELP_TOOLBOX_BOOKMARKS))) + Image(StockImage::Yes, bLarge ? OUString(BMP_HELP_TOOLBOX_L_BOOKMARKS) : OUString(BMP_HELP_TOOLBOX_BOOKMARKS)) ); aToolBox->SetItemImage( TBI_SEARCHDIALOG, - Image(BitmapEx(bLarge ? OUString(BMP_HELP_TOOLBOX_L_SEARCHDIALOG) : OUString(BMP_HELP_TOOLBOX_SEARCHDIALOG))) + Image(StockImage::Yes, bLarge ? OUString(BMP_HELP_TOOLBOX_L_SEARCHDIALOG) : OUString(BMP_HELP_TOOLBOX_SEARCHDIALOG)) ); Size aSize = aToolBox->CalcWindowSizePixel(); @@ -2319,43 +2319,43 @@ bool SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) aPos.AdjustY(pTextWin->GetPosPixel().Y() ); ScopedVclPtrInstance<PopupMenu> aMenu; if ( bIsIndexOn ) - aMenu->InsertItem(TBI_INDEX, aIndexOffText, Image(BitmapEx(BMP_HELP_TOOLBOX_INDEX_OFF))); + aMenu->InsertItem(TBI_INDEX, aIndexOffText, Image(StockImage::Yes, BMP_HELP_TOOLBOX_INDEX_OFF)); else - aMenu->InsertItem(TBI_INDEX, aIndexOnText, Image(BitmapEx(BMP_HELP_TOOLBOX_INDEX_ON))); + aMenu->InsertItem(TBI_INDEX, aIndexOnText, Image(StockImage::Yes, BMP_HELP_TOOLBOX_INDEX_ON)); aMenu->SetHelpId( TBI_INDEX, HID_HELP_TOOLBOXITEM_INDEX ); aMenu->InsertSeparator(); aMenu->InsertItem( TBI_BACKWARD, SfxResId( STR_HELP_BUTTON_PREV ), - Image(BitmapEx(BMP_HELP_TOOLBOX_PREV)) + Image(StockImage::Yes, BMP_HELP_TOOLBOX_PREV) ); aMenu->SetHelpId( TBI_BACKWARD, HID_HELP_TOOLBOXITEM_BACKWARD ); aMenu->EnableItem( TBI_BACKWARD, pHelpWin->HasHistoryPredecessor() ); aMenu->InsertItem( TBI_FORWARD, SfxResId( STR_HELP_BUTTON_NEXT ), - Image(BitmapEx(BMP_HELP_TOOLBOX_NEXT)) + Image(StockImage::Yes, BMP_HELP_TOOLBOX_NEXT) ); aMenu->SetHelpId( TBI_FORWARD, HID_HELP_TOOLBOXITEM_FORWARD ); aMenu->EnableItem( TBI_FORWARD, pHelpWin->HasHistorySuccessor() ); aMenu->InsertItem( TBI_START, SfxResId( STR_HELP_BUTTON_START ), - Image(BitmapEx(BMP_HELP_TOOLBOX_START)) + Image(StockImage::Yes, BMP_HELP_TOOLBOX_START) ); aMenu->SetHelpId( TBI_START, HID_HELP_TOOLBOXITEM_START ); aMenu->InsertSeparator(); aMenu->InsertItem( TBI_PRINT, SfxResId( STR_HELP_BUTTON_PRINT ), - Image(BitmapEx(BMP_HELP_TOOLBOX_PRINT)) + Image(StockImage::Yes, BMP_HELP_TOOLBOX_PRINT) ); aMenu->SetHelpId( TBI_PRINT, HID_HELP_TOOLBOXITEM_PRINT ); aMenu->InsertItem( TBI_BOOKMARKS, SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ), - Image(BitmapEx(BMP_HELP_TOOLBOX_BOOKMARKS)) + Image(StockImage::Yes, BMP_HELP_TOOLBOX_BOOKMARKS) ); aMenu->SetHelpId( TBI_BOOKMARKS, HID_HELP_TOOLBOXITEM_BOOKMARKS ); aMenu->InsertItem( TBI_SEARCHDIALOG, SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ), - Image(BitmapEx(BMP_HELP_TOOLBOX_SEARCHDIALOG)) + Image(StockImage::Yes, BMP_HELP_TOOLBOX_SEARCHDIALOG) ); aMenu->SetHelpId( TBI_SEARCHDIALOG, HID_HELP_TOOLBOXITEM_SEARCHDIALOG ); aMenu->InsertSeparator(); @@ -2378,7 +2378,7 @@ bool SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) aMenu->InsertSeparator(); aMenu->InsertItem( TBI_COPY, SfxResId(STR_HELP_MENU_TEXT_COPY), - Image(BitmapEx(BMP_HELP_TOOLBOX_COPY)) + Image(StockImage::Yes, BMP_HELP_TOOLBOX_COPY) ); aMenu->SetHelpId( TBI_COPY, ".uno:Copy" ); aMenu->EnableItem( TBI_COPY, HasSelection() ); diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx index b35397cf9296..3970c7f08a39 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -123,7 +123,7 @@ RecentDocsView::RecentDocsView( vcl::Window* pParent ) : ThumbnailView(pParent) , mnFileTypes(ApplicationType::TYPE_NONE) , mnLastMouseDownItem(THUMBNAILVIEW_ITEM_NOTFOUND) - , maWelcomeImage(BitmapEx(BMP_WELCOME)) + , maWelcomeImage(StockImage::Yes, BMP_WELCOME) , maWelcomeLine1(SfxResId(STR_WELCOME_LINE1)) , maWelcomeLine2(SfxResId(STR_WELCOME_LINE2)) { diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 316372ec6f2b..c866edd2ed45 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1421,7 +1421,7 @@ CustomPropertyLine::CustomPropertyLine( vcl::Window* pParent ) : m_aTimeField->SetExtFormat( ExtTimeFieldFormat::Long24H ); m_aDateField->SetExtDateFormat( ExtDateFieldFormat::SystemShortYYYY ); - m_aRemoveButton->SetModeImage(Image(BitmapEx(SFX_BMP_PROPERTY_REMOVE))); + m_aRemoveButton->SetModeImage(Image(StockImage::Yes, SFX_BMP_PROPERTY_REMOVE)); m_aRemoveButton->SetQuickHelpText(SfxResId(STR_SFX_REMOVE_PROPERTY)); m_aEditButton->SetText(SFX_ST_EDIT); diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx index d1f753c8da71..4e66a9db55f4 100644 --- a/sfx2/source/dialog/infobar.cxx +++ b/sfx2/source/dialog/infobar.cxx @@ -183,7 +183,7 @@ SfxInfoBarWindow::SfxInfoBarWindow(vcl::Window* pParent, const OUString& sId, long nWidth = pParent->GetSizePixel().getWidth(); SetPosSizePixel(Point(0, 0), Size(nWidth, INFO_BAR_BASE_HEIGHT * fScaleFactor)); - m_pImage->SetImage(Image(BitmapEx(GetInfoBarIconName(ibType)))); + m_pImage->SetImage(Image(StockImage::Yes, GetInfoBarIconName(ibType))); m_pImage->SetPaintTransparent(true); m_pImage->Show(); @@ -305,7 +305,7 @@ void SfxInfoBarWindow::Update( const OUString &sNewMessage, InfoBarType eType ) { m_eType = eType; SetForeAndBackgroundColors(m_eType); - m_pImage->SetImage(Image(BitmapEx(GetInfoBarIconName(eType)))); + m_pImage->SetImage(Image(StockImage::Yes, GetInfoBarIconName(eType))); } m_pMessage->SetText( sNewMessage ); diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index d7a3ad778d89..6a29e77056b8 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -2140,13 +2140,13 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(SfxBindings* pB, SfxTemplatePanel , m_aActionTbL(VclPtrInstance<DropToolBox_Impl>(pDlgWindow, this)) , m_aActionTbR(VclPtrInstance<ToolBox>(pDlgWindow)) { - m_aActionTbR->InsertItem(SID_STYLE_WATERCAN, Image(BitmapEx(RID_SFXBMP_WATERCAN)), SfxResId(STR_STYLE_FILL_FORMAT_MODE)); + m_aActionTbR->InsertItem(SID_STYLE_WATERCAN, Image(StockImage::Yes, RID_SFXBMP_WATERCAN), SfxResId(STR_STYLE_FILL_FORMAT_MODE)); m_aActionTbR->SetHelpId(SID_STYLE_WATERCAN, HID_TEMPLDLG_WATERCAN); - m_aActionTbR->InsertItem(SID_STYLE_NEW_BY_EXAMPLE, Image(BitmapEx(RID_SFXBMP_NEW_BY_EXAMPLE)), SfxResId(STR_STYLE_NEW_STYLE_FROM_SELECTION)); + m_aActionTbR->InsertItem(SID_STYLE_NEW_BY_EXAMPLE, Image(StockImage::Yes, RID_SFXBMP_NEW_BY_EXAMPLE), SfxResId(STR_STYLE_NEW_STYLE_FROM_SELECTION)); m_aActionTbR->SetHelpId(SID_STYLE_NEW_BY_EXAMPLE, HID_TEMPLDLG_NEWBYEXAMPLE); - m_aActionTbR->InsertItem(SID_STYLE_UPDATE_BY_EXAMPLE, Image(BitmapEx(RID_SFXBMP_UPDATE_BY_EXAMPLE)), SfxResId(STR_STYLE_UPDATE_STYLE)); + m_aActionTbR->InsertItem(SID_STYLE_UPDATE_BY_EXAMPLE, Image(StockImage::Yes, RID_SFXBMP_UPDATE_BY_EXAMPLE), SfxResId(STR_STYLE_UPDATE_STYLE)); m_aActionTbR->SetHelpId(SID_STYLE_UPDATE_BY_EXAMPLE, HID_TEMPLDLG_UPDATEBYEXAMPLE); Initialize(); diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx index 575b4253a56c..c82d1ec84033 100644 --- a/sfx2/source/dialog/titledockwin.cxx +++ b/sfx2/source/dialog/titledockwin.cxx @@ -215,8 +215,7 @@ namespace sfx2 m_aToolbox->Clear(); // Get the closer bitmap and set it as right most button. - BitmapEx aBitmapEx(SFX_BMP_CLOSE_DOC); - m_aToolbox->InsertItem(1, Image(aBitmapEx)); + m_aToolbox->InsertItem(1, Image(StockImage::Yes, SFX_BMP_CLOSE_DOC)); m_aToolbox->SetQuickHelpText(1, SfxResId(STR_CLOSE_PANE)); m_aToolbox->ShowItem( 1 ); } diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 717eabb934c2..940679960b93 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -171,7 +171,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(vcl::Window *parent) mpActionMenu = VclPtr<PopupMenu>::Create(); mpActionMenu->InsertItem(MNI_ACTION_NEW_FOLDER, SfxResId(STR_CATEGORY_NEW), - Image(BitmapEx(BMP_ACTION_REFRESH))); + Image(StockImage::Yes, BMP_ACTION_REFRESH)); mpActionMenu->InsertItem(MNI_ACTION_RENAME_FOLDER, SfxResId(STR_CATEGORY_RENAME)); mpActionMenu->InsertItem(MNI_ACTION_DELETE_FOLDER, @@ -179,7 +179,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(vcl::Window *parent) mpActionMenu->InsertSeparator(); mpActionMenu->InsertItem(MNI_ACTION_REFRESH, SfxResId(STR_ACTION_REFRESH), - Image(BitmapEx(BMP_ACTION_REFRESH))); + Image(StockImage::Yes, BMP_ACTION_REFRESH)); mpActionMenu->InsertItem(MNI_ACTION_DEFAULT,SfxResId(STR_ACTION_DEFAULT)); mpActionMenu->SetSelectHdl(LINK(this,SfxTemplateManagerDlg,MenuSelectHdl)); |