loplugin:singlevalfields in ucbhelper

Change-Id: I738bda6e6e161fb5ea96bd496a21ccf72680cd7f
Reviewed-on: https://gerrit.libreoffice.org/26604
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin
2016-06-23 15:58:08 +02:00
committed by Noel Grandin
parent 1506b14a7e
commit 29bea29ec1
8 changed files with 23 additions and 163 deletions

View File

@@ -39,35 +39,30 @@ SimpleFileAccessInteraction::SimpleFileAccessInteraction(
aInterceptedRequest.Handle = HANDLE_INTERACTIVEIOEXCEPTION;
aInterceptedRequest.Request <<= css::ucb::InteractiveIOException();
aInterceptedRequest.Continuation = cppu::UnoType<css::task::XInteractionAbort>::get();
aInterceptedRequest.MatchExact = false;
lInterceptions.push_back(aInterceptedRequest);
//intercept internal error
aInterceptedRequest.Handle = HANDLE_UNSUPPORTEDDATASINKEXCEPTION;
aInterceptedRequest.Request <<= css::ucb::UnsupportedDataSinkException();
aInterceptedRequest.Continuation = cppu::UnoType<css::task::XInteractionAbort>::get();
aInterceptedRequest.MatchExact = false;
lInterceptions.push_back(aInterceptedRequest);
//intercept network error exception (WebDAV ucp provider)
aInterceptedRequest.Handle = HANDLE_INTERACTIVENETWORKEXCEPTION;
aInterceptedRequest.Request <<= css::ucb::InteractiveNetworkException();
aInterceptedRequest.Continuation = cppu::UnoType<css::task::XInteractionAbort>::get();
aInterceptedRequest.MatchExact = false;
lInterceptions.push_back(aInterceptedRequest);
//intercept certificate validation request (WebDAV ucp provider)
aInterceptedRequest.Handle = HANDLE_CERTIFICATEREQUEST;
aInterceptedRequest.Request <<= css::ucb::CertificateValidationRequest();
aInterceptedRequest.Continuation = cppu::UnoType<css::task::XInteractionAbort>::get();
aInterceptedRequest.MatchExact = false;
lInterceptions.push_back(aInterceptedRequest);
//intercept authentication request (WebDAV ucp provider)
aInterceptedRequest.Handle = HANDLE_AUTHENTICATIONREQUEST;
aInterceptedRequest.Request <<= css::ucb::AuthenticationRequest();
aInterceptedRequest.Continuation = cppu::UnoType<css::task::XInteractionApprove>::get();
aInterceptedRequest.MatchExact = false;
lInterceptions.push_back(aInterceptedRequest);
setInterceptedHandler(xHandler);

View File

@@ -44,19 +44,16 @@ StillReadWriteInteraction::StillReadWriteInteraction(const css::uno::Reference<
aInterceptedRequest.Handle = HANDLE_INTERACTIVEIOEXCEPTION;
aInterceptedRequest.Request <<= css::ucb::InteractiveIOException();
aInterceptedRequest.Continuation = cppu::UnoType<css::task::XInteractionAbort>::get();
aInterceptedRequest.MatchExact = false;
lInterceptions.push_back(aInterceptedRequest);
aInterceptedRequest.Handle = HANDLE_UNSUPPORTEDDATASINKEXCEPTION;
aInterceptedRequest.Request <<= css::ucb::UnsupportedDataSinkException();
aInterceptedRequest.Continuation = cppu::UnoType<css::task::XInteractionAbort>::get();
aInterceptedRequest.MatchExact = false;
lInterceptions.push_back(aInterceptedRequest);
aInterceptedRequest.Handle = HANDLE_AUTHENTICATIONREQUESTEXCEPTION;
aInterceptedRequest.Request <<= css::ucb::AuthenticationRequest();
aInterceptedRequest.Continuation = cppu::UnoType<css::task::XInteractionApprove>::get();
aInterceptedRequest.MatchExact = false;
lInterceptions.push_back(aInterceptedRequest);
setInterceptedHandler(xHandler);

View File

@@ -346,7 +346,6 @@ class UCBHELPER_DLLPUBLIC InteractionSupplyAuthentication :
bool m_bCanSetPassword : 1;
bool m_bCanSetAccount : 1;
bool m_bCanUseSystemCredentials : 1;
bool m_bDefaultUseSystemCredentials : 1;
bool m_bUseSystemCredentials : 1;
public:
@@ -530,7 +529,6 @@ inline InteractionSupplyAuthentication::InteractionSupplyAuthentication(
m_bCanSetPassword( bCanSetPassword ),
m_bCanSetAccount( bCanSetAccount ),
m_bCanUseSystemCredentials( bCanUseSystemCredentials ),
m_bDefaultUseSystemCredentials( false ),
m_bUseSystemCredentials( false )
{
}

View File

@@ -64,23 +64,6 @@ class UCBHELPER_DLLPUBLIC InterceptedInteraction : public ::cppu::WeakImplHelper
css::uno::Type Continuation;
/** @short specify, if both interactions must have the same type
or can be derived from.
@descr Interaction base on exceptions - and exceptions are real types.
So they can be checked in its type. These parameter "MatchExact"
influence the type-check in the following way:
TRUE => the exception will be intercepted only
if it supports exactly the same type ...
or
FALSE => derived exceptions will be intercepted too.
@attention This parameter does not influence the check of the continuation
type! The continuation must be matched exactly every time ...
*/
bool MatchExact;
/** @short its an unique identifier, which must be managed by the outside code.
@descr If there is a derived class, which overwrites the InterceptedInteraction::intercepted()
@@ -98,7 +81,6 @@ class UCBHELPER_DLLPUBLIC InterceptedInteraction : public ::cppu::WeakImplHelper
*/
InterceptedRequest()
{
MatchExact = false;
Handle = INVALID_HANDLE;
}

View File

@@ -57,18 +57,6 @@ struct ResultSetColumnData
/** @see ResultSetMetaData::isCaseSensitive */
bool isCaseSensitive;
/** @see ResultSetMetaData::isSearchable */
bool isSearchable;
/** @see ResultSetMetaData::isCurrency */
bool isCurrency;
/** @see ResultSetMetaData::isNullable */
sal_Int32 isNullable;
/** @see ResultSetMetaData::isSigned */
bool isSigned;
/** @see ResultSetMetaData::getColumnDisplaySize */
sal_Int32 columnDisplaySize;
@@ -78,12 +66,6 @@ struct ResultSetColumnData
/** @see ResultSetMetaData::getSchemaName */
OUString schemaName;
/** @see ResultSetMetaData::getPrecision */
sal_Int32 precision;
/** @see ResultSetMetaData::getScale */
sal_Int32 scale;
/** @see ResultSetMetaData::getTableName */
OUString tableName;
@@ -93,15 +75,6 @@ struct ResultSetColumnData
/** @see ResultSetMetaData::getColumnTypeName */
OUString columnTypeName;
/** @see ResultSetMetaData::isReadOnly */
bool isReadOnly;
/** @see ResultSetMetaData::isWritable */
bool isWritable;
/** @see ResultSetMetaData::isDefinitelyWritable */
bool isDefinitelyWritable;
/** @see ResultSetMetaData::getColumnServiceName */
OUString columnServiceName;
@@ -114,16 +87,7 @@ struct ResultSetColumnData
ResultSetColumnData::ResultSetColumnData()
: isAutoIncrement( false ),
isCaseSensitive( true ),
isSearchable( false ),
isCurrency( false ),
isNullable( css::sdbc::ColumnValue::NULLABLE ),
isSigned( false ),
columnDisplaySize( 16 ),
precision( -1 ),
scale( 0 ),
isReadOnly( true ),
isWritable( false ),
isDefinitelyWritable( false )
columnDisplaySize( 16 )
{
}
@@ -145,7 +109,6 @@ private:
protected:
css::uno::Reference< css::uno::XComponentContext > m_xContext;
css::uno::Sequence< css::beans::Property > m_aProps;
bool m_bReadOnly;
public:

View File

@@ -115,11 +115,7 @@ InterceptedInteraction::EInterceptionState InterceptedInteraction::impl_intercep
css::uno::Type aInterceptedType = rInterception.Request.getValueType();
// check the request
bool bMatch = false;
if (rInterception.MatchExact)
bMatch = aInterceptedType.equals(aRequestType);
else
bMatch = aInterceptedType.isAssignableFrom(aRequestType); // don't change intercepted and request type here -> it will check the wrong direction!
bool bMatch = aInterceptedType.isAssignableFrom(aRequestType); // don't change intercepted and request type here -> it will check the wrong direction!
// intercepted ...
// Call they might existing derived class, so they can handle that by its own.

View File

@@ -758,7 +758,7 @@ InteractionSupplyAuthentication::canUseSystemCredentials(
sal_Bool& Default )
throw ( uno::RuntimeException, std::exception )
{
Default = m_bDefaultUseSystemCredentials;
Default = false;
return m_bCanUseSystemCredentials;
}

View File

@@ -83,8 +83,7 @@ ResultSetMetaData::ResultSetMetaData(
const Sequence< Property >& rProps )
: m_pImpl( new ResultSetMetaData_Impl( rProps.getLength() ) ),
m_xContext( rxContext ),
m_aProps( rProps ),
m_bReadOnly( true )
m_aProps( rProps )
{
}
@@ -95,8 +94,7 @@ ResultSetMetaData::ResultSetMetaData(
const std::vector< ResultSetColumnData >& rColumnData )
: m_pImpl( new ResultSetMetaData_Impl( rColumnData ) ),
m_xContext( rxContext ),
m_aProps( rProps ),
m_bReadOnly( true )
m_aProps( rProps )
{
OSL_ENSURE( rColumnData.size() == sal_uInt32( rProps.getLength() ),
"ResultSetMetaData ctor - different array sizes!" );
@@ -180,64 +178,34 @@ sal_Bool SAL_CALL ResultSetMetaData::isCaseSensitive( sal_Int32 column )
// virtual
sal_Bool SAL_CALL ResultSetMetaData::isSearchable( sal_Int32 column )
sal_Bool SAL_CALL ResultSetMetaData::isSearchable( sal_Int32 /*column*/ )
throw( SQLException, RuntimeException, std::exception )
{
/*
Checks whether the value stored in column can be used in a
WHERE clause.
*/
if ( ( column < 1 ) || ( column > m_aProps.getLength() ) )
return false;
return m_pImpl->m_aColumnData[ column - 1 ].isSearchable;
return false;
}
// virtual
sal_Bool SAL_CALL ResultSetMetaData::isCurrency( sal_Int32 column )
sal_Bool SAL_CALL ResultSetMetaData::isCurrency( sal_Int32 /*column*/ )
throw( SQLException, RuntimeException, std::exception )
{
/*
Checks whether column is a cash value.
*/
if ( ( column < 1 ) || ( column > m_aProps.getLength() ) )
return false;
return m_pImpl->m_aColumnData[ column - 1 ].isCurrency;
return false;
}
// virtual
sal_Int32 SAL_CALL ResultSetMetaData::isNullable( sal_Int32 column )
sal_Int32 SAL_CALL ResultSetMetaData::isNullable( sal_Int32 /*column*/ )
throw( SQLException, RuntimeException, std::exception )
{
/*
Checks whether a NULL can be stored in column.
Possible values: see com/sun/star/sdbc/ColumnValue.idl
*/
if ( ( column < 1 ) || ( column > m_aProps.getLength() ) )
return ColumnValue::NULLABLE;
return m_pImpl->m_aColumnData[ column - 1 ].isNullable;
return ColumnValue::NULLABLE;
}
// virtual
sal_Bool SAL_CALL ResultSetMetaData::isSigned( sal_Int32 column )
sal_Bool SAL_CALL ResultSetMetaData::isSigned( sal_Int32 /*column*/ )
throw( SQLException, RuntimeException, std::exception )
{
/*
Checks whether the value stored in column is a signed number.
*/
if ( ( column < 1 ) || ( column > m_aProps.getLength() ) )
return false;
return m_pImpl->m_aColumnData[ column - 1 ].isSigned;
return false;
}
@@ -310,37 +278,18 @@ OUString SAL_CALL ResultSetMetaData::getSchemaName( sal_Int32 column )
// virtual
sal_Int32 SAL_CALL ResultSetMetaData::getPrecision( sal_Int32 column )
sal_Int32 SAL_CALL ResultSetMetaData::getPrecision( sal_Int32 /*column*/ )
throw( SQLException, RuntimeException, std::exception )
{
/*
For number types, getprecision gets the number of decimal digits
in column.
For character types, it gets the maximum length in characters for
column.
For binary types, it gets the maximum length in bytes for column.
*/
if ( ( column < 1 ) || ( column > m_aProps.getLength() ) )
return -1;
return m_pImpl->m_aColumnData[ column - 1 ].precision;
return -1;
}
// virtual
sal_Int32 SAL_CALL ResultSetMetaData::getScale( sal_Int32 column )
sal_Int32 SAL_CALL ResultSetMetaData::getScale( sal_Int32 /*column*/ )
throw( SQLException, RuntimeException, std::exception )
{
/*
Gets the number of digits to the right of the decimal point for
values in column.
*/
if ( ( column < 1 ) || ( column > m_aProps.getLength() ) )
return 0;
return m_pImpl->m_aColumnData[ column - 1 ].scale;
return 0;
}
@@ -507,46 +456,26 @@ OUString SAL_CALL ResultSetMetaData::getColumnTypeName( sal_Int32 column )
// virtual
sal_Bool SAL_CALL ResultSetMetaData::isReadOnly( sal_Int32 column )
sal_Bool SAL_CALL ResultSetMetaData::isReadOnly( sal_Int32 /*column*/ )
throw( SQLException, RuntimeException, std::exception )
{
if ( m_pImpl->m_bGlobalReadOnlyValue )
return m_bReadOnly;
if ( ( column < 1 ) || ( column > m_aProps.getLength() ) )
return true;
// autoincrement==true => readonly
return m_pImpl->m_aColumnData[ column - 1 ].isAutoIncrement ||
m_pImpl->m_aColumnData[ column - 1 ].isReadOnly;
return true;
}
// virtual
sal_Bool SAL_CALL ResultSetMetaData::isWritable( sal_Int32 column )
sal_Bool SAL_CALL ResultSetMetaData::isWritable( sal_Int32 /*column*/ )
throw( SQLException, RuntimeException, std::exception )
{
if ( m_pImpl->m_bGlobalReadOnlyValue )
return !m_bReadOnly;
if ( ( column < 1 ) || ( column > m_aProps.getLength() ) )
return false;
return m_pImpl->m_aColumnData[ column - 1 ].isWritable;
return false;
}
// virtual
sal_Bool SAL_CALL ResultSetMetaData::isDefinitelyWritable( sal_Int32 column )
sal_Bool SAL_CALL ResultSetMetaData::isDefinitelyWritable( sal_Int32 /*column*/ )
throw( SQLException, RuntimeException, std::exception )
{
if ( m_pImpl->m_bGlobalReadOnlyValue )
return !m_bReadOnly;
if ( ( column < 1 ) || ( column > m_aProps.getLength() ) )
return false;
return m_pImpl->m_aColumnData[ column - 1 ].isDefinitelyWritable;
return false;
}