summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx21
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx3
-rw-r--r--sc/source/ui/docshell/arealink.cxx2
-rw-r--r--sc/source/ui/inc/linkarea.hrc35
-rw-r--r--sc/source/ui/inc/linkarea.hxx19
-rw-r--r--sc/source/ui/miscdlgs/linkarea.cxx93
-rw-r--r--sc/source/ui/miscdlgs/linkarea.src119
-rw-r--r--sc/source/ui/view/cellsh1.cxx3
8 files changed, 54 insertions, 241 deletions
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 98b656ff8102..83f3c235c143 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -982,27 +982,12 @@ AbstractScSelEntryDlg * ScAbstractDialogFactory_Impl::CreateScSelEntryDlg ( Wind
}
// add for ScSelEntryDlg end
-
-AbstractScLinkedAreaDlg * ScAbstractDialogFactory_Impl::CreateScLinkedAreaDlg ( Window* pParent,
- int nId)
+AbstractScLinkedAreaDlg * ScAbstractDialogFactory_Impl::CreateScLinkedAreaDlg(Window* pParent)
{
- ScLinkedAreaDlg * pDlg=NULL;
- switch ( nId )
- {
- case RID_SCDLG_LINKAREA :
- pDlg = new ScLinkedAreaDlg( pParent );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractScLinkedAreaDlg_Impl( pDlg );
- return 0;
+ ScLinkedAreaDlg* pDlg = new ScLinkedAreaDlg( pParent );
+ return new AbstractScLinkedAreaDlg_Impl( pDlg );
}
-
-
AbstractScMetricInputDlg * ScAbstractDialogFactory_Impl::CreateScMetricInputDlg ( Window* pParent,
sal_uInt16 nResId, // Ableitung fuer jeden Dialog!
long nCurrent,
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 33836164b5be..f88bb0ebf6ba 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -463,8 +463,7 @@ public:
virtual AbstractScSelEntryDlg * CreateScSelEntryDlg ( Window* pParent, // add for ScSelEntryDlg
const std::vector<String> &rEntryList );
- virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg ( Window* pParent, //add for ScLinkedAreaDlg
- int nId);
+ virtual AbstractScLinkedAreaDlg * CreateScLinkedAreaDlg(Window* pParent); //add for ScLinkedAreaDlg
virtual AbstractScMetricInputDlg * CreateScMetricInputDlg ( Window* pParent, //add for ScMetricInputDlg
sal_uInt16 nResId, // Ableitung fuer jeden Dialog!
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index bd48b87c3e2c..df3c944d2314 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -95,7 +95,7 @@ void ScAreaLink::Edit(Window* pParent, const Link& /* rEndEditHdl */ )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- AbstractScLinkedAreaDlg* pDlg = pFact->CreateScLinkedAreaDlg( pParent, RID_SCDLG_LINKAREA);
+ AbstractScLinkedAreaDlg* pDlg = pFact->CreateScLinkedAreaDlg(pParent);
OSL_ENSURE(pDlg, "Dialog create fail!");
pDlg->InitFromOldLink( aFileName, aFilterName, aOptions, aSourceArea, GetRefreshDelay() );
pImpl->m_pDialog = pDlg;
diff --git a/sc/source/ui/inc/linkarea.hrc b/sc/source/ui/inc/linkarea.hrc
deleted file mode 100644
index 36606f72ea19..000000000000
--- a/sc/source/ui/inc/linkarea.hrc
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <sc.hrc>
-
-#define BTN_OK 1
-#define BTN_CANCEL 2
-#define BTN_HELP 3
-#define FL_LOCATION 4
-#define CB_URL 5
-#define BTN_BROWSE 6
-#define FT_HINT 7
-#define FT_RANGES 8
-#define LB_RANGES 9
-#define BTN_RELOAD 10
-#define NF_DELAY 11
-#define FT_SECONDS 12
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/linkarea.hxx b/sc/source/ui/inc/linkarea.hxx
index 2f035fbb387b..5930daa60a7e 100644
--- a/sc/source/ui/inc/linkarea.hxx
+++ b/sc/source/ui/inc/linkarea.hxx
@@ -40,18 +40,13 @@ class ScDocShell;
class ScLinkedAreaDlg : public ModalDialog
{
private:
- FixedLine aFlLocation;
- SvtURLBox aCbUrl;
- PushButton aBtnBrowse;
- FixedInfo aTxtHint;
- FixedText aFtRanges;
- MultiListBox aLbRanges;
- CheckBox aBtnReload;
- NumericField aNfDelay;
- FixedText aFtSeconds;
- OKButton aBtnOk;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
+ SvtURLBox* m_pCbUrl;
+ PushButton* m_pBtnBrowse;
+ ListBox* m_pLbRanges;
+ CheckBox* m_pBtnReload;
+ NumericField* m_pNfDelay;
+ FixedText* m_pFtSeconds;
+ OKButton* m_pBtnOk;
ScDocShell* pSourceShell;
sfx2::DocumentInserter* pDocInserter;
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index 6e448ca072be..c88bbf7f3477 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -34,7 +34,6 @@
#include <vcl/waitobj.hxx>
#include "linkarea.hxx"
-#include "linkarea.hrc"
#include "scresid.hxx"
#include "sc.hrc"
#include "rangeutl.hxx"
@@ -43,37 +42,27 @@
//==================================================================
-ScLinkedAreaDlg::ScLinkedAreaDlg( Window* pParent ) :
- ModalDialog ( pParent, ScResId( RID_SCDLG_LINKAREA ) ),
- //
- aFlLocation ( this, ScResId( FL_LOCATION ) ),
- aCbUrl ( this, ScResId( CB_URL ) ),
- aBtnBrowse ( this, ScResId( BTN_BROWSE ) ),
- aTxtHint ( this, ScResId( FT_HINT ) ),
- aFtRanges ( this, ScResId( FT_RANGES ) ),
- aLbRanges ( this, ScResId( LB_RANGES ) ),
- aBtnReload ( this, ScResId( BTN_RELOAD ) ),
- aNfDelay ( this, ScResId( NF_DELAY ) ),
- aFtSeconds ( this, ScResId( FT_SECONDS ) ),
- aBtnOk ( this, ScResId( BTN_OK ) ),
- aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
- aBtnHelp ( this, ScResId( BTN_HELP ) ),
- //
- pSourceShell( NULL ),
- pDocInserter( NULL )
+ScLinkedAreaDlg::ScLinkedAreaDlg(Window* pParent)
+ : ModalDialog(pParent, "ExternalDataDialog", "modules/scalc/ui/externaldata.ui")
+ , pSourceShell(NULL)
+ , pDocInserter(NULL)
{
- FreeResource();
-
- aCbUrl.SetHelpId( HID_SCDLG_LINKAREAURL ); // SvtURLBox ctor always sets SID_OPENURL
- aCbUrl.SetSelectHdl( LINK( this, ScLinkedAreaDlg, FileHdl ) );
- aBtnBrowse.SetClickHdl( LINK( this, ScLinkedAreaDlg, BrowseHdl ) );
- aLbRanges.SetSelectHdl( LINK( this, ScLinkedAreaDlg, RangeHdl ) );
- aBtnReload.SetClickHdl( LINK( this, ScLinkedAreaDlg, ReloadHdl ) );
+ get(m_pCbUrl, "url");
+ get(m_pLbRanges, "ranges");
+ m_pLbRanges->EnableMultiSelection(true);
+ m_pLbRanges->SetDropDownLineCount(8);
+ get(m_pBtnBrowse, "browse");
+ get(m_pBtnReload, "reload");
+ get(m_pNfDelay, "delay");
+ get(m_pFtSeconds, "secondsft");
+ get(m_pBtnOk, "ok");
+
+ m_pCbUrl->SetSelectHdl( LINK( this, ScLinkedAreaDlg, FileHdl ) );
+ m_pBtnBrowse->SetClickHdl( LINK( this, ScLinkedAreaDlg, BrowseHdl ) );
+ m_pLbRanges->SetSelectHdl( LINK( this, ScLinkedAreaDlg, RangeHdl ) );
+ m_pBtnReload->SetClickHdl( LINK( this, ScLinkedAreaDlg, ReloadHdl ) );
UpdateEnable();
-
- aNfDelay.SetAccessibleName(aBtnReload.GetText());
- aNfDelay.SetAccessibleRelationLabeledBy(&aBtnReload);
}
ScLinkedAreaDlg::~ScLinkedAreaDlg()
@@ -109,7 +98,7 @@ IMPL_LINK_NOARG(ScLinkedAreaDlg, BrowseHdl)
IMPL_LINK_NOARG(ScLinkedAreaDlg, FileHdl)
{
- OUString aEntered = aCbUrl.GetURL();
+ OUString aEntered = m_pCbUrl->GetURL();
if (pSourceShell)
{
SfxMedium* pMed = pSourceShell->GetMedium();
@@ -179,10 +168,10 @@ void ScLinkedAreaDlg::InitFromOldLink( const String& rFile, const String& rFilte
if (pSourceShell)
{
SfxMedium* pMed = pSourceShell->GetMedium();
- aCbUrl.SetText( pMed->GetName() );
+ m_pCbUrl->SetText( pMed->GetName() );
}
else
- aCbUrl.SetText( EMPTY_STRING );
+ m_pCbUrl->SetText( EMPTY_STRING );
UpdateSourceRanges();
@@ -190,13 +179,13 @@ void ScLinkedAreaDlg::InitFromOldLink( const String& rFile, const String& rFilte
for ( xub_StrLen i=0; i<nRangeCount; i++ )
{
String aRange = rSource.GetToken(i);
- aLbRanges.SelectEntry( aRange );
+ m_pLbRanges->SelectEntry( aRange );
}
bool bDoRefresh = (nRefresh != 0);
- aBtnReload.Check( bDoRefresh );
+ m_pBtnReload->Check( bDoRefresh );
if (bDoRefresh)
- aNfDelay.SetValue( nRefresh );
+ m_pNfDelay->SetValue( nRefresh );
UpdateEnable();
}
@@ -254,7 +243,7 @@ IMPL_LINK( ScLinkedAreaDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg
if ( !pSourceShell->GetError() ) // only errors
{
- aCbUrl.SetText( pMed->GetName() );
+ m_pCbUrl->SetText( pMed->GetName() );
}
else
{
@@ -262,7 +251,7 @@ IMPL_LINK( ScLinkedAreaDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg
pSourceShell = NULL;
aSourceRef.Clear();
- aCbUrl.SetText( EMPTY_STRING );
+ m_pCbUrl->SetText( EMPTY_STRING );
}
}
@@ -276,32 +265,32 @@ IMPL_LINK( ScLinkedAreaDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg
void ScLinkedAreaDlg::UpdateSourceRanges()
{
- aLbRanges.SetUpdateMode(false);
+ m_pLbRanges->SetUpdateMode(false);
- aLbRanges.Clear();
+ m_pLbRanges->Clear();
if ( pSourceShell )
{
ScAreaNameIterator aIter( pSourceShell->GetDocument() );
ScRange aDummy;
OUString aName;
while ( aIter.Next( aName, aDummy ) )
- aLbRanges.InsertEntry( aName );
+ m_pLbRanges->InsertEntry( aName );
}
- aLbRanges.SetUpdateMode(true);
+ m_pLbRanges->SetUpdateMode(true);
- if ( aLbRanges.GetEntryCount() == 1 )
- aLbRanges.SelectEntryPos(0);
+ if ( m_pLbRanges->GetEntryCount() == 1 )
+ m_pLbRanges->SelectEntryPos(0);
}
void ScLinkedAreaDlg::UpdateEnable()
{
- bool bEnable = ( pSourceShell && aLbRanges.GetSelectEntryCount() );
- aBtnOk.Enable( bEnable );
+ bool bEnable = ( pSourceShell && m_pLbRanges->GetSelectEntryCount() );
+ m_pBtnOk->Enable( bEnable );
- bool bReload = aBtnReload.IsChecked();
- aNfDelay.Enable( bReload );
- aFtSeconds.Enable( bReload );
+ bool bReload = m_pBtnReload->IsChecked();
+ m_pNfDelay->Enable( bReload );
+ m_pFtSeconds->Enable( bReload );
}
OUString ScLinkedAreaDlg::GetURL()
@@ -337,20 +326,20 @@ OUString ScLinkedAreaDlg::GetOptions()
OUString ScLinkedAreaDlg::GetSource()
{
OUStringBuffer aBuf;
- sal_uInt16 nCount = aLbRanges.GetSelectEntryCount();
+ sal_uInt16 nCount = m_pLbRanges->GetSelectEntryCount();
for (sal_uInt16 i=0; i<nCount; i++)
{
if (i > 0)
aBuf.append(sal_Unicode(';'));
- aBuf.append(aLbRanges.GetSelectEntry(i));
+ aBuf.append(m_pLbRanges->GetSelectEntry(i));
}
return aBuf.makeStringAndClear();
}
sal_uLong ScLinkedAreaDlg::GetRefresh()
{
- if ( aBtnReload.IsChecked() )
- return sal::static_int_cast<sal_uLong>( aNfDelay.GetValue() );
+ if ( m_pBtnReload->IsChecked() )
+ return sal::static_int_cast<sal_uLong>( m_pNfDelay->GetValue() );
else
return 0; // disabled
}
diff --git a/sc/source/ui/miscdlgs/linkarea.src b/sc/source/ui/miscdlgs/linkarea.src
deleted file mode 100644
index e8fcb33d3a52..000000000000
--- a/sc/source/ui/miscdlgs/linkarea.src
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "linkarea.hrc"
-
-ModalDialog RID_SCDLG_LINKAREA
-{
- HelpID = "sc:ModalDialog:RID_SCDLG_LINKAREA";
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Size = MAP_APPFONT ( 274 , 190 ) ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 218 , 8 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 218 , 25 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 218 , 49 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- FixedLine FL_LOCATION
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 204 , 8 ) ;
- Text [ en-US ] = "URL of ~external data source";
- };
- ComboBox CB_URL
- {
- HelpID = "sc:ComboBox:RID_SCDLG_LINKAREA:CB_URL";
- Pos = MAP_APPFONT ( 12 , 15 ) ;
- Size = MAP_APPFONT ( 174 , 80 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- PushButton BTN_BROWSE
- {
- HelpID = "sc:PushButton:RID_SCDLG_LINKAREA:BTN_BROWSE";
- Pos = MAP_APPFONT ( 190 , 14 ) ;
- Size = MAP_APPFONT ( 14 , 14 ) ;
- Text = "~..." ;
- };
- FixedText FT_HINT
- {
- Pos = MAP_APPFONT ( 12 , 31 ) ;
- Size = MAP_APPFONT ( 192 , 26 ) ;
- WordBreak = TRUE ;
- Text [ en-US ] = "(Enter the URL of the source document in the local file system or Internet here.)";
- };
- FixedText FT_RANGES
- {
- Pos = MAP_APPFONT ( 6 , 62 ) ;
- Size = MAP_APPFONT ( 198 , 8 ) ;
- Text [ en-US ] = "~Available tables/ranges";
- };
- MultiListBox LB_RANGES
- {
- HelpID = "sc:MultiListBox:RID_SCDLG_LINKAREA:LB_RANGES";
- SimpleMode = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 74 ) ;
- Size = MAP_APPFONT ( 192 , 80 ) ;
- AutoHScroll = TRUE ;
- };
- CheckBox BTN_RELOAD
- {
- HelpID = "sc:CheckBox:RID_SCDLG_LINKAREA:BTN_RELOAD";
- Pos = MAP_APPFONT ( 12 , 168 ) ;
- Size = MAP_APPFONT ( 100 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Update every";
- };
- NumericField NF_DELAY
- {
- HelpID = "sc:NumericField:RID_SCDLG_LINKAREA:NF_DELAY";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 113 , 166 ) ;
- Size = MAP_APPFONT ( 32 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Repeat = TRUE ;
- Minimum = 1 ;
- Maximum = 99999 ;
- Value = 60 ;
- };
- FixedText FT_SECONDS
- {
- Pos = MAP_APPFONT ( 149 , 168 ) ;
- Size = MAP_APPFONT ( 59 , 8 ) ;
- Text [ en-US ] = "seconds";
- };
- Text [ en-US ] = "External Data";
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 85fcf8355ffe..c4742b25ca7e 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2346,8 +2346,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
delete pImpl->m_pLinkedDlg;
pImpl->m_pLinkedDlg =
- pFact->CreateScLinkedAreaDlg( pTabViewShell->GetDialogParent(),
- RID_SCDLG_LINKAREA);
+ pFact->CreateScLinkedAreaDlg(pTabViewShell->GetDialogParent());
OSL_ENSURE(pImpl->m_pLinkedDlg, "Dialog create fail!");
delete pImpl->m_pRequest;
pImpl->m_pRequest = new SfxRequest( rReq );