[Libreoffice-commits] .: vcl/inc vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Dec 5 04:05:10 PST 2012
vcl/inc/vcl/fixed.hxx | 2 +-
vcl/source/control/fixed.cxx | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
New commits:
commit 625ce5e92ba1850c841ce591f7bc395243af46a6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Dec 5 12:03:16 2012 +0000
allow arbitrary icons from our icon-themes to be loaded via .ui
Change-Id: I5aab159bbbd4c20788085ae3069522f248289ab2
diff --git a/vcl/inc/vcl/fixed.hxx b/vcl/inc/vcl/fixed.hxx
index 94d70dc..c36b63d 100644
--- a/vcl/inc/vcl/fixed.hxx
+++ b/vcl/inc/vcl/fixed.hxx
@@ -186,7 +186,7 @@ public:
sal_Bool SetModeImage( const Image& rImage );
const Image& GetModeImage( ) const;
-;
+ virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue);
};
#endif // _SV_FIXED_HXX
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 982e3ec..f8e8b3d 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -24,8 +24,10 @@
#include "vcl/dialog.hxx"
#include "vcl/event.hxx"
#include "vcl/fixed.hxx"
+#include "vcl/svapp.hxx"
#include <comphelper/string.hxx>
#include "controldata.hxx"
+#include "impimagetree.hxx"
#include "window.h"
// =======================================================================
@@ -1193,4 +1195,23 @@ const Image& FixedImage::GetModeImage( ) const
return maImage;
}
+bool FixedImage::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
+{
+ if (rKey == "pixbuf")
+ {
+ static ImplImageTreeSingletonRef aImageTree;
+ OUString sCurrentSymbolsStyle =
+ Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName();
+ const OUString sFileName(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8));
+ BitmapEx aBitmap;
+ bool bSuccess = aImageTree->loadImage(sFileName, sCurrentSymbolsStyle, aBitmap, true);
+ SAL_WARN_IF(!bSuccess, "vcl.layout", "Unable to load " << sFileName
+ << " from theme " << sCurrentSymbolsStyle);
+ SetImage(Image(aBitmap));
+ }
+ else
+ return Control::set_property(rKey, rValue);
+ return true;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list