diff options
author | Noel Grandin <noel@peralex.com> | 2016-06-23 15:58:08 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-24 08:12:53 +0000 |
commit | 29bea29ec1a56255455f855e2b29321553cb524c (patch) | |
tree | fd09a463594fcb40275305a86cb64d91562b68f5 /ucbhelper/source | |
parent | 1506b14a7ed546c3e78625eaac667bdd5e60f57f (diff) |
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>
Diffstat (limited to 'ucbhelper/source')
-rw-r--r-- | ucbhelper/source/client/interceptedinteraction.cxx | 6 | ||||
-rw-r--r-- | ucbhelper/source/provider/interactionrequest.cxx | 2 | ||||
-rw-r--r-- | ucbhelper/source/provider/resultsetmetadata.cxx | 111 |
3 files changed, 22 insertions, 97 deletions
diff --git a/ucbhelper/source/client/interceptedinteraction.cxx b/ucbhelper/source/client/interceptedinteraction.cxx index fdd26ce72cc2..a03d6dcf8ef4 100644 --- a/ucbhelper/source/client/interceptedinteraction.cxx +++ b/ucbhelper/source/client/interceptedinteraction.cxx @@ -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. diff --git a/ucbhelper/source/provider/interactionrequest.cxx b/ucbhelper/source/provider/interactionrequest.cxx index 38c661b9bf94..79fc8706220a 100644 --- a/ucbhelper/source/provider/interactionrequest.cxx +++ b/ucbhelper/source/provider/interactionrequest.cxx @@ -758,7 +758,7 @@ InteractionSupplyAuthentication::canUseSystemCredentials( sal_Bool& Default ) throw ( uno::RuntimeException, std::exception ) { - Default = m_bDefaultUseSystemCredentials; + Default = false; return m_bCanUseSystemCredentials; } diff --git a/ucbhelper/source/provider/resultsetmetadata.cxx b/ucbhelper/source/provider/resultsetmetadata.cxx index b1b620f98eb6..0b84e84993d7 100644 --- a/ucbhelper/source/provider/resultsetmetadata.cxx +++ b/ucbhelper/source/provider/resultsetmetadata.cxx @@ -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; } |