1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: linkdlg.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
34 #ifdef SVX_DLLIMPLEMENTATION
35 #undef SVX_DLLIMPLEMENTATION
38 #include <linkdlg.hxx>
39 #include <vcl/svapp.hxx>
41 #include <tools/urlobj.hxx>
42 #include <svtools/svmedit.hxx>
43 #include <svtools/filedlg.hxx>
44 #include <vcl/dialog.hxx>
45 #include <vcl/button.hxx>
46 #include <vcl/fixed.hxx>
47 #include <vcl/group.hxx>
48 #include <vcl/lstbox.hxx>
49 #include <vcl/msgbox.hxx>
50 #include <vcl/timer.hxx>
51 #include <svtools/svtabbx.hxx>
53 #include <svuidlg.hrc>
54 #include <sfx2/linkmgr.hxx>
55 #include <sfx2/linksrc.hxx>
56 #include <svtools/soerr.hxx>
57 #include <sfx2/lnkbase.hxx>
58 #include <sfx2/objsh.hxx>
60 #include <svx/dialmgr.hxx>
62 #define _SVSTDARR_USHORTS
63 #include <svtools/svstdarr.hxx>
65 #define MAX_FILENAME 18
66 #define MAX_LINKNAME 18
67 #define MAX_TYPENAME 15
68 #define MAX_UPDATENAME 10
70 #define FILEOBJECT ( OBJECT_CLIENT_FILE & ~OBJECT_CLIENT_SO )
74 SV_DECL_IMPL_REF_LIST(SvBaseLink
,SvBaseLink
*)
76 // Achtung im Code wird dieses Array direkt (0, 1, ...) indiziert
78 { 4, // Number of Tabs
83 SvBaseLinksDlg::SvBaseLinksDlg( Window
* pParent
, SvLinkManager
* pMgr
, BOOL bHtml
)
84 : ModalDialog( pParent
, SVX_RES( MD_UPDATE_BASELINKS
) ),
85 aFtFiles( this, SVX_RES( FT_FILES
) ),
86 aFtLinks( this, SVX_RES( FT_LINKS
) ),
87 aFtType( this, SVX_RES( FT_TYPE
) ),
88 aFtStatus( this, SVX_RES( FT_STATUS
) ),
89 aCancelButton1( this, SVX_RES( 1 ) ),
90 aHelpButton1( this, SVX_RES( 1 ) ),
91 aPbUpdateNow( this, SVX_RES( PB_UPDATE_NOW
) ),
92 aPbOpenSource( this, SVX_RES( PB_OPEN_SOURCE
) ),
93 aPbChangeSource( this, SVX_RES( PB_CHANGE_SOURCE
) ),
94 aPbBreakLink( this, SVX_RES( PB_BREAK_LINK
) ),
95 aFtFiles2( this, SVX_RES( FT_FILES2
) ),
96 aFtSource2( this, SVX_RES( FT_SOURCE2
) ),
97 aFtType2( this, SVX_RES( FT_TYPE2
) ),
98 aFtUpdate( this, SVX_RES( FT_UPDATE
) ),
99 aRbAutomatic( this, SVX_RES( RB_AUTOMATIC
) ),
100 aRbManual( this, SVX_RES( RB_MANUAL
) ),
101 aFtFullFileName( this, SVX_RES( FT_FULL_FILE_NAME
) ),
102 aFtFullSourceName( this, SVX_RES( FT_FULL_SOURCE_NAME
) ),
103 aFtFullTypeName( this, SVX_RES( FT_FULL_TYPE_NAME
) ),
104 aStrAutolink( SVX_RES( STR_AUTOLINK
) ),
105 aStrManuallink( SVX_RES( STR_MANUALLINK
) ),
106 aStrBrokenlink( SVX_RES( STR_BROKENLINK
) ),
107 aStrGraphiclink( SVX_RES( STR_GRAPHICLINK
) ),
108 aStrButtonclose( SVX_RES( STR_BUTTONCLOSE
) ),
109 aStrCloselinkmsg( SVX_RES( STR_CLOSELINKMSG
) ),
110 aStrCloselinkmsgMulti( SVX_RES( STR_CLOSELINKMSG_MULTI
) ),
111 aStrWaitinglink( SVX_RES( STR_WAITINGLINK
) ),
114 aTbLinks( this, SVX_RES(TB_LINKS
) )
118 aTbLinks
.SetHelpId(HID_LINKDLG_TABLB
);
119 aTbLinks
.SetSelectionMode( MULTIPLE_SELECTION
);
120 aTbLinks
.SetTabs( &nTabs
[0], MAP_APPFONT
);
121 aTbLinks
.Resize(); // OS: Hack fuer richtige Selektion
123 //JP 24.02.99: UpdateTimer fuer DDE-/Grf-Links, auf die gewarted wird
124 aUpdateTimer
.SetTimeoutHdl( LINK( this, SvBaseLinksDlg
, UpdateWaitingHdl
) );
125 aUpdateTimer
.SetTimeout( 1000 );
129 Links().SetSelectHdl( LINK( this, SvBaseLinksDlg
, LinksSelectHdl
) );
130 Links().SetDoubleClickHdl( LINK( this, SvBaseLinksDlg
, LinksDoubleClickHdl
) );
131 Automatic().SetClickHdl( LINK( this, SvBaseLinksDlg
, AutomaticClickHdl
) );
132 Manual().SetClickHdl( LINK( this, SvBaseLinksDlg
, ManualClickHdl
) );
133 UpdateNow().SetClickHdl( LINK( this, SvBaseLinksDlg
, UpdateNowClickHdl
) );
134 // OpenSource().SetClickHdl( LINK( this, SvBaseLinksDlg, OpenSourceClickHdl ) );
135 ChangeSource().SetClickHdl( LINK( this, SvBaseLinksDlg
, ChangeSourceClickHdl
) );
137 BreakLink().SetClickHdl( LINK( this, SvBaseLinksDlg
, BreakLinkClickHdl
) );
144 SvBaseLinksDlg::~SvBaseLinksDlg()
148 /*************************************************************************
149 |* SvBaseLinksDlg::Handler()
152 |* Ersterstellung MM 14.06.94
153 |* Letzte Aenderung JP 30.05.95
154 *************************************************************************/
155 IMPL_LINK( SvBaseLinksDlg
, LinksSelectHdl
, SvTabListBox
*, pSvTabListBox
)
157 USHORT nSelectionCount
= pSvTabListBox
?
158 (USHORT
)pSvTabListBox
->GetSelectionCount() : 0;
159 if(nSelectionCount
> 1)
161 //bei Mehrfachselektion ggf. alte Eintraege deselektieren
162 SvLBoxEntry
* pEntry
= 0;
163 SvBaseLink
* pLink
= 0;
164 pEntry
= pSvTabListBox
->GetHdlEntry();
165 pLink
= (SvBaseLink
*)pEntry
->GetUserData();
166 USHORT nObjectType
= pLink
->GetObjType();
167 if((OBJECT_CLIENT_FILE
& nObjectType
) != OBJECT_CLIENT_FILE
)
169 pSvTabListBox
->SelectAll(FALSE
);
170 pSvTabListBox
->Select(pEntry
);
175 for( USHORT i
= 0; i
< nSelectionCount
; i
++)
177 pEntry
= i
== 0 ? pSvTabListBox
->FirstSelected() :
178 pSvTabListBox
->NextSelected(pEntry
);
179 DBG_ASSERT(pEntry
, "Wo ist der Entry?");
180 pLink
= (SvBaseLink
*)pEntry
->GetUserData();
181 DBG_ASSERT(pLink
, "Wo ist der Link?");
182 if( (OBJECT_CLIENT_FILE
& pLink
->GetObjType()) != OBJECT_CLIENT_FILE
)
183 pSvTabListBox
->Select( pEntry
, FALSE
);
188 UpdateNow().Enable();
190 Automatic().Disable();
197 SvBaseLink
* pLink
= GetSelEntry( &nPos
);
201 UpdateNow().Enable();
204 String
*pLinkNm
= &sLink
, *pFilter
= 0;
206 if( FILEOBJECT
& pLink
->GetObjType() )
208 Automatic().Disable();
211 if( OBJECT_CLIENT_GRF
== pLink
->GetObjType() )
212 pLinkNm
= 0, pFilter
= &sLink
;
216 Automatic().Enable();
219 if( LINKUPDATE_ALWAYS
== pLink
->GetUpdateMode() )
226 pLinkMgr
->GetDisplayNames( pLink
, &sType
, &aFileName
, pLinkNm
, pFilter
);
227 aFileName
= INetURLObject::decode(aFileName
, INET_HEX_ESCAPE
, INetURLObject::DECODE_UNAMBIGUOUS
);
228 FileName().SetText( aFileName
);
229 SourceName().SetText( sLink
);
230 TypeName().SetText( sType
);
235 IMPL_LINK_INLINE_START( SvBaseLinksDlg
, LinksDoubleClickHdl
, SvTabListBox
*, pSvTabListBox
)
239 ChangeSourceClickHdl( 0 );
242 IMPL_LINK_INLINE_END( SvBaseLinksDlg
, LinksDoubleClickHdl
, SvTabListBox
*, pSvTabListBox
)
244 IMPL_LINK_INLINE_START( SvBaseLinksDlg
, AutomaticClickHdl
, RadioButton
*, pRadioButton
)
249 SvBaseLink
* pLink
= GetSelEntry( &nPos
);
250 if( pLink
&& !( FILEOBJECT
& pLink
->GetObjType() ) &&
251 LINKUPDATE_ALWAYS
!= pLink
->GetUpdateMode() )
252 SetType( *pLink
, nPos
, LINKUPDATE_ALWAYS
);
255 IMPL_LINK_INLINE_END( SvBaseLinksDlg
, AutomaticClickHdl
, RadioButton
*, pRadioButton
)
257 IMPL_LINK_INLINE_START( SvBaseLinksDlg
, ManualClickHdl
, RadioButton
*, pRadioButton
)
262 SvBaseLink
* pLink
= GetSelEntry( &nPos
);
263 if( pLink
&& !( FILEOBJECT
& pLink
->GetObjType() ) &&
264 LINKUPDATE_ONCALL
!= pLink
->GetUpdateMode())
265 SetType( *pLink
, nPos
, LINKUPDATE_ONCALL
);
268 IMPL_LINK_INLINE_END( SvBaseLinksDlg
, ManualClickHdl
, RadioButton
*, pRadioButton
)
270 IMPL_LINK( SvBaseLinksDlg
, UpdateNowClickHdl
, PushButton
*, EMPTYARG
)
272 SvTabListBox
& rListBox
= Links();
273 USHORT nSelCnt
= (USHORT
)rListBox
.GetSelectionCount();
277 std::vector
< SvBaseLink
* > aLnkArr
;
278 std::vector
< USHORT
> aPosArr
;
280 SvLBoxEntry
* pE
= rListBox
.FirstSelected();
283 USHORT nFndPos
= (USHORT
)rListBox
.GetModel()->GetAbsPos( pE
);
284 if( LISTBOX_ENTRY_NOTFOUND
!= nFndPos
)
286 aLnkArr
.push_back( static_cast< SvBaseLink
* >( pE
->GetUserData() ) );
287 aPosArr
.push_back( nFndPos
);
289 pE
= rListBox
.NextSelected( pE
);
292 if( !aLnkArr
.empty() )
294 for( USHORT n
= 0; n
< aLnkArr
.size(); ++n
)
296 SvBaseLinkRef xLink
= aLnkArr
[ n
];
298 // suche erstmal im Array nach dem Eintrag
299 for( USHORT i
= 0; i
< pLinkMgr
->GetLinks().Count(); ++i
)
300 if( &xLink
== *pLinkMgr
->GetLinks()[ i
] )
302 xLink
->SetUseCache( FALSE
);
303 SetType( *xLink
, aPosArr
[ n
], xLink
->GetUpdateMode() );
304 xLink
->SetUseCache( TRUE
);
309 // falls jemand der Meinung ist, seine Links auszutauschen (SD)
310 SvLinkManager
* pNewMgr
= pLinkMgr
;
312 SetManager( pNewMgr
);
315 if( 0 == (pE
= rListBox
.GetEntry( aPosArr
[ 0 ] )) ||
316 pE
->GetUserData() != aLnkArr
[ 0 ] )
318 // suche mal den Link
319 pE
= rListBox
.First();
322 if( pE
->GetUserData() == aLnkArr
[ 0 ] )
324 pE
= rListBox
.Next( pE
);
328 pE
= rListBox
.FirstSelected();
333 SvLBoxEntry
* pSelEntry
= rListBox
.FirstSelected();
334 if( pE
!= pSelEntry
)
335 rListBox
.Select( pSelEntry
, FALSE
);
336 rListBox
.Select( pE
);
337 rListBox
.MakeVisible( pE
);
344 IMPL_LINK_INLINE_START( SvBaseLinksDlg, OpenSourceClickHdl, PushButton *, pPushButton )
346 DBG_ASSERT( !this, "Open noch nicht impl." );
349 IMPL_LINK_INLINE_END( SvBaseLinksDlg, OpenSourceClickHdl, PushButton *, pPushButton )
352 IMPL_LINK( SvBaseLinksDlg
, ChangeSourceClickHdl
, PushButton
*, pPushButton
)
356 USHORT nSelectionCount
= (USHORT
)Links().GetSelectionCount();
357 if(nSelectionCount
> 1)
359 PathDialog
aPathDlg( this );
360 String sType
, sFile
, sLinkName
;
362 SvLBoxEntry
* pEntry
= Links().FirstSelected();
363 SvBaseLink
* pLink
= (SvBaseLink
*)pEntry
->GetUserData();
364 pLinkMgr
->GetDisplayNames( pLink
, &sType
, &sFile
, 0, 0 );
365 INetURLObject
aUrl(sFile
);
366 if(aUrl
.GetProtocol() == INET_PROT_FILE
)
368 rtl::OUString
sOldPath(aUrl
.PathToFileName());
369 sal_Int32 nLen
= aUrl
.GetName().getLength();
370 sOldPath
= sOldPath
.copy(0, sOldPath
.getLength() - nLen
);
371 aPathDlg
.SetPath(sOldPath
);
373 if(aPathDlg
.Execute() == RET_OK
)
375 String aPath
= aPathDlg
.GetPath();
377 for( USHORT i
= 0; i
< nSelectionCount
; i
++)
380 Links().FirstSelected() :
381 Links().NextSelected( pEntry
);
382 DBG_ASSERT(pEntry
,"Wo ist der Entry");
383 pLink
= (SvBaseLink
*)pEntry
->GetUserData();
384 DBG_ASSERT(pLink
,"Wo ist der Link");
385 pLinkMgr
->GetDisplayNames( pLink
, &sType
, &sFile
, &sLinkName
, &sFilter
);
386 INetURLObject
aUrl_(sFile
);
387 INetURLObject
aUrl2(aPath
, INET_PROT_FILE
);
388 aUrl2
.insertName( aUrl_
.getName() );
390 MakeLnkName( sNewLinkName
, 0 ,
391 aUrl2
.GetMainURL(INetURLObject::DECODE_TO_IURI
), sLinkName
, &sFilter
);
392 pLink
->SetLinkSourceName( sNewLinkName
);
395 if( pLinkMgr
->GetPersist() )
396 pLinkMgr
->GetPersist()->SetModified();
397 SvLinkManager
* pNewMgr
= pLinkMgr
;
399 SetManager( pNewMgr
);
405 SvBaseLink
* pLink
= GetSelEntry( &nPos
);
406 if ( pLink
&& (pLink
->GetLinkSourceName().Len() != 0) )
407 pLink
->Edit( this, LINK( this, SvBaseLinksDlg
, EndEditHdl
) );
412 IMPL_LINK( SvBaseLinksDlg
, BreakLinkClickHdl
, PushButton
*, pPushButton
)
416 BOOL bModified
= FALSE
;
417 if(Links().GetSelectionCount() <= 1)
420 SvBaseLinkRef xLink
= GetSelEntry( &nPos
);
424 QueryBox
aBox( this, WB_YES_NO
| WB_DEF_YES
, Closelinkmsg() );
426 if( RET_YES
== aBox
.Execute() )
428 Links().GetModel()->Remove( Links().GetEntry( nPos
) );
430 // falls Object noch vorhanden, dann das schliessen
431 BOOL bNewLnkMgr
= OBJECT_CLIENT_FILE
== xLink
->GetObjType();
433 // dem Link sagen, das er aufgeloest wird!
436 // falls einer vergessen hat sich auszutragen
438 pLinkMgr
->Remove( &xLink
);
442 SvLinkManager
* pNewMgr
= pLinkMgr
;
444 SetManager( pNewMgr
);
446 SvLBoxEntry
* pEntry
= Links().GetEntry( nPos
? --nPos
: 0 );
448 Links().SetCurEntry( pEntry
);
455 QueryBox
aBox( this, WB_YES_NO
| WB_DEF_YES
, CloselinkmsgMulti() );
457 if( RET_YES
== aBox
.Execute() )
460 SvBaseLinkMemberList aLinkList
;
461 SvLBoxEntry
* pEntry
= Links().FirstSelected();
464 void * pUD
= pEntry
->GetUserData();
466 aLinkList
.Append( (SvBaseLink
*)pUD
);
467 pEntry
= Links().NextSelected(pEntry
);
469 Links().RemoveSelection();
470 for( ULONG i
= 0; i
< aLinkList
.Count(); i
++ )
472 SvBaseLinkRef xLink
= aLinkList
.GetObject( i
);
473 // dem Link sagen, das er aufgeloest wird!
476 // falls einer vergessen hat sich auszutragen
477 pLinkMgr
->Remove( &xLink
);
480 //Danach alle selektierten Eintraege entfernen
485 if( !Links().GetEntryCount() )
487 // Der letzte macht das Licht aus
488 Automatic().Disable();
490 UpdateNow().Disable();
491 // OpenSource().Disable();
492 ChangeSource().Disable();
493 BreakLink().Disable();
496 SourceName().SetText( aEmpty
);
497 TypeName().SetText( aEmpty
);
499 if( pLinkMgr
->GetPersist() )
500 pLinkMgr
->GetPersist()->SetModified();
505 IMPL_LINK( SvBaseLinksDlg
, UpdateWaitingHdl
, Timer
*, pTimer
)
508 // for( SvLBoxEntry* pBox = Links().First(); pBox;
509 // pBox = Links().Next( pBox ))
511 Links().SetUpdateMode(FALSE
);
512 for( ULONG nPos
= Links().GetEntryCount(); nPos
; )
514 SvLBoxEntry
* pBox
= Links().GetEntry( --nPos
);
515 SvBaseLinkRef
xLink( (SvBaseLink
*)pBox
->GetUserData() );
518 String
sCur( ImplGetStateStr( *xLink
) ),
519 sOld( Links().GetEntryText( pBox
, 3 ) );
521 Links().SetEntryText( sCur
, pBox
, 3 );
524 Links().SetUpdateMode(TRUE
);
528 IMPL_LINK( SvBaseLinksDlg
, EndEditHdl
, sfx2::SvBaseLink
*, _pLink
)
531 SvBaseLink
* pLink
= GetSelEntry( &nPos
);
533 if ( pLink
!= _pLink
&& _pLink
&& _pLink
->WasLastEditOK() )
536 // StarImpress/Draw tauschen die LinkObjecte selbst aus!
537 // also suche den Link im Manager, wenn der nicht mehr existiert,
538 // dann setze fuelle die Liste komplett neu. Ansonsten braucht
539 // nur der editierte Linkt aktualisiert werden.
540 BOOL bLinkFnd
= FALSE
;
541 for( USHORT n
= pLinkMgr
->GetLinks().Count(); n
; )
542 if( _pLink
== &(*pLinkMgr
->GetLinks()[ --n
]) )
550 Links().SetUpdateMode(FALSE
);
551 Links().GetModel()->Remove( Links().GetEntry( nPos
) );
552 SvLBoxEntry
* pToUnselect
= Links().FirstSelected();
553 InsertEntry( *_pLink
, nPos
, sal_True
);
555 Links().Select(pToUnselect
, FALSE
);
556 Links().SetUpdateMode(TRUE
);
560 SvLinkManager
* pNewMgr
= pLinkMgr
;
562 SetManager( pNewMgr
);
564 if( pLinkMgr
->GetPersist() )
565 pLinkMgr
->GetPersist()->SetModified();
567 else if ( pLink
== _pLink
)
569 DBG_ERRORFILE( "SvBaseLinksDlg::EndEditHdl(): wrong link" );
574 String
SvBaseLinksDlg::ImplGetStateStr( const SvBaseLink
& rLnk
)
579 else if( rLnk
.GetObj()->IsPending() )
581 sRet
= Waitinglink();
584 else if( LINKUPDATE_ALWAYS
== rLnk
.GetUpdateMode() )
592 void SvBaseLinksDlg::SetManager( SvLinkManager
* pNewMgr
)
594 if( pLinkMgr
== pNewMgr
)
598 // Update muss vor Clear gestoppt werden
599 Links().SetUpdateMode( FALSE
);
606 SvBaseLinks
& rLnks
= (SvBaseLinks
&)pLinkMgr
->GetLinks();
607 for( USHORT n
= 0; n
< rLnks
.Count(); ++n
)
609 SvBaseLinkRef
* pLinkRef
= rLnks
[ n
];
610 if( !pLinkRef
->Is() )
612 rLnks
.Remove( n
, 1 );
616 if( (*pLinkRef
)->IsVisible() )
617 InsertEntry( **pLinkRef
);
622 SvLBoxEntry
* pEntry
= Links().GetEntry( 0 );
623 Links().SetCurEntry( pEntry
);
624 Links().Select( pEntry
);
627 Links().SetUpdateMode( TRUE
);
628 Links().Invalidate();
633 void SvBaseLinksDlg::InsertEntry( const SvBaseLink
& rLink
, USHORT nPos
, sal_Bool bSelect
)
635 String aEntry
, sFileNm
, sLinkNm
, sTypeNm
, sFilter
;
637 pLinkMgr
->GetDisplayNames( (SvBaseLink
*)&rLink
, &sTypeNm
, &sFileNm
, &sLinkNm
, &sFilter
);
639 // GetTab(0) gibt die Position der von der TabListBox automatisch eingefuegten
640 // Bitmap. Die Breite der ersten Textspalte ergibt sich deshalb aus Tab(2)-Tab(1)
641 long nWidthPixel
= Links().GetLogicTab( 2 ) - Links().GetLogicTab( 1 );
642 nWidthPixel
-= SV_TAB_BORDER
;
643 XubString aTxt
= Links().GetEllipsisString( sFileNm
, nWidthPixel
, TEXT_DRAW_PATHELLIPSIS
);
644 INetURLObject
aPath( sFileNm
, INET_PROT_FILE
);
645 String aFileName
= aPath
.getName();
646 if( aFileName
.Len() > aTxt
.Len() )
648 else if( aTxt
.Search( aFileName
, aTxt
.Len() - aFileName
.Len() ) == STRING_NOTFOUND
)
649 // filename not in string
654 if( OBJECT_CLIENT_GRF
== rLink
.GetObjType() )
661 aEntry
+= ImplGetStateStr( rLink
);
663 SvLBoxEntry
* pE
= Links().InsertEntryToColumn( aEntry
, nPos
);
664 pE
->SetUserData( (void*)&rLink
);
669 SvBaseLink
* SvBaseLinksDlg::GetSelEntry( USHORT
* pPos
)
671 SvLBoxEntry
* pE
= Links().FirstSelected();
673 if( pE
&& LISTBOX_ENTRY_NOTFOUND
!=
674 ( nPos
= (USHORT
)Links().GetModel()->GetAbsPos( pE
) ) )
676 DBG_ASSERT( pE
, "wo kommt der leere Eintrag her?" );
680 return (SvBaseLink
*)pE
->GetUserData();
685 void SvBaseLinksDlg::SetType( SvBaseLink
& rLink
,
689 rLink
.SetUpdateMode( nType
);
691 SvLBoxEntry
* pBox
= Links().GetEntry( nSelPos
);
692 Links().SetEntryText( ImplGetStateStr( rLink
), pBox
, 3 );
693 if( pLinkMgr
->GetPersist() )
694 pLinkMgr
->GetPersist()->SetModified();
697 void SvBaseLinksDlg::SetActLink( SvBaseLink
* pLink
)
701 const SvBaseLinks
& rLnks
= pLinkMgr
->GetLinks();
703 for( USHORT n
= 0; n
< rLnks
.Count(); ++n
)
705 SvBaseLinkRef
* pLinkRef
= rLnks
[ n
];
706 // #109573# only visible links have been inserted into the TreeListBox,
707 // invisible ones have to be skipped here
708 if( (*pLinkRef
)->IsVisible() )
710 if( pLink
== *pLinkRef
)
712 Links().Select( Links().GetEntry( nSelect
) );