Kaydet (Commit) 5d3c37b9 authored tarafından Michael Stahl's avatar Michael Stahl Kaydeden (comit) Noel Grandin

sw: remove SwDBTreeList_Impl::m_aConnections

... which actually does nothing since commit
fca027b0 but was dutifully converted to
a boost::ptr_vector.

Change-Id: I69186d6ba7d90fb2f94b417fede3a907811c32c0
Reviewed-on: https://gerrit.libreoffice.org/19518Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 604c6cf4
...@@ -310,7 +310,7 @@ public: ...@@ -310,7 +310,7 @@ public:
/** create and store or find an already stored connection to a data source for use /** create and store or find an already stored connection to a data source for use
in SwFieldMgr and SwDBTreeList */ in SwFieldMgr and SwDBTreeList */
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>
RegisterConnection(OUString& rSource); RegisterConnection(OUString const& rSource);
const SwDSParam* CreateDSData(const SwDBData& rData) const SwDSParam* CreateDSData(const SwDBData& rData)
{return FindDSData(rData, true);} {return FindDSData(rData, true);}
......
...@@ -2293,7 +2293,7 @@ bool SwDBManager::OpenDataSource(const OUString& rDataSource, const OUString& rT ...@@ -2293,7 +2293,7 @@ bool SwDBManager::OpenDataSource(const OUString& rDataSource, const OUString& rT
return pFound->xResultSet.is(); 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); SwDSParam* pFound = SwDBManager::FindDSConnection(rDataSource, true);
uno::Reference< sdbc::XDataSource> xSource; uno::Reference< sdbc::XDataSource> xSource;
......
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
#include <unomid.h> #include <unomid.h>
#include <boost/ptr_container/ptr_vector.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
...@@ -68,12 +67,9 @@ struct SwConnectionData ...@@ -68,12 +67,9 @@ struct SwConnectionData
Reference<XConnection> xConnection; Reference<XConnection> xConnection;
}; };
typedef boost::ptr_vector<SwConnectionData> SwConnectionArr;
class SwDBTreeList_Impl : public cppu::WeakImplHelper < XContainerListener > class SwDBTreeList_Impl : public cppu::WeakImplHelper < XContainerListener >
{ {
Reference< XDatabaseContext > m_xDatabaseContext; Reference< XDatabaseContext > m_xDatabaseContext;
SwConnectionArr m_aConnections;
SwWrtShell* m_pWrtShell; SwWrtShell* m_pWrtShell;
public: public:
...@@ -119,14 +115,6 @@ void SwDBTreeList_Impl::elementRemoved( const ContainerEvent& rEvent ) throw (Ru ...@@ -119,14 +115,6 @@ void SwDBTreeList_Impl::elementRemoved( const ContainerEvent& rEvent ) throw (Ru
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
OUString sSource; OUString sSource;
rEvent.Accessor >>= 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) void SwDBTreeList_Impl::disposing( const EventObject& ) throw (RuntimeException, std::exception)
...@@ -153,20 +141,9 @@ bool SwDBTreeList_Impl::HasContext() ...@@ -153,20 +141,9 @@ bool SwDBTreeList_Impl::HasContext()
Reference<XConnection> SwDBTreeList_Impl::GetConnection(const OUString& rSourceName) Reference<XConnection> SwDBTreeList_Impl::GetConnection(const OUString& rSourceName)
{ {
Reference<XConnection> xRet; Reference<XConnection> xRet;
for(SwConnectionArr::const_iterator i = m_aConnections.begin(); i != m_aConnections.end(); ++i) if (m_xDatabaseContext.is() && m_pWrtShell)
{
if(i->sSourceName == rSourceName)
{
xRet = i->xConnection;
break;
}
}
if(!xRet.is() && m_xDatabaseContext.is() && m_pWrtShell)
{ {
SwConnectionData* pPtr = new SwConnectionData(); xRet = m_pWrtShell->GetDBManager()->RegisterConnection(rSourceName);
pPtr->sSourceName = rSourceName;
xRet = m_pWrtShell->GetDBManager()->RegisterConnection(pPtr->sSourceName);
m_aConnections.push_back(pPtr);
} }
return xRet; return xRet;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment