pppoptimizer.cxx (597a4c59) pppoptimizer.cxx (8c5bb9c6)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 16 unchanged lines hidden (view full) ---

25#include "precompiled_sdext.hxx"
26
27#include "pppoptimizer.hxx"
28#include "impoptimizer.hxx"
29#include <osl/file.hxx>
30
31#include <com/sun/star/lang/IllegalArgumentException.hpp>
32
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 16 unchanged lines hidden (view full) ---

25#include "precompiled_sdext.hxx"
26
27#include "pppoptimizer.hxx"
28#include "impoptimizer.hxx"
29#include <osl/file.hxx>
30
31#include <com/sun/star/lang/IllegalArgumentException.hpp>
32
33#define SERVICE_NAME "com.sun.star.comp.PPPOptimizer"
33#define SERVICE_NAME "com.sun.star.presentation.PresentationOptimizer"
34
35
36using namespace ::com::sun::star::uno;
37using namespace ::com::sun::star::util;
38using namespace ::com::sun::star::lang;
39using namespace ::com::sun::star::frame;
40using namespace ::com::sun::star::beans;
41

--- 58 unchanged lines hidden (view full) ---

100// -----------------------------------------------------------------------------
101// XDispatchProvider
102// -----------------------------------------------------------------------------
103
104Reference< com::sun::star::frame::XDispatch > SAL_CALL PPPOptimizer::queryDispatch(
105 const URL& aURL, const ::rtl::OUString& /* aTargetFrameName */, sal_Int32 /* nSearchFlags */ ) throw( RuntimeException )
106{
107 Reference < XDispatch > xRet;
34
35
36using namespace ::com::sun::star::uno;
37using namespace ::com::sun::star::util;
38using namespace ::com::sun::star::lang;
39using namespace ::com::sun::star::frame;
40using namespace ::com::sun::star::beans;
41

--- 58 unchanged lines hidden (view full) ---

100// -----------------------------------------------------------------------------
101// XDispatchProvider
102// -----------------------------------------------------------------------------
103
104Reference< com::sun::star::frame::XDispatch > SAL_CALL PPPOptimizer::queryDispatch(
105 const URL& aURL, const ::rtl::OUString& /* aTargetFrameName */, sal_Int32 /* nSearchFlags */ ) throw( RuntimeException )
106{
107 Reference < XDispatch > xRet;
108 if ( aURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) == 0 )
108 if ( aURL.Protocol.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
109 "vnd.com.sun.star.presentation.PresentationOptimizer:" ) ) )
109 {
110// if ( aURL.Path.compareToAscii( "Function1" ) == 0 )
111 xRet = this;
112 }
113 return xRet;
114}
115
116//------------------------------------------------------------------------------

--- 14 unchanged lines hidden (view full) ---

131// -----------------------------------------------------------------------------
132// XDispatch
133// -----------------------------------------------------------------------------
134
135void SAL_CALL PPPOptimizer::dispatch( const URL& rURL, const Sequence< PropertyValue >& lArguments )
136 throw( RuntimeException )
137{
138 OSL_TRACE("PPPOptimizer::dispatch");
110 {
111// if ( aURL.Path.compareToAscii( "Function1" ) == 0 )
112 xRet = this;
113 }
114 return xRet;
115}
116
117//------------------------------------------------------------------------------

--- 14 unchanged lines hidden (view full) ---

132// -----------------------------------------------------------------------------
133// XDispatch
134// -----------------------------------------------------------------------------
135
136void SAL_CALL PPPOptimizer::dispatch( const URL& rURL, const Sequence< PropertyValue >& lArguments )
137 throw( RuntimeException )
138{
139 OSL_TRACE("PPPOptimizer::dispatch");
139 if ( mxController.is() && ( rURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) == 0 ) )
140 if ( mxController.is() && rURL.Protocol.equalsAsciiL(
141 RTL_CONSTASCII_STRINGPARAM(
142 "vnd.com.sun.star.presentation.PresentationOptimizer:" )))
140 {
143 {
141 if ( rURL.Path.compareToAscii( "optimize" ) == 0 )
144 if ( rURL.Path.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("optimize") ) )
142 {
143 Reference< XModel > xModel( mxController->getModel() );
144 if ( xModel.is() )
145 {
146 try
147 {
148 ImpOptimizer aOptimizer( mxContext, xModel );
149 aOptimizer.Optimize( lArguments );

--- 38 unchanged lines hidden (view full) ---

188 }
189 return nFileSize;
190}
191
192// -----------------------------------------------------------------------------
193
194OUString PPPOptimizer_getImplementationName()
195{
145 {
146 Reference< XModel > xModel( mxController->getModel() );
147 if ( xModel.is() )
148 {
149 try
150 {
151 ImpOptimizer aOptimizer( mxContext, xModel );
152 aOptimizer.Optimize( lArguments );

--- 38 unchanged lines hidden (view full) ---

191 }
192 return nFileSize;
193}
194
195// -----------------------------------------------------------------------------
196
197OUString PPPOptimizer_getImplementationName()
198{
196 return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.PPPOptimizerImp" ) );
199 return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.presentation.PresentationOptimizer" ) );
197}
198
199Sequence< OUString > PPPOptimizer_getSupportedServiceNames()
200{
201 Sequence < OUString > aRet(1);
202 OUString* pArray = aRet.getArray();
203 pArray[0] = OUString ( RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME ) );
204 return aRet;
205}
206
207Reference< XInterface > PPPOptimizer_createInstance( const Reference< XComponentContext > & rSMgr )
208 throw( Exception )
209{
210 return (cppu::OWeakObject*) new PPPOptimizer( rSMgr );
211}
200}
201
202Sequence< OUString > PPPOptimizer_getSupportedServiceNames()
203{
204 Sequence < OUString > aRet(1);
205 OUString* pArray = aRet.getArray();
206 pArray[0] = OUString ( RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME ) );
207 return aRet;
208}
209
210Reference< XInterface > PPPOptimizer_createInstance( const Reference< XComponentContext > & rSMgr )
211 throw( Exception )
212{
213 return (cppu::OWeakObject*) new PPPOptimizer( rSMgr );
214}