Kaydet (Commit) 4ce614f5 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, convert some code to use getProcessComponentContext

these VBA services should be left alone, according to Noel Power.

Change-Id: Iee394f73fa99c18d6b70892bff9b0e2122f67d69
üst 614e31aa
......@@ -329,11 +329,11 @@ ScVbaShape::TextFrame() throw (uno::RuntimeException)
uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW );
if( xServiceInfo->supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) )
{
uno::Reference< lang::XMultiServiceFactory > xSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
uno::Sequence< uno::Any > aArgs(2);
aArgs[0] = uno::makeAny( getParent() );
aArgs[1] <<= m_xShape;
uno::Reference< uno::XInterface > xTextFrame( xSF->createInstanceWithArguments( "ooo.vba.excel.TextFrame" , aArgs ) , uno::UNO_QUERY_THROW );
uno::Reference< uno::XInterface > xTextFrame = xContext->getServiceManager()->createInstanceWithArgumentsAndContext( "ooo.vba.excel.TextFrame" , aArgs, xContext );
return uno::makeAny( xTextFrame );
}
......@@ -666,11 +666,11 @@ ScVbaShape::WrapFormat() throw (uno::RuntimeException)
uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW );
if( xServiceInfo->supportsService( "com.sun.star.text.TextDocument" ))
{
uno::Reference< lang::XMultiServiceFactory > xSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
uno::Sequence< uno::Any > aArgs(2);
aArgs[0] = uno::makeAny( getParent() );
aArgs[1] <<= m_xShape;
uno::Reference< uno::XInterface > xWrapFormat( xSF->createInstanceWithArguments( "ooo.vba.word.WrapFormat" , aArgs ) , uno::UNO_QUERY_THROW );
uno::Reference< uno::XInterface > xWrapFormat = xContext->getServiceManager()->createInstanceWithArgumentsAndContext( "ooo.vba.word.WrapFormat" , aArgs, xContext );
return uno::makeAny( xWrapFormat );
}
throw uno::RuntimeException( "Not implemented" , uno::Reference< uno::XInterface >() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment