summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-09-12 16:57:53 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-09-14 11:29:31 +0200
commit24dbe577e539798203d777802cc7027b2edd58c4 (patch)
tree5f22ef1e1fda89acd31758063b2ff1735a56bab7 /oox
parentb7006f3c2f8f71f4d4721c6e5cdc122628c756f0 (diff)
Replace struct EmbeddedWAVAudioFile with simple string.
Change-Id: I6659b6e1be865546f380a28e4803fbe593de0803
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/drawingml/embeddedwavaudiofile.hxx18
-rw-r--r--oox/inc/drawingml/graphicproperties.hxx5
-rw-r--r--oox/source/drawingml/embeddedwavaudiofile.cxx21
-rw-r--r--oox/source/drawingml/fillproperties.cxx5
-rw-r--r--oox/source/drawingml/graphicshapecontext.cxx10
-rw-r--r--oox/source/drawingml/hyperlinkcontext.cxx5
-rw-r--r--oox/source/drawingml/shape.cxx2
-rw-r--r--oox/source/ppt/soundactioncontext.cxx5
-rw-r--r--oox/source/ppt/timetargetelementcontext.cxx6
9 files changed, 25 insertions, 52 deletions
diff --git a/oox/inc/drawingml/embeddedwavaudiofile.hxx b/oox/inc/drawingml/embeddedwavaudiofile.hxx
index c1b199243f87..d4676543a26d 100644
--- a/oox/inc/drawingml/embeddedwavaudiofile.hxx
+++ b/oox/inc/drawingml/embeddedwavaudiofile.hxx
@@ -21,27 +21,15 @@
#define INCLUDED_OOX_DRAWINGML_EMBEDDEDWAVAUDIOFILE_HXX
#include <rtl/ustring.hxx>
-#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
#include <oox/core/fragmenthandler.hxx>
+#include <oox/helper/attributelist.hxx>
namespace oox { namespace drawingml {
- struct EmbeddedWAVAudioFile
- {
- EmbeddedWAVAudioFile()
- : mbBuiltIn(false)
- {
- }
- bool mbBuiltIn;
- OUString msName;
- OUString msEmbed;
- };
-
- void getEmbeddedWAVAudioFile(
+ OUString getEmbeddedWAVAudioFile(
const ::oox::core::Relations& rRelations,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& xAttribs,
- EmbeddedWAVAudioFile & aAudio );
+ const AttributeList& rAttribs );
} }
diff --git a/oox/inc/drawingml/graphicproperties.hxx b/oox/inc/drawingml/graphicproperties.hxx
index 626fe5f0f9b8..27644cd683d6 100644
--- a/oox/inc/drawingml/graphicproperties.hxx
+++ b/oox/inc/drawingml/graphicproperties.hxx
@@ -24,7 +24,6 @@
#include <oox/drawingml/fillproperties.hxx>
#include <oox/helper/helper.hxx>
-#include <drawingml/embeddedwavaudiofile.hxx>
namespace oox {
class GraphicHelper;
@@ -36,8 +35,8 @@ namespace drawingml {
struct GraphicProperties
{
- BlipFillProperties maBlipProps; /// Properties for the graphic.
- EmbeddedWAVAudioFile maAudio; /// Audio file details
+ BlipFillProperties maBlipProps; ///< Properties for the graphic.
+ OUString msMediaTempFile; ///< Audio/Video temporary file.
/** Overwrites all members that are explicitly set in rSourceProps. */
void assignUsed( const GraphicProperties& rSourceProps );
diff --git a/oox/source/drawingml/embeddedwavaudiofile.cxx b/oox/source/drawingml/embeddedwavaudiofile.cxx
index c15bc7c56b5c..7ed371ed2b68 100644
--- a/oox/source/drawingml/embeddedwavaudiofile.cxx
+++ b/oox/source/drawingml/embeddedwavaudiofile.cxx
@@ -20,23 +20,16 @@
#include "drawingml/embeddedwavaudiofile.hxx"
#include "oox/helper/attributelist.hxx"
-using namespace ::oox::core;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::xml::sax;
-
namespace oox { namespace drawingml {
// CT_EmbeddedWAVAudioFile
- void getEmbeddedWAVAudioFile( const Relations& rRelations,
- const Reference< XFastAttributeList >& xAttribs, EmbeddedWAVAudioFile & aAudio )
- {
- AttributeList attribs(xAttribs);
-
- OUString sId = xAttribs->getOptionalValue( R_TOKEN( embed ) );
- aAudio.msEmbed = rRelations.getFragmentPathFromRelId( sId );
- aAudio.mbBuiltIn = attribs.getBool( XML_builtIn, false );
- aAudio.msName = xAttribs->getOptionalValue( XML_name );
- }
+OUString getEmbeddedWAVAudioFile( const core::Relations& rRelations, const AttributeList& rAttribs )
+{
+ if (rAttribs.getBool( XML_builtIn, false ))
+ return rAttribs.getString( XML_name ).get();
+ else
+ return rRelations.getFragmentPathFromRelId( rAttribs.getString( R_TOKEN(embed) ).get() );
+}
} }
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index 109fc23a2216..80e2c25109da 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -34,6 +34,7 @@
#include <com/sun/star/drawing/Hatch.hpp>
#include <com/sun/star/drawing/RectanglePoint.hpp>
#include <com/sun/star/graphic/XGraphicTransformer.hpp>
+#include <oox/core/fragmenthandler.hxx>
#include "oox/helper/graphichelper.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/shapepropertymap.hxx"
@@ -752,8 +753,8 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe
rPropMap.setProperty(PROP_AdjustContrast, nContrast);
// Media content
- if( !maAudio.msEmbed.isEmpty() )
- rPropMap.setProperty(PROP_MediaURL, maAudio.msEmbed);
+ if( !msMediaTempFile.isEmpty() )
+ rPropMap.setProperty(PROP_MediaURL, msMediaTempFile);
}
bool ArtisticEffectProperties::isEmpty() const
diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx
index f23ee1f003f6..a2eac1638308 100644
--- a/oox/source/drawingml/graphicshapecontext.cxx
+++ b/oox/source/drawingml/graphicshapecontext.cxx
@@ -19,8 +19,10 @@
#include <com/sun/star/io/TempFile.hpp>
#include "oox/drawingml/graphicshapecontext.hxx"
+
#include <osl/diagnose.h>
+#include <drawingml/embeddedwavaudiofile.hxx>
#include "drawingml/fillpropertiesgroupcontext.hxx"
#include "drawingml/graphicproperties.hxx"
#include "drawingml/customshapeproperties.hxx"
@@ -38,7 +40,6 @@
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/binaryoutputstream.hxx"
#include "oox/ppt/pptshapegroupcontext.hxx"
-#include <comphelper/processfactory.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::io;
@@ -85,9 +86,8 @@ ContextHandlerRef GraphicShapeContext::onCreateContext( sal_Int32 aElementToken,
return new BlipFillContext( *this, rAttribs, mpShapePtr->getGraphicProperties().maBlipProps );
case XML_wavAudioFile:
{
- getEmbeddedWAVAudioFile( getRelations(), rAttribs.getFastAttributeList(), mpShapePtr->getGraphicProperties().maAudio );
- mpShapePtr->getGraphicProperties().maAudio.msEmbed =
- lcl_CopyToTempFile( mpShapePtr->getGraphicProperties().maAudio.msEmbed, getFilter() );
+ mpShapePtr->getGraphicProperties().msMediaTempFile =
+ lcl_CopyToTempFile( getEmbeddedWAVAudioFile(getRelations(), rAttribs), getFilter() );
}
break;
case XML_audioFile:
@@ -95,7 +95,7 @@ ContextHandlerRef GraphicShapeContext::onCreateContext( sal_Int32 aElementToken,
{
OUString rPath = getRelations().getFragmentPathFromRelId(
rAttribs.getString(R_TOKEN(link)).get() );
- mpShapePtr->getGraphicProperties().maAudio.msEmbed =
+ mpShapePtr->getGraphicProperties().msMediaTempFile =
lcl_CopyToTempFile( rPath, getFilter() );
}
break;
diff --git a/oox/source/drawingml/hyperlinkcontext.cxx b/oox/source/drawingml/hyperlinkcontext.cxx
index b2774d1784b1..a3e7254df380 100644
--- a/oox/source/drawingml/hyperlinkcontext.cxx
+++ b/oox/source/drawingml/hyperlinkcontext.cxx
@@ -150,15 +150,14 @@ HyperLinkContext::~HyperLinkContext()
}
ContextHandlerRef HyperLinkContext::onCreateContext(
- ::sal_Int32 aElement, const AttributeList& rAttribs )
+ ::sal_Int32 aElement, const AttributeList& )
{
switch( aElement )
{
case A_TOKEN( extLst ):
return 0;
case A_TOKEN( snd ):
- EmbeddedWAVAudioFile aAudio;
- getEmbeddedWAVAudioFile( getRelations(), rAttribs.getFastAttributeList(), aAudio );
+ // TODO use getEmbeddedWAVAudioFile() here
break;
}
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 099feb0e6bc2..dbd2aa702c2c 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -405,7 +405,7 @@ Reference< XShape > Shape::createAndInsert(
OUString aServiceName;
if( rServiceName == "com.sun.star.drawing.GraphicObjectShape" &&
- mpGraphicPropertiesPtr && !mpGraphicPropertiesPtr->maAudio.msEmbed.isEmpty() )
+ mpGraphicPropertiesPtr && !mpGraphicPropertiesPtr->msMediaTempFile.isEmpty() )
{
aServiceName = finalizeServiceName( rFilterBase, "com.sun.star.presentation.MediaShape", aShapeRectHmm );
bIsEmbMedia = true;
diff --git a/oox/source/ppt/soundactioncontext.cxx b/oox/source/ppt/soundactioncontext.cxx
index 0996fdb3f947..9f1a4c0c69d3 100644
--- a/oox/source/ppt/soundactioncontext.cxx
+++ b/oox/source/ppt/soundactioncontext.cxx
@@ -74,10 +74,7 @@ namespace oox { namespace ppt {
case PPT_TOKEN( snd ):
if( mbHasStartSound )
{
- drawingml::EmbeddedWAVAudioFile aAudio;
- drawingml::getEmbeddedWAVAudioFile( getRelations(), rAttribs.getFastAttributeList(), aAudio);
-
- msSndName = ( aAudio.mbBuiltIn ? aAudio.msName : aAudio.msEmbed );
+ msSndName = drawingml::getEmbeddedWAVAudioFile( getRelations(), rAttribs );
}
return this;
case PPT_TOKEN( endSnd ):
diff --git a/oox/source/ppt/timetargetelementcontext.cxx b/oox/source/ppt/timetargetelementcontext.cxx
index 230dd89558ed..225ca38de3bb 100644
--- a/oox/source/ppt/timetargetelementcontext.cxx
+++ b/oox/source/ppt/timetargetelementcontext.cxx
@@ -123,11 +123,7 @@ namespace oox { namespace ppt {
case PPT_TOKEN( sndTgt ):
{
mpTarget->mnType = XML_sndTgt;
- drawingml::EmbeddedWAVAudioFile aAudio;
- drawingml::getEmbeddedWAVAudioFile( getRelations(), rAttribs.getFastAttributeList(), aAudio);
-
- OUString sSndName = ( aAudio.mbBuiltIn ? aAudio.msName : aAudio.msEmbed );
- mpTarget->msValue = sSndName;
+ mpTarget->msValue = drawingml::getEmbeddedWAVAudioFile( getRelations(), rAttribs );
break;
}
case PPT_TOKEN( spTgt ):