summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sw/inc/dbmgr.hxx2
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx2
-rw-r--r--sw/source/uibase/dbui/dbtree.cxx27
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;
}