summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/graphicshapecontext.cxx
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@suse.com>2012-04-02 17:33:32 +0530
committerMuthu Subramanian <sumuthu@suse.com>2012-04-02 17:35:54 +0530
commit8866e1986d354f0eb7eb26d78e6b6a22c6fda632 (patch)
tree3024278aab04e26e55c13ccf71c0fd2dc6071e20 /oox/source/drawingml/graphicshapecontext.cxx
parente2786b3878c391d8b7f4b53b40f30453dbbffbd9 (diff)
n747499: PPTX embedded media playback.
Currently plays the embedded audio files. The image for the audio file seems to be rendered bad, currently.
Diffstat (limited to 'oox/source/drawingml/graphicshapecontext.cxx')
-rw-r--r--oox/source/drawingml/graphicshapecontext.cxx21
1 files changed, 20 insertions, 1 deletions
diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx
index f01854c77103..2230a3bbe60a 100644
--- a/oox/source/drawingml/graphicshapecontext.cxx
+++ b/oox/source/drawingml/graphicshapecontext.cxx
@@ -26,6 +26,7 @@
*
************************************************************************/
+#include <com/sun/star/io/XTempFile.hpp>
#include "oox/drawingml/graphicshapecontext.hxx"
#include <osl/diagnose.h>
@@ -42,6 +43,9 @@
#include "oox/vml/vmlshapecontainer.hxx"
#include "oox/drawingml/fillproperties.hxx"
#include "oox/drawingml/transform2dcontext.hxx"
+#include "oox/helper/binaryinputstream.hxx"
+#include "oox/helper/binaryoutputstream.hxx"
+#include <comphelper/processfactory.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -77,7 +81,22 @@ Reference< XFastContextHandler > GraphicShapeContext::createFastChildContext( sa
xRet.set( new BlipFillContext( *this, xAttribs, mpShapePtr->getGraphicProperties().maBlipProps ) );
break;
case XML_wavAudioFile:
- getEmbeddedWAVAudioFile( getRelations(), xAttribs, mpShapePtr->getGraphicProperties().maAudio );
+ {
+ getEmbeddedWAVAudioFile( getRelations(), xAttribs, mpShapePtr->getGraphicProperties().maAudio );
+ if( !mpShapePtr->getGraphicProperties().maAudio.msEmbed.isEmpty() )
+ {
+ Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
+ Reference< XInputStream > xInStrm( getFilter().openInputStream( mpShapePtr->getGraphicProperties().maAudio.msEmbed ), UNO_SET_THROW );
+ Reference< XTempFile > xTempFile( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TempFile" ) ), UNO_QUERY_THROW );
+ Reference< XOutputStream > xOutStrm( xTempFile->getOutputStream(), UNO_SET_THROW );
+ BinaryXOutputStream aOutStrm( xOutStrm, false );
+ BinaryXInputStream aInStrm( xInStrm, false );
+ aInStrm.copyToStream( aOutStrm );
+
+ xTempFile->setRemoveFile( false );
+ mpShapePtr->getGraphicProperties().maAudio.msEmbed = xTempFile->getUri();
+ }
+ }
break;
}