diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-12-10 21:58:17 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-12-10 21:58:17 +0100 |
commit | 6d82dbeddb991307a987b9f8087d78b702f6c7c0 (patch) | |
tree | 4c0a3b56f376a7449acc72e8768043fcbb971415 /svx/source/unodraw | |
parent | e253f0cf0ddfed47d1e64fd7b7304f48d0a4ece0 (diff) |
#i107450#: move method CreateGraphicObjectFromURL to class GraphicObject
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/XPropertyTable.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unobtabl.cxx | 42 | ||||
-rw-r--r-- | svx/source/unodraw/unonrule.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap4.cxx | 2 |
4 files changed, 3 insertions, 45 deletions
diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx index c30921595bdd..fee6a7295656 100644 --- a/svx/source/unodraw/XPropertyTable.cxx +++ b/svx/source/unodraw/XPropertyTable.cxx @@ -718,7 +718,7 @@ XPropertyEntry* SvxUnoXBitmapTable::getEntry( const OUString& rName, const uno:: if(!(rAny >>= aURL)) return NULL; - GraphicObject aGrafObj( CreateGraphicObjectFromURL( aURL ) ); + GraphicObject aGrafObj( GraphicObject::CreateGraphicObjectFromURL( aURL ) ); XOBitmap aBMP( aGrafObj ); const String aName( rName ); diff --git a/svx/source/unodraw/unobtabl.cxx b/svx/source/unodraw/unobtabl.cxx index 671de49dc4ba..7aa359ad6e19 100644 --- a/svx/source/unodraw/unobtabl.cxx +++ b/svx/source/unodraw/unobtabl.cxx @@ -34,11 +34,6 @@ #include <vcl/cvtgrf.hxx> #include <svl/itemset.hxx> #include <svx/xit.hxx> -#ifndef SVX_LIGHT -#ifndef _SFXDOCFILE_HXX -#include <sfx2/docfile.hxx> -#endif -#endif #include "UnoNameItemTable.hxx" #include <svx/xbtmpit.hxx> @@ -127,41 +122,4 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoBitmapTable_createInstance( Sdr { return *new SvxUnoBitmapTable(pModel); } -#include <tools/stream.hxx> -#include <unotools/localfilehelper.hxx> -/** returns a GraphicObject for this URL */ -GraphicObject CreateGraphicObjectFromURL( const ::rtl::OUString &rURL ) throw() -{ - const String aURL( rURL ), aPrefix( RTL_CONSTASCII_STRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX) ); - - if( aURL.Search( aPrefix ) == 0 ) - { - // graphic manager url - ByteString aUniqueID( String(rURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 )), RTL_TEXTENCODING_UTF8 ); - return GraphicObject( aUniqueID ); - } - else - { - Graphic aGraphic; - -#ifndef SVX_LIGHT - if ( aURL.Len() ) - { - SfxMedium aMedium( aURL, STREAM_READ, TRUE ); - SvStream* pStream = aMedium.GetInStream(); - - if( pStream ) - GraphicConverter::Import( *pStream, aGraphic ); - } -#else - String aSystemPath( rURL ); - utl::LocalFileHelper::ConvertURLToSystemPath( aSystemPath, aSystemPath ); - SvFileStream aFile( aSystemPath, STREAM_READ ); - GraphicConverter::Import( aFile, aGraphic ); -#endif - - - return GraphicObject( aGraphic ); - } -} diff --git a/svx/source/unodraw/unonrule.cxx b/svx/source/unodraw/unonrule.cxx index af4a327edb7d..184d3b25d524 100644 --- a/svx/source/unodraw/unonrule.cxx +++ b/svx/source/unodraw/unonrule.cxx @@ -458,7 +458,7 @@ void SvxUnoNumberingRules::setNumberingRuleByIndex( const Sequence< beans::Prope OUString aURL; if( aVal >>= aURL ) { - GraphicObject aGrafObj( CreateGraphicObjectFromURL( aURL ) ); + GraphicObject aGrafObj( GraphicObject::CreateGraphicObjectFromURL( aURL ) ); SvxBrushItem aBrushItem( aGrafObj, GPOS_AREA, SID_ATTR_BRUSH ); aFmt.SetGraphicBrush( &aBrushItem ); continue; diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index baad4bbe3813..1ed781f8b097 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -212,7 +212,7 @@ bool SvxOle2Shape::setPropertyValueImpl( const ::rtl::OUString& rName, const Sfx OUString aURL; if( rValue >>= aURL ) { - GraphicObject aGrafObj( CreateGraphicObjectFromURL( aURL ) ); + GraphicObject aGrafObj( GraphicObject::CreateGraphicObjectFromURL( aURL ) ); static_cast<SdrOle2Obj*>(mpObj.get())->SetGraphic( &aGrafObj.GetGraphic() ); return true; } |