no need to take a copy of the getProcessComponentContext return value

we can just take a "const &".

(found by running clang-tidy with the
performance-unnecessary-copy-initialization warning)

Change-Id: I20fd208c65303da78170b1ac06c638fdf3aa094b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176267
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
Noel Grandin 2024-11-08 12:00:27 +02:00
parent 5ff283e3b8
commit ed0b12f4ea
304 changed files with 481 additions and 466 deletions

View file

@ -184,7 +184,7 @@ uno::Reference<media::XPlayer> MediaWindowImpl::createPlayer(const OUString& rUR
// currently there isn't anything else, throw any mime type to the media players
//if (!pMimeType || *pMimeType == AVMEDIA_MIMETYPE_COMMON)
{
uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext());
const uno::Reference<uno::XComponentContext>& xContext(::comphelper::getProcessComponentContext());
const OUString sToolkitName = Application::GetToolkitName();
if (sToolkitName == "gtk4")
xPlayer = createPlayer(rURL, u"com.sun.star.comp.avmedia.Manager_Gtk"_ustr, xContext);

View file

@ -619,7 +619,7 @@ void DialogWindow::SaveDialog()
OUString aSelectedFileURL = xFP->getSelectedFiles()[0];
Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
const Reference<uno::XComponentContext>& xContext(comphelper::getProcessComponentContext());
Reference< XSimpleFileAccess3 > xSFI( SimpleFileAccess::create(xContext) );
Reference< XOutputStream > xOutput;
@ -785,7 +785,7 @@ bool implImportDialog(weld::Window* pWin, const ScriptDocument& rDocument, const
{
bool bDone = false;
Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext());
const Reference<uno::XComponentContext>& xContext(::comphelper::getProcessComponentContext());
sfx2::FileDialogHelper aDlg(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
FileDialogFlags::NONE, pWin);
aDlg.SetContext(sfx2::FileDialogHelper::BasicImportDialog);
@ -1117,7 +1117,7 @@ void DialogWindow::StoreData()
if( xDialogModel.is() )
{
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, GetDocument().isDocument() ? GetDocument().getDocument() : Reference< frame::XModel >() );
xLib->replaceByName( GetName(), Any( xISP ) );

View file

@ -72,7 +72,7 @@ VclPtr<DialogWindow> Shell::CreateDlgWin( const ScriptDocument& rDocument, const
if ( xISP.is() )
{
// create dialog model
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext();
Reference< container::XNameContainer > xDialogModel( xContext->getServiceManager()->createInstanceWithContext
( u"com.sun.star.awt.UnoControlDialogModel"_ustr, xContext ), UNO_QUERY );
Reference< XInputStream > xInput( xISP->createInputStream() );

View file

@ -659,7 +659,7 @@ OUString SbTreeListBox::GetRootEntryBitmaps(const ScriptDocument& rDocument)
if ( rDocument.isDocument() )
{
OUString sFactoryURL;
Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
const Reference<uno::XComponentContext>& xContext( ::comphelper::getProcessComponentContext() );
Reference< frame::XModuleManager2 > xModuleManager( frame::ModuleManager::create(xContext) );
try
{

View file

@ -197,7 +197,7 @@ namespace basctl
xBroadcaster.set( m_xModel, UNO_QUERY_THROW );
else
{
Reference< css::uno::XComponentContext > aContext(
const Reference< css::uno::XComponentContext >& aContext(
comphelper::getProcessComponentContext() );
xBroadcaster = theGlobalEventBroadcaster::get(aContext);
}

View file

@ -565,7 +565,7 @@ void LibPage::NewLib()
void LibPage::InsertLib()
{
Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const Reference< uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
// file open dialog
sfx2::FileDialogHelper aDlg(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, m_pDialog->getDialog());
aDlg.SetContext(sfx2::FileDialogHelper::BasicInsertLib);
@ -1018,7 +1018,7 @@ void LibPage::ExportAsPackage( const OUString& aLibName )
aDlg.SetContext(sfx2::FileDialogHelper::BasicExportPackage);
const Reference <XFilePicker3>& xFP = aDlg.GetFilePicker();
Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const Reference< uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
Reference< task::XInteractionHandler2 > xHandler( task::InteractionHandler::createWithParent(xContext, nullptr) );
Reference< XSimpleFileAccess3 > xSFA = SimpleFileAccess::create(xContext);
@ -1116,7 +1116,7 @@ void LibPage::ExportAsPackage( const OUString& aLibName )
void LibPage::ExportAsBasic( const OUString& aLibName )
{
// Folder picker
Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const Reference< uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
Reference< XFolderPicker2 > xFolderPicker = sfx2::createFolderPicker(xContext, m_pDialog->getDialog());
Reference< task::XInteractionHandler2 > xHandler( task::InteractionHandler::createWithParent(xContext, nullptr) );

View file

@ -159,7 +159,7 @@ void Shell::CopyDialogResources(
return;
// create dialog model
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext();
Reference< container::XNameContainer > xDialogModel( xContext->getServiceManager()->createInstanceWithContext
( u"com.sun.star.awt.UnoControlDialogModel"_ustr, xContext ), UNO_QUERY );
Reference< io::XInputStream > xInput( io_xISP->createInputStream() );

View file

@ -597,7 +597,7 @@ namespace basctl
if ( _eType == E_DIALOGS )
{
// create dialog model
Reference< XComponentContext > aContext(
const Reference< XComponentContext >& aContext(
comphelper::getProcessComponentContext() );
Reference< XNameContainer > xDialogModel;
if ( _rxExistingDialogModel.is() )
@ -733,7 +733,7 @@ namespace basctl
return false;
// create new dialog model
Reference< XComponentContext > aContext(
const Reference< XComponentContext >& aContext(
comphelper::getProcessComponentContext() );
Reference< XNameContainer > xDialogModel(
aContext->getServiceManager()->createInstanceWithContext(
@ -915,7 +915,7 @@ namespace basctl
if ( !xLibContainer->hasByName( _rLibName ) || !xLibContainer->isLibraryLink( _rLibName ) )
return false;
OUString aFileURL;
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const Reference< XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
Reference< XUriReferenceFactory > xUriFac = UriReferenceFactory::create(xContext);
OUString aLinkURL( xLibContainer->getLibraryLinkURL( _rLibName ) );

View file

@ -89,7 +89,7 @@ DlgEdHint::~DlgEdHint()
void DlgEditor::ShowDialog()
{
uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = getProcessComponentContext();
// create a dialog
uno::Reference< awt::XUnoControlDialog > xDlg = awt::UnoControlDialog::create( xContext );
@ -415,7 +415,7 @@ Reference< util::XNumberFormatsSupplier > const & DlgEditor::GetNumberFormatsSup
{
if ( !m_xSupplier.is() )
{
Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
Reference< util::XNumberFormatsSupplier > xSupplier( util::NumberFormatsSupplier::createWithDefaultLocale(xContext) );
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
@ -696,7 +696,7 @@ void DlgEditor::Copy()
}
// export clipboard dialog model to xml
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xClipDialogModel, xContext, m_xDocument );
Reference< XInputStream > xStream( xISP->createInputStream() );
@ -825,7 +825,7 @@ void DlgEditor::Paste()
return;
// create clipboard dialog model from xml
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext();
Reference< container::XNameContainer > xClipDialogModel( xContext->getServiceManager()->createInstanceWithContext(
u"com.sun.star.awt.UnoControlDialogModel"_ustr, xContext ), uno::UNO_QUERY );

View file

@ -43,7 +43,7 @@ DlgEdTransferableImpl::~DlgEdTransferableImpl()
bool DlgEdTransferableImpl::compareDataFlavors( const DataFlavor& lFlavor, const DataFlavor& rFlavor )
{
// compare mime content types
Reference< uno::XComponentContext > xContext = getProcessComponentContext();
const Reference< uno::XComponentContext >& xContext = getProcessComponentContext();
Reference< datatransfer::XMimeContentTypeFactory >
xMCntTypeFactory = MimeContentTypeFactory::create(xContext);

View file

@ -49,7 +49,7 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, rtl::Referenc
{
static const uno::Reference<lang::XMultiServiceFactory> xDialogSFact = [] {
uno::Reference<lang::XMultiServiceFactory> xFact;
uno::Reference< uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
const uno::Reference< uno::XComponentContext>& xContext = ::comphelper::getProcessComponentContext();
uno::Reference< container::XNameContainer > xC( xContext->getServiceManager()->createInstanceWithContext( u"com.sun.star.awt.UnoControlDialogModel"_ustr, xContext ), uno::UNO_QUERY );
if (xC.is())
xFact.set(xC, uno::UNO_QUERY);

View file

@ -135,7 +135,7 @@ void PropBrw::ImplReCreateController()
try
{
Reference< XComponentContext > xOwnContext = comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xOwnContext = comphelper::getProcessComponentContext();
// a ComponentContext for the
::cppu::ContextEntry_Init aHandlerContextInfo[] =

View file

@ -306,7 +306,7 @@ namespace basic
// global constants
// StarDesktop
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
pBasicManager->SetGlobalUNOConstant( u"StarDesktop"_ustr, css::uno::Any( Desktop::create(xContext)));
// (BasicLibraries and DialogLibraries have automatically been added in SetLibraryContainerInfo)

View file

@ -79,7 +79,7 @@ void SFURL_firing_impl( const ScriptEvent& aScriptEvent, Any* pRet, const Refere
}
else
{
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
Reference< provider::XScriptProviderFactory > xFactory =
provider::theMasterScriptProviderFactory::get( xContext );
@ -405,7 +405,7 @@ css::uno::Reference< css::container::XNameContainer > implFindDialogLibForDialog
void RTL_Impl_CreateUnoDialog( SbxArray& rPar )
{
Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
const Reference< XComponentContext >& xContext( comphelper::getProcessComponentContext() );
// We need at least 1 parameter
if (rPar.Count() < 2)

View file

@ -189,7 +189,7 @@ static Reference< XHierarchicalNameAccess > const & getTypeProvider_Impl()
// Do we have already CoreReflection; if not obtain it
if( !xAccess.is() )
{
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
if( xContext.is() )
{
@ -215,7 +215,7 @@ static Reference< XTypeConverter > const & getTypeConverter_Impl()
// Do we have already CoreReflection; if not obtain it
if( !xTypeConverter.is() )
{
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
if( xContext.is() )
{
@ -236,7 +236,7 @@ SbUnoObject* createOLEObject_Impl( const OUString& aType )
{
static const Reference<XMultiServiceFactory> xOLEFactory = [] {
Reference<XMultiServiceFactory> xFactory;
Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
const Reference< XComponentContext >& xContext( comphelper::getProcessComponentContext() );
if( xContext.is() )
{
Reference<XMultiComponentFactory> xSMgr = xContext->getServiceManager();
@ -2388,7 +2388,7 @@ void SbUnoObject::doIntrospection()
if( !bNeedIntrospection )
return;
Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
const Reference<XComponentContext>& xContext = comphelper::getProcessComponentContext();
if (!xContext.is())
return;
@ -4030,7 +4030,7 @@ void SbRtl_CreateUnoListener(StarBASIC * pBasic, SbxArray & rPar, bool)
return;
// get the AllListenerAdapterService
Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
const Reference< XComponentContext >& xContext( comphelper::getProcessComponentContext() );
// search the class
Reference< XIdlClass > xClass = xCoreReflection->forName( aListenerClassName );
@ -4374,7 +4374,7 @@ Reference< XInterface > createComListener( const Any& aControlAny, const OUStrin
{
Reference< XInterface > xRet;
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
Reference< XMultiComponentFactory > xServiceMgr( xContext->getServiceManager() );
@ -4486,7 +4486,7 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP
// For now: Take first interface that allows to instantiate COM wrapper
// TODO: Check if support for multiple interfaces is needed
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
Reference< XMultiComponentFactory > xServiceMgr( xContext->getServiceManager() );
Reference< XSingleServiceFactory > xComImplementsFactory

View file

@ -2596,7 +2596,7 @@ void SbUserFormModule::InitObject()
Reference< script::vba::XVBACompatibility > xVBACompat( getVBACompatibility( m_xModel ), uno::UNO_SET_THROW );
xVBACompat->broadcastVBAScriptEvent( script::vba::VBAScriptEventId::INITIALIZE_USERFORM, GetName() );
uno::Reference< lang::XMultiServiceFactory > xVBAFactory( pGlobs->getUnoAny(), uno::UNO_QUERY_THROW );
uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = comphelper::getProcessComponentContext();
OUString sDialogUrl( u"vnd.sun.star.script:"_ustr );
OUString sProjectName( u"Standard"_ustr );

View file

@ -132,7 +132,7 @@ void SbiStream::MapError()
bool hasUno()
{
static const bool bRetVal = [] {
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext();
if( !xContext.is() )
{
// No service manager at all

View file

@ -1441,7 +1441,7 @@ void SbRtl_StrComp(StarBASIC *, SbxArray & rPar, bool)
::utl::TransliterationWrapper* pTransliterationWrapper = GetSbData()->pTransliterationWrapper.get();
if( !pTransliterationWrapper )
{
uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = getProcessComponentContext();
GetSbData()->pTransliterationWrapper.reset(
new ::utl::TransliterationWrapper( xContext,
TransliterationFlags::IGNORE_CASE |
@ -4084,7 +4084,7 @@ void SbRtl_StrConv(StarBASIC *, SbxArray & rPar, bool)
OUString aStr = rPar.Get(1)->GetOUString();
if (!aStr.isEmpty() && !aTranslitSet.empty())
{
uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = getProcessComponentContext();
for (auto transliterationFlag : aTranslitSet)
{

View file

@ -125,7 +125,7 @@ bool SfxDialogLibraryContainer::isLibraryElementValid(const Any& rElement) const
static bool writeOasis2OOoLibraryElement(
const Reference< XInputStream >& xInput, const Reference< XOutputStream >& xOutput )
{
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
Reference< lang::XMultiComponentFactory > xSMgr(

View file

@ -121,7 +121,7 @@ void lcl_addSequenceToDataSource(
const OUString & rRole )
{
Reference< chart2::data::XDataSink > xSink( xDataSource, uno::UNO_QUERY );
Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
if( ! xSink.is() )
return;

View file

@ -59,7 +59,7 @@ namespace comphelper
{
if ( !m_xBreakIter.is() )
{
Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
m_xBreakIter = i18n::BreakIterator::create(xContext);
}

View file

@ -384,7 +384,7 @@ namespace
// create content from current extension configuration
uno::Sequence< uno::Sequence< uno::Reference< deployment::XPackage > > > xAllPackages;
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
uno::Reference< deployment::XExtensionManager > m_xExtensionManager = deployment::ExtensionManager::get(xContext);
try
@ -505,7 +505,7 @@ namespace
{
if (DirectoryHelper::fileExists(aPath))
{
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
uno::Reference< xml::dom::XDocumentBuilder > xBuilder(xml::dom::DocumentBuilder::create(xContext));
uno::Reference< xml::dom::XDocument > aDocument = xBuilder->parseURI(aPath);
@ -607,7 +607,7 @@ namespace
if (!DirectoryHelper::fileExists(rUnoPackagReg))
return;
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
uno::Reference< xml::dom::XDocumentBuilder > xBuilder = xml::dom::DocumentBuilder::create(xContext);
uno::Reference< xml::dom::XDocument > aDocument = xBuilder->parseURI(rUnoPackagReg);
@ -1879,7 +1879,7 @@ namespace comphelper
if (!DirectoryHelper::fileExists(aRegistryModifications))
return;
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
uno::Reference< XDocumentBuilder > xBuilder = DocumentBuilder::create(xContext);
uno::Reference< XDocument > xDocument = xBuilder->parseURI(aRegistryModifications);
uno::Reference< XElement > xRootElement = xDocument->getDocumentElement();

View file

@ -39,7 +39,7 @@ bool dispatchCommand(const OUString& rCommand, const uno::Reference<css::frame::
util::URL aCommandURL;
aCommandURL.Complete = rCommand;
uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
const uno::Reference<uno::XComponentContext>& xContext = ::comphelper::getProcessComponentContext();
uno::Reference<util::XURLTransformer> xParser = util::URLTransformer::create(xContext);
xParser->parseStrict(aCommandURL);
@ -66,7 +66,7 @@ bool dispatchCommand(const OUString& rCommand, const uno::Reference<css::frame::
bool dispatchCommand(const OUString& rCommand, const css::uno::Sequence<css::beans::PropertyValue>& rArguments, const uno::Reference<css::frame::XDispatchResultListener>& rListener)
{
// Target where we will execute the .uno: command
uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
const uno::Reference<uno::XComponentContext>& xContext = ::comphelper::getProcessComponentContext();
uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create(xContext);
uno::Reference<frame::XFrame> xFrame(xDesktop->getActiveFrame());

View file

@ -921,7 +921,7 @@ void Connection::storeDatabase()
Reference<XStream> xDBStream(
m_xEmbeddedStorage->openStreamElement(our_sFBKLocation, ElementModes::WRITE));
using namespace ::comphelper;
Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
const Reference<XComponentContext>& xContext = comphelper::getProcessComponentContext();
Reference<XInputStream> xInputStream;
if (!xContext.is())
return;

View file

@ -216,7 +216,7 @@ void CustomNotebookbarGenerator::getFileNameAndAppName(OUString& sAppName,
if (!pFrame)
return;
const auto xContext = comphelper::getProcessComponentContext();
const auto& xContext = comphelper::getProcessComponentContext();
utl::OConfigurationTreeRoot aRoot(xContext, u"org.openoffice.Office.UI.ToolbarMode/"_ustr,
false);
const Reference<frame::XFrame>& xFrame = pFrame->GetFrame().GetFrameInterface();

View file

@ -196,7 +196,8 @@ void SvxConfigPage::InsertEntryIntoNotebookbarTabUI(std::u16string_view sClassId
const weld::TreeIter& rIter)
{
css::uno::Reference<css::container::XNameAccess> m_xCommandToLabelMap;
uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
const uno::Reference<uno::XComponentContext>& xContext
= ::comphelper::getProcessComponentContext();
uno::Reference<container::XNameAccess> xNameAccess(
css::frame::theUICommandDescription::get(xContext));

View file

@ -302,7 +302,7 @@ SaveInData::SaveInData(
bReadOnly = xDocPersistence->isReadOnly();
}
uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
const uno::Reference<uno::XComponentContext>& xContext = ::comphelper::getProcessComponentContext();
uno::Reference< container::XNameAccess > xNameAccess(
css::frame::theUICommandDescription::get(xContext) );
@ -603,7 +603,7 @@ void MenuSaveInData::Apply(
uno::Reference< container::XIndexContainer > const & rMenuBar,
uno::Reference< lang::XSingleComponentFactory >& rFactory )
{
uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
const uno::Reference<uno::XComponentContext>& xContext = ::comphelper::getProcessComponentContext();
for (auto const& entryData : *GetEntries())
{
@ -630,7 +630,7 @@ void SaveInData::ApplyMenu(
uno::Reference< lang::XSingleComponentFactory >& rFactory,
SvxConfigEntry* pMenuData )
{
uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
const uno::Reference<uno::XComponentContext>& xContext = ::comphelper::getProcessComponentContext();
for (auto const& entry : *pMenuData->GetEntries())
{
@ -702,7 +702,7 @@ ContextMenuSaveInData::ContextMenuSaveInData(
const OUString& aModuleId, bool bIsDocConfig )
: SaveInData( xCfgMgr, xParentCfgMgr, aModuleId, bIsDocConfig )
{
css::uno::Reference< css::uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const css::uno::Reference< css::uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
css::uno::Reference< css::container::XNameAccess > xConfig( css::ui::theWindowStateConfiguration::get( xContext ) );
xConfig->getByName( aModuleId ) >>= m_xPersistentWindowState;
}
@ -1279,7 +1279,7 @@ OUString SvxConfigPage::GetFrameWithDefaultAndIdentify( uno::Reference< frame::X
OUString sModuleID;
try
{
uno::Reference< uno::XComponentContext > xContext(
const uno::Reference< uno::XComponentContext >& xContext(
::comphelper::getProcessComponentContext() );
uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(
@ -1974,7 +1974,7 @@ ToolbarSaveInData::ToolbarSaveInData(
m_aDescriptorContainer ( ITEM_DESCRIPTOR_CONTAINER )
{
uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
const uno::Reference<uno::XComponentContext>& xContext = ::comphelper::getProcessComponentContext();
// Initialize the m_xPersistentWindowState variable which is used
// to get the default properties of system toolbars such as name
uno::Reference< container::XNameAccess > xPWSS = css::ui::theWindowStateConfiguration::get( xContext );
@ -2413,7 +2413,7 @@ void ToolbarSaveInData::ApplyToolbar(
uno::Reference< lang::XSingleComponentFactory >& rFactory,
SvxConfigEntry const * pToolbarData )
{
uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
const uno::Reference<uno::XComponentContext>& xContext = ::comphelper::getProcessComponentContext();
for (auto const& entry : *pToolbarData->GetEntries())
{
@ -2742,7 +2742,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog(weld::Window *pWindow,
Size aSize(m_xTbSymbol->CalcWindowSizePixel(Size(m_nExpectedSize, m_nExpectedSize), 11, 5));
m_xTbSymbol->set_size_request(aSize.Width(), aSize.Height());
uno::Reference< uno::XComponentContext > xComponentContext =
const uno::Reference< uno::XComponentContext >& xComponentContext =
::comphelper::getProcessComponentContext();
m_xGraphProvider.set( graphic::GraphicProvider::create( xComponentContext ) );

View file

@ -317,7 +317,7 @@ void QrCodeGenDialog::Apply()
SvMemoryStream aSvgStream(4096, 4096);
aSvgStream.WriteOString(aSvgImage);
Reference<XInputStream> xInputStream(new utl::OSeekableInputStreamWrapper(aSvgStream));
Reference<XComponentContext> xContext(comphelper::getProcessComponentContext());
const Reference<XComponentContext>& xContext(comphelper::getProcessComponentContext());
Reference<XGraphicProvider> xProvider = css::graphic::GraphicProvider::create(xContext);
Sequence<PropertyValue> aMediaProperties{ comphelper::makePropertyValue(u"InputStream"_ustr,

View file

@ -119,7 +119,7 @@ SignSignatureLineDialog::SignSignatureLineDialog(weld::Widget* pParent, Referenc
IMPL_LINK_NOARG(SignSignatureLineDialog, loadImage, weld::Button&, void)
{
Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
const Reference<XComponentContext>& xContext = comphelper::getProcessComponentContext();
sfx2::FileDialogHelper aHelper(TemplateDescription::FILEOPEN_PREVIEW, FileDialogFlags::NONE,
m_xDialog.get());
aHelper.SetContext(sfx2::FileDialogHelper::SignatureLine);

View file

@ -801,7 +801,7 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, ClickSearchHdl, weld::Button&, void)
try
{
// setup folder picker
css::uno::Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const css::uno::Reference< XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
xFolderPicker = sfx2::createFolderPicker(xContext, GetFrameWeld());
OUString aDlgPathName( SvtPathOptions().GetGraphicPath() );

View file

@ -383,7 +383,7 @@ void SvxHyperlinkNewDocTp::DoApply()
IMPL_LINK_NOARG(SvxHyperlinkNewDocTp, ClickNewHdl_Impl, weld::Button&, void)
{
DisableClose( true );
uno::Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const uno::Reference < XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
uno::Reference < XFolderPicker2 > xFolderPicker = sfx2::createFolderPicker(xContext, mpDialog->getDialog());
OUString aStrURL;

View file

@ -287,7 +287,7 @@ short SvInsertOleDlg::run()
if ( !aFileName.isEmpty() )
{
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
uno::Reference< task::XInteractionHandler2 > xInteraction(
task::InteractionHandler::createWithParent(xContext, nullptr) );

View file

@ -87,7 +87,7 @@ void SvxMultiPathDialog::AppendEntry(const OUString& rText, const OUString& rId)
IMPL_LINK_NOARG(SvxMultiPathDialog, AddHdl_Impl, weld::Button&, void)
{
Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const Reference < XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
Reference < XFolderPicker2 > xFolderPicker = sfx2::createFolderPicker(xContext, m_xDialog.get());
if ( xFolderPicker->execute() != ExecutableDialogResults::OK )
@ -117,7 +117,7 @@ IMPL_LINK_NOARG(SvxMultiPathDialog, AddHdl_Impl, weld::Button&, void)
IMPL_LINK_NOARG(SvxPathSelectDialog, AddHdl_Impl, weld::Button&, void)
{
Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const Reference < XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
Reference < XFolderPicker2 > xFolderPicker = sfx2::createFolderPicker(xContext, m_xDialog.get());
if ( xFolderPicker->execute() != ExecutableDialogResults::OK )

View file

@ -123,7 +123,7 @@ void SvxScriptOrgDialog::Init( std::u16string_view language )
deleteAllTree();
Reference< browse::XBrowseNode > rootNode;
Reference< XComponentContext > xCtx(
const Reference< XComponentContext >& xCtx(
comphelper::getProcessComponentContext() );
Sequence< Reference< browse::XBrowseNode > > children;

View file

@ -174,7 +174,7 @@ void TipOfTheDayDialog::UpdateTip()
{
css::util::URL aCommandURL;
aCommandURL.Complete = sLink;
const css::uno::Reference<css::uno::XComponentContext> xContext
const css::uno::Reference<css::uno::XComponentContext>& xContext
= comphelper::getProcessComponentContext();
const css::uno::Reference<css::util::XURLTransformer> xParser
= css::util::URLTransformer::create(xContext);

View file

@ -35,7 +35,7 @@ static OUString GetCurrentApp()
if (SfxViewFrame* pViewFrame = SfxViewFrame::Current())
{
const auto xCurrentFrame = pViewFrame->GetFrame().GetFrameInterface();
const auto xContext = comphelper::getProcessComponentContext();
const auto& xContext = comphelper::getProcessComponentContext();
const auto xModuleManager = css::frame::ModuleManager::create(xContext);
switch (vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(xCurrentFrame)))
{
@ -69,7 +69,7 @@ static OUString GetCurrentMode()
OUString sResult;
if (SfxViewFrame::Current())
{
const auto xContext = comphelper::getProcessComponentContext();
const auto& xContext = comphelper::getProcessComponentContext();
const utl::OConfigurationTreeRoot aAppNode(
xContext, "org.openoffice.Office.UI.ToolbarMode/Applications/" + GetCurrentApp(), true);
if (aAppNode.isValid())
@ -190,7 +190,7 @@ IMPL_LINK(ToolbarmodeDialog, OnApplyClick, weld::Button&, rButton, void)
OUString sCurrentApp = GetCurrentApp();
if (SfxViewFrame::Current())
{
const auto xContext = comphelper::getProcessComponentContext();
const auto& xContext = comphelper::getProcessComponentContext();
const utl::OConfigurationTreeRoot aAppNode(
xContext, u"org.openoffice.Office.UI.ToolbarMode/Applications/"_ustr, true);
if (sCurrentApp != "Writer")

View file

@ -50,7 +50,7 @@ void CertPathDialog::Init()
try
{
uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext();
const uno::Reference<uno::XComponentContext>& xContext = comphelper::getProcessComponentContext();
uno::Reference<xml::crypto::XNSSInitializer> xCipherContextSupplier = xml::crypto::NSSInitializer::create(xContext);
OUString sActivePath = xCipherContextSupplier->getNSSPath();
@ -138,7 +138,7 @@ bool CertPathDialog::isActiveServicePath() const
try
{
uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext();
const uno::Reference<uno::XComponentContext>& xContext = comphelper::getProcessComponentContext();
uno::Reference<xml::crypto::XNSSInitializer> xCipherContextSupplier = xml::crypto::NSSInitializer::create(xContext);
if (!xCipherContextSupplier->getIsNSSinitialized())

View file

@ -73,7 +73,7 @@ namespace offapp
};
m_xDriverList->set_column_fixed_widths(aWidths);
css::uno::Reference < css::uno::XComponentContext > xContext(::comphelper::getProcessComponentContext());
const css::uno::Reference < css::uno::XComponentContext >& xContext(::comphelper::getProcessComponentContext());
m_xReadWriteAccess = css::configuration::ReadWriteAccess::create(xContext, u"*"_ustr);
m_xEnablePooling->connect_toggled( LINK(this, ConnectionPoolOptionsPage, OnEnabledDisabled) );

View file

@ -39,7 +39,7 @@ namespace svx
try
{
Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
const Reference<XComponentContext>& xContext( ::comphelper::getProcessComponentContext() );
Reference< XDatabaseContext > xRegistrations(
DatabaseContext::create(xContext) );

View file

@ -57,7 +57,7 @@ namespace svx
m_xURL->DisableHistory();
m_xURL->SetFilter(u"*.odb");
css::uno::Reference < css::uno::XComponentContext > xContext(::comphelper::getProcessComponentContext());
const css::uno::Reference < css::uno::XComponentContext >& xContext(::comphelper::getProcessComponentContext());
m_xReadWriteAccess = css::configuration::ReadWriteAccess::create(xContext, u"*"_ustr);
m_xName->connect_changed( LINK(this, ODocumentLinkDialog, OnEntryModified) );

View file

@ -703,7 +703,8 @@ void CuiAboutConfigTabPage::FillItems(const Reference<XNameAccess>& xNameAccess,
Reference<XNameAccess> CuiAboutConfigTabPage::getConfigAccess(const OUString& sNodePath,
bool bUpdate)
{
uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext());
const uno::Reference<uno::XComponentContext>& xContext(
::comphelper::getProcessComponentContext());
uno::Reference<lang::XMultiServiceFactory> xConfigProvider(
css::configuration::theDefaultProvider::get(xContext));

View file

@ -464,7 +464,7 @@ ColorConfigWindow_Impl::ColorConfigWindow_Impl(weld::Window* pTopLevel, weld::Co
, m_xWidget1(m_xBuilder->weld_widget(u"docboundaries"_ustr))
, m_xWidget2(m_xBuilder->weld_widget(u"docboundaries_lb"_ustr))
{
css::uno::Reference < css::uno::XComponentContext > xContext(::comphelper::getProcessComponentContext());
const css::uno::Reference < css::uno::XComponentContext >& xContext(::comphelper::getProcessComponentContext());
m_xReadWriteAccess = css::configuration::ReadWriteAccess::create(xContext, u"*"_ustr);
CreateEntries();

View file

@ -1451,7 +1451,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
// tell quickstarter to stop being a veto listener
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext());
css::office::Quickstart::createAndSetVeto(xContext, false, false, false/*DisableVeto*/);
}

View file

@ -160,7 +160,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, AddHdl_Impl, weld::Button&, void)
{
try
{
Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const Reference < XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
xFolderPicker = sfx2::createFolderPicker(xContext, GetFrameWeld());
OUString sWorkFolder = SvtPathOptions().GetWorkPath();
@ -873,7 +873,7 @@ IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddArchiveHdl_Impl, weld::Button&, void)
IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddPathHdl_Impl, weld::Button&, void)
{
Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const Reference < XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
Reference < XFolderPicker2 > xFolderPicker = sfx2::createFolderPicker(xContext, m_xDialog.get());
OUString sOldFolder;

View file

@ -524,7 +524,7 @@ static void lcl_MergeDisplayArray(
SvxLinguData_Impl::SvxLinguData_Impl() :
nDisplayServices (0)
{
uno::Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const uno::Reference< XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
xLinguSrvcMgr = LinguServiceManager::create(xContext);
const Locale& rCurrentLocale = Application::GetSettings().GetUILanguageTag().getLocale();
@ -1609,7 +1609,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(weld::Window* pParent, SvxLinguData_Impl& r
if (m_xLanguageLB->get_active_id() != eSysLang)
m_xLanguageLB->set_active(0);
css::uno::Reference < css::uno::XComponentContext > xContext(::comphelper::getProcessComponentContext());
const css::uno::Reference < css::uno::XComponentContext >& xContext(::comphelper::getProcessComponentContext());
m_xReadWriteAccess = css::configuration::ReadWriteAccess::create(xContext, u"*"_ustr);
m_xLanguageLB->connect_changed( LINK( this, SvxEditModulesDlg, LangSelectListBoxHdl_Impl ));

View file

@ -543,7 +543,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathHdl_Impl, weld::Button&, void)
{
try
{
Reference < XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const Reference < XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
xFolderPicker = sfx2::createFolderPicker(xContext, GetFrameWeld());
INetURLObject aURL( sWritable, INetProtocol::File );
@ -608,7 +608,7 @@ void SvxPathTabPage::GetPathList(
// load PathSettings service if necessary
if ( !pImpl->m_xPathSettings.is() )
{
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext();
pImpl->m_xPathSettings = css::util::thePathSettings::get( xContext );
}
@ -666,7 +666,7 @@ void SvxPathTabPage::SetPathList(
// load PathSettings service if necessary
if ( !pImpl->m_xPathSettings.is() )
{
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext();
pImpl->m_xPathSettings = css::util::thePathSettings::get( xContext );
}

View file

@ -91,7 +91,7 @@ SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage(weld::Container* pPage, weld::Dia
+ "&LOlocale=" + LanguageTag(utl::ConfigManager::getUILocale()).getBcp47());
uno::Reference < uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const uno::Reference < uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
m_xUpdateAccess = setup::UpdateCheckConfig::create( xContext );
m_xReadWriteAccess = css::configuration::ReadWriteAccess::create(xContext, u"*"_ustr);
@ -444,7 +444,7 @@ IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, ExtrasCheckHdl_Impl, weld::Toggleable&,
IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, FileDialogHdl_Impl, weld::Button&, void)
{
uno::Reference < uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const uno::Reference < uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
uno::Reference < ui::dialogs::XFolderPicker2 > xFolderPicker = sfx2::createFolderPicker(xContext, GetFrameWeld());
OUString aURL;
@ -464,7 +464,7 @@ IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, FileDialogHdl_Impl, weld::Button&, void)
IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, CheckNowHdl_Impl, weld::Button&, void)
{
uno::Reference < uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
const uno::Reference < uno::XComponentContext>& xContext( ::comphelper::getProcessComponentContext() );
try
{

View file

@ -50,7 +50,7 @@ namespace offapp
{
try
{
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
Reference< XDriverManager2 > xEnumAccess = DriverManager::create( xContext );
Reference< XEnumeration > xEnumDrivers = xEnumAccess->createEnumeration();

View file

@ -1621,7 +1621,7 @@ void OfaTreeOptionsDialog::ApplyLanguageOptions(const SfxItemSet& rSet)
bool bSaveSpellCheck = false;
const SfxPoolItem* pItem = nullptr;
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const Reference< XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
Reference< XLinguProperties > xProp = LinguProperties::create( xContext );
if ( const SfxHyphenRegionItem* pHyphenItem = rSet.GetItemIfSet(SID_ATTR_HYPHENREGION, false ) )
{
@ -2271,7 +2271,7 @@ OUString OfaTreeOptionsDialog::GetModuleIdentifier( const Reference< XFrame >& r
{
OUString sModule;
Reference < XFrame > xCurrentFrame( rFrame );
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext();
Reference < XModuleManager2 > xModuleManager = ModuleManager::create(xContext);
if ( !xCurrentFrame.is() )

View file

@ -127,7 +127,7 @@ void SchemaParser::parseSchema()
Reference<XStream> xStream(m_rStorage->openStreamElement(SCHEMA_FILENAME, ElementModes::READ));
Reference<XComponentContext> rContext = comphelper::getProcessComponentContext();
const Reference<XComponentContext>& rContext = comphelper::getProcessComponentContext();
Reference<XTextInputStream2> xTextInput = TextInputStream::create(rContext);
xTextInput->setEncoding(u"UTF-8"_ustr);
xTextInput->setInputStream(xStream->getInputStream());

View file

@ -381,7 +381,7 @@ IMPL_LINK(TreeListBox, CommandHdl, const CommandEvent&, rCEvt, bool)
css::uno::Any(comphelper::makePropertyValue( u"IsContextMenu"_ustr, true ))
};
css::uno::Reference< css::uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
const css::uno::Reference< css::uno::XComponentContext >& xContext = comphelper::getProcessComponentContext();
css::uno::Reference<css::frame::XPopupMenuController> xMenuController
(xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
u"com.sun.star.comp.framework.ResourceMenuController"_ustr, aArgs, xContext), css::uno::UNO_QUERY);

View file

@ -59,7 +59,7 @@ namespace dbaui
do
{
// Retrieve popup menu labels
Reference< css::uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const Reference< css::uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
if ( !xContext.is() )
break;

View file

@ -274,7 +274,7 @@ namespace dbaui
if (eType == ::dbaccess::DST_THUNDERBIRD)
profileType = MozillaProductType_Thunderbird;
Reference<XComponentContext> xContext = ::comphelper::getProcessComponentContext();
const Reference<XComponentContext>& xContext = ::comphelper::getProcessComponentContext();
Reference<XMozillaBootstrap> xMozillaBootstrap = MozillaBootstrap::create(xContext);
// collect all Mozilla Profiles

View file

@ -964,7 +964,7 @@ void handleCrashReport()
#if !defined ANDROID
void handleSafeMode()
{
css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const css::uno::Reference< css::uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
Reference< css::frame::XSynchronousDispatch > xSafeModeUI(
xContext->getServiceManager()->createInstanceWithContext(u"com.sun.star.comp.svx.SafeModeUI"_ustr, xContext),
@ -1033,7 +1033,7 @@ bool impl_callRecoveryUI(bool bEmergencySave ,
static constexpr OUStringLiteral COMMAND_EMERGENCYSAVE = u"vnd.sun.star.autorecovery:/doEmergencySave";
static constexpr OUStringLiteral COMMAND_RECOVERY = u"vnd.sun.star.autorecovery:/doAutoRecovery";
css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const css::uno::Reference< css::uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
g_xRecoveryUI.set(
xContext->getServiceManager()->createInstanceWithContext(u"com.sun.star.comp.svx.RecoveryUI"_ustr, xContext),
@ -1375,7 +1375,7 @@ int Desktop::Main()
recordTime(startT, "SetSplashScreenProgress(20): time = ");
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
Reference< XRestartManager > xRestartManager( OfficeRestartManager::get(xContext) );
@ -2338,7 +2338,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
case ApplicationEvent::Type::Appear:
if ( !GetCommandLineArgs().IsInvisible() && !impl_bringToFrontRecoveryUI() )
{
Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< css::uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
// find active task - the active task is always a visible task
Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( xContext );
@ -2427,7 +2427,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
// NOTICE: The quickstart service must be initialized inside the "main thread", so we use the
// application events to do this (they are executed inside main thread)!!!
// Don't start quickstart service if the user specified "--invisible" on the command line!
Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< css::uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
css::office::Quickstart::createStart(xContext, true/*Quickstart*/);
}
break;
@ -2437,7 +2437,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
// The user will try it again, in case nothing happens .-)
try
{
Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< css::uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( xContext );
@ -2512,7 +2512,7 @@ void Desktop::OpenSplashScreen()
aSplashService = "com.sun.star.office.PipeSplashScreen";
Sequence< Any > aSeq{ Any(true) /* bVisible */, Any(aAppName) };
css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const css::uno::Reference< css::uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
m_rSplashScreen.set(
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aSplashService, aSeq, xContext),
UNO_QUERY);
@ -2583,7 +2583,7 @@ void Desktop::ShowBackingComponent(Desktop * progress)
{
return;
}
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext();
Reference< XDesktop2 > xDesktop = css::frame::Desktop::create(xContext);
if (progress != nullptr)
{

View file

@ -228,7 +228,7 @@ void Desktop::createAcceptor(const OUString& aAcceptString)
}
Sequence< Any > aSeq{ Any(aAcceptString), Any(bAccept) };
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
Reference<XInitialization> rAcceptor(
xContext->getServiceManager()->createInstanceWithContext(u"com.sun.star.office.Acceptor"_ustr, xContext),
UNO_QUERY );

View file

@ -381,7 +381,7 @@ bool Desktop::CheckExtensionDependencies()
return false;
}
uno::Reference< uno::XComponentContext > xContext(
const uno::Reference< uno::XComponentContext >& xContext(
comphelper::getProcessComponentContext());
bool bDependenciesValid = impl_checkDependencies( xContext );
@ -402,7 +402,7 @@ bool Desktop::CheckExtensionDependencies()
void Desktop::SynchronizeExtensionRepositories(bool bCleanedExtensionCache, Desktop* pDesktop)
{
uno::Reference< uno::XComponentContext > context(
const uno::Reference< uno::XComponentContext >& context(
comphelper::getProcessComponentContext());
uno::Reference< ucb::XCommandEnvironment > silent(
new SilentCommandEnv(context, pDesktop));

View file

@ -102,7 +102,7 @@ std::shared_ptr<const SfxFilter> impl_lookupExportFilterForUrl( std::u16string_v
":eflags=" +
OUString::number(static_cast<int>(SFX_FILTER_NOTINSTALLED));
const Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
const Reference< XComponentContext >& xContext( comphelper::getProcessComponentContext() );
const Reference< XContainerQuery > xFilterFactory(
xContext->getServiceManager()->createInstanceWithContext( u"com.sun.star.document.FilterFactory"_ustr, xContext ),
UNO_QUERY_THROW );
@ -134,7 +134,7 @@ std::shared_ptr<const SfxFilter> impl_getExportFilterFromUrl(
{
try
{
const Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
const Reference< XComponentContext >& xContext( comphelper::getProcessComponentContext() );
const Reference< document::XTypeDetection > xTypeDetector(
xContext->getServiceManager()->createInstanceWithContext( u"com.sun.star.document.TypeDetection"_ustr, xContext ),
UNO_QUERY_THROW );

View file

@ -74,7 +74,7 @@ int MyApp::Main()
void MyApp::DeInit()
{
css::uno::Reference< css::uno::XComponentContext > context(
const css::uno::Reference< css::uno::XComponentContext >& context(
comphelper::getProcessComponentContext());
dp_misc::disposeBridges(context);
css::uno::Reference< css::lang::XComponent >(

View file

@ -619,7 +619,7 @@ void UpdateDialog::createNotifyJob( bool bPrepareOnly,
util::URL aURL;
xNameAccess->getByName(u"URL"_ustr) >>= aURL.Complete;
uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
uno::Reference < util::XURLTransformer > xTransformer = util::URLTransformer::create(xContext);
xTransformer->parseStrict(aURL);

View file

@ -296,7 +296,7 @@ namespace dp_misc {
DescriptionInfoset getDescriptionInfoset(std::u16string_view sExtensionFolderURL)
{
Reference< css::xml::dom::XNode > root;
Reference<css::uno::XComponentContext> context(
const Reference<css::uno::XComponentContext>& context(
comphelper::getProcessComponentContext());
try {
root =

View file

@ -201,7 +201,7 @@ bool MigrationImpl::doMigration()
OUString aOldCfgDataPath = m_aInfo.userdata + "/user/config/soffice.cfg/modules/" + i.sModuleShortName;
uno::Sequence< uno::Any > lArgs {uno::Any(aOldCfgDataPath), uno::Any(embed::ElementModes::READ)};
uno::Reference< uno::XComponentContext > xContext(comphelper::getProcessComponentContext());
const uno::Reference< uno::XComponentContext >& xContext(comphelper::getProcessComponentContext());
uno::Reference< lang::XSingleServiceFactory > xStorageFactory(embed::FileSystemStorageFactory::create(xContext));
uno::Reference< embed::XStorage > xModules(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY);
uno::Reference< ui::XUIConfigurationManager2 > xOldCfgManager = ui::UIConfigurationManager::create(xContext);
@ -868,7 +868,7 @@ void MigrationImpl::runServices()
// and execute the migration job
uno::Reference< XJob > xMigrationJob;
uno::Reference< uno::XComponentContext > xContext(comphelper::getProcessComponentContext());
const uno::Reference< uno::XComponentContext >& xContext(comphelper::getProcessComponentContext());
for (auto const& rMigration : *m_vrMigrations)
{
if( !rMigration.service.isEmpty()) {

View file

@ -65,7 +65,7 @@ namespace drawinglayer::primitive2d
if(aUnoControlTypeName.isEmpty())
return;
uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
uno::Reference< awt::XControl > xXControl(
xContext->getServiceManager()->createInstanceWithContext(aUnoControlTypeName, xContext), uno::UNO_QUERY);

View file

@ -199,7 +199,7 @@ namespace drawinglayer::primitive2d
if(!xBreakIterator.is())
{
css::uno::Reference< css::uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const css::uno::Reference< css::uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
xBreakIterator = css::i18n::BreakIterator::create(xContext);
}

View file

@ -1502,7 +1502,7 @@ void VclMetafileProcessor2D::processTextSimplePortionPrimitive2D(
// support for TEXT_ MetaFile actions only for decorated texts
if (!gxBreakIterator.get() || !gxBreakIterator.get()->get())
{
uno::Reference<uno::XComponentContext> xContext(
const uno::Reference<uno::XComponentContext>& xContext(
::comphelper::getProcessComponentContext());
gxBreakIterator.set(i18n::BreakIterator::create(xContext));
}

View file

@ -4737,7 +4737,7 @@ Reference < i18n::XBreakIterator > const & ImpEditEngine::ImplGetBreakIterator()
{
if (!mxBI.is())
{
uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext());
const uno::Reference<uno::XComponentContext>& xContext(::comphelper::getProcessComponentContext());
mxBI = i18n::BreakIterator::create(xContext);
}
return mxBI;
@ -4747,7 +4747,7 @@ Reference < i18n::XExtendedInputSequenceChecker > const & ImpEditEngine::ImplGet
{
if (!mxISC.is())
{
uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext());
const uno::Reference<uno::XComponentContext>& xContext(::comphelper::getProcessComponentContext());
mxISC = i18n::InputSequenceChecker::create(xContext);
}
return mxISC;

View file

@ -75,7 +75,7 @@ static void lcl_getFormatter(css::uno::Reference<css::text::XNumberingFormatter>
try
{
Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
const Reference<XComponentContext>& xContext( ::comphelper::getProcessComponentContext() );
Reference<XDefaultNumberingProvider> xRet = text::DefaultNumberingProvider::create(xContext);
_xFormatter.set(xRet, UNO_QUERY);
}

View file

@ -2350,7 +2350,7 @@ void SvxAutoCorrectLanguageLists::LoadXMLExceptList_Imp(
}
else
{
uno::Reference< uno::XComponentContext > xContext =
const uno::Reference< uno::XComponentContext >& xContext =
comphelper::getProcessComponentContext();
xml::sax::InputSource aParserInput;
@ -2423,7 +2423,7 @@ void SvxAutoCorrectLanguageLists::SaveExceptList_Imp(
xStrm->SetProperty( u"MediaType"_ustr, Any(u"text/xml"_ustr) );
uno::Reference< uno::XComponentContext > xContext =
const uno::Reference< uno::XComponentContext >& xContext =
comphelper::getProcessComponentContext();
uno::Reference < xml::sax::XWriter > xWriter = xml::sax::Writer::create(xContext);
@ -2464,7 +2464,7 @@ SvxAutocorrWordList* SvxAutoCorrectLanguageLists::LoadAutocorrWordList()
{
uno::Reference < embed::XStorage > xStg = comphelper::OStorageHelper::GetStorageFromURL( sShareAutoCorrFile, embed::ElementModes::READ );
uno::Reference < io::XStream > xStrm = xStg->openStreamElement( pXMLImplAutocorr_ListStr, embed::ElementModes::READ );
uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = comphelper::getProcessComponentContext();
xml::sax::InputSource aParserInput;
aParserInput.sSystemId = pXMLImplAutocorr_ListStr;
@ -2763,7 +2763,7 @@ bool SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SotStorage& rStg )
refList->SetBufferSize( 8192 );
refList->SetProperty( u"MediaType"_ustr, Any(u"text/xml"_ustr) );
uno::Reference< uno::XComponentContext > xContext =
const uno::Reference< uno::XComponentContext >& xContext =
comphelper::getProcessComponentContext();
uno::Reference < xml::sax::XWriter > xWriter = xml::sax::Writer::create(xContext);

View file

@ -56,7 +56,7 @@ using namespace ::com::sun::star::linguistic2;
static uno::Reference< XLinguServiceManager2 > GetLngSvcMgr_Impl()
{
uno::Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
const uno::Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext();
uno::Reference< XLinguServiceManager2 > xRes = LinguServiceManager::create(xContext);
return xRes;
}
@ -402,7 +402,7 @@ LinguMgrExitLstnr::LinguMgrExitLstnr()
// add object to frame::Desktop EventListeners in order to properly call
// the AtExit function at application exit.
uno::Reference< XComponentContext > xContext = getProcessComponentContext();
const uno::Reference< XComponentContext >& xContext = getProcessComponentContext();
xDesktop = Desktop::create( xContext );
xDesktop->addEventListener( this );
}

View file

@ -291,7 +291,7 @@ void SvxWriteXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection&
do
{
// create service factory
uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
const uno::Reference<uno::XComponentContext>& xContext( ::comphelper::getProcessComponentContext() );
// create document handler
uno::Reference< xml::sax::XWriter > xWriter = xml::sax::Writer::create( xContext );

View file

@ -162,7 +162,7 @@ EditPaM SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection
{
do
{
uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
const uno::Reference<uno::XComponentContext>& xContext( ::comphelper::getProcessComponentContext() );
xml::sax::InputSource aParserInput;
aParserInput.aInputStream = new utl::OInputStreamWrapper(rStream);

View file

@ -346,7 +346,7 @@ namespace abp
{
// Embed.
OUString aStreamRelPath = u"EmbeddedDatabase"_ustr;
auto xContext(comphelper::getProcessComponentContext());
const auto& xContext(comphelper::getProcessComponentContext());
auto xUri = css::uri::UriReferenceFactory::create(xContext)->parse(aOwnURL);
assert(xUri.is());
xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)->createVndSunStarPkgUrlReference(xUri);

View file

@ -125,7 +125,7 @@ namespace bib
if( !m_xControlContainer.is())
return;
uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = comphelper::getProcessComponentContext();
if ( !m_xGridModel.is())
return;

View file

@ -283,7 +283,7 @@ const Sequence<OUString>& DBChangeDialogConfig_Impl::GetDataSourceNames()
{
if(!aSourceNames.hasElements())
{
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const Reference< XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
Reference<XDatabaseContext> xDBContext = DatabaseContext::create(xContext);
aSourceNames = xDBContext->getElementNames();
}

View file

@ -81,7 +81,7 @@ static Reference< XConnection > getConnection(const OUString& _rURL)
// first get the sdb::DataSource corresponding to the url
Reference< XDataSource > xDataSource;
// is it a favorite title ?
Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
const Reference<XComponentContext>& xContext = comphelper::getProcessComponentContext();
Reference< XDatabaseContext > xNamingContext = DatabaseContext::create(xContext);
if (xNamingContext->hasByName(_rURL))
{
@ -1198,7 +1198,7 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel(
else
aInstanceName += getControlName(nFormatKey);
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext();
Reference< XInterface > xObject = xContext->getServiceManager()->createInstanceWithContext(aInstanceName, xContext);
xModel.set( xObject, UNO_QUERY );
Reference< XPropertySet > xPropSet( xModel, UNO_QUERY );
@ -1364,7 +1364,7 @@ uno::Reference< form::runtime::XFormController > const & BibDataManager::GetForm
{
if(!m_xFormCtrl.is())
{
Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
const Reference< uno::XComponentContext >& xContext = comphelper::getProcessComponentContext();
m_xFormCtrl = form::runtime::FormController::create(xContext);
m_xFormCtrl->setModel(uno::Reference< awt::XTabControllerModel > (getForm(), UNO_QUERY));
m_xFormDispatch.set( m_xFormCtrl, UNO_QUERY);

View file

@ -444,7 +444,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
{
try
{
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
// create the dialog object
uno::Reference< ui::dialogs::XExecutableDialog > xDialog = sdb::FilterDialog::createWithQuery(xContext, m_xDatMan->getParser(),

View file

@ -311,7 +311,7 @@ namespace pcr
Reference<XGraphic> xGraphic;
try
{
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const Reference< XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
Reference< XGraphicProvider > xGraphicProvider( GraphicProvider::create(xContext) );
Sequence aMediaProperties{ comphelper::makePropertyValue(u"URL"_ustr, rImageURL) };

View file

@ -2774,7 +2774,7 @@ void DffPropertyReader::CheckAndCorrectExcelTextRotation( SvStream& rIn, SfxItem
( new ::comphelper::SequenceInputStream( aXMLDataSeq ) );
try
{
css::uno::Reference< css::uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
const css::uno::Reference< css::uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
css::uno::Reference< css::embed::XStorage > xStorage
( ::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(
OFOPXML_STORAGE_FORMAT_STRING, xInputStream, xContext, true ) );

View file

@ -666,7 +666,7 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
bool SVGFilter::implExportImpressOrDraw( const Reference< XOutputStream >& rxOStm)
{
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ) ;
const Reference< XComponentContext >& xContext( ::comphelper::getProcessComponentContext() ) ;
bool bRet = false;
// Instead of writing to rxOStm directly, we write here in case we need
// to compress the output later
@ -790,7 +790,7 @@ bool SVGFilter::implExportImpressOrDraw( const Reference< XOutputStream >& rxOSt
bool SVGFilter::implExportWriterOrCalc( const Reference< XOutputStream >& rxOStm )
{
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ) ;
const Reference< XComponentContext >& xContext( ::comphelper::getProcessComponentContext() ) ;
bool bRet = false;
if( rxOStm.is() )

View file

@ -153,7 +153,7 @@ Reference<XXPathAPI> ComputedExpression::_getXPathAPI(const xforms::EvaluationCo
Reference<XXPathAPI> xXPath( XPathAPI::create( comphelper::getProcessComponentContext() ) );
// register xforms extension#
Reference< XComponentContext > aComponentContext = comphelper::getProcessComponentContext();
const Reference< XComponentContext >& aComponentContext = comphelper::getProcessComponentContext();
Reference< XXPathExtension > aExtension = XPathExtension::createWithModel(aComponentContext, aContext.mxModel, aContext.mxContextNode);
xXPath->registerExtensionInstance(aExtension);

View file

@ -50,7 +50,7 @@ CSubmission::SubmissionResult CSubmission::replace(std::u16string_view aReplace,
return CSubmission::UNKNOWN_ERROR;
try {
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext();
if (o3tl::equalsIgnoreAsciiCase(aReplace, u"all")
|| o3tl::equalsIgnoreAsciiCase(aReplace, u"document")) {
Reference< XComponentLoader > xLoader;

View file

@ -442,7 +442,7 @@ ViewTabListBox_Impl::ViewTabListBox_Impl(std::unique_ptr<weld::TreeView> xTreeVi
maResetQuickSearch.SetTimeout( QUICK_SEARCH_TIMEOUT );
maResetQuickSearch.SetInvokeHandler( LINK( this, ViewTabListBox_Impl, ResetQuickSearch_Impl ) );
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
Reference< XInteractionHandler > xInteractionHandler(
InteractionHandler::createWithParent(xContext, pTopLevel->GetXWindow()), UNO_QUERY_THROW);
@ -798,7 +798,7 @@ SvtFileView::SvtFileView(weld::Window* pTopLevel,
if ( bShowType )
nFlags |= FileViewFlags::SHOW_TYPE;
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
Reference< XInteractionHandler > xInteractionHandler(
InteractionHandler::createWithParent(xContext, pTopLevel->GetXWindow()), UNO_QUERY_THROW);
Reference < XCommandEnvironment > xCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );

View file

@ -27,7 +27,7 @@ FolderTree::FolderTree(std::unique_ptr<weld::TreeView> xTreeView, weld::Window*
m_xTreeView->set_size_request(m_xTreeView->get_approximate_digit_width() * 24,
m_xTreeView->get_height_rows(7));
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
Reference< XInteractionHandler > xInteractionHandler(
InteractionHandler::createWithParent(xContext, pTopLevel->GetXWindow()), UNO_QUERY_THROW);
m_xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );

View file

@ -75,7 +75,7 @@ namespace svt
void SmartContent::enableOwnInteractionHandler(::svt::OFilePickerInteractionHandler::EInterceptedInteractions eInterceptions)
{
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
Reference< XInteractionHandler > xGlobalInteractionHandler(
InteractionHandler::createWithParent(xContext, nullptr), UNO_QUERY_THROW );
@ -90,7 +90,7 @@ namespace svt
{
m_xOwnInteraction.clear();
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
Reference< XInteractionHandler > xGlobalInteractionHandler(
InteractionHandler::createWithParent(xContext, nullptr), UNO_QUERY_THROW );
m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() );

View file

@ -113,7 +113,7 @@ void FrameListAnalyzer::impl_analyze()
{
try
{
css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const css::uno::Reference< css::uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
css::uno::Reference< css::frame::XModuleManager2 > xModuleMgr = css::frame::ModuleManager::create(xContext);
OUString sModule = xModuleMgr->identify(m_xReferenceFrame);
m_bReferenceIsBacking = sModule == "com.sun.star.frame.StartModule";
@ -184,7 +184,7 @@ void FrameListAnalyzer::impl_analyze()
{
try
{
css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const css::uno::Reference< css::uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
css::uno::Reference< css::frame::XModuleManager2 > xModuleMgr = css::frame::ModuleManager::create(xContext);
OUString sModule = xModuleMgr->identify(xFrame);
if (sModule == "com.sun.star.frame.StartModule")

View file

@ -331,7 +331,7 @@ void SAL_CALL OReadMenuBarHandler::startElement(
m_bMenuMode = true;
// Container must be factory to create sub container
Reference< XComponentContext > xComponentContext(
const Reference< XComponentContext >& xComponentContext(
comphelper::getProcessComponentContext() );
Reference< XIndexContainer > xSubItemContainer;

View file

@ -614,7 +614,7 @@ LoadEnv::EContentType LoadEnv::classifyContent(const OUString&
}
// following operations can work on an internal type name only :-(
css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const css::uno::Reference< css::uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
css::uno::Reference< css::document::XTypeDetection > xDetect(
xContext->getServiceManager()->createInstanceWithContext(
u"com.sun.star.document.TypeDetection"_ustr, xContext),

View file

@ -95,7 +95,7 @@ void ThesaurusMenuController::fillPopupMenu()
{
try
{
css::uno::Reference<css::uno::XComponentContext> xContext(::comphelper::getProcessComponentContext());
const css::uno::Reference<css::uno::XComponentContext>& xContext(::comphelper::getProcessComponentContext());
css::uno::Reference<css::graphic::XGraphicProvider> xProvider(css::graphic::GraphicProvider::create(xContext));
xGraphic = xProvider->queryGraphic({ comphelper::makePropertyValue(u"URL"_ustr, aSynonymsImageUrl) });
}

View file

@ -84,7 +84,7 @@ void ToolbarModeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
SolarMutexGuard aSolarMutexGuard;
resetPopupMenu( rPopupMenu );
const Reference<XComponentContext> xContext (::comphelper::getProcessComponentContext() );
const Reference<XComponentContext>& xContext (::comphelper::getProcessComponentContext() );
const Reference<frame::XModuleManager> xModuleManager = frame::ModuleManager::create( xContext );
vcl::EnumContext::Application eApp = vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(m_xFrame));

View file

@ -244,7 +244,7 @@ static OUString transliterate_titlecase_Impl(
OUString aRes;
if (!aText.isEmpty())
{
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const Reference< XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
rtl::Reference< CharacterClassificationImpl > xCharClassImpl( new CharacterClassificationImpl( xContext ) );
// because xCharClassImpl.toTitle does not handle ligatures or Beta but will raise

View file

@ -71,7 +71,7 @@ using namespace linguistic;
static uno::Reference< XLinguServiceManager2 > GetLngSvcMgr_Impl()
{
uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< XLinguServiceManager2 > xRes = LinguServiceManager::create( xContext ) ;
return xRes;
}

View file

@ -61,7 +61,7 @@ using namespace linguistic;
static uno::Reference< XLinguServiceManager2 > GetLngSvcMgr_Impl()
{
uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< XLinguServiceManager2 > xRes = LinguServiceManager::create( xContext ) ;
return xRes;
}

View file

@ -68,7 +68,7 @@ static void ReadThroughDic( const OUString &rMainURL, ConvDicXMLImport &rImport
return;
DBG_ASSERT(!INetURLObject( rMainURL ).HasError(), "invalid URL");
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
// get xInputStream stream
uno::Reference< io::XInputStream > xIn;
@ -207,7 +207,7 @@ void ConvDic::Save()
return;
DBG_ASSERT(!INetURLObject( aMainURL ).HasError(), "invalid URL");
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
// get XOutputStream stream
uno::Reference< io::XStream > xStream;

View file

@ -88,7 +88,7 @@ const sal_Int16 DIC_VERSION_7 = 7;
static uno::Reference< XLinguServiceManager2 > GetLngSvcMgr_Impl()
{
uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< XLinguServiceManager2 > xRes = LinguServiceManager::create( xContext ) ;
return xRes;
}
@ -273,7 +273,7 @@ ErrCode DictionaryNeo::loadEntries(const OUString &rMainURL)
if (rMainURL.isEmpty())
return ERRCODE_NONE;
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
// get XInputStream stream
uno::Reference< io::XInputStream > xStream;
@ -407,7 +407,7 @@ ErrCode DictionaryNeo::saveEntries(const OUString &rURL)
return ERRCODE_NONE;
DBG_ASSERT(!INetURLObject( rURL ).HasError(), "lng : invalid URL");
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
// get XOutputStream stream
uno::Reference<io::XStream> xStream;

View file

@ -761,7 +761,7 @@ static bool IsVers2OrNewer( const OUString& rFileURL, LanguageType& nLng, bool&
return false;
// get stream to be used
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
// get XInputStream stream
uno::Reference< io::XInputStream > xStream;

View file

@ -564,7 +564,7 @@ uno::Reference< linguistic2::XProofreader > GrammarCheckingIterator::GetGrammarC
{
try
{
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< linguistic2::XProofreader > xGC(
xContext->getServiceManager()->createInstanceWithContext(aSvcImplName, xContext),
uno::UNO_QUERY_THROW );
@ -883,7 +883,7 @@ sal_Int32 GrammarCheckingIterator::GetSuggestedEndOfSentence(
if (!m_xBreakIterator.is())
{
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
m_xBreakIterator = i18n::BreakIterator::create(xContext);
}
sal_Int32 nTextLen = rText.getLength();
@ -1095,7 +1095,7 @@ uno::Reference< util::XChangesBatch > const & GrammarCheckingIterator::GetUpdate
try
{
// get configuration provider
uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
const uno::Reference< uno::XComponentContext >& xContext = comphelper::getProcessComponentContext();
uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider =
configuration::theDefaultProvider::get( xContext );

View file

@ -345,7 +345,7 @@ Reference< XHyphenatedWord > SAL_CALL
{
Reference< XHyphenator > *pRef = pEntry->aSvcRefs.getArray();
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
// build service initialization argument
@ -477,7 +477,7 @@ Reference< XHyphenatedWord > SAL_CALL
{
Reference< XHyphenator > *pRef = pEntry->aSvcRefs.getArray();
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
// build service initialization argument
@ -599,7 +599,7 @@ Reference< XPossibleHyphens > SAL_CALL
{
Reference< XHyphenator > *pRef = pEntry->aSvcRefs.getArray();
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
// build service initialization argument

View file

@ -70,7 +70,7 @@ static uno::Sequence< lang::Locale > GetAvailLocales(
{
uno::Sequence< lang::Locale > aRes;
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
if( rSvcImplNames.hasElements() )
{
std::set< LanguageType > aLanguages;
@ -417,7 +417,7 @@ LngSvcMgr::LngSvcMgr()
aUpdateIdle.SetInvokeHandler(LINK(this, LngSvcMgr, updateAndBroadcast));
// request to be notified if an extension has been added/removed
uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
const uno::Reference<uno::XComponentContext>& xContext(comphelper::getProcessComponentContext());
uno::Reference<deployment::XExtensionManager> xExtensionManager;
try {
@ -935,7 +935,7 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl()
pAvailSpellSvcs.emplace();
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xContext->getServiceManager(), uno::UNO_QUERY );
uno::Reference< container::XEnumeration > xEnum;
@ -989,7 +989,7 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl()
pAvailGrammarSvcs.emplace();
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xContext->getServiceManager(), uno::UNO_QUERY );
uno::Reference< container::XEnumeration > xEnum;
@ -1047,7 +1047,7 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl()
return;
pAvailHyphSvcs.emplace();
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xContext->getServiceManager(), uno::UNO_QUERY );
uno::Reference< container::XEnumeration > xEnum;
@ -1099,7 +1099,7 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl()
pAvailThesSvcs.emplace();
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xContext->getServiceManager(), uno::UNO_QUERY );
uno::Reference< container::XEnumeration > xEnum;

View file

@ -672,7 +672,7 @@ uno::Reference< XLinguProperties > GetLinguProperties()
uno::Reference< XSearchableDictionaryList > GetDictionaryList()
{
uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< XSearchableDictionaryList > xRef;
try
{
@ -705,7 +705,7 @@ AppExitListener::AppExitListener()
{
// add object to Desktop EventListeners in order to properly call
// the AtExit function at application exit.
uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< XComponentContext >& xContext( comphelper::getProcessComponentContext() );
try
{

View file

@ -86,7 +86,7 @@ static std::vector< OUString > GetMultiPaths_Impl(
OUString aWritablePath;
bool bSuccess = true;
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
try
{
OUString aInternal( OUString::Concat(rPathPrefix) + "_internal" );

View file

@ -341,7 +341,7 @@ bool SpellCheckerDispatcher::isValid_Impl(
const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray();
Reference< XSpellChecker > *pRef = pEntry->aSvcRefs .getArray();
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
// build service initialization argument
@ -522,7 +522,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray();
Reference< XSpellChecker > *pRef = pEntry->aSvcRefs .getArray();
Reference< XComponentContext > xContext(
const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
// build service initialization argument

Some files were not shown because too many files have changed in this diff Show more