diff options
author | Kurt Zenker <kz@openoffice.org> | 2004-08-31 13:59:00 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2004-08-31 13:59:00 +0000 |
commit | 81715a373c4a214624e9df24bdd389d093bb3c67 (patch) | |
tree | 48bce7ac24eeaa649af0dc12ba6a23a30a34420c /vcl/source/gdi/image.cxx | |
parent | 8db474e7a9101234cb2a22479ac328998a8acd83 (diff) |
INTEGRATION: CWS c02v1 (1.16.52); FILE MERGED
2004/08/13 13:11:47 ka 1.16.52.2: #117562#: Gallery API
2004/08/13 10:58:57 ka 1.16.52.1: #117562#: Gallery API
Diffstat (limited to 'vcl/source/gdi/image.cxx')
-rw-r--r-- | vcl/source/gdi/image.cxx | 61 |
1 files changed, 6 insertions, 55 deletions
diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx index 49ae25c9ab09..35bc4201777c 100644 --- a/vcl/source/gdi/image.cxx +++ b/vcl/source/gdi/image.cxx @@ -2,9 +2,9 @@ * * $RCSfile: image.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: rt $ $Date: 2004-07-06 14:43:19 $ + * last change: $Author: kz $ $Date: 2004-08-31 14:59:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -93,25 +93,6 @@ #include <image.hxx> #endif -#ifndef _COMPHELPER_PROCESSFACTORY_HXX_ -#include <comphelper/processfactory.hxx> -#endif -#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#endif -#ifndef _COM_SUN_STAR_GRAPHIC_XGRAPHICPROVIDER_HPP_ -#include <com/sun/star/graphic/XGraphicProvider.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_ -#include <com/sun/star/lang/XUnoTunnel.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_ -#include <com/sun/star/lang/XTypeProvider.hpp> -#endif -#ifndef _COM_SUN_STAR_GRAPHIC_XGRAPHIC_HPP_ -#include <com/sun/star/graphic/XGraphic.hpp> -#endif - DBG_NAME( Image ); DBG_NAME( ImageList ); @@ -251,14 +232,8 @@ Image::Image( const uno::Reference< graphic::XGraphic >& rxGraphic ) : { DBG_CTOR( Image, NULL ); - uno::Reference< lang::XUnoTunnel > xTunnel( rxGraphic, uno::UNO_QUERY ); - uno::Reference< lang::XTypeProvider > xProv( rxGraphic, uno::UNO_QUERY ); - const ::Graphic* pGraphic = ( ( xTunnel.is() && xProv.is() ) ? - reinterpret_cast< ::Graphic* >( xTunnel->getSomething( xProv->getImplementationId() ) ) : - NULL ); - - if( pGraphic ) - ImplInit( pGraphic->GetBitmapEx() ); + const Graphic aGraphic( rxGraphic ); + ImplInit( aGraphic.GetBitmapEx() ); } // ----------------------------------------------------------------------- @@ -359,33 +334,9 @@ BitmapEx Image::GetBitmapEx() const uno::Reference< graphic::XGraphic > Image::GetXGraphic() const { - const Graphic aGraphic( GetBitmapEx() ); - uno::Reference< graphic::XGraphic > xRet; - - if( aGraphic.GetType() != GRAPHIC_NONE ) - { - uno::Reference < lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() ); - - if( xMSF.is() ) - { - uno::Reference< graphic::XGraphicProvider > xProv( xMSF->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.graphic.GraphicProvider" ) ) ), - uno::UNO_QUERY ); - - if( xProv.is() ) - { - uno::Sequence< beans::PropertyValue > aLoadProps( 1 ); - ::rtl::OUString aURL( RTL_CONSTASCII_USTRINGPARAM( "private:memorygraphic/" ) ); - - aLoadProps[ 0 ].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ); - aLoadProps[ 0 ].Value <<= ( aURL += ::rtl::OUString::valueOf( (sal_Int64) &aGraphic ) ); - - xRet = xProv->queryGraphic( aLoadProps ); - } - } - } + const Graphic aGraphic( GetBitmapEx() ); - return xRet; + return aGraphic.GetXGraphic(); } // ----------------------------------------------------------------------- |