summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-06-03 13:22:24 +0200
committerNoel Grandin <noel@peralex.com>2013-06-05 08:13:21 +0200
commit9a49980efa3522eb89f66eb185c98009236ffa89 (patch)
tree271602627acedd147d88bf4016b1b92d1f89fc26 /svx
parentac40f246cd6991abaef2bf341a7d2d0d66885ccb (diff)
fdo#46808, Convert various comphelper::ComponentContext
..to regular XComponenContext Change-Id: I08f9092ae818db5c1e37880625b83607c860680b
Diffstat (limited to 'svx')
-rw-r--r--svx/source/form/formcontroller.cxx33
-rw-r--r--svx/source/inc/formcontroller.hxx7
2 files changed, 19 insertions, 21 deletions
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 1382e0296637..776fa59094bf 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -100,7 +100,7 @@ using namespace ::connectivity::simple;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
FormController_NewInstance_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & _rxORB )
{
- return *( new ::svxform::FormController( _rxORB ) );
+ return *( new ::svxform::FormController( comphelper::getComponentContext(_rxORB) ) );
}
namespace svxform
@@ -547,11 +547,11 @@ IMPL_LINK( FormController, OnInvalidateFeatures, void*, /*_pNotInterestedInThisP
DBG_NAME( FormController )
//------------------------------------------------------------------
-FormController::FormController(const Reference< XMultiServiceFactory > & _rxORB )
+FormController::FormController(const Reference< css::uno::XComponentContext > & _rxORB )
:FormController_BASE( m_aMutex )
,OPropertySetHelper( FormController_BASE::rBHelper )
- ,OSQLParserClient( comphelper::getComponentContext(_rxORB) )
- ,m_aContext( _rxORB )
+ ,OSQLParserClient( _rxORB )
+ ,m_xComponentContext( _rxORB )
,m_aActivateListeners(m_aMutex)
,m_aModifyListeners(m_aMutex)
,m_aErrorListeners(m_aMutex)
@@ -587,7 +587,7 @@ FormController::FormController(const Reference< XMultiServiceFactory > & _rxORB
::comphelper::increment(m_refCount);
{
- m_xTabController = TabController::create( m_aContext.getUNOContext() );
+ m_xTabController = TabController::create( m_xComponentContext );
m_xAggregate = Reference< XAggregation >( m_xTabController, UNO_QUERY_THROW );
m_xAggregate->setDelegator( *this );
}
@@ -831,7 +831,7 @@ void FormController::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) cons
{
Reference< XDatabaseMetaData> xMetaData(xConnection->getMetaData());
Reference< XNumberFormatsSupplier> xFormatSupplier( aStaticTools.getNumberFormats( xConnection, sal_True ) );
- Reference< XNumberFormatter> xFormatter( NumberFormatter::create(m_aContext.getUNOContext()), UNO_QUERY_THROW );
+ Reference< XNumberFormatter> xFormatter = NumberFormatter::create(m_xComponentContext);
xFormatter->attachNumberFormatsSupplier(xFormatSupplier);
Reference< XColumnsSupplier> xSupplyCols(m_xModelAsIndex, UNO_QUERY);
@@ -1466,7 +1466,7 @@ void FormController::toggleAutoFields(sal_Bool bAutoFields)
{
OUString sServiceName;
OSL_VERIFY( xSet->getPropertyValue( FM_PROP_DEFAULTCONTROL ) >>= sServiceName );
- Reference< XControl > xNewControl( m_aContext.createComponent( sServiceName ), UNO_QUERY );
+ Reference< XControl > xNewControl( m_xComponentContext->getServiceManager()->createInstanceWithContext( sServiceName, m_xComponentContext ), UNO_QUERY );
replaceControl( xControl, xNewControl );
}
}
@@ -1789,7 +1789,7 @@ void FormController::focusGained(const FocusEvent& e) throw( RuntimeException )
return;
// Control erhaelt Focus, dann eventuell in den sichtbaren Bereich
- Reference< XFormControllerContext > xContext( m_xContext );
+ Reference< XFormControllerContext > xContext( m_xFormControllerContext );
Reference< XControl > xCurrentControl( m_xCurrentControl );
aGuard.clear();
// <-- SYNCHRONIZED
@@ -1927,7 +1927,7 @@ void FormController::setModel(const Reference< XTabControllerModel > & Model) th
if (m_xModelAsIndex.is())
{
// re-create m_xFormOperations
- m_xFormOperations.set( FormOperations::createWithFormController( m_aContext.getUNOContext(), this ), UNO_SET_THROW );
+ m_xFormOperations = FormOperations::createWithFormController( m_xComponentContext, this );
m_xFormOperations->setFeatureInvalidation( this );
// adding load and ui interaction listeners
@@ -3061,7 +3061,7 @@ Reference< XFormControllerContext > SAL_CALL FormController::getContext() throw
{
::osl::MutexGuard aGuard( m_aMutex );
impl_checkDisposed_throw();
- return m_xContext;
+ return m_xFormControllerContext;
}
//------------------------------------------------------------------------------
@@ -3069,7 +3069,7 @@ void SAL_CALL FormController::setContext( const Reference< XFormControllerContex
{
::osl::MutexGuard aGuard( m_aMutex );
impl_checkDisposed_throw();
- m_xContext = _context;
+ m_xFormControllerContext = _context;
}
//------------------------------------------------------------------------------
@@ -3146,7 +3146,7 @@ void FormController::setFilter(::std::vector<FmFieldInfo>& rFieldInfos)
// need to parse criteria localized
OStaticDataAccessTools aStaticTools;
Reference< XNumberFormatsSupplier> xFormatSupplier( aStaticTools.getNumberFormats(xConnection, sal_True));
- Reference< XNumberFormatter> xFormatter( NumberFormatter::create(m_aContext.getUNOContext()), UNO_QUERY_THROW );
+ Reference< XNumberFormatter> xFormatter = NumberFormatter::create(m_xComponentContext);
xFormatter->attachNumberFormatsSupplier(xFormatSupplier);
Locale aAppLocale = Application::GetSettings().GetUILanguageTag().getLocale();
const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetUILocaleDataWrapper() );
@@ -3298,7 +3298,7 @@ void FormController::startFiltering()
// the control we have to activate after replacement
Reference< XDatabaseMetaData > xMetaData(xConnection->getMetaData());
Reference< XNumberFormatsSupplier > xFormatSupplier = aStaticTools.getNumberFormats(xConnection, sal_True);
- Reference< XNumberFormatter > xFormatter( NumberFormatter::create(m_aContext.getUNOContext()), UNO_QUERY_THROW );
+ Reference< XNumberFormatter > xFormatter = NumberFormatter::create(m_xComponentContext);
xFormatter->attachNumberFormatsSupplier(xFormatSupplier);
// structure for storing the field info
@@ -3372,7 +3372,7 @@ void FormController::startFiltering()
{
// create a filter control
Reference< XControl > xFilterControl = form::control::FilterControl::createWithFormat(
- m_aContext.getUNOContext(),
+ m_xComponentContext,
VCLUnoHelper::GetInterface( getDialogParentWindow() ),
xFormatter,
xModel);
@@ -3466,7 +3466,7 @@ void FormController::stopFiltering()
{
OUString sServiceName;
OSL_VERIFY( xSet->getPropertyValue( FM_PROP_DEFAULTCONTROL ) >>= sServiceName );
- Reference< XControl > xNewControl( m_aContext.createComponent( sServiceName ), UNO_QUERY );
+ Reference< XControl > xNewControl( m_xComponentContext->getServiceManager()->createInstanceWithContext( sServiceName, m_xComponentContext ), UNO_QUERY );
replaceControl( xControl, xNewControl );
}
}
@@ -4256,8 +4256,7 @@ bool FormController::ensureInteractionHandler()
return false;
m_bAttemptedHandlerCreation = true;
- m_xInteractionHandler.set( InteractionHandler::createWithParent(m_aContext.getUNOContext(), 0), UNO_QUERY );
- OSL_ENSURE( m_xInteractionHandler.is(), "FormController::ensureInteractionHandler: could not create an interaction handler!" );
+ m_xInteractionHandler = InteractionHandler::createWithParent(m_xComponentContext, 0);
return m_xInteractionHandler.is();
}
diff --git a/svx/source/inc/formcontroller.hxx b/svx/source/inc/formcontroller.hxx
index cc9af3abe8f0..5506fd8fe2d9 100644
--- a/svx/source/inc/formcontroller.hxx
+++ b/svx/source/inc/formcontroller.hxx
@@ -68,7 +68,6 @@
#include <com/sun/star/util/XModifyListener.hpp>
#include <comphelper/broadcasthelper.hxx>
-#include <comphelper/componentcontext.hxx>
#include <comphelper/proparrhlp.hxx>
#include <comphelper/stl_types.hxx>
#include <cppuhelper/propshlp.hxx>
@@ -145,11 +144,11 @@ namespace svxform
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess> m_xModelAsIndex;
::com::sun::star::uno::Reference< ::com::sun::star::script::XEventAttacherManager> m_xModelAsManager;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xParent;
- ::comphelper::ComponentContext m_aContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xComponentContext;
// Composer used for checking filter conditions
::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer > m_xComposer;
::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > m_xInteractionHandler;
- ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormControllerContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormControllerContext > m_xFormControllerContext;
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl> > m_aControls;
::cppu::OInterfaceContainerHelper
@@ -210,7 +209,7 @@ namespace svxform
Interceptors m_aControlDispatchInterceptors;
public:
- FormController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & _rxORB );
+ FormController( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & _rxORB );
protected:
~FormController();