fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / scripting / source / provider / ScriptImpl.cxx
blob074159042d5f983d789e6642d7cc5107dbfafb8e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include "ScriptImpl.hxx"
22 #include "sal/log.hxx"
24 using namespace ::com::sun::star;
25 using namespace ::com::sun::star::uno;
26 using namespace ::com::sun::star::script::framework;
28 namespace func_provider
32 ScriptImpl::ScriptImpl(
33 const Reference< beans::XPropertySet > & scriptingContext,
34 const Reference< runtime::XScriptInvocation > & runtimeMgr,
35 const OUString& scriptURI )
36 throw ( RuntimeException ) :
37 m_XScriptingContext( scriptingContext, UNO_SET_THROW ),
38 m_RunTimeManager( runtimeMgr, UNO_SET_THROW ),
39 m_ScriptURI( scriptURI )
41 SAL_INFO("scripting.provider", "<!constucting a ScriptImpl>" );
45 ScriptImpl::~ScriptImpl()
47 SAL_INFO("scripting.provider", "<Destructing a ScriptImpl>" );
51 Any SAL_CALL
52 ScriptImpl::invoke( const Sequence< Any >& aParams,
53 Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam )
54 throw ( lang::IllegalArgumentException, script::CannotConvertException,
55 reflection::InvocationTargetException, RuntimeException )
57 SAL_INFO("scripting.provider", "<ScriptImpl::invoke>" );
58 Any result;
59 Any anyScriptingContext;
61 anyScriptingContext <<= m_XScriptingContext;
62 try
64 result = m_RunTimeManager->invoke( m_ScriptURI, anyScriptingContext, aParams,
65 aOutParamIndex, aOutParam );
67 catch ( const lang::IllegalArgumentException & iae )
69 OUString temp = "ScriptImpl::invoke IllegalArgumentException : ";
70 throw lang::IllegalArgumentException( temp.concat( iae.Message ),
71 Reference< XInterface > (),
72 iae.ArgumentPosition );
74 catch ( const script::CannotConvertException & cce )
76 OUString temp = "ScriptImpl::invoke CannotConvertException : ";
77 throw script::CannotConvertException( temp.concat( cce.Message ),
78 Reference< XInterface > (),
79 cce.DestinationTypeClass,
80 cce.Reason,
81 cce.ArgumentIndex );
83 catch ( const reflection::InvocationTargetException & ite )
85 OUString temp = "ScriptImpl::invoke InvocationTargetException : ";
86 throw reflection::InvocationTargetException( temp.concat( ite.Message ),
87 Reference< XInterface > (),
88 ite.TargetException );
90 catch ( const RuntimeException & re )
92 OUString temp = "ScriptImpl::invoke RuntimeException : ";
93 throw RuntimeException( temp.concat( re.Message ) );
95 #ifdef _DEBUG
96 catch ( ... )
98 throw RuntimeException(
99 "ScriptImpl::invoke Unknown Exception caught - RuntimeException rethrown" );
101 #endif
102 return result;
104 } // namespace func_provider
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */