diff options
Diffstat (limited to 'scripting')
83 files changed, 1011 insertions, 506 deletions
diff --git a/scripting/inc/pch/precompiled_scripting.cxx b/scripting/inc/pch/precompiled_scripting.cxx index ff35b12afe..563ae22e3f 100644 --- a/scripting/inc/pch/precompiled_scripting.cxx +++ b/scripting/inc/pch/precompiled_scripting.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,3 +28,4 @@ #include "precompiled_scripting.hxx" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/inc/pch/precompiled_scripting.hxx b/scripting/inc/pch/precompiled_scripting.hxx index 183e6a5ca6..1d707df6bb 100644 --- a/scripting/inc/pch/precompiled_scripting.hxx +++ b/scripting/inc/pch/precompiled_scripting.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,3 +31,4 @@ #ifdef PRECOMPILED_HEADERS #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java index 3a2ff76bc9..e7bce06905 100644 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java @@ -170,7 +170,7 @@ public class ScriptEditorForBeanShell /** - * Indicates the line where error occured + * Indicates the line where error occurred * */ public void indicateErrorLine( int lineNum ) diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java index 46ccea6931..dde0286538 100644 --- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java +++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java @@ -254,7 +254,7 @@ public class ScriptEditorForJavaScript implements ScriptEditor } /** - * Indicates the line where error occured + * Indicates the line where error occurred * */ public void indicateErrorLine( int lineNum ) diff --git a/scripting/prj/build.lst b/scripting/prj/build.lst index d0ceb4cb81..d0ceb4cb81 100644..100755 --- a/scripting/prj/build.lst +++ b/scripting/prj/build.lst diff --git a/scripting/source/basprov/baslibnode.cxx b/scripting/source/basprov/baslibnode.cxx index 0df822404d..1e805bce43 100644 --- a/scripting/source/basprov/baslibnode.cxx +++ b/scripting/source/basprov/baslibnode.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,7 +31,7 @@ #include "baslibnode.hxx" #include "basmodnode.hxx" #include <com/sun/star/script/browse/BrowseNodeTypes.hpp> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <basic/basmgr.hxx> #include <basic/sbstar.hxx> @@ -80,7 +81,7 @@ namespace basprov ::rtl::OUString BasicLibraryNodeImpl::getName( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return m_sLibName; } @@ -89,7 +90,7 @@ namespace basprov Sequence< Reference< browse::XBrowseNode > > BasicLibraryNodeImpl::getChildNodes( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Sequence< Reference< browse::XBrowseNode > > aChildNodes; @@ -123,7 +124,7 @@ namespace basprov sal_Bool BasicLibraryNodeImpl::hasChildNodes( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; sal_Bool bReturn = sal_False; if ( m_xLibrary.is() ) @@ -136,7 +137,7 @@ namespace basprov sal_Int16 BasicLibraryNodeImpl::getType( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return browse::BrowseNodeTypes::CONTAINER; } @@ -146,3 +147,5 @@ namespace basprov //......................................................................... } // namespace basprov //......................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/basprov/baslibnode.hxx b/scripting/source/basprov/baslibnode.hxx index fb74315660..1e9b8167bd 100644 --- a/scripting/source/basprov/baslibnode.hxx +++ b/scripting/source/basprov/baslibnode.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -85,3 +86,5 @@ namespace basprov //......................................................................... #endif // SCRIPTING_BASLIBNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/basprov/basmethnode.cxx b/scripting/source/basprov/basmethnode.cxx index 49e85cceca..2638a3cc30 100644 --- a/scripting/source/basprov/basmethnode.cxx +++ b/scripting/source/basprov/basmethnode.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,7 +35,7 @@ #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/lang/XMultiComponentFactory.hpp> #include <com/sun/star/script/browse/BrowseNodeTypes.hpp> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <basic/sbstar.hxx> #include <basic/sbmeth.hxx> @@ -86,17 +87,17 @@ namespace basprov StarBASIC* pBasic = static_cast< StarBASIC* >( pModule->GetParent() ); if ( pBasic ) { - m_sURI = ::rtl::OUString::createFromAscii( "vnd.sun.star.script:" ); + m_sURI = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.script:")); m_sURI += pBasic->GetName(); - m_sURI += ::rtl::OUString::createFromAscii( "." ); + m_sURI += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".")); m_sURI += pModule->GetName(); - m_sURI += ::rtl::OUString::createFromAscii( "." ); + m_sURI += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".")); m_sURI += m_pMethod->GetName(); - m_sURI += ::rtl::OUString::createFromAscii( "?language=Basic&location=" ); + m_sURI += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("?language=Basic&location=")); if ( m_bIsAppScript ) - m_sURI += ::rtl::OUString::createFromAscii( "application" ); + m_sURI += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("application")); else - m_sURI += ::rtl::OUString::createFromAscii( "document" ); + m_sURI += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("document")); } } } @@ -129,7 +130,7 @@ namespace basprov ::rtl::OUString BasicMethodNodeImpl::getName( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; ::rtl::OUString sMethodName; if ( m_pMethod ) @@ -142,7 +143,7 @@ namespace basprov Sequence< Reference< browse::XBrowseNode > > BasicMethodNodeImpl::getChildNodes( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return Sequence< Reference< browse::XBrowseNode > >(); } @@ -151,7 +152,7 @@ namespace basprov sal_Bool BasicMethodNodeImpl::hasChildNodes( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return sal_False; } @@ -160,7 +161,7 @@ namespace basprov sal_Int16 BasicMethodNodeImpl::getType( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return browse::BrowseNodeTypes::SCRIPT; } @@ -235,7 +236,7 @@ namespace basprov for ( sal_Int32 i = 0; i < nProps; ++i ) { // TODO: according to MBA the property 'Title' may change in future - if ( pProps[i].Name == ::rtl::OUString::createFromAscii( "Title" ) ) + if ( pProps[i].Name == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")) ) { pProps[i].Value >>= sDocURL; break; @@ -279,17 +280,17 @@ namespace basprov if ( xHelper.is() ) { Sequence < PropertyValue > aArgs(7); - aArgs[0].Name = ::rtl::OUString::createFromAscii( "Document" ); + aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Document")); aArgs[0].Value <<= sDocURL; - aArgs[1].Name = ::rtl::OUString::createFromAscii( "LibName" ); + aArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LibName")); aArgs[1].Value <<= sLibName; - aArgs[2].Name = ::rtl::OUString::createFromAscii( "Name" ); + aArgs[2].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); aArgs[2].Value <<= sModName; - aArgs[3].Name = ::rtl::OUString::createFromAscii( "Type" ); - aArgs[3].Value <<= ::rtl::OUString::createFromAscii( "Module" ); - aArgs[4].Name = ::rtl::OUString::createFromAscii( "Line" ); + aArgs[3].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Type")); + aArgs[3].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Module")); + aArgs[4].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Line")); aArgs[4].Value <<= static_cast< sal_uInt32 >( nLine1 ); - xHelper->executeDispatch( xProv, ::rtl::OUString::createFromAscii( ".uno:BasicIDEAppear" ), ::rtl::OUString(), 0, aArgs ); + xHelper->executeDispatch( xProv, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:BasicIDEAppear")), ::rtl::OUString(), 0, aArgs ); } } } @@ -356,3 +357,5 @@ namespace basprov //......................................................................... } // namespace basprov //......................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/basprov/basmethnode.hxx b/scripting/source/basprov/basmethnode.hxx index 0ef02816dc..298447c2a8 100644 --- a/scripting/source/basprov/basmethnode.hxx +++ b/scripting/source/basprov/basmethnode.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -130,3 +131,5 @@ namespace basprov //......................................................................... #endif // SCRIPTING_BASMETHNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/basprov/basmodnode.cxx b/scripting/source/basprov/basmodnode.cxx index f56bc33519..0a68d53228 100644 --- a/scripting/source/basprov/basmodnode.cxx +++ b/scripting/source/basprov/basmodnode.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,7 +31,7 @@ #include "basmodnode.hxx" #include "basmethnode.hxx" #include <com/sun/star/script/browse/BrowseNodeTypes.hpp> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <basic/sbx.hxx> #include <basic/sbstar.hxx> @@ -74,7 +75,7 @@ namespace basprov ::rtl::OUString BasicModuleNodeImpl::getName( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; ::rtl::OUString sModuleName; if ( m_pModule ) @@ -87,7 +88,7 @@ namespace basprov Sequence< Reference< browse::XBrowseNode > > BasicModuleNodeImpl::getChildNodes( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Sequence< Reference< browse::XBrowseNode > > aChildNodes; @@ -124,7 +125,7 @@ namespace basprov sal_Bool BasicModuleNodeImpl::hasChildNodes( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; sal_Bool bReturn = sal_False; if ( m_pModule ) @@ -141,7 +142,7 @@ namespace basprov sal_Int16 BasicModuleNodeImpl::getType( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return browse::BrowseNodeTypes::CONTAINER; } @@ -151,3 +152,5 @@ namespace basprov //......................................................................... } // namespace basprov //......................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/basprov/basmodnode.hxx b/scripting/source/basprov/basmodnode.hxx index 5b2e50b124..7dcfd964ed 100644 --- a/scripting/source/basprov/basmodnode.hxx +++ b/scripting/source/basprov/basmodnode.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,3 +80,5 @@ namespace basprov //......................................................................... #endif // SCRIPTING_BASMODNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx index 1cc4b2a889..9341850440 100644 --- a/scripting/source/basprov/basprov.cxx +++ b/scripting/source/basprov/basprov.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,13 +36,11 @@ #include <com/sun/star/script/provider/ScriptFrameworkErrorType.hpp> #include <com/sun/star/document/XEmbeddedScripts.hpp> -#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_ #include <cppuhelper/implementationentry.hxx> -#endif #include <rtl/uri.hxx> #include <osl/process.h> #include <osl/file.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <basic/sbx.hxx> #include <basic/basmgr.hxx> @@ -151,12 +150,12 @@ namespace basprov Reference< lang::XMultiComponentFactory > xSMgr( m_xContext->getServiceManager() ); if ( xSMgr.is() ) { - xUriFac.set( xSMgr->createInstanceWithContext( ::rtl::OUString::createFromAscii( - "com.sun.star.uri.UriReferenceFactory" ), m_xContext ), UNO_QUERY ); + xUriFac.set( xSMgr->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.uri.UriReferenceFactory" )), m_xContext ), UNO_QUERY ); } if ( xUriFac.is() ) - { + { ::rtl::OUString aLinkURL( xLibContainer->getLibraryLinkURL( rLibName ) ); Reference< uri::XUriReference > xUriRef( xUriFac->parse( aLinkURL ), UNO_QUERY ); @@ -174,10 +173,10 @@ namespace basprov { ::rtl::OUString aDecodedURL( aAuthority.copy( sizeof ( "vnd.sun.star.expand:" ) - 1 ) ); aDecodedURL = ::rtl::Uri::decode( aDecodedURL, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ); - Reference<util::XMacroExpander> xMacroExpander( - m_xContext->getValueByName( - ::rtl::OUString::createFromAscii( "/singletons/com.sun.star.util.theMacroExpander" ) ), - UNO_QUERY ); + Reference<util::XMacroExpander> xMacroExpander( + m_xContext->getValueByName( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.util.theMacroExpander")) ), + UNO_QUERY ); if ( xMacroExpander.is() ) aFileURL = xMacroExpander->expandMacros( aDecodedURL ); } @@ -196,7 +195,7 @@ namespace basprov ::rtl::OUString aSearchURL1( RTL_CONSTASCII_USTRINGPARAM( "share/basic" ) ); ::rtl::OUString aSearchURL2( RTL_CONSTASCII_USTRINGPARAM( "share/uno_packages" ) ); - if( aCanonicalFileURL.indexOf( aSearchURL1 ) != -1 || aCanonicalFileURL.indexOf( aSearchURL2 ) != -1 ) + if( aCanonicalFileURL.indexOf( aSearchURL1 ) != -1 || aCanonicalFileURL.indexOf( aSearchURL2 ) != -1 ) bIsShared = true; } } @@ -241,7 +240,7 @@ namespace basprov { // TODO - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( aArguments.getLength() != 1 ) { @@ -329,18 +328,18 @@ namespace basprov // XScriptProvider // ----------------------------------------------------------------------------- - Reference < provider::XScript > BasicProviderImpl::getScript( const ::rtl::OUString& scriptURI ) + Reference < provider::XScript > BasicProviderImpl::getScript( const ::rtl::OUString& scriptURI ) throw ( provider::ScriptFrameworkErrorException, RuntimeException) { // TODO - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Reference< provider::XScript > xScript; Reference< lang::XMultiComponentFactory > xMcFac ( m_xContext->getServiceManager() ); Reference< uri::XUriReferenceFactory > xFac ( - xMcFac->createInstanceWithContext( rtl::OUString::createFromAscii( - "com.sun.star.uri.UriReferenceFactory"), m_xContext ) , UNO_QUERY ); + xMcFac->createInstanceWithContext( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.uri.UriReferenceFactory")), m_xContext ) , UNO_QUERY ); if ( !xFac.is() ) { @@ -349,7 +348,7 @@ namespace basprov scriptURI, OUSTR("Basic"), provider::ScriptFrameworkErrorType::UNKNOWN ); } - + Reference< uri::XUriReference > uriRef( xFac->parse( scriptURI ), UNO_QUERY ); @@ -357,7 +356,7 @@ namespace basprov if ( !uriRef.is() || !sfUri.is() ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "BasicProviderImpl::getScript: failed to parse URI: " ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("BasicProviderImpl::getScript: failed to parse URI: ")); errorMsg = errorMsg.concat( scriptURI ); throw provider::ScriptFrameworkErrorException( errorMsg, Reference< XInterface >(), @@ -365,13 +364,39 @@ namespace basprov provider::ScriptFrameworkErrorType::MALFORMED_URL ); } - + ::rtl::OUString aDescription = sfUri->getName(); - ::rtl::OUString aLocation = sfUri->getParameter( - ::rtl::OUString::createFromAscii( "location" ) ); + ::rtl::OUString aLocation = sfUri->getParameter( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("location")) ); sal_Int32 nIndex = 0; - ::rtl::OUString aLibrary = aDescription.getToken( 0, (sal_Unicode)'.', nIndex ); + // In some strange circumstances the Library name can have an + // apparantly illegal '.' in it ( in imported VBA ) + + BasicManager* pBasicMgr = NULL; + if ( aLocation.equals( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("document")) ) ) + { + pBasicMgr = m_pDocBasicManager; + } + else if ( aLocation.equals( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("application")) ) ) + { + pBasicMgr = m_pAppBasicManager; + } + rtl::OUString sProjectName; + if ( pBasicMgr ) + sProjectName = pBasicMgr->GetName(); + + ::rtl::OUString aLibrary; + if ( sProjectName.getLength() && aDescription.match( sProjectName ) ) + { + OSL_TRACE("LibraryName %s is part of the url %s", + rtl::OUStringToOString( sProjectName, RTL_TEXTENCODING_UTF8 ).getStr(), + rtl::OUStringToOString( aDescription, RTL_TEXTENCODING_UTF8 ).getStr() ); + aLibrary = sProjectName; + nIndex = sProjectName.getLength() + 1; + } + else + aLibrary = aDescription.getToken( 0, (sal_Unicode)'.', nIndex ); ::rtl::OUString aModule; if ( nIndex != -1 ) aModule = aDescription.getToken( 0, (sal_Unicode)'.', nIndex ); @@ -381,15 +406,6 @@ namespace basprov if ( aLibrary.getLength() != 0 && aModule.getLength() != 0 && aMethod.getLength() != 0 && aLocation.getLength() != 0 ) { - BasicManager* pBasicMgr = NULL; - if ( aLocation.equals( ::rtl::OUString::createFromAscii("document") ) ) - { - pBasicMgr = m_pDocBasicManager; - } - else if ( aLocation.equals( ::rtl::OUString::createFromAscii("application") ) ) - { - pBasicMgr = m_pAppBasicManager; - } if ( pBasicMgr ) { @@ -451,23 +467,23 @@ namespace basprov { // TODO - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; - return ::rtl::OUString::createFromAscii( "Basic" ); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Basic")); } // ----------------------------------------------------------------------------- Sequence< Reference< browse::XBrowseNode > > BasicProviderImpl::getChildNodes( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Reference< script::XLibraryContainer > xLibContainer; BasicManager* pBasicManager = NULL; if ( m_bIsAppScriptCtx ) { - xLibContainer = m_xLibContainerApp; + xLibContainer = m_xLibContainerApp; pBasicManager = m_pAppBasicManager; } else @@ -476,7 +492,7 @@ namespace basprov pBasicManager = m_pDocBasicManager; } - Sequence< Reference< browse::XBrowseNode > > aChildNodes; + Sequence< Reference< browse::XBrowseNode > > aChildNodes; if ( pBasicManager && xLibContainer.is() ) { @@ -502,7 +518,7 @@ namespace basprov } if ( bCreate ) { - pChildNodes[childsFound++] = static_cast< browse::XBrowseNode* >( new BasicLibraryNodeImpl( + pChildNodes[childsFound++] = static_cast< browse::XBrowseNode* >( new BasicLibraryNodeImpl( m_xContext, m_sScriptingContext, pBasicManager, xLibContainer, pLibNames[i], m_bIsAppScriptCtx ) ); } } @@ -518,13 +534,13 @@ namespace basprov sal_Bool BasicProviderImpl::hasChildNodes( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; sal_Bool bReturn = sal_False; Reference< script::XLibraryContainer > xLibContainer; if ( m_bIsAppScriptCtx ) { - xLibContainer = m_xLibContainerApp; + xLibContainer = m_xLibContainerApp; } else { @@ -540,7 +556,7 @@ namespace basprov sal_Int16 BasicProviderImpl::getType( ) throw (RuntimeException) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; return browse::BrowseNodeTypes::CONTAINER; } @@ -581,7 +597,7 @@ namespace basprov extern "C" { - SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( + SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) { (void)ppEnv; @@ -593,7 +609,9 @@ extern "C" const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) { - return ::cppu::component_getFactoryHelper( + return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, ::basprov::s_component_entries ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/basprov/basprov.hxx b/scripting/source/basprov/basprov.hxx index 9ef21da4d0..8507346561 100644 --- a/scripting/source/basprov/basprov.hxx +++ b/scripting/source/basprov/basprov.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -113,3 +114,5 @@ namespace basprov //......................................................................... #endif // SCRIPTING_BASPROV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx index 06f58b94bf..d38f78aec2 100644 --- a/scripting/source/basprov/basscript.cxx +++ b/scripting/source/basprov/basscript.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_scripting.hxx" #include "basscript.hxx" -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <basic/sbx.hxx> #include <basic/sbstar.hxx> @@ -36,7 +37,10 @@ #include <basic/sbmeth.hxx> #include <basic/basmgr.hxx> #include <com/sun/star/script/provider/ScriptFrameworkErrorType.hpp> - +#include "bcholder.hxx" +#include <comphelper/proparrhlp.hxx> +#include <comphelper/propertycontainer.hxx> +#include <com/sun/star/beans/PropertyAttribute.hpp> #include <map> @@ -45,6 +49,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::script; using namespace ::com::sun::star::document; +using namespace ::com::sun::star::beans; extern ::com::sun::star::uno::Any sbxToUnoValue( SbxVariable* pVar ); extern void unoToSbxValue( SbxVariable* pVar, const ::com::sun::star::uno::Any& aValue ); @@ -54,6 +59,10 @@ extern void unoToSbxValue( SbxVariable* pVar, const ::com::sun::star::uno::Any& namespace basprov { //......................................................................... +#define BASSCRIPT_PROPERTY_ID_CALLER 1 +#define BASSCRIPT_PROPERTY_CALLER ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Caller" ) ) + +#define BASSCRIPT_DEFAULT_ATTRIBS() PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT typedef ::std::map< sal_Int16, Any, ::std::less< sal_Int16 > > OutParamMap; @@ -64,18 +73,22 @@ namespace basprov // ----------------------------------------------------------------------------- BasicScriptImpl::BasicScriptImpl( const ::rtl::OUString& funcName, SbMethodRef xMethod ) - :m_xMethod( xMethod ) + : ::scripting_helper::OBroadcastHelperHolder( m_aMutex ) + ,OPropertyContainer( GetBroadcastHelper() ) + ,m_xMethod( xMethod ) ,m_funcName( funcName ) ,m_documentBasicManager( NULL ) ,m_xDocumentScriptContext() { + registerProperty( BASSCRIPT_PROPERTY_CALLER, BASSCRIPT_PROPERTY_ID_CALLER, BASSCRIPT_DEFAULT_ATTRIBS(), &m_caller, ::getCppuType( &m_caller ) ); } // ----------------------------------------------------------------------------- BasicScriptImpl::BasicScriptImpl( const ::rtl::OUString& funcName, SbMethodRef xMethod, - BasicManager& documentBasicManager, const Reference< XScriptInvocationContext >& documentScriptContext ) - :m_xMethod( xMethod ) + BasicManager& documentBasicManager, const Reference< XScriptInvocationContext >& documentScriptContext ) : ::scripting_helper::OBroadcastHelperHolder( m_aMutex ) + ,OPropertyContainer( GetBroadcastHelper() ) + ,m_xMethod( xMethod ) ,m_funcName( funcName ) ,m_documentBasicManager( &documentBasicManager ) ,m_xDocumentScriptContext( documentScriptContext ) @@ -110,6 +123,48 @@ namespace basprov } // ----------------------------------------------------------------------------- + // XInterface + // ----------------------------------------------------------------------------- + + IMPLEMENT_FORWARD_XINTERFACE2( BasicScriptImpl, BasicScriptImpl_BASE, OPropertyContainer ) + + // ----------------------------------------------------------------------------- + // XTypeProvider + // ----------------------------------------------------------------------------- + + IMPLEMENT_FORWARD_XTYPEPROVIDER2( BasicScriptImpl, BasicScriptImpl_BASE, OPropertyContainer ) + + // ----------------------------------------------------------------------------- + // OPropertySetHelper + // ----------------------------------------------------------------------------- + + ::cppu::IPropertyArrayHelper& BasicScriptImpl::getInfoHelper( ) + { + return *getArrayHelper(); + } + + // ----------------------------------------------------------------------------- + // OPropertyArrayUsageHelper + // ----------------------------------------------------------------------------- + + ::cppu::IPropertyArrayHelper* BasicScriptImpl::createArrayHelper( ) const + { + Sequence< Property > aProps; + describeProperties( aProps ); + return new ::cppu::OPropertyArrayHelper( aProps ); + } + + // ----------------------------------------------------------------------------- + // XPropertySet + // ----------------------------------------------------------------------------- + + Reference< XPropertySetInfo > BasicScriptImpl::getPropertySetInfo( ) throw (RuntimeException) + { + Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); + return xInfo; + } + + // ----------------------------------------------------------------------------- // XScript // ----------------------------------------------------------------------------- @@ -119,7 +174,7 @@ namespace basprov // TODO: throw CannotConvertException // TODO: check length of aOutParamIndex, aOutParam - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; Any aReturn; @@ -134,7 +189,7 @@ namespace basprov sal_Int32 nParamsCount = aParams.getLength(); SbxInfo* pInfo = m_xMethod->GetInfo(); if ( pInfo ) - { + { sal_Int32 nSbxOptional = 0; USHORT n = 1; for ( const SbxParamInfo* pParamInfo = pInfo->GetParam( n ); pParamInfo; pParamInfo = pInfo->GetParam( ++n ) ) @@ -148,12 +203,12 @@ namespace basprov if ( nParamsCount < nSbxCount - nSbxOptional ) { throw provider::ScriptFrameworkErrorException( - ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "wrong number of parameters!" ) ), - Reference< XInterface >(), + Reference< XInterface >(), m_funcName, - ::rtl::OUString( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Basic" ) ), provider::ScriptFrameworkErrorType::NO_SUCH_SCRIPT ); } @@ -188,8 +243,14 @@ namespace basprov if ( m_documentBasicManager && m_xDocumentScriptContext.is() ) aOldThisComponent = m_documentBasicManager->SetGlobalUNOConstant( "ThisComponent", makeAny( m_xDocumentScriptContext ) ); + if ( m_caller.getLength() && m_caller[ 0 ].hasValue() ) + { + SbxVariableRef xCallerVar = new SbxVariable( SbxVARIANT ); + unoToSbxValue( static_cast< SbxVariable* >( xCallerVar ), m_caller[ 0 ] ); + nErr = m_xMethod->Call( xReturn, xCallerVar ); + } + else nErr = m_xMethod->Call( xReturn ); - if ( m_documentBasicManager && m_xDocumentScriptContext.is() ) m_documentBasicManager->SetGlobalUNOConstant( "ThisComponent", aOldThisComponent ); } @@ -203,8 +264,8 @@ namespace basprov { SbxInfo* pInfo_ = m_xMethod->GetInfo(); if ( pInfo_ ) - { - OutParamMap aOutParamMap; + { + OutParamMap aOutParamMap; for ( USHORT n = 1, nCount = xSbxParams->Count(); n < nCount; ++n ) { const SbxParamInfo* pParamInfo = pInfo_->GetParam( n ); @@ -238,7 +299,7 @@ namespace basprov m_xMethod->SetParameters( NULL ); } - return aReturn; + return aReturn; } // ----------------------------------------------------------------------------- @@ -246,3 +307,5 @@ namespace basprov //......................................................................... } // namespace basprov //......................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/basprov/basscript.hxx b/scripting/source/basprov/basscript.hxx index 99d351ee51..cbdaac88eb 100644 --- a/scripting/source/basprov/basscript.hxx +++ b/scripting/source/basprov/basscript.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,13 +29,15 @@ #ifndef SCRIPTING_BASSCRIPT_HXX #define SCRIPTING_BASSCRIPT_HXX +#include "bcholder.hxx" #include <com/sun/star/script/provider/XScript.hpp> #include <com/sun/star/document/XScriptInvocationContext.hpp> #include <cppuhelper/implbase1.hxx> +#include <comphelper/proparrhlp.hxx> +#include <comphelper/propertycontainer.hxx> #include <basic/sbmeth.hxx> #include <svl/lstner.hxx> - class BasicManager; //......................................................................... @@ -46,7 +49,7 @@ namespace basprov // class BasicScriptImpl // ---------------------------------------------------- - typedef ::cppu::WeakImplHelper1< + typedef ::cppu::WeakImplHelper1< ::com::sun::star::script::provider::XScript > BasicScriptImpl_BASE; @@ -58,6 +61,16 @@ namespace basprov BasicManager* m_documentBasicManager; ::com::sun::star::uno::Reference< ::com::sun::star::document::XScriptInvocationContext > m_xDocumentScriptContext; + // hack, OPropertyContainer doesn't allow you to define a property of unknown + // type ( I guess because an Any can't contain an Any... I've always wondered why? + // as its not unusual to do that in corba ) + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > m_caller; + protected: + // OPropertySetHelper + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper( ); + + // OPropertyArrayUsageHelper + virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; public: BasicScriptImpl( @@ -72,13 +85,19 @@ namespace basprov ); virtual ~BasicScriptImpl(); + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + // XScript virtual ::com::sun::star::uno::Any SAL_CALL invoke( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams, ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam ) - throw ( - ::com::sun::star::script::provider::ScriptFrameworkErrorException, + throw ( + ::com::sun::star::script::provider::ScriptFrameworkErrorException, ::com::sun::star::reflection::InvocationTargetException, ::com::sun::star::uno::RuntimeException ); @@ -91,3 +110,5 @@ namespace basprov //......................................................................... #endif // SCRIPTING_BASSCRIPT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx index 11a101454e..681793d6f0 100644 --- a/scripting/source/dlgprov/dlgevtatt.cxx +++ b/scripting/source/dlgprov/dlgevtatt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,6 +38,7 @@ #include <tools/diagnose_ex.h> #include <com/sun/star/awt/XControl.hpp> +#include <com/sun/star/awt/XControlContainer.hpp> #include <com/sun/star/awt/XDialogEventHandler.hpp> #include <com/sun/star/awt/XContainerWindowEventHandler.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -108,13 +110,14 @@ namespace dlgprov { protected: rtl::OUString msDialogCodeName; + rtl::OUString msDialogLibName; Reference< script::XScriptListener > mxListener; virtual void firing_impl( const script::ScriptEvent& aScriptEvent, uno::Any* pRet ); public: - DialogVBAScriptListenerImpl( const Reference< XComponentContext >& rxContext, const Reference< awt::XControl >& rxControl, const Reference< frame::XModel >& xModel ); + DialogVBAScriptListenerImpl( const Reference< XComponentContext >& rxContext, const Reference< awt::XControl >& rxControl, const Reference< frame::XModel >& xModel, const rtl::OUString& sDialogLibName ); }; - DialogVBAScriptListenerImpl::DialogVBAScriptListenerImpl( const Reference< XComponentContext >& rxContext, const Reference< awt::XControl >& rxControl, const Reference< frame::XModel >& xModel ) : DialogScriptListenerImpl( rxContext ) + DialogVBAScriptListenerImpl::DialogVBAScriptListenerImpl( const Reference< XComponentContext >& rxContext, const Reference< awt::XControl >& rxControl, const Reference< frame::XModel >& xModel, const rtl::OUString& sDialogLibName ) : DialogScriptListenerImpl( rxContext ), msDialogLibName( sDialogLibName ) { Reference< XMultiComponentFactory > xSMgr( m_xContext->getServiceManager() ); Sequence< Any > args(1); @@ -142,10 +145,10 @@ namespace dlgprov void DialogVBAScriptListenerImpl::firing_impl( const script::ScriptEvent& aScriptEvent, uno::Any* ) { - if ( aScriptEvent.ScriptType.equals( rtl::OUString::createFromAscii("VBAInterop") ) && mxListener.is() ) + if ( aScriptEvent.ScriptType.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VBAInterop")) ) && mxListener.is() ) { ScriptEvent aScriptEventCopy( aScriptEvent ); - aScriptEventCopy.ScriptCode = msDialogCodeName; + aScriptEventCopy.ScriptCode = msDialogLibName.concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ).concat( msDialogCodeName ); try { mxListener->firing( aScriptEventCopy ); @@ -169,7 +172,7 @@ namespace dlgprov // key listeners by protocol when ScriptType = 'Script' // otherwise key is the ScriptType e.g. StarBasic if ( rxRTLListener.is() ) // set up handler for RTL_BASIC - listernersForTypes[ rtl::OUString::createFromAscii("StarBasic") ] = rxRTLListener; + listernersForTypes[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StarBasic")) ] = rxRTLListener; else listernersForTypes[ rtl::OUString::createFromAscii("StarBasic") ] = new DialogLegacyScriptListenerImpl( rxContext, rxModel ); // handler for Script & ::rtl::OUString::createFromAscii( "vnd.sun.star.UNO:" ) @@ -229,6 +232,9 @@ namespace dlgprov Reference< container::XNameContainer > xEventCont = xEventsSupplier->getEvents(); Reference< XControlModel > xControlModel = xControl->getModel(); + Reference< XPropertySet > xProps( xControlModel, uno::UNO_QUERY ); + rtl::OUString sName; + xProps->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")) ) >>= sName; if ( xEventCont.is() ) { Sequence< ::rtl::OUString > aNames = xEventCont->getElementNames(); @@ -242,7 +248,7 @@ namespace dlgprov Any aElement = xEventCont->getByName( pNames[ j ] ); aElement >>= aDesc; rtl::OUString sKey = aDesc.ScriptType; - if ( aDesc.ScriptType.equals( rtl::OUString::createFromAscii("Script" ) ) || aDesc.ScriptType.equals( rtl::OUString::createFromAscii("UNO" ) ) ) + if ( aDesc.ScriptType.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Script")) ) || aDesc.ScriptType.equals( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UNO")) ) ) { sal_Int32 nIndex = aDesc.ScriptCode.indexOf( ':' ); sKey = aDesc.ScriptCode.copy( 0, nIndex ); @@ -285,6 +291,51 @@ namespace dlgprov } } + + void DialogEventsAttacherImpl::nestedAttachEvents( const Sequence< Reference< XInterface > >& Objects, const Any& Helper, rtl::OUString& sDialogCodeName ) + { + const Reference< XInterface >* pObjects = Objects.getConstArray(); + sal_Int32 nObjCount = Objects.getLength(); + + for ( sal_Int32 i = 0; i < nObjCount; ++i ) + { + // We know that we have to do with instances of XControl. + // Otherwise this is not the right implementation for + // XScriptEventsAttacher and we have to give up. + Reference< XControl > xControl( pObjects[ i ], UNO_QUERY ); + Reference< XControlContainer > xControlContainer( xControl, UNO_QUERY ); + Reference< XDialog > xDialog( xControl, UNO_QUERY ); + if ( !xControl.is() ) + throw IllegalArgumentException(); + + // get XEventsSupplier from control model + Reference< XControlModel > xControlModel = xControl->getModel(); + Reference< XScriptEventsSupplier > xEventsSupplier( xControlModel, UNO_QUERY ); + attachEventsToControl( xControl, xEventsSupplier, Helper ); + if ( mbUseFakeVBAEvents ) + { + xEventsSupplier.set( getFakeVbaEventsSupplier( xControl, sDialogCodeName ) ); + Any newHelper(xControl ); + attachEventsToControl( xControl, xEventsSupplier, newHelper ); + } + if ( xControlContainer.is() && !xDialog.is() ) + { + Sequence< Reference< XControl > > aControls = xControlContainer->getControls(); + sal_Int32 nControlCount = aControls.getLength(); + + Sequence< Reference< XInterface > > aObjects( nControlCount ); + Reference< XInterface >* pObjectsModify = aObjects.getArray(); + const Reference< XControl >* pControls = aControls.getConstArray(); + + for ( sal_Int32 j = 0; j < nControlCount; ++j ) + { + pObjectsModify[j] = Reference< XInterface >( pControls[j], UNO_QUERY ); + } + nestedAttachEvents( aObjects, Helper, sDialogCodeName ); + } + } + } + // ----------------------------------------------------------------------------- // XScriptEventsAttacher // ----------------------------------------------------------------------------- @@ -317,9 +368,7 @@ namespace dlgprov } } - - // go over all objects - const Reference< XInterface >* pObjects = Objects.getConstArray(); + rtl::OUString sDialogCodeName; sal_Int32 nObjCount = Objects.getLength(); Reference< awt::XControl > xDlgControl( Objects[ nObjCount - 1 ], uno::UNO_QUERY ); // last object is the dialog rtl::OUString sDialogCodeName; @@ -352,6 +401,8 @@ namespace dlgprov attachEventsToControl( xControl, xEventsSupplier, Helper ); } } + // go over all objects + nestedAttachEvents( Objects, Helper, sDialogCodeName ); } @@ -409,7 +460,7 @@ namespace dlgprov void DialogAllListenerImpl::firing( const AllEventObject& Event ) throw ( RuntimeException ) { - ::osl::MutexGuard aGuard( getMutex() ); + //::osl::MutexGuard aGuard( getMutex() ); firing_impl( Event, NULL ); } @@ -419,7 +470,7 @@ namespace dlgprov Any DialogAllListenerImpl::approveFiring( const AllEventObject& Event ) throw ( reflection::InvocationTargetException, RuntimeException ) { - ::osl::MutexGuard aGuard( getMutex() ); + //::osl::MutexGuard aGuard( getMutex() ); Any aReturn; firing_impl( Event, &aReturn ); @@ -477,7 +528,7 @@ namespace dlgprov if ( xFactory.is() ) { Any aCtx; - aCtx <<= ::rtl::OUString::createFromAscii( "user" ); + aCtx <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")); xScriptProvider.set( xFactory->createScriptProvider( aCtx ), UNO_QUERY ); } } @@ -535,7 +586,7 @@ namespace dlgprov void DialogUnoScriptListenerImpl::firing_impl( const ScriptEvent& aScriptEvent, Any* pRet ) { - static ::rtl::OUString sUnoURLScheme = ::rtl::OUString::createFromAscii( "vnd.sun.star.UNO:" ); + static ::rtl::OUString sUnoURLScheme(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.UNO:")); ::rtl::OUString sScriptCode( aScriptEvent.ScriptCode ); ::rtl::OUString aMethodName = aScriptEvent.ScriptCode.copy( sUnoURLScheme.getLength() ); @@ -655,7 +706,7 @@ namespace dlgprov void DialogScriptListenerImpl::firing( const ScriptEvent& aScriptEvent ) throw ( RuntimeException ) { - ::osl::MutexGuard aGuard( getMutex() ); + //::osl::MutexGuard aGuard( getMutex() ); firing_impl( aScriptEvent, NULL ); } @@ -665,7 +716,7 @@ namespace dlgprov Any DialogScriptListenerImpl::approveFiring( const ScriptEvent& aScriptEvent ) throw ( reflection::InvocationTargetException, RuntimeException ) { - ::osl::MutexGuard aGuard( getMutex() ); + //::osl::MutexGuard aGuard( getMutex() ); Any aReturn; firing_impl( aScriptEvent, &aReturn ); @@ -677,3 +728,5 @@ namespace dlgprov //......................................................................... } // namespace dlgprov //......................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/dlgprov/dlgevtatt.hxx b/scripting/source/dlgprov/dlgevtatt.hxx index c76ee093da..aeb1eddec2 100644 --- a/scripting/source/dlgprov/dlgevtatt.hxx +++ b/scripting/source/dlgprov/dlgevtatt.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,9 +36,7 @@ #include <com/sun/star/script/XScriptListener.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/awt/XControl.hpp> -#ifndef _COM_SUN_STAR_BEANS_XINTROSPECTION_HPP_ #include <com/sun/star/beans/XIntrospectionAccess.hpp> -#endif #include <cppuhelper/implbase1.hxx> #include <com/sun/star/script/XScriptEventsSupplier.hpp> @@ -78,7 +77,7 @@ namespace dlgprov const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xHandler, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XIntrospectionAccess >& xIntrospect, bool bProviderMode, - const ::com::sun::star::uno::Reference< ::com::sun::star::script::XScriptListener >& xRTLListener ); + const ::com::sun::star::uno::Reference< ::com::sun::star::script::XScriptListener >& xRTLListener ,const rtl::OUString& sDialogLibName ); virtual ~DialogEventsAttacherImpl(); // XScriptEventsAttacher @@ -162,3 +161,5 @@ namespace dlgprov //......................................................................... #endif // SCRIPTING_DLGEVT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx index 57aaffe256..ef607963f7 100644 --- a/scripting/source/dlgprov/dlgprov.cxx +++ b/scripting/source/dlgprov/dlgprov.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,7 +74,7 @@ namespace dlgprov { //......................................................................... -static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAscii( "ResourceResolver" ); +static ::rtl::OUString aResourceResolverPropName(RTL_CONSTASCII_USTRINGPARAM("ResourceResolver")); // ============================================================================= // component operations // ============================================================================= @@ -164,7 +165,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs Reference< resource::XStringResourceResolver > xStringResourceResolver = xStringResourceSupplier->getStringResource(); - xStringResourceManager = + xStringResourceManager = Reference< resource::XStringResourceManager >( xStringResourceResolver, UNO_QUERY ); } } @@ -178,8 +179,8 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs return xControlModel; } - Reference< container::XNameContainer > DialogProviderImpl::createDialogModel( - const Reference< io::XInputStream >& xInput, + Reference< container::XNameContainer > DialogProviderImpl::createDialogModel( + const Reference< io::XInputStream >& xInput, const Reference< resource::XStringResourceManager >& xStringResourceManager, const Any &aDialogSourceURL) throw ( Exception ) { @@ -189,7 +190,15 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs Reference< beans::XPropertySet > xDlgPropSet( xDialogModel, UNO_QUERY ); xDlgPropSet->setPropertyValue( aDlgSrcUrlPropName, aDialogSourceURL ); - ::xmlscript::importDialogModel( xInput, xDialogModel, m_xContext ); + // #TODO we really need to detect the source of the Dialog, is it + // located in the document or not. m_xModel need not be the location of + // the dialog. E.g. if the dialog was created from basic ( then we just + // can't tell where its from ) + // If we are happy to always substitute the form model for the awt + // one then maybe the presence of a document model is enough to trigger + // swapping out the models ( or perhaps we only want to do this + // for vba mode ) there are a number of feasible and valid possibilities + ::xmlscript::importDialogModel( xInput, xDialogModel, m_xContext, m_xModel ); // Set resource property if( xStringResourceManager.is() ) { @@ -198,17 +207,17 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs aStringResourceManagerAny <<= xStringResourceManager; xDlgPSet->setPropertyValue( aResourceResolverPropName, aStringResourceManagerAny ); } - - return xDialogModel; + + return xDialogModel; } Reference< XControlModel > DialogProviderImpl::createDialogModelForBasic() throw ( Exception ) { - if ( !m_BasicInfo.get() ) - // shouln't get here + if ( !m_BasicInfo.get() ) + // shouln't get here throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("No information to create dialog" ) ), Reference< XInterface >() ); Reference< resource::XStringResourceManager > xStringResourceManager = getStringResourceFromDialogLibrary( m_BasicInfo->mxDlgLib ); - + rtl::OUString aURL(RTL_CONSTASCII_USTRINGPARAM("" )); Any aDialogSourceURL; aDialogSourceURL <<= aURL; @@ -225,7 +234,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs // TODO: use URL parsing class // TODO: decoding of location Reference< XMultiComponentFactory > xSMgr( m_xContext->getServiceManager(), UNO_QUERY ); - + if ( !xSMgr.is() ) { throw RuntimeException( @@ -234,17 +243,17 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs } Reference< uri::XUriReferenceFactory > xFac ( - xSMgr->createInstanceWithContext( rtl::OUString::createFromAscii( - "com.sun.star.uri.UriReferenceFactory"), m_xContext ) , UNO_QUERY ); + xSMgr->createInstanceWithContext( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.uri.UriReferenceFactory")), m_xContext ) , UNO_QUERY ); if ( !xFac.is() ) { throw RuntimeException( - ::rtl::OUString::createFromAscii( "DialogProviderImpl::getDialogModel(), could not instatiate UriReferenceFactory." ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogProviderImpl::getDialogModel(), could not instatiate UriReferenceFactory.")), Reference< XInterface >() ); } - // i75778: Support non-script URLs + // i75778: Support non-script URLs Reference< io::XInputStream > xInput; Reference< container::XNameContainer > xDialogLib; @@ -253,7 +262,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs Reference< util::XMacroExpander > xMacroExpander( m_xContext->getValueByName( - ::rtl::OUString::createFromAscii( "/singletons/com.sun.star.util.theMacroExpander" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.util.theMacroExpander")) ), UNO_QUERY_THROW ); Reference< uri::XUriReference > uriRef; @@ -262,7 +271,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs uriRef = Reference< uri::XUriReference >( xFac->parse( aURL ), UNO_QUERY ); if ( !uriRef.is() ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "DialogProviderImpl::getDialogModel: failed to parse URI: " ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("DialogProviderImpl::getDialogModel: failed to parse URI: ")); errorMsg += aURL; throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 1 ); @@ -282,7 +291,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs // Try any other URL with SimpleFileAccess Reference< ::com::sun::star::ucb::XSimpleFileAccess > xSFI = Reference< ::com::sun::star::ucb::XSimpleFileAccess >( xSMgr->createInstanceWithContext - ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), m_xContext ), UNO_QUERY ); + ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), m_xContext ), UNO_QUERY ); try { @@ -294,7 +303,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs else { ::rtl::OUString sDescription = sfUri->getName(); - + sal_Int32 nIndex = 0; ::rtl::OUString sLibName = sDescription.getToken( 0, (sal_Unicode)'.', nIndex ); @@ -303,18 +312,18 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs sDlgName = sDescription.getToken( 0, (sal_Unicode)'.', nIndex ); ::rtl::OUString sLocation = sfUri->getParameter( - ::rtl::OUString::createFromAscii( "location" ) ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("location")) ); // get dialog library container // TODO: dialogs in packages Reference< XLibraryContainer > xLibContainer; - if ( sLocation == ::rtl::OUString::createFromAscii( "application" ) ) + if ( sLocation == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("application")) ) { xLibContainer = Reference< XLibraryContainer >( SFX_APP()->GetDialogContainer(), UNO_QUERY ); } - else if ( sLocation == ::rtl::OUString::createFromAscii( "document" ) ) + else if ( sLocation == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("document")) ) { Reference< XEmbeddedScripts > xDocumentScripts( m_xModel, UNO_QUERY ); if ( xDocumentScripts.is() ) @@ -403,6 +412,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs if ( xISP.is() ) xInput = xISP->createInputStream(); + msDialogLibName = sLibName; } // import dialog model @@ -432,7 +442,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs Reference< XMultiComponentFactory > xSMgr_( m_xContext->getServiceManager(), UNO_QUERY_THROW ); // TODO: Ctor xStringResourceManager = Reference< resource::XStringResourceManager >( xSMgr_->createInstanceWithContext - ( ::rtl::OUString::createFromAscii( "com.sun.star.resource.StringResourceWithLocation" ), + ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.resource.StringResourceWithLocation")), m_xContext ), UNO_QUERY ); if( xStringResourceManager.is() ) { @@ -448,7 +458,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs Any aDialogSourceURLAny; aDialogSourceURLAny <<= aURL; - + Reference< container::XNameContainer > xDialogModel( createDialogModel( xInput , xStringResourceManager, aDialogSourceURLAny ), UNO_QUERY_THROW); xCtrlModel = Reference< XControlModel >( xDialogModel, UNO_QUERY ); @@ -503,7 +513,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs } // create a peer - Reference< XToolkit> xToolkit( xSMgr->createInstanceWithContext( + Reference< XToolkit> xToolkit( xSMgr->createInstanceWithContext( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ), m_xContext ), UNO_QUERY ); if ( xToolkit.is() ) xDialogControl->createPeer( xToolkit, xPeer ); @@ -516,7 +526,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs // ----------------------------------------------------------------------------- - void DialogProviderImpl::attachControlEvents( + void DialogProviderImpl::attachControlEvents( const Reference< XControl >& rxControl, const Reference< XInterface >& rxHandler, const Reference< XIntrospectionAccess >& rxIntrospectionAccess, @@ -543,8 +553,8 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs pObjects[nControlCount] = Reference< XInterface >( rxControl, UNO_QUERY ); Reference< XScriptEventsAttacher > xScriptEventsAttacher = new DialogEventsAttacherImpl - ( m_xContext, m_xModel, rxControl, rxHandler, rxIntrospectionAccess, - bDialogProviderMode, ( m_BasicInfo.get() ? m_BasicInfo->mxBasicRTLListener : NULL ) ); + ( m_xContext, m_xModel, rxControl, rxHandler, rxIntrospectionAccess, + bDialogProviderMode, ( m_BasicInfo.get() ? m_BasicInfo->mxBasicRTLListener : NULL ), msDialogLibName ); Any aHelper; xScriptEventsAttacher->attachEvents( aObjects, Reference< XScriptListener >(), aHelper ); @@ -572,7 +582,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs // Get introspection service Reference< XInterface > xI = xSMgr->createInstanceWithContext - ( rtl::OUString::createFromAscii("com.sun.star.beans.Introspection"), m_xContext ); + ( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.beans.Introspection")), m_xContext ); if (xI.is()) xIntrospection = Reference< XIntrospection >::query( xI ); } @@ -649,7 +659,10 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs aArguments[0] >>= m_xModel; m_BasicInfo.reset( new BasicRTLParams() ); m_BasicInfo->mxInput.set( aArguments[ 1 ], UNO_QUERY_THROW ); - m_BasicInfo->mxDlgLib.set( aArguments[ 2 ], UNO_QUERY_THROW ); + // allow null mxDlgLib, a document dialog instantiated from + // from application basic is unable to provide ( or find ) it's + // Library + aArguments[ 2 ] >>= m_BasicInfo->mxDlgLib; // leave the possibility to optionally allow the old dialog creation // to use the new XScriptListener ( which converts the old style macro // to a SF url ) @@ -667,10 +680,8 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs // XDialogProvider // ----------------------------------------------------------------------------- - static ::rtl::OUString aDecorationPropName = - ::rtl::OUString::createFromAscii( "Decoration" ); - static ::rtl::OUString aTitlePropName = - ::rtl::OUString::createFromAscii( "Title" ); + static ::rtl::OUString aDecorationPropName(RTL_CONSTASCII_USTRINGPARAM("Decoration")); + static ::rtl::OUString aTitlePropName(RTL_CONSTASCII_USTRINGPARAM("Title")); Reference < XControl > DialogProviderImpl::createDialogImpl( const ::rtl::OUString& URL, const Reference< XInterface >& xHandler, @@ -845,7 +856,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs extern "C" { - void SAL_CALL component_getImplementationEnvironment( + void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) { (void)ppEnv; @@ -857,7 +868,9 @@ extern "C" const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) { - return ::cppu::component_getFactoryHelper( + return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, ::dlgprov::s_component_entries ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/dlgprov/dlgprov.hxx b/scripting/source/dlgprov/dlgprov.hxx index 82faef2f86..8189f7955c 100644 --- a/scripting/source/dlgprov/dlgprov.hxx +++ b/scripting/source/dlgprov/dlgprov.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,7 +63,7 @@ namespace dlgprov // class DialogProviderImpl // ============================================================================= - typedef ::cppu::WeakImplHelper4< + typedef ::cppu::WeakImplHelper4< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::lang::XInitialization, ::com::sun::star::awt::XDialogProvider2, @@ -81,10 +82,10 @@ namespace dlgprov ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel; - + rtl::OUString msDialogLibName; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > createDialogModel( const ::rtl::OUString& sURL ); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > createDialogControl( + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > createDialogControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxDialogModel, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParent ); @@ -92,19 +93,19 @@ namespace dlgprov const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxHandler, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XIntrospectionAccess >& rxIntrospectionAccess, bool bDialogProviderMode ); - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XIntrospectionAccess > inspectHandler( + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XIntrospectionAccess > inspectHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxHandler ); // helper methods ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createControlModel() throw ( ::com::sun::star::uno::Exception ); - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createDialogModel( - const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInput, + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createDialogModel( + const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInput, const ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceManager >& xStringResourceManager, const ::com::sun::star::uno::Any &aDialogSourceURL) throw ( ::com::sun::star::uno::Exception ); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > createDialogModelForBasic() throw ( ::com::sun::star::uno::Exception ); // XDialogProvider / XDialogProvider2 impl method virtual ::com::sun::star::uno::Reference < ::com::sun::star::awt::XControl > SAL_CALL createDialogImpl( - const ::rtl::OUString& URL, + const ::rtl::OUString& URL, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xHandler, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParent, bool bDialogProviderMode ) @@ -116,25 +117,25 @@ namespace dlgprov virtual ~DialogProviderImpl(); // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); // XInitialization - virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) + virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); // XDialogProvider - virtual ::com::sun::star::uno::Reference < ::com::sun::star::awt::XDialog > SAL_CALL createDialog( + virtual ::com::sun::star::uno::Reference < ::com::sun::star::awt::XDialog > SAL_CALL createDialog( const ::rtl::OUString& URL ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); // XDialogProvider2 virtual ::com::sun::star::uno::Reference < ::com::sun::star::awt::XDialog > SAL_CALL createDialogWithHandler( - const ::rtl::OUString& URL, + const ::rtl::OUString& URL, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xHandler ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); @@ -155,3 +156,5 @@ namespace dlgprov //......................................................................... #endif // SCRIPTING_DLGPROV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/inc/bcholder.hxx b/scripting/source/inc/bcholder.hxx index cb955d910e..5d87a00801 100644 --- a/scripting/source/inc/bcholder.hxx +++ b/scripting/source/inc/bcholder.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -68,3 +69,5 @@ namespace scripting_helper //......................................................................... #endif // SCRIPTING_BCHOLDER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/inc/util/MiscUtils.hxx b/scripting/source/inc/util/MiscUtils.hxx index 44e03b67cd..ddedb48cfe 100644 --- a/scripting/source/inc/util/MiscUtils.hxx +++ b/scripting/source/inc/util/MiscUtils.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -175,3 +176,5 @@ static ::rtl::OUString parseLocationName( const ::rtl::OUString& location ) }; } // namespace sf_misc #endif // + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/inc/util/scriptingconstants.hxx b/scripting/source/inc/util/scriptingconstants.hxx index 5799fe95c0..5153f4a45e 100644 --- a/scripting/source/inc/util/scriptingconstants.hxx +++ b/scripting/source/inc/util/scriptingconstants.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,3 +78,5 @@ private: } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/inc/util/util.hxx b/scripting/source/inc/util/util.hxx index 84d51f85d8..fb3bcb062b 100644 --- a/scripting/source/inc/util/util.hxx +++ b/scripting/source/inc/util/util.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -32,7 +33,7 @@ #include <rtl/ustrbuf.hxx> #include <osl/diagnose.h> -#define OUSTR(x) ::rtl::OUString( ::rtl::OUString::createFromAscii(x) ) +#define OUSTR(x) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(x) ) namespace scripting_util { @@ -42,8 +43,10 @@ namespace scripting_util if(!xRef.is()) { - throw ::com::sun::star::uno::RuntimeException(OUSTR(Msg), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >()); + throw ::com::sun::star::uno::RuntimeException(::rtl::OUString::createFromAscii(Msg), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >()); } } } #endif //_COM_SUN_STAR_SCRIPTING_UTIL_UTIL_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx index e8c45b5d88..b9496ff185 100644 --- a/scripting/source/protocolhandler/scripthandler.cxx +++ b/scripting/source/protocolhandler/scripthandler.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -113,8 +114,8 @@ Reference< XDispatch > SAL_CALL ScriptProtocolHandler::queryDispatch( // get scheme of url Reference< uri::XUriReferenceFactory > xFac ( - m_xFactory->createInstance( rtl::OUString::createFromAscii( - "com.sun.star.uri.UriReferenceFactory") ) , UNO_QUERY ); + m_xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.uri.UriReferenceFactory")) ) , UNO_QUERY ); if ( xFac.is() ) { Reference< uri::XUriReference > uriRef( @@ -162,7 +163,7 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification( { try { - bool bIsDocumentScript = ( aURL.Complete.indexOf( ::rtl::OUString::createFromAscii( "document" ) ) !=-1 ); + bool bIsDocumentScript = ( aURL.Complete.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("document")) ) !=-1 ); // TODO: isn't this somewhat strange? This should be a test for a location=document parameter, shouldn't it? if ( bIsDocumentScript ) @@ -251,8 +252,8 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification( #ifdef _DEBUG catch ( ... ) { - ::rtl::OUString reason = ::rtl::OUString::createFromAscii( - "ScriptProtocolHandler::dispatch: caught unknown exception" ); + ::rtl::OUString reason(RTL_CONSTASCII_USTRINGPARAM( + "ScriptProtocolHandler::dispatch: caught unknown exception" )); invokeResult <<= reason; } @@ -261,9 +262,9 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification( } else { - ::rtl::OUString reason = ::rtl::OUString::createFromAscii( + ::rtl::OUString reason(RTL_CONSTASCII_USTRINGPARAM( "ScriptProtocolHandler::dispatchWithNotification failed, ScriptProtocolHandler not initialised" - ); + )); invokeResult <<= reason; } @@ -407,8 +408,8 @@ ScriptProtocolHandler::createScriptProvider() Reference< XComponentContext > xCtx( xProps->getPropertyValue( dc ), UNO_QUERY_THROW ); - ::rtl::OUString tmspf = ::rtl::OUString::createFromAscii( - "/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory"); + ::rtl::OUString tmspf(RTL_CONSTASCII_USTRINGPARAM( + "/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory")); Reference< provider::XScriptProviderFactory > xFac( xCtx->getValueByName( tmspf ), UNO_QUERY_THROW ); @@ -578,3 +579,4 @@ extern "C" } // extern "C" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/protocolhandler/scripthandler.hxx b/scripting/source/protocolhandler/scripthandler.hxx index a7e7bea384..8792bb066b 100644 --- a/scripting/source/protocolhandler/scripthandler.hxx +++ b/scripting/source/protocolhandler/scripthandler.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -149,3 +150,5 @@ public: } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/ActiveMSPList.cxx b/scripting/source/provider/ActiveMSPList.cxx index 380c124ba0..3d61f529eb 100644 --- a/scripting/source/provider/ActiveMSPList.cxx +++ b/scripting/source/provider/ActiveMSPList.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -69,7 +70,7 @@ ActiveMSPList::~ActiveMSPList() Reference< provider::XScriptProvider > ActiveMSPList::createNewMSP( const uno::Any& context ) { - ::rtl::OUString serviceName = ::rtl::OUString::createFromAscii("com.sun.star.script.provider.MasterScriptProvider"); + ::rtl::OUString serviceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.provider.MasterScriptProvider")); Sequence< Any > args( &context, 1 ); Reference< provider::XScriptProvider > msp( @@ -296,7 +297,7 @@ ActiveMSPList::createNonDocMSPs() return; } // do creation of user and share MSPs here - ::rtl::OUString serviceName = ::rtl::OUString::createFromAscii("com.sun.star.script.provider.MasterScriptProvider"); + ::rtl::OUString serviceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.provider.MasterScriptProvider")); Sequence< Any > args(1); args[ 0 ] <<= userDirString; @@ -322,3 +323,4 @@ ActiveMSPList::createNonDocMSPs() } // namespace func_provider +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/ActiveMSPList.hxx b/scripting/source/provider/ActiveMSPList.hxx index b0418ebaa4..fdc3ae4508 100644 --- a/scripting/source/provider/ActiveMSPList.hxx +++ b/scripting/source/provider/ActiveMSPList.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -112,3 +113,5 @@ private: }; } // func_provider #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx index 7593eb3cde..1d49ede652 100644 --- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx +++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -264,7 +265,7 @@ private: for ( sal_Int32 i = 0; i < langNodes.getLength(); i++ ) { Reference< browse::XBrowseNode > xbn; - if ( langNodes[ i ]->getName().equals(::rtl::OUString::createFromAscii("uno_packages")) ) + if ( langNodes[ i ]->getName().equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno_packages"))) ) { xbn.set( new LocationBrowseNode( langNodes[ i ] ) ); } @@ -324,8 +325,8 @@ Sequence< Reference< browse::XBrowseNode > > getAllBrowseNodes( const Reference< xCtx->getValueByName( OUSTR("/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory") ), UNO_QUERY_THROW ); - locnBNs[ mspIndex++ ] = Reference< browse::XBrowseNode >( xFac->createScriptProvider( makeAny( ::rtl::OUString::createFromAscii("user") ) ), UNO_QUERY_THROW ); - locnBNs[ mspIndex++ ] = Reference< browse::XBrowseNode >( xFac->createScriptProvider( makeAny( ::rtl::OUString::createFromAscii("share") ) ), UNO_QUERY_THROW ); + locnBNs[ mspIndex++ ] = Reference< browse::XBrowseNode >( xFac->createScriptProvider( makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")) ) ), UNO_QUERY_THROW ); + locnBNs[ mspIndex++ ] = Reference< browse::XBrowseNode >( xFac->createScriptProvider( makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("share")) ) ), UNO_QUERY_THROW ); } // TODO proper exception handling, should throw catch( Exception& e ) @@ -569,7 +570,7 @@ public: { m_vNodes.push_back( new DefaultBrowseNode( xCtx, nodes[ i ] ) ); } - m_Name = ::rtl::OUString::createFromAscii( "Root" ); + m_Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Root")); } ~DefaultRootBrowseNode() @@ -637,7 +638,7 @@ public: virtual ::rtl::OUString SAL_CALL getName() throw ( RuntimeException ) { - return ::rtl::OUString::createFromAscii( "Root" ); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Root")); } virtual Sequence< Reference< browse::XBrowseNode > > SAL_CALL @@ -735,8 +736,8 @@ Sequence< ::rtl::OUString > SAL_CALL bnf_getSupportedServiceNames( ) SAL_THROW( () ) { - ::rtl::OUString str_name = ::rtl::OUString::createFromAscii( - "com.sun.star.script.browse.BrowseNodeFactory"); + ::rtl::OUString str_name(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.script.browse.BrowseNodeFactory")); return Sequence< ::rtl::OUString >( &str_name, 1 ); } @@ -745,8 +746,8 @@ bnf_getSupportedServiceNames( ) bnf_getImplementationName( ) SAL_THROW( () ) { - return ::rtl::OUString::createFromAscii( - "com.sun.star.script.browse.BrowseNodeFactory" ); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.script.browse.BrowseNodeFactory" )); } Reference< XInterface > SAL_CALL @@ -795,3 +796,5 @@ sal_Bool BrowseNodeFactoryImpl::supportsService( } } // namespace browsenodefactory + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.hxx b/scripting/source/provider/BrowseNodeFactoryImpl.hxx index f41af8b2fa..eec93fabe0 100644 --- a/scripting/source/provider/BrowseNodeFactoryImpl.hxx +++ b/scripting/source/provider/BrowseNodeFactoryImpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -86,3 +87,5 @@ public: } // namespace browsenodefactory + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index efd7862892..06f8446c54 100755..100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -272,11 +273,11 @@ throw ( provider::ScriptFrameworkErrorException, // need to get the language from the string Reference< uri::XUriReferenceFactory > xFac ( - m_xMgr->createInstanceWithContext( rtl::OUString::createFromAscii( - "com.sun.star.uri.UriReferenceFactory"), m_xContext ) , UNO_QUERY ); + m_xMgr->createInstanceWithContext( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.uri.UriReferenceFactory")), m_xContext ) , UNO_QUERY ); if ( !xFac.is() ) { - ::rtl::OUString message = ::rtl::OUString::createFromAscii("Failed to instantiate UriReferenceFactory"); + ::rtl::OUString message(RTL_CONSTASCII_USTRINGPARAM("Failed to instantiate UriReferenceFactory")); throw provider::ScriptFrameworkErrorException( message, Reference< XInterface >(), scriptURI, ::rtl::OUString(), @@ -298,8 +299,8 @@ throw ( provider::ScriptFrameworkErrorException, provider::ScriptFrameworkErrorType::UNKNOWN ); } - ::rtl::OUString langKey = ::rtl::OUString::createFromAscii( "language" ); - ::rtl::OUString locKey = ::rtl::OUString::createFromAscii( "location" ); + ::rtl::OUString langKey(RTL_CONSTASCII_USTRINGPARAM("language")); + ::rtl::OUString locKey(RTL_CONSTASCII_USTRINGPARAM("location")); if ( sfUri->hasParameter( langKey ) == sal_False || sfUri->hasParameter( locKey ) == sal_False || @@ -318,8 +319,7 @@ throw ( provider::ScriptFrameworkErrorException, // if script us located in uno pkg sal_Int32 index = -1; - ::rtl::OUString pkgTag = - ::rtl::OUString::createFromAscii( ":uno_packages" ); + ::rtl::OUString pkgTag(RTL_CONSTASCII_USTRINGPARAM(":uno_packages")); // for languages other than basic, scripts located in uno packages // are merged into the user/share location context. // For other languages the location attribute in script url has the form @@ -818,8 +818,8 @@ MasterScriptProvider::getAllProviders() throw ( css::uno::RuntimeException ) } else { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( - "MasterScriptProvider::getAllProviders, cache not initialised"); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM( + "MasterScriptProvider::getAllProviders, cache not initialised")); throw RuntimeException( errorMsg.concat( errorMsg ), Reference< XInterface >() ); } @@ -921,8 +921,8 @@ Sequence< ::rtl::OUString > urihelper_getSupportedServiceNames( ) SAL_THROW( () ) { ::rtl::OUString serviceNameList[] = { - ::rtl::OUString::createFromAscii( - "com.sun.star.script.provider.ScriptURIHelper" ) }; + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.script.provider.ScriptURIHelper" )) }; Sequence< ::rtl::OUString > serviceNames = Sequence < ::rtl::OUString > ( serviceNameList, 1 ); @@ -933,8 +933,8 @@ Sequence< ::rtl::OUString > urihelper_getSupportedServiceNames( ) ::rtl::OUString urihelper_getImplementationName( ) SAL_THROW( () ) { - return ::rtl::OUString::createFromAscii( - "com.sun.star.script.provider.ScriptURIHelper"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.script.provider.ScriptURIHelper")); } static struct cppu::ImplementationEntry s_entries [] = @@ -999,3 +999,5 @@ extern "C" pRegistryKey, ::scripting_runtimemgr::s_entries ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/MasterScriptProvider.hxx b/scripting/source/provider/MasterScriptProvider.hxx index 4484c6cef6..1e075cd498 100644 --- a/scripting/source/provider/MasterScriptProvider.hxx +++ b/scripting/source/provider/MasterScriptProvider.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -155,3 +156,5 @@ private: }; } // namespace func_provider #endif //_FRAMEWORK_SCRIPT_PROVIDER_XFUNCTIONPROVIDER_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/MasterScriptProviderFactory.cxx b/scripting/source/provider/MasterScriptProviderFactory.cxx index 4ca5ebebd3..e73a03edde 100644 --- a/scripting/source/provider/MasterScriptProviderFactory.cxx +++ b/scripting/source/provider/MasterScriptProviderFactory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -91,8 +92,8 @@ Sequence< ::rtl::OUString > SAL_CALL mspf_getSupportedServiceNames( ) SAL_THROW( () ) { - ::rtl::OUString str_name = ::rtl::OUString::createFromAscii( - "com.sun.star.script.provider.MasterScriptProviderFactory"); + ::rtl::OUString str_name(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.script.provider.MasterScriptProviderFactory")); return Sequence< ::rtl::OUString >( &str_name, 1 ); } @@ -101,8 +102,8 @@ mspf_getSupportedServiceNames( ) mspf_getImplementationName( ) SAL_THROW( () ) { - return ::rtl::OUString::createFromAscii( - "com.sun.star.script.provider.MasterScriptProviderFactory"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.script.provider.MasterScriptProviderFactory")); } Reference< XInterface > SAL_CALL @@ -151,3 +152,5 @@ sal_Bool MasterScriptProviderFactory::supportsService( } } // namespace browsenodefactory + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/MasterScriptProviderFactory.hxx b/scripting/source/provider/MasterScriptProviderFactory.hxx index 6954c850c1..c247c4bf9f 100644 --- a/scripting/source/provider/MasterScriptProviderFactory.hxx +++ b/scripting/source/provider/MasterScriptProviderFactory.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -83,3 +84,5 @@ public: } // namespace func_provider + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx index 040dfdd437..d27e5d9e9b 100644 --- a/scripting/source/provider/ProviderCache.cxx +++ b/scripting/source/provider/ProviderCache.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -166,7 +167,7 @@ ProviderCache::populateCache() throw ( RuntimeException ) Reference< lang::XSingleComponentFactory > factory; if ( sal_False == ( xEnum->nextElement() >>= factory ) ) { - throw new RuntimeException( ::rtl::OUString::createFromAscii( " error extracting XSingleComponentFactory from Content enumeration. " ), Reference< XInterface >() ); + throw new RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" error extracting XSingleComponentFactory from Content enumeration. ")), Reference< XInterface >() ); } validateXRef( factory, "ProviderCache::populateCache() invalid factory" ); Reference< lang::XServiceInfo > xServiceInfo( factory, UNO_QUERY_THROW ); @@ -213,10 +214,12 @@ ProviderCache::createProvider( ProviderDetails& details ) throw ( RuntimeExcepti } catch ( RuntimeException& e ) { - ::rtl::OUString temp = ::rtl::OUString::createFromAscii("ProviderCache::createProvider() Error creating provider from factory!!!"); + ::rtl::OUString temp(RTL_CONSTASCII_USTRINGPARAM("ProviderCache::createProvider() Error creating provider from factory!!!")); throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); } return details.provider; } } //end namespace + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/ProviderCache.hxx b/scripting/source/provider/ProviderCache.hxx index 59c4f7ac26..04bb50d2e2 100644 --- a/scripting/source/provider/ProviderCache.hxx +++ b/scripting/source/provider/ProviderCache.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -106,3 +107,5 @@ private: }; } // func_provider #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/ScriptImpl.cxx b/scripting/source/provider/ScriptImpl.cxx index a2715e72e9..c34675e3b4 100644 --- a/scripting/source/provider/ScriptImpl.cxx +++ b/scripting/source/provider/ScriptImpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -120,3 +121,5 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, return result; } } // namespace func_provider + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/ScriptImpl.hxx b/scripting/source/provider/ScriptImpl.hxx index 9aa019daad..56784d8721 100644 --- a/scripting/source/provider/ScriptImpl.hxx +++ b/scripting/source/provider/ScriptImpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -111,3 +112,5 @@ private: }; } // namespace func_provider #endif //_FRAMEWORK_SCRIPT_PROVIDER_FUNCTIONIMPL_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/ScriptingContext.cxx b/scripting/source/provider/ScriptingContext.cxx index 724b8c5a76..87d6dbefd6 100755..100644 --- a/scripting/source/provider/ScriptingContext.cxx +++ b/scripting/source/provider/ScriptingContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -114,3 +115,5 @@ css::uno::Sequence< css::uno::Type > SAL_CALL ScriptingContext::getTypes( ) thr return OPropertyContainer::getTypes(); } } // namespace func_provider + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/ScriptingContext.hxx b/scripting/source/provider/ScriptingContext.hxx index 726a2aa3d4..e273567803 100644 --- a/scripting/source/provider/ScriptingContext.hxx +++ b/scripting/source/provider/ScriptingContext.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -89,3 +90,5 @@ private: }; } // func_provider #endif //_FRAMEWORK_SCRIPT_PROVIDER_XFUNCTIONPROVIDER_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx index 978115d881..0d3a6a998b 100644 --- a/scripting/source/provider/URIHelper.cxx +++ b/scripting/source/provider/URIHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -71,8 +72,8 @@ ScriptingFrameworkURIHelper::ScriptingFrameworkURIHelper( { m_xSimpleFileAccess = uno::Reference< ucb::XSimpleFileAccess >( xContext->getServiceManager()->createInstanceWithContext( - OUString::createFromAscii( - "com.sun.star.ucb.SimpleFileAccess"), + OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.ucb.SimpleFileAccess")), xContext), uno::UNO_QUERY_THROW); } catch (uno::Exception&) @@ -85,8 +86,8 @@ ScriptingFrameworkURIHelper::ScriptingFrameworkURIHelper( { m_xUriReferenceFactory = uno::Reference< uri::XUriReferenceFactory >( xContext->getServiceManager()->createInstanceWithContext( - OUString::createFromAscii( - "com.sun.star.uri.UriReferenceFactory"), + OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.uri.UriReferenceFactory")), xContext ), uno::UNO_QUERY_THROW ); } catch (uno::Exception&) @@ -110,26 +111,26 @@ throw ( uno::Exception, uno::RuntimeException ) args[0].getValueType() != ::getCppuType((const OUString*)NULL) || args[1].getValueType() != ::getCppuType((const OUString*)NULL) ) { - throw uno::RuntimeException( OUString::createFromAscii( - "ScriptingFrameworkURIHelper got invalid argument list" ), + throw uno::RuntimeException( OUString(RTL_CONSTASCII_USTRINGPARAM( + "ScriptingFrameworkURIHelper got invalid argument list" )), uno::Reference< uno::XInterface >() ); } if ( (args[0] >>= m_sLanguage) == sal_False || (args[1] >>= m_sLocation) == sal_False ) { - throw uno::RuntimeException( OUString::createFromAscii( - "ScriptingFrameworkURIHelper error parsing args" ), + throw uno::RuntimeException( OUString(RTL_CONSTASCII_USTRINGPARAM( + "ScriptingFrameworkURIHelper error parsing args" )), uno::Reference< uno::XInterface >() ); } - SCRIPTS_PART = OUString::createFromAscii( "/Scripts/" ); + SCRIPTS_PART = OUString(RTL_CONSTASCII_USTRINGPARAM("/Scripts/")); SCRIPTS_PART = SCRIPTS_PART.concat( m_sLanguage.toAsciiLowerCase() ); if ( !initBaseURI() ) { - throw uno::RuntimeException( OUString::createFromAscii( - "ScriptingFrameworkURIHelper cannot find script directory"), + throw uno::RuntimeException( OUString(RTL_CONSTASCII_USTRINGPARAM( + "ScriptingFrameworkURIHelper cannot find script directory")), uno::Reference< uno::XInterface >() ); } } @@ -142,31 +143,31 @@ ScriptingFrameworkURIHelper::initBaseURI() if ( m_sLocation.equalsAscii(USER)) { - test = OUString::createFromAscii(USER); - uri = OUString::createFromAscii(USER_URI); + test = OUString(RTL_CONSTASCII_USTRINGPARAM(USER)); + uri = OUString(RTL_CONSTASCII_USTRINGPARAM(USER_URI)); bAppendScriptsPart = true; } else if ( m_sLocation.equalsAscii(USER_UNO_PACKAGES)) { - test = OUString::createFromAscii("uno_packages"); - uri = OUString::createFromAscii(USER_URI); - uri = uri.concat(OUString::createFromAscii(USER_UNO_PACKAGES_DIR)); + test = OUString(RTL_CONSTASCII_USTRINGPARAM("uno_packages")); + uri = OUString(RTL_CONSTASCII_USTRINGPARAM(USER_URI)); + uri = uri.concat(OUString(RTL_CONSTASCII_USTRINGPARAM(USER_UNO_PACKAGES_DIR))); } else if (m_sLocation.equalsAscii(SHARE)) { - test = OUString::createFromAscii(SHARE); - uri = OUString::createFromAscii(SHARE_URI); + test = OUString(RTL_CONSTASCII_USTRINGPARAM(SHARE)); + uri = OUString(RTL_CONSTASCII_USTRINGPARAM(SHARE_URI)); bAppendScriptsPart = true; } else if (m_sLocation.equalsAscii(SHARE_UNO_PACKAGES)) { - test = OUString::createFromAscii("uno_packages"); - uri = OUString::createFromAscii(SHARE_UNO_PACKAGES_URI); + test = OUString(RTL_CONSTASCII_USTRINGPARAM("uno_packages")); + uri = OUString(RTL_CONSTASCII_USTRINGPARAM(SHARE_UNO_PACKAGES_URI)); } - else if (m_sLocation.indexOf(OUString::createFromAscii(TDOC_SCHEME)) == 0) + else if (m_sLocation.indexOf(OUString(RTL_CONSTASCII_USTRINGPARAM(TDOC_SCHEME))) == 0) { m_sBaseURI = m_sLocation.concat( SCRIPTS_PART ); - m_sLocation = OUString::createFromAscii( DOCUMENT ); + m_sLocation = OUString(RTL_CONSTASCII_USTRINGPARAM( DOCUMENT )); return true; } else @@ -263,13 +264,13 @@ ScriptingFrameworkURIHelper::getStorageURI(const OUString& rScriptURI) catch ( uno::Exception& ) { throw lang::IllegalArgumentException( - OUString::createFromAscii( "Script URI not valid" ), + OUString(RTL_CONSTASCII_USTRINGPARAM("Script URI not valid")), uno::Reference< uno::XInterface >(), 1 ); } ::rtl::OUStringBuffer buf(120); buf.append(m_sBaseURI); - buf.append(OUString::createFromAscii("/")); + buf.append(OUString(RTL_CONSTASCII_USTRINGPARAM("/"))); buf.append(getLanguagePath(sLanguagePart)); OUString result = buf.makeStringAndClear(); @@ -288,16 +289,16 @@ OUString SAL_CALL ScriptingFrameworkURIHelper::getImplementationName() throw( uno::RuntimeException ) { - return OUString::createFromAscii( - "com.sun.star.script.provider.ScriptURIHelper" ); + return OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.script.provider.ScriptURIHelper" )); } sal_Bool SAL_CALL ScriptingFrameworkURIHelper::supportsService( const OUString& serviceName ) throw( uno::RuntimeException ) { - OUString m_sServiceName = OUString::createFromAscii( - "com.sun.star.script.provider.ScriptURIHelper" ); + OUString m_sServiceName(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.script.provider.ScriptURIHelper" )); if ( serviceName.equals( m_sServiceName ) ) { @@ -311,8 +312,8 @@ ScriptingFrameworkURIHelper::getSupportedServiceNames() throw( uno::RuntimeException ) { ::rtl::OUString serviceNameList[] = { - ::rtl::OUString::createFromAscii( - "com.sun.star.script.provider.ScriptURIHelper" ) }; + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.script.provider.ScriptURIHelper" )) }; uno::Sequence< ::rtl::OUString > serviceNames = uno::Sequence < ::rtl::OUString > ( serviceNameList, 1 ); @@ -320,3 +321,5 @@ ScriptingFrameworkURIHelper::getSupportedServiceNames() return serviceNames; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/provider/URIHelper.hxx b/scripting/source/provider/URIHelper.hxx index 73f5103918..c81c3d2375 100644 --- a/scripting/source/provider/URIHelper.hxx +++ b/scripting/source/provider/URIHelper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -106,3 +107,5 @@ public: } // namespace func_provider #endif //_FRAMEWORK_SCRIPT_PROVIDER_XSCRIPTURIHELPER_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/pyprov/description.xml b/scripting/source/pyprov/description.xml new file mode 100644 index 0000000000..1fe0a3d923 --- /dev/null +++ b/scripting/source/pyprov/description.xml @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<description + xmlns="http://openoffice.org/extensions/description/2006" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:dep="http://openoffice.org/extensions/description/2006"> + + <identifier value="com.sun.star.script.provider.ScriptProviderForPython"/> + + <dependencies> + <OpenOffice.org-minimal-version value="3.0" dep:name="OpenOffice.org 3.0"/> + </dependencies> + + <version value="3.3.0"/> + + <publisher> + <name xlink:href="http://www.documentfoundation.org" lang="en">The + Document Foundation</name> + </publisher> + + <display-name> + <name lang="en">Script provider for Python</name> + </display-name> + +</description> diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py index 6592a59d18..f0dd1fdf34 100644 --- a/scripting/source/pyprov/mailmerge.py +++ b/scripting/source/pyprov/mailmerge.py @@ -2,8 +2,8 @@ # a simple email mailmerge component # manual installation for hackers, not necessary for users -# cp mailmerge.py /usr/lib/openoffice.org2.0/program -# cd /usr/lib/openoffice.org2.0/program +# cp mailmerge.py /usr/lib/libreoffice/program +# cd /usr/lib/libreoffice/program # ./unopkg add --shared mailmerge.py # edit ~/.openoffice.org2/user/registry/data/org/openoffice/Office/Writer.xcu # and change EMailSupported to as follows... diff --git a/scripting/source/pyprov/manifest.xml b/scripting/source/pyprov/manifest.xml new file mode 100644 index 0000000000..7e4e0456ea --- /dev/null +++ b/scripting/source/pyprov/manifest.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd"> +<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest"> + <manifest:file-entry + manifest:media-type="application/vnd.sun.star.uno-component;type=python" + manifest:full-path="pythonscript.py"/> +</manifest:manifest> diff --git a/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx b/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx index ffb2a52d88..f76b9aff3c 100644 --- a/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx +++ b/scripting/source/runtimemgr/ScriptNameResolverImpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,10 +54,10 @@ namespace scripting_runtimemgr { const sal_Char* const LANGUAGE_TO_RESOLVE_ON[] = { "All" }; // should be configurable -OUString nrs_implName = OUString::createFromAscii( - "drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" ); -OUString nrs_serviceName = OUString::createFromAscii( - "drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" ); +OUString nrs_implName(RTL_CONSTASCII_USTRINGPARAM( + "drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" )); +OUString nrs_serviceName(RTL_CONSTASCII_USTRINGPARAM( + "drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" )); Sequence< OUString > nrs_serviceNames = Sequence< OUString >( &nrs_serviceName, 1 ); const char* const SCRIPTSTORAGEMANAGER_SERVICE = @@ -172,10 +173,10 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE OSL_TRACE( "ScriptNameResolverImpl::resolve Starting..." ); - OUString docString = OUString::createFromAscii( "location=document" ); - OUString userString = OUString::createFromAscii( "location=user" ); - OUString shareString = OUString::createFromAscii( "location=share" ); - OUString filesysString = OUString::createFromAscii( "location=filesystem" ); + OUString docString(RTL_CONSTASCII_USTRINGPARAM("location=document")); + OUString userString(RTL_CONSTASCII_USTRINGPARAM("location=user")); + OUString shareString(RTL_CONSTASCII_USTRINGPARAM("location=share")); + OUString filesysString(RTL_CONSTASCII_USTRINGPARAM("location=filesystem")); // initialise vector with doc, user and share @@ -221,8 +222,8 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE throw RuntimeException( temp.concat( e.Message ), Reference< XInterface >() ); } Reference< XInterface > xInterface = m_xMultiComFac->createInstanceWithContext( - ::rtl::OUString::createFromAscii( - "com.sun.star.ucb.SimpleFileAccess" ), m_xContext ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.ucb.SimpleFileAccess" )), m_xContext ); validateXRef( xInterface, "ScriptProvider::initialise: cannot get SimpleFileAccess Service\n" ); Reference < ucb::XSimpleFileAccess > xSimpleFileAccess = Reference < @@ -269,7 +270,7 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE // b) an illegal location // detect illegal location - if ( scriptURI.indexOf( OUString::createFromAscii( "location=" ) ) != -1 ) + if ( scriptURI.indexOf( OUString(RTL_CONSTASCII_USTRINGPARAM("location=")) ) != -1 ) { OSL_TRACE( "ScriptNameResolver::resolve, throwing IllegalArgException" ); @@ -431,7 +432,7 @@ SAL_THROW ( ( lang::IllegalArgumentException, css::security::AccessControlExcept try { OUString permissionURI = docURI; - OUString filesysString = OUString::createFromAscii( "location=filesystem" ); + OUString filesysString(RTL_CONSTASCII_USTRINGPARAM("location=filesystem")); if ( scriptURI.indexOf( filesysString ) != -1 ) { // in the case of filesys scripts we're checking whether the @@ -519,7 +520,7 @@ const ::rtl::OUString & permissionURI ) SAL_THROW ( ( RuntimeException, css::sec Reference< XInterface > xInterface; Any a = m_xContext->getValueByName( - OUString::createFromAscii( SCRIPTSTORAGEMANAGER_SERVICE ) ); + OUString(RTL_CONSTASCII_USTRINGPARAM( SCRIPTSTORAGEMANAGER_SERVICE )) ); if ( sal_False == ( a >>= xInterface ) ) { throw RuntimeException( @@ -540,7 +541,7 @@ const ::rtl::OUString & permissionURI ) SAL_THROW ( ( RuntimeException, css::sec ( sid != scriptingConstantsPool.SHARED_STORAGE_ID ) ) { xScriptSecurity->checkPermission( permissionURI, - OUString::createFromAscii( "execute" ) ); + OUString(RTL_CONSTASCII_USTRINGPARAM("execute")) ); // if we get here, the checkPermission hasn't thrown an // AccessControlException, ie. permission has been granted OSL_TRACE( "ScriptNameResolverImpl::getStorageInstance: got execute permission for ID=%d", sid ); @@ -585,7 +586,7 @@ throw( lang::IllegalArgumentException ) { OUString filePath; OUString fileName; - OUString filesysString = OUString::createFromAscii( "location=filesystem" ); + OUString filesysString(RTL_CONSTASCII_USTRINGPARAM("location=filesystem")); sal_Int32 locationPos = scriptURI.indexOf( filesysString ); // expect location=filesys:file:///foo/bar/myscript.bsh etc // except the file url at this point is encoded @@ -602,7 +603,7 @@ throw( lang::IllegalArgumentException ) endOfLocn - locationPos - filesysStrLen ); } //file name shoul also be encoded so again ok to search for '&' - OUString functionKey = OUString::createFromAscii( "function=" ); + OUString functionKey(RTL_CONSTASCII_USTRINGPARAM("function=")); sal_Int32 functionKeyLength = functionKey.getLength(); sal_Int32 functionNamePos = scriptURI.indexOf( functionKey ); if ( functionNamePos > 0 ) @@ -658,3 +659,5 @@ OUString scriptnri_getImplementationName() SAL_THROW( () ) return nrs_implName; } } // namespace scripting_runtimemgr + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/runtimemgr/ScriptNameResolverImpl.hxx b/scripting/source/runtimemgr/ScriptNameResolverImpl.hxx index ef52e47ebf..089b300a1b 100644 --- a/scripting/source/runtimemgr/ScriptNameResolverImpl.hxx +++ b/scripting/source/runtimemgr/ScriptNameResolverImpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -108,3 +109,5 @@ private: } // scripting_runtimemgr #endif //_FRAMEWORK_SCRIPT_SCRIPTNAMERESOLVERIMPL_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/runtimemgr/ScriptRuntimeManager.cxx b/scripting/source/runtimemgr/ScriptRuntimeManager.cxx index e23265364b..43d19c624f 100755..100644 --- a/scripting/source/runtimemgr/ScriptRuntimeManager.cxx +++ b/scripting/source/runtimemgr/ScriptRuntimeManager.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,9 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_scripting.hxx" -#ifndef _VCL_MSGBOX_HXX #include <vcl/msgbox.hxx> -#endif #include "ScriptExecDialog.hrc" @@ -56,10 +55,10 @@ using namespace ::drafts::com::sun::star::script::framework; namespace scripting_runtimemgr { -static OUString s_implName = ::rtl::OUString::createFromAscii( - "drafts.com.sun.star.script.framework.runtime.ScriptRuntimeManager" ); -static OUString s_serviceName = ::rtl::OUString::createFromAscii( - "drafts.com.sun.star.script.framework.runtime.ScriptRuntimeManager" ); +static OUString s_implName(RTL_CONSTASCII_USTRINGPARAM( + "drafts.com.sun.star.script.framework.runtime.ScriptRuntimeManager" )); +static OUString s_serviceName(RTL_CONSTASCII_USTRINGPARAM( + "drafts.com.sun.star.script.framework.runtime.ScriptRuntimeManager" )); static Sequence< OUString > s_serviceNames = Sequence< OUString >( &s_serviceName, 1 ); ::rtl_StandardModuleCount s_moduleCount = MODULE_COUNT_INIT; @@ -144,8 +143,8 @@ throw( RuntimeException ) try { Reference< XInterface > xInterface = m_xMgr->createInstanceWithContext( - OUString::createFromAscii( - "drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" ), + OUString(RTL_CONSTASCII_USTRINGPARAM( + "drafts.com.sun.star.script.framework.runtime.DefaultScriptNameResolver" )), m_xContext ); validateXRef( xInterface, "ScriptRuntimeManager::GetScriptRuntime: cannot get instance of DefaultScriptNameResolver" ); @@ -226,8 +225,8 @@ Any SAL_CALL ScriptRuntimeManager::invoke( aOutParamIndex, aOutParam ); // need to dispose of filesystem storage - OUString filesysString = OUString::createFromAscii( - "location=filesystem" ); + OUString filesysString(RTL_CONSTASCII_USTRINGPARAM( + "location=filesystem" )); if ( scriptURI.indexOf( filesysString ) != -1 ) { Any a = m_xContext->getValueByName( @@ -502,3 +501,5 @@ extern "C" pRegistryKey, ::scripting_runtimemgr::s_entries ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/runtimemgr/ScriptRuntimeManager.hxx b/scripting/source/runtimemgr/ScriptRuntimeManager.hxx index 6bd25f5d04..9f97f00bda 100644 --- a/scripting/source/runtimemgr/ScriptRuntimeManager.hxx +++ b/scripting/source/runtimemgr/ScriptRuntimeManager.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -147,3 +148,5 @@ private: } // scripting_runtimemgr #endif //_FRAMEWORK_SCRIPT_SCRIPTRUNTIMEMANAGER_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/runtimemgr/StorageBridge.cxx b/scripting/source/runtimemgr/StorageBridge.cxx index 9a5105b576..cdb705122c 100644 --- a/scripting/source/runtimemgr/StorageBridge.cxx +++ b/scripting/source/runtimemgr/StorageBridge.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -81,7 +82,7 @@ StorageBridge::initStorage() throw ( ::com::sun::star::uno::RuntimeException ) Reference< XInterface > temp; Any a = m_xContext->getValueByName( - OUString::createFromAscii( SCRIPTSTORAGEMANAGER_SERVICE ) ); + OUString(RTL_CONSTASCII_USTRINGPARAM( SCRIPTSTORAGEMANAGER_SERVICE )) ); if ( sal_False == ( a >>= temp ) ) { throw RuntimeException( @@ -150,3 +151,5 @@ throw ( lang::IllegalArgumentException, RuntimeException ) return results; } }// namespace + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/runtimemgr/StorageBridge.hxx b/scripting/source/runtimemgr/StorageBridge.hxx index 54f3f8551b..7d0e0ca898 100644 --- a/scripting/source/runtimemgr/StorageBridge.hxx +++ b/scripting/source/runtimemgr/StorageBridge.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -83,3 +84,5 @@ private: } #endif //_COM_SUN_STAR_SCRIPTING_STORAGEBRIDGE_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/runtimemgr/StorageBridgeFactory.cxx b/scripting/source/runtimemgr/StorageBridgeFactory.cxx index 47fbdf22a6..9392eaf751 100644 --- a/scripting/source/runtimemgr/StorageBridgeFactory.cxx +++ b/scripting/source/runtimemgr/StorageBridgeFactory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,3 +68,5 @@ StorageBridgeFactory::getStorageInstance( sal_Int32 sid ) return storage; } } //scripting_runtimemgr + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/runtimemgr/StorageBridgeFactory.hxx b/scripting/source/runtimemgr/StorageBridgeFactory.hxx index 5e8dc69608..9631f9bb90 100644 --- a/scripting/source/runtimemgr/StorageBridgeFactory.hxx +++ b/scripting/source/runtimemgr/StorageBridgeFactory.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,3 +57,5 @@ private: }; } // scripting_runtimemgr #endif //_FRAMEWORK_SCRIPT_NAMERESOLVER_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptData.hxx b/scripting/source/storage/ScriptData.hxx index 2e1866b93a..4efb93e05a 100644 --- a/scripting/source/storage/ScriptData.hxx +++ b/scripting/source/storage/ScriptData.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -89,3 +90,4 @@ struct ScriptData } // namespace scripting_impl #endif // _SCRIPTING_STORAGE_ScriptData_HXX_ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptElement.cxx b/scripting/source/storage/ScriptElement.cxx index 86ef4a8b2c..6552bbdc45 100644 --- a/scripting/source/storage/ScriptElement.cxx +++ b/scripting/source/storage/ScriptElement.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -159,3 +160,5 @@ ScriptElement::~ScriptElement() SAL_THROW(()) } } // namespace scripting_impl + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptElement.hxx b/scripting/source/storage/ScriptElement.hxx index 64084004ed..d0a5976e52 100644 --- a/scripting/source/storage/ScriptElement.hxx +++ b/scripting/source/storage/ScriptElement.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -59,3 +60,5 @@ private: } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptInfo.cxx b/scripting/source/storage/ScriptInfo.cxx index 0d8aa511fb..2a9d868cf6 100644 --- a/scripting/source/storage/ScriptInfo.cxx +++ b/scripting/source/storage/ScriptInfo.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -246,7 +247,7 @@ OUString SAL_CALL ScriptInfo::getDescription( ) throw ( RuntimeException ) // TDB need to determine locale here, hardcoded at the moment // to english - OUString localeLang = OUString::createFromAscii( "en" ); + OUString localeLang(RTL_CONSTASCII_USTRINGPARAM("en")); strpair_map::const_iterator str_it = m_scriptData.locales.find( localeLang ); @@ -371,3 +372,5 @@ throw ( css::uno::RuntimeException ) } //************************************************************************* } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptInfo.hxx b/scripting/source/storage/ScriptInfo.hxx index 3de01df8a7..e87f244ab1 100644 --- a/scripting/source/storage/ScriptInfo.hxx +++ b/scripting/source/storage/ScriptInfo.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,3 +74,5 @@ private: } #endif // define __SCRIPTING_STORAGE... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptInfoImpl.hxx b/scripting/source/storage/ScriptInfoImpl.hxx index e715be8b49..ba033f2d74 100644 --- a/scripting/source/storage/ScriptInfoImpl.hxx +++ b/scripting/source/storage/ScriptInfoImpl.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -91,3 +92,4 @@ struct ScriptInfoImpl #endif // _SCRIPTING_STORAGE_SCRIPTINFOIMPL_HXX_ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptMetadataImporter.cxx b/scripting/source/storage/ScriptMetadataImporter.cxx index 502ce6aab4..c688997693 100644 --- a/scripting/source/storage/ScriptMetadataImporter.cxx +++ b/scripting/source/storage/ScriptMetadataImporter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -92,7 +93,7 @@ void ScriptMetadataImporter::parseMetaData( "ScriptMetadataImporter::parseMetaData: No service manager available" ); Reference< XInterface > xInterface = xMgr->createInstanceWithContext( - OUString::createFromAscii( "com.sun.star.xml.sax.Parser" ), m_xContext ); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser")), m_xContext ); validateXRef( xInterface, "ScriptMetadataImporter::parseMetaData: cannot get SAX Parser" ); Reference< xml::sax::XParser > xParser; @@ -102,8 +103,8 @@ void ScriptMetadataImporter::parseMetaData( } catch (RuntimeException & re ) { - OUString msg = OUString::createFromAscii( - "ScriptMetadata:Importer::parserMetaData cannot get XParser" ); + OUString msg(RTL_CONSTASCII_USTRINGPARAM( + "ScriptMetadata:Importer::parserMetaData cannot get XParser" )); msg.concat( re.Message ); throw RuntimeException( msg, Reference< XInterface > () ); } @@ -126,24 +127,24 @@ void ScriptMetadataImporter::parseMetaData( } catch ( xml::sax::SAXException & saxe ) { - OUString msg = OUString::createFromAscii( - "ScriptMetadata:Importer::parserMetaData SAXException" ); + OUString msg(RTL_CONSTASCII_USTRINGPARAM( + "ScriptMetadata:Importer::parserMetaData SAXException" )); msg.concat( saxe.Message ); throw xml::sax::SAXException( msg, Reference< XInterface > (), saxe.WrappedException ); } catch ( io::IOException & ioe ) { - throw io::IOException( OUString::createFromAscii( - "ScriptMetadataImporter::parseMetaData IOException: " ) + ioe.Message, + throw io::IOException( OUString(RTL_CONSTASCII_USTRINGPARAM( + "ScriptMetadataImporter::parseMetaData IOException: " )) + ioe.Message, Reference< XInterface > () ); } #ifdef _DEBUG catch ( ... ) { - throw RuntimeException( OUString::createFromAscii( - "ScriptMetadataImporter::parseMetadata UnknownException: " ), + throw RuntimeException( OUString(RTL_CONSTASCII_USTRINGPARAM( + "ScriptMetadataImporter::parseMetadata UnknownException: " )), Reference< XInterface > () ); } #endif @@ -229,35 +230,35 @@ void ScriptMetadataImporter::startElement( case SCRIPT: m_ScriptData.parcelURI = ms_parcelURI; m_ScriptData.language = xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "language" )); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("language"))); OSL_TRACE( "Trace Message: language is %s\n", ::rtl::OUStringToOString( m_ScriptData.language, RTL_TEXTENCODING_ASCII_US ).pData->buffer ); break; case LOCALE: ms_localeLang = xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "lang" ) ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("lang")) ); OSL_TRACE( "Trace Message: Locale is %s\n", ::rtl::OUStringToOString( ms_localeLang, RTL_TEXTENCODING_ASCII_US ).pData->buffer ); break; case DISPLAYNAME: ms_localeDisName = xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "value" )); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"))); OSL_TRACE( "Trace Message: Displyaname is %s\n", ::rtl::OUStringToOString( ms_localeDisName, RTL_TEXTENCODING_ASCII_US ).pData->buffer ); break; case FUNCTIONNAME: m_ScriptData.functionname = xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "value" ) ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value")) ); OSL_TRACE( "Trace Message: Functionname is %s\n", ::rtl::OUStringToOString( m_ScriptData.functionname, RTL_TEXTENCODING_ASCII_US ).pData->buffer ); break; case LOGICALNAME: m_ScriptData.logicalname = xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "value" )); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"))); #ifdef _DEBUG fprintf(stderr, "Trace Message: logicalname is %s\n", ::rtl::OUStringToOString( m_ScriptData.logicalname, @@ -267,21 +268,21 @@ void ScriptMetadataImporter::startElement( case LANGDEPPROPS: m_ScriptData.languagedepprops.push_back( ::std::make_pair( xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "name" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name")) ), xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "value" ) ) + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value")) ) )); OSL_TRACE( "Trace Message: Langdepprops is %s\t%s\n", ::rtl::OUStringToOString( xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "name" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name")) ), RTL_TEXTENCODING_ASCII_US ).pData->buffer, ::rtl::OUStringToOString( xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "value" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value")) ), RTL_TEXTENCODING_ASCII_US ).pData->buffer ); break; case FILESET: ms_filesetname = xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "name" ) ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name")) ); OSL_TRACE( "Trace Message: filesetname is %s\n", ::rtl::OUStringToOString(ms_filesetname, RTL_TEXTENCODING_ASCII_US ).pData->buffer ); @@ -289,21 +290,21 @@ void ScriptMetadataImporter::startElement( case FILESETPROPS: mv_filesetprops.push_back( ::std::make_pair( xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "name" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name")) ), xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "value" ) ) + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value")) ) )); OSL_TRACE( "Trace Message: filesetprops is %s\t%s\n", ::rtl::OUStringToOString( xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "name" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name")) ), RTL_TEXTENCODING_ASCII_US ).pData->buffer, ::rtl::OUStringToOString( xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "value" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value")) ), RTL_TEXTENCODING_ASCII_US ).pData->buffer ); break; case FILES: ms_filename = xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "name" ) ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name")) ); OSL_TRACE( "Trace Message: filename is %s\n", ::rtl::OUStringToOString( ms_filename, RTL_TEXTENCODING_ASCII_US).pData->buffer ); @@ -312,22 +313,22 @@ void ScriptMetadataImporter::startElement( /** mm_files.insert( strpair_pair( ms_filename, str_pair( xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "name" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name")) ), xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "value") ) ) + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value")) ) ) ) ); */ mv_fileprops.push_back(str_pair( xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "name" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name")) ), xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "value") ) ) ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value")) ) ) ); OSL_TRACE( "Trace Message: fileprops is %s\t%s\n", ::rtl::OUStringToOString( xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "name" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name")) ), RTL_TEXTENCODING_ASCII_US ).pData->buffer, ::rtl::OUStringToOString( xAttribs->getValueByName( - ::rtl::OUString::createFromAscii( "value" ) ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value")) ), RTL_TEXTENCODING_ASCII_US ).pData->buffer ); break; @@ -518,7 +519,7 @@ void ScriptMetadataImporter::setState( const ::rtl::OUString & tagName ) else { //If there is a tag we don't know about, throw a exception (wobbler) :) - ::rtl::OUString str_sax = ::rtl::OUString::createFromAscii( "No Such Tag" ); + ::rtl::OUString str_sax(RTL_CONSTASCII_USTRINGPARAM("No Such Tag")); OSL_TRACE( "ScriptMetadataImporter: No Such Tag: %s\n", ::rtl::OUStringToOString( @@ -530,3 +531,5 @@ void ScriptMetadataImporter::setState( const ::rtl::OUString & tagName ) } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptMetadataImporter.hxx b/scripting/source/storage/ScriptMetadataImporter.hxx index 74daf4eb04..e9d968c975 100644 --- a/scripting/source/storage/ScriptMetadataImporter.hxx +++ b/scripting/source/storage/ScriptMetadataImporter.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -249,3 +250,5 @@ private: } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptSecurityManager.cxx b/scripting/source/storage/ScriptSecurityManager.cxx index a17759a6de..824ef6116d 100755..100644 --- a/scripting/source/storage/ScriptSecurityManager.cxx +++ b/scripting/source/storage/ScriptSecurityManager.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,17 +63,17 @@ const char* const SCRIPTSTORAGEMANAGER_SERVICE = namespace scripting_securitymgr { -static OUString s_configProv = ::rtl::OUString::createFromAscii( - "com.sun.star.configuration.ConfigurationProvider"); +static OUString s_configProv(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.ConfigurationProvider")); -static OUString s_configAccess = ::rtl::OUString::createFromAscii( - "com.sun.star.configuration.ConfigurationAccess"); +static OUString s_configAccess(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.ConfigurationAccess")); -static OUString s_configUpdate = ::rtl::OUString::createFromAscii( - "com.sun.star.configuration.ConfigurationUpdateAccess"); +static OUString s_configUpdate(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.ConfigurationUpdateAccess")); -static OUString s_securityDialog = ::rtl::OUString::createFromAscii( - "com.sun.star.script.framework.security.SecurityDialog"); +static OUString s_securityDialog(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.script.framework.security.SecurityDialog")); static const int PERMISSION_NEVER = 0; static const int PERMISSION_PATHLIST = 1; @@ -136,7 +137,7 @@ throw ( RuntimeException ) Reference< XInterface > xInterface; Any a = m_xContext->getValueByName( - OUString::createFromAscii( SCRIPTSTORAGEMANAGER_SERVICE ) ); + OUString(RTL_CONSTASCII_USTRINGPARAM( SCRIPTSTORAGEMANAGER_SERVICE )) ); if ( sal_False == ( a >>= xInterface ) ) { throw RuntimeException( @@ -355,7 +356,7 @@ void ScriptSecurityManager::checkPermission( const OUString & scriptStorageURL, const OUString & permissionRequest ) throw ( RuntimeException, lang::IllegalArgumentException, security::AccessControlException ) { - if( permissionRequest.equals( OUString::createFromAscii( "execute" ) ) ) + if( permissionRequest.equals( OUString(RTL_CONSTASCII_USTRINGPARAM("execute")) ) ) { OSL_TRACE( "ScriptSecurityManager::checkPermission: execute permission request for %s", @@ -375,18 +376,18 @@ void ScriptSecurityManager::checkPermission( const OUString & scriptStorageURL, OSL_TRACE( "permission refused" ); Any aPermission; security::RuntimePermission permission; - permission.Name = OUString::createFromAscii( "execute" ).concat( scriptStorageURL ); + permission.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("execute")).concat( scriptStorageURL ); aPermission <<= permission; throw security::AccessControlException( - OUString::createFromAscii( "ScriptSecurityManager::checkPermission: no execute permission for URL" ).concat( scriptStorageURL ), + OUString(RTL_CONSTASCII_USTRINGPARAM("ScriptSecurityManager::checkPermission: no execute permission for URL")).concat( scriptStorageURL ), Reference< XInterface > (), aPermission ); } } // we should never get here!! - throw lang::IllegalArgumentException( OUString::createFromAscii( "ScriptSecurityManager::checkPermission: storageURL not found" ), Reference< XInterface > (), 0 ); + throw lang::IllegalArgumentException( OUString(RTL_CONSTASCII_USTRINGPARAM("ScriptSecurityManager::checkPermission: storageURL not found")), Reference< XInterface > (), 0 ); } // inappropriate permission request - throw lang::IllegalArgumentException( OUString::createFromAscii( "ScriptSecurityManager::checkPermission: storageURL not found" ), Reference< XInterface > (), 1 ); + throw lang::IllegalArgumentException( OUString(RTL_CONSTASCII_USTRINGPARAM("ScriptSecurityManager::checkPermission: storageURL not found")), Reference< XInterface > (), 1 ); } void ScriptSecurityManager::removePermissionSettings ( ::rtl::OUString & scriptStorageURL ) @@ -414,8 +415,8 @@ void ScriptSecurityManager::readConfiguration() try { beans::PropertyValue configPath; - configPath.Name = ::rtl::OUString::createFromAscii( "nodepath" ); - configPath.Value <<= ::rtl::OUString::createFromAscii( "org.openoffice.Office.Common/Security/Scripting" ); + configPath.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")); + configPath.Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/Security/Scripting")); Sequence < Any > aargs( 1 ); aargs[ 0 ] <<= configPath; validateXRef( m_xConfigProvFactory, @@ -512,8 +513,8 @@ void ScriptSecurityManager::readConfiguration() validateXRef( xMgr, "ScriptSecurityManager::readConfiguration: cannot get XMultiComponentFactory" ); xInterface = xMgr->createInstanceWithContext( - ::rtl::OUString::createFromAscii( - "com.sun.star.util.PathSubstitution"), m_xContext); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.util.PathSubstitution")), m_xContext); validateXRef( xInterface, "ScriptSecurityManager::readConfiguration: cannot get ConfigurationProvider" ); Reference< util::XStringSubstitution > xStringSubstitution( @@ -548,8 +549,8 @@ throw ( RuntimeException ) { OSL_TRACE( "--->ScriptSecurityManager::addToSecurePaths" ); beans::PropertyValue configPath; - configPath.Name = ::rtl::OUString::createFromAscii( "nodepath" ); - configPath.Value <<= ::rtl::OUString::createFromAscii( "org.openoffice.Office.Common/Security/Scripting" ); + configPath.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")); + configPath.Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/Security/Scripting")); Sequence < Any > aargs( 1 ); aargs[ 0 ] <<= configPath; Reference< XInterface > xInterface = m_xConfigProvFactory->createInstanceWithArguments( s_configUpdate, @@ -603,3 +604,5 @@ ScriptSecurityManager::~ScriptSecurityManager() } } // Namespace + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptSecurityManager.hxx b/scripting/source/storage/ScriptSecurityManager.hxx index 39fede0118..8e594965f2 100755..100644 --- a/scripting/source/storage/ScriptSecurityManager.hxx +++ b/scripting/source/storage/ScriptSecurityManager.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -97,3 +98,5 @@ private: } // scripting_securitymgr #endif //_FRAMEWORK_SCRIPT_SCRIPTSECURITYMANAGER_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptStorage.cxx b/scripting/source/storage/ScriptStorage.cxx index 7919904c40..4837ffa0e2 100644 --- a/scripting/source/storage/ScriptStorage.cxx +++ b/scripting/source/storage/ScriptStorage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -69,8 +70,8 @@ const sal_Char * const SCRIPT_DIR = "/Scripts"; const sal_Char * const SCRIPT_PARCEL = "/parcel-descriptor.xml"; const sal_Char * const SCRIPT_PARCEL_NAME_ONLY = "parcel-descriptor"; -static OUString ss_implName = OUString::createFromAscii( IMPL_NAME ); -static OUString ss_serviceName = OUString::createFromAscii( SERVICE_NAME ); +static OUString ss_implName(RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME )); +static OUString ss_serviceName(RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME )); static Sequence< OUString > ss_serviceNames = Sequence< OUString >( &ss_serviceName, 1 ); @@ -103,8 +104,8 @@ throw ( RuntimeException ) mh_scriptLangs = new ScriptLanguages_hash(); Reference< XInterface > xInterface = m_xMgr->createInstanceWithContext( - OUString::createFromAscii( - "com.sun.star.configuration.ConfigurationProvider" ) + OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.ConfigurationProvider" )) , m_xContext ); validateXRef( xInterface, "ScriptStorage::ScriptStorage: cannot get ConfigurationProvider" ); @@ -116,14 +117,14 @@ throw ( RuntimeException ) validateXRef( xConfigProvFactory, "ScriptStorage::ScriptStorage: cannot get XMultiServiceFactory interface from ConfigurationProvider" ); beans::PropertyValue configPath; - configPath.Name = ::rtl::OUString::createFromAscii( "nodepath" ); - configPath.Value <<= ::rtl::OUString::createFromAscii( "org.openoffice.Office.Scripting/ScriptRuntimes" ); + configPath.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")); + configPath.Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Scripting/ScriptRuntimes")); Sequence < Any > aargs( 1 ); aargs[ 0 ] <<= configPath; xInterface = xConfigProvFactory->createInstanceWithArguments( - OUString::createFromAscii( - "com.sun.star.configuration.ConfigurationAccess"), + OUString(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.ConfigurationAccess")), aargs ); validateXRef( xInterface, "ScriptStorage::ScriptStorage: cannot get ConfigurationAccess" ); @@ -143,7 +144,7 @@ throw ( RuntimeException ) validateXRef( xPropSet, "ScriptStorage::ScriptStorage: cannot get XPropertySet for name" ); Any aProp = xPropSet->getPropertyValue( - OUString::createFromAscii( "SupportedFileExtensions") ); + OUString(RTL_CONSTASCII_USTRINGPARAM("SupportedFileExtensions")) ); Sequence< OUString > extns; if( sal_False == ( aProp >>= extns ) ) { @@ -289,8 +290,8 @@ throw ( RuntimeException, Exception ) validateXRef( xSMI, "ScriptStorage::create: failed to obtain valid XExtendedDocumentHandler" ); - xStringUri = xStringUri.concat( ::rtl::OUString::createFromAscii( - SCRIPT_DIR ) ); + xStringUri = xStringUri.concat( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + SCRIPT_DIR )) ); // No Scripts directory - just return if ( ! m_xSimpleFileAccess->isFolder( xStringUri ) ) @@ -328,7 +329,7 @@ throw ( RuntimeException, Exception ) RTL_TEXTENCODING_ASCII_US ).pData->buffer ); OUString parcelFile = parcelDirs[ j ].concat( - ::rtl::OUString::createFromAscii( SCRIPT_PARCEL ) ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCRIPT_PARCEL )) ); // Do not have a valid parcel.xml if ( !m_xSimpleFileAccess->exists( parcelFile ) || @@ -447,7 +448,7 @@ throw ( RuntimeException, Exception ) // the char just after the filesep lastFileSep += 1; sal_Int32 lastFileExt = xStringUri.lastIndexOf( fileExtension ); - OUString searchString = OUString::createFromAscii( "://" ); + OUString searchString(RTL_CONSTASCII_USTRINGPARAM("://")); sal_Int32 searchStringLength = searchString.getLength(); sal_Int32 startPath = xStringUri.indexOf( searchString ); sal_Int32 uriLength = xStringUri.getLength(); @@ -499,7 +500,7 @@ ScriptStorage::getFileExtension( const OUString & stringUri ) } else { - fileExtension = OUString::createFromAscii(""); + fileExtension = OUString(RTL_CONSTASCII_USTRINGPARAM("")); } return fileExtension; } @@ -558,8 +559,8 @@ throw ( RuntimeException ) // xScriptInvocation = Reference<XScriptInvocation>(xx, UNO_QUERY_THROW); Reference< xml::sax::XExtendedDocumentHandler > xHandler; - OUString parcel_suffix = OUString::createFromAscii( SCRIPT_PARCEL ); - OUString ou_parcel = OUString( + OUString parcel_suffix(RTL_CONSTASCII_USTRINGPARAM( SCRIPT_PARCEL )); + OUString ou_parcel( RTL_CONSTASCII_USTRINGPARAM( SCRIPT_PARCEL_NAME_ONLY ) ); try @@ -583,13 +584,13 @@ throw ( RuntimeException ) xOS = m_xSimpleFileAccess->openFileWrite( parcel_xml_path ); OSL_TRACE( "saving: %s\n", rtl::OUStringToOString( - it_sfh->second.parcelURI.concat( OUString::createFromAscii( - "/parcel.xml" ) ), + it_sfh->second.parcelURI.concat( OUString(RTL_CONSTASCII_USTRINGPARAM( + "/parcel.xml" )) ), RTL_TEXTENCODING_ASCII_US ).pData->buffer ); Reference< XInterface > xInterface = m_xMgr->createInstanceWithContext( - OUString::createFromAscii( "com.sun.star.xml.sax.Writer" ), + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")), m_xContext ); validateXRef( xInterface, "ScriptStorage::save: cannot get sax.Writer" ); xHandler = Reference<xml::sax::XExtendedDocumentHandler>( @@ -893,3 +894,5 @@ SAL_THROW( () ) return ::scripting_impl::ss_implName; } }//end namespace + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptStorage.hxx b/scripting/source/storage/ScriptStorage.hxx index fce94d8a3a..064b929a44 100644 --- a/scripting/source/storage/ScriptStorage.hxx +++ b/scripting/source/storage/ScriptStorage.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -203,3 +204,5 @@ private: } // namespace scripting_impl #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptStorageManager.cxx b/scripting/source/storage/ScriptStorageManager.cxx index 1ba7c7187a..5f6d6f4536 100644 --- a/scripting/source/storage/ScriptStorageManager.cxx +++ b/scripting/source/storage/ScriptStorageManager.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,12 +55,10 @@ using namespace ::drafts::com::sun::star::script::framework; namespace scripting_impl { -static OUString s_implName = - ::rtl::OUString::createFromAscii( - "drafts.com.sun.star.script.framework.storage.ScriptStorageManager" ); -static OUString s_serviceName = - ::rtl::OUString::createFromAscii( +static OUString s_implName(RTL_CONSTASCII_USTRINGPARAM( "drafts.com.sun.star.script.framework.storage.ScriptStorageManager" ); +static OUString s_serviceName(RTL_CONSTASCII_USTRINGPARAM( + "drafts.com.sun.star.script.framework.storage.ScriptStorageManager" )); static Sequence< OUString > s_serviceNames = Sequence< OUString >( &s_serviceName, 1 ); //extern ::rtl_StandardModuleCount s_moduleCount = MODULE_COUNT_INIT; @@ -86,8 +85,8 @@ ScriptStorageManager::ScriptStorageManager( const Reference< { // obtain the macro expander singleton to use in determining the // location of the application script storage - Any aAny = m_xContext->getValueByName( OUString::createFromAscii( - "/singletons/com.sun.star.util.theMacroExpander" ) ); + Any aAny = m_xContext->getValueByName( OUString(RTL_CONSTASCII_USTRINGPARAM( + "/singletons/com.sun.star.util.theMacroExpander" )) ); Reference< util::XMacroExpander > xME; if ( sal_False == ( aAny >>= xME ) ) { @@ -97,14 +96,14 @@ ScriptStorageManager::ScriptStorageManager( const Reference< } validateXRef( xME, "ScriptStorageManager constructor: can't get MacroExpander" ); - OUString base = OUString::createFromAscii( - SAL_CONFIGFILE( "${$BRAND_BASE_DIR/program/bootstrap" ) ); + OUString base(RTL_CONSTASCII_USTRINGPARAM( + SAL_CONFIGFILE( "${$BRAND_BASE_DIR/program/bootstrap" )) ); setupAppStorage( xME, - base.concat( OUString::createFromAscii( "::BaseInstallation}/share" ) ), + base.concat( OUString(RTL_CONSTASCII_USTRINGPARAM("::BaseInstallation}/share")) ), OUSTR( "SHARE" ) ); setupAppStorage( xME, - base.concat( OUString::createFromAscii( "::UserInstallation}/user" ) ), + base.concat( OUString(RTL_CONSTASCII_USTRINGPARAM("::UserInstallation}/user")) ), OUSTR( "USER" ) ); } @@ -128,7 +127,7 @@ SAL_THROW ( ( RuntimeException ) ) { Reference< XInterface > xInterface = m_xMgr->createInstanceWithContext( - OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), m_xContext ); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), m_xContext ); validateXRef( xInterface, "ScriptStorageManager constructor: can't get SimpleFileAccess XInterface" ); Reference< ucb::XSimpleFileAccess > xSFA( xInterface, UNO_QUERY_THROW ); @@ -170,8 +169,8 @@ SAL_THROW ( ( RuntimeException ) ) Reference< XInterface > xInterface = m_xMgr->createInstanceWithArgumentsAndContext( - OUString::createFromAscii( - "drafts.com.sun.star.script.framework.storage.ScriptStorage" ), + OUString(RTL_CONSTASCII_USTRINGPARAM( + "drafts.com.sun.star.script.framework.storage.ScriptStorage" )), aArgs, m_xContext ); validateXRef( xInterface, "ScriptStorageManager:: setupAnyStorage: Can't create ScriptStorage for share" ); @@ -218,8 +217,8 @@ throw ( RuntimeException ) validateXRef( xSFA, "ScriptStorageManager::createScriptStorage: XSimpleFileAccess is not valid" ); - return setupAnyStorage( xSFA, ::rtl::OUString::createFromAscii( "" ), - ::rtl::OUString::createFromAscii( "" ) ); + return setupAnyStorage( xSFA, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("")) ); } //************************************************************************* @@ -236,7 +235,7 @@ throw ( RuntimeException ) // workaround issue: no functionProvider created on doc open // if NODIALOG tag, strip from stringURI, set boolean=true bool displayDialog = true; - ::rtl::OUString dialogTag = ::rtl::OUString::createFromAscii( "NoDialog::" ); + ::rtl::OUString dialogTag(RTL_CONSTASCII_USTRINGPARAM("NoDialog::")); ::rtl::OUString stringURI = cStringURI; if( stringURI.indexOf( dialogTag ) == 0 ) { @@ -248,8 +247,7 @@ throw ( RuntimeException ) // convert file:///... url to vnd... syntax - ::rtl::OUString canonicalURI( - ::rtl::OUString::createFromAscii( "vnd.sun.star.pkg://" ) ); + ::rtl::OUString canonicalURI(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.pkg://")); canonicalURI = canonicalURI.concat( ::rtl::Uri::encode( stringURI, rtl_UriCharClassUricNoSlash, rtl_UriEncodeCheckEscapes, RTL_TEXTENCODING_ASCII_US ) ); @@ -571,3 +569,5 @@ SAL_THROW( () ) return ::scripting_impl::s_implName; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptStorageManager.hxx b/scripting/source/storage/ScriptStorageManager.hxx index 4cabe11772..a06409be28 100644 --- a/scripting/source/storage/ScriptStorageManager.hxx +++ b/scripting/source/storage/ScriptStorageManager.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -223,3 +224,5 @@ private: } // scripting_impl #endif //_COM_SUN_STAR_SCRIPTING_STORAGE_SCRIPTSTORAGEMANAGER_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptURI.cxx b/scripting/source/storage/ScriptURI.cxx index ad68531027..7fa195570f 100644 --- a/scripting/source/storage/ScriptURI.cxx +++ b/scripting/source/storage/ScriptURI.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,7 +47,7 @@ using namespace ::com::sun::star::lang; namespace scripting_impl { -static const OUString schema = OUString::createFromAscii( "vnd.sun.star.script://" ); +static const OUString schema(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.script://")); /** * Constructor @@ -225,3 +226,5 @@ Uri ScriptURI::parseIt() } } // namespace script_uri + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/ScriptURI.hxx b/scripting/source/storage/ScriptURI.hxx index bbfe170c56..0d1ac98598 100644 --- a/scripting/source/storage/ScriptURI.hxx +++ b/scripting/source/storage/ScriptURI.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -118,3 +119,5 @@ private: } //namespace script_uri #endif // define __FRAMEWORK_STORAGE_SCRIPTURI_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/XMLElement.cxx b/scripting/source/storage/XMLElement.cxx index 9d218460bf..42fea9353d 100644 --- a/scripting/source/storage/XMLElement.cxx +++ b/scripting/source/storage/XMLElement.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -167,3 +168,5 @@ throw ( RuntimeException ) } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/storage/XMLElement.hxx b/scripting/source/storage/XMLElement.hxx index 07cd4e8d5e..798e360b23 100644 --- a/scripting/source/storage/XMLElement.hxx +++ b/scripting/source/storage/XMLElement.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -138,3 +139,5 @@ protected: } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index bbde6609e0..ec6f46cb29 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,9 +37,7 @@ #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/lang/XMultiComponentFactory.hpp> -#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_ #include <cppuhelper/implementationentry.hxx> -#endif #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XNameAccess.hpp> @@ -209,7 +208,7 @@ void StringResourceImpl::removeModifyListener( const Reference< XModifyListener } if( !bSuccess ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "StringResourceImpl: No entry for ResourceID: " ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("StringResourceImpl: No entry for ResourceID: ")); errorMsg.concat( ResourceID ); throw ::com::sun::star::resource::MissingResourceException( errorMsg, Reference< XInterface >() ); } @@ -271,7 +270,7 @@ Sequence< ::rtl::OUString > StringResourceImpl::implGetResourceIDs( LocaleItem* IdToStringMap::const_iterator it; int iTarget = 0; - for( it = rHashMap.begin(); it != rHashMap.end(); it++ ) + for( it = rHashMap.begin(); it != rHashMap.end(); ++it ) { ::rtl::OUString aStr = (*it).first; pStrings[iTarget] = aStr; @@ -457,7 +456,7 @@ void StringResourceImpl::implRemoveId( const ::rtl::OUString& ResourceID, Locale IdToStringMap::iterator it = rHashMap.find( ResourceID ); if( it == rHashMap.end() ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "StringResourceImpl: No entries for ResourceID: " ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("StringResourceImpl: No entries for ResourceID: ")); errorMsg.concat( ResourceID ); throw ::com::sun::star::resource::MissingResourceException( errorMsg, Reference< XInterface >() ); } @@ -492,7 +491,7 @@ void StringResourceImpl::newLocale( const Locale& locale ) if( getItemForLocale( locale, false ) != NULL ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "StringResourceImpl: locale already exists" ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("StringResourceImpl: locale already exists")); throw ElementExistException( errorMsg, Reference< XInterface >() ); } @@ -513,7 +512,7 @@ void StringResourceImpl::newLocale( const Locale& locale ) const IdToStringMap& rSourceMap = pCopyFromItem->m_aIdToStringMap; IdToStringMap& rTargetMap = pLocaleItem->m_aIdToStringMap; IdToStringMap::const_iterator it; - for( it = rSourceMap.begin(); it != rSourceMap.end(); it++ ) + for( it = rSourceMap.begin(); it != rSourceMap.end(); ++it ) { ::rtl::OUString aId = (*it).first; ::rtl::OUString aStr = (*it).second; @@ -523,7 +522,7 @@ void StringResourceImpl::newLocale( const Locale& locale ) const IdToIndexMap& rSourceIndexMap = pCopyFromItem->m_aIdToIndexMap; IdToIndexMap& rTargetIndexMap = pLocaleItem->m_aIdToIndexMap; IdToIndexMap::const_iterator it_index; - for( it_index = rSourceIndexMap.begin(); it_index != rSourceIndexMap.end(); it_index++ ) + for( it_index = rSourceIndexMap.begin(); it_index != rSourceIndexMap.end(); ++it_index ) { ::rtl::OUString aId = (*it_index).first; sal_Int32 nIndex = (*it_index).second; @@ -545,7 +544,7 @@ void StringResourceImpl::newLocale( const Locale& locale ) } else { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "StringResourceImpl: Invalid locale" ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("StringResourceImpl: Invalid locale")); throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 ); } } @@ -650,7 +649,7 @@ sal_Int32 StringResourceImpl::getUniqueNumericId( ) if( m_nNextUniqueNumericId < UNIQUE_NUMBER_NEEDS_INITIALISATION ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "getUniqueNumericId: Extended sal_Int32 range" ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("getUniqueNumericId: Extended sal_Int32 range")); throw NoSupportException( errorMsg, Reference< XInterface >() ); } return m_nNextUniqueNumericId; @@ -685,7 +684,7 @@ LocaleItem* StringResourceImpl::getItemForLocale if( pRetItem == NULL && bException ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "StringResourceImpl: Invalid locale" ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("StringResourceImpl: Invalid locale")); throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 ); } return pRetItem; @@ -831,7 +830,7 @@ Sequence< ::rtl::OUString > StringResourcePersistenceImpl::getSupportedServiceNa // XInitialization base functionality for derived classes // ----------------------------------------------------------------------------- -static ::rtl::OUString aNameBaseDefaultStr = ::rtl::OUString::createFromAscii( "strings" ); +static ::rtl::OUString aNameBaseDefaultStr(RTL_CONSTASCII_USTRINGPARAM("strings")); void StringResourcePersistenceImpl::implInitializeCommonParameters ( const Sequence< Any >& aArguments ) @@ -840,7 +839,7 @@ void StringResourcePersistenceImpl::implInitializeCommonParameters bool bReadOnlyOk = (aArguments[1] >>= m_bReadOnly); if( !bReadOnlyOk ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "XInitialization::initialize: Expected ReadOnly flag" ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("XInitialization::initialize: Expected ReadOnly flag")); throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 1 ); } @@ -848,14 +847,14 @@ void StringResourcePersistenceImpl::implInitializeCommonParameters bool bLocaleOk = (aArguments[2] >>= aCurrentLocale); if( !bLocaleOk ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "XInitialization::initialize: Expected Locale" ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("XInitialization::initialize: Expected Locale")); throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 2 ); } bool bNameBaseOk = (aArguments[3] >>= m_aNameBase); if( !bNameBaseOk ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "XInitialization::initialize: Expected NameBase string" ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("XInitialization::initialize: Expected NameBase string")); throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 3 ); } if( m_aNameBase.getLength() == 0 ) @@ -864,7 +863,7 @@ void StringResourcePersistenceImpl::implInitializeCommonParameters bool bCommentOk = (aArguments[4] >>= m_aComment); if( !bCommentOk ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "XInitialization::initialize: Expected Comment string" ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("XInitialization::initialize: Expected Comment string")); throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 4 ); } @@ -1044,7 +1043,7 @@ void StringResourcePersistenceImpl::implStoreAtStorage if( pLocaleItem != NULL ) { ::rtl::OUString aStreamName = implGetFileNameForLocaleItem( pLocaleItem, m_aNameBase ); - aStreamName += ::rtl::OUString::createFromAscii( ".properties" ); + aStreamName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".properties")); try { @@ -1066,13 +1065,13 @@ void StringResourcePersistenceImpl::implStoreAtStorage loadLocale( pLocaleItem ) ) { ::rtl::OUString aStreamName = implGetFileNameForLocaleItem( pLocaleItem, aNameBase ); - aStreamName += ::rtl::OUString::createFromAscii( ".properties" ); + aStreamName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".properties")); Reference< io::XStream > xElementStream = Storage->openStreamElement( aStreamName, ElementModes::READWRITE ); - ::rtl::OUString aPropName = ::rtl::OUString::createFromAscii( "MediaType" ); - ::rtl::OUString aMime = ::rtl::OUString::createFromAscii( "text/plain" ); + ::rtl::OUString aPropName(RTL_CONSTASCII_USTRINGPARAM("MediaType")); + ::rtl::OUString aMime(RTL_CONSTASCII_USTRINGPARAM("text/plain")); uno::Reference< beans::XPropertySet > xProps( xElementStream, uno::UNO_QUERY ); OSL_ENSURE( xProps.is(), "The StorageStream must implement XPropertySet interface!\n" ); @@ -1080,7 +1079,7 @@ void StringResourcePersistenceImpl::implStoreAtStorage { xProps->setPropertyValue( aPropName, uno::makeAny( aMime ) ); - aPropName = ::rtl::OUString::createFromAscii( "UseCommonStoragePasswordEncryption" ); + aPropName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseCommonStoragePasswordEncryption")); xProps->setPropertyValue( aPropName, uno::makeAny( sal_True ) ); } @@ -1104,7 +1103,7 @@ void StringResourcePersistenceImpl::implStoreAtStorage if( pLocaleItem != NULL ) { ::rtl::OUString aStreamName = implGetFileNameForLocaleItem( pLocaleItem, m_aNameBase ); - aStreamName += ::rtl::OUString::createFromAscii( ".default" ); + aStreamName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".default")); try { @@ -1123,13 +1122,13 @@ void StringResourcePersistenceImpl::implStoreAtStorage if( m_pDefaultLocaleItem != NULL && (bStoreAll || m_bDefaultModified) ) { ::rtl::OUString aStreamName = implGetFileNameForLocaleItem( m_pDefaultLocaleItem, aNameBase ); - aStreamName += ::rtl::OUString::createFromAscii( ".default" ); + aStreamName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".default")); Reference< io::XStream > xElementStream = Storage->openStreamElement( aStreamName, ElementModes::READWRITE ); - ::rtl::OUString aPropName = ::rtl::OUString::createFromAscii( "MediaType" ); - ::rtl::OUString aMime = ::rtl::OUString::createFromAscii( "text/plain" ); + ::rtl::OUString aPropName(RTL_CONSTASCII_USTRINGPARAM("MediaType")); + ::rtl::OUString aMime(RTL_CONSTASCII_USTRINGPARAM("text/plain")); // Only create stream without content Reference< io::XOutputStream > xOutputStream = xElementStream->getOutputStream(); @@ -1153,7 +1152,7 @@ void StringResourcePersistenceImpl::storeToURL( const ::rtl::OUString& URL, Reference< XMultiComponentFactory > xMCF = getMultiComponentFactory(); Reference< ucb::XSimpleFileAccess > xFileAccess; xFileAccess = Reference< ucb::XSimpleFileAccess >( xMCF->createInstanceWithContext - ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), + ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), m_xContext ), UNO_QUERY ); if( xFileAccess.is() && Handler.is() ) xFileAccess->setInteractionHandler( Handler ); @@ -1295,10 +1294,10 @@ public: BinaryOutput( Reference< XMultiComponentFactory > xMCF, Reference< XComponentContext > xContext ); - Reference< io::XOutputStream > getOutputStream( void ) + Reference< io::XOutputStream > getOutputStream() const { return m_xOutputStream; } - Sequence< ::sal_Int8 > closeAndGetData( void ); + Sequence< ::sal_Int8 > closeAndGetData(); // Template to be used with sal_Int16 and sal_Unicode template< class T > @@ -1317,7 +1316,7 @@ BinaryOutput::BinaryOutput( Reference< XMultiComponentFactory > xMCF, , m_xContext( xContext ) { m_xTempFile = m_xMCF->createInstanceWithContext - ( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ), m_xContext ); + ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile")), m_xContext ); if( m_xTempFile.is() ) m_xOutputStream = Reference< io::XOutputStream >( m_xTempFile, UNO_QUERY ); } @@ -1366,7 +1365,7 @@ void BinaryOutput::writeString( const ::rtl::OUString& aStr ) writeUnicodeChar( 0 ); } -Sequence< ::sal_Int8 > BinaryOutput::closeAndGetData( void ) +Sequence< ::sal_Int8 > BinaryOutput::closeAndGetData() { Sequence< ::sal_Int8 > aRetSeq; if( !m_xOutputStream.is() ) @@ -1519,7 +1518,7 @@ public: Reference< io::XInputStream > getInputStreamForSection( sal_Int32 nSize ); void seek( sal_Int32 nPos ); - sal_Int32 getPosition( void ) + sal_Int32 getPosition( void ) const { return m_nCurPos; } sal_Int16 readInt16( void ); @@ -1545,7 +1544,7 @@ Reference< io::XInputStream > BinaryInput::getInputStreamForSection( sal_Int32 n if( m_nCurPos + nSize <= m_nSize ) { Reference< io::XOutputStream > xTempOut( m_xMCF->createInstanceWithContext - ( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ), m_xContext ), UNO_QUERY ); + ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile")), m_xContext ), UNO_QUERY ); if( xTempOut.is() ) { Sequence< sal_Int8 > aSection( m_pData + m_nCurPos, nSize ); @@ -1771,7 +1770,7 @@ void StringResourcePersistenceImpl::implScanLocaleNames( const Sequence< ::rtl:: aExtension = aCompleteName.copy( iDot + 1 ); } - if( aExtension.equalsAscii( "properties" ) ) + if( aExtension.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "properties" ) ) ) { //rtl::OUString aName = aInetObj.getBase(); Locale aLocale; @@ -1791,7 +1790,7 @@ void StringResourcePersistenceImpl::implScanLocaleNames( const Sequence< ::rtl:: } } } - else if( !bDefaultFound && aExtension.equalsAscii( "default" ) ) + else if( !bDefaultFound && aExtension.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "default" ) ) ) { //rtl::OUString aName = aInetObj.getBase(); Locale aLocale; @@ -1847,7 +1846,7 @@ bool StringResourcePersistenceImpl::implLoadLocale( LocaleItem* ) ::rtl::OUString implGetNameScemeForLocaleItem( const LocaleItem* pLocaleItem ) { - static ::rtl::OUString aUnder = ::rtl::OUString::createFromAscii( "_" ); + static ::rtl::OUString aUnder(RTL_CONSTASCII_USTRINGPARAM("_")); OSL_ENSURE( pLocaleItem, "StringResourcePersistenceImpl::implGetNameScemeForLocaleItem(): pLocaleItem == NULL" ); @@ -2018,7 +2017,7 @@ bool StringResourcePersistenceImpl::implReadPropertiesFile bool bSuccess = false; Reference< XMultiComponentFactory > xMCF = getMultiComponentFactory(); Reference< io::XTextInputStream > xTextInputStream( xMCF->createInstanceWithContext - ( ::rtl::OUString::createFromAscii( "com.sun.star.io.TextInputStream" ), m_xContext ), UNO_QUERY ); + ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TextInputStream")), m_xContext ), UNO_QUERY ); if( xTextInputStream.is() ) { @@ -2230,8 +2229,8 @@ void implWriteStringWithEncoding( const ::rtl::OUString& aStr, bool StringResourcePersistenceImpl::implWritePropertiesFile( LocaleItem* pLocaleItem, const Reference< io::XOutputStream >& xOutputStream, const ::rtl::OUString& aComment ) { - static ::rtl::OUString aAssignmentStr = ::rtl::OUString::createFromAscii( "=" ); - static ::rtl::OUString aLineFeedStr = ::rtl::OUString::createFromAscii( "\n" ); + static ::rtl::OUString aAssignmentStr(RTL_CONSTASCII_USTRINGPARAM("=")); + static ::rtl::OUString aLineFeedStr(RTL_CONSTASCII_USTRINGPARAM("\n")); if( !xOutputStream.is() || pLocaleItem == NULL ) return false; @@ -2239,7 +2238,7 @@ bool StringResourcePersistenceImpl::implWritePropertiesFile( LocaleItem* pLocale bool bSuccess = false; Reference< XMultiComponentFactory > xMCF = getMultiComponentFactory(); Reference< io::XTextOutputStream > xTextOutputStream( xMCF->createInstanceWithContext - ( ::rtl::OUString::createFromAscii( "com.sun.star.io.TextOutputStream" ), m_xContext ), UNO_QUERY ); + ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TextOutputStream")), m_xContext ), UNO_QUERY ); if( xTextOutputStream.is() ) { @@ -2265,7 +2264,7 @@ bool StringResourcePersistenceImpl::implWritePropertiesFile( LocaleItem* pLocale // Find max/min index sal_Int32 nMinIndex = -1; sal_Int32 nMaxIndex = -1; - for( it_index = rIndexMap.begin(); it_index != rIndexMap.end(); it_index++ ) + for( it_index = rIndexMap.begin(); it_index != rIndexMap.end(); ++it_index ) { sal_Int32 nIndex = (*it_index).second; if( nMinIndex > nIndex || nMinIndex == -1 ) @@ -2280,7 +2279,7 @@ bool StringResourcePersistenceImpl::implWritePropertiesFile( LocaleItem* pLocale sal_Int32 i; for( i = 0 ; i < nTabSize ; i++ ) pIdPtrs[i] = NULL; - for( it_index = rIndexMap.begin(); it_index != rIndexMap.end(); it_index++ ) + for( it_index = rIndexMap.begin(); it_index != rIndexMap.end(); ++it_index ) { sal_Int32 nIndex = (*it_index).second; pIdPtrs[nIndex - nMinIndex] = &((*it_index).first); @@ -2403,7 +2402,7 @@ void StringResourceWithStorageImpl::initialize( const Sequence< Any >& aArgument if( !bOk ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "StringResourceWithStorageImpl::initialize: invalid storage" ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("StringResourceWithStorageImpl::initialize: invalid storage")); throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 ); } @@ -2594,8 +2593,8 @@ void StringResourceWithStorageImpl::setStorage( const Reference< XStorage >& Sto if( !Storage.is() ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii - ( "StringResourceWithStorageImpl::setStorage: invalid storage" ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM + ( "StringResourceWithStorageImpl::setStorage: invalid storage" )); throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 ); } @@ -2745,12 +2744,12 @@ void StringResourceWithLocationImpl::initialize( const Sequence< Any >& aArgumen else { if( m_aLocation.getStr()[nLen - 1] != '/' ) - m_aLocation += ::rtl::OUString::createFromAscii( "/" ); + m_aLocation += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); } if( !bOk ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "XInitialization::initialize: invalid URL" ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("XInitialization::initialize: invalid URL")); throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 ); } @@ -2758,7 +2757,7 @@ void StringResourceWithLocationImpl::initialize( const Sequence< Any >& aArgumen bOk = (aArguments[5] >>= m_xInteractionHandler); if( !bOk ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii( "StringResourceWithStorageImpl::initialize: invalid type" ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM("StringResourceWithStorageImpl::initialize: invalid type")); throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 5 ); } @@ -2954,8 +2953,8 @@ void StringResourceWithLocationImpl::setURL( const ::rtl::OUString& URL ) sal_Int32 nLen = URL.getLength(); if( nLen == 0 ) { - ::rtl::OUString errorMsg = ::rtl::OUString::createFromAscii - ( "StringResourceWithLocationImpl::setURL: invalid URL" ); + ::rtl::OUString errorMsg(RTL_CONSTASCII_USTRINGPARAM + ( "StringResourceWithLocationImpl::setURL: invalid URL" )); throw IllegalArgumentException( errorMsg, Reference< XInterface >(), 0 ); } @@ -3024,7 +3023,7 @@ const Reference< ucb::XSimpleFileAccess > StringResourceWithLocationImpl::getFil { Reference< XMultiComponentFactory > xMCF = getMultiComponentFactory(); m_xSFI = Reference< ucb::XSimpleFileAccess >( xMCF->createInstanceWithContext - ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), m_xContext ), UNO_QUERY ); + ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")), m_xContext ), UNO_QUERY ); if( m_xSFI.is() && m_xInteractionHandler.is() ) m_xSFI->setInteractionHandler( m_xInteractionHandler ); @@ -3088,3 +3087,5 @@ extern "C" pImplName, pServiceManager, pRegistryKey, ::stringresource::s_component_entries ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/stringresource/stringresource.hxx b/scripting/source/stringresource/stringresource.hxx index 81ee75f057..656a872509 100644 --- a/scripting/source/stringresource/stringresource.hxx +++ b/scripting/source/stringresource/stringresource.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,12 +29,8 @@ #ifndef SCRIPTING_DLGPROV_HXX #define SCRIPTING_DLGPROV_HXX -#ifndef _COM_SUN_STAR_AWT_XSTRINGRESOURCEWITHSTORAGE_HPP_ #include <com/sun/star/resource/XStringResourceWithStorage.hpp> -#endif -#ifndef _COM_SUN_STAR_AWT_XSTRINGRESOURCEWITHSTORAGE_HPP_ #include <com/sun/star/resource/XStringResourceWithLocation.hpp> -#endif #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/uno/XComponentContext.hpp> @@ -689,3 +686,5 @@ public: //......................................................................... #endif // SCRIPTING_DLGPROV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/source/vbaevents/makefile.mk b/scripting/source/vbaevents/makefile.mk deleted file mode 100755 index cb0e9feaec..0000000000 --- a/scripting/source/vbaevents/makefile.mk +++ /dev/null @@ -1,101 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.0 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=scripting -TARGET=vbaevents -.IF "$(ENABLE_VBA)"!="YES" -dummy: - @echo "not building vbaevents..." -.ENDIF - -VISIBILITY_HIDDEN=TRUE -NO_BSYMBOLIC= TRUE -ENABLE_EXCEPTIONS=TRUE -COMP1TYPELIST=$(TARGET) -COMPRDB=$(SOLARBINDIR)$/types.rdb - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -DLLPRE = - -# ------------------------------------------------------------------ - -#.INCLUDE : ..$/cppumaker.mk - -SLOFILES= \ - $(SLO)$/service.obj \ - $(SLO)$/eventhelper.obj - -SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno -SHL1IMPLIB= i$(TARGET) - -SHL1VERSIONMAP=$(SOLARENV)/src/component.map -SHL1DEF=$(MISC)$/$(SHL1TARGET).def -DEF1NAME=$(SHL1TARGET) - -SHL1STDLIBS= \ - $(CPPUHELPERLIB) \ - $(BASICLIB) \ - $(COMPHELPERLIB) \ - $(SFXLIB) \ - $(CPPULIB) \ - $(TOOLSLIB) \ - $(SALLIB) - -SHL1DEPN= -SHL1LIBS=$(SLB)$/$(TARGET).lib - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - -# ------------------------------------------------------------------ - -ALLTAR : \ - $(MISC)$/$(TARGET).don \ - -$(SLOFILES) : $(MISC)$/$(TARGET).don - -$(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb - +$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@ - echo $@ - - -ALLTAR : $(MISC)/vbaevents.component - -$(MISC)/vbaevents.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ - vbaevents.component - $(XSLTPROC) --nonet --stringparam uri \ - '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ - $(SOLARENV)/bin/createcomponent.xslt vbaevents.component diff --git a/scripting/source/vbaevents/vbamsformreturntypes.hxx b/scripting/source/vbaevents/vbamsformreturntypes.hxx new file mode 100644 index 0000000000..82e6ddce8f --- /dev/null +++ b/scripting/source/vbaevents/vbamsformreturntypes.hxx @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009, 2010. + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef VBA_MSFORM_RETURNTYPES_HXX +#define VBA_MSFORM_RETURNTYPES_HXX + +#include <cppuhelper/implbase1.hxx> +#include <msforms/XReturnBoolean.hpp> +#include <msforms/XReturnInteger.hpp> + + +typedef ::cppu::WeakImplHelper1<msforms::XReturnBoolean> ReturnBoolean_BASE; + +class SAL_DLLPUBLIC_EXPORT VbaReturnBoolean : public ReturnBoolean_BASE +{ +public: + sal_Bool Value; + +public: + VbaReturnBoolean() : Value(false) {} ; + + // XReturnBoolean + virtual ::sal_Bool SAL_CALL getValue() throw (::com::sun::star::uno::RuntimeException) { return Value; } + virtual void SAL_CALL setValue( ::sal_Bool _value ) throw (::com::sun::star::uno::RuntimeException) { Value = _value; } + + // XDefaultProperty + ::rtl::OUString SAL_CALL getDefaultPropertyName() throw (com::sun::star::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); } +}; + + +typedef ::cppu::WeakImplHelper1<msforms::XReturnInteger> ReturnInteger_BASE; + +class SAL_DLLPUBLIC_EXPORT VbaReturnInteger : public ReturnInteger_BASE +{ +public: + sal_Int32 Value; + +public: + VbaReturnInteger() : Value(0) {} ; + + // XReturnInteger + virtual ::sal_Int32 SAL_CALL getValue() throw (::com::sun::star::uno::RuntimeException) { return Value; } + virtual void SAL_CALL setValue( ::sal_Int32 _value ) throw (::com::sun::star::uno::RuntimeException) { Value = _value; } + + // XDefaultProperty + ::rtl::OUString SAL_CALL getDefaultPropertyName() throw (com::sun::star::uno::RuntimeException) { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); } +}; +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scripting/util/provider/beanshell/delzip b/scripting/util/provider/beanshell/delzip new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/scripting/util/provider/beanshell/delzip diff --git a/scripting/util/provider/beanshell/description.xml b/scripting/util/provider/beanshell/description.xml new file mode 100644 index 0000000000..6b053188bf --- /dev/null +++ b/scripting/util/provider/beanshell/description.xml @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<description + xmlns="http://openoffice.org/extensions/description/2006" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:dep="http://openoffice.org/extensions/description/2006"> + + <identifier value="com.sun.star.script.provider.ScriptProviderForBeanShell"/> + + <dependencies> + <OpenOffice.org-minimal-version value="3.0" dep:name="OpenOffice.org 3.0"/> + </dependencies> + + <version value="3.3.0"/> + + <publisher> + <name xlink:href="http://www.documentfoundation.org" lang="en">The + Document Foundation</name> + </publisher> + + <display-name> + <name lang="en">Script provider for BeanShell</name> + </display-name> + +</description> diff --git a/scripting/util/provider/beanshell/makefile.mk b/scripting/util/provider/beanshell/makefile.mk new file mode 100644 index 0000000000..7e16329fda --- /dev/null +++ b/scripting/util/provider/beanshell/makefile.mk @@ -0,0 +1,48 @@ +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Red Hat, Inc. +# Portions created by the Initial Developer are Copyright (C) 2010 the +# Initial Developer. All Rights Reserved. +# +# Contributor(s): David Tardon <dtardon@redhat.com> +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +PRJ=..$/..$/.. + +PRJNAME=scripting +TARGET=bshprov + +.INCLUDE : settings.mk + +.IF "$(L10N_framework)"=="" && "$(SOLAR_JAVA)"!="" + +EXTENSIONNAME:=ScriptProviderForBeanShell +EXTENSION_ZIPNAME:=script-provider-for-beanshell + +COMPONENT_JARFILES=$(EXTENSIONDIR)$/$(EXTENSIONNAME).jar + +.INCLUDE : extension_pre.mk +.INCLUDE : target.mk +.INCLUDE : extension_post.mk + +.ELSE + +.INCLUDE : target.mk + +.ENDIF diff --git a/scripting/util/provider/beanshell/manifest.xml b/scripting/util/provider/beanshell/manifest.xml new file mode 100644 index 0000000000..da8e620281 --- /dev/null +++ b/scripting/util/provider/beanshell/manifest.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd"> +<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest"> + <manifest:file-entry + manifest:media-type="application/vnd.sun.star.uno-component;type=java" + manifest:full-path="ScriptProviderForBeanShell.jar"/> +</manifest:manifest> diff --git a/scripting/util/provider/javascript/delzip b/scripting/util/provider/javascript/delzip new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/scripting/util/provider/javascript/delzip diff --git a/scripting/util/provider/javascript/description.xml b/scripting/util/provider/javascript/description.xml new file mode 100644 index 0000000000..58f047891f --- /dev/null +++ b/scripting/util/provider/javascript/description.xml @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<description + xmlns="http://openoffice.org/extensions/description/2006" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:dep="http://openoffice.org/extensions/description/2006"> + + <identifier value="com.sun.star.script.provider.ScriptProviderForJavaScript"/> + + <dependencies> + <OpenOffice.org-minimal-version value="3.0" dep:name="OpenOffice.org 3.0"/> + </dependencies> + + <version value="3.3.0"/> + + <publisher> + <name xlink:href="http://www.documentfoundation.org" lang="en">The + Document Foundation</name> + </publisher> + + <display-name> + <name lang="en">Script provider for JavaScript</name> + </display-name> + +</description> diff --git a/scripting/util/provider/javascript/makefile.mk b/scripting/util/provider/javascript/makefile.mk new file mode 100644 index 0000000000..a99096a626 --- /dev/null +++ b/scripting/util/provider/javascript/makefile.mk @@ -0,0 +1,55 @@ +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Red Hat, Inc. +# Portions created by the Initial Developer are Copyright (C) 2010 the +# Initial Developer. All Rights Reserved. +# +# Contributor(s): David Tardon <dtardon@redhat.com> +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +PRJ=..$/..$/.. + +PRJNAME=scripting +TARGET=jsprov + +.INCLUDE : settings.mk + +.IF "$(L10N_framework)"=="" && "$(SOLAR_JAVA)"!="" + +EXTENSIONNAME:=ScriptProviderForJavaScript +EXTENSION_ZIPNAME:=script-provider-for-javascript + +COMPONENT_JARFILES=$(EXTENSIONDIR)$/$(EXTENSIONNAME).jar +EXTENSION_PACKDEPS=$(SOLARBINDIR)$/js.jar + +.INCLUDE : extension_pre.mk +.INCLUDE : target.mk +.INCLUDE : extension_post.mk + +ALLTAR : $(EXTENSIONDIR)$/js.jar + +$(EXTENSIONDIR)$/js.jar : $(SOLARBINDIR)$/js.jar + @@-$(MKDIRHIER) $(@:d) + $(COMMAND_ECHO)$(COPY) $< $@ + +.ELSE + +.INCLUDE : target.mk + +.ENDIF diff --git a/scripting/util/provider/javascript/manifest.xml b/scripting/util/provider/javascript/manifest.xml new file mode 100644 index 0000000000..4c61747f4d --- /dev/null +++ b/scripting/util/provider/javascript/manifest.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd"> +<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest"> + <manifest:file-entry + manifest:media-type="application/vnd.sun.star.uno-component;type=java" + manifest:full-path="js.jar"/> + <manifest:file-entry + manifest:media-type="application/vnd.sun.star.uno-component;type=java" + manifest:full-path="ScriptProviderForJavaScript.jar"/> +</manifest:manifest> diff --git a/scripting/workben/ifc/scripting/SecurityDialogUtil.java b/scripting/workben/ifc/scripting/SecurityDialogUtil.java index 1b0e2345a0..8722bcbe17 100644 --- a/scripting/workben/ifc/scripting/SecurityDialogUtil.java +++ b/scripting/workben/ifc/scripting/SecurityDialogUtil.java @@ -64,7 +64,7 @@ public SecurityDialogUtil(XMultiServiceFactory xMSF, String btnName, boolean che } /** - * Returns the error message that occured while + * Returns the error message that occurred while * accessing and pressing the button. * @return Error message. */ |