Kaydet (Commit) d36331d6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Remove unhelpful "using namespace com::sun::star;" from ucb/source/ucp/gio/

...in preparation for another change using a top-level namespace ucb

Change-Id: I3a92d64806bc570bdfd4fe06e672cb6ce2049e7e
Reviewed-on: https://gerrit.libreoffice.org/71987
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst deaddddf
...@@ -77,15 +77,13 @@ ...@@ -77,15 +77,13 @@
#include "gio_outputstream.hxx" #include "gio_outputstream.hxx"
#include "gio_mount.hxx" #include "gio_mount.hxx"
using namespace com::sun::star;
namespace gio namespace gio
{ {
Content::Content( Content::Content(
const uno::Reference< uno::XComponentContext >& rxContext, const css::uno::Reference< css::uno::XComponentContext >& rxContext,
ContentProvider* pProvider, ContentProvider* pProvider,
const uno::Reference< ucb::XContentIdentifier >& Identifier) const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier)
: ContentImplHelper( rxContext, pProvider, Identifier ), : ContentImplHelper( rxContext, pProvider, Identifier ),
m_pProvider( pProvider ), mpFile (nullptr), mpInfo( nullptr ), mbTransient(false) m_pProvider( pProvider ), mpFile (nullptr), mpInfo( nullptr ), mbTransient(false)
{ {
...@@ -93,9 +91,9 @@ Content::Content( ...@@ -93,9 +91,9 @@ Content::Content(
} }
Content::Content( Content::Content(
const uno::Reference< uno::XComponentContext >& rxContext, const css::uno::Reference< css::uno::XComponentContext >& rxContext,
ContentProvider* pProvider, ContentProvider* pProvider,
const uno::Reference< ucb::XContentIdentifier >& Identifier, const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier,
bool bIsFolder) bool bIsFolder)
: ContentImplHelper( rxContext, pProvider, Identifier ), : ContentImplHelper( rxContext, pProvider, Identifier ),
m_pProvider( pProvider ), mpFile (nullptr), mpInfo( nullptr ), mbTransient(true) m_pProvider( pProvider ), mpFile (nullptr), mpInfo( nullptr ), mbTransient(true)
...@@ -133,7 +131,7 @@ void SAL_CALL Content::abort( sal_Int32 /*CommandId*/ ) ...@@ -133,7 +131,7 @@ void SAL_CALL Content::abort( sal_Int32 /*CommandId*/ )
OUString SAL_CALL Content::getContentType() OUString SAL_CALL Content::getContentType()
{ {
return isFolder(uno::Reference< ucb::XCommandEnvironment >()) return isFolder(css::uno::Reference< css::ucb::XCommandEnvironment >())
? OUString( GIO_FOLDER_TYPE ) ? OUString( GIO_FOLDER_TYPE )
: OUString( GIO_FILE_TYPE ); : OUString( GIO_FILE_TYPE );
} }
...@@ -144,9 +142,9 @@ do { \ ...@@ -144,9 +142,9 @@ do { \
aRet <<= aExcept;\ aRet <<= aExcept;\
} while(false) } while(false)
uno::Any convertToException(GError *pError, const uno::Reference< uno::XInterface >& rContext, bool bThrow) css::uno::Any convertToException(GError *pError, const css::uno::Reference< css::uno::XInterface >& rContext, bool bThrow)
{ {
uno::Any aRet; css::uno::Any aRet;
gint eCode = pError->code; gint eCode = pError->code;
OUString sMessage(pError->message, strlen(pError->message), RTL_TEXTENCODING_UTF8); OUString sMessage(pError->message, strlen(pError->message), RTL_TEXTENCODING_UTF8);
...@@ -154,113 +152,113 @@ uno::Any convertToException(GError *pError, const uno::Reference< uno::XInterfac ...@@ -154,113 +152,113 @@ uno::Any convertToException(GError *pError, const uno::Reference< uno::XInterfac
OUString sName; OUString sName;
uno::Sequence< uno::Any > aArgs( 1 ); css::uno::Sequence< css::uno::Any > aArgs( 1 );
aArgs[ 0 ] <<= sName; aArgs[ 0 ] <<= sName;
switch (eCode) switch (eCode)
{ {
case G_IO_ERROR_FAILED: case G_IO_ERROR_FAILED:
{ io::IOException aExcept(sMessage, rContext); { css::io::IOException aExcept(sMessage, rContext);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_NOT_MOUNTED: case G_IO_ERROR_NOT_MOUNTED:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_EXISTING_PATH, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_NOT_EXISTING_PATH, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_NOT_FOUND: case G_IO_ERROR_NOT_FOUND:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_EXISTING, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_NOT_EXISTING, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_EXISTS: case G_IO_ERROR_EXISTS:
{ ucb::NameClashException aExcept(sMessage, rContext, { css::ucb::NameClashException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, sName); css::task::InteractionClassification_ERROR, sName);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_INVALID_ARGUMENT: case G_IO_ERROR_INVALID_ARGUMENT:
{ lang::IllegalArgumentException aExcept(sMessage, rContext, -1 ); { css::lang::IllegalArgumentException aExcept(sMessage, rContext, -1 );
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_PERMISSION_DENIED: case G_IO_ERROR_PERMISSION_DENIED:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_ACCESS_DENIED, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_ACCESS_DENIED, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_IS_DIRECTORY: case G_IO_ERROR_IS_DIRECTORY:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_FILE, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_NO_FILE, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_NOT_REGULAR_FILE: case G_IO_ERROR_NOT_REGULAR_FILE:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_FILE, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_NO_FILE, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_NOT_DIRECTORY: case G_IO_ERROR_NOT_DIRECTORY:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_NO_DIRECTORY, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_NO_DIRECTORY, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_FILENAME_TOO_LONG: case G_IO_ERROR_FILENAME_TOO_LONG:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_NAME_TOO_LONG, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_NAME_TOO_LONG, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_PENDING: case G_IO_ERROR_PENDING:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_PENDING, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_PENDING, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_CLOSED: case G_IO_ERROR_CLOSED:
case G_IO_ERROR_CANCELLED: case G_IO_ERROR_CANCELLED:
case G_IO_ERROR_TOO_MANY_LINKS: case G_IO_ERROR_TOO_MANY_LINKS:
case G_IO_ERROR_WRONG_ETAG: case G_IO_ERROR_WRONG_ETAG:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_GENERAL, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_GENERAL, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_NOT_SUPPORTED: case G_IO_ERROR_NOT_SUPPORTED:
case G_IO_ERROR_CANT_CREATE_BACKUP: case G_IO_ERROR_CANT_CREATE_BACKUP:
case G_IO_ERROR_WOULD_MERGE: case G_IO_ERROR_WOULD_MERGE:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_SUPPORTED, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_NOT_SUPPORTED, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_NO_SPACE: case G_IO_ERROR_NO_SPACE:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_OUT_OF_DISK_SPACE, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_OUT_OF_DISK_SPACE, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_INVALID_FILENAME: case G_IO_ERROR_INVALID_FILENAME:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_INVALID_CHARACTER, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_INVALID_CHARACTER, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_READ_ONLY: case G_IO_ERROR_READ_ONLY:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_WRITE_PROTECTED, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_WRITE_PROTECTED, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_TIMED_OUT: case G_IO_ERROR_TIMED_OUT:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_DEVICE_NOT_READY, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_DEVICE_NOT_READY, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_WOULD_RECURSE: case G_IO_ERROR_WOULD_RECURSE:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_RECURSIVE, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_RECURSIVE, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_BUSY: case G_IO_ERROR_BUSY:
case G_IO_ERROR_WOULD_BLOCK: case G_IO_ERROR_WOULD_BLOCK:
{ ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext, { css::ucb::InteractiveAugmentedIOException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, ucb::IOErrorCode_LOCKING_VIOLATION, aArgs); css::task::InteractionClassification_ERROR, css::ucb::IOErrorCode_LOCKING_VIOLATION, aArgs);
EXCEPT(aExcept); } EXCEPT(aExcept); }
break; break;
case G_IO_ERROR_HOST_NOT_FOUND: case G_IO_ERROR_HOST_NOT_FOUND:
{ ucb::InteractiveNetworkResolveNameException aExcept(sMessage, rContext, { css::ucb::InteractiveNetworkResolveNameException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR, OUString()); css::task::InteractionClassification_ERROR, OUString());
EXCEPT(aExcept);} EXCEPT(aExcept);}
break; break;
default: default:
...@@ -269,29 +267,29 @@ uno::Any convertToException(GError *pError, const uno::Reference< uno::XInterfac ...@@ -269,29 +267,29 @@ uno::Any convertToException(GError *pError, const uno::Reference< uno::XInterfac
case G_IO_ERROR_NOT_SYMBOLIC_LINK: case G_IO_ERROR_NOT_SYMBOLIC_LINK:
case G_IO_ERROR_NOT_MOUNTABLE_FILE: case G_IO_ERROR_NOT_MOUNTABLE_FILE:
case G_IO_ERROR_FAILED_HANDLED: case G_IO_ERROR_FAILED_HANDLED:
{ ucb::InteractiveNetworkGeneralException aExcept(sMessage, rContext, { css::ucb::InteractiveNetworkGeneralException aExcept(sMessage, rContext,
task::InteractionClassification_ERROR); css::task::InteractionClassification_ERROR);
EXCEPT(aExcept);} EXCEPT(aExcept);}
break; break;
} }
return aRet; return aRet;
} }
void convertToIOException(GError *pError, const uno::Reference< uno::XInterface >& rContext) void convertToIOException(GError *pError, const css::uno::Reference< css::uno::XInterface >& rContext)
{ {
try try
{ {
convertToException(pError, rContext); convertToException(pError, rContext);
} }
catch (const io::IOException&) catch (const css::io::IOException&)
{ {
throw; throw;
} }
catch (const uno::RuntimeException&) catch (const css::uno::RuntimeException&)
{ {
throw; throw;
} }
catch (const uno::Exception& e) catch (const css::uno::Exception& e)
{ {
css::uno::Any a(cppu::getCaughtException()); css::uno::Any a(cppu::getCaughtException());
throw css::lang::WrappedTargetRuntimeException( throw css::lang::WrappedTargetRuntimeException(
...@@ -300,7 +298,7 @@ void convertToIOException(GError *pError, const uno::Reference< uno::XInterface ...@@ -300,7 +298,7 @@ void convertToIOException(GError *pError, const uno::Reference< uno::XInterface
} }
} }
uno::Any Content::mapGIOError( GError *pError ) css::uno::Any Content::mapGIOError( GError *pError )
{ {
if (!pError) if (!pError)
return getBadArgExcept(); return getBadArgExcept();
...@@ -308,9 +306,9 @@ uno::Any Content::mapGIOError( GError *pError ) ...@@ -308,9 +306,9 @@ uno::Any Content::mapGIOError( GError *pError )
return convertToException(pError, static_cast< cppu::OWeakObject * >(this), false); return convertToException(pError, static_cast< cppu::OWeakObject * >(this), false);
} }
uno::Any Content::getBadArgExcept() css::uno::Any Content::getBadArgExcept()
{ {
return uno::makeAny( lang::IllegalArgumentException( return css::uno::makeAny( css::lang::IllegalArgumentException(
"Wrong argument type!", "Wrong argument type!",
static_cast< cppu::OWeakObject * >( this ), -1) ); static_cast< cppu::OWeakObject * >( this ), -1) );
} }
...@@ -322,12 +320,12 @@ class MountOperation ...@@ -322,12 +320,12 @@ class MountOperation
GError *mpError; GError *mpError;
static void Completed(GObject *source, GAsyncResult *res, gpointer user_data); static void Completed(GObject *source, GAsyncResult *res, gpointer user_data);
public: public:
explicit MountOperation(const uno::Reference< ucb::XCommandEnvironment >& xEnv); explicit MountOperation(const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv);
~MountOperation(); ~MountOperation();
GError *Mount(GFile *pFile); GError *Mount(GFile *pFile);
}; };
MountOperation::MountOperation(const uno::Reference< ucb::XCommandEnvironment >& xEnv) : mpError(nullptr) MountOperation::MountOperation(const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv) : mpError(nullptr)
{ {
mpLoop = g_main_loop_new(nullptr, FALSE); mpLoop = g_main_loop_new(nullptr, FALSE);
mpAuthentication = ooo_mount_operation_new(xEnv); mpAuthentication = ooo_mount_operation_new(xEnv);
...@@ -368,7 +366,7 @@ MountOperation::~MountOperation() ...@@ -368,7 +366,7 @@ MountOperation::~MountOperation()
g_main_loop_unref(mpLoop); g_main_loop_unref(mpLoop);
} }
GFileInfo* Content::getGFileInfo(const uno::Reference< ucb::XCommandEnvironment >& xEnv, GError **ppError) GFileInfo* Content::getGFileInfo(const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv, GError **ppError)
{ {
GError * err = nullptr; GError * err = nullptr;
if (mpInfo == nullptr && !mbTransient) { if (mpInfo == nullptr && !mbTransient) {
...@@ -412,13 +410,13 @@ GFile* Content::getGFile() ...@@ -412,13 +410,13 @@ GFile* Content::getGFile()
return mpFile; return mpFile;
} }
bool Content::isFolder(const uno::Reference< ucb::XCommandEnvironment >& xEnv) bool Content::isFolder(const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv)
{ {
GFileInfo *pInfo = getGFileInfo(xEnv); GFileInfo *pInfo = getGFileInfo(xEnv);
return pInfo && (g_file_info_get_file_type(pInfo) == G_FILE_TYPE_DIRECTORY); return pInfo && (g_file_info_get_file_type(pInfo) == G_FILE_TYPE_DIRECTORY);
} }
static util::DateTime getDateFromUnix (time_t t) static css::util::DateTime getDateFromUnix (time_t t)
{ {
TimeValue tv; TimeValue tv;
tv.Nanosec = 0; tv.Nanosec = 0;
...@@ -426,20 +424,20 @@ static util::DateTime getDateFromUnix (time_t t) ...@@ -426,20 +424,20 @@ static util::DateTime getDateFromUnix (time_t t)
oslDateTime dt; oslDateTime dt;
if ( osl_getDateTimeFromTimeValue( &tv, &dt ) ) if ( osl_getDateTimeFromTimeValue( &tv, &dt ) )
return util::DateTime( 0, dt.Seconds, dt.Minutes, dt.Hours, return css::util::DateTime( 0, dt.Seconds, dt.Minutes, dt.Hours,
dt.Day, dt.Month, dt.Year, false); dt.Day, dt.Month, dt.Year, false);
else else
return util::DateTime(); return css::util::DateTime();
} }
uno::Reference< sdbc::XRow > Content::getPropertyValues( css::uno::Reference< css::sdbc::XRow > Content::getPropertyValues(
const uno::Sequence< beans::Property >& rProperties, const css::uno::Sequence< css::beans::Property >& rProperties,
const uno::Reference< ucb::XCommandEnvironment >& xEnv ) const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv )
{ {
rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( m_xContext ); rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( m_xContext );
sal_Int32 nProps; sal_Int32 nProps;
const beans::Property* pProps; const css::beans::Property* pProps;
nProps = rProperties.getLength(); nProps = rProperties.getLength();
pProps = rProperties.getConstArray(); pProps = rProperties.getConstArray();
...@@ -447,7 +445,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( ...@@ -447,7 +445,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
GFileInfo *pInfo = nullptr; GFileInfo *pInfo = nullptr;
for( sal_Int32 n = 0; n < nProps; ++n ) for( sal_Int32 n = 0; n < nProps; ++n )
{ {
const beans::Property& rProp = pProps[ n ]; const css::beans::Property& rProp = pProps[ n ];
if ( rProp.Name == "IsDocument" ) if ( rProp.Name == "IsDocument" )
{ {
...@@ -544,7 +542,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( ...@@ -544,7 +542,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
} }
else if ( rProp.Name == "CreatableContentsInfo" ) else if ( rProp.Name == "CreatableContentsInfo" )
{ {
xRow->appendObject( rProp, uno::makeAny( queryCreatableContentsInfo( xEnv ) ) ); xRow->appendObject( rProp, css::uno::makeAny( queryCreatableContentsInfo( xEnv ) ) );
} }
else else
{ {
...@@ -554,13 +552,13 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( ...@@ -554,13 +552,13 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
} }
} }
return uno::Reference< sdbc::XRow >( xRow.get() ); return css::uno::Reference< css::sdbc::XRow >( xRow.get() );
} }
static lang::IllegalAccessException static css::lang::IllegalAccessException
getReadOnlyException( const uno::Reference< uno::XInterface >& rContext ) getReadOnlyException( const css::uno::Reference< css::uno::XInterface >& rContext )
{ {
return lang::IllegalAccessException ("Property is read-only!", rContext ); return css::lang::IllegalAccessException ("Property is read-only!", rContext );
} }
void Content::queryChildren( ContentRefList& rChildren ) void Content::queryChildren( ContentRefList& rChildren )
...@@ -599,12 +597,12 @@ void Content::queryChildren( ContentRefList& rChildren ) ...@@ -599,12 +597,12 @@ void Content::queryChildren( ContentRefList& rChildren )
} }
} }
bool Content::exchangeIdentity( const uno::Reference< ucb::XContentIdentifier >& xNewId ) bool Content::exchangeIdentity( const css::uno::Reference< css::ucb::XContentIdentifier >& xNewId )
{ {
if ( !xNewId.is() ) if ( !xNewId.is() )
return false; return false;
uno::Reference< ucb::XContent > xThis = this; css::uno::Reference< css::ucb::XContent > xThis = this;
if ( mbTransient ) if ( mbTransient )
{ {
...@@ -626,12 +624,12 @@ bool Content::exchangeIdentity( const uno::Reference< ucb::XContentIdentifier >& ...@@ -626,12 +624,12 @@ bool Content::exchangeIdentity( const uno::Reference< ucb::XContentIdentifier >&
ContentRef xChild = rChild; ContentRef xChild = rChild;
// Create new content identifier for the child... // Create new content identifier for the child...
uno::Reference< ucb::XContentIdentifier > xOldChildId = xChild->getIdentifier(); css::uno::Reference< css::ucb::XContentIdentifier > xOldChildId = xChild->getIdentifier();
OUString aOldChildURL = xOldChildId->getContentIdentifier(); OUString aOldChildURL = xOldChildId->getContentIdentifier();
OUString aNewChildURL = aOldChildURL.replaceAt( OUString aNewChildURL = aOldChildURL.replaceAt(
0, aOldURL.getLength(), xNewId->getContentIdentifier() ); 0, aOldURL.getLength(), xNewId->getContentIdentifier() );
uno::Reference< ucb::XContentIdentifier > xNewChildId css::uno::Reference< css::ucb::XContentIdentifier > xNewChildId
= new ::ucbhelper::ContentIdentifier( aNewChildURL ); = new ::ucbhelper::ContentIdentifier( aNewChildURL );
if ( !xChild->exchangeIdentity( xNewChildId ) ) if ( !xChild->exchangeIdentity( xNewChildId ) )
...@@ -662,9 +660,9 @@ void Content::getFileInfo( ...@@ -662,9 +660,9 @@ void Content::getFileInfo(
} }
} }
uno::Sequence< uno::Any > Content::setPropertyValues( css::uno::Sequence< css::uno::Any > Content::setPropertyValues(
const uno::Sequence< beans::PropertyValue >& rValues, const css::uno::Sequence< css::beans::PropertyValue >& rValues,
const uno::Reference< ucb::XCommandEnvironment >& xEnv ) const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv )
{ {
GError *pError=nullptr; GError *pError=nullptr;
GFileInfo *pNewInfo=nullptr; GFileInfo *pNewInfo=nullptr;
...@@ -685,20 +683,20 @@ uno::Sequence< uno::Any > Content::setPropertyValues( ...@@ -685,20 +683,20 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
sal_Int32 nCount = rValues.getLength(); sal_Int32 nCount = rValues.getLength();
beans::PropertyChangeEvent aEvent; css::beans::PropertyChangeEvent aEvent;
aEvent.Source = static_cast< cppu::OWeakObject * >( this ); aEvent.Source = static_cast< cppu::OWeakObject * >( this );
aEvent.Further = false; aEvent.Further = false;
aEvent.PropertyHandle = -1; aEvent.PropertyHandle = -1;
sal_Int32 nChanged = 0, nTitlePos = -1; sal_Int32 nChanged = 0, nTitlePos = -1;
const char *newName = nullptr; const char *newName = nullptr;
uno::Sequence< beans::PropertyChangeEvent > aChanges(nCount); css::uno::Sequence< css::beans::PropertyChangeEvent > aChanges(nCount);
uno::Sequence< uno::Any > aRet( nCount ); css::uno::Sequence< css::uno::Any > aRet( nCount );
const beans::PropertyValue* pValues = rValues.getConstArray(); const css::beans::PropertyValue* pValues = rValues.getConstArray();
for ( sal_Int32 n = 0; n < nCount; ++n ) for ( sal_Int32 n = 0; n < nCount; ++n )
{ {
const beans::PropertyValue& rValue = pValues[ n ]; const css::beans::PropertyValue& rValue = pValues[ n ];
SAL_INFO("ucb.ucp.gio", "Set prop '" << rValue.Name << "'"); SAL_INFO("ucb.ucp.gio", "Set prop '" << rValue.Name << "'");
if ( rValue.Name == "ContentType" || if ( rValue.Name == "ContentType" ||
rValue.Name == "MediaType" || rValue.Name == "MediaType" ||
...@@ -714,7 +712,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( ...@@ -714,7 +712,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
OUString aNewTitle; OUString aNewTitle;
if (!( rValue.Value >>= aNewTitle )) if (!( rValue.Value >>= aNewTitle ))
{ {
aRet[ n ] <<= beans::IllegalTypeException aRet[ n ] <<= css::beans::IllegalTypeException
( "Property value has wrong type!", ( "Property value has wrong type!",
static_cast< cppu::OWeakObject * >( this ) ); static_cast< cppu::OWeakObject * >( this ) );
continue; continue;
...@@ -722,7 +720,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( ...@@ -722,7 +720,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
if ( aNewTitle.getLength() <= 0 ) if ( aNewTitle.getLength() <= 0 )
{ {
aRet[ n ] <<= lang::IllegalArgumentException aRet[ n ] <<= css::lang::IllegalArgumentException
( "Empty title not allowed!", ( "Empty title not allowed!",
static_cast< cppu::OWeakObject * >( this ), -1 ); static_cast< cppu::OWeakObject * >( this ), -1 );
continue; continue;
...@@ -773,12 +771,12 @@ uno::Sequence< uno::Any > Content::setPropertyValues( ...@@ -773,12 +771,12 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
{ {
OUString aNewURL = getParentURL(); OUString aNewURL = getParentURL();
aNewURL += OUString( newName, strlen(newName), RTL_TEXTENCODING_UTF8 ); aNewURL += OUString( newName, strlen(newName), RTL_TEXTENCODING_UTF8 );
uno::Reference< ucb::XContentIdentifier > xNewId css::uno::Reference< css::ucb::XContentIdentifier > xNewId
= new ::ucbhelper::ContentIdentifier( aNewURL ); = new ::ucbhelper::ContentIdentifier( aNewURL );
if (!exchangeIdentity( xNewId ) ) if (!exchangeIdentity( xNewId ) )
{ {
aRet[ nTitlePos ] <<= uno::Exception aRet[ nTitlePos ] <<= css::uno::Exception
( "Exchange failed!", ( "Exchange failed!",
static_cast< cppu::OWeakObject * >( this ) ); static_cast< cppu::OWeakObject * >( this ) );
} }
...@@ -825,10 +823,10 @@ bool Content::doSetFileInfo(GFileInfo *pNewInfo) ...@@ -825,10 +823,10 @@ bool Content::doSetFileInfo(GFileInfo *pNewInfo)
const int TRANSFER_BUFFER_SIZE = 65536; const int TRANSFER_BUFFER_SIZE = 65536;
void Content::copyData( const uno::Reference< io::XInputStream >& xIn, void Content::copyData( const css::uno::Reference< css::io::XInputStream >& xIn,
const uno::Reference< io::XOutputStream >& xOut ) const css::uno::Reference< css::io::XOutputStream >& xOut )
{ {
uno::Sequence< sal_Int8 > theData( TRANSFER_BUFFER_SIZE ); css::uno::Sequence< sal_Int8 > theData( TRANSFER_BUFFER_SIZE );
g_return_if_fail( xIn.is() && xOut.is() ); g_return_if_fail( xIn.is() && xOut.is() );
...@@ -838,13 +836,13 @@ void Content::copyData( const uno::Reference< io::XInputStream >& xIn, ...@@ -838,13 +836,13 @@ void Content::copyData( const uno::Reference< io::XInputStream >& xIn,
xOut->closeOutput(); xOut->closeOutput();
} }
bool Content::feedSink( const uno::Reference< uno::XInterface >& xSink ) bool Content::feedSink( const css::uno::Reference< css::uno::XInterface >& xSink )
{ {
if ( !xSink.is() ) if ( !xSink.is() )
return false; return false;
uno::Reference< io::XOutputStream > xOut(xSink, uno::UNO_QUERY ); css::uno::Reference< css::io::XOutputStream > xOut(xSink, css::uno::UNO_QUERY );
uno::Reference< io::XActiveDataSink > xDataSink(xSink, uno::UNO_QUERY ); css::uno::Reference< css::io::XActiveDataSink > xDataSink(xSink, css::uno::UNO_QUERY );
if ( !xOut.is() && !xDataSink.is() ) if ( !xOut.is() && !xDataSink.is() )
return false; return false;
...@@ -854,7 +852,7 @@ bool Content::feedSink( const uno::Reference< uno::XInterface >& xSink ) ...@@ -854,7 +852,7 @@ bool Content::feedSink( const uno::Reference< uno::XInterface >& xSink )
if (!pStream) if (!pStream)
convertToException(pError, static_cast< cppu::OWeakObject * >(this)); convertToException(pError, static_cast< cppu::OWeakObject * >(this));
uno::Reference< io::XInputStream > xIn( css::uno::Reference< css::io::XInputStream > xIn(
new comphelper::OSeekableInputWrapper( new comphelper::OSeekableInputWrapper(
new ::gio::InputStream(pStream), m_xContext)); new ::gio::InputStream(pStream), m_xContext));
...@@ -867,47 +865,47 @@ bool Content::feedSink( const uno::Reference< uno::XInterface >& xSink ) ...@@ -867,47 +865,47 @@ bool Content::feedSink( const uno::Reference< uno::XInterface >& xSink )
return true; return true;
} }
uno::Any Content::open(const ucb::OpenCommandArgument2 & rOpenCommand, css::uno::Any Content::open(const css::ucb::OpenCommandArgument2 & rOpenCommand,
const uno::Reference< ucb::XCommandEnvironment > & xEnv ) const css::uno::Reference< css::ucb::XCommandEnvironment > & xEnv )
{ {
bool bIsFolder = isFolder(xEnv); bool bIsFolder = isFolder(xEnv);
if (!g_file_query_exists(getGFile(), nullptr)) if (!g_file_query_exists(getGFile(), nullptr))
{ {
uno::Sequence< uno::Any > aArgs( 1 ); css::uno::Sequence< css::uno::Any > aArgs( 1 );
aArgs[ 0 ] <<= m_xIdentifier->getContentIdentifier(); aArgs[ 0 ] <<= m_xIdentifier->getContentIdentifier();
uno::Any aErr = uno::makeAny( css::uno::Any aErr = css::uno::makeAny(
ucb::InteractiveAugmentedIOException(OUString(), static_cast< cppu::OWeakObject * >( this ), css::ucb::InteractiveAugmentedIOException(OUString(), static_cast< cppu::OWeakObject * >( this ),
task::InteractionClassification_ERROR, css::task::InteractionClassification_ERROR,
bIsFolder ? ucb::IOErrorCode_NOT_EXISTING_PATH : ucb::IOErrorCode_NOT_EXISTING, aArgs) bIsFolder ? css::ucb::IOErrorCode_NOT_EXISTING_PATH : css::ucb::IOErrorCode_NOT_EXISTING, aArgs)
); );
ucbhelper::cancelCommandExecution(aErr, xEnv); ucbhelper::cancelCommandExecution(aErr, xEnv);
} }
uno::Any aRet; css::uno::Any aRet;
bool bOpenFolder = ( bool bOpenFolder = (
( rOpenCommand.Mode == ucb::OpenMode::ALL ) || ( rOpenCommand.Mode == css::ucb::OpenMode::ALL ) ||
( rOpenCommand.Mode == ucb::OpenMode::FOLDERS ) || ( rOpenCommand.Mode == css::ucb::OpenMode::FOLDERS ) ||
( rOpenCommand.Mode == ucb::OpenMode::DOCUMENTS ) ( rOpenCommand.Mode == css::ucb::OpenMode::DOCUMENTS )
); );
if ( bOpenFolder && bIsFolder ) if ( bOpenFolder && bIsFolder )
{ {
uno::Reference< ucb::XDynamicResultSet > xSet css::uno::Reference< css::ucb::XDynamicResultSet > xSet
= new DynamicResultSet( m_xContext, this, rOpenCommand, xEnv ); = new DynamicResultSet( m_xContext, this, rOpenCommand, xEnv );
aRet <<= xSet; aRet <<= xSet;
} }
else if ( rOpenCommand.Sink.is() ) else if ( rOpenCommand.Sink.is() )
{ {
if ( if (
( rOpenCommand.Mode == ucb::OpenMode::DOCUMENT_SHARE_DENY_NONE ) || ( rOpenCommand.Mode == css::ucb::OpenMode::DOCUMENT_SHARE_DENY_NONE ) ||
( rOpenCommand.Mode == ucb::OpenMode::DOCUMENT_SHARE_DENY_WRITE ) ( rOpenCommand.Mode == css::ucb::OpenMode::DOCUMENT_SHARE_DENY_WRITE )
) )
{ {
ucbhelper::cancelCommandExecution( ucbhelper::cancelCommandExecution(
uno::makeAny ( ucb::UnsupportedOpenModeException css::uno::makeAny ( css::ucb::UnsupportedOpenModeException
( OUString(), static_cast< cppu::OWeakObject * >( this ), ( OUString(), static_cast< cppu::OWeakObject * >( this ),
sal_Int16( rOpenCommand.Mode ) ) ), sal_Int16( rOpenCommand.Mode ) ) ),
xEnv ); xEnv );
...@@ -921,7 +919,7 @@ uno::Any Content::open(const ucb::OpenCommandArgument2 & rOpenCommand, ...@@ -921,7 +919,7 @@ uno::Any Content::open(const ucb::OpenCommandArgument2 & rOpenCommand,
SAL_WARN("ucb.ucp.gio", "Failed to load data from '" << m_xIdentifier->getContentIdentifier() << "'"); SAL_WARN("ucb.ucp.gio", "Failed to load data from '" << m_xIdentifier->getContentIdentifier() << "'");
ucbhelper::cancelCommandExecution( ucbhelper::cancelCommandExecution(
uno::makeAny (ucb::UnsupportedDataSinkException css::uno::makeAny (css::ucb::UnsupportedDataSinkException
( OUString(), static_cast< cppu::OWeakObject * >( this ), ( OUString(), static_cast< cppu::OWeakObject * >( this ),
rOpenCommand.Sink ) ), rOpenCommand.Sink ) ),
xEnv ); xEnv );
...@@ -932,17 +930,17 @@ uno::Any Content::open(const ucb::OpenCommandArgument2 & rOpenCommand, ...@@ -932,17 +930,17 @@ uno::Any Content::open(const ucb::OpenCommandArgument2 & rOpenCommand,
return aRet; return aRet;
} }
uno::Any SAL_CALL Content::execute( css::uno::Any SAL_CALL Content::execute(
const ucb::Command& aCommand, const css::ucb::Command& aCommand,
sal_Int32 /*CommandId*/, sal_Int32 /*CommandId*/,
const uno::Reference< ucb::XCommandEnvironment >& xEnv ) const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv )
{ {
SAL_INFO("ucb.ucp.gio", "Content::execute " << aCommand.Name); SAL_INFO("ucb.ucp.gio", "Content::execute " << aCommand.Name);
uno::Any aRet; css::uno::Any aRet;
if ( aCommand.Name == "getPropertyValues" ) if ( aCommand.Name == "getPropertyValues" )
{ {
uno::Sequence< beans::Property > Properties; css::uno::Sequence< css::beans::Property > Properties;
if ( !( aCommand.Argument >>= Properties ) ) if ( !( aCommand.Argument >>= Properties ) )
ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
aRet <<= getPropertyValues( Properties, xEnv ); aRet <<= getPropertyValues( Properties, xEnv );
...@@ -953,21 +951,21 @@ uno::Any SAL_CALL Content::execute( ...@@ -953,21 +951,21 @@ uno::Any SAL_CALL Content::execute(
aRet <<= getCommandInfo( xEnv, false ); aRet <<= getCommandInfo( xEnv, false );
else if ( aCommand.Name == "open" ) else if ( aCommand.Name == "open" )
{ {
ucb::OpenCommandArgument2 aOpenCommand; css::ucb::OpenCommandArgument2 aOpenCommand;
if ( !( aCommand.Argument >>= aOpenCommand ) ) if ( !( aCommand.Argument >>= aOpenCommand ) )
ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
aRet = open( aOpenCommand, xEnv ); aRet = open( aOpenCommand, xEnv );
} }
else if ( aCommand.Name == "transfer" ) else if ( aCommand.Name == "transfer" )
{ {
ucb::TransferInfo transferArgs; css::ucb::TransferInfo transferArgs;
if ( !( aCommand.Argument >>= transferArgs ) ) if ( !( aCommand.Argument >>= transferArgs ) )
ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
transfer( transferArgs, xEnv ); transfer( transferArgs, xEnv );
} }
else if ( aCommand.Name == "setPropertyValues" ) else if ( aCommand.Name == "setPropertyValues" )
{ {
uno::Sequence< beans::PropertyValue > aProperties; css::uno::Sequence< css::beans::PropertyValue > aProperties;
if ( !( aCommand.Argument >>= aProperties ) || !aProperties.hasElements() ) if ( !( aCommand.Argument >>= aProperties ) || !aProperties.hasElements() )
ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
aRet <<= setPropertyValues( aProperties, xEnv ); aRet <<= setPropertyValues( aProperties, xEnv );
...@@ -975,14 +973,14 @@ uno::Any SAL_CALL Content::execute( ...@@ -975,14 +973,14 @@ uno::Any SAL_CALL Content::execute(
else if (aCommand.Name == "createNewContent" else if (aCommand.Name == "createNewContent"
&& isFolder( xEnv ) ) && isFolder( xEnv ) )
{ {
ucb::ContentInfo arg; css::ucb::ContentInfo arg;
if ( !( aCommand.Argument >>= arg ) ) if ( !( aCommand.Argument >>= arg ) )
ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
aRet <<= createNewContent( arg ); aRet <<= createNewContent( arg );
} }
else if ( aCommand.Name == "insert" ) else if ( aCommand.Name == "insert" )
{ {
ucb::InsertCommandArgument arg; css::ucb::InsertCommandArgument arg;
if ( !( aCommand.Argument >>= arg ) ) if ( !( aCommand.Argument >>= arg ) )
ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
insert( arg.Data, arg.ReplaceExisting, xEnv ); insert( arg.Data, arg.ReplaceExisting, xEnv );
...@@ -1011,7 +1009,7 @@ uno::Any SAL_CALL Content::execute( ...@@ -1011,7 +1009,7 @@ uno::Any SAL_CALL Content::execute(
SAL_WARN("ucb.ucp.gio", "Unknown command " << aCommand.Name); SAL_WARN("ucb.ucp.gio", "Unknown command " << aCommand.Name);
ucbhelper::cancelCommandExecution ucbhelper::cancelCommandExecution
( uno::makeAny( ucb::UnsupportedCommandException ( css::uno::makeAny( css::ucb::UnsupportedCommandException
( OUString(), ( OUString(),
static_cast< cppu::OWeakObject * >( this ) ) ), static_cast< cppu::OWeakObject * >( this ) ) ),
xEnv ); xEnv );
...@@ -1022,7 +1020,7 @@ uno::Any SAL_CALL Content::execute( ...@@ -1022,7 +1020,7 @@ uno::Any SAL_CALL Content::execute(
void Content::destroy( bool bDeletePhysical ) void Content::destroy( bool bDeletePhysical )
{ {
uno::Reference< ucb::XContent > xThis = this; css::uno::Reference< css::ucb::XContent > xThis = this;
deleted(); deleted();
...@@ -1035,8 +1033,8 @@ void Content::destroy( bool bDeletePhysical ) ...@@ -1035,8 +1033,8 @@ void Content::destroy( bool bDeletePhysical )
} }
} }
void Content::insert(const uno::Reference< io::XInputStream > &xInputStream, void Content::insert(const css::uno::Reference< css::io::XInputStream > &xInputStream,
bool bReplaceExisting, const uno::Reference< ucb::XCommandEnvironment > &xEnv ) bool bReplaceExisting, const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv )
{ {
GError *pError = nullptr; GError *pError = nullptr;
GFileInfo *pInfo = getGFileInfo(xEnv); GFileInfo *pInfo = getGFileInfo(xEnv);
...@@ -1053,8 +1051,8 @@ void Content::insert(const uno::Reference< io::XInputStream > &xInputStream, ...@@ -1053,8 +1051,8 @@ void Content::insert(const uno::Reference< io::XInputStream > &xInputStream,
if ( !xInputStream.is() ) if ( !xInputStream.is() )
{ {
ucbhelper::cancelCommandExecution( uno::makeAny ucbhelper::cancelCommandExecution( css::uno::makeAny
( ucb::MissingInputStreamException ( css::ucb::MissingInputStreamException
( OUString(), static_cast< cppu::OWeakObject * >( this ) ) ), ( OUString(), static_cast< cppu::OWeakObject * >( this ) ) ),
xEnv ); xEnv );
} }
...@@ -1071,7 +1069,7 @@ void Content::insert(const uno::Reference< io::XInputStream > &xInputStream, ...@@ -1071,7 +1069,7 @@ void Content::insert(const uno::Reference< io::XInputStream > &xInputStream,
ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv); ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv);
} }
uno::Reference < io::XOutputStream > xOutput = new ::gio::OutputStream(pOutStream); css::uno::Reference < css::io::XOutputStream > xOutput = new ::gio::OutputStream(pOutStream);
copyData( xInputStream, xOutput ); copyData( xInputStream, xOutput );
if (mbTransient) if (mbTransient)
...@@ -1084,7 +1082,7 @@ void Content::insert(const uno::Reference< io::XInputStream > &xInputStream, ...@@ -1084,7 +1082,7 @@ void Content::insert(const uno::Reference< io::XInputStream > &xInputStream,
const GFileCopyFlags DEFAULT_COPYDATA_FLAGS = const GFileCopyFlags DEFAULT_COPYDATA_FLAGS =
static_cast<GFileCopyFlags>(G_FILE_COPY_OVERWRITE|G_FILE_COPY_TARGET_DEFAULT_PERMS); static_cast<GFileCopyFlags>(G_FILE_COPY_OVERWRITE|G_FILE_COPY_TARGET_DEFAULT_PERMS);
void Content::transfer( const ucb::TransferInfo& aTransferInfo, const uno::Reference< ucb::XCommandEnvironment >& xEnv ) void Content::transfer( const css::ucb::TransferInfo& aTransferInfo, const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv )
{ {
OUString sDest = m_xIdentifier->getContentIdentifier(); OUString sDest = m_xIdentifier->getContentIdentifier();
if (!sDest.endsWith("/")) { if (!sDest.endsWith("/")) {
...@@ -1110,47 +1108,47 @@ void Content::transfer( const ucb::TransferInfo& aTransferInfo, const uno::Refer ...@@ -1110,47 +1108,47 @@ void Content::transfer( const ucb::TransferInfo& aTransferInfo, const uno::Refer
ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv); ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv);
} }
uno::Sequence< ucb::ContentInfo > Content::queryCreatableContentsInfo( css::uno::Sequence< css::ucb::ContentInfo > Content::queryCreatableContentsInfo(
const uno::Reference< ucb::XCommandEnvironment >& xEnv) const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv)
{ {
if ( isFolder( xEnv ) ) if ( isFolder( xEnv ) )
{ {
uno::Sequence< ucb::ContentInfo > seq(2); css::uno::Sequence< css::ucb::ContentInfo > seq(2);
// Minimum set of props we really need // Minimum set of props we really need
uno::Sequence< beans::Property > props( 1 ); css::uno::Sequence< css::beans::Property > props( 1 );
props[0] = beans::Property( props[0] = css::beans::Property(
"Title", "Title",
-1, -1,
cppu::UnoType<OUString>::get(), cppu::UnoType<OUString>::get(),
beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::BOUND ); css::beans::PropertyAttribute::MAYBEVOID | css::beans::PropertyAttribute::BOUND );
// file // file
seq[0].Type = GIO_FILE_TYPE; seq[0].Type = GIO_FILE_TYPE;
seq[0].Attributes = ( ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM | seq[0].Attributes = ( css::ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM |
ucb::ContentInfoAttribute::KIND_DOCUMENT ); css::ucb::ContentInfoAttribute::KIND_DOCUMENT );
seq[0].Properties = props; seq[0].Properties = props;
// folder // folder
seq[1].Type = GIO_FOLDER_TYPE; seq[1].Type = GIO_FOLDER_TYPE;
seq[1].Attributes = ucb::ContentInfoAttribute::KIND_FOLDER; seq[1].Attributes = css::ucb::ContentInfoAttribute::KIND_FOLDER;
seq[1].Properties = props; seq[1].Properties = props;
return seq; return seq;
} }
else else
{ {
return uno::Sequence< ucb::ContentInfo >(); return css::uno::Sequence< css::ucb::ContentInfo >();
} }
} }
uno::Sequence< ucb::ContentInfo > SAL_CALL Content::queryCreatableContentsInfo() css::uno::Sequence< css::ucb::ContentInfo > SAL_CALL Content::queryCreatableContentsInfo()
{ {
return queryCreatableContentsInfo( uno::Reference< ucb::XCommandEnvironment >() ); return queryCreatableContentsInfo( css::uno::Reference< css::ucb::XCommandEnvironment >() );
} }
uno::Reference< ucb::XContent > css::uno::Reference< css::ucb::XContent >
SAL_CALL Content::createNewContent( const ucb::ContentInfo& Info ) SAL_CALL Content::createNewContent( const css::ucb::ContentInfo& Info )
{ {
bool create_document; bool create_document;
const char *name; const char *name;
...@@ -1162,7 +1160,7 @@ uno::Reference< ucb::XContent > ...@@ -1162,7 +1160,7 @@ uno::Reference< ucb::XContent >
else else
{ {
SAL_WARN("ucb.ucp.gio", "Failed to create new content '" << Info.Type << "'"); SAL_WARN("ucb.ucp.gio", "Failed to create new content '" << Info.Type << "'");
return uno::Reference< ucb::XContent >(); return css::uno::Reference< css::ucb::XContent >();
} }
SAL_INFO("ucb.ucp.gio", "createNewContent (" << create_document << ")"); SAL_INFO("ucb.ucp.gio", "createNewContent (" << create_document << ")");
...@@ -1174,140 +1172,140 @@ uno::Reference< ucb::XContent > ...@@ -1174,140 +1172,140 @@ uno::Reference< ucb::XContent >
name = create_document ? "[New_Content]" : "[New_Collection]"; name = create_document ? "[New_Content]" : "[New_Collection]";
aURL += OUString::createFromAscii( name ); aURL += OUString::createFromAscii( name );
uno::Reference< ucb::XContentIdentifier > xId(new ::ucbhelper::ContentIdentifier(aURL)); css::uno::Reference< css::ucb::XContentIdentifier > xId(new ::ucbhelper::ContentIdentifier(aURL));
try try
{ {
return new ::gio::Content( m_xContext, m_pProvider, xId, !create_document ); return new ::gio::Content( m_xContext, m_pProvider, xId, !create_document );
} catch ( ucb::ContentCreationException & ) } catch ( css::ucb::ContentCreationException & )
{ {
return uno::Reference< ucb::XContent >(); return css::uno::Reference< css::ucb::XContent >();
} }
} }
uno::Sequence< uno::Type > SAL_CALL Content::getTypes() css::uno::Sequence< css::uno::Type > SAL_CALL Content::getTypes()
{ {
if ( isFolder( uno::Reference< ucb::XCommandEnvironment >() ) ) if ( isFolder( css::uno::Reference< css::ucb::XCommandEnvironment >() ) )
{ {
static cppu::OTypeCollection s_aFolderCollection static cppu::OTypeCollection s_aFolderCollection
(CPPU_TYPE_REF( lang::XTypeProvider ), (CPPU_TYPE_REF( css::lang::XTypeProvider ),
CPPU_TYPE_REF( lang::XServiceInfo ), CPPU_TYPE_REF( css::lang::XServiceInfo ),
CPPU_TYPE_REF( lang::XComponent ), CPPU_TYPE_REF( css::lang::XComponent ),
CPPU_TYPE_REF( ucb::XContent ), CPPU_TYPE_REF( css::ucb::XContent ),
CPPU_TYPE_REF( ucb::XCommandProcessor ), CPPU_TYPE_REF( css::ucb::XCommandProcessor ),
CPPU_TYPE_REF( beans::XPropertiesChangeNotifier ), CPPU_TYPE_REF( css::beans::XPropertiesChangeNotifier ),
CPPU_TYPE_REF( ucb::XCommandInfoChangeNotifier ), CPPU_TYPE_REF( css::ucb::XCommandInfoChangeNotifier ),
CPPU_TYPE_REF( beans::XPropertyContainer ), CPPU_TYPE_REF( css::beans::XPropertyContainer ),
CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ), CPPU_TYPE_REF( css::beans::XPropertySetInfoChangeNotifier ),
CPPU_TYPE_REF( container::XChild ), CPPU_TYPE_REF( css::container::XChild ),
CPPU_TYPE_REF( ucb::XContentCreator ) ); CPPU_TYPE_REF( css::ucb::XContentCreator ) );
return s_aFolderCollection.getTypes(); return s_aFolderCollection.getTypes();
} }
else else
{ {
static cppu::OTypeCollection s_aFileCollection static cppu::OTypeCollection s_aFileCollection
(CPPU_TYPE_REF( lang::XTypeProvider ), (CPPU_TYPE_REF( css::lang::XTypeProvider ),
CPPU_TYPE_REF( lang::XServiceInfo ), CPPU_TYPE_REF( css::lang::XServiceInfo ),
CPPU_TYPE_REF( lang::XComponent ), CPPU_TYPE_REF( css::lang::XComponent ),
CPPU_TYPE_REF( ucb::XContent ), CPPU_TYPE_REF( css::ucb::XContent ),
CPPU_TYPE_REF( ucb::XCommandProcessor ), CPPU_TYPE_REF( css::ucb::XCommandProcessor ),
CPPU_TYPE_REF( beans::XPropertiesChangeNotifier ), CPPU_TYPE_REF( css::beans::XPropertiesChangeNotifier ),
CPPU_TYPE_REF( ucb::XCommandInfoChangeNotifier ), CPPU_TYPE_REF( css::ucb::XCommandInfoChangeNotifier ),
CPPU_TYPE_REF( beans::XPropertyContainer ), CPPU_TYPE_REF( css::beans::XPropertyContainer ),
CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ), CPPU_TYPE_REF( css::beans::XPropertySetInfoChangeNotifier ),
CPPU_TYPE_REF( container::XChild ) ); CPPU_TYPE_REF( css::container::XChild ) );
return s_aFileCollection.getTypes(); return s_aFileCollection.getTypes();
} }
} }
uno::Sequence< beans::Property > Content::getProperties( css::uno::Sequence< css::beans::Property > Content::getProperties(
const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ ) const css::uno::Reference< css::ucb::XCommandEnvironment > & /*xEnv*/ )
{ {
static const beans::Property aGenericProperties[] = static const css::beans::Property aGenericProperties[] =
{ {
beans::Property( "IsDocument", css::beans::Property( "IsDocument",
-1, cppu::UnoType<bool>::get(), -1, cppu::UnoType<bool>::get(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ),
beans::Property( "IsFolder", css::beans::Property( "IsFolder",
-1, cppu::UnoType<bool>::get(), -1, cppu::UnoType<bool>::get(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ),
beans::Property( "Title", css::beans::Property( "Title",
-1, cppu::UnoType<OUString>::get(), -1, cppu::UnoType<OUString>::get(),
beans::PropertyAttribute::BOUND ), css::beans::PropertyAttribute::BOUND ),
beans::Property( "IsReadOnly", css::beans::Property( "IsReadOnly",
-1, cppu::UnoType<bool>::get(), -1, cppu::UnoType<bool>::get(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ),
beans::Property( "DateCreated", css::beans::Property( "DateCreated",
-1, cppu::UnoType<util::DateTime>::get(), -1, cppu::UnoType<css::util::DateTime>::get(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ),
beans::Property( "DateModified", css::beans::Property( "DateModified",
-1, cppu::UnoType<util::DateTime>::get(), -1, cppu::UnoType<css::util::DateTime>::get(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ),
beans::Property( "Size", css::beans::Property( "Size",
-1, cppu::UnoType<sal_Int64>::get(), -1, cppu::UnoType<sal_Int64>::get(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ),
beans::Property( "IsVolume", css::beans::Property( "IsVolume",
1, cppu::UnoType<bool>::get(), 1, cppu::UnoType<bool>::get(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ),
beans::Property( "IsCompactDisc", css::beans::Property( "IsCompactDisc",
-1, cppu::UnoType<bool>::get(), -1, cppu::UnoType<bool>::get(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ),
beans::Property( "IsRemoveable", css::beans::Property( "IsRemoveable",
-1, cppu::UnoType<bool>::get(), -1, cppu::UnoType<bool>::get(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ),
beans::Property( "IsHidden", css::beans::Property( "IsHidden",
-1, cppu::UnoType<bool>::get(), -1, cppu::UnoType<bool>::get(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY ),
beans::Property( "CreatableContentsInfo", css::beans::Property( "CreatableContentsInfo",
-1, cppu::UnoType<uno::Sequence< ucb::ContentInfo >>::get(), -1, cppu::UnoType<css::uno::Sequence< css::ucb::ContentInfo >>::get(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ) css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY )
}; };
const int nProps = SAL_N_ELEMENTS(aGenericProperties); const int nProps = SAL_N_ELEMENTS(aGenericProperties);
return uno::Sequence< beans::Property > ( aGenericProperties, nProps ); return css::uno::Sequence< css::beans::Property > ( aGenericProperties, nProps );
} }
uno::Sequence< ucb::CommandInfo > Content::getCommands( const uno::Reference< ucb::XCommandEnvironment > & xEnv) css::uno::Sequence< css::ucb::CommandInfo > Content::getCommands( const css::uno::Reference< css::ucb::XCommandEnvironment > & xEnv)
{ {
static const ucb::CommandInfo aCommandInfoTable[] = static const css::ucb::CommandInfo aCommandInfoTable[] =
{ {
// Required commands // Required commands
ucb::CommandInfo css::ucb::CommandInfo
( "getCommandInfo", ( "getCommandInfo",
-1, cppu::UnoType<void>::get() ), -1, cppu::UnoType<void>::get() ),
ucb::CommandInfo css::ucb::CommandInfo
( "getPropertySetInfo", ( "getPropertySetInfo",
-1, cppu::UnoType<void>::get() ), -1, cppu::UnoType<void>::get() ),
ucb::CommandInfo css::ucb::CommandInfo
( "getPropertyValues", ( "getPropertyValues",
-1, cppu::UnoType<uno::Sequence< beans::Property >>::get() ), -1, cppu::UnoType<css::uno::Sequence< css::beans::Property >>::get() ),
ucb::CommandInfo css::ucb::CommandInfo
( "setPropertyValues", ( "setPropertyValues",
-1, cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get() ), -1, cppu::UnoType<css::uno::Sequence< css::beans::PropertyValue >>::get() ),
// Optional standard commands // Optional standard commands
ucb::CommandInfo css::ucb::CommandInfo
( "delete", ( "delete",
-1, cppu::UnoType<bool>::get() ), -1, cppu::UnoType<bool>::get() ),
ucb::CommandInfo css::ucb::CommandInfo
( "insert", ( "insert",
-1, cppu::UnoType<ucb::InsertCommandArgument>::get() ), -1, cppu::UnoType<css::ucb::InsertCommandArgument>::get() ),
ucb::CommandInfo css::ucb::CommandInfo
( "open", ( "open",
-1, cppu::UnoType<ucb::OpenCommandArgument2>::get() ), -1, cppu::UnoType<css::ucb::OpenCommandArgument2>::get() ),
// Folder Only, omitted if not a folder // Folder Only, omitted if not a folder
ucb::CommandInfo css::ucb::CommandInfo
( "transfer", ( "transfer",
-1, cppu::UnoType<ucb::TransferInfo>::get() ), -1, cppu::UnoType<css::ucb::TransferInfo>::get() ),
ucb::CommandInfo css::ucb::CommandInfo
( "createNewContent", ( "createNewContent",
-1, cppu::UnoType<ucb::ContentInfo>::get() ) -1, cppu::UnoType<css::ucb::ContentInfo>::get() )
}; };
const int nProps = SAL_N_ELEMENTS(aCommandInfoTable); const int nProps = SAL_N_ELEMENTS(aCommandInfoTable);
return uno::Sequence< ucb::CommandInfo >(aCommandInfoTable, isFolder(xEnv) ? nProps : nProps - 2); return css::uno::Sequence< css::ucb::CommandInfo >(aCommandInfoTable, isFolder(xEnv) ? nProps : nProps - 2);
} }
XTYPEPROVIDER_COMMON_IMPL( Content ); XTYPEPROVIDER_COMMON_IMPL( Content );
...@@ -1322,9 +1320,9 @@ void SAL_CALL Content::release() throw() ...@@ -1322,9 +1320,9 @@ void SAL_CALL Content::release() throw()
ContentImplHelper::release(); ContentImplHelper::release();
} }
uno::Any SAL_CALL Content::queryInterface( const uno::Type & rType ) css::uno::Any SAL_CALL Content::queryInterface( const css::uno::Type & rType )
{ {
uno::Any aRet = cppu::queryInterface( rType, static_cast< ucb::XContentCreator * >( this ) ); css::uno::Any aRet = cppu::queryInterface( rType, static_cast< css::ucb::XContentCreator * >( this ) );
return aRet.hasValue() ? aRet : ContentImplHelper::queryInterface(rType); return aRet.hasValue() ? aRet : ContentImplHelper::queryInterface(rType);
} }
...@@ -1333,9 +1331,9 @@ OUString SAL_CALL Content::getImplementationName() ...@@ -1333,9 +1331,9 @@ OUString SAL_CALL Content::getImplementationName()
return OUString("com.sun.star.comp.GIOContent"); return OUString("com.sun.star.comp.GIOContent");
} }
uno::Sequence< OUString > SAL_CALL Content::getSupportedServiceNames() css::uno::Sequence< OUString > SAL_CALL Content::getSupportedServiceNames()
{ {
uno::Sequence<OUString> aSNS { "com.sun.star.ucb.GIOContent" }; css::uno::Sequence<OUString> aSNS { "com.sun.star.ucb.GIOContent" };
return aSNS; return aSNS;
} }
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#include "gio_content.hxx" #include "gio_content.hxx"
#include "gio_provider.hxx" #include "gio_provider.hxx"
using namespace com::sun::star;
using namespace gio; using namespace gio;
namespace gio namespace gio
...@@ -58,15 +56,15 @@ bool DataSupplier::getData() ...@@ -58,15 +56,15 @@ bool DataSupplier::getData()
{ {
switch ( mnOpenMode ) switch ( mnOpenMode )
{ {
case ucb::OpenMode::FOLDERS: case css::ucb::OpenMode::FOLDERS:
if (g_file_info_get_file_type(pInfo) != G_FILE_TYPE_DIRECTORY) if (g_file_info_get_file_type(pInfo) != G_FILE_TYPE_DIRECTORY)
continue; continue;
break; break;
case ucb::OpenMode::DOCUMENTS: case css::ucb::OpenMode::DOCUMENTS:
if (g_file_info_get_file_type(pInfo) != G_FILE_TYPE_REGULAR) if (g_file_info_get_file_type(pInfo) != G_FILE_TYPE_REGULAR)
continue; continue;
break; break;
case ucb::OpenMode::ALL: case css::ucb::OpenMode::ALL:
default: default:
break; break;
} }
...@@ -121,11 +119,11 @@ OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) ...@@ -121,11 +119,11 @@ OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex )
return OUString(); return OUString();
} }
uno::Reference< ucb::XContentIdentifier > DataSupplier::queryContentIdentifier( sal_uInt32 nIndex ) css::uno::Reference< css::ucb::XContentIdentifier > DataSupplier::queryContentIdentifier( sal_uInt32 nIndex )
{ {
if ( nIndex < maResults.size() ) if ( nIndex < maResults.size() )
{ {
uno::Reference< ucb::XContentIdentifier > xId = maResults[ nIndex ]->xId; css::uno::Reference< css::ucb::XContentIdentifier > xId = maResults[ nIndex ]->xId;
if ( xId.is() ) if ( xId.is() )
{ {
// Already cached. // Already cached.
...@@ -136,19 +134,19 @@ uno::Reference< ucb::XContentIdentifier > DataSupplier::queryContentIdentifier( ...@@ -136,19 +134,19 @@ uno::Reference< ucb::XContentIdentifier > DataSupplier::queryContentIdentifier(
OUString aId = queryContentIdentifierString( nIndex ); OUString aId = queryContentIdentifierString( nIndex );
if ( aId.getLength() ) if ( aId.getLength() )
{ {
uno::Reference< ucb::XContentIdentifier > xId = new ucbhelper::ContentIdentifier( aId ); css::uno::Reference< css::ucb::XContentIdentifier > xId = new ucbhelper::ContentIdentifier( aId );
maResults[ nIndex ]->xId = xId; maResults[ nIndex ]->xId = xId;
return xId; return xId;
} }
return uno::Reference< ucb::XContentIdentifier >(); return css::uno::Reference< css::ucb::XContentIdentifier >();
} }
uno::Reference< ucb::XContent > DataSupplier::queryContent( sal_uInt32 nIndex ) css::uno::Reference< css::ucb::XContent > DataSupplier::queryContent( sal_uInt32 nIndex )
{ {
if ( nIndex < maResults.size() ) if ( nIndex < maResults.size() )
{ {
uno::Reference< ucb::XContent > xContent = maResults[ nIndex ]->xContent; css::uno::Reference< css::ucb::XContent > xContent = maResults[ nIndex ]->xContent;
if ( xContent.is() ) if ( xContent.is() )
{ {
// Already cached. // Already cached.
...@@ -156,20 +154,20 @@ uno::Reference< ucb::XContent > DataSupplier::queryContent( sal_uInt32 nIndex ) ...@@ -156,20 +154,20 @@ uno::Reference< ucb::XContent > DataSupplier::queryContent( sal_uInt32 nIndex )
} }
} }
uno::Reference< ucb::XContentIdentifier > xId = queryContentIdentifier( nIndex ); css::uno::Reference< css::ucb::XContentIdentifier > xId = queryContentIdentifier( nIndex );
if ( xId.is() ) if ( xId.is() )
{ {
try try
{ {
uno::Reference< ucb::XContent > xContent = mxContent->getProvider()->queryContent( xId ); css::uno::Reference< css::ucb::XContent > xContent = mxContent->getProvider()->queryContent( xId );
maResults[ nIndex ]->xContent = xContent; maResults[ nIndex ]->xContent = xContent;
return xContent; return xContent;
} }
catch ( ucb::IllegalIdentifierException& ) catch ( css::ucb::IllegalIdentifierException& )
{ {
} }
} }
return uno::Reference< ucb::XContent >(); return css::uno::Reference< css::ucb::XContent >();
} }
bool DataSupplier::getResult( sal_uInt32 nIndex ) bool DataSupplier::getResult( sal_uInt32 nIndex )
...@@ -199,11 +197,11 @@ bool DataSupplier::isCountFinal() ...@@ -199,11 +197,11 @@ bool DataSupplier::isCountFinal()
return mbCountFinal; return mbCountFinal;
} }
uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues( sal_uInt32 nIndex ) css::uno::Reference< css::sdbc::XRow > DataSupplier::queryPropertyValues( sal_uInt32 nIndex )
{ {
if ( nIndex < maResults.size() ) if ( nIndex < maResults.size() )
{ {
uno::Reference< sdbc::XRow > xRow = maResults[ nIndex ]->xRow; css::uno::Reference< css::sdbc::XRow > xRow = maResults[ nIndex ]->xRow;
if ( xRow.is() ) if ( xRow.is() )
{ {
// Already cached. // Already cached.
...@@ -213,33 +211,33 @@ uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues( sal_uInt32 nInde ...@@ -213,33 +211,33 @@ uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues( sal_uInt32 nInde
if ( getResult( nIndex ) ) if ( getResult( nIndex ) )
{ {
uno::Reference< ucb::XContent > xContent( queryContent( nIndex ) ); css::uno::Reference< css::ucb::XContent > xContent( queryContent( nIndex ) );
if ( xContent.is() ) if ( xContent.is() )
{ {
try try
{ {
uno::Reference< ucb::XCommandProcessor > xCmdProc( css::uno::Reference< css::ucb::XCommandProcessor > xCmdProc(
xContent, uno::UNO_QUERY_THROW ); xContent, css::uno::UNO_QUERY_THROW );
sal_Int32 nCmdId( xCmdProc->createCommandIdentifier() ); sal_Int32 nCmdId( xCmdProc->createCommandIdentifier() );
ucb::Command aCmd; css::ucb::Command aCmd;
aCmd.Name = "getPropertyValues"; aCmd.Name = "getPropertyValues";
aCmd.Handle = -1; aCmd.Handle = -1;
aCmd.Argument <<= getResultSet()->getProperties(); aCmd.Argument <<= getResultSet()->getProperties();
uno::Any aResult( xCmdProc->execute( css::uno::Any aResult( xCmdProc->execute(
aCmd, nCmdId, getResultSet()->getEnvironment() ) ); aCmd, nCmdId, getResultSet()->getEnvironment() ) );
uno::Reference< sdbc::XRow > xRow; css::uno::Reference< css::sdbc::XRow > xRow;
if ( aResult >>= xRow ) if ( aResult >>= xRow )
{ {
maResults[ nIndex ]->xRow = xRow; maResults[ nIndex ]->xRow = xRow;
return xRow; return xRow;
} }
} }
catch ( uno::Exception const & ) catch ( css::uno::Exception const & )
{ {
} }
} }
} }
return uno::Reference< sdbc::XRow >(); return css::uno::Reference< css::sdbc::XRow >();
} }
void DataSupplier::releasePropertyValues( sal_uInt32 nIndex ) void DataSupplier::releasePropertyValues( sal_uInt32 nIndex )
......
...@@ -28,15 +28,13 @@ ...@@ -28,15 +28,13 @@
#include "gio_inputstream.hxx" #include "gio_inputstream.hxx"
#include "gio_content.hxx" #include "gio_content.hxx"
using namespace com::sun::star;
namespace gio namespace gio
{ {
InputStream::InputStream(GFileInputStream *pStream): mpStream(pStream) InputStream::InputStream(GFileInputStream *pStream): mpStream(pStream)
{ {
if (!mpStream) if (!mpStream)
throw io::NotConnectedException(); throw css::io::NotConnectedException();
} }
InputStream::~InputStream() InputStream::~InputStream()
...@@ -64,18 +62,18 @@ void SAL_CALL InputStream::skipBytes( sal_Int32 nBytesToSkip ) ...@@ -64,18 +62,18 @@ void SAL_CALL InputStream::skipBytes( sal_Int32 nBytesToSkip )
readBytes(data, nBytesToSkip); readBytes(data, nBytesToSkip);
} }
sal_Int32 SAL_CALL InputStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) sal_Int32 SAL_CALL InputStream::readBytes( css::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead )
{ {
if (!mpStream) if (!mpStream)
throw io::NotConnectedException(); throw css::io::NotConnectedException();
try try
{ {
aData.realloc( nBytesToRead ); aData.realloc( nBytesToRead );
} }
catch ( const uno::Exception & ) catch ( const css::uno::Exception & )
{ {
throw io::BufferSizeExceededException(); throw css::io::BufferSizeExceededException();
} }
gsize nBytesRead = 0; gsize nBytesRead = 0;
...@@ -86,7 +84,7 @@ sal_Int32 SAL_CALL InputStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal ...@@ -86,7 +84,7 @@ sal_Int32 SAL_CALL InputStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal
return nBytesRead; return nBytesRead;
} }
sal_Int32 SAL_CALL InputStream::readSomeBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) sal_Int32 SAL_CALL InputStream::readSomeBytes( css::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead )
{ {
return readBytes(aData, nMaxBytesToRead); return readBytes(aData, nMaxBytesToRead);
} }
......
...@@ -60,13 +60,11 @@ static void ooo_mount_operation_class_init (OOoMountOperationClass *klass) ...@@ -60,13 +60,11 @@ static void ooo_mount_operation_class_init (OOoMountOperationClass *klass)
mount_op_class->ask_password = ooo_mount_operation_ask_password; mount_op_class->ask_password = ooo_mount_operation_ask_password;
} }
using namespace com::sun::star;
static void ooo_mount_operation_ask_password (GMountOperation *op, static void ooo_mount_operation_ask_password (GMountOperation *op,
const char * /*message*/, const char *default_user, const char * /*message*/, const char *default_user,
const char *default_domain, GAskPasswordFlags flags) const char *default_domain, GAskPasswordFlags flags)
{ {
uno::Reference< task::XInteractionHandler > xIH; css::uno::Reference< css::task::XInteractionHandler > xIH;
OOoMountOperation *pThis = reinterpret_cast<OOoMountOperation*>(op); OOoMountOperation *pThis = reinterpret_cast<OOoMountOperation*>(op);
...@@ -130,7 +128,7 @@ static void ooo_mount_operation_ask_password (GMountOperation *op, ...@@ -130,7 +128,7 @@ static void ooo_mount_operation_ask_password (GMountOperation *op,
return; return;
} }
uno::Reference< task::XInteractionAbort > xAbort(xSelection.get(), uno::UNO_QUERY ); css::uno::Reference< css::task::XInteractionAbort > xAbort(xSelection.get(), css::uno::UNO_QUERY );
if ( xAbort.is() ) if ( xAbort.is() )
{ {
g_mount_operation_reply (op, G_MOUNT_OPERATION_ABORTED); g_mount_operation_reply (op, G_MOUNT_OPERATION_ABORTED);
...@@ -153,13 +151,13 @@ static void ooo_mount_operation_ask_password (GMountOperation *op, ...@@ -153,13 +151,13 @@ static void ooo_mount_operation_ask_password (GMountOperation *op,
switch (xSupp->getRememberPasswordMode()) switch (xSupp->getRememberPasswordMode())
{ {
default: default:
case ucb::RememberAuthentication_NO: case css::ucb::RememberAuthentication_NO:
g_mount_operation_set_password_save(op, G_PASSWORD_SAVE_NEVER); g_mount_operation_set_password_save(op, G_PASSWORD_SAVE_NEVER);
break; break;
case ucb::RememberAuthentication_SESSION: case css::ucb::RememberAuthentication_SESSION:
g_mount_operation_set_password_save(op, G_PASSWORD_SAVE_FOR_SESSION); g_mount_operation_set_password_save(op, G_PASSWORD_SAVE_FOR_SESSION);
break; break;
case ucb::RememberAuthentication_PERSISTENT: case css::ucb::RememberAuthentication_PERSISTENT:
g_mount_operation_set_password_save(op, G_PASSWORD_SAVE_PERMANENTLY); g_mount_operation_set_password_save(op, G_PASSWORD_SAVE_PERMANENTLY);
break; break;
} }
...@@ -173,7 +171,7 @@ static void ooo_mount_operation_ask_password (GMountOperation *op, ...@@ -173,7 +171,7 @@ static void ooo_mount_operation_ask_password (GMountOperation *op,
g_mount_operation_reply (op, G_MOUNT_OPERATION_HANDLED); g_mount_operation_reply (op, G_MOUNT_OPERATION_HANDLED);
} }
GMountOperation *ooo_mount_operation_new(const uno::Reference< ucb::XCommandEnvironment >& rEnv) GMountOperation *ooo_mount_operation_new(const css::uno::Reference< css::ucb::XCommandEnvironment >& rEnv)
{ {
OOoMountOperation *pRet = static_cast<OOoMountOperation*>(g_object_new (OOO_TYPE_MOUNT_OPERATION, nullptr)); OOoMountOperation *pRet = static_cast<OOoMountOperation*>(g_object_new (OOO_TYPE_MOUNT_OPERATION, nullptr));
pRet->pEnv = &rEnv; pRet->pEnv = &rEnv;
......
...@@ -28,15 +28,13 @@ ...@@ -28,15 +28,13 @@
#include "gio_outputstream.hxx" #include "gio_outputstream.hxx"
#include "gio_content.hxx" #include "gio_content.hxx"
using namespace com::sun::star;
namespace gio namespace gio
{ {
OutputStream::OutputStream(GFileOutputStream *pStream) : Seekable(G_SEEKABLE(pStream)), mpStream(pStream) OutputStream::OutputStream(GFileOutputStream *pStream) : Seekable(G_SEEKABLE(pStream)), mpStream(pStream)
{ {
if (!mpStream) if (!mpStream)
throw io::NotConnectedException(); throw css::io::NotConnectedException();
} }
OutputStream::~OutputStream() OutputStream::~OutputStream()
...@@ -47,7 +45,7 @@ OutputStream::~OutputStream() ...@@ -47,7 +45,7 @@ OutputStream::~OutputStream()
void SAL_CALL OutputStream::writeBytes( const css::uno::Sequence< sal_Int8 >& rData ) void SAL_CALL OutputStream::writeBytes( const css::uno::Sequence< sal_Int8 >& rData )
{ {
if (!mpStream) if (!mpStream)
throw io::NotConnectedException(); throw css::io::NotConnectedException();
GError *pError=nullptr; GError *pError=nullptr;
if (!g_output_stream_write_all(G_OUTPUT_STREAM(mpStream), rData.getConstArray(), rData.getLength(), nullptr, nullptr, &pError)) if (!g_output_stream_write_all(G_OUTPUT_STREAM(mpStream), rData.getConstArray(), rData.getLength(), nullptr, nullptr, &pError))
...@@ -57,7 +55,7 @@ void SAL_CALL OutputStream::writeBytes( const css::uno::Sequence< sal_Int8 >& rD ...@@ -57,7 +55,7 @@ void SAL_CALL OutputStream::writeBytes( const css::uno::Sequence< sal_Int8 >& rD
void SAL_CALL OutputStream::flush() void SAL_CALL OutputStream::flush()
{ {
if (!mpStream) if (!mpStream)
throw io::NotConnectedException(); throw css::io::NotConnectedException();
GError *pError=nullptr; GError *pError=nullptr;
if (!g_output_stream_flush(G_OUTPUT_STREAM(mpStream), nullptr, &pError)) if (!g_output_stream_flush(G_OUTPUT_STREAM(mpStream), nullptr, &pError))
...@@ -70,9 +68,9 @@ void SAL_CALL OutputStream::closeOutput() ...@@ -70,9 +68,9 @@ void SAL_CALL OutputStream::closeOutput()
g_output_stream_close(G_OUTPUT_STREAM(mpStream), nullptr, nullptr); g_output_stream_close(G_OUTPUT_STREAM(mpStream), nullptr, nullptr);
} }
uno::Any OutputStream::queryInterface( const uno::Type &type ) css::uno::Any OutputStream::queryInterface( const css::uno::Type &type )
{ {
uno::Any aRet = ::cppu::queryInterface ( type, css::uno::Any aRet = ::cppu::queryInterface ( type,
static_cast< XOutputStream * >( this ) ); static_cast< XOutputStream * >( this ) );
return aRet.hasValue() ? aRet : Seekable::queryInterface( type ); return aRet.hasValue() ? aRet : Seekable::queryInterface( type );
......
...@@ -29,19 +29,17 @@ ...@@ -29,19 +29,17 @@
#include "gio_provider.hxx" #include "gio_provider.hxx"
#include "gio_content.hxx" #include "gio_content.hxx"
using namespace com::sun::star;
namespace gio namespace gio
{ {
uno::Reference< css::ucb::XContent > SAL_CALL css::uno::Reference< css::ucb::XContent > SAL_CALL
ContentProvider::queryContent( ContentProvider::queryContent(
const uno::Reference< css::ucb::XContentIdentifier >& Identifier ) const css::uno::Reference< css::ucb::XContentIdentifier >& Identifier )
{ {
SAL_INFO("ucb.ucp.gio", "QueryContent: " << Identifier->getContentIdentifier()); SAL_INFO("ucb.ucp.gio", "QueryContent: " << Identifier->getContentIdentifier());
osl::MutexGuard aGuard( m_aMutex ); osl::MutexGuard aGuard( m_aMutex );
// Check, if a content with given id already exists... // Check, if a content with given id already exists...
uno::Reference< ucb::XContent > xContent = queryExistingContent( Identifier ).get(); css::uno::Reference< css::ucb::XContent > xContent = queryExistingContent( Identifier ).get();
if ( xContent.is() ) if ( xContent.is() )
return xContent; return xContent;
...@@ -61,7 +59,7 @@ ContentProvider::queryContent( ...@@ -61,7 +59,7 @@ ContentProvider::queryContent(
} }
ContentProvider::ContentProvider( ContentProvider::ContentProvider(
const uno::Reference< uno::XComponentContext >& rxContext ) const css::uno::Reference< css::uno::XComponentContext >& rxContext )
: ::ucbhelper::ContentProviderImplHelper( rxContext ) : ::ucbhelper::ContentProviderImplHelper( rxContext )
{ {
} }
...@@ -86,16 +84,16 @@ void SAL_CALL ContentProvider::release() ...@@ -86,16 +84,16 @@ void SAL_CALL ContentProvider::release()
css::uno::Any SAL_CALL ContentProvider::queryInterface( const css::uno::Type & rType ) css::uno::Any SAL_CALL ContentProvider::queryInterface( const css::uno::Type & rType )
{ {
css::uno::Any aRet = cppu::queryInterface( rType, css::uno::Any aRet = cppu::queryInterface( rType,
static_cast< lang::XTypeProvider* >(this), static_cast< css::lang::XTypeProvider* >(this),
static_cast< lang::XServiceInfo* >(this), static_cast< css::lang::XServiceInfo* >(this),
static_cast< css::ucb::XContentProvider* >(this) static_cast< css::ucb::XContentProvider* >(this)
); );
return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
} }
XTYPEPROVIDER_IMPL_3( ContentProvider, XTYPEPROVIDER_IMPL_3( ContentProvider,
lang::XTypeProvider, css::lang::XTypeProvider,
lang::XServiceInfo, css::lang::XServiceInfo,
css::ucb::XContentProvider ); css::ucb::XContentProvider );
XSERVICEINFO_COMMOM_IMPL( ContentProvider, XSERVICEINFO_COMMOM_IMPL( ContentProvider,
...@@ -125,9 +123,9 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * ucpgio1_component_getFactory( const sal_C ...@@ -125,9 +123,9 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * ucpgio1_component_getFactory( const sal_C
{ {
void * pRet = nullptr; void * pRet = nullptr;
uno::Reference< lang::XMultiServiceFactory > xSMgr css::uno::Reference< css::lang::XMultiServiceFactory > xSMgr
(static_cast< lang::XMultiServiceFactory * >( pServiceManager ) ); (static_cast< css::lang::XMultiServiceFactory * >( pServiceManager ) );
uno::Reference< lang::XSingleServiceFactory > xFactory; css::uno::Reference< css::lang::XSingleServiceFactory > xFactory;
#if !GLIB_CHECK_VERSION(2,36,0) #if !GLIB_CHECK_VERSION(2,36,0)
g_type_init(); g_type_init();
#endif #endif
......
...@@ -29,15 +29,13 @@ ...@@ -29,15 +29,13 @@
#include "gio_seekable.hxx" #include "gio_seekable.hxx"
#include "gio_content.hxx" #include "gio_content.hxx"
using namespace com::sun::star;
namespace gio namespace gio
{ {
Seekable::Seekable(GSeekable *pStream) : mpStream(pStream) Seekable::Seekable(GSeekable *pStream) : mpStream(pStream)
{ {
if (!mpStream) if (!mpStream)
throw io::NotConnectedException(); throw css::io::NotConnectedException();
} }
Seekable::~Seekable() Seekable::~Seekable()
...@@ -47,10 +45,10 @@ Seekable::~Seekable() ...@@ -47,10 +45,10 @@ Seekable::~Seekable()
void SAL_CALL Seekable::truncate() void SAL_CALL Seekable::truncate()
{ {
if (!mpStream) if (!mpStream)
throw io::NotConnectedException(); throw css::io::NotConnectedException();
if (!g_seekable_can_truncate(mpStream)) if (!g_seekable_can_truncate(mpStream))
throw io::IOException("Truncate unsupported", throw css::io::IOException("Truncate unsupported",
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
GError *pError=nullptr; GError *pError=nullptr;
...@@ -61,10 +59,10 @@ void SAL_CALL Seekable::truncate() ...@@ -61,10 +59,10 @@ void SAL_CALL Seekable::truncate()
void SAL_CALL Seekable::seek( sal_Int64 location ) void SAL_CALL Seekable::seek( sal_Int64 location )
{ {
if (!mpStream) if (!mpStream)
throw io::NotConnectedException(); throw css::io::NotConnectedException();
if (!g_seekable_can_seek(mpStream)) if (!g_seekable_can_seek(mpStream))
throw io::IOException("Seek unsupported", throw css::io::IOException("Seek unsupported",
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
GError *pError=nullptr; GError *pError=nullptr;
...@@ -75,7 +73,7 @@ void SAL_CALL Seekable::seek( sal_Int64 location ) ...@@ -75,7 +73,7 @@ void SAL_CALL Seekable::seek( sal_Int64 location )
sal_Int64 SAL_CALL Seekable::getPosition() sal_Int64 SAL_CALL Seekable::getPosition()
{ {
if (!mpStream) if (!mpStream)
throw io::NotConnectedException(); throw css::io::NotConnectedException();
return g_seekable_tell(mpStream); return g_seekable_tell(mpStream);
} }
...@@ -83,7 +81,7 @@ sal_Int64 SAL_CALL Seekable::getPosition() ...@@ -83,7 +81,7 @@ sal_Int64 SAL_CALL Seekable::getPosition()
sal_Int64 SAL_CALL Seekable::getLength() sal_Int64 SAL_CALL Seekable::getLength()
{ {
if (!mpStream) if (!mpStream)
throw io::NotConnectedException(); throw css::io::NotConnectedException();
bool bOk = false; bool bOk = false;
sal_uInt64 nSize = 0; sal_uInt64 nSize = 0;
...@@ -115,9 +113,9 @@ sal_Int64 SAL_CALL Seekable::getLength() ...@@ -115,9 +113,9 @@ sal_Int64 SAL_CALL Seekable::getLength()
return nSize; return nSize;
} }
uno::Any Seekable::queryInterface( const uno::Type &type ) css::uno::Any Seekable::queryInterface( const css::uno::Type &type )
{ {
uno::Any aRet = ::cppu::queryInterface ( type, css::uno::Any aRet = ::cppu::queryInterface ( type,
static_cast< XSeekable * >( this ) ); static_cast< XSeekable * >( this ) );
if (!aRet.hasValue() && g_seekable_can_truncate(mpStream)) if (!aRet.hasValue() && g_seekable_can_truncate(mpStream))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment