summaryrefslogtreecommitdiff
path: root/scripting/source/provider/BrowseNodeFactoryImpl.cxx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2008-03-06 15:27:13 +0000
committerKurt Zenker <kz@openoffice.org>2008-03-06 15:27:13 +0000
commit6aa091e4176caafccdd7008b510351c4f5a82fa9 (patch)
treeb51a58463673500775ffc7edb2cda0096c01f99a /scripting/source/provider/BrowseNodeFactoryImpl.cxx
parentfe0ad4f71898ace47f3b98064edddff0df744213 (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/BrowseNodeFactoryImpl.cxx')
-rw-r--r--scripting/source/provider/BrowseNodeFactoryImpl.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
index 6f28d47912..f2857c734c 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();
}
}