diff options
author | Sven Jacobi <sj@openoffice.org> | 2001-12-18 12:44:13 +0000 |
---|---|---|
committer | Sven Jacobi <sj@openoffice.org> | 2001-12-18 12:44:13 +0000 |
commit | 34f6d73eef33f8fe358e274821e7eb8b181584b6 (patch) | |
tree | af500e1c5f006e75fdeb5119868deb97a9dba540 | |
parent | c0e0d25b1a69d1b55338a424ca50f6743d456e98 (diff) |
#96026# now also exporting linked graphics
-rw-r--r-- | svx/source/msfilter/escherex.cxx | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/svx/source/msfilter/escherex.cxx b/svx/source/msfilter/escherex.cxx index b0d1fefbe2c6..e854d8f71120 100644 --- a/svx/source/msfilter/escherex.cxx +++ b/svx/source/msfilter/escherex.cxx @@ -2,9 +2,9 @@ * * $RCSfile: escherex.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.25 $ * - * last change: $Author: sj $ $Date: 2001-09-07 09:22:26 $ + * last change: $Author: sj $ $Date: 2001-12-18 13:44:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -151,6 +151,12 @@ #ifndef _COM_SUN_STAR_TEXT_GRAPHICCROP_HPP_ #include <com/sun/star/text/GraphicCrop.hpp> #endif +#ifndef _UNOTOOLS_UCBSTREAMHELPER_HXX +#include <unotools/ucbstreamhelper.hxx> +#endif +#ifndef _UNOTOOLS_LOCALFILEHELPER_HXX +#include <unotools/localfilehelper.hxx> +#endif #ifndef _COMPHELPER_EXTRACT_HXX_ #include <comphelper/extract.hxx> #endif @@ -928,13 +934,30 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties( } if ( aGraphicUrl.Len() ) { - xub_StrLen nIndex = aGraphicUrl.Search( (sal_Unicode)':', 0 ); + String aVndUrl( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) ); + xub_StrLen nIndex = aGraphicUrl.Search( aVndUrl, 0 ); if ( nIndex != STRING_NOTFOUND ) { - nIndex++; + nIndex += aVndUrl.Len(); if ( aGraphicUrl.Len() > nIndex ) aUniqueId = ByteString( aGraphicUrl, nIndex, aGraphicUrl.Len() - nIndex, RTL_TEXTENCODING_UTF8 ); } + else + { + Graphic aGraphic; + INetURLObject aTmp( aGraphicUrl ); + SvStream* pIn = ::utl::UcbStreamHelper::CreateStream( + aTmp.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); + if ( pIn ) + { + sal_uInt32 nErrCode = GraphicConverter::Import( *pIn, aGraphic ); + if ( nErrCode == ERRCODE_NONE ) + { + aGraphicObject = aGraphic; + aUniqueId = aGraphicObject.GetUniqueID(); + } + } + } } if ( aUniqueId.Len() ) { |