summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-04-25 13:30:44 +0200
committerNoel Grandin <noel@peralex.com>2013-04-25 14:44:07 +0200
commita66fd8a99a8c783e4782c487666369c2e567bb95 (patch)
treeb42df8c6377af896e16993e673aa236fd9ec40ca
parent725d23bee0a32eb19554efb5204789b6eb500b03 (diff)
fdo#46808, Convert animations::Audio and IterateContainer to new style
The services already existed, they just needed IDL files Change-Id: I4e3389abb2cb0e41c9bab112cda2a7e896eb271d
-rw-r--r--offapi/UnoApi_offapi.mk2
-rw-r--r--offapi/com/sun/star/animations/Audio.idl38
-rw-r--r--offapi/com/sun/star/animations/IterateContainer.idl38
-rw-r--r--sd/source/core/CustomAnimationEffect.cxx12
4 files changed, 85 insertions, 5 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 29e1a786412c..e1c6e9bda495 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -38,6 +38,8 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/accessibil
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/animations,\
AnimateColor \
AnimateSet \
+ Audio \
+ IterateContainer \
ParallelTimeContainer \
SequenceTimeContainer \
TargetPropertiesCreator \
diff --git a/offapi/com/sun/star/animations/Audio.idl b/offapi/com/sun/star/animations/Audio.idl
new file mode 100644
index 000000000000..929a3dce9fb1
--- /dev/null
+++ b/offapi/com/sun/star/animations/Audio.idl
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_animations_Audio_idl__
+#define __com_sun_star_animations_Audio_idl__
+
+#include <com/sun/star/animations/XAudio.idl>
+
+
+module com { module sun { module star { module animations {
+
+
+/**
+ @since LibreOffice 4.1
+*/
+service Audio : com::sun::star::animations::XAudio;
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/animations/IterateContainer.idl b/offapi/com/sun/star/animations/IterateContainer.idl
new file mode 100644
index 000000000000..a6310f5f1b54
--- /dev/null
+++ b/offapi/com/sun/star/animations/IterateContainer.idl
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_animations_IterateContainer_idl__
+#define __com_sun_star_animations_IterateContainer_idl__
+
+#include <com/sun/star/animations/XTimeContainer.idl>
+
+
+module com { module sun { module star { module animations {
+
+
+/**
+ @since LibreOffice 4.1
+*/
+service IterateContainer : com::sun::star::animations::XTimeContainer;
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx
index 0bbaf013ea51..5f7a9e18bbb3 100644
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -22,6 +22,8 @@
#include <com/sun/star/animations/AnimateColor.hpp>
#include <com/sun/star/animations/AnimateSet.hpp>
#include <com/sun/star/animations/AnimationFill.hpp>
+#include <com/sun/star/animations/Audio.hpp>
+#include <com/sun/star/animations/IterateContainer.hpp>
#include <com/sun/star/animations/ParallelTimeContainer.hpp>
#include <com/sun/star/animations/SequenceTimeContainer.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
@@ -1032,14 +1034,14 @@ void CustomAnimationEffect::setIterateType( sal_Int16 nIterateType )
{
sal_Int16 nTargetSubItem = mnTargetSubItem;
+ Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
Reference< XTimeContainer > xNewContainer;
if(nIterateType)
{
- Reference< XMultiServiceFactory > xMsf( ::comphelper::getProcessServiceFactory() );
- xNewContainer.set( xMsf->createInstance( OUString::createFromAscii("com.sun.star.animations.IterateContainer") ), UNO_QUERY_THROW );
+ xNewContainer.set( IterateContainer::create( xContext ) );
}
else
- xNewContainer.set( ParallelTimeContainer::create( ::comphelper::getProcessComponentContext() ), UNO_QUERY_THROW );
+ xNewContainer.set( ParallelTimeContainer::create( xContext ), UNO_QUERY_THROW );
Reference< XTimeContainer > xOldContainer( mxNode, UNO_QUERY_THROW );
Reference< XEnumerationAccess > xEnumerationAccess( mxNode, UNO_QUERY_THROW );
@@ -1553,8 +1555,8 @@ void CustomAnimationEffect::createAudio( const ::com::sun::star::uno::Any& rSour
if( !mxAudio.is() ) try
{
- Reference< XMultiServiceFactory > xMsf( ::comphelper::getProcessServiceFactory() );
- Reference< XAudio > xAudio( xMsf->createInstance( "com.sun.star.animations.Audio" ), UNO_QUERY_THROW );
+ Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+ Reference< XAudio > xAudio( Audio::create( xContext ) );
xAudio->setSource( rSource );
xAudio->setVolume( fVolume );
setAudio( xAudio );