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 /sw | |
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 'sw')
-rw-r--r-- | sw/source/ui/dbui/mmoutputtypepage.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/fldui/changedb.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/app/swmodule.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/dbui/dbtree.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/lingu/olmenu.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/misc/redlndlg.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/ribbar/inputwin.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/ribbar/workctrl.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/utlui/glbltree.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/utlui/navipi.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/utlui/viewlayoutctrl.cxx | 12 |
12 files changed, 41 insertions, 41 deletions
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index d0b3f5c875a8..3e2910cb1b73 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -437,7 +437,7 @@ void SwSendMailDialog::IterateMails() { if(!SwMailMergeHelper::CheckMailAddress( pCurrentMailDescriptor->sEMail )) { - Image aInsertImg(BitmapEx(RID_BMP_FORMULA_CANCEL)); + Image aInsertImg(StockImage::Yes, RID_BMP_FORMULA_CANCEL); OUString sMessage = m_sSendingTo; OUString sTmp(pCurrentMailDescriptor->sEMail); @@ -523,7 +523,7 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> const & Application::PostUserEvent( LINK( this, SwSendMailDialog, StopSendMails ), this, true ); } - Image aInsertImg(BitmapEx(bResult ? OUString(RID_BMP_FORMULA_APPLY) : OUString(RID_BMP_FORMULA_CANCEL))); + Image aInsertImg(StockImage::Yes, bResult ? OUString(RID_BMP_FORMULA_APPLY) : OUString(RID_BMP_FORMULA_CANCEL)); OUString sMessage = m_sSendingTo; OUString sTmp(xMessage->getRecipients()[0]); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 9bd79a7db39d..9ae53737945c 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -70,8 +70,8 @@ namespace { Image BuildBitmap(bool bProtect, bool bHidden) { if (bProtect) - return Image(BitmapEx(bHidden ? OUString(RID_BMP_PROT_HIDE) : OUString(RID_BMP_PROT_NO_HIDE))); - return Image(BitmapEx(bHidden ? OUString(RID_BMP_HIDE) : OUString(RID_BMP_NO_HIDE))); + return Image(StockImage::Yes, bHidden ? OUString(RID_BMP_PROT_HIDE) : OUString(RID_BMP_PROT_NO_HIDE)); + return Image(StockImage::Yes, bHidden ? OUString(RID_BMP_HIDE) : OUString(RID_BMP_NO_HIDE)); } } diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx index 715b99016593..fa054f251539 100644 --- a/sw/source/ui/fldui/changedb.cxx +++ b/sw/source/ui/fldui/changedb.cxx @@ -69,8 +69,8 @@ SwChangeDBDlg::SwChangeDBDlg(SwView const & rVw) m_pUsedDBTLB->SetSelectionMode(SelectionMode::Multiple); m_pUsedDBTLB->SetStyle(m_pUsedDBTLB->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); m_pUsedDBTLB->SetSpaceBetweenEntries(0); - m_pUsedDBTLB->SetNodeBitmaps(Image(BitmapEx(RID_BMP_COLLAPSE)), - Image(BitmapEx(RID_BMP_EXPAND))); + m_pUsedDBTLB->SetNodeBitmaps(Image(StockImage::Yes, RID_BMP_COLLAPSE), + Image(StockImage::Yes, RID_BMP_EXPAND)); Link<SvTreeListBox*,void> aLink = LINK(this, SwChangeDBDlg, TreeSelectHdl); @@ -134,9 +134,9 @@ SvTreeListEntry* SwChangeDBDlg::Insert(const OUString& rDBName) sal_uLong nParent = 0; sal_uLong nChild = 0; - Image aTableImg(BitmapEx(RID_BMP_DBTABLE)); - Image aDBImg(BitmapEx(RID_BMP_DB)); - Image aQueryImg(BitmapEx(RID_BMP_DBQUERY)); + Image aTableImg(StockImage::Yes, RID_BMP_DBTABLE); + Image aDBImg(StockImage::Yes, RID_BMP_DB); + Image aQueryImg(StockImage::Yes, RID_BMP_DBQUERY); Image& rToInsert = nCommandType ? aQueryImg : aTableImg; while ((pParent = m_pUsedDBTLB->GetEntry(nParent++)) != nullptr) { diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index 963d35cadd3f..c921a2431857 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -396,32 +396,32 @@ std::unique_ptr<SfxStyleFamilies> SwModule::CreateStyleFamilies() pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Para, SwResId(STR_PARAGRAPHSTYLEFAMILY), - Image(BitmapEx(BMP_STYLES_FAMILY_PARA)), + Image(StockImage::Yes, BMP_STYLES_FAMILY_PARA), RID_PARAGRAPHSTYLEFAMILY, GetResLocale())); pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Char, SwResId(STR_CHARACTERSTYLEFAMILY), - Image(BitmapEx(BMP_STYLES_FAMILY_CHAR)), + Image(StockImage::Yes, BMP_STYLES_FAMILY_CHAR), RID_CHARACTERSTYLEFAMILY, GetResLocale())); pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Frame, SwResId(STR_FRAMESTYLEFAMILY), - Image(BitmapEx(BMP_STYLES_FAMILY_FRAME)), + Image(StockImage::Yes, BMP_STYLES_FAMILY_FRAME), RID_FRAMESTYLEFAMILY, GetResLocale())); pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Page, SwResId(STR_PAGESTYLEFAMILY), - Image(BitmapEx(BMP_STYLES_FAMILY_PAGE)), + Image(StockImage::Yes, BMP_STYLES_FAMILY_PAGE), RID_PAGESTYLEFAMILY, GetResLocale())); pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Pseudo, SwResId(STR_LISTSTYLEFAMILY), - Image(BitmapEx(BMP_STYLES_FAMILY_LIST)), + Image(StockImage::Yes, BMP_STYLES_FAMILY_LIST), RID_LISTSTYLEFAMILY, GetResLocale())); pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Table, SwResId(STR_TABLESTYLEFAMILY), - Image(BitmapEx(BMP_STYLES_FAMILY_TABLE)), + Image(StockImage::Yes, BMP_STYLES_FAMILY_TABLE), RID_TABLESTYLEFAMILY, GetResLocale())); return pStyleFamilies; diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx index e0674f90e44b..b4d9d4494ef6 100644 --- a/sw/source/uibase/dbui/dbtree.cxx +++ b/sw/source/uibase/dbui/dbtree.cxx @@ -172,8 +172,8 @@ void SwDBTreeList::InitTreeList() SetStyle(GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); // don't set font, so that the Control's font is being applied! SetSpaceBetweenEntries(0); - SetNodeBitmaps(Image(BitmapEx(RID_BMP_COLLAPSE)), - Image(BitmapEx(RID_BMP_EXPAND))); + SetNodeBitmaps(Image(StockImage::Yes, RID_BMP_COLLAPSE), + Image(StockImage::Yes, RID_BMP_EXPAND)); SetDragDropMode(DragDropMode::APP_COPY); @@ -190,7 +190,7 @@ void SwDBTreeList::InitTreeList() const OUString* pDBNames = aDBNames.getConstArray(); long nCount = aDBNames.getLength(); - Image aImg(BitmapEx(RID_BMP_DB)); + Image aImg(StockImage::Yes, RID_BMP_DB); for(long i = 0; i < nCount; i++) { OUString sDBName(pDBNames[i]); @@ -207,7 +207,7 @@ void SwDBTreeList::InitTreeList() void SwDBTreeList::AddDataSource(const OUString& rSource) { - Image aImg(BitmapEx(RID_BMP_DB)); + Image aImg(StockImage::Yes, RID_BMP_DB); SvTreeListEntry* pEntry = InsertEntry(rSource, aImg, aImg, nullptr, true); SvTreeListBox::Select(pEntry); } @@ -336,7 +336,7 @@ void SwDBTreeList::RequestingChildren(SvTreeListEntry* pParent) OUString sTableName; long nCount = aTableNames.getLength(); const OUString* pTableNames = aTableNames.getConstArray(); - Image aImg(BitmapEx(RID_BMP_DBTABLE)); + Image aImg(StockImage::Yes, RID_BMP_DBTABLE); for (long i = 0; i < nCount; i++) { sTableName = pTableNames[i]; @@ -354,7 +354,7 @@ void SwDBTreeList::RequestingChildren(SvTreeListEntry* pParent) OUString sQueryName; long nCount = aQueryNames.getLength(); const OUString* pQueryNames = aQueryNames.getConstArray(); - Image aImg(BitmapEx(RID_BMP_DBQUERY)); + Image aImg(StockImage::Yes, RID_BMP_DBQUERY); for (long i = 0; i < nCount; i++) { sQueryName = pQueryNames[i]; diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx index 56f56cbe5a03..118a1bb85ca2 100644 --- a/sw/source/uibase/lingu/olmenu.cxx +++ b/sw/source/uibase/lingu/olmenu.cxx @@ -451,7 +451,7 @@ SwSpellPopup::SwSpellPopup( m_xPopupMenu->InsertSeparator(OString(), nPos++); m_xPopupMenu->InsertItem(MN_SHORT_COMMENT, aMessageText, MenuItemBits::NOSELECT, OString(), nPos++); if (bUseImagesInMenus) - m_xPopupMenu->SetItemImage(MN_SHORT_COMMENT, Image(BitmapEx(BMP_INFO_16))); + m_xPopupMenu->SetItemImage(MN_SHORT_COMMENT, Image(StockImage::Yes, BMP_INFO_16)); // Add an item to show detailed infos if the FullCommentURL property is defined beans::PropertyValues aProperties = rResult.aErrors[ nErrorInResult ].aProperties; diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index 169be0e7297c..530e21e090a8 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -160,11 +160,11 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer , m_bOnlyFormatedRedlines(false) , m_bRedlnAutoFormat(bAutoFormat) , m_bInhibitActivate(false) - , m_aInserted(BitmapEx(BMP_REDLINE_INSERTED)) - , m_aDeleted(BitmapEx(BMP_REDLINE_DELETED)) - , m_aFormated(BitmapEx(BMP_REDLINE_FORMATTED)) - , m_aTableChgd(BitmapEx(BMP_REDLINE_TABLECHG)) - , m_aFormatCollSet(BitmapEx(BMP_REDLINE_FMTCOLLSET)) + , m_aInserted(StockImage::Yes, BMP_REDLINE_INSERTED) + , m_aDeleted(StockImage::Yes, BMP_REDLINE_DELETED) + , m_aFormated(StockImage::Yes, BMP_REDLINE_FORMATTED) + , m_aTableChgd(StockImage::Yes, BMP_REDLINE_TABLECHG) + , m_aFormatCollSet(StockImage::Yes, BMP_REDLINE_FMTCOLLSET) { m_aTabPagesCTRL->SetHelpId(HID_REDLINE_CTRL); m_pTPView = m_aTabPagesCTRL->GetViewPage(); diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx index 7e4c4f3a3439..324c0fbd8877 100644 --- a/sw/source/uibase/ribbar/inputwin.cxx +++ b/sw/source/uibase/ribbar/inputwin.cxx @@ -77,11 +77,11 @@ SwInputWindow::SwInputWindow(vcl::Window* pParent, SfxDispatcher const * pDispat aEdit->SetSizePixel(aEdit->CalcMinimumSize()); aPos->SetSizePixel(aPos->LogicToPixel(Size(45, 11), MapMode(MapUnit::MapAppFont))); - InsertItem(FN_FORMULA_CALC, Image(BitmapEx(RID_BMP_FORMULA_CALC)), + InsertItem(FN_FORMULA_CALC, Image(StockImage::Yes, RID_BMP_FORMULA_CALC), SwResId(STR_FORMULA_CALC)); - InsertItem(FN_FORMULA_CANCEL, Image(BitmapEx(RID_BMP_FORMULA_CANCEL)), + InsertItem(FN_FORMULA_CANCEL, Image(StockImage::Yes, RID_BMP_FORMULA_CANCEL), SwResId(STR_FORMULA_CANCEL)); - InsertItem(FN_FORMULA_APPLY, Image(BitmapEx(RID_BMP_FORMULA_APPLY)), + InsertItem(FN_FORMULA_APPLY, Image(StockImage::Yes, RID_BMP_FORMULA_APPLY), SwResId(STR_FORMULA_APPLY)); SetHelpId(FN_FORMULA_CALC, HID_TBX_FORMULA_CALC); diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index 4dd4d8d03c5a..5cd71f1e2746 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -323,7 +323,7 @@ SwScrollNaviPopup::SwScrollNaviPopup(sal_uInt16 nId, const Reference< XFrame >& ToolBoxItemBits nTbxBits = ToolBoxItemBits::NONE; if ((NID_PREV != nNaviId) && (NID_NEXT != nNaviId)) nTbxBits = ToolBoxItemBits::CHECKABLE; - m_pToolBox->InsertItem(nNaviId, Image(BitmapEx(aNavigationImgIds[i])), + m_pToolBox->InsertItem(nNaviId, Image(StockImage::Yes, aNavigationImgIds[i]), SwResId(aNavigationStrIds[i]), nTbxBits); m_pToolBox->SetHelpId(nNaviId, aNavigationHelpIds[i]); } @@ -727,7 +727,7 @@ NavElementBox_Impl::NavElementBox_Impl( { sal_uInt16 nNaviId = aNavigationInsertIds[i]; if ( ( NID_PREV != nNaviId ) && ( NID_NEXT != nNaviId ) ) - InsertEntry( SwResId( aNavigationStrIds[i] ), Image( BitmapEx( aNavigationImgIds[i] ) ) ); + InsertEntry( SwResId( aNavigationStrIds[i] ), Image( StockImage::Yes, aNavigationImgIds[i] ) ); } } diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 275f71578aae..28709b329ae2 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -696,14 +696,14 @@ void SwGlobalTree::Display(bool bOnlyUpdateUserData) { const SwTOXBase* pBase = pCont->GetTOX(); sEntry = pBase->GetTitle(); - aImage = Image(BitmapEx(RID_BMP_NAVI_INDEX)); + aImage = Image(StockImage::Yes, RID_BMP_NAVI_INDEX); } break; case GLBLDOC_SECTION: { const SwSection* pSect = pCont->GetSection(); sEntry = pSect->GetSectionName(); - aImage = Image(BitmapEx(RID_BMP_DROP_REGION)); + aImage = Image(StockImage::Yes, RID_BMP_DROP_REGION); } break; } diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index cc6d60dcc06e..c3253ac29e60 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -1139,7 +1139,7 @@ void SwNavigationPI::SetRegionDropMode(RegionMode nNewMode) sImageId = RID_BMP_DROP_COPY; break; } - m_aContentToolBox->SetItemImage(m_aContentToolBox->GetItemId("dragmode"), Image(BitmapEx(sImageId))); + m_aContentToolBox->SetItemImage(m_aContentToolBox->GetItemId("dragmode"), Image(StockImage::Yes, sImageId)); } void SwNavigationPI::ToggleTree() diff --git a/sw/source/uibase/utlui/viewlayoutctrl.cxx b/sw/source/uibase/utlui/viewlayoutctrl.cxx index eadb17f748f1..c813ffaa5baf 100644 --- a/sw/source/uibase/utlui/viewlayoutctrl.cxx +++ b/sw/source/uibase/utlui/viewlayoutctrl.cxx @@ -46,12 +46,12 @@ SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, { mpImpl->mnState = 1; - mpImpl->maImageSingleColumn = Image(BitmapEx(RID_BMP_VIEWLAYOUT_SINGLECOLUMN)); - mpImpl->maImageSingleColumn_Active = Image(BitmapEx(RID_BMP_VIEWLAYOUT_SINGLECOLUMN_ACTIVE)); - mpImpl->maImageAutomatic = Image(BitmapEx(RID_BMP_VIEWLAYOUT_AUTOMATIC)); - mpImpl->maImageAutomatic_Active = Image(BitmapEx(RID_BMP_VIEWLAYOUT_AUTOMATIC_ACTIVE)); - mpImpl->maImageBookMode = Image(BitmapEx(RID_BMP_VIEWLAYOUT_BOOKMODE)); - mpImpl->maImageBookMode_Active = Image(BitmapEx(RID_BMP_VIEWLAYOUT_BOOKMODE_ACTIVE)); + mpImpl->maImageSingleColumn = Image(StockImage::Yes, RID_BMP_VIEWLAYOUT_SINGLECOLUMN); + mpImpl->maImageSingleColumn_Active = Image(StockImage::Yes, RID_BMP_VIEWLAYOUT_SINGLECOLUMN_ACTIVE); + mpImpl->maImageAutomatic = Image(StockImage::Yes, RID_BMP_VIEWLAYOUT_AUTOMATIC); + mpImpl->maImageAutomatic_Active = Image(StockImage::Yes, RID_BMP_VIEWLAYOUT_AUTOMATIC_ACTIVE); + mpImpl->maImageBookMode = Image(StockImage::Yes, RID_BMP_VIEWLAYOUT_BOOKMODE); + mpImpl->maImageBookMode_Active = Image(StockImage::Yes, RID_BMP_VIEWLAYOUT_BOOKMODE_ACTIVE); } SwViewLayoutControl::~SwViewLayoutControl() |