diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-07 10:29:02 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2018-12-10 11:09:00 +0100 |
commit | 89161e4d5835b93f0942e960a116a0d3863cc55c (patch) | |
tree | 5c614702f3f553bd41f8082e48b841cf9db4c2e9 /sfx2 | |
parent | 3f4874dcff0423e045151eb8f435b2b1d057733b (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>
Reviewed-on: https://gerrit.libreoffice.org/64860
Tested-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 e197f8e7ce4d..5c8654ab1fdb 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -265,9 +265,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 ); @@ -1857,8 +1857,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 ) ), @@ -1954,33 +1954,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(); @@ -2338,43 +2338,43 @@ bool SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) aPos.Y() += 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(); @@ -2397,7 +2397,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 3be2690f0688..28826d9bc4fc 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -61,7 +61,7 @@ RecentDocsView::RecentDocsView( vcl::Window* pParent ) , mnItemPadding(5) , mnItemMaxTextLength(30) , 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 ceb6d87af82d..2631e379393c 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1492,7 +1492,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 96e4d9aa5736..937cd80849ec 100644 --- a/sfx2/source/dialog/infobar.cxx +++ b/sfx2/source/dialog/infobar.cxx @@ -185,7 +185,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(); @@ -307,7 +307,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 aab3bc258236..264f066e3ee2 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -2168,13 +2168,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 36ca2572d6e7..292cd9ae8727 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 8861f89c7c8d..f58345fe16c4 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)); |