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
......@@ -28,8 +28,6 @@
#include "gio_content.hxx"
#include "gio_provider.hxx"
using namespace com::sun::star;
using namespace gio;
namespace gio
......@@ -58,15 +56,15 @@ bool DataSupplier::getData()
{
switch ( mnOpenMode )
{
case ucb::OpenMode::FOLDERS:
case css::ucb::OpenMode::FOLDERS:
if (g_file_info_get_file_type(pInfo) != G_FILE_TYPE_DIRECTORY)
continue;
break;
case ucb::OpenMode::DOCUMENTS:
case css::ucb::OpenMode::DOCUMENTS:
if (g_file_info_get_file_type(pInfo) != G_FILE_TYPE_REGULAR)
continue;
break;
case ucb::OpenMode::ALL:
case css::ucb::OpenMode::ALL:
default:
break;
}
......@@ -121,11 +119,11 @@ OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex )
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() )
{
uno::Reference< ucb::XContentIdentifier > xId = maResults[ nIndex ]->xId;
css::uno::Reference< css::ucb::XContentIdentifier > xId = maResults[ nIndex ]->xId;
if ( xId.is() )
{
// Already cached.
......@@ -136,19 +134,19 @@ uno::Reference< ucb::XContentIdentifier > DataSupplier::queryContentIdentifier(
OUString aId = queryContentIdentifierString( nIndex );
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;
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() )
{
uno::Reference< ucb::XContent > xContent = maResults[ nIndex ]->xContent;
css::uno::Reference< css::ucb::XContent > xContent = maResults[ nIndex ]->xContent;
if ( xContent.is() )
{
// Already cached.
......@@ -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() )
{
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;
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 )
......@@ -199,11 +197,11 @@ bool DataSupplier::isCountFinal()
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() )
{
uno::Reference< sdbc::XRow > xRow = maResults[ nIndex ]->xRow;
css::uno::Reference< css::sdbc::XRow > xRow = maResults[ nIndex ]->xRow;
if ( xRow.is() )
{
// Already cached.
......@@ -213,33 +211,33 @@ uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues( sal_uInt32 nInde
if ( getResult( nIndex ) )
{
uno::Reference< ucb::XContent > xContent( queryContent( nIndex ) );
css::uno::Reference< css::ucb::XContent > xContent( queryContent( nIndex ) );
if ( xContent.is() )
{
try
{
uno::Reference< ucb::XCommandProcessor > xCmdProc(
xContent, uno::UNO_QUERY_THROW );
css::uno::Reference< css::ucb::XCommandProcessor > xCmdProc(
xContent, css::uno::UNO_QUERY_THROW );
sal_Int32 nCmdId( xCmdProc->createCommandIdentifier() );
ucb::Command aCmd;
css::ucb::Command aCmd;
aCmd.Name = "getPropertyValues";
aCmd.Handle = -1;
aCmd.Argument <<= getResultSet()->getProperties();
uno::Any aResult( xCmdProc->execute(
css::uno::Any aResult( xCmdProc->execute(
aCmd, nCmdId, getResultSet()->getEnvironment() ) );
uno::Reference< sdbc::XRow > xRow;
css::uno::Reference< css::sdbc::XRow > xRow;
if ( aResult >>= xRow )
{
maResults[ nIndex ]->xRow = 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 )
......
......@@ -28,15 +28,13 @@
#include "gio_inputstream.hxx"
#include "gio_content.hxx"
using namespace com::sun::star;
namespace gio
{
InputStream::InputStream(GFileInputStream *pStream): mpStream(pStream)
{
if (!mpStream)
throw io::NotConnectedException();
throw css::io::NotConnectedException();
}
InputStream::~InputStream()
......@@ -64,18 +62,18 @@ void SAL_CALL InputStream::skipBytes( sal_Int32 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)
throw io::NotConnectedException();
throw css::io::NotConnectedException();
try
{
aData.realloc( nBytesToRead );
}
catch ( const uno::Exception & )
catch ( const css::uno::Exception & )
{
throw io::BufferSizeExceededException();
throw css::io::BufferSizeExceededException();
}
gsize nBytesRead = 0;
......@@ -86,7 +84,7 @@ sal_Int32 SAL_CALL InputStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal
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);
}
......
......@@ -60,13 +60,11 @@ static void ooo_mount_operation_class_init (OOoMountOperationClass *klass)
mount_op_class->ask_password = ooo_mount_operation_ask_password;
}
using namespace com::sun::star;
static void ooo_mount_operation_ask_password (GMountOperation *op,
const char * /*message*/, const char *default_user,
const char *default_domain, GAskPasswordFlags flags)
{
uno::Reference< task::XInteractionHandler > xIH;
css::uno::Reference< css::task::XInteractionHandler > xIH;
OOoMountOperation *pThis = reinterpret_cast<OOoMountOperation*>(op);
......@@ -130,7 +128,7 @@ static void ooo_mount_operation_ask_password (GMountOperation *op,
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() )
{
g_mount_operation_reply (op, G_MOUNT_OPERATION_ABORTED);
......@@ -153,13 +151,13 @@ static void ooo_mount_operation_ask_password (GMountOperation *op,
switch (xSupp->getRememberPasswordMode())
{
default:
case ucb::RememberAuthentication_NO:
case css::ucb::RememberAuthentication_NO:
g_mount_operation_set_password_save(op, G_PASSWORD_SAVE_NEVER);
break;
case ucb::RememberAuthentication_SESSION:
case css::ucb::RememberAuthentication_SESSION:
g_mount_operation_set_password_save(op, G_PASSWORD_SAVE_FOR_SESSION);
break;
case ucb::RememberAuthentication_PERSISTENT:
case css::ucb::RememberAuthentication_PERSISTENT:
g_mount_operation_set_password_save(op, G_PASSWORD_SAVE_PERMANENTLY);
break;
}
......@@ -173,7 +171,7 @@ static void ooo_mount_operation_ask_password (GMountOperation *op,
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));
pRet->pEnv = &rEnv;
......
......@@ -28,15 +28,13 @@
#include "gio_outputstream.hxx"
#include "gio_content.hxx"
using namespace com::sun::star;
namespace gio
{
OutputStream::OutputStream(GFileOutputStream *pStream) : Seekable(G_SEEKABLE(pStream)), mpStream(pStream)
{
if (!mpStream)
throw io::NotConnectedException();
throw css::io::NotConnectedException();
}
OutputStream::~OutputStream()
......@@ -47,7 +45,7 @@ OutputStream::~OutputStream()
void SAL_CALL OutputStream::writeBytes( const css::uno::Sequence< sal_Int8 >& rData )
{
if (!mpStream)
throw io::NotConnectedException();
throw css::io::NotConnectedException();
GError *pError=nullptr;
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
void SAL_CALL OutputStream::flush()
{
if (!mpStream)
throw io::NotConnectedException();
throw css::io::NotConnectedException();
GError *pError=nullptr;
if (!g_output_stream_flush(G_OUTPUT_STREAM(mpStream), nullptr, &pError))
......@@ -70,9 +68,9 @@ void SAL_CALL OutputStream::closeOutput()
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 ) );
return aRet.hasValue() ? aRet : Seekable::queryInterface( type );
......
......@@ -29,19 +29,17 @@
#include "gio_provider.hxx"
#include "gio_content.hxx"
using namespace com::sun::star;
namespace gio
{
uno::Reference< css::ucb::XContent > SAL_CALL
css::uno::Reference< css::ucb::XContent > SAL_CALL
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());
osl::MutexGuard aGuard( m_aMutex );
// 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() )
return xContent;
......@@ -61,7 +59,7 @@ ContentProvider::queryContent(
}
ContentProvider::ContentProvider(
const uno::Reference< uno::XComponentContext >& rxContext )
const css::uno::Reference< css::uno::XComponentContext >& rxContext )
: ::ucbhelper::ContentProviderImplHelper( rxContext )
{
}
......@@ -86,16 +84,16 @@ void SAL_CALL ContentProvider::release()
css::uno::Any SAL_CALL ContentProvider::queryInterface( const css::uno::Type & rType )
{
css::uno::Any aRet = cppu::queryInterface( rType,
static_cast< lang::XTypeProvider* >(this),
static_cast< lang::XServiceInfo* >(this),
static_cast< css::lang::XTypeProvider* >(this),
static_cast< css::lang::XServiceInfo* >(this),
static_cast< css::ucb::XContentProvider* >(this)
);
return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
}
XTYPEPROVIDER_IMPL_3( ContentProvider,
lang::XTypeProvider,
lang::XServiceInfo,
css::lang::XTypeProvider,
css::lang::XServiceInfo,
css::ucb::XContentProvider );
XSERVICEINFO_COMMOM_IMPL( ContentProvider,
......@@ -125,9 +123,9 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * ucpgio1_component_getFactory( const sal_C
{
void * pRet = nullptr;
uno::Reference< lang::XMultiServiceFactory > xSMgr
(static_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
uno::Reference< lang::XSingleServiceFactory > xFactory;
css::uno::Reference< css::lang::XMultiServiceFactory > xSMgr
(static_cast< css::lang::XMultiServiceFactory * >( pServiceManager ) );
css::uno::Reference< css::lang::XSingleServiceFactory > xFactory;
#if !GLIB_CHECK_VERSION(2,36,0)
g_type_init();
#endif
......
......@@ -29,15 +29,13 @@
#include "gio_seekable.hxx"
#include "gio_content.hxx"
using namespace com::sun::star;
namespace gio
{
Seekable::Seekable(GSeekable *pStream) : mpStream(pStream)
{
if (!mpStream)
throw io::NotConnectedException();
throw css::io::NotConnectedException();
}
Seekable::~Seekable()
......@@ -47,10 +45,10 @@ Seekable::~Seekable()
void SAL_CALL Seekable::truncate()
{
if (!mpStream)
throw io::NotConnectedException();
throw css::io::NotConnectedException();
if (!g_seekable_can_truncate(mpStream))
throw io::IOException("Truncate unsupported",
throw css::io::IOException("Truncate unsupported",
static_cast< cppu::OWeakObject * >(this));
GError *pError=nullptr;
......@@ -61,10 +59,10 @@ void SAL_CALL Seekable::truncate()
void SAL_CALL Seekable::seek( sal_Int64 location )
{
if (!mpStream)
throw io::NotConnectedException();
throw css::io::NotConnectedException();
if (!g_seekable_can_seek(mpStream))
throw io::IOException("Seek unsupported",
throw css::io::IOException("Seek unsupported",
static_cast< cppu::OWeakObject * >(this));
GError *pError=nullptr;
......@@ -75,7 +73,7 @@ void SAL_CALL Seekable::seek( sal_Int64 location )
sal_Int64 SAL_CALL Seekable::getPosition()
{
if (!mpStream)
throw io::NotConnectedException();
throw css::io::NotConnectedException();
return g_seekable_tell(mpStream);
}
......@@ -83,7 +81,7 @@ sal_Int64 SAL_CALL Seekable::getPosition()
sal_Int64 SAL_CALL Seekable::getLength()
{
if (!mpStream)
throw io::NotConnectedException();
throw css::io::NotConnectedException();
bool bOk = false;
sal_uInt64 nSize = 0;
......@@ -115,9 +113,9 @@ sal_Int64 SAL_CALL Seekable::getLength()
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 ) );
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