fdo#46808, Convert oox::PowerPointExport service to new style
The service already existed, it just needed an IDL file
Change-Id: I1404f4f60abafd489ddfb7294affcc7ff33885ce
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 79f76c8..20aa8a7 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -262,6 +262,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/mozilla,\
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/oox,\
ExcelFilterExport \
PowerPointExport \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/packages/manifest,\
ManifestReader \
diff --git a/offapi/com/sun/star/oox/PowerPointExport.idl b/offapi/com/sun/star/oox/PowerPointExport.idl
new file mode 100644
index 0000000..14f84eb
--- /dev/null
+++ b/offapi/com/sun/star/oox/PowerPointExport.idl
@@ -0,0 +1,37 @@
/* -*- 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_oox_PowerPointExport_idl__
#define __com_sun_star_oox_PowerPointExport_idl__
#include <com/sun/star/document/XExporter.idl>
module com { module sun { module star { module oox {
/**
@since LibreOffice 4.2
*/
service PowerPointExport : com::sun::star::document::XExporter;
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index 285ac2a..e9008b3 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -24,10 +24,12 @@
#include "oox/helper/graphichelper.hxx"
#include "oox/ole/vbaproject.hxx"
#include "com/sun/star/oox/PowerPointExport.hpp"
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
using namespace oox::core;
using namespace ::oox::core;
using ::com::sun::star::beans::PropertyValue;
using ::com::sun::star::lang::XComponent;
@@ -96,7 +98,7 @@ sal_Int32 PowerPointImport::getSchemeColor( sal_Int32 nToken ) const
if ( mpActualSlidePersist )
{
sal_Bool bColorMapped = sal_False;
oox::drawingml::ClrMapPtr pClrMapPtr( mpActualSlidePersist->getClrMap() );
::oox::drawingml::ClrMapPtr pClrMapPtr( mpActualSlidePersist->getClrMap() );
if ( pClrMapPtr )
bColorMapped = pClrMapPtr->getColorMap( nToken );
@@ -110,7 +112,7 @@ sal_Int32 PowerPointImport::getSchemeColor( sal_Int32 nToken ) const
bColorMapped = pClrMapPtr->getColorMap( nToken );
}
}
oox::drawingml::ClrSchemePtr pClrSchemePtr( mpActualSlidePersist->getClrScheme() );
::oox::drawingml::ClrSchemePtr pClrSchemePtr( mpActualSlidePersist->getClrScheme() );
if ( pClrSchemePtr )
pClrSchemePtr->getColor( nToken, nColor );
else
@@ -140,17 +142,15 @@ sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< PropertyValue >& rDe
return true;
if( isExportFilter() ) {
Reference< XExporter > xExporter( Reference<css::lang::XMultiServiceFactory>(getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( "com.sun.star.comp.Impress.oox.PowerPointExport" ), UNO_QUERY );;
Reference< XExporter > xExporter = css::oox::PowerPointExport::create( getComponentContext() );
if( xExporter.is() ) {
Reference< XComponent > xDocument( getModel(), UNO_QUERY );
Reference< XFilter > xFilter( xExporter, UNO_QUERY );
Reference< XComponent > xDocument( getModel(), UNO_QUERY );
Reference< XFilter > xFilter( xExporter, UNO_QUERY );
if( xFilter.is() ) {
xExporter->setSourceDocument( xDocument );
if( xFilter->filter( rDescriptor ) )
return true;
}
if( xFilter.is() ) {
xExporter->setSourceDocument( xDocument );
if( xFilter->filter( rDescriptor ) )
return true;
}
}
@@ -162,12 +162,12 @@ sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< PropertyValue >& rDe
return mpActualSlidePersist ? mpActualSlidePersist->getDrawing() : 0;
}
const oox::drawingml::table::TableStyleListPtr PowerPointImport::getTableStyles()
const ::oox::drawingml::table::TableStyleListPtr PowerPointImport::getTableStyles()
{
if ( !mpTableStyleList && !maTableStyleListPath.isEmpty() )
{
mpTableStyleList = oox::drawingml::table::TableStyleListPtr( new oox::drawingml::table::TableStyleList() );
importFragment( new oox::drawingml::table::TableStyleListFragmentHandler(
mpTableStyleList = ::oox::drawingml::table::TableStyleListPtr( new ::oox::drawingml::table::TableStyleList() );
importFragment( new ::oox::drawingml::table::TableStyleListFragmentHandler(
*this, maTableStyleListPath, *mpTableStyleList ) );
}
return mpTableStyleList;
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index ba04809..084fa787 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2141,8 +2141,9 @@ OUString SAL_CALL PowerPointExport_getImplementationName() throw()
uno::Sequence< OUString > SAL_CALL PowerPointExport_getSupportedServiceNames() throw()
{
const OUString aServiceName( "com.sun.star.comp.ooxpptx" );
const Sequence< OUString > aSeq( &aServiceName, 1 );
Sequence< OUString > aSeq( 2 );
aSeq[0] = "com.sun.star.comp.ooxpptx";
aSeq[1] = "com.sun.star.oox.PowerPointExport";
return aSeq;
}
diff --git a/sd/util/sdfilt.component b/sd/util/sdfilt.component
index 3b1d3b0..349ea8b 100644
--- a/sd/util/sdfilt.component
+++ b/sd/util/sdfilt.component
@@ -11,5 +11,6 @@
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.Impress.oox.PowerPointExport">
<service name="com.sun.star.comp.ooxpptx"/>
<service name="com.sun.star.oox.PowerPointExport"/>
</implementation>
</component>