summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-11-02 17:46:30 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-11-15 08:28:44 +0100
commit5837402fb1daa437d9a1a37edc9ede57319944f1 (patch)
tree61e39515cd546fe7ad76364ebb444850b93541ce /scripting
parent3f15a663b273e4a437fd68335d6eab2b11fc80c9 (diff)
fdo#46808, use service constructor for ucb::SimpleFileAccess
I upgraded the service to return XSimpleFileAccess3, since it already implemented that interface, and it's backwards compatible. Change-Id: I40001a46048bd21a23b6a2f58a95376f06fc634b
Diffstat (limited to 'scripting')
-rw-r--r--scripting/source/dlgprov/DialogModelProvider.cxx3
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx3
-rw-r--r--scripting/source/inc/util/MiscUtils.hxx8
-rw-r--r--scripting/source/provider/URIHelper.cxx2
-rw-r--r--scripting/source/provider/URIHelper.hxx3
-rw-r--r--scripting/source/stringresource/stringresource.cxx16
-rw-r--r--scripting/source/stringresource/stringresource.hxx12
7 files changed, 20 insertions, 27 deletions
diff --git a/scripting/source/dlgprov/DialogModelProvider.cxx b/scripting/source/dlgprov/DialogModelProvider.cxx
index 9fb6bb27f905..176ed1452745 100644
--- a/scripting/source/dlgprov/DialogModelProvider.cxx
+++ b/scripting/source/dlgprov/DialogModelProvider.cxx
@@ -21,7 +21,6 @@
#include "dlgprov.hxx"
#include <com/sun/star/resource/XStringResourceManager.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
-#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
// component helper namespace
@@ -70,7 +69,7 @@ void SAL_CALL DialogModelProvider::initialize(const css::uno::Sequence< uno::Any
if ( !( aArguments[ 0 ] >>= sURL ))
throw css::lang::IllegalArgumentException();
// Try any other URL with SimpleFileAccess
- Reference< ucb::XSimpleFileAccess2 > xSFI = ucb::SimpleFileAccess::create(m_xContext);
+ Reference< ucb::XSimpleFileAccess3 > xSFI = ucb::SimpleFileAccess::create(m_xContext);
try
{
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index 4392c99cb37d..61e60d951ebe 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -35,7 +35,6 @@
#include <com/sun/star/resource/XStringResourceManager.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
-#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
#include <com/sun/star/resource/XStringResourceWithLocation.hpp>
#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <sfx2/app.hxx>
@@ -325,7 +324,7 @@ static ::rtl::OUString aResourceResolverPropName("ResourceResolver");
bSingleDialog = true;
// Try any other URL with SimpleFileAccess
- Reference< ucb::XSimpleFileAccess2 > xSFI = ucb::SimpleFileAccess::create(m_xContext);
+ Reference< ucb::XSimpleFileAccess3 > xSFI = ucb::SimpleFileAccess::create(m_xContext);
try
{
diff --git a/scripting/source/inc/util/MiscUtils.hxx b/scripting/source/inc/util/MiscUtils.hxx
index 8ad4f8f505de..41a57fe5d9ef 100644
--- a/scripting/source/inc/util/MiscUtils.hxx
+++ b/scripting/source/inc/util/MiscUtils.hxx
@@ -31,7 +31,6 @@
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
-#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
@@ -57,11 +56,8 @@ public:
{
return result;
}
- css::uno::Reference < css::ucb::XSimpleFileAccess2 > xSFA( css::ucb::SimpleFileAccess::create(xCtx) );
- if ( xSFA.is() )
- {
- result = xSFA->getFolderContents( OUSTR("vnd.sun.star.tdoc:/"), true );
- }
+ css::uno::Reference < css::ucb::XSimpleFileAccess3 > xSFA( css::ucb::SimpleFileAccess::create(xCtx) );
+ result = xSFA->getFolderContents( OUSTR("vnd.sun.star.tdoc:/"), true );
}
catch ( css::uno::Exception& )
{
diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx
index ec7ba77551ac..13677d1f24be 100644
--- a/scripting/source/provider/URIHelper.cxx
+++ b/scripting/source/provider/URIHelper.cxx
@@ -59,7 +59,7 @@ ScriptingFrameworkURIHelper::ScriptingFrameworkURIHelper(
{
try
{
- m_xSimpleFileAccess = uno::Reference< ucb::XSimpleFileAccess2 >( ucb::SimpleFileAccess::create(xContext) );
+ m_xSimpleFileAccess = ucb::SimpleFileAccess::create(xContext);
}
catch (uno::Exception&)
{
diff --git a/scripting/source/provider/URIHelper.hxx b/scripting/source/provider/URIHelper.hxx
index aae68be61efe..ddf65c04db0c 100644
--- a/scripting/source/provider/URIHelper.hxx
+++ b/scripting/source/provider/URIHelper.hxx
@@ -26,7 +26,6 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
-#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
#include <rtl/ustring.hxx>
@@ -45,7 +44,7 @@ class ScriptingFrameworkURIHelper :
{
private:
- css::uno::Reference< css::ucb::XSimpleFileAccess2 > m_xSimpleFileAccess;
+ css::uno::Reference< css::ucb::XSimpleFileAccess3 > m_xSimpleFileAccess;
css::uno::Reference<css::uri::XUriReferenceFactory> m_xUriReferenceFactory;
::rtl::OUString m_sLanguage;
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 338883dbf7e5..0086ea9d9a5e 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -1140,7 +1140,7 @@ void StringResourcePersistenceImpl::storeToURL( const ::rtl::OUString& URL,
bool bUsedForStore = false;
bool bStoreAll = true;
- Reference< ucb::XSimpleFileAccess2 > xFileAccess = ucb::SimpleFileAccess::create(m_xContext);
+ Reference< ucb::XSimpleFileAccess3 > xFileAccess = ucb::SimpleFileAccess::create(m_xContext);
if( xFileAccess.is() && Handler.is() )
xFileAccess->setInteractionHandler( Handler );
@@ -1151,7 +1151,7 @@ void StringResourcePersistenceImpl::implKillRemovedLocaleFiles
(
const ::rtl::OUString& Location,
const ::rtl::OUString& aNameBase,
- const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 >& xFileAccess
+ const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 >& xFileAccess
)
throw (Exception, RuntimeException)
{
@@ -1177,7 +1177,7 @@ void StringResourcePersistenceImpl::implKillChangedDefaultFiles
(
const ::rtl::OUString& Location,
const ::rtl::OUString& aNameBase,
- const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 >& xFileAccess
+ const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 >& xFileAccess
)
throw (Exception, RuntimeException)
{
@@ -1204,7 +1204,7 @@ void StringResourcePersistenceImpl::implStoreAtLocation
const ::rtl::OUString& Location,
const ::rtl::OUString& aNameBase,
const ::rtl::OUString& aComment,
- const Reference< ucb::XSimpleFileAccess2 >& xFileAccess,
+ const Reference< ucb::XSimpleFileAccess3 >& xFileAccess,
bool bUsedForStore,
bool bStoreAll,
bool bKillAll
@@ -2874,7 +2874,7 @@ void StringResourceWithLocationImpl::store()
if( !m_bModified && !bStoreAll )
return;
- Reference< ucb::XSimpleFileAccess2 > xFileAccess = getFileAccess();
+ Reference< ucb::XSimpleFileAccess3 > xFileAccess = getFileAccess();
implStoreAtLocation( m_aLocation, m_aNameBase, m_aComment,
xFileAccess, bUsedForStore, bStoreAll );
m_bModified = false;
@@ -2960,7 +2960,7 @@ void StringResourceWithLocationImpl::setURL( const ::rtl::OUString& URL )
// Scan locale properties files
void StringResourceWithLocationImpl::implScanLocales( void )
{
- const Reference< ucb::XSimpleFileAccess2 > xFileAccess = getFileAccess();
+ const Reference< ucb::XSimpleFileAccess3 > xFileAccess = getFileAccess();
if( xFileAccess.is() && xFileAccess->isFolder( m_aLocation ) )
{
Sequence< ::rtl::OUString > aContentSeq = xFileAccess->getFolderContents( m_aLocation, false );
@@ -2973,7 +2973,7 @@ bool StringResourceWithLocationImpl::implLoadLocale( LocaleItem* pLocaleItem )
{
bool bSuccess = false;
- const Reference< ucb::XSimpleFileAccess2 > xFileAccess = getFileAccess();
+ const Reference< ucb::XSimpleFileAccess3 > xFileAccess = getFileAccess();
if( xFileAccess.is() )
{
::rtl::OUString aCompleteFileName =
@@ -2996,7 +2996,7 @@ bool StringResourceWithLocationImpl::implLoadLocale( LocaleItem* pLocaleItem )
return bSuccess;
}
-const Reference< ucb::XSimpleFileAccess2 > StringResourceWithLocationImpl::getFileAccess( void )
+const Reference< ucb::XSimpleFileAccess3 > StringResourceWithLocationImpl::getFileAccess( void )
{
::osl::MutexGuard aGuard( getMutex() );
diff --git a/scripting/source/stringresource/stringresource.hxx b/scripting/source/stringresource/stringresource.hxx
index 6697eb8aa1ac..90f9a8dc8a9b 100644
--- a/scripting/source/stringresource/stringresource.hxx
+++ b/scripting/source/stringresource/stringresource.hxx
@@ -25,7 +25,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
+#include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <cppuhelper/implbase1.hxx>
@@ -305,7 +305,7 @@ protected:
(
const ::rtl::OUString& Location,
const ::rtl::OUString& aNameBase,
- const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 >& xFileAccess
+ const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 >& xFileAccess
)
throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
@@ -313,7 +313,7 @@ protected:
(
const ::rtl::OUString& Location,
const ::rtl::OUString& aNameBase,
- const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 >& xFileAccess
+ const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 >& xFileAccess
)
throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
@@ -322,7 +322,7 @@ protected:
const ::rtl::OUString& Location,
const ::rtl::OUString& aNameBase,
const ::rtl::OUString& aComment,
- const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 >& xFileAccess,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 >& xFileAccess,
bool bUsedForStore,
bool bStoreAll,
bool bKillAll = false
@@ -557,10 +557,10 @@ class StringResourceWithLocationImpl : public StringResourceWithLocationImpl_BAS
{
::rtl::OUString m_aLocation;
bool m_bLocationChanged;
- com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess2 > m_xSFI;
+ com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess3 > m_xSFI;
com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > m_xInteractionHandler;
- const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 > getFileAccess( void );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 > getFileAccess( void );
virtual void implScanLocales( void );
virtual bool implLoadLocale( LocaleItem* pLocaleItem );