summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-01-31 17:19:17 +0200
committerNoel Grandin <noel@peralex.com>2013-02-11 08:02:18 +0200
commita9934b36fea86646586f10daaa310d7173ede795 (patch)
tree9105477aa9517cefb18b785b94ae7badda51a102 /extensions
parentfdo#46808, Convert package module to XComponentContext (diff)
downloadcore-a9934b36fea86646586f10daaa310d7173ede795.tar.gz
core-a9934b36fea86646586f10daaa310d7173ede795.zip
fdo#46808, some simple conversions to XComponentContext
Change-Id: I68e90fde0645d4d1d518d22620d4c28ae91139d4
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/bibliography/bibbeam.cxx10
-rw-r--r--extensions/source/bibliography/datman.cxx6
-rw-r--r--extensions/source/bibliography/general.cxx6
-rw-r--r--extensions/source/bibliography/general.hxx3
4 files changed, 9 insertions, 16 deletions
diff --git a/extensions/source/bibliography/bibbeam.cxx b/extensions/source/bibliography/bibbeam.cxx
index 4eaf83ac9800..3a168a7445c8 100644
--- a/extensions/source/bibliography/bibbeam.cxx
+++ b/extensions/source/bibliography/bibbeam.cxx
@@ -137,9 +137,9 @@ namespace bib
if( m_xControlContainer.is())
{
- uno::Reference< lang::XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory();
+ uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
- if ( m_xGridModel.is() && xMgr.is())
+ if ( m_xGridModel.is())
{
uno::Reference< XPropertySet > xPropSet( m_xGridModel, UNO_QUERY );
@@ -149,10 +149,8 @@ namespace bib
rtl::OUString aControlName;
aAny >>= aControlName;
- m_xControl = Reference< awt::XControl > (xMgr->createInstance( aControlName ), UNO_QUERY );
- DBG_ASSERT( m_xControl.is(), "no GridControl created" );
- if ( m_xControl.is() )
- m_xControl->setModel( m_xGridModel );
+ m_xControl = Reference< awt::XControl > ( xContext->getServiceManager()->createInstanceWithContext(aControlName, xContext), UNO_QUERY_THROW );
+ m_xControl->setModel( m_xGridModel );
}
if ( m_xControl.is() )
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index 298fe29d9014..93b42303a0ad 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -564,8 +564,6 @@ DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan )
aSelectionLB.SetDoubleClickHdl( LINK(this, DBChangeDialog_Impl, DoubleClickHdl));
try
{
- Reference< XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory();
-
::Size aSize = aSelectionHB.GetSizePixel();
long nTabs[2];
nTabs[0] = 1;// Number of Tabs
@@ -1403,8 +1401,8 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel(
else
aInstanceName += getControlName(nFormatKey);
- Reference< XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory();
- Reference< XInterface > xObject = xMgr->createInstance(aInstanceName);
+ Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
+ Reference< XInterface > xObject = xContext->getServiceManager()->createInstanceWithContext(aInstanceName, xContext);
xModel=Reference< awt::XControlModel > ( xObject, UNO_QUERY );
Reference< XPropertySet > xPropSet( xModel, UNO_QUERY );
Any aFieldName; aFieldName <<= aName;
diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx
index dea0a288da23..7b9a4a4e50c7 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -279,7 +279,6 @@ BibGeneralPage::BibGeneralPage(Window* pParent, BibDataManager* pMan):
xCtrlContnr = VCLUnoHelper::CreateControlContainer(&aControlParentWin);
- xMgr = comphelper::getProcessServiceFactory();
// the control should be a bit smaller than the fixed text
Size aControlSize(aIdentifierFT.GetSizePixel());
aControlSize.Width() = aControlSize.Width() * 8 / 10;
@@ -464,7 +463,7 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl(
{
sal_Bool bTypeListBox = sTypeColumnName == rName;
xCtrModel = pDatMan->loadControlModel(rName, bTypeListBox);
- if ( xCtrModel.is() && xMgr.is())
+ if ( xCtrModel.is() )
{
uno::Reference< beans::XPropertySet > xPropSet( xCtrModel, UNO_QUERY );
@@ -523,7 +522,8 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl(
}
- uno::Reference< awt::XControl > xControl(xMgr->createInstance( aControlName ), UNO_QUERY );
+ uno::Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
+ uno::Reference< awt::XControl > xControl( xContext->getServiceManager()->createInstanceWithContext(aControlName, xContext), UNO_QUERY);
if ( xControl.is() )
{
xControl->setModel( xCtrModel);
diff --git a/extensions/source/bibliography/general.hxx b/extensions/source/bibliography/general.hxx
index bf3a5e781322..2b4a7ddb8c87 100644
--- a/extensions/source/bibliography/general.hxx
+++ b/extensions/source/bibliography/general.hxx
@@ -111,9 +111,6 @@ class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
xCtrlContnr;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- xMgr;
-
::com::sun::star::uno::Reference< ::com::sun::star::form::XBoundComponent >
xCurrentBoundComponent;