Just use Any ctor instead of makeAny in scripting

Change-Id: I611640a6fb7061fbb6a239034f75e006db075989
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133786
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2022-05-03 23:23:59 +02:00
parent aebfe0e943
commit 5fc8f8620d
8 changed files with 13 additions and 13 deletions

View File

@@ -242,7 +242,7 @@ constexpr OUStringLiteral BASSCRIPT_PROPERTY_CALLER = u"Caller";
// if it's a document-based script, temporarily reset ThisComponent to the script invocation context
Any aOldThisComponent;
if ( m_documentBasicManager && m_xDocumentScriptContext.is() )
aOldThisComponent = m_documentBasicManager->SetGlobalUNOConstant( "ThisComponent", makeAny( m_xDocumentScriptContext ) );
aOldThisComponent = m_documentBasicManager->SetGlobalUNOConstant( "ThisComponent", Any( m_xDocumentScriptContext ) );
if ( m_caller.hasElements() && m_caller[ 0 ].hasValue() )
{

View File

@@ -603,8 +603,8 @@ namespace dlgprov
aDecorationAny >>= bDecoration;
if( !bDecoration )
{
xDlgModPropSet->setPropertyValue( aDecorationPropName, makeAny( true ) );
xDlgModPropSet->setPropertyValue( "Title", makeAny( OUString() ) );
xDlgModPropSet->setPropertyValue( aDecorationPropName, Any( true ) );
xDlgModPropSet->setPropertyValue( "Title", Any( OUString() ) );
}
}
catch( UnknownPropertyException& )

View File

@@ -142,7 +142,7 @@ Reference< provider::XScriptProvider >
if ( pos == m_mScriptComponents.end() )
{
// TODO
msp = createNewMSP( uno::makeAny( xContext ) );
msp = createNewMSP( uno::Any( xContext ) );
addActiveMSP( xNormalized, msp );
}
else

View File

@@ -75,7 +75,7 @@ private:
css::uno::Reference< css::script::provider::XScriptProvider >
createNewMSP( const OUString& context )
{
return createNewMSP( css::uno::makeAny( context ) );
return createNewMSP( css::uno::Any( context ) );
}
friend class NonDocMSPCreator;

View File

@@ -266,8 +266,8 @@ std::vector< Reference< browse::XBrowseNode > > getAllBrowseNodes( const Referen
{
xFac = provider::theMasterScriptProviderFactory::get( xCtx );
locnBNs[ mspIndex++ ].set( xFac->createScriptProvider( makeAny( OUString("user") ) ), UNO_QUERY_THROW );
locnBNs[ mspIndex++ ].set( xFac->createScriptProvider( makeAny( OUString("share") ) ), UNO_QUERY_THROW );
locnBNs[ mspIndex++ ].set( xFac->createScriptProvider( Any( OUString("user") ) ), UNO_QUERY_THROW );
locnBNs[ mspIndex++ ].set( xFac->createScriptProvider( Any( OUString("share") ) ), UNO_QUERY_THROW );
}
// TODO proper exception handling, should throw
catch( const Exception& )
@@ -295,7 +295,7 @@ std::vector< Reference< browse::XBrowseNode > > getAllBrowseNodes( const Referen
{
Reference< document::XEmbeddedScripts > xScripts( model, UNO_QUERY );
if ( xScripts.is() )
locnBNs[ mspIndex++ ].set( xFac->createScriptProvider( makeAny( model ) ), UNO_QUERY_THROW );
locnBNs[ mspIndex++ ].set( xFac->createScriptProvider( Any( model ) ), UNO_QUERY_THROW );
}
}
}

View File

@@ -323,7 +323,7 @@ MasterScriptProvider::getScript( const OUString& scriptURI )
provider::theMasterScriptProviderFactory::get( m_xContext );
Reference< provider::XScriptProvider > xSP(
xFac_->createScriptProvider( makeAny( location ) ), UNO_SET_THROW );
xFac_->createScriptProvider( Any( location ) ), UNO_SET_THROW );
xScript = xSP->getScript( scriptURI );
}

View File

@@ -867,10 +867,10 @@ void StringResourcePersistenceImpl::implStoreAtStorage
if ( xProps.is() )
{
OUString aPropName("MediaType");
xProps->setPropertyValue( aPropName, uno::makeAny( OUString("text/plain") ) );
xProps->setPropertyValue( aPropName, uno::Any( OUString("text/plain") ) );
aPropName = "UseCommonStoragePasswordEncryption";
xProps->setPropertyValue( aPropName, uno::makeAny( true ) );
xProps->setPropertyValue( aPropName, uno::Any( true ) );
}
Reference< io::XOutputStream > xOutputStream = xElementStream->getOutputStream();

View File

@@ -373,7 +373,7 @@ ScriptEventHelper::getEventListeners() const
Reference< beans::XIntrospection > xIntrospection = beans::theIntrospection::get( m_xCtx );
Reference< beans::XIntrospectionAccess > xIntrospectionAccess =
xIntrospection->inspect( makeAny( m_xControl ) );
xIntrospection->inspect( Any( m_xControl ) );
const Sequence< Type > aControlListeners =
xIntrospectionAccess->getSupportedListeners();
for ( const Type& listType : aControlListeners )
@@ -894,7 +894,7 @@ EventListener::firing_Impl(const ScriptEvent& evt, Any* pRet )
OUString url = aMacroResolvedInfo.msResolvedMacro;
try
{
uno::Any aDummyCaller = uno::makeAny( OUString("Error") );
uno::Any aDummyCaller( OUString("Error") );
if ( pRet )
{
ooo::vba::executeMacro( mpShell, url, aArguments, *pRet, aDummyCaller );