summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/image.hxx3
-rw-r--r--sd/source/ui/controller/slidelayoutcontroller.cxx2
-rw-r--r--vcl/source/control/fixed.cxx2
-rw-r--r--vcl/source/image/Image.cxx5
-rw-r--r--vcl/source/window/builder.cxx4
-rw-r--r--vcl/source/window/msgbox.cxx8
6 files changed, 16 insertions, 8 deletions
diff --git a/include/vcl/image.hxx b/include/vcl/image.hxx
index 17bfce780461..c115a676102d 100644
--- a/include/vcl/image.hxx
+++ b/include/vcl/image.hxx
@@ -45,6 +45,8 @@ namespace vcl
#define IMAGELIST_IMAGE_NOTFOUND (sal_uInt16(0xFFFF))
+enum class StockImage { Yes };
+
class SAL_WARN_UNUSED VCL_DLLPUBLIC Image
{
friend class ::OutputDevice;
@@ -54,6 +56,7 @@ public:
explicit Image( const BitmapEx& rBitmapEx );
explicit Image( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic );
explicit Image( const OUString &rPNGFileUrl );
+ explicit Image( StockImage, const OUString &rPNGFilePath );
Size GetSizePixel() const;
diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx
index 6f4ba93c1e92..27d597b2172f 100644
--- a/sd/source/ui/controller/slidelayoutcontroller.cxx
+++ b/sd/source/ui/controller/slidelayoutcontroller.cxx
@@ -132,7 +132,7 @@ static void fillLayoutValueSet( ValueSet* pValue, const snewfoil_value_info_layo
for( ; pInfo->mpStrResId; pInfo++ )
{
OUString aText(SdResId(pInfo->mpStrResId));
- Image aImg("private:graphicrepository/" + OUString::createFromAscii(pInfo->msBmpResId));
+ Image aImg(StockImage::Yes, OUString::createFromAscii(pInfo->msBmpResId));
pValue->InsertItem(static_cast<sal_uInt16>(pInfo->maAutoLayout)+1, aImg, aText);
aLayoutItemSize.setWidth( std::max( aLayoutItemSize.Width(), aImg.GetSizePixel().Width() ) );
aLayoutItemSize.setHeight( std::max( aLayoutItemSize.Height(), aImg.GetSizePixel().Height() ) );
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 7423859045d5..365c421e9b34 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -951,7 +951,7 @@ void FixedImage::SetModeImage( const Image& rImage )
Image FixedImage::loadThemeImage(const OUString &rFileName)
{
- return Image("private:graphicrepository/" + rFileName);
+ return Image(StockImage::Yes, rFileName);
}
bool FixedImage::set_property(const OString &rKey, const OUString &rValue)
diff --git a/vcl/source/image/Image.cxx b/vcl/source/image/Image.cxx
index ecb514c5bbac..e22f5f814304 100644
--- a/vcl/source/image/Image.cxx
+++ b/vcl/source/image/Image.cxx
@@ -70,6 +70,11 @@ Image::Image(const OUString & rFileUrl)
}
}
+Image::Image(StockImage, const OUString & rFileUrl)
+ : mpImplData(new ImplImage(rFileUrl))
+{
+}
+
void Image::ImplInit(const BitmapEx& rBitmapEx)
{
if (!rBitmapEx.IsEmpty())
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 8ff3f0621d2a..210982ddb365 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -676,7 +676,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr
SAL_WARN_IF(eType != SymbolType::IMAGE, "vcl.layout", "unimplemented symbol type for radiobuttons");
if (eType == SymbolType::IMAGE)
{
- Image const aImage("private:graphicrepository/" +
+ Image const aImage(StockImage::Yes,
mapStockToImageResource(rImageInfo.m_sStock));
if (!elem.m_bRadio)
pTargetButton->SetModeImage(aImage);
@@ -721,7 +721,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr
if (eType != SymbolType::IMAGE)
continue;
- Image const aImage("private:graphicrepository/" +
+ Image const aImage(StockImage::Yes,
mapStockToImageResource(rImageInfo.m_sStock));
pImage->SetImage(aImage);
}
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 31307c542a9c..23f7ca2f5e73 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -40,10 +40,10 @@ static void ImplInitMsgBoxImageList()
std::vector<Image> &rImages = pSVData->maWinData.maMsgBoxImgList;
if (rImages.empty())
{
- rImages.emplace_back(Image("private:graphicrepository/" SV_RESID_BITMAP_ERRORBOX));
- rImages.emplace_back(Image("private:graphicrepository/" SV_RESID_BITMAP_QUERYBOX));
- rImages.emplace_back(Image("private:graphicrepository/" SV_RESID_BITMAP_WARNINGBOX));
- rImages.emplace_back(Image("private:graphicrepository/" SV_RESID_BITMAP_INFOBOX));
+ rImages.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_ERRORBOX));
+ rImages.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_QUERYBOX));
+ rImages.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_WARNINGBOX));
+ rImages.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_INFOBOX));
}
}