summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/webdav-neon
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-26 12:01:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-27 09:05:39 +0200
commit467724410dc470ec259131f97abd836fe9b021a1 (patch)
treec4af76c0132cc6a4638eace0ccebe5ae1bd9e305 /ucb/source/ucp/webdav-neon
parente827d227c92c338fb75f076b6d3f3a7b52b9f767 (diff)
loplugin:flatten in toolkit..vbahelper
Change-Id: I6d4be3e1cc29b2b91d5c39b757ff3b903c47112d Reviewed-on: https://gerrit.libreoffice.org/42794 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb/source/ucp/webdav-neon')
-rw-r--r--ucb/source/ucp/webdav-neon/NeonInputStream.cxx6
-rw-r--r--ucb/source/ucp/webdav-neon/webdavcontent.cxx71
2 files changed, 38 insertions, 39 deletions
diff --git a/ucb/source/ucp/webdav-neon/NeonInputStream.cxx b/ucb/source/ucp/webdav-neon/NeonInputStream.cxx
index 6958ad90ea3c..3e43456a1838 100644
--- a/ucb/source/ucp/webdav-neon/NeonInputStream.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonInputStream.cxx
@@ -117,10 +117,10 @@ void SAL_CALL NeonInputStream::seek( sal_Int64 location )
if ( location < 0 )
throw css::lang::IllegalArgumentException();
- if ( location <= mLen )
- mPos = location;
- else
+ if ( location > mLen )
throw css::lang::IllegalArgumentException();
+
+ mPos = location;
}
sal_Int64 SAL_CALL NeonInputStream::getPosition()
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index cc381283dd98..c49caa3d8367 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -2553,53 +2553,52 @@ void Content::insert(
if ( Environment.is() )
xIH = Environment->getInteractionHandler();
- if ( xIH.is() )
+ if ( !xIH.is() )
{
- uno::Any aExAsAny( uno::makeAny( aEx ) );
+ // No IH; throw.
+ throw aEx;
+ }
- rtl::Reference< ucbhelper::SimpleInteractionRequest > xRequest
- = new ucbhelper::SimpleInteractionRequest(
- aExAsAny,
- ContinuationFlags::Approve | ContinuationFlags::Disapprove );
- xIH->handle( xRequest.get() );
+ uno::Any aExAsAny( uno::makeAny( aEx ) );
- const ContinuationFlags nResp = xRequest->getResponse();
+ rtl::Reference< ucbhelper::SimpleInteractionRequest > xRequest
+ = new ucbhelper::SimpleInteractionRequest(
+ aExAsAny,
+ ContinuationFlags::Approve | ContinuationFlags::Disapprove );
+ xIH->handle( xRequest.get() );
- switch ( nResp )
- {
- case ContinuationFlags::NONE:
- // Not handled; throw.
- throw aEx;
+ const ContinuationFlags nResp = xRequest->getResponse();
+
+ switch ( nResp )
+ {
+ case ContinuationFlags::NONE:
+ // Not handled; throw.
+ throw aEx;
// break;
- case ContinuationFlags::Approve:
- // Continue -> Overwrite.
- bReplaceExisting = true;
- break;
+ case ContinuationFlags::Approve:
+ // Continue -> Overwrite.
+ bReplaceExisting = true;
+ break;
- case ContinuationFlags::Disapprove:
- // Abort.
- throw ucb::CommandFailedException(
- OUString(),
- uno::Reference< uno::XInterface >(),
- aExAsAny );
+ case ContinuationFlags::Disapprove:
+ // Abort.
+ throw ucb::CommandFailedException(
+ OUString(),
+ uno::Reference< uno::XInterface >(),
+ aExAsAny );
// break;
- default:
- SAL_WARN( "ucb.ucp.webdav", "Content::insert - "
- "Unknown interaction selection!" );
- throw ucb::CommandFailedException(
- "Unknown interaction selection!",
- uno::Reference< uno::XInterface >(),
- aExAsAny );
+ default:
+ SAL_WARN( "ucb.ucp.webdav", "Content::insert - "
+ "Unknown interaction selection!" );
+ throw ucb::CommandFailedException(
+ "Unknown interaction selection!",
+ uno::Reference< uno::XInterface >(),
+ aExAsAny );
// break;
- }
- }
- else
- {
- // No IH; throw.
- throw aEx;
}
+
}
}