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 /sc/source | |
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 'sc/source')
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 20 | ||||
-rw-r--r-- | sc/source/ui/app/scmod.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/cctrl/tbzoomsliderctrl.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/dataproviderdlg.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/navipi/content.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/navipi/navipi.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx | 20 | ||||
-rw-r--r-- | sc/source/ui/view/olinewin.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/xmlsource/xmlsourcedlg.cxx | 6 |
9 files changed, 32 insertions, 33 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 4a8ea6ea7ff6..d8cca415d466 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -191,11 +191,11 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const SfxBindings* pBind ) : // Position window, 3 buttons, input window InsertWindow (1, aWndPos.get(), ToolBoxItemBits::NONE, 0); InsertSeparator (1); - InsertItem (SID_INPUT_FUNCTION, Image(BitmapEx(RID_BMP_INPUT_FUNCTION)), ToolBoxItemBits::NONE, 2); - InsertItem (SID_INPUT_SUM, Image(BitmapEx(RID_BMP_INPUT_SUM)), ToolBoxItemBits::NONE, 3); - InsertItem (SID_INPUT_EQUAL, Image(BitmapEx(RID_BMP_INPUT_EQUAL)), ToolBoxItemBits::NONE, 4); - InsertItem (SID_INPUT_CANCEL, Image(BitmapEx(RID_BMP_INPUT_CANCEL)), ToolBoxItemBits::NONE, 5); - InsertItem (SID_INPUT_OK, Image(BitmapEx(RID_BMP_INPUT_OK)), ToolBoxItemBits::NONE, 6); + InsertItem (SID_INPUT_FUNCTION, Image(StockImage::Yes, RID_BMP_INPUT_FUNCTION), ToolBoxItemBits::NONE, 2); + InsertItem (SID_INPUT_SUM, Image(StockImage::Yes, RID_BMP_INPUT_SUM), ToolBoxItemBits::NONE, 3); + InsertItem (SID_INPUT_EQUAL, Image(StockImage::Yes, RID_BMP_INPUT_EQUAL), ToolBoxItemBits::NONE, 4); + InsertItem (SID_INPUT_CANCEL, Image(StockImage::Yes, RID_BMP_INPUT_CANCEL), ToolBoxItemBits::NONE, 5); + InsertItem (SID_INPUT_OK, Image(StockImage::Yes, RID_BMP_INPUT_OK), ToolBoxItemBits::NONE, 6); InsertSeparator (7); InsertWindow (7, &aTextWindow, ToolBoxItemBits::NONE, 8); @@ -644,16 +644,16 @@ void ScInputWindow::DataChanged( const DataChangedEvent& rDCEvt ) if ( rDCEvt.GetType() == DataChangedEventType::SETTINGS && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) { // update item images - SetItemImage(SID_INPUT_FUNCTION, Image(BitmapEx(RID_BMP_INPUT_FUNCTION))); + SetItemImage(SID_INPUT_FUNCTION, Image(StockImage::Yes, RID_BMP_INPUT_FUNCTION)); if ( bIsOkCancelMode ) { - SetItemImage(SID_INPUT_CANCEL, Image(BitmapEx(RID_BMP_INPUT_CANCEL))); - SetItemImage(SID_INPUT_OK, Image(BitmapEx(RID_BMP_INPUT_OK))); + SetItemImage(SID_INPUT_CANCEL, Image(StockImage::Yes, RID_BMP_INPUT_CANCEL)); + SetItemImage(SID_INPUT_OK, Image(StockImage::Yes, RID_BMP_INPUT_OK)); } else { - SetItemImage(SID_INPUT_SUM, Image(BitmapEx(RID_BMP_INPUT_SUM))); - SetItemImage(SID_INPUT_EQUAL, Image(BitmapEx(RID_BMP_INPUT_EQUAL))); + SetItemImage(SID_INPUT_SUM, Image(StockImage::Yes, RID_BMP_INPUT_SUM)); + SetItemImage(SID_INPUT_EQUAL, Image(StockImage::Yes, RID_BMP_INPUT_EQUAL)); } } diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 74d53c7db400..4b9e46b957ad 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -2251,12 +2251,12 @@ SfxStyleFamilies* ScModule::CreateStyleFamilies() pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Para, ScGlobal::GetRscString(STR_STYLE_FAMILY_CELL), - Image(BitmapEx(BMP_STYLES_FAMILY_CELL)), + Image(StockImage::Yes, BMP_STYLES_FAMILY_CELL), RID_CELLSTYLEFAMILY, SC_MOD()->GetResLocale())); pStyleFamilies->emplace_back(SfxStyleFamilyItem(SfxStyleFamily::Page, ScGlobal::GetRscString(STR_STYLE_FAMILY_PAGE), - Image(BitmapEx(BMP_STYLES_FAMILY_PAGE)), + Image(StockImage::Yes, BMP_STYLES_FAMILY_PAGE), RID_PAGESTYLEFAMILY, SC_MOD()->GetResLocale())); return pStyleFamilies; diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx index d5315da35ae1..a460a4aacf7e 100644 --- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx +++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx @@ -222,9 +222,9 @@ ScZoomSliderWnd::ScZoomSliderWnd( vcl::Window* pParent, aLogicalSize( 115, 40 ), m_xDispatchProvider( rDispatchProvider ) { - mpImpl->maSliderButton = Image(BitmapEx(RID_SVXBMP_SLIDERBUTTON)); - mpImpl->maIncreaseButton = Image(BitmapEx(RID_SVXBMP_SLIDERINCREASE)); - mpImpl->maDecreaseButton = Image(BitmapEx(RID_SVXBMP_SLIDERDECREASE)); + mpImpl->maSliderButton = Image(StockImage::Yes, RID_SVXBMP_SLIDERBUTTON); + mpImpl->maIncreaseButton = Image(StockImage::Yes, RID_SVXBMP_SLIDERINCREASE); + mpImpl->maDecreaseButton = Image(StockImage::Yes, RID_SVXBMP_SLIDERDECREASE); Size aSliderSize = LogicToPixel( aLogicalSize, MapMode( MapUnit::Map10thMM ) ); SetSizePixel( Size( aSliderSize.Width() * nSliderWidth-1, aSliderSize.Height() + nSliderHeight ) ); } diff --git a/sc/source/ui/miscdlgs/dataproviderdlg.cxx b/sc/source/ui/miscdlgs/dataproviderdlg.cxx index d5f36083e4f6..5d1d16ec0639 100644 --- a/sc/source/ui/miscdlgs/dataproviderdlg.cxx +++ b/sc/source/ui/miscdlgs/dataproviderdlg.cxx @@ -84,7 +84,7 @@ ScDataProviderBaseControl::ScDataProviderBaseControl(vcl::Window* pParent, mpApplyBtn->SetControlForeground(COL_GREEN); mpApplyBtn->SetControlBackground(COL_GREEN); mpApplyBtn->SetBackground(Wallpaper(COL_LIGHTGREEN)); - mpApplyBtn->SetModeImage(Image(BitmapEx("sc/res/xml_element.png"))); + mpApplyBtn->SetModeImage(Image(StockImage::Yes, "sc/res/xml_element.png")); mpApplyBtn->Show(); mpApplyBtn->SetClickHdl(LINK(this, ScDataProviderBaseControl, ApplyBtnHdl)); SetSizePixel(GetOptimalSize()); diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 4b14ddf3add9..0bc3a39e318e 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -249,8 +249,7 @@ void ScContentTree::InitRoot( ScContentId nType ) return; } - BitmapEx aBitmap(aContentBmps[(int)nType - 1]); - Image aImage(aBitmap); + Image aImage(StockImage::Yes, aContentBmps[(int)nType - 1]); OUString aName(ScResId(SCSTR_CONTENT_ARY[(int)nType])); // back to the correct position: sal_uInt16 nPos = nRootType != ScContentId::ROOT ? 0 : pPosList[nType]-1; diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 79ebee607a68..4b95e0d9a79b 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -428,7 +428,7 @@ void ScNavigatorDlg::UpdateButtons() sImageId = RID_BMP_DROP_COPY; break; } - aTbxCmd->SetItemImage(nDragModeId, Image(BitmapEx(sImageId))); + aTbxCmd->SetItemImage(nDragModeId, Image(StockImage::Yes, sImageId)); } ScNavigatorSettings::ScNavigatorSettings() diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx index 29a76f8e9a75..7b952c96b8fb 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx @@ -60,16 +60,16 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel( maBorderTLBRControl(SID_ATTR_BORDER_DIAG_TLBR, *pBindings, *this), maBorderBLTRControl(SID_ATTR_BORDER_DIAG_BLTR, *pBindings, *this), - maIMGCellBorder(BitmapEx(RID_BMP_CELL_BORDER)), - maIMGLineStyle1(BitmapEx(RID_BMP_LINE_STYLE1)), - maIMGLineStyle2(BitmapEx(RID_BMP_LINE_STYLE2)), - maIMGLineStyle3(BitmapEx(RID_BMP_LINE_STYLE3)), - maIMGLineStyle4(BitmapEx(RID_BMP_LINE_STYLE4)), - maIMGLineStyle5(BitmapEx(RID_BMP_LINE_STYLE5)), - maIMGLineStyle6(BitmapEx(RID_BMP_LINE_STYLE6)), - maIMGLineStyle7(BitmapEx(RID_BMP_LINE_STYLE7)), - maIMGLineStyle8(BitmapEx(RID_BMP_LINE_STYLE8)), - maIMGLineStyle9(BitmapEx(RID_BMP_LINE_STYLE9)), + maIMGCellBorder(StockImage::Yes, RID_BMP_CELL_BORDER), + maIMGLineStyle1(StockImage::Yes, RID_BMP_LINE_STYLE1), + maIMGLineStyle2(StockImage::Yes, RID_BMP_LINE_STYLE2), + maIMGLineStyle3(StockImage::Yes, RID_BMP_LINE_STYLE3), + maIMGLineStyle4(StockImage::Yes, RID_BMP_LINE_STYLE4), + maIMGLineStyle5(StockImage::Yes, RID_BMP_LINE_STYLE5), + maIMGLineStyle6(StockImage::Yes, RID_BMP_LINE_STYLE6), + maIMGLineStyle7(StockImage::Yes, RID_BMP_LINE_STYLE7), + maIMGLineStyle8(StockImage::Yes, RID_BMP_LINE_STYLE8), + maIMGLineStyle9(StockImage::Yes, RID_BMP_LINE_STYLE9), mnIn(0), mnOut(0), diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx index 9a56fb6fd7c4..9e4b6f0a43eb 100644 --- a/sc/source/ui/view/olinewin.cxx +++ b/sc/source/ui/view/olinewin.cxx @@ -532,7 +532,7 @@ namespace { Image GetImage(const OUString& rId) { - return Image(BitmapEx(rId)); + return Image(StockImage::Yes, rId); } } diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index ab128360889e..f356ca89f3a0 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -91,9 +91,9 @@ ScXMLSourceDlg::ScXMLSourceDlg( mpActiveEdit = mpRefEdit; - maXMLParam.maImgElementDefault = Image(BitmapEx(RID_BMP_ELEMENT_DEFAULT)); - maXMLParam.maImgElementRepeat = Image(BitmapEx(RID_BMP_ELEMENT_REPEAT)); - maXMLParam.maImgAttribute = Image(BitmapEx(RID_BMP_ELEMENT_ATTRIBUTE)); + maXMLParam.maImgElementDefault = Image(StockImage::Yes, RID_BMP_ELEMENT_DEFAULT); + maXMLParam.maImgElementRepeat = Image(StockImage::Yes, RID_BMP_ELEMENT_REPEAT); + maXMLParam.maImgAttribute = Image(StockImage::Yes, RID_BMP_ELEMENT_ATTRIBUTE); Link<Button*,void> aBtnHdl = LINK(this, ScXMLSourceDlg, BtnPressedHdl); mpBtnSelectSource->SetClickHdl(aBtnHdl); |