From f302b530d8d26546a137f7b77c73185a60d29238 Mon Sep 17 00:00:00 2001 From: Laszlo Kovacs Date: Mon, 23 Sep 2002 13:08:29 +0000 Subject: Comments and header guards added --- scripting/source/storage/ScriptElement.cxx | 12 ++++++++++-- scripting/source/storage/ScriptElement.hxx | 18 +++++++++++++----- scripting/source/storage/ScriptInfo.cxx | 29 +++++++++++++++++++++++------ scripting/source/storage/ScriptInfo.hxx | 20 +++++++++++++------- 4 files changed, 59 insertions(+), 20 deletions(-) (limited to 'scripting/source/storage') diff --git a/scripting/source/storage/ScriptElement.cxx b/scripting/source/storage/ScriptElement.cxx index 06d4e86d2e1b..57fd28d9e64e 100644 --- a/scripting/source/storage/ScriptElement.cxx +++ b/scripting/source/storage/ScriptElement.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ScriptElement.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dfoster $ $Date: 2002-09-20 14:33:48 $ + * last change: $Author: lkovacs $ $Date: 2002-09-23 14:08:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,7 +59,9 @@ * ************************************************************************/ +#ifndef _SCRIPT_FRAMEWORK_STORAGE_SCRIPT_ELEMENT_HXX_ #include "ScriptElement.hxx" +#endif #include using namespace ::rtl; @@ -71,6 +73,12 @@ namespace scripting_impl { //************************************************************************* +/** + Construct a ScriptElement from a ScriptImplInfo object + + @param sII + the ScriptImplInfoObject +*/ ScriptElement::ScriptElement(storage::ScriptImplInfo & sII) : m_sII( sII ), XMLElement(OUSTR("script")) diff --git a/scripting/source/storage/ScriptElement.hxx b/scripting/source/storage/ScriptElement.hxx index 7777b8746806..866dbe609648 100644 --- a/scripting/source/storage/ScriptElement.hxx +++ b/scripting/source/storage/ScriptElement.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ScriptElement.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dfoster $ $Date: 2002-09-20 14:33:48 $ + * last change: $Author: lkovacs $ $Date: 2002-09-23 14:08:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -58,12 +58,14 @@ * * ************************************************************************/ -#ifndef _SCRIPTING_STORAGE_METADATA_ELEMENT_HXX_ -#define _SCRIPTING_STORAGE_METADATA_ELEMENT_HXX_ +#ifndef _SCRIPT_FRAMEWORK_STORAGE_SCRIPT_ELEMENT_HXX_ +#define _SCRIPT_FRAMEWORK_STORAGE_SCRIPT_ELEMENT_HXX_ #include +#ifndef _DRAFTS_COM_SUN_STAR_SCRIPT_FRAMEWORK_STORAGE_SCRIPTIMPLINFO_HPP_ #include +#endif #include "XMLElement.hxx" @@ -76,7 +78,13 @@ private: drafts::com::sun::star::script::framework::storage::ScriptImplInfo m_sII; public: - explicit ScriptElement(drafts::com::sun::star::script::framework::storage::ScriptImplInfo &); + /** + Construct a ScriptElement from a ScriptImplInfo object + + @param sII + the ScriptImplInfoObject + */ + explicit ScriptElement(drafts::com::sun::star::script::framework::storage::ScriptImplInfo & sII); ~ScriptElement() SAL_THROW (()); }; diff --git a/scripting/source/storage/ScriptInfo.cxx b/scripting/source/storage/ScriptInfo.cxx index 3a2080306b4d..5470da02bf31 100644 --- a/scripting/source/storage/ScriptInfo.cxx +++ b/scripting/source/storage/ScriptInfo.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ScriptInfo.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dfoster $ $Date: 2002-09-20 14:33:49 $ + * last change: $Author: lkovacs $ $Date: 2002-09-23 14:08:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,10 +63,14 @@ #include #include +#ifndef _SCRIPT_FRAMEWORK_STORAGE_SCRIPT_INFO_HXX_ #include +#endif #include +#ifndef _DRAFTS_COM_SUN_STAR_SCRIPT_FRAMEWORK_STORAGE_XPARCELINVOCATIONPREP_HPP_ #include +#endif using namespace ::rtl; using namespace ::com::sun::star::uno; @@ -235,19 +239,25 @@ throw(RuntimeException) //************************************************************************* /** - * This function prepares the script for invocation and returns the full path - * to the prepared parcel folder - * - */ + This function prepares the script for invocation and returns the full path + to the prepared parcel folder + + @return + ::rtl::OUString file URI to the prepared parcel + +*/ ::rtl::OUString SAL_CALL ScriptInfo::prepareForInvocation() throw(RuntimeException) { try { + // if not document URI nothing to do, return path if (m_scriptImplInfo.parcelURI.compareToAscii(docUriPrefix, 16) != 0) { return m_scriptImplInfo.parcelURI; } + // if document URI then copy parcel to a temporary area and return path to it + validateXRef(m_xContext, "ScriptInfo::prepareForInvocation(): invalid context"); Any aAny=m_xContext->getValueByName( OUString::createFromAscii( @@ -274,6 +284,13 @@ throw(RuntimeException) throw RuntimeException(temp.concat(e.Message), Reference ()); } + catch(RuntimeException &e) + { + OUString temp = OUSTR( + "ScriptInfo::prepareForInvocation UnknownException: "); + throw RuntimeException(temp.concat(e.Message), + Reference ()); + } #ifdef _DEBUG catch ( ... ) { diff --git a/scripting/source/storage/ScriptInfo.hxx b/scripting/source/storage/ScriptInfo.hxx index f5b8c845e199..8196f2af4126 100644 --- a/scripting/source/storage/ScriptInfo.hxx +++ b/scripting/source/storage/ScriptInfo.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ScriptInfo.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dfoster $ $Date: 2002-09-20 14:33:50 $ + * last change: $Author: lkovacs $ $Date: 2002-09-23 14:08:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,8 +59,8 @@ * ************************************************************************/ -#ifndef __SCRIPTING_STORAGE_SCRIPTINFO_HXX_ -#define __SCRIPTING_STORAGE_SCRIPTINFO_HXX_ +#ifndef __SCRIPT_FRAMEWORK_STORAGE_SCRIPTINFO_HXX_ +#define __SCRIPT_FRAMEWORK_STORAGE_SCRIPTINFO_HXX_ #include // helper for component factory @@ -70,7 +70,9 @@ #include #include +#ifndef _DRAFTS_COM_SUN_STAR_SCRIPT_FRAMEWORK_XSCRIPTINVOCATIONPREP_HPP_ #include +#endif namespace scripting_impl { @@ -112,9 +114,13 @@ public: virtual ::rtl::OUString SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL extraProperties( ) throw (::com::sun::star::uno::RuntimeException); /** - * This function prepares the script for invocation and returns the full path - * to the prepared parcel folder - */ + This function prepares the script for invocation and returns the full path + to the prepared parcel folder + + @return + ::rtl::OUString file URI to the prepared parcel + + */ virtual ::rtl::OUString SAL_CALL prepareForInvocation() throw (::com::sun::star::uno::RuntimeException); }; -- cgit