xref: /aoo41x/main/sc/source/ui/miscdlgs/linkarea.cxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_sc.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #undef SC_DLLIMPLEMENTATION
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir //------------------------------------------------------------------
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #include <sfx2/app.hxx>
38*cdf0e10cSrcweir #include <sfx2/docfile.hxx>
39*cdf0e10cSrcweir #include <sfx2/docfilt.hxx>
40*cdf0e10cSrcweir #include <sfx2/docinsert.hxx>
41*cdf0e10cSrcweir #include <sfx2/fcontnr.hxx>
42*cdf0e10cSrcweir #include <sfx2/filedlghelper.hxx>
43*cdf0e10cSrcweir #include <svtools/ehdl.hxx>
44*cdf0e10cSrcweir #include <svtools/sfxecode.hxx>
45*cdf0e10cSrcweir #include <vcl/waitobj.hxx>
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir #include "linkarea.hxx"
48*cdf0e10cSrcweir #include "linkarea.hrc"
49*cdf0e10cSrcweir #include "scresid.hxx"
50*cdf0e10cSrcweir #include "sc.hrc"
51*cdf0e10cSrcweir #include "rangeutl.hxx"
52*cdf0e10cSrcweir #include "docsh.hxx"
53*cdf0e10cSrcweir #include "tablink.hxx"
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir //==================================================================
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir ScLinkedAreaDlg::ScLinkedAreaDlg( Window* pParent ) :
58*cdf0e10cSrcweir 	ModalDialog ( pParent, ScResId( RID_SCDLG_LINKAREA ) ),
59*cdf0e10cSrcweir 	//
60*cdf0e10cSrcweir 	aFlLocation	( this, ScResId( FL_LOCATION ) ),
61*cdf0e10cSrcweir 	aCbUrl		( this, ScResId( CB_URL ) ),
62*cdf0e10cSrcweir 	aBtnBrowse	( this, ScResId( BTN_BROWSE ) ),
63*cdf0e10cSrcweir 	aTxtHint	( this, ScResId( FT_HINT ) ),
64*cdf0e10cSrcweir 	aFtRanges	( this, ScResId( FT_RANGES ) ),
65*cdf0e10cSrcweir 	aLbRanges	( this, ScResId( LB_RANGES ) ),
66*cdf0e10cSrcweir 	aBtnReload	( this, ScResId( BTN_RELOAD ) ),
67*cdf0e10cSrcweir 	aNfDelay	( this, ScResId( NF_DELAY ) ),
68*cdf0e10cSrcweir 	aFtSeconds	( this, ScResId( FT_SECONDS ) ),
69*cdf0e10cSrcweir 	aBtnOk		( this, ScResId( BTN_OK ) ),
70*cdf0e10cSrcweir 	aBtnCancel	( this, ScResId( BTN_CANCEL ) ),
71*cdf0e10cSrcweir 	aBtnHelp	( this, ScResId( BTN_HELP ) ),
72*cdf0e10cSrcweir 	//
73*cdf0e10cSrcweir     pSourceShell( NULL ),
74*cdf0e10cSrcweir     pDocInserter( NULL )
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir {
77*cdf0e10cSrcweir 	FreeResource();
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir 	aCbUrl.SetHelpId( HID_SCDLG_LINKAREAURL );	// SvtURLBox ctor always sets SID_OPENURL
80*cdf0e10cSrcweir 	aCbUrl.SetSelectHdl( LINK( this, ScLinkedAreaDlg, FileHdl ) );
81*cdf0e10cSrcweir 	aBtnBrowse.SetClickHdl( LINK( this, ScLinkedAreaDlg, BrowseHdl ) );
82*cdf0e10cSrcweir 	aLbRanges.SetSelectHdl( LINK( this, ScLinkedAreaDlg, RangeHdl ) );
83*cdf0e10cSrcweir 	aBtnReload.SetClickHdl( LINK( this, ScLinkedAreaDlg, ReloadHdl ) );
84*cdf0e10cSrcweir 	UpdateEnable();
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 	aNfDelay.SetAccessibleName(aBtnReload.GetText());
87*cdf0e10cSrcweir 	aNfDelay.SetAccessibleRelationLabeledBy(&aBtnReload);
88*cdf0e10cSrcweir }
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir ScLinkedAreaDlg::~ScLinkedAreaDlg()
91*cdf0e10cSrcweir {
92*cdf0e10cSrcweir 	// pSourceShell is deleted by aSourceRef
93*cdf0e10cSrcweir }
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir short ScLinkedAreaDlg::Execute()
96*cdf0e10cSrcweir {
97*cdf0e10cSrcweir 	// set parent for file dialog or filter options
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir 	Window*	pOldDefParent = Application::GetDefDialogParent();
100*cdf0e10cSrcweir 	Application::SetDefDialogParent( this );
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir 	short nRet = ModalDialog::Execute();
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir 	Application::SetDefDialogParent( pOldDefParent );
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir 	return nRet;
107*cdf0e10cSrcweir }
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir #define FILTERNAME_HTML  "HTML (StarCalc)"
110*cdf0e10cSrcweir #define FILTERNAME_QUERY "calc_HTML_WebQuery"
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir IMPL_LINK( ScLinkedAreaDlg, BrowseHdl, PushButton*, EMPTYARG )
113*cdf0e10cSrcweir {
114*cdf0e10cSrcweir     if ( !pDocInserter )
115*cdf0e10cSrcweir         pDocInserter = new sfx2::DocumentInserter(
116*cdf0e10cSrcweir             0, String::CreateFromAscii( ScDocShell::Factory().GetShortName() ) );
117*cdf0e10cSrcweir     pDocInserter->StartExecuteModal( LINK( this, ScLinkedAreaDlg, DialogClosedHdl ) );
118*cdf0e10cSrcweir     return 0;
119*cdf0e10cSrcweir }
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir IMPL_LINK( ScLinkedAreaDlg, FileHdl, ComboBox*, EMPTYARG )
122*cdf0e10cSrcweir {
123*cdf0e10cSrcweir 	String aEntered = aCbUrl.GetURL();
124*cdf0e10cSrcweir 	if (pSourceShell)
125*cdf0e10cSrcweir 	{
126*cdf0e10cSrcweir 		SfxMedium* pMed = pSourceShell->GetMedium();
127*cdf0e10cSrcweir 		if ( pMed->GetName() == aEntered )
128*cdf0e10cSrcweir 		{
129*cdf0e10cSrcweir 			//	already loaded - nothing to do
130*cdf0e10cSrcweir 			return 0;
131*cdf0e10cSrcweir 		}
132*cdf0e10cSrcweir 	}
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir 	String aFilter;
135*cdf0e10cSrcweir 	String aOptions;
136*cdf0e10cSrcweir 	//	get filter name by looking at the file content (bWithContent = sal_True)
137*cdf0e10cSrcweir     // Break operation if any error occured inside.
138*cdf0e10cSrcweir     if (!ScDocumentLoader::GetFilterName( aEntered, aFilter, aOptions, sal_True, sal_True ))
139*cdf0e10cSrcweir         return 0;
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir     // #i53241# replace HTML filter with DataQuery filter
142*cdf0e10cSrcweir     if( aFilter.EqualsAscii( FILTERNAME_HTML ) )
143*cdf0e10cSrcweir         aFilter.AssignAscii( FILTERNAME_QUERY );
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir 	LoadDocument( aEntered, aFilter, aOptions );
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir 	UpdateSourceRanges();
148*cdf0e10cSrcweir 	UpdateEnable();
149*cdf0e10cSrcweir 	return 0;
150*cdf0e10cSrcweir }
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir void ScLinkedAreaDlg::LoadDocument( const String& rFile, const String& rFilter, const String& rOptions )
153*cdf0e10cSrcweir {
154*cdf0e10cSrcweir 	if ( pSourceShell )
155*cdf0e10cSrcweir 	{
156*cdf0e10cSrcweir 		//	unload old document
157*cdf0e10cSrcweir 		pSourceShell->DoClose();
158*cdf0e10cSrcweir 		pSourceShell = NULL;
159*cdf0e10cSrcweir 		aSourceRef.Clear();
160*cdf0e10cSrcweir 	}
161*cdf0e10cSrcweir 
162*cdf0e10cSrcweir 	if ( rFile.Len() )
163*cdf0e10cSrcweir 	{
164*cdf0e10cSrcweir 		WaitObject aWait( this );
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir 		String aNewFilter = rFilter;
167*cdf0e10cSrcweir 		String aNewOptions = rOptions;
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir 		SfxErrorContext aEc( ERRCTX_SFX_OPENDOC, rFile );
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir 		ScDocumentLoader aLoader( rFile, aNewFilter, aNewOptions, 0, sal_True );	// with interaction
172*cdf0e10cSrcweir 		pSourceShell = aLoader.GetDocShell();
173*cdf0e10cSrcweir 		if ( pSourceShell )
174*cdf0e10cSrcweir 		{
175*cdf0e10cSrcweir 			sal_uLong nErr = pSourceShell->GetErrorCode();
176*cdf0e10cSrcweir 			if (nErr)
177*cdf0e10cSrcweir 				ErrorHandler::HandleError( nErr );		// including warnings
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir 			aSourceRef = pSourceShell;
180*cdf0e10cSrcweir 			aLoader.ReleaseDocRef();	// don't call DoClose in DocLoader dtor
181*cdf0e10cSrcweir 		}
182*cdf0e10cSrcweir 	}
183*cdf0e10cSrcweir }
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir void ScLinkedAreaDlg::InitFromOldLink( const String& rFile, const String& rFilter,
186*cdf0e10cSrcweir 										const String& rOptions, const String& rSource,
187*cdf0e10cSrcweir 										sal_uLong nRefresh )
188*cdf0e10cSrcweir {
189*cdf0e10cSrcweir 	LoadDocument( rFile, rFilter, rOptions );
190*cdf0e10cSrcweir 	if (pSourceShell)
191*cdf0e10cSrcweir 	{
192*cdf0e10cSrcweir 		SfxMedium* pMed = pSourceShell->GetMedium();
193*cdf0e10cSrcweir 		aCbUrl.SetText( pMed->GetName() );
194*cdf0e10cSrcweir 	}
195*cdf0e10cSrcweir 	else
196*cdf0e10cSrcweir 		aCbUrl.SetText( EMPTY_STRING );
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir 	UpdateSourceRanges();
199*cdf0e10cSrcweir 
200*cdf0e10cSrcweir 	xub_StrLen nRangeCount = rSource.GetTokenCount();
201*cdf0e10cSrcweir 	for ( xub_StrLen i=0; i<nRangeCount; i++ )
202*cdf0e10cSrcweir 	{
203*cdf0e10cSrcweir 		String aRange = rSource.GetToken(i);
204*cdf0e10cSrcweir 		aLbRanges.SelectEntry( aRange );
205*cdf0e10cSrcweir 	}
206*cdf0e10cSrcweir 
207*cdf0e10cSrcweir 	sal_Bool bDoRefresh = ( nRefresh != 0 );
208*cdf0e10cSrcweir 	aBtnReload.Check( bDoRefresh );
209*cdf0e10cSrcweir 	if (bDoRefresh)
210*cdf0e10cSrcweir 		aNfDelay.SetValue( nRefresh );
211*cdf0e10cSrcweir 
212*cdf0e10cSrcweir 	UpdateEnable();
213*cdf0e10cSrcweir }
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir IMPL_LINK( ScLinkedAreaDlg, RangeHdl, MultiListBox*, EMPTYARG )
216*cdf0e10cSrcweir {
217*cdf0e10cSrcweir 	UpdateEnable();
218*cdf0e10cSrcweir 	return 0;
219*cdf0e10cSrcweir }
220*cdf0e10cSrcweir 
221*cdf0e10cSrcweir IMPL_LINK( ScLinkedAreaDlg, ReloadHdl, CheckBox*, EMPTYARG )
222*cdf0e10cSrcweir {
223*cdf0e10cSrcweir     UpdateEnable();
224*cdf0e10cSrcweir     return 0;
225*cdf0e10cSrcweir }
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir IMPL_LINK( ScLinkedAreaDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
228*cdf0e10cSrcweir {
229*cdf0e10cSrcweir     if ( _pFileDlg->GetError() != ERRCODE_NONE )
230*cdf0e10cSrcweir         return 0;
231*cdf0e10cSrcweir 
232*cdf0e10cSrcweir     SfxMedium* pMed = pDocInserter->CreateMedium();
233*cdf0e10cSrcweir     if ( pMed )
234*cdf0e10cSrcweir     {
235*cdf0e10cSrcweir         WaitObject aWait( this );
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir         // #92296# replace HTML filter with DataQuery filter
238*cdf0e10cSrcweir         const String aHTMLFilterName( RTL_CONSTASCII_USTRINGPARAM( FILTERNAME_HTML ) );
239*cdf0e10cSrcweir         const String aWebQFilterName( RTL_CONSTASCII_USTRINGPARAM( FILTERNAME_QUERY ) );
240*cdf0e10cSrcweir 
241*cdf0e10cSrcweir         const SfxFilter* pFilter = pMed->GetFilter();
242*cdf0e10cSrcweir         if( pFilter && (pFilter->GetFilterName() == aHTMLFilterName) )
243*cdf0e10cSrcweir         {
244*cdf0e10cSrcweir             const SfxFilter* pNewFilter =
245*cdf0e10cSrcweir                 ScDocShell::Factory().GetFilterContainer()->GetFilter4FilterName( aWebQFilterName );
246*cdf0e10cSrcweir             if( pNewFilter )
247*cdf0e10cSrcweir                 pMed->SetFilter( pNewFilter );
248*cdf0e10cSrcweir         }
249*cdf0e10cSrcweir 
250*cdf0e10cSrcweir         //  ERRCTX_SFX_OPENDOC -> "Fehler beim Laden des Dokumentes"
251*cdf0e10cSrcweir         SfxErrorContext aEc( ERRCTX_SFX_OPENDOC, pMed->GetName() );
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir         if (pSourceShell)
254*cdf0e10cSrcweir             pSourceShell->DoClose();        // deleted when assigning aSourceRef
255*cdf0e10cSrcweir 
256*cdf0e10cSrcweir         pMed->UseInteractionHandler( sal_True );    // to enable the filter options dialog
257*cdf0e10cSrcweir 
258*cdf0e10cSrcweir         pSourceShell = new ScDocShell;
259*cdf0e10cSrcweir         aSourceRef = pSourceShell;
260*cdf0e10cSrcweir         pSourceShell->DoLoad( pMed );
261*cdf0e10cSrcweir 
262*cdf0e10cSrcweir         sal_uLong nErr = pSourceShell->GetErrorCode();
263*cdf0e10cSrcweir         if (nErr)
264*cdf0e10cSrcweir             ErrorHandler::HandleError( nErr );              // including warnings
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir         if ( !pSourceShell->GetError() )                    // only errors
267*cdf0e10cSrcweir         {
268*cdf0e10cSrcweir             //aCbUrl.SetText( pSourceShell->GetTitle( SFX_TITLE_FULLNAME ) );
269*cdf0e10cSrcweir             aCbUrl.SetText( pMed->GetName() );
270*cdf0e10cSrcweir         }
271*cdf0e10cSrcweir         else
272*cdf0e10cSrcweir         {
273*cdf0e10cSrcweir             pSourceShell->DoClose();
274*cdf0e10cSrcweir             pSourceShell = NULL;
275*cdf0e10cSrcweir             aSourceRef.Clear();
276*cdf0e10cSrcweir 
277*cdf0e10cSrcweir             aCbUrl.SetText( EMPTY_STRING );
278*cdf0e10cSrcweir         }
279*cdf0e10cSrcweir     }
280*cdf0e10cSrcweir 
281*cdf0e10cSrcweir     UpdateSourceRanges();
282*cdf0e10cSrcweir     UpdateEnable();
283*cdf0e10cSrcweir     return 0;
284*cdf0e10cSrcweir }
285*cdf0e10cSrcweir 
286*cdf0e10cSrcweir #undef FILTERNAME_HTML
287*cdf0e10cSrcweir #undef FILTERNAME_QUERY
288*cdf0e10cSrcweir 
289*cdf0e10cSrcweir void ScLinkedAreaDlg::UpdateSourceRanges()
290*cdf0e10cSrcweir {
291*cdf0e10cSrcweir 	aLbRanges.SetUpdateMode( sal_False );
292*cdf0e10cSrcweir 
293*cdf0e10cSrcweir 	aLbRanges.Clear();
294*cdf0e10cSrcweir 	if ( pSourceShell )
295*cdf0e10cSrcweir 	{
296*cdf0e10cSrcweir 		ScAreaNameIterator aIter( pSourceShell->GetDocument() );
297*cdf0e10cSrcweir 		ScRange aDummy;
298*cdf0e10cSrcweir 		String aName;
299*cdf0e10cSrcweir 		while ( aIter.Next( aName, aDummy ) )
300*cdf0e10cSrcweir 			aLbRanges.InsertEntry( aName );
301*cdf0e10cSrcweir 	}
302*cdf0e10cSrcweir 
303*cdf0e10cSrcweir 	aLbRanges.SetUpdateMode( sal_True );
304*cdf0e10cSrcweir 
305*cdf0e10cSrcweir 	if ( aLbRanges.GetEntryCount() == 1 )
306*cdf0e10cSrcweir 		aLbRanges.SelectEntryPos(0);
307*cdf0e10cSrcweir }
308*cdf0e10cSrcweir 
309*cdf0e10cSrcweir void ScLinkedAreaDlg::UpdateEnable()
310*cdf0e10cSrcweir {
311*cdf0e10cSrcweir 	sal_Bool bEnable = ( pSourceShell && aLbRanges.GetSelectEntryCount() );
312*cdf0e10cSrcweir 	aBtnOk.Enable( bEnable );
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir 	sal_Bool bReload = aBtnReload.IsChecked();
315*cdf0e10cSrcweir 	aNfDelay.Enable( bReload );
316*cdf0e10cSrcweir 	aFtSeconds.Enable( bReload );
317*cdf0e10cSrcweir }
318*cdf0e10cSrcweir 
319*cdf0e10cSrcweir String ScLinkedAreaDlg::GetURL()
320*cdf0e10cSrcweir {
321*cdf0e10cSrcweir 	if (pSourceShell)
322*cdf0e10cSrcweir 	{
323*cdf0e10cSrcweir 		SfxMedium* pMed = pSourceShell->GetMedium();
324*cdf0e10cSrcweir 		return pMed->GetName();
325*cdf0e10cSrcweir 	}
326*cdf0e10cSrcweir 	return EMPTY_STRING;
327*cdf0e10cSrcweir }
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir String ScLinkedAreaDlg::GetFilter()
330*cdf0e10cSrcweir {
331*cdf0e10cSrcweir 	if (pSourceShell)
332*cdf0e10cSrcweir 	{
333*cdf0e10cSrcweir 		SfxMedium* pMed = pSourceShell->GetMedium();
334*cdf0e10cSrcweir 		return pMed->GetFilter()->GetFilterName();
335*cdf0e10cSrcweir 	}
336*cdf0e10cSrcweir 	return EMPTY_STRING;
337*cdf0e10cSrcweir }
338*cdf0e10cSrcweir 
339*cdf0e10cSrcweir String ScLinkedAreaDlg::GetOptions()
340*cdf0e10cSrcweir {
341*cdf0e10cSrcweir 	if (pSourceShell)
342*cdf0e10cSrcweir 	{
343*cdf0e10cSrcweir 		SfxMedium* pMed = pSourceShell->GetMedium();
344*cdf0e10cSrcweir 		return ScDocumentLoader::GetOptions( *pMed );
345*cdf0e10cSrcweir 	}
346*cdf0e10cSrcweir 	return EMPTY_STRING;
347*cdf0e10cSrcweir }
348*cdf0e10cSrcweir 
349*cdf0e10cSrcweir String ScLinkedAreaDlg::GetSource()
350*cdf0e10cSrcweir {
351*cdf0e10cSrcweir 	String aSource;
352*cdf0e10cSrcweir 	sal_uInt16 nCount = aLbRanges.GetSelectEntryCount();
353*cdf0e10cSrcweir 	for (sal_uInt16 i=0; i<nCount; i++)
354*cdf0e10cSrcweir 	{
355*cdf0e10cSrcweir 		if (i > 0)
356*cdf0e10cSrcweir 			aSource.Append( (sal_Unicode) ';' );
357*cdf0e10cSrcweir 		aSource.Append( aLbRanges.GetSelectEntry( i ) );
358*cdf0e10cSrcweir 	}
359*cdf0e10cSrcweir 	return aSource;
360*cdf0e10cSrcweir }
361*cdf0e10cSrcweir 
362*cdf0e10cSrcweir sal_uLong ScLinkedAreaDlg::GetRefresh()
363*cdf0e10cSrcweir {
364*cdf0e10cSrcweir 	if ( aBtnReload.IsChecked() )
365*cdf0e10cSrcweir         return sal::static_int_cast<sal_uLong>( aNfDelay.GetValue() );
366*cdf0e10cSrcweir 	else
367*cdf0e10cSrcweir 		return 0;	// disabled
368*cdf0e10cSrcweir }
369*cdf0e10cSrcweir 
370