summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/gio
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-04-23 20:15:18 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-07-01 04:55:21 +0200
commite693d340a86e4e5f16c3beda062aaec3a71e5e2e (patch)
tree9c2725d9385acdc9b303766f71a3861dd8aa568c /ucb/source/ucp/gio
parentc5bd661dc032ed8f664b0eac47f246d4d51b4d2c (diff)
Use getXWeak in ucb
Change-Id: Id94a89596bd473ed8c83d7be89ba673d8dc1bba1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150878 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'ucb/source/ucp/gio')
-rw-r--r--ucb/source/ucp/gio/gio_content.cxx28
-rw-r--r--ucb/source/ucp/gio/gio_inputstream.cxx2
-rw-r--r--ucb/source/ucp/gio/gio_outputstream.cxx4
-rw-r--r--ucb/source/ucp/gio/gio_seekable.cxx10
4 files changed, 22 insertions, 22 deletions
diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx
index 5c225a951dbd..f7e1fd11a3f0 100644
--- a/ucb/source/ucp/gio/gio_content.cxx
+++ b/ucb/source/ucp/gio/gio_content.cxx
@@ -296,14 +296,14 @@ css::uno::Any Content::mapGIOError( GError *pError )
if (!pError)
return getBadArgExcept();
- return convertToException(pError, static_cast< cppu::OWeakObject * >(this), false);
+ return convertToException(pError, getXWeak(), false);
}
css::uno::Any Content::getBadArgExcept()
{
return css::uno::Any( css::lang::IllegalArgumentException(
"Wrong argument type!",
- static_cast< cppu::OWeakObject * >( this ), -1) );
+ getXWeak(), -1) );
}
namespace {
@@ -681,7 +681,7 @@ css::uno::Sequence< css::uno::Any > Content::setPropertyValues(
sal_Int32 nCount = rValues.getLength();
css::beans::PropertyChangeEvent aEvent;
- aEvent.Source = static_cast< cppu::OWeakObject * >( this );
+ aEvent.Source = getXWeak();
aEvent.Further = false;
aEvent.PropertyHandle = -1;
@@ -704,7 +704,7 @@ css::uno::Sequence< css::uno::Any > Content::setPropertyValues(
rValue.Name == "Size" ||
rValue.Name == "CreatableContentsInfo" )
{
- aRetRange[ n ] <<= getReadOnlyException( static_cast< cppu::OWeakObject * >(this) );
+ aRetRange[ n ] <<= getReadOnlyException( getXWeak() );
}
else if ( rValue.Name == "Title" )
{
@@ -712,7 +712,7 @@ css::uno::Sequence< css::uno::Any > Content::setPropertyValues(
{
aRetRange[ n ] <<= css::beans::IllegalTypeException
( "Property value has wrong type!",
- static_cast< cppu::OWeakObject * >( this ) );
+ getXWeak() );
continue;
}
@@ -720,7 +720,7 @@ css::uno::Sequence< css::uno::Any > Content::setPropertyValues(
{
aRetRange[ n ] <<= css::lang::IllegalArgumentException
( "Empty title not allowed!",
- static_cast< cppu::OWeakObject * >( this ), -1 );
+ getXWeak(), -1 );
continue;
}
@@ -746,7 +746,7 @@ css::uno::Sequence< css::uno::Any > Content::setPropertyValues(
else
{
SAL_WARN("ucb.ucp.gio", "Unknown property " << rValue.Name);
- aRetRange[ n ] <<= getReadOnlyException( static_cast< cppu::OWeakObject * >(this) );
+ aRetRange[ n ] <<= getReadOnlyException( getXWeak() );
}
}
@@ -778,7 +778,7 @@ css::uno::Sequence< css::uno::Any > Content::setPropertyValues(
{
aRetRange[ nTitlePos ] <<= css::uno::Exception
( "Exchange failed!",
- static_cast< cppu::OWeakObject * >( this ) );
+ getXWeak() );
}
}
@@ -855,7 +855,7 @@ bool Content::feedSink( const css::uno::Reference< css::uno::XInterface >& xSink
GError *pError=nullptr;
GFileInputStream *pStream = g_file_read(getGFile(), nullptr, &pError);
if (!pStream)
- convertToException(pError, static_cast< cppu::OWeakObject * >(this));
+ convertToException(pError, getXWeak());
css::uno::Reference< css::io::XInputStream > xIn(
new comphelper::OSeekableInputWrapper(
@@ -880,7 +880,7 @@ css::uno::Any Content::open(const css::ucb::OpenCommandArgument2 & rOpenCommand,
css::uno::Sequence< css::uno::Any > aArgs{ css::uno::Any(
m_xIdentifier->getContentIdentifier()) };
css::uno::Any aErr(
- css::ucb::InteractiveAugmentedIOException(OUString(), static_cast< cppu::OWeakObject * >( this ),
+ css::ucb::InteractiveAugmentedIOException(OUString(), getXWeak(),
css::task::InteractionClassification_ERROR,
bIsFolder ? css::ucb::IOErrorCode_NOT_EXISTING_PATH : css::ucb::IOErrorCode_NOT_EXISTING, aArgs)
);
@@ -911,7 +911,7 @@ css::uno::Any Content::open(const css::ucb::OpenCommandArgument2 & rOpenCommand,
{
ucbhelper::cancelCommandExecution(
css::uno::Any ( css::ucb::UnsupportedOpenModeException
- ( OUString(), static_cast< cppu::OWeakObject * >( this ),
+ ( OUString(), getXWeak(),
sal_Int16( rOpenCommand.Mode ) ) ),
xEnv );
}
@@ -925,7 +925,7 @@ css::uno::Any Content::open(const css::ucb::OpenCommandArgument2 & rOpenCommand,
ucbhelper::cancelCommandExecution(
css::uno::Any (css::ucb::UnsupportedDataSinkException
- ( OUString(), static_cast< cppu::OWeakObject * >( this ),
+ ( OUString(), getXWeak(),
rOpenCommand.Sink ) ),
xEnv );
}
@@ -1016,7 +1016,7 @@ css::uno::Any SAL_CALL Content::execute(
ucbhelper::cancelCommandExecution
( css::uno::Any( css::ucb::UnsupportedCommandException
( OUString(),
- static_cast< cppu::OWeakObject * >( this ) ) ),
+ getXWeak() ) ),
xEnv );
}
@@ -1058,7 +1058,7 @@ void Content::insert(const css::uno::Reference< css::io::XInputStream > &xInputS
{
ucbhelper::cancelCommandExecution( css::uno::Any
( css::ucb::MissingInputStreamException
- ( OUString(), static_cast< cppu::OWeakObject * >( this ) ) ),
+ ( OUString(), getXWeak() ) ),
xEnv );
}
diff --git a/ucb/source/ucp/gio/gio_inputstream.cxx b/ucb/source/ucp/gio/gio_inputstream.cxx
index c6df4572b55e..5d07586ec66f 100644
--- a/ucb/source/ucp/gio/gio_inputstream.cxx
+++ b/ucb/source/ucp/gio/gio_inputstream.cxx
@@ -76,7 +76,7 @@ sal_Int32 SAL_CALL InputStream::readBytes( css::uno::Sequence< sal_Int8 >& aData
gsize nBytesRead = 0;
GError *pError=nullptr;
if (!g_input_stream_read_all(G_INPUT_STREAM(mpStream), aData.getArray(), nBytesToRead, &nBytesRead, nullptr, &pError))
- convertToIOException(pError, static_cast< cppu::OWeakObject * >(this));
+ convertToIOException(pError, getXWeak());
aData.realloc(nBytesRead);
return nBytesRead;
}
diff --git a/ucb/source/ucp/gio/gio_outputstream.cxx b/ucb/source/ucp/gio/gio_outputstream.cxx
index 1f334f4df8d8..0da373c0df5d 100644
--- a/ucb/source/ucp/gio/gio_outputstream.cxx
+++ b/ucb/source/ucp/gio/gio_outputstream.cxx
@@ -46,7 +46,7 @@ void SAL_CALL OutputStream::writeBytes( const css::uno::Sequence< sal_Int8 >& rD
GError *pError=nullptr;
if (!g_output_stream_write_all(G_OUTPUT_STREAM(mpStream), rData.getConstArray(), rData.getLength(), nullptr, nullptr, &pError))
- convertToIOException(pError, static_cast< cppu::OWeakObject * >(this));
+ convertToIOException(pError, getXWeak());
}
void SAL_CALL OutputStream::flush()
@@ -56,7 +56,7 @@ void SAL_CALL OutputStream::flush()
GError *pError=nullptr;
if (!g_output_stream_flush(G_OUTPUT_STREAM(mpStream), nullptr, &pError))
- convertToIOException(pError, static_cast< cppu::OWeakObject * >(this));
+ convertToIOException(pError, getXWeak());
}
void SAL_CALL OutputStream::closeOutput()
diff --git a/ucb/source/ucp/gio/gio_seekable.cxx b/ucb/source/ucp/gio/gio_seekable.cxx
index 1f1da5948d8c..a04185225603 100644
--- a/ucb/source/ucp/gio/gio_seekable.cxx
+++ b/ucb/source/ucp/gio/gio_seekable.cxx
@@ -46,11 +46,11 @@ void SAL_CALL Seekable::truncate()
if (!g_seekable_can_truncate(mpStream))
throw css::io::IOException("Truncate unsupported",
- static_cast< cppu::OWeakObject * >(this));
+ getXWeak());
GError *pError=nullptr;
if (!g_seekable_truncate(mpStream, 0, nullptr, &pError))
- convertToIOException(pError, static_cast< cppu::OWeakObject * >(this));
+ convertToIOException(pError, getXWeak());
}
void SAL_CALL Seekable::seek( sal_Int64 location )
@@ -60,11 +60,11 @@ void SAL_CALL Seekable::seek( sal_Int64 location )
if (!g_seekable_can_seek(mpStream))
throw css::io::IOException("Seek unsupported",
- static_cast< cppu::OWeakObject * >(this));
+ getXWeak());
GError *pError=nullptr;
if (!g_seekable_seek(mpStream, location, G_SEEK_SET, nullptr, &pError))
- convertToIOException(pError, static_cast< cppu::OWeakObject * >(this));
+ convertToIOException(pError, getXWeak());
}
sal_Int64 SAL_CALL Seekable::getPosition()
@@ -102,7 +102,7 @@ sal_Int64 SAL_CALL Seekable::getLength()
GError *pError=nullptr;
sal_Int64 nCurr = getPosition();
if (!g_seekable_seek(mpStream, 0, G_SEEK_END, nullptr, &pError))
- convertToIOException(pError, static_cast< cppu::OWeakObject * >(this));
+ convertToIOException(pError, getXWeak());
nSize = getPosition();
seek(nCurr);
}