diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-01-08 11:04:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-01-08 13:31:29 +0100 |
commit | 87f0786156105ef721af069c636b7814a7a39abc (patch) | |
tree | 550b18a7c1f320ce36e727f329d2a1d219aac41c /connectivity/source/drivers/ado/AResultSetMetaData.cxx | |
parent | 7957123a144bfe66a99aa0d30a47900b6b621a70 (diff) |
Fix uses of OTools::get/putValue with string arguments
...after 723a2623bd11c51d506873862893ee4009caaab1 "Use string view here". My
clang-cl build's
> connectivity/source/drivers/ado/AColumn.cxx(164,62): error: implicit conversion of constant &u"Autoincrement"[0] of type 'const char16_t *' to 'bool'; use 'true' instead [loplugin:consttobool]
> OTools::putValue(m_aColumn.get_Properties(), u"Autoincrement", getBOOL(rValue));
> ^~~~~~~~~~~~~~~~
> connectivity/source/drivers/ado/AColumn.cxx(239,62): error: implicit conversion of constant &u"Autoincrement"[0] of type 'const char16_t *' to 'bool'; use 'true' instead [loplugin:consttobool]
> m_IsAutoIncrement = OTools::getValue(aProps, u"Autoincrement").getBool();
> ^~~~~~~~~~~~~~~~
etc. revealed that those arguments were now silently picking the
OLEVariant(bool) overload.
Change-Id: I83f0d790591d6be9b84fb6263747085dc7bd94d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108962
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity/source/drivers/ado/AResultSetMetaData.cxx')
-rw-r--r-- | connectivity/source/drivers/ado/AResultSetMetaData.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/connectivity/source/drivers/ado/AResultSetMetaData.cxx b/connectivity/source/drivers/ado/AResultSetMetaData.cxx index 34fe539e14a2..e64c1c45b6e9 100644 --- a/connectivity/source/drivers/ado/AResultSetMetaData.cxx +++ b/connectivity/source/drivers/ado/AResultSetMetaData.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <ado/AResultSetMetaData.hxx> #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/ColumnValue.hpp> @@ -84,7 +88,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isCaseSensitive( sal_Int32 column ) { WpADOProperties aProps( aField.get_Properties() ); if ( aProps.IsValid() ) - bRet = OTools::getValue(aProps, u"ISCASESENSITIVE").getBool(); + bRet = OTools::getValue(aProps, std::u16string_view(u"ISCASESENSITIVE")).getBool(); } return bRet; } @@ -114,7 +118,8 @@ OUString SAL_CALL OResultSetMetaData::getTableName( sal_Int32 column ) { WpADOProperties aProps( aField.get_Properties() ); if ( aProps.IsValid() ) - sTableName = OTools::getValue(aProps, u"BASETABLENAME").getString(); + sTableName + = OTools::getValue(aProps, std::u16string_view(u"BASETABLENAME")).getString(); } return sTableName; } @@ -160,7 +165,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isAutoIncrement( sal_Int32 column ) WpADOProperties aProps( aField.get_Properties() ); if ( aProps.IsValid() ) { - bRet = OTools::getValue(aProps, u"ISAUTOINCREMENT").getBool(); + bRet = OTools::getValue(aProps, std::u16string_view(u"ISAUTOINCREMENT")).getBool(); } } return bRet; |