diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-09 15:52:14 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-10 09:16:53 +0100 |
commit | e3560f4770487c8d38463fb4a9a63325abc385f9 (patch) | |
tree | cc2ea6d5d18de966e4677ebfd846c1bf5ec5c216 /connectivity | |
parent | 77e3cb338f576757fd875bc60952ac22530f6a7a (diff) |
Replace deprecated boost::optional::reset(val) with operator =
Change-Id: I7340a561e0df0c781fd834388deb4b9f83800f9b
Reviewed-on: https://gerrit.libreoffice.org/63221
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/dbmetadata.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/Reader.cxx | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/connectivity/source/commontools/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx index afd77484c3ab..4f4aa1e09353 100644 --- a/connectivity/source/commontools/dbmetadata.cxx +++ b/connectivity/source/commontools/dbmetadata.cxx @@ -162,7 +162,7 @@ namespace dbtools lcl_checkConnected( _metaData ); try { - _cachedSetting.reset( (_metaData.xConnectionMetaData.get()->*_getter)() ); + _cachedSetting = (_metaData.xConnectionMetaData.get()->*_getter)(); } catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION("connectivity.commontools"); } } diff --git a/connectivity/source/drivers/jdbc/Reader.cxx b/connectivity/source/drivers/jdbc/Reader.cxx index ef5deeaac096..6d3b846f88f8 100644 --- a/connectivity/source/drivers/jdbc/Reader.cxx +++ b/connectivity/source/drivers/jdbc/Reader.cxx @@ -56,9 +56,9 @@ void SAL_CALL java_io_Reader::skipBytes( sal_Int32 nBytesToSkip ) if(nBytesToSkip <= 0) return; - if(m_buf != boost::none) + if(m_buf) { - m_buf = boost::none; + m_buf.reset(); --nBytesToSkip; } @@ -69,14 +69,14 @@ void SAL_CALL java_io_Reader::skipBytes( sal_Int32 nBytesToSkip ) { assert(nBytesToSkip % sizeof(jchar) == 1); Sequence< sal_Int8 > aData(1); - assert(m_buf == boost::none); + assert(m_buf); readBytes(aData, 1); } } sal_Int32 SAL_CALL java_io_Reader::available( ) { - if(m_buf != boost::none) + if(m_buf) return 1; jboolean out; SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java environment has been deleted!"); @@ -90,7 +90,7 @@ sal_Int32 SAL_CALL java_io_Reader::available( ) out = t.pEnv->CallBooleanMethod( object, mID); ThrowRuntimeException(t.pEnv,*this); } //t.pEnv - return (m_buf != boost::none ? 1 : 0) + (out ? 1 : 0); // no way to tell *how much* is ready + return (m_buf ? 1 : 0) + (out ? 1 : 0); // no way to tell *how much* is ready } void SAL_CALL java_io_Reader::closeInput( ) @@ -109,7 +109,7 @@ sal_Int32 SAL_CALL java_io_Reader::readBytes( css::uno::Sequence< sal_Int8 >& aD sal_Int8 *dst(aData.getArray()); sal_Int32 nBytesWritten(0); - if(m_buf != boost::none) + if (m_buf) { if(aData.getLength() == 0) { @@ -117,7 +117,7 @@ sal_Int32 SAL_CALL java_io_Reader::readBytes( css::uno::Sequence< sal_Int8 >& aD dst = aData.getArray(); } *dst = *m_buf; - m_buf = boost::none; + m_buf.reset(); ++nBytesWritten; ++dst; --nBytesToRead; @@ -166,7 +166,7 @@ sal_Int32 SAL_CALL java_io_Reader::readBytes( css::uno::Sequence< sal_Int8 >& aD if(outBytes < outChars*jcs) { assert(outChars*jcs - outBytes == 1); - assert(m_buf == boost::none); + assert(!m_buf); m_buf = reinterpret_cast<char*>(outBuf)[outBytes]; } } |