[Libreoffice-commits] core.git: 2 commits - ucb/source
Michael Stahl
mstahl at redhat.com
Thu Sep 10 08:45:36 PDT 2015
ucb/source/ucp/file/bc.cxx | 12 +++++-------
ucb/source/ucp/file/filinsreq.cxx | 20 ++++++++------------
ucb/source/ucp/file/filinsreq.hxx | 24 +++++++-----------------
ucb/source/ucp/ftp/ftpcontent.cxx | 8 ++++----
ucb/source/ucp/ftp/ftpintreq.cxx | 26 ++++++++------------------
ucb/source/ucp/ftp/ftpintreq.hxx | 19 +++++++------------
6 files changed, 39 insertions(+), 70 deletions(-)
New commits:
commit 0a94746db12fbab5c30c1009912ee910b9f20553
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Sep 10 17:40:45 2015 +0200
ucb: fix another duplicate WeakImplHelper<XInteractionRequest>
Change-Id: I0728601cd7abd8f8d718728d5983aed94355bdc0
diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx
index 442fe1d..c150284a 100644
--- a/ucb/source/ucp/ftp/ftpcontent.cxx
+++ b/ucb/source/ucp/ftp/ftpcontent.cxx
@@ -803,10 +803,10 @@ void FTPContent::insert(const InsertCommandArgument& aInsertCommand,
ucbhelper::cancelCommandExecution(aAny,Env);
}
- XInteractionRequestImpl* p = new XInteractionRequestImpl;
- Reference<XInteractionRequest> req(p);
- xInt->handle(req);
- if(p->approved()) {
+ XInteractionRequestImpl request;
+ Reference<XInteractionRequest> xReq(request.getRequest());
+ xInt->handle(xReq);
+ if (request.approved()) {
bReplace = true;
goto retry;
}
diff --git a/ucb/source/ucp/ftp/ftpintreq.cxx b/ucb/source/ucp/ftp/ftpintreq.cxx
index 55f51d3..4cb1c9be 100644
--- a/ucb/source/ucp/ftp/ftpintreq.cxx
+++ b/ucb/source/ucp/ftp/ftpintreq.cxx
@@ -18,9 +18,12 @@
*/
+#include "ftpintreq.hxx"
+
+#include <comphelper/interaction.hxx>
+
#include <com/sun/star/ucb/UnsupportedNameClashException.hpp>
#include <com/sun/star/ucb/NameClash.hpp>
-#include "ftpintreq.hxx"
using namespace cppu;
using namespace com::sun::star;
@@ -65,28 +68,15 @@ void SAL_CALL XInteractionDisapproveImpl::select()
XInteractionRequestImpl::XInteractionRequestImpl()
: p1( new XInteractionApproveImpl )
, p2( new XInteractionDisapproveImpl )
- , m_aSeq( 2 )
-{
- m_aSeq[0] = Reference<XInteractionContinuation>(p1);
- m_aSeq[1] = Reference<XInteractionContinuation>(p2);
-}
-
-Any SAL_CALL XInteractionRequestImpl::getRequest( )
- throw (RuntimeException,
- std::exception)
{
+ uno::Sequence<uno::Reference<task::XInteractionContinuation>> continuations{
+ Reference<XInteractionContinuation>(p1),
+ Reference<XInteractionContinuation>(p2) };
Any aAny;
UnsupportedNameClashException excep;
excep.NameClash = NameClash::ERROR;
aAny <<= excep;
- return aAny;
-}
-
-Sequence<Reference<XInteractionContinuation > > SAL_CALL XInteractionRequestImpl::getContinuations()
- throw (RuntimeException,
- std::exception)
-{
- return m_aSeq;
+ m_xRequest.set(new ::comphelper::OInteractionRequest(aAny, continuations));
}
bool XInteractionRequestImpl::approved() const
diff --git a/ucb/source/ucp/ftp/ftpintreq.hxx b/ucb/source/ucp/ftp/ftpintreq.hxx
index ce8d8fa..3bab88b 100644
--- a/ucb/source/ucp/ftp/ftpintreq.hxx
+++ b/ucb/source/ucp/ftp/ftpintreq.hxx
@@ -71,30 +71,25 @@ namespace ftp {
- class XInteractionRequestImpl : public cppu::WeakImplHelper<
- css::task::XInteractionRequest >
+ class XInteractionRequestImpl
{
public:
XInteractionRequestImpl();
- com::sun::star::uno::Any SAL_CALL getRequest( )
- throw (css::uno::RuntimeException,
- std::exception) SAL_OVERRIDE;
-
- css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > SAL_CALL
- getContinuations( )
- throw (css::uno::RuntimeException,
- std::exception) SAL_OVERRIDE;
-
bool approved() const;
+ css::uno::Reference<css::task::XInteractionRequest> const& getRequest() const
+ {
+ return m_xRequest;
+ }
+
private:
XInteractionApproveImpl* p1;
XInteractionDisapproveImpl* p2;
- css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > m_aSeq;
+ css::uno::Reference<css::task::XInteractionRequest> m_xRequest;
};
}
commit 67f4626d079678e125f74fe0897d86341cda272d
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Sep 10 17:21:45 2015 +0200
ucb: fix mergedlib duplicate WeakImplHelper<XInteractionRequest>
Change-Id: I0666bb38e43240a0cbd972a141ecc36573c2ad6a
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index 86127c6..9debd71 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -1208,19 +1208,17 @@ void SAL_CALL BaseContent::insert( sal_Int32 nMyCommandIdentifier,
if( success )
break;
- XInteractionRequestImpl *aRequestImpl =
- new XInteractionRequestImpl(
+ XInteractionRequestImpl aRequestImpl(
rtl::Uri::decode(
getTitle(m_aUncPath),
rtl_UriDecodeWithCharset,
RTL_TEXTENCODING_UTF8),
static_cast<cppu::OWeakObject*>(this),
m_pMyShell,nMyCommandIdentifier);
- uno::Reference< task::XInteractionRequest > aReq( aRequestImpl );
+ uno::Reference<task::XInteractionRequest> const xReq(aRequestImpl.getRequest());
- m_pMyShell->handleTask( nMyCommandIdentifier,aReq );
- if( aRequestImpl->aborted() ||
- aRequestImpl->newName().isEmpty() )
+ m_pMyShell->handleTask( nMyCommandIdentifier, xReq );
+ if (aRequestImpl.aborted() || aRequestImpl.newName().isEmpty())
// means aborting
break;
@@ -1230,7 +1228,7 @@ void SAL_CALL BaseContent::insert( sal_Int32 nMyCommandIdentifier,
if( !m_aUncPath.endsWith( "/" ) )
m_aUncPath += "/";
- m_aUncPath += rtl::Uri::encode( aRequestImpl->newName(),
+ m_aUncPath += rtl::Uri::encode( aRequestImpl.newName(),
rtl_UriCharClassPchar,
rtl_UriEncodeIgnoreEscapes,
RTL_TEXTENCODING_UTF8 );
diff --git a/ucb/source/ucp/file/filinsreq.cxx b/ucb/source/ucp/file/filinsreq.cxx
index a2eb970..e6466b9 100644
--- a/ucb/source/ucp/file/filinsreq.cxx
+++ b/ucb/source/ucp/file/filinsreq.cxx
@@ -20,6 +20,9 @@
#include "filinsreq.hxx"
#include "shell.hxx"
#include "filglob.hxx"
+
+#include <comphelper/interaction.hxx>
+
#include <com/sun/star/ucb/IOErrorCode.hpp>
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
#include <com/sun/star/ucb/NameClashException.hpp>
@@ -45,21 +48,14 @@ XInteractionRequestImpl::XInteractionRequestImpl(
p2( new XInteractionAbortImpl ),
m_nErrorCode(0),
m_nMinorError(0),
- m_aSeq( 2 ),
m_aClashingName(aClashingName),
m_xOrigin(xOrigin)
{
if( pShell )
pShell->retrieveError(CommandId,m_nErrorCode,m_nMinorError);
- m_aSeq[0] = Reference<XInteractionContinuation>(p1);
- m_aSeq[1] = Reference<XInteractionContinuation>(p2);
-}
-
-
-Any SAL_CALL
-XInteractionRequestImpl::getRequest()
- throw(RuntimeException, std::exception)
-{
+ uno::Sequence<uno::Reference<task::XInteractionContinuation>> continuations{
+ Reference<XInteractionContinuation>(p1),
+ Reference<XInteractionContinuation>(p2) };
Any aAny;
if(m_nErrorCode == TASKHANDLING_FOLDER_EXISTS_MKDIR)
{
@@ -67,7 +63,7 @@ XInteractionRequestImpl::getRequest()
excep.Name = m_aClashingName;
excep.Classification = InteractionClassification_ERROR;
excep.Context = m_xOrigin;
- excep.Message = "folder exists and overwritte forbidden";
+ excep.Message = "folder exists and overwrite forbidden";
aAny <<= excep;
}
else if(m_nErrorCode == TASKHANDLING_INVALID_NAME_MKDIR)
@@ -87,7 +83,7 @@ XInteractionRequestImpl::getRequest()
aAny <<= excep;
}
- return aAny;
+ m_xRequest.set(new ::comphelper::OInteractionRequest(aAny, continuations));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/file/filinsreq.hxx b/ucb/source/ucp/file/filinsreq.hxx
index 8f6ad6b..5e14287 100644
--- a/ucb/source/ucp/file/filinsreq.hxx
+++ b/ucb/source/ucp/file/filinsreq.hxx
@@ -104,8 +104,7 @@ class XInteractionSupplyNameImpl : public cppu::WeakImplHelper<
- class XInteractionRequestImpl : public cppu::WeakImplHelper<
- css::task::XInteractionRequest >
+ class XInteractionRequestImpl
{
public:
@@ -116,18 +115,6 @@ class XInteractionSupplyNameImpl : public cppu::WeakImplHelper<
shell* pShell,
sal_Int32 CommandId);
- ::com::sun::star::uno::Any SAL_CALL getRequest( )
- throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-
- com::sun::star::uno::Sequence<
- com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > SAL_CALL
- getContinuations( )
- throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
- {
- return m_aSeq;
- }
-
bool aborted() const
{
return p2->isSelected();
@@ -141,15 +128,18 @@ class XInteractionSupplyNameImpl : public cppu::WeakImplHelper<
return OUString();
}
+ css::uno::Reference<css::task::XInteractionRequest> const& getRequest() const
+ {
+ return m_xRequest;
+ }
+
private:
XInteractionSupplyNameImpl* p1;
XInteractionAbortImpl* p2;
sal_Int32 m_nErrorCode,m_nMinorError;
- com::sun::star::uno::Sequence<
- com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > m_aSeq;
+ css::uno::Reference<css::task::XInteractionRequest> m_xRequest;
OUString m_aClashingName;
com::sun::star::uno::Reference<
More information about the Libreoffice-commits
mailing list