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> | 2019-09-30 20:27:04 +0200 |
commit | eda88cd2eb4cba8f1a3482a3d1bfda66d29f3aab (patch) | |
tree | e78b76eb2c992ab899cdfabe8b68a9157411c832 /basctl | |
parent | b14830db341ef1a136bf9f5e5ba3c7ea521bea48 (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.
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>
(cherry picked from commit 89161e4d5835b93f0942e960a116a0d3863cc55c)
Change-Id: I3224e11937d720fa484b0d659d25673a9e809267
Reviewed-on: https://gerrit.libreoffice.org/79844
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 4 | ||||
-rw-r--r-- | basctl/source/basicide/bastype2.cxx | 16 | ||||
-rw-r--r-- | basctl/source/basicide/bastype3.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/moduldl2.cxx | 6 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.cxx | 4 |
5 files changed, 16 insertions, 16 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index e307250ba663..53cdae40421b 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -79,7 +79,7 @@ SbxVariable* IsSbxVariable (SbxBase* pBase) Image GetImage(const OUString& rId) { - return Image(BitmapEx(rId)); + return Image(StockImage::Yes, rId); } int const nScrollLine = 12; @@ -1572,7 +1572,7 @@ WatchWindow::WatchWindow (Layout* pParent) aRemoveWatchButton->SetClickHdl( LINK( this, WatchWindow, ButtonHdl ) ); aRemoveWatchButton->SetPosPixel( Point( nTextLen + aXEdit->GetSizePixel().Width() + 4, 2 ) ); aRemoveWatchButton->SetHelpId(HID_BASICIDE_REMOVEWATCH); - aRemoveWatchButton->SetModeImage(Image(BitmapEx(RID_BMP_REMOVEWATCH))); + aRemoveWatchButton->SetModeImage(Image(StockImage::Yes, RID_BMP_REMOVEWATCH)); aRemoveWatchButton->SetQuickHelpText(IDEResId(RID_STR_REMOVEWATCHTIP)); Size aSz( aRemoveWatchButton->GetModeImage().GetSizePixel() ); aSz.AdjustWidth(6 ); diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index bd1c88785cab..2d2992c6928b 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -263,7 +263,7 @@ void TreeListBox::ImpCreateLibEntries( SvTreeListEntry* pDocumentRootEntry, cons SvTreeListEntry* pLibRootEntry = FindEntry( pDocumentRootEntry, aLibName, OBJ_TYPE_LIBRARY ); if ( pLibRootEntry ) { - SetEntryBitmaps(pLibRootEntry, Image(BitmapEx(sId))); + SetEntryBitmaps(pLibRootEntry, Image(StockImage::Yes, sId)); if ( IsExpanded(pLibRootEntry)) ImpCreateLibSubEntries( pLibRootEntry, rDocument, aLibName ); } @@ -271,7 +271,7 @@ void TreeListBox::ImpCreateLibEntries( SvTreeListEntry* pDocumentRootEntry, cons { AddEntry( aLibName, - Image(BitmapEx(sId)), + Image(StockImage::Yes, sId), pDocumentRootEntry, true, o3tl::make_unique<Entry>(OBJ_TYPE_LIBRARY)); } @@ -307,7 +307,7 @@ void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const { pModuleEntry = AddEntry( aModName, - Image(BitmapEx(RID_BMP_MODULE)), + Image(StockImage::Yes, RID_BMP_MODULE), pLibRootEntry, false, o3tl::make_unique<Entry>(OBJ_TYPE_MODULE)); } @@ -363,7 +363,7 @@ void TreeListBox::ImpCreateLibSubEntriesInVBAMode( SvTreeListEntry* pLibRootEntr SvTreeListEntry* pLibSubRootEntry = FindEntry( pLibRootEntry, aEntryName, eType ); if( pLibSubRootEntry ) { - SetEntryBitmaps(pLibSubRootEntry, Image(BitmapEx(RID_BMP_MODLIB))); + SetEntryBitmaps(pLibSubRootEntry, Image(StockImage::Yes, RID_BMP_MODLIB)); if ( IsExpanded( pLibSubRootEntry ) ) ImpCreateLibSubSubEntriesInVBAMode( pLibSubRootEntry, rDocument, rLibName ); } @@ -371,7 +371,7 @@ void TreeListBox::ImpCreateLibSubEntriesInVBAMode( SvTreeListEntry* pLibRootEntr { AddEntry( aEntryName, - Image(BitmapEx(RID_BMP_MODLIB)), + Image(StockImage::Yes, RID_BMP_MODLIB), pLibRootEntry, true, o3tl::make_unique<Entry>(eType)); } } @@ -432,7 +432,7 @@ void TreeListBox::ImpCreateLibSubSubEntriesInVBAMode( SvTreeListEntry* pLibSubRo { pModuleEntry = AddEntry( aEntryName, - Image(BitmapEx(RID_BMP_MODULE)), + Image(StockImage::Yes, RID_BMP_MODULE), pLibSubRootEntry, false, o3tl::make_unique<Entry>(OBJ_TYPE_MODULE)); } @@ -748,12 +748,12 @@ void TreeListBox::GetRootEntryBitmaps( const ScriptDocument& rDocument, Image& r else { // default icon - rImage = Image(BitmapEx(RID_BMP_DOCUMENT)); + rImage = Image(StockImage::Yes, RID_BMP_DOCUMENT); } } else { - rImage = Image(BitmapEx(RID_BMP_INSTALLATION)); + rImage = Image(StockImage::Yes, RID_BMP_INSTALLATION); } } diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx index eeaf863d05cc..20e43963c855 100644 --- a/basctl/source/basicide/bastype3.cxx +++ b/basctl/source/basicide/bastype3.cxx @@ -107,7 +107,7 @@ void TreeListBox::RequestingChildren( SvTreeListEntry* pEntry ) // exchange image const bool bDlgMode = (nMode & BrowseMode::Dialogs) && !(nMode & BrowseMode::Modules); - Image aImage(BitmapEx(bDlgMode ? OUStringLiteral(RID_BMP_DLGLIB) : OUStringLiteral(RID_BMP_MODLIB))); + Image aImage(StockImage::Yes, bDlgMode ? OUStringLiteral(RID_BMP_DLGLIB) : OUStringLiteral(RID_BMP_MODLIB)); SetEntryBitmaps( pEntry, aImage ); } else diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 7c16245fd392..32f6d8adf1bc 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -1425,7 +1425,7 @@ SvTreeListEntry* LibPage::ImpInsertLibEntry( const OUString& rLibName, sal_uLong if (bProtected) { - Image aImage(BitmapEx(RID_BMP_LOCKED)); + Image aImage(StockImage::Yes, RID_BMP_LOCKED); m_pLibBox->SetExpandedEntryBmp(pNewEntry, aImage); m_pLibBox->SetCollapsedEntryBmp(pNewEntry, aImage); } @@ -1527,7 +1527,7 @@ void createLibImpl(weld::Window* pWin, const ScriptDocument& rDocument, const OUString sId = bDlgMode ? OUStringLiteral(RID_BMP_DLGLIB) : OUStringLiteral(RID_BMP_MODLIB); SvTreeListEntry* pNewLibEntry = pBasicBox->AddEntry( aLibName, - Image(BitmapEx(sId)), + Image(StockImage::Yes, sId), pRootEntry, false, o3tl::make_unique<Entry>(OBJ_TYPE_LIBRARY)); DBG_ASSERT( pNewLibEntry, "Insert entry failed!" ); @@ -1536,7 +1536,7 @@ void createLibImpl(weld::Window* pWin, const ScriptDocument& rDocument, { SvTreeListEntry* pEntry_ = pBasicBox->AddEntry( aModName, - Image(BitmapEx(RID_BMP_MODULE)), + Image(StockImage::Yes, RID_BMP_MODULE), pNewLibEntry, false, o3tl::make_unique<Entry>(OBJ_TYPE_MODULE)); DBG_ASSERT( pEntry_, "Insert entry failed!" ); diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 6626420f14cf..b44acd676d65 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -860,7 +860,7 @@ void ObjectPage::NewDialog() { pEntry = m_pBasicBox->AddEntry( aDlgName, - Image(BitmapEx(RID_BMP_DIALOG)), + Image(StockImage::Yes, RID_BMP_DIALOG), pLibEntry, false, o3tl::make_unique<Entry>(OBJ_TYPE_DIALOG)); DBG_ASSERT( pEntry, "Insert entry failed!" ); @@ -1031,7 +1031,7 @@ SbModule* createModImpl(weld::Window* pWin, const ScriptDocument& rDocument, { pEntry = rBasicBox.AddEntry( aModName, - Image(BitmapEx(RID_BMP_MODULE)), + Image(StockImage::Yes, RID_BMP_MODULE), pSubRootEntry, false, o3tl::make_unique<Entry>(OBJ_TYPE_MODULE)); DBG_ASSERT( pEntry, "Insert entry failed!" ); |