[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - include/vcl sd/source vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Dec 8 12:37:27 UTC 2018


 include/vcl/image.hxx                             |    3 +++
 sd/source/ui/controller/slidelayoutcontroller.cxx |    2 +-
 vcl/source/control/fixed.cxx                      |    2 +-
 vcl/source/image/Image.cxx                        |    5 +++++
 vcl/source/window/builder.cxx                     |    2 +-
 vcl/source/window/msgbox.cxx                      |    8 ++++----
 6 files changed, 15 insertions(+), 7 deletions(-)

New commits:
commit 408d190f399724b4928624acc7beda50191269fd
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Dec 7 14:25:36 2018 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Dec 8 13:37:08 2018 +0100

    utility constructor for Image "private:graphicrepository" urls
    
    Change-Id: I118039f4e47818a43da9302ce3550ea800522675
    Reviewed-on: https://gerrit.libreoffice.org/64765
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Jenkins
    Reviewed-on: https://gerrit.libreoffice.org/64803
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/include/vcl/image.hxx b/include/vcl/image.hxx
index 058a985e237d..a49c4fa9582d 100644
--- a/include/vcl/image.hxx
+++ b/include/vcl/image.hxx
@@ -49,6 +49,8 @@ namespace vcl
 
 #define IMAGELIST_IMAGE_NOTFOUND    ((sal_uInt16)0xFFFF)
 
+enum class StockImage { Yes };
+
 class SAL_WARN_UNUSED VCL_DLLPUBLIC Image
 {
     friend class ::OutputDevice;
@@ -57,6 +59,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 4ba598f10809..b26c193d0455 100644
--- a/sd/source/ui/controller/slidelayoutcontroller.cxx
+++ b/sd/source/ui/controller/slidelayoutcontroller.cxx
@@ -135,7 +135,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.Width()  = std::max( aLayoutItemSize.Width(),  aImg.GetSizePixel().Width()  );
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index e990752ebc22..3a459298936a 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -967,7 +967,7 @@ bool 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 106e9e21ec4d..9dd585081206 100644
--- a/vcl/source/image/Image.cxx
+++ b/vcl/source/image/Image.cxx
@@ -76,6 +76,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 60e968771d78..f40ac4696481 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -365,7 +365,7 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr
                 SAL_WARN_IF(eType != SymbolType::IMAGE, "vcl.layout", "inimplemented symbol type for radiobuttons");
             if (eType == SymbolType::IMAGE)
             {
-                Image const aImage("private:graphicrepository/" +
+                Image const aImage(StockImage::Yes,
                                    mapStockToImageResource(rImageInfo.m_sStock));
                 if (!aI->m_bRadio)
                     pTargetButton->SetModeImage(aImage);
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 40a120e0508a..635147b2e906 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));
     }
 }
 


More information about the Libreoffice-commits mailing list