summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-11-01 13:25:57 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-11-05 16:43:14 +0100
commit41a71413f4ebe69a48ee068fd5c785d6015c0cca (patch)
treedc46caf73c60f9186e1ce28543715d79e747394e
parentb70a330d4f06daaeeff940b2f935c8089d8a7be6 (diff)
fdo#46808, use service constructor for ucb::PropertiesManager
Change-Id: Ib0c7375ac9f72647b10adcb2cea8a0f8e2fdcca0
-rw-r--r--ucb/source/ucp/file/filrset.cxx5
-rw-r--r--ucb/source/ucp/ftp/ftpresultsetbase.cxx3
-rw-r--r--ucbhelper/Library_ucbhelper.mk1
-rw-r--r--ucbhelper/inc/ucbhelper/resultsetmetadata.hxx6
-rw-r--r--ucbhelper/source/provider/resultset.cxx3
-rw-r--r--ucbhelper/source/provider/resultsetmetadata.cxx50
-rw-r--r--xmlhelp/source/cxxhelp/provider/resultsetbase.cxx3
7 files changed, 34 insertions, 37 deletions
diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx
index d343b1c5d802..86860da2a524 100644
--- a/ucb/source/ucp/file/filrset.cxx
+++ b/ucb/source/ucp/file/filrset.cxx
@@ -772,7 +772,7 @@ XResultSet_impl::getMetaData(
::ucbhelper::ResultSetMetaData* p =
new ::ucbhelper::ResultSetMetaData(
- uno::Reference<lang::XMultiServiceFactory>(m_pMyShell->m_xContext->getServiceManager(), uno::UNO_QUERY_THROW),
+ m_pMyShell->m_xContext,
m_sProperty,
aColumnData );
return uno::Reference< sdbc::XResultSetMetaData >( p );
@@ -780,8 +780,7 @@ XResultSet_impl::getMetaData(
}
::ucbhelper::ResultSetMetaData* p =
- new ::ucbhelper::ResultSetMetaData(
- uno::Reference<lang::XMultiServiceFactory>(m_pMyShell->m_xContext->getServiceManager(), uno::UNO_QUERY_THROW), m_sProperty );
+ new ::ucbhelper::ResultSetMetaData( m_pMyShell->m_xContext, m_sProperty );
return uno::Reference< sdbc::XResultSetMetaData >( p );
}
diff --git a/ucb/source/ucp/ftp/ftpresultsetbase.cxx b/ucb/source/ucp/ftp/ftpresultsetbase.cxx
index 701c2e77f00f..b6e68d7d5e71 100644
--- a/ucb/source/ucp/ftp/ftpresultsetbase.cxx
+++ b/ucb/source/ucp/ftp/ftpresultsetbase.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <comphelper/processfactory.hxx>
#include <ucbhelper/contentidentifier.hxx>
#include <com/sun/star/ucb/OpenMode.hpp>
#include <com/sun/star/uno/Reference.h>
@@ -641,7 +642,7 @@ ResultSetBase::getMetaData(
{
::ucbhelper::ResultSetMetaData* p =
new ::ucbhelper::ResultSetMetaData(
- m_xMSF, m_sProperty );
+ comphelper::getComponentContext(m_xMSF), m_sProperty );
return uno::Reference< sdbc::XResultSetMetaData >( p );
}
diff --git a/ucbhelper/Library_ucbhelper.mk b/ucbhelper/Library_ucbhelper.mk
index 73b1afc30c4e..ff92193a5d42 100644
--- a/ucbhelper/Library_ucbhelper.mk
+++ b/ucbhelper/Library_ucbhelper.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_Library_use_package,ucbhelper,ucbhelper_inc))
$(eval $(call gb_Library_use_sdk_api,ucbhelper))
$(eval $(call gb_Library_use_libraries,ucbhelper,\
+ comphelper \
cppu \
cppuhelper \
sal \
diff --git a/ucbhelper/inc/ucbhelper/resultsetmetadata.hxx b/ucbhelper/inc/ucbhelper/resultsetmetadata.hxx
index 0b5b331dc2a6..129f1f8b90bf 100644
--- a/ucbhelper/inc/ucbhelper/resultsetmetadata.hxx
+++ b/ucbhelper/inc/ucbhelper/resultsetmetadata.hxx
@@ -145,7 +145,7 @@ private:
protected:
::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+ ::com::sun::star::uno::XComponentContext > m_xContext;
::com::sun::star::uno::Sequence<
::com::sun::star::beans::Property > m_aProps;
sal_Bool m_bReadOnly;
@@ -163,7 +163,7 @@ public:
*/
ResultSetMetaData(
const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Sequence<
::com::sun::star::beans::Property >& rProps,
sal_Bool bReadOnly = sal_True );
@@ -183,7 +183,7 @@ public:
*/
ResultSetMetaData(
const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Sequence<
::com::sun::star::beans::Property >& rProps,
const std::vector< ResultSetColumnData >& rColumnData );
diff --git a/ucbhelper/source/provider/resultset.cxx b/ucbhelper/source/provider/resultset.cxx
index 9af7a6d38b69..281434f08edc 100644
--- a/ucbhelper/source/provider/resultset.cxx
+++ b/ucbhelper/source/provider/resultset.cxx
@@ -23,6 +23,7 @@
**************************************************************************
*************************************************************************/
+#include <comphelper/processfactory.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <ucbhelper/resultset.hxx>
@@ -371,7 +372,7 @@ uno::Reference< sdbc::XResultSetMetaData > SAL_CALL ResultSet::getMetaData()
osl::MutexGuard aGuard( m_pImpl->m_aMutex );
if ( !m_pImpl->m_xMetaData.is() )
- m_pImpl->m_xMetaData = new ResultSetMetaData( m_pImpl->m_xSMgr,
+ m_pImpl->m_xMetaData = new ResultSetMetaData( comphelper::getComponentContext(m_pImpl->m_xSMgr),
m_pImpl->m_aProperties );
return m_pImpl->m_xMetaData;
diff --git a/ucbhelper/source/provider/resultsetmetadata.cxx b/ucbhelper/source/provider/resultsetmetadata.cxx
index 1d7c8dca9fd8..13e94ed2cc92 100644
--- a/ucbhelper/source/provider/resultsetmetadata.cxx
+++ b/ucbhelper/source/provider/resultsetmetadata.cxx
@@ -37,12 +37,14 @@
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/ucb/PropertiesManager.hpp>
#include <ucbhelper/resultsetmetadata.hxx>
using namespace com::sun::star::beans;
using namespace com::sun::star::io;
using namespace com::sun::star::lang;
using namespace com::sun::star::sdbc;
+using namespace com::sun::star::ucb;
using namespace com::sun::star::uno;
using namespace com::sun::star::util;
@@ -82,11 +84,11 @@ namespace ucbhelper {
//=========================================================================
ResultSetMetaData::ResultSetMetaData(
- const Reference< XMultiServiceFactory >& rxSMgr,
+ const Reference< XComponentContext >& rxContext,
const Sequence< Property >& rProps,
sal_Bool bReadOnly )
: m_pImpl( new ResultSetMetaData_Impl( rProps.getLength() ) ),
- m_xSMgr( rxSMgr ),
+ m_xContext( rxContext ),
m_aProps( rProps ),
m_bReadOnly( bReadOnly )
{
@@ -94,11 +96,11 @@ ResultSetMetaData::ResultSetMetaData(
//=========================================================================
ResultSetMetaData::ResultSetMetaData(
- const Reference< XMultiServiceFactory >& rxSMgr,
+ const Reference< XComponentContext >& rxContext,
const Sequence< Property >& rProps,
const std::vector< ResultSetColumnData >& rColumnData )
: m_pImpl( new ResultSetMetaData_Impl( rColumnData ) ),
- m_xSMgr( rxSMgr ),
+ m_xContext( rxContext ),
m_aProps( rProps ),
m_bReadOnly( sal_True )
{
@@ -400,35 +402,27 @@ sal_Int32 SAL_CALL ResultSetMetaData::getColumnType( sal_Int32 column )
{
try
{
- Reference< XPropertySetInfo > xInfo(
- m_xSMgr->createInstance(
- OUString(
- "com.sun.star.ucb.PropertiesManager" ) ),
- UNO_QUERY );
- if ( xInfo.is() )
- {
-
+ Reference< XPropertySetInfo > xInfo = PropertiesManager::create( m_xContext );
// Less (remote) calls...
- Sequence< Property > aProps = xInfo->getProperties();
- const Property* pProps1 = aProps.getConstArray();
- sal_Int32 nCount1 = aProps.getLength();
+ Sequence< Property > aProps = xInfo->getProperties();
+ const Property* pProps1 = aProps.getConstArray();
+ sal_Int32 nCount1 = aProps.getLength();
- sal_Int32 nCount = m_aProps.getLength();
- Property* pProps = m_aProps.getArray();
- for ( sal_Int32 n = 0; n < nCount; ++n )
- {
- Property& rProp = pProps[ n ];
+ sal_Int32 nCount = m_aProps.getLength();
+ Property* pProps = m_aProps.getArray();
+ for ( sal_Int32 n = 0; n < nCount; ++n )
+ {
+ Property& rProp = pProps[ n ];
- for ( sal_Int32 m = 0; m < nCount1; ++m )
+ for ( sal_Int32 m = 0; m < nCount1; ++m )
+ {
+ const Property& rProp1 = pProps1[ m ];
+ if ( rProp.Name == rProp1.Name )
{
- const Property& rProp1 = pProps1[ m ];
- if ( rProp.Name == rProp1.Name )
- {
- // Found...
- rProp.Type = rProp1.Type;
- break;
- }
+ // Found...
+ rProp.Type = rProp1.Type;
+ break;
}
}
}
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx
index 5319a58ca34b..eb124bfdc382 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx
@@ -26,6 +26,7 @@
*
************************************************************************/
+#include <comphelper/processfactory.hxx>
#include <ucbhelper/contentidentifier.hxx>
#include <com/sun/star/ucb/OpenMode.hpp>
#include <com/sun/star/uno/Reference.h>
@@ -648,7 +649,7 @@ ResultSetBase::getMetaData(
{
::ucbhelper::ResultSetMetaData* p =
new ::ucbhelper::ResultSetMetaData(
- m_xMSF, m_sProperty );
+ comphelper::getComponentContext(m_xMSF), m_sProperty );
return uno::Reference< sdbc::XResultSetMetaData >( p );
}