diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-10-21 17:39:31 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-28 06:39:11 +0000 |
commit | 5d3c37b99e8bfa9256f12015152439bf4e5ebbb4 (patch) | |
tree | 30bbd261fe0ebdfd1f0779a5e27c64208595f5ea | |
parent | 604c6cf42f1d136e5c076b4ae17bec86e7e1a206 (diff) |
sw: remove SwDBTreeList_Impl::m_aConnections
... which actually does nothing since commit
fca027b0bd76a76b50f4d6d667d2d479417a74a6 but was dutifully converted to
a boost::ptr_vector.
Change-Id: I69186d6ba7d90fb2f94b417fede3a907811c32c0
Reviewed-on: https://gerrit.libreoffice.org/19518
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | sw/inc/dbmgr.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/dbui/dbmgr.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/dbui/dbtree.cxx | 27 |
3 files changed, 4 insertions, 27 deletions
diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx index c2a94f0444d4..4c0fe4005690 100644 --- a/sw/inc/dbmgr.hxx +++ b/sw/inc/dbmgr.hxx @@ -310,7 +310,7 @@ public: /** create and store or find an already stored connection to a data source for use in SwFieldMgr and SwDBTreeList */ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> - RegisterConnection(OUString& rSource); + RegisterConnection(OUString const& rSource); const SwDSParam* CreateDSData(const SwDBData& rData) {return FindDSData(rData, true);} diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 0c763ab817e3..f65903d132f0 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -2293,7 +2293,7 @@ bool SwDBManager::OpenDataSource(const OUString& rDataSource, const OUString& rT return pFound->xResultSet.is(); } -uno::Reference< sdbc::XConnection> SwDBManager::RegisterConnection(OUString& rDataSource) +uno::Reference< sdbc::XConnection> SwDBManager::RegisterConnection(OUString const& rDataSource) { SwDSParam* pFound = SwDBManager::FindDSConnection(rDataSource, true); uno::Reference< sdbc::XDataSource> xSource; diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx index 65b098c86090..4ddad2a74939 100644 --- a/sw/source/uibase/dbui/dbtree.cxx +++ b/sw/source/uibase/dbui/dbtree.cxx @@ -50,7 +50,6 @@ #include <unomid.h> -#include <boost/ptr_container/ptr_vector.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -68,12 +67,9 @@ struct SwConnectionData Reference<XConnection> xConnection; }; -typedef boost::ptr_vector<SwConnectionData> SwConnectionArr; - class SwDBTreeList_Impl : public cppu::WeakImplHelper < XContainerListener > { Reference< XDatabaseContext > m_xDatabaseContext; - SwConnectionArr m_aConnections; SwWrtShell* m_pWrtShell; public: @@ -119,14 +115,6 @@ void SwDBTreeList_Impl::elementRemoved( const ContainerEvent& rEvent ) throw (Ru SolarMutexGuard aGuard; OUString sSource; rEvent.Accessor >>= sSource; - for(SwConnectionArr::iterator i = m_aConnections.begin(); i != m_aConnections.end(); ++i) - { - if(i->sSourceName == sSource) - { - m_aConnections.erase(i); - break; - } - } } void SwDBTreeList_Impl::disposing( const EventObject& ) throw (RuntimeException, std::exception) @@ -153,20 +141,9 @@ bool SwDBTreeList_Impl::HasContext() Reference<XConnection> SwDBTreeList_Impl::GetConnection(const OUString& rSourceName) { Reference<XConnection> xRet; - for(SwConnectionArr::const_iterator i = m_aConnections.begin(); i != m_aConnections.end(); ++i) - { - if(i->sSourceName == rSourceName) - { - xRet = i->xConnection; - break; - } - } - if(!xRet.is() && m_xDatabaseContext.is() && m_pWrtShell) + if (m_xDatabaseContext.is() && m_pWrtShell) { - SwConnectionData* pPtr = new SwConnectionData(); - pPtr->sSourceName = rSourceName; - xRet = m_pWrtShell->GetDBManager()->RegisterConnection(pPtr->sSourceName); - m_aConnections.push_back(pPtr); + xRet = m_pWrtShell->GetDBManager()->RegisterConnection(rSourceName); } return xRet; } |