summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/dialogs/insdlg.cxx51
-rw-r--r--cui/source/options/certpath.cxx7
-rw-r--r--cui/source/options/optlingu.cxx15
3 files changed, 27 insertions, 46 deletions
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index 02282e48a01e..3d53af241edb 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -355,40 +355,27 @@ IMPL_LINK_NOARG(SvInsertPlugInDialog, BrowseHdl)
void fillNetscapePluginFilters( Sequence< OUString >& rNames, Sequence< OUString >& rTypes );
fillNetscapePluginFilters( aFilterNames, aFilterTypes );
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- if( xFactory.is() )
- {
- Reference< XFilePicker > xFilePicker( xFactory->createInstance( "com.sun.star.ui.dialogs.FilePicker" ), UNO_QUERY );
- DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" );
-
- Reference< XInitialization > xInit( xFilePicker, UNO_QUERY );
- Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY );
- if( xInit.is() && xFilePicker.is() && xFilterMgr.is() )
- {
- Sequence< Any > aServiceType( 1 );
- aServiceType[0] <<= TemplateDescription::FILEOPEN_SIMPLE;
- xInit->initialize( aServiceType );
+ Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+ Reference< XFilePicker3 > xFilePicker = ui::dialogs::FilePicker::createWithMode( xContext, ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE );
- // add the filters
- try
- {
- const OUString* pNames = aFilterNames.getConstArray();
- const OUString* pTypes = aFilterTypes.getConstArray();
- for( int i = 0; i < aFilterNames.getLength(); i++ )
- xFilterMgr->appendFilter( pNames[i], pTypes[i] );
- }
- catch( IllegalArgumentException& )
- {
- DBG_ASSERT( 0, "caught IllegalArgumentException when registering filter\n" );
- }
+ // add the filters
+ try
+ {
+ const OUString* pNames = aFilterNames.getConstArray();
+ const OUString* pTypes = aFilterTypes.getConstArray();
+ for( int i = 0; i < aFilterNames.getLength(); i++ )
+ xFilePicker->appendFilter( pNames[i], pTypes[i] );
+ }
+ catch( IllegalArgumentException& )
+ {
+ DBG_ASSERT( 0, "caught IllegalArgumentException when registering filter\n" );
+ }
- if( xFilePicker->execute() == ExecutableDialogResults::OK )
- {
- Sequence< OUString > aPathSeq( xFilePicker->getFiles() );
- INetURLObject aObj( aPathSeq[0] );
- m_pEdFileurl->SetText(aObj.PathToFileName());
- }
- }
+ if( xFilePicker->execute() == ExecutableDialogResults::OK )
+ {
+ Sequence< OUString > aPathSeq( xFilePicker->getFiles() );
+ INetURLObject aObj( aPathSeq[0] );
+ m_pEdFileurl->SetText(aObj.PathToFileName());
}
return 0;
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index 0a477ca7c601..e3ebcbe0375b 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -18,7 +18,7 @@
#include "certpath.hrc"
#include "dialmgr.hxx"
-#include <com/sun/star/mozilla/XMozillaBootstrap.hpp>
+#include <com/sun/star/mozilla/MozillaBootstrap.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
#include <comphelper/processfactory.hxx>
@@ -71,10 +71,7 @@ CertPathDialog::CertPathDialog( Window* pParent ) :
"mozilla" };
sal_Int32 nProduct = SAL_N_ELEMENTS(productTypes);
- uno::Reference<uno::XInterface> xInstance = comphelper::getProcessServiceFactory()->createInstance(
- "com.sun.star.mozilla.MozillaBootstrap");
-
- uno::Reference<mozilla::XMozillaBootstrap> xMozillaBootstrap(xInstance, uno::UNO_QUERY_THROW);
+ uno::Reference<mozilla::XMozillaBootstrap> xMozillaBootstrap = mozilla::MozillaBootstrap::create( comphelper::getProcessComponentContext() );
for (sal_Int32 i = 0; i < nProduct; ++i)
{
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 9ab17cf95674..75fd722cfcc7 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -517,7 +517,6 @@ class SvxLinguData_Impl
LangImplNameTable aCfgHyphTable;
LangImplNameTable aCfgThesTable;
LangImplNameTable aCfgGrammarTable;
- uno::Reference< XMultiServiceFactory > xMSF;
uno::Reference< XLinguServiceManager2 > xLinguSrvcMgr;
@@ -730,8 +729,8 @@ static void lcl_MergeDisplayArray(
SvxLinguData_Impl::SvxLinguData_Impl() :
nDisplayServices (0)
{
- xMSF = ::comphelper::getProcessServiceFactory();
- xLinguSrvcMgr = LinguServiceManager::create(comphelper::getComponentContext(xMSF));
+ uno::Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ xLinguSrvcMgr = LinguServiceManager::create(xContext);
const Locale& rCurrentLocale = Application::GetSettings().GetLanguageTag().getLocale();
Sequence<Any> aArgs(2);//second arguments has to be empty!
@@ -748,7 +747,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
ServiceInfo_Impl aInfo;
aInfo.sSpellImplName = pSpellNames[nIdx];
aInfo.xSpell = uno::Reference<XSpellChecker>(
- xMSF->createInstanceWithArguments(aInfo.sSpellImplName, aArgs), UNO_QUERY);
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sSpellImplName, aArgs, xContext), UNO_QUERY);
uno::Reference<XServiceDisplayName> xDispName(aInfo.xSpell, UNO_QUERY);
if(xDispName.is())
@@ -772,7 +771,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
ServiceInfo_Impl aInfo;
aInfo.sGrammarImplName = pGrammarNames[nIdx];
aInfo.xGrammar = uno::Reference<XProofreader>(
- xMSF->createInstanceWithArguments(aInfo.sGrammarImplName, aArgs), UNO_QUERY);
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sGrammarImplName, aArgs, xContext), UNO_QUERY);
uno::Reference<XServiceDisplayName> xDispName(aInfo.xGrammar, UNO_QUERY);
if(xDispName.is())
@@ -796,7 +795,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
ServiceInfo_Impl aInfo;
aInfo.sHyphImplName = pHyphNames[nIdx];
aInfo.xHyph = uno::Reference<XHyphenator>(
- xMSF->createInstanceWithArguments(aInfo.sHyphImplName, aArgs), UNO_QUERY);
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sHyphImplName, aArgs, xContext), UNO_QUERY);
uno::Reference<XServiceDisplayName> xDispName(aInfo.xHyph, UNO_QUERY);
if(xDispName.is())
@@ -820,7 +819,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
ServiceInfo_Impl aInfo;
aInfo.sThesImplName = pThesNames[nIdx];
aInfo.xThes = uno::Reference<XThesaurus>(
- xMSF->createInstanceWithArguments(aInfo.sThesImplName, aArgs), UNO_QUERY);
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sThesImplName, aArgs, xContext), UNO_QUERY);
uno::Reference<XServiceDisplayName> xDispName(aInfo.xThes, UNO_QUERY);
if(xDispName.is())
@@ -871,14 +870,12 @@ SvxLinguData_Impl::SvxLinguData_Impl( const SvxLinguData_Impl &rData ) :
aCfgHyphTable (rData.aCfgHyphTable),
aCfgThesTable (rData.aCfgThesTable),
aCfgGrammarTable (rData.aCfgGrammarTable),
- xMSF (rData.xMSF),
xLinguSrvcMgr (rData.xLinguSrvcMgr)
{
}
SvxLinguData_Impl & SvxLinguData_Impl::operator = (const SvxLinguData_Impl &rData)
{
- xMSF = rData.xMSF;
xLinguSrvcMgr = rData.xLinguSrvcMgr;
aAllServiceLocales = rData.aAllServiceLocales;
aCfgSpellTable = rData.aCfgSpellTable;