xref: /aoo42x/main/sw/source/ui/dbui/dbtree.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sw.hxx"
30 
31 // INCLUDE ---------------------------------------------------------------
32 
33 
34 #include <sot/formats.hxx>
35 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
36 #include <com/sun/star/container/XNameAccess.hpp>
37 #include <com/sun/star/sdbc/XDataSource.hpp>
38 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
39 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
40 #include <com/sun/star/sdb/XQueriesSupplier.hpp>
41 #include <com/sun/star/sdb/XDatabaseAccess.hpp>
42 #include <com/sun/star/sdb/CommandType.hpp>
43 #include <com/sun/star/beans/XPropertySet.hpp>
44 #include <comphelper/processfactory.hxx>
45 #include <com/sun/star/sdb/XCompletedConnection.hpp>
46 #include <com/sun/star/container/XContainerListener.hpp>
47 #include <com/sun/star/container/XContainer.hpp>
48 #include <cppuhelper/implbase1.hxx>
49 #include <svx/dbaexchange.hxx>
50 
51 #ifndef _DBMGR_HXX
52 #include <dbmgr.hxx>
53 #endif
54 #include <swmodule.hxx>
55 #ifndef _VIEW_HXX
56 #include <view.hxx>
57 #endif
58 #include <wrtsh.hxx>
59 #include <dbtree.hxx>
60 #include <vos/mutex.hxx>
61 #include <vcl/svapp.hxx>
62 
63 #ifndef _HELPID_H
64 #include <helpid.h>
65 #endif
66 #ifndef _UTLUI_HRC
67 #include <utlui.hrc>
68 #endif
69 
70 #include <unomid.h>
71 
72 using namespace ::com::sun::star;
73 using namespace ::com::sun::star::uno;
74 using namespace ::com::sun::star::container;
75 using namespace ::com::sun::star::lang;
76 using namespace ::com::sun::star::sdb;
77 using namespace ::com::sun::star::sdbc;
78 using namespace ::com::sun::star::sdbcx;
79 using namespace ::com::sun::star::task;
80 using namespace ::com::sun::star::beans;
81 
82 /* -----------------------------17.07.01 13:10--------------------------------
83 
84  ---------------------------------------------------------------------------*/
85 struct SwConnectionData
86 {
87     ::rtl::OUString                sSourceName;
88     Reference<XConnection>  xConnection;
89 };
90 
91 typedef SwConnectionData* SwConnectionDataPtr;
92 SV_DECL_PTRARR_DEL( SwConnectionArr, SwConnectionDataPtr, 32, 32 )
93 SV_IMPL_PTRARR( SwConnectionArr, SwConnectionDataPtr )
94 /* -----------------------------17.07.01 13:24--------------------------------
95 
96  ---------------------------------------------------------------------------*/
97 class SwDBTreeList_Impl : public cppu::WeakImplHelper1 < XContainerListener >
98 {
99     Reference< XNameAccess > xDBContext;
100     SwConnectionArr aConnections;
101     SwWrtShell* pWrtSh;
102 
103     public:
104         SwDBTreeList_Impl(SwWrtShell* pShell) :
105             pWrtSh(pShell) {}
106         ~SwDBTreeList_Impl();
107 
108     virtual void SAL_CALL elementInserted( const ContainerEvent& Event ) throw (RuntimeException);
109     virtual void SAL_CALL elementRemoved( const ContainerEvent& Event ) throw (RuntimeException);
110     virtual void SAL_CALL elementReplaced( const ContainerEvent& Event ) throw (RuntimeException);
111     virtual void SAL_CALL disposing( const EventObject& Source ) throw (RuntimeException);
112 
113     sal_Bool                        HasContext();
114     SwWrtShell*                 GetWrtShell() { return pWrtSh;}
115     void                        SetWrtShell(SwWrtShell& rSh) { pWrtSh = &rSh;}
116     Reference< XNameAccess >    GetContext() {return xDBContext;}
117     Reference<XConnection>      GetConnection(const rtl::OUString& rSourceName);
118 };
119 /* -----------------------------17.07.01 13:24--------------------------------
120 
121  ---------------------------------------------------------------------------*/
122 SwDBTreeList_Impl::~SwDBTreeList_Impl()
123 {
124     Reference<XContainer> xContainer(xDBContext, UNO_QUERY);
125     if(xContainer.is())
126     {
127         m_refCount++;
128         //block necessary due to solaris' compiler behaviour to
129         //remove temporaries at the block's end
130         {
131             xContainer->removeContainerListener( this );
132         }
133         m_refCount--;
134     }
135 }
136 /* -----------------------------17.07.01 13:24--------------------------------
137 
138  ---------------------------------------------------------------------------*/
139 void SwDBTreeList_Impl::elementInserted( const ContainerEvent&  ) throw (RuntimeException)
140 {
141     // information not needed
142 }
143 /* -----------------------------17.07.01 13:24--------------------------------
144 
145  ---------------------------------------------------------------------------*/
146 void SwDBTreeList_Impl::elementRemoved( const ContainerEvent& rEvent ) throw (RuntimeException)
147 {
148     vos::OGuard aGuard(Application::GetSolarMutex());
149     ::rtl::OUString sSource;
150     rEvent.Accessor >>= sSource;
151     for(sal_uInt16 i = 0; i < aConnections.Count(); i++)
152     {
153         SwConnectionDataPtr pPtr = aConnections[i];
154         if(pPtr->sSourceName == sSource)
155         {
156 //            SwConnectionDataPtr pPtr = aConnections[i];
157 //            Reference<XComponent> xComp(pPtr->xConnection, UNO_QUERY);
158 //            if(xComp.is())
159 //                xComp->dispose();
160             aConnections.DeleteAndDestroy(i);
161             break;
162         }
163     }
164 }
165 /* -----------------------------17.07.01 13:24--------------------------------
166 
167  ---------------------------------------------------------------------------*/
168 void SwDBTreeList_Impl::disposing( const EventObject&  ) throw (RuntimeException)
169 {
170     xDBContext = 0;
171 }
172 /* -----------------------------17.07.01 13:24--------------------------------
173 
174  ---------------------------------------------------------------------------*/
175 void SwDBTreeList_Impl::elementReplaced( const ContainerEvent& rEvent ) throw (RuntimeException)
176 {
177     elementRemoved(rEvent);
178 }
179 /* -----------------------------17.07.01 13:24--------------------------------
180 
181  ---------------------------------------------------------------------------*/
182 sal_Bool SwDBTreeList_Impl::HasContext()
183 {
184     if(!xDBContext.is())
185     {
186         Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
187         if( xMgr.is() )
188         {
189             Reference<XInterface> xInstance = xMgr->createInstance(
190                         C2U( "com.sun.star.sdb.DatabaseContext" ));
191             xDBContext = Reference<XNameAccess>(xInstance, UNO_QUERY) ;
192             Reference<XContainer> xContainer(xDBContext, UNO_QUERY);
193             if(xContainer.is())
194                 xContainer->addContainerListener( this );
195         }
196         DBG_ASSERT(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available");
197     }
198     return xDBContext.is();
199 }
200 /* -----------------------------17.07.01 13:24--------------------------------
201 
202  ---------------------------------------------------------------------------*/
203 Reference<XConnection>  SwDBTreeList_Impl::GetConnection(const rtl::OUString& rSourceName)
204 {
205     Reference<XConnection>  xRet;
206     for(sal_uInt16 i = 0; i < aConnections.Count(); i++)
207     {
208         SwConnectionDataPtr pPtr = aConnections[i];
209         if(pPtr->sSourceName == rSourceName)
210         {
211             xRet = pPtr->xConnection;
212             break;
213         }
214     }
215     if(!xRet.is() && xDBContext.is() && pWrtSh)
216     {
217         SwConnectionDataPtr pPtr = new SwConnectionData();
218         pPtr->sSourceName = rSourceName;
219         xRet = pWrtSh->GetNewDBMgr()->RegisterConnection(pPtr->sSourceName);
220         aConnections.Insert(pPtr, aConnections.Count());
221     }
222     return xRet;
223 }
224 /*------------------------------------------------------------------------
225  Beschreibung:
226 ------------------------------------------------------------------------*/
227 SwDBTreeList::SwDBTreeList(Window *pParent, const ResId& rResId,
228                         SwWrtShell* pSh,
229                         const String& rDefDBName, const sal_Bool bShowCol):
230 
231 	SvTreeListBox	(pParent, rResId),
232     aImageList      (SW_RES(ILIST_DB_DLG    )),
233     aImageListHC    (SW_RES(ILIST_DB_DLG_HC )),
234 	sDefDBName		(rDefDBName),
235     bInitialized    (sal_False),
236 	bShowColumns	(bShowCol),
237     pImpl(new SwDBTreeList_Impl(pSh))
238 {
239 	SetHelpId(HID_DB_SELECTION_TLB);
240 
241 	if (IsVisible())
242 		InitTreeList();
243 }
244 
245 /*------------------------------------------------------------------------
246  Beschreibung:
247 ------------------------------------------------------------------------*/
248 SwDBTreeList::~SwDBTreeList()
249 {
250     delete pImpl;
251 }
252 
253 /*------------------------------------------------------------------------
254  Beschreibung:
255 ------------------------------------------------------------------------*/
256 
257 
258 void SwDBTreeList::InitTreeList()
259 {
260     if(!pImpl->HasContext() && pImpl->GetWrtShell())
261 		return;
262 	SetSelectionMode(SINGLE_SELECTION);
263 	SetStyle(GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
264 	// Font nicht setzen, damit der Font des Controls uebernommen wird!
265 	SetSpaceBetweenEntries(0);
266     SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE),
267                     aImageList.GetImage(IMG_EXPAND  ), BMP_COLOR_NORMAL );
268     SetNodeBitmaps( aImageListHC.GetImage(IMG_COLLAPSE),
269                     aImageListHC.GetImage(IMG_EXPAND  ), BMP_COLOR_HIGHCONTRAST );
270 
271 	SetDragDropMode(SV_DRAGDROP_APP_COPY);
272 
273 	GetModel()->SetCompareHdl(LINK(this, SwDBTreeList, DBCompare));
274 
275     Sequence< ::rtl::OUString > aDBNames = pImpl->GetContext()->getElementNames();
276     const ::rtl::OUString* pDBNames = aDBNames.getConstArray();
277 	long nCount = aDBNames.getLength();
278 
279     Image aImg = aImageList.GetImage(IMG_DB);
280     Image aHCImg = aImageListHC.GetImage(IMG_DB);
281     for(long i = 0; i < nCount; i++)
282 	{
283 		String sDBName(pDBNames[i]);
284         SvLBoxEntry* pEntry = InsertEntry(sDBName, aImg, aImg, NULL, sal_True);
285         SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
286         SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
287 	}
288 	String sDBName(sDefDBName.GetToken(0, DB_DELIM));
289 	String sTableName(sDefDBName.GetToken(1, DB_DELIM));
290 	String sColumnName(sDefDBName.GetToken(2, DB_DELIM));
291 	Select(sDBName, sTableName, sColumnName);
292 
293 
294 	bInitialized = sal_True;
295 }
296 /*-- 27.05.2004 09:19:09---------------------------------------------------
297 
298   -----------------------------------------------------------------------*/
299 void    SwDBTreeList::AddDataSource(const String& rSource)
300 {
301     Image aImg = aImageList.GetImage(IMG_DB);
302     Image aHCImg = aImageListHC.GetImage(IMG_DB);
303     SvLBoxEntry* pEntry = InsertEntry(rSource, aImg, aImg, NULL, sal_True);
304     SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
305     SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
306     SvTreeListBox::Select(pEntry);
307 }
308 /*------------------------------------------------------------------------
309  Beschreibung:
310 ------------------------------------------------------------------------*/
311 
312 void SwDBTreeList::ShowColumns(sal_Bool bShowCol)
313 {
314 	if (bShowCol != bShowColumns)
315 	{
316 		bShowColumns = bShowCol;
317 		String sTableName, sColumnName;
318 		String  sDBName(GetDBName(sTableName, sColumnName));
319 
320 		SetUpdateMode(sal_False);
321 
322 		SvLBoxEntry* pEntry = First();
323 
324 		while (pEntry)
325 		{
326 			pEntry = (SvLBoxEntry*)GetRootLevelParent( pEntry );
327 			Collapse(pEntry);		// zuklappen
328 
329 			SvLBoxEntry* pChild;
330 			while ((pChild = FirstChild(pEntry)) != 0L)
331 				GetModel()->Remove(pChild);
332 
333 			pEntry = Next(pEntry);
334 		}
335 
336 		if (sDBName.Len())
337 		{
338 			Select(sDBName, sTableName, sColumnName);	// force RequestingChilds
339 		}
340 		SetUpdateMode(sal_True);
341 	}
342 }
343 
344 /*------------------------------------------------------------------------
345  Beschreibung:
346 ------------------------------------------------------------------------*/
347 
348 void  SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent)
349 {
350 	if (!pParent->HasChilds())
351 	{
352 		if (GetParent(pParent))	// column names
353 		{
354             try
355             {
356 
357                 String sSourceName = GetEntryText(GetParent(pParent));
358                 String sTableName = GetEntryText(pParent);
359 
360                 if(!pImpl->GetContext()->hasByName(sSourceName))
361                     return;
362                 Reference<XConnection> xConnection = pImpl->GetConnection(sSourceName);
363                 sal_Bool bTable = pParent->GetUserData() == 0;
364                 Reference<XColumnsSupplier> xColsSupplier;
365                 if(bTable)
366                 {
367                     Reference<XTablesSupplier> xTSupplier = Reference<XTablesSupplier>(xConnection, UNO_QUERY);
368                     if(xTSupplier.is())
369                     {
370                         Reference<XNameAccess> xTbls = xTSupplier->getTables();
371                         DBG_ASSERT(xTbls->hasByName(sTableName), "table not available anymore?");
372                         try
373                         {
374                             Any aTable = xTbls->getByName(sTableName);
375                             Reference<XPropertySet> xPropSet;
376                             aTable >>= xPropSet;
377                             xColsSupplier = Reference<XColumnsSupplier>(xPropSet, UNO_QUERY);
378                         }
379                         catch(Exception&)
380                         {}
381                     }
382                 }
383                 else
384                 {
385                     Reference<XQueriesSupplier> xQSupplier = Reference<XQueriesSupplier>(xConnection, UNO_QUERY);
386                     if(xQSupplier.is())
387                     {
388                         Reference<XNameAccess> xQueries = xQSupplier->getQueries();
389                         DBG_ASSERT(xQueries->hasByName(sTableName), "table not available anymore?");
390                         try
391                         {
392                             Any aQuery = xQueries->getByName(sTableName);
393                             Reference<XPropertySet> xPropSet;
394                             aQuery >>= xPropSet;
395                             xColsSupplier = Reference<XColumnsSupplier>(xPropSet, UNO_QUERY);
396                         }
397                         catch(Exception&)
398                         {}
399                     }
400                 }
401 
402                 if(xColsSupplier.is())
403                 {
404                     Reference <XNameAccess> xCols = xColsSupplier->getColumns();
405                     Sequence< ::rtl::OUString> aColNames = xCols->getElementNames();
406                     const ::rtl::OUString* pColNames = aColNames.getConstArray();
407                     long nCount = aColNames.getLength();
408                     for (long i = 0; i < nCount; i++)
409                     {
410                         String sName = pColNames[i];
411                         if(bTable)
412                             InsertEntry(sName, pParent);
413                         else
414                             InsertEntry(sName, pParent);
415                     }
416                 }
417             }
418             catch(const Exception&)
419             {
420             }
421 		}
422 		else	// Tabellennamen
423 		{
424             try
425             {
426                 String sSourceName = GetEntryText(pParent);
427                 if(!pImpl->GetContext()->hasByName(sSourceName))
428                     return;
429                 Reference<XConnection> xConnection = pImpl->GetConnection(sSourceName);
430                 if (xConnection.is())
431                 {
432                     Reference<XTablesSupplier> xTSupplier = Reference<XTablesSupplier>(xConnection, UNO_QUERY);
433                     if(xTSupplier.is())
434                     {
435                         Reference<XNameAccess> xTbls = xTSupplier->getTables();
436                         Sequence< ::rtl::OUString> aTblNames = xTbls->getElementNames();
437                         String sTableName;
438                         long nCount = aTblNames.getLength();
439                         const ::rtl::OUString* pTblNames = aTblNames.getConstArray();
440                         Image aImg = aImageList.GetImage(IMG_DBTABLE);
441                         Image aHCImg = aImageListHC.GetImage(IMG_DBTABLE);
442                         for (long i = 0; i < nCount; i++)
443                         {
444                             sTableName = pTblNames[i];
445                             SvLBoxEntry* pTableEntry = InsertEntry(sTableName, aImg, aImg, pParent, bShowColumns);
446                             //to discriminate between queries and tables the user data of table entries is set
447                             pTableEntry->SetUserData((void*)0);
448                             SetExpandedEntryBmp(pTableEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
449                             SetCollapsedEntryBmp(pTableEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
450                         }
451                     }
452 
453                     Reference<XQueriesSupplier> xQSupplier = Reference<XQueriesSupplier>(xConnection, UNO_QUERY);
454                     if(xQSupplier.is())
455                     {
456                         Reference<XNameAccess> xQueries = xQSupplier->getQueries();
457                         Sequence< ::rtl::OUString> aQueryNames = xQueries->getElementNames();
458                         String sQueryName;
459                         long nCount = aQueryNames.getLength();
460                         const ::rtl::OUString* pQueryNames = aQueryNames.getConstArray();
461                         Image aImg = aImageList.GetImage(IMG_DBQUERY);
462                         Image aHCImg = aImageListHC.GetImage(IMG_DBQUERY);
463                         for (long i = 0; i < nCount; i++)
464                         {
465                             sQueryName = pQueryNames[i];
466                             SvLBoxEntry* pQueryEntry = InsertEntry(sQueryName, aImg, aImg, pParent, bShowColumns);
467                             pQueryEntry->SetUserData((void*)1);
468                             SetExpandedEntryBmp(pQueryEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
469                             SetCollapsedEntryBmp( pQueryEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
470                         }
471                     }
472                 }
473             }
474             catch(const Exception&)
475             {
476             }
477         }
478 	}
479 }
480 
481 /*------------------------------------------------------------------------
482  Beschreibung:
483 ------------------------------------------------------------------------*/
484 
485 IMPL_LINK( SwDBTreeList, DBCompare, SvSortData*, pData )
486 {
487 	SvLBoxEntry* pRight = (SvLBoxEntry*)(pData->pRight );
488 
489 	if (GetParent(pRight) && GetParent(GetParent(pRight)))
490 		return COMPARE_GREATER;	// Spaltennamen nicht sortieren
491 
492 	return DefaultCompare(pData);	// Sonst Basisklasse rufen
493 }
494 
495 /*------------------------------------------------------------------------
496  Beschreibung:
497 ------------------------------------------------------------------------*/
498 
499 String  SwDBTreeList::GetDBName(String& rTableName, String& rColumnName, sal_Bool* pbIsTable)
500 {
501 	String sDBName;
502 	SvLBoxEntry* pEntry = FirstSelected();
503 
504 	if (pEntry && GetParent(pEntry))
505 	{
506 		if (GetParent(GetParent(pEntry)))
507 		{
508 			rColumnName = GetEntryText(pEntry);
509 			pEntry = GetParent(pEntry);	// Spaltenname war selektiert
510 		}
511 		sDBName = GetEntryText(GetParent(pEntry));
512 		if(pbIsTable)
513 		{
514             *pbIsTable = pEntry->GetUserData() == 0;
515 		}
516 		rTableName = GetEntryText(pEntry);
517 	}
518 	return sDBName;
519 }
520 
521 /*------------------------------------------------------------------------
522  Beschreibung:	Format: Datenbank.Tabelle
523 ------------------------------------------------------------------------*/
524 
525 
526 void SwDBTreeList::Select(const String& rDBName, const String& rTableName, const String& rColumnName)
527 {
528 	SvLBoxEntry* pParent;
529 	SvLBoxEntry* pChild;
530 	sal_uInt16 nParent = 0;
531 	sal_uInt16 nChild = 0;
532 
533 	while ((pParent = GetEntry(nParent++)) != NULL)
534 	{
535 		if (rDBName == GetEntryText(pParent))
536 		{
537 			if (!pParent->HasChilds())
538 				RequestingChilds(pParent);
539 			while ((pChild = GetEntry(pParent, nChild++)) != NULL)
540 			{
541 				if (rTableName == GetEntryText(pChild))
542 				{
543 					pParent = pChild;
544 
545 					if (bShowColumns && rColumnName.Len())
546 					{
547 						nChild = 0;
548 
549 						if (!pParent->HasChilds())
550 							RequestingChilds(pParent);
551 
552 						while ((pChild = GetEntry(pParent, nChild++)) != NULL)
553 							if (rColumnName == GetEntryText(pChild))
554 								break;
555 					}
556 					if (!pChild)
557 						pChild = pParent;
558 
559 					MakeVisible(pChild);
560 					SvTreeListBox::Select(pChild);
561 					return;
562 				}
563 			}
564 		}
565 	}
566 }
567 
568 /*------------------------------------------------------------------------
569  Beschreibung:
570 ------------------------------------------------------------------------*/
571 
572 void SwDBTreeList::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ )
573 {
574 	String sTableName, sColumnName;
575 	String  sDBName( GetDBName( sTableName, sColumnName ));
576 	if( sDBName.Len() )
577 	{
578 		TransferDataContainer* pContainer = new TransferDataContainer;
579 		STAR_REFERENCE( datatransfer::XTransferable ) xRef( pContainer );
580 		if( sColumnName.Len() )
581 		{
582 			// Datenbankfeld draggen
583 			svx::OColumnTransferable aColTransfer(
584 							sDBName
585 							,::rtl::OUString()
586                             , sdb::CommandType::TABLE
587 							,sTableName
588 							, sColumnName
589 							,(CTF_FIELD_DESCRIPTOR |CTF_COLUMN_DESCRIPTOR ));
590 			aColTransfer.addDataToContainer( pContainer );
591 		}
592 
593 		sDBName += '.';
594 		sDBName += sTableName;
595 		if( sColumnName.Len() )
596 		{
597 			sDBName += '.';
598 			sDBName += sColumnName;
599 		}
600 
601 		pContainer->CopyString( FORMAT_STRING, sDBName );
602 		pContainer->StartDrag( this, DND_ACTION_COPY | DND_ACTION_LINK,
603 								Link() );
604 	}
605 }
606 
607 /*------------------------------------------------------------------------
608  Beschreibung:
609 ------------------------------------------------------------------------*/
610 sal_Int8 SwDBTreeList::AcceptDrop( const AcceptDropEvent& /*rEvt*/ )
611 {
612 	return DND_ACTION_NONE;
613 }
614 /*-- 07.10.2003 13:28:22---------------------------------------------------
615 
616   -----------------------------------------------------------------------*/
617 void    SwDBTreeList::SetWrtShell(SwWrtShell& rSh)
618 {
619     pImpl->SetWrtShell(rSh);
620     if (IsVisible() && !bInitialized)
621         InitTreeList();
622 }
623