diff options
author | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2010-08-27 12:13:59 +0200 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2010-08-27 12:13:59 +0200 |
commit | 265043a935781633f204b1ddfede5f454b8555fe (patch) | |
tree | 4d8dfc5e03a67f57a07d138c6dfee6e5480ac565 /toolkit/source/helper/tkresmgr.cxx | |
parent | 5eb0040d0199f8c80d47ed912e055f27a193b81d (diff) |
tabcontrol: #i113362# impl tabcontrol in awt
Diffstat (limited to 'toolkit/source/helper/tkresmgr.cxx')
-rw-r--r-- | toolkit/source/helper/tkresmgr.cxx | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/toolkit/source/helper/tkresmgr.cxx b/toolkit/source/helper/tkresmgr.cxx index 4e1e4153daf1..433ac3511e94 100644 --- a/toolkit/source/helper/tkresmgr.cxx +++ b/toolkit/source/helper/tkresmgr.cxx @@ -29,14 +29,21 @@ #include "precompiled_toolkit.hxx" #include <toolkit/helper/tkresmgr.hxx> #include <tools/simplerm.hxx> +#include <comphelper/processfactory.hxx> +#include <comphelper/componentcontext.hxx> +#include <comphelper/namedvaluecollection.hxx> +#include <com/sun/star/graphic/XGraphicProvider.hpp> #ifndef _TOOLS_RESMGR_HXX_ #include <tools/resmgr.hxx> #endif - +#include <tools/diagnose_ex.h> #include <vcl/svapp.hxx> - +using ::com::sun::star::uno::Reference; +using ::com::sun::star::graphic::XGraphic; +using ::com::sun::star::graphic::XGraphicProvider; +using namespace ::com::sun::star; // ----------------------------------------------------------------------------- // TkResMgr // ----------------------------------------------------------------------------- @@ -98,3 +105,26 @@ Image TkResMgr::loadImage( sal_uInt16 nResId ) } // ----------------------------------------------------------------------------- +Image TkResMgr::getImageFromURL( const ::rtl::OUString& i_rImageURL ) +{ + if ( !i_rImageURL.getLength() ) + return Image(); + + try + { + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + Reference< XGraphicProvider > xProvider; + if ( aContext.createComponent( "com.sun.star.graphic.GraphicProvider", xProvider ) ) + { + ::comphelper::NamedValueCollection aMediaProperties; + aMediaProperties.put( "URL", i_rImageURL ); + Reference< XGraphic > xGraphic = xProvider->queryGraphic( aMediaProperties.getPropertyValues() ); + return Image( xGraphic ); + } + } + catch( const uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return Image(); +}
\ No newline at end of file |