diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-03-06 15:27:13 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-03-06 15:27:13 +0000 |
commit | 6be6953378cc9e67958e76f5a3578e78b7fe2b0a (patch) | |
tree | 77acd86f445b017ecc69104f7a236ebe5fb4c5f5 /scripting/source/provider | |
parent | 715dba899383392acf10ad512d017e7a9fa0dff2 (diff) |
INTEGRATION: CWS odbmacros2 (1.11.54); FILE MERGED
2008/02/04 13:05:02 fs 1.11.54.4: RESYNC: (1.11-1.12); FILE MERGED
2007/12/20 09:38:18 fs 1.11.54.3: getAllBrowseNodes: check for XembeddedScripts only, not for XScriptInvocationContext
2007/12/17 12:43:37 fs 1.11.54.2: #i49133#
allow to create script providers for documents which do not support
embedded scripts themselves (i.e. don't have the XEmbeddedScripts
interface), but are able to point to such a do cument (via
XScriptInvocationContext) whose scripts they can execute
2007/12/11 22:48:59 fs 1.11.54.1: #i49133# don't create a provider for a document which is not able to contain macros/scripts
Diffstat (limited to 'scripting/source/provider')
-rw-r--r-- | scripting/source/provider/BrowseNodeFactoryImpl.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx index 6f28d479125c..f2857c734c06 100644 --- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx +++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx @@ -4,9 +4,9 @@ * * $RCSfile: BrowseNodeFactoryImpl.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: vg $ $Date: 2008-01-28 13:58:06 $ + * last change: $Author: kz $ $Date: 2008-03-06 16:27:13 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -49,7 +49,9 @@ #include <com/sun/star/script/provider/XScriptProviderFactory.hpp> #include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp> +#include <com/sun/star/document/XScriptInvocationContext.hpp> +#include <tools/diagnose_ex.h> #include "BrowseNodeFactoryImpl.hxx" #include "ActiveMSPList.hxx" @@ -358,15 +360,17 @@ Sequence< Reference< browse::XBrowseNode > > getAllBrowseNodes( const Reference< sal_Bool bHidden = aMD.getUnpackedValueOrDefault( comphelper::MediaDescriptor::PROP_HIDDEN(), bDefault ); sal_Bool bPreview = aMD.getUnpackedValueOrDefault( comphelper::MediaDescriptor::PROP_PREVIEW(), bDefault ); if( !bHidden && !bPreview ) - locnBNs[ mspIndex++ ] = Reference< browse::XBrowseNode >( xFac->createScriptProvider( makeAny( model ) ), UNO_QUERY_THROW ); + { + Reference< document::XEmbeddedScripts > xScripts( model, UNO_QUERY ); + if ( xScripts.is() ) + locnBNs[ mspIndex++ ] = Reference< browse::XBrowseNode >( + xFac->createScriptProvider( makeAny( model ) ), UNO_QUERY_THROW ); + } } } - catch( Exception& e ) + catch( const Exception& ) { - (void)e; - OSL_TRACE("Caught Exception creating MSP for %s exception msg: %s", - ::rtl::OUStringToOString( openDocs[ i ] , RTL_TEXTENCODING_ASCII_US ).pData->buffer, - ::rtl::OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).pData->buffer ); + DBG_UNHANDLED_EXCEPTION(); } } |