comphelper/source/streaming/memorystream.cxx | 4 +-- ucb/source/ucp/file/filrset.cxx | 6 ----- ucb/source/ucp/file/filrset.hxx | 29 --------------------------- ucb/source/ucp/file/filtask.cxx | 6 +++-- unoidl/source/legacyprovider.cxx | 1 unoidl/source/unoidlprovider.cxx | 1 6 files changed, 10 insertions(+), 37 deletions(-)
New commits: commit 83867d0947fe033693636a233b606d9a3372fbdc Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Jul 5 15:13:23 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Jul 6 08:23:55 2019 +0200 no need for XResultSet_impl to extend Notifier it never returns any kind of ContentEventNotifier Change-Id: I53d14378c3c70e4797782aa2c35602103c7cf813 Reviewed-on: https://gerrit.libreoffice.org/75139 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx index 9c3916844c1a..f9d1b8d503cd 100644 --- a/ucb/source/ucp/file/filrset.cxx +++ b/ucb/source/ucp/file/filrset.cxx @@ -75,15 +75,11 @@ XResultSet_impl::XResultSet_impl( TaskManager* pMyShell, } else m_nIsOpen = true; - - m_pMyShell->registerNotifier( m_aBaseDirectory,this ); } XResultSet_impl::~XResultSet_impl() { - m_pMyShell->deregisterNotifier( m_aBaseDirectory,this ); - if( m_nIsOpen ) m_aFolder.close(); } @@ -221,7 +217,7 @@ XResultSet_impl::OneMore() else if( err == osl::FileBase::E_None ) { if (!m_pMyShell->getv( - this, m_sProperty, aDirIte, aUnqPath, IsRegular, aRow )) + nullptr, m_sProperty, aDirIte, aUnqPath, IsRegular, aRow )) { SAL_WARN( "ucb.ucp.file", diff --git a/ucb/source/ucp/file/filrset.hxx b/ucb/source/ucp/file/filrset.hxx index 0c9f57acc1fb..82c1db908fd2 100644 --- a/ucb/source/ucp/file/filrset.hxx +++ b/ucb/source/ucp/file/filrset.hxx @@ -39,9 +39,7 @@ namespace fileaccess { -class Notifier; - -class XResultSet_impl : public Notifier, +class XResultSet_impl : public cppu::WeakImplHelper< css::lang::XEventListener, css::sdbc::XRow, css::sdbc::XResultSet, @@ -61,31 +59,6 @@ class XResultSet_impl : public Notifier, virtual ~XResultSet_impl() override; - virtual std::unique_ptr<ContentEventNotifier> cDEL() override - { - return nullptr; - } - - virtual std::unique_ptr<ContentEventNotifier> cEXC( const OUString& ) override - { - return nullptr; - } - - virtual std::unique_ptr<ContentEventNotifier> cCEL() override - { - return nullptr; - } - - virtual std::unique_ptr<PropertySetInfoChangeNotifier> cPSL() override - { - return nullptr; - } - - virtual std::unique_ptr<PropertyChangeNotifier> cPCL() override - { - return nullptr; - } - sal_Int32 CtorSuccess() { return m_nErrorCode;} sal_Int32 getMinorError() { return m_nMinorErrorCode;} diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx index bb47d6e653ba..db1e4ca19dda 100644 --- a/ucb/source/ucp/file/filtask.cxx +++ b/ucb/source/ucp/file/filtask.cxx @@ -2514,7 +2514,8 @@ TaskManager::getv( else aIsRegular = aFileStatus.getFileType() == osl::FileStatus::Regular; - registerNotifier( aUnqPath,pNotifier ); + if (pNotifier) + registerNotifier( aUnqPath,pNotifier ); insertDefaultProperties( aUnqPath ); { osl::MutexGuard aGuard( m_aMutex ); @@ -2533,7 +2534,8 @@ TaskManager::getv( return it1->getValue(); }); } - deregisterNotifier( aUnqPath,pNotifier ); + if (pNotifier) + deregisterNotifier( aUnqPath,pNotifier ); XRow_impl* p = new XRow_impl( this,seq ); row = uno::Reference< sdbc::XRow >( p ); commit ad1e790d76492ca4465114ad17e32912242db34f Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Jul 5 14:12:24 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Jul 6 08:23:35 2019 +0200 small optimisations In UNOMemoryStream (a) let the vector use it's natural grow strategy, so we avoid extending the vector by only the small amount we need now. (b) don't throw the vector storage away on truncate, we might need it soon In unoidl/ reserve some vector capacities. Change-Id: I6668a679e689d46d311a9e11eb3d0bc3395f3b6e Reviewed-on: https://gerrit.libreoffice.org/75136 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/comphelper/source/streaming/memorystream.cxx b/comphelper/source/streaming/memorystream.cxx index a4e713777a90..4477cd068188 100644 --- a/comphelper/source/streaming/memorystream.cxx +++ b/comphelper/source/streaming/memorystream.cxx @@ -197,7 +197,7 @@ void SAL_CALL UNOMemoryStream::writeBytes( const Sequence< sal_Int8 >& aData ) } if( static_cast< sal_Int32 >( nNewSize ) > static_cast< sal_Int32 >( maData.size() ) ) - maData.resize( static_cast< sal_Int32 >( nNewSize ) ); + maData.insert( maData.end(), nNewSize - maData.size(), 0 ); sal_Int8* pData = &(*maData.begin()); sal_Int8* pCursor = &(pData[mnCursor]); @@ -219,7 +219,7 @@ void SAL_CALL UNOMemoryStream::closeOutput() //XTruncate void SAL_CALL UNOMemoryStream::truncate() { - maData.resize( 0 ); + maData.clear(); mnCursor = 0; } diff --git a/unoidl/source/legacyprovider.cxx b/unoidl/source/legacyprovider.cxx index 35ebf8d417ce..8e517e986f67 100644 --- a/unoidl/source/legacyprovider.cxx +++ b/unoidl/source/legacyprovider.cxx @@ -300,6 +300,7 @@ rtl::Reference< Entity > readEntity( translateAnnotations(reader.getFieldDocumentation(j))); } std::vector< InterfaceTypeEntity::Method > meths; + meths.reserve(methodCount); for (sal_uInt16 j = 0; j != methodCount; ++j) { RTMethodMode flags = reader.getMethodFlags(j); if (flags != RTMethodMode::ATTRIBUTE_GET diff --git a/unoidl/source/unoidlprovider.cxx b/unoidl/source/unoidlprovider.cxx index 6685f1fe289a..bde4d74a6a12 100644 --- a/unoidl/source/unoidlprovider.cxx +++ b/unoidl/source/unoidlprovider.cxx @@ -1010,6 +1010,7 @@ rtl::Reference< Entity > readEntity( } offset += 4; std::vector< InterfaceTypeEntity::Method > meths; + meths.reserve(nMeths); for (sal_uInt32 i = 0; i != nMeths; ++i) { OUString methName(file->readIdxName(&offset)); checkEntityName(file, methName); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits