summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/misc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-04 13:18:35 +0200
committerNoel Grandin <noel@peralex.com>2012-12-06 13:20:31 +0200
commit773ad75b0dbc4dac1cae704c726b5a2d67ae1146 (patch)
treeb95386a6639835d7751a6b3aa7bcdfb114f026f8 /dbaccess/source/ui/misc
parent584cd8d1c23d47becb776e382f853ffe77ce9fc2 (diff)
fdo#46808, Adapt util::NumberFormatsSupplier UNO service to new style
Change-Id: I58436d9eea0c38d14cde2dc01aa463d5d71912e9
Diffstat (limited to 'dbaccess/source/ui/misc')
-rw-r--r--dbaccess/source/ui/misc/DExport.cxx2
-rw-r--r--dbaccess/source/ui/misc/TableCopyHelper.cxx5
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx6
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx14
-rw-r--r--dbaccess/source/ui/misc/WExtendPages.cxx5
5 files changed, 17 insertions, 15 deletions
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index eb3a755d7115..1599bed21890 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -715,7 +715,7 @@ sal_Bool ODatabaseExport::executeWizard(const ::rtl::OUString& _rTableName,const
m_xFormatter,
getTypeSelectionPageFactory(),
m_rInputStream,
- m_xFactory
+ comphelper::getComponentContext(m_xFactory)
);
sal_Bool bError = sal_False;
diff --git a/dbaccess/source/ui/misc/TableCopyHelper.cxx b/dbaccess/source/ui/misc/TableCopyHelper.cxx
index 83b73a894d04..b57bf8e0072f 100644
--- a/dbaccess/source/ui/misc/TableCopyHelper.cxx
+++ b/dbaccess/source/ui/misc/TableCopyHelper.cxx
@@ -40,6 +40,7 @@
#include <tools/urlobj.hxx>
#include <tools/diagnose_ex.h>
#include <comphelper/componentcontext.hxx>
+#include <comphelper/processfactory.hxx>
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/sdbcx/XViewsSupplier.hpp>
#include <com/sun/star/sdb/XQueryDefinitionsSupplier.hpp>
@@ -246,9 +247,9 @@ sal_Bool OTableCopyHelper::copyTagTable(OTableCopyHelper::DropDescriptor& _rDesc
Reference<XEventListener> xEvt;
ODatabaseImportExport* pImport = NULL;
if ( _rDesc.bHtml )
- pImport = new OHTMLImportExport(_xConnection,getNumberFormatter(_xConnection,m_pController->getORB()),m_pController->getORB());
+ pImport = new OHTMLImportExport(_xConnection,getNumberFormatter(_xConnection, comphelper::getComponentContext(m_pController->getORB())),m_pController->getORB());
else
- pImport = new ORTFImportExport(_xConnection,getNumberFormatter(_xConnection,m_pController->getORB()),m_pController->getORB());
+ pImport = new ORTFImportExport(_xConnection,getNumberFormatter(_xConnection, comphelper::getComponentContext(m_pController->getORB())),m_pController->getORB());
xEvt = pImport;
SvStream* pStream = (SvStream*)(SotStorageStream*)_rDesc.aHtmlRtfStorage;
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index e28ad805f397..b781a71f96ba 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -1604,7 +1604,7 @@ sal_Bool insertHierachyElement( Window* _pParent, const Reference< XMultiService
return sal_True;
}
// -----------------------------------------------------------------------------
-Reference< XNumberFormatter > getNumberFormatter(const Reference< XConnection >& _rxConnection,const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rMF )
+Reference< XNumberFormatter > getNumberFormatter(const Reference< XConnection >& _rxConnection, const Reference< ::com::sun::star::uno::XComponentContext >& _rxContext )
{
// ---------------------------------------------------------------
// create a formatter working with the connections format supplier
@@ -1612,13 +1612,13 @@ Reference< XNumberFormatter > getNumberFormatter(const Reference< XConnection >&
try
{
- Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(::dbtools::getNumberFormats(_rxConnection, sal_True,_rMF));
+ Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(::dbtools::getNumberFormats(_rxConnection, sal_True, _rxContext));
if ( xSupplier.is() )
{
// create a new formatter
xFormatter = Reference< util::XNumberFormatter > (
- util::NumberFormatter::create(comphelper::getComponentContext(_rMF)), UNO_QUERY_THROW);
+ util::NumberFormatter::create( _rxContext ), UNO_QUERY_THROW);
xFormatter->attachNumberFormatsSupplier(xSupplier);
}
}
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index b468478b5d50..5edb86e1b2b4 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -548,7 +548,7 @@ namespace
//------------------------------------------------------------------------
OCopyTableWizard::OCopyTableWizard( Window * pParent, const ::rtl::OUString& _rDefaultName, sal_Int16 _nOperation,
const ICopyTableSourceObject& _rSourceObject, const Reference< XConnection >& _xSourceConnection,
- const Reference< XConnection >& _xConnection, const Reference< XMultiServiceFactory >& _rxORB,
+ const Reference< XConnection >& _xConnection, const Reference< XComponentContext >& _rxContext,
const Reference< XInteractionHandler>& _xInteractionHandler)
: WizardDialog( pParent, ModuleRes(WIZ_RTFCOPYTABLE))
,m_pbHelp( this , ModuleRes(PB_HELP))
@@ -559,8 +559,8 @@ OCopyTableWizard::OCopyTableWizard( Window * pParent, const ::rtl::OUString& _rD
,m_mNameMapping(_xConnection->getMetaData().is() && _xConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers())
,m_xDestConnection( _xConnection )
,m_rSourceObject( _rSourceObject )
- ,m_xFormatter( getNumberFormatter( _xConnection, _rxORB ) )
- ,m_xFactory(_rxORB)
+ ,m_xFormatter( getNumberFormatter( _xConnection, _rxContext ) )
+ ,m_xContext(_rxContext)
,m_xInteractionHandler(_xInteractionHandler)
,m_sTypeNames(ModuleRes(STR_TABLEDESIGN_DBFIELDTYPES))
,m_nPageCount(0)
@@ -649,7 +649,7 @@ OCopyTableWizard::OCopyTableWizard( Window * pParent, const ::rtl::OUString& _rD
OCopyTableWizard::OCopyTableWizard( Window* pParent, const ::rtl::OUString& _rDefaultName, sal_Int16 _nOperation,
const ODatabaseExport::TColumns& _rSourceColumns, const ODatabaseExport::TColumnVector& _rSourceColVec,
const Reference< XConnection >& _xConnection, const Reference< XNumberFormatter >& _xFormatter,
- TypeSelectionPageFactory _pTypeSelectionPageFactory, SvStream& _rTypeSelectionPageArg, const Reference< XMultiServiceFactory >& _rM )
+ TypeSelectionPageFactory _pTypeSelectionPageFactory, SvStream& _rTypeSelectionPageArg, const Reference< XComponentContext >& _rxContext )
:WizardDialog( pParent, ModuleRes(WIZ_RTFCOPYTABLE))
,m_vSourceColumns(_rSourceColumns)
,m_pbHelp( this , ModuleRes(PB_HELP))
@@ -661,7 +661,7 @@ OCopyTableWizard::OCopyTableWizard( Window* pParent, const ::rtl::OUString& _rDe
,m_xDestConnection( _xConnection )
,m_rSourceObject( DummyCopySource::Instance() )
,m_xFormatter(_xFormatter)
- ,m_xFactory(_rM)
+ ,m_xContext(_rxContext)
,m_sTypeNames(ModuleRes(STR_TABLEDESIGN_DBFIELDTYPES))
,m_nPageCount(0)
,m_bDeleteSourceColumns(sal_False)
@@ -684,7 +684,7 @@ OCopyTableWizard::OCopyTableWizard( Window* pParent, const ::rtl::OUString& _rDe
::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aTypeInfo, m_aTypeInfoIndex );
::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aDestTypeInfo, m_aDestTypeInfoIndex );
- m_xInteractionHandler.set( InteractionHandler::createWithParent(comphelper::getComponentContext(m_xFactory), 0), UNO_QUERY );
+ m_xInteractionHandler.set( InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY );
OCopyTable* pPage1( new OCopyTable( this ) );
pPage1->disallowViews();
@@ -1339,7 +1339,7 @@ Reference< XPropertySet > OCopyTableWizard::createTable()
{
xSuppDestinationColumns.set( xTable, UNO_QUERY_THROW );
// insert new table name into table filter
- ::dbaui::appendToFilter( m_xDestConnection, m_sName, comphelper::getComponentContext(GetFactory()), this );
+ ::dbaui::appendToFilter( m_xDestConnection, m_sName, GetComponentContext(), this );
// copy ui settings
m_rSourceObject.copyUISettingsTo( xTable );
diff --git a/dbaccess/source/ui/misc/WExtendPages.cxx b/dbaccess/source/ui/misc/WExtendPages.cxx
index c1ccaf8eb541..e8e84a2a6270 100644
--- a/dbaccess/source/ui/misc/WExtendPages.cxx
+++ b/dbaccess/source/ui/misc/WExtendPages.cxx
@@ -23,6 +23,7 @@
#include "WCopyTable.hxx"
using namespace dbaui;
+using namespace com::sun::star;
//========================================================================
SvParser* OWizHTMLExtend::createReader(sal_Int32 _nRows)
{
@@ -30,7 +31,7 @@ SvParser* OWizHTMLExtend::createReader(sal_Int32 _nRows)
_nRows,
m_pParent->GetColumnPositions(),
m_pParent->GetFormatter(),
- m_pParent->GetFactory(),
+ uno::Reference<lang::XMultiServiceFactory>(m_pParent->GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW),
m_pParent->getDestVector(),
m_pParent->getTypeInfo(),
m_pParent->shouldCreatePrimaryKey());
@@ -42,7 +43,7 @@ SvParser* OWizRTFExtend::createReader(sal_Int32 _nRows)
_nRows,
m_pParent->GetColumnPositions(),
m_pParent->GetFormatter(),
- m_pParent->GetFactory(),
+ uno::Reference<lang::XMultiServiceFactory>(m_pParent->GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW),
m_pParent->getDestVector(),
m_pParent->getTypeInfo(),
m_pParent->shouldCreatePrimaryKey());