summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-06-06 13:55:04 -0400
committerKohei Yoshida <kyoshida@novell.com>2011-06-06 13:55:04 -0400
commite72cffd9330d88c8ca314273130ebce918727e28 (patch)
tree35c8b30c6ef99b8c3e31e5c56defb10afec5eab5 /sc/source
parent5336fee91b318586e1a0ae9332b567394a4489ef (diff)
parentfa6022f01236b124e88ade381334878c88d69ce5 (diff)
Merge remote branch 'origin/master'
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/dbgui/dbnamdlg.cxx14
-rw-r--r--sc/source/ui/inc/dbfunc.hxx2
-rw-r--r--sc/source/ui/inc/dbnamdlg.hxx4
-rw-r--r--sc/source/ui/view/dbfunc.cxx23
4 files changed, 16 insertions, 27 deletions
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 4b00d757e6a1..99001ccff970 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -194,14 +194,6 @@ ScDbNameDlg::ScDbNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
ScDbNameDlg::~ScDbNameDlg()
{
DELETEZ( pSaveObj );
-
- ScRange* pEntry = (ScRange*)aRemoveList.First();
- while ( pEntry )
- {
- aRemoveList.Remove( pEntry );
- delete pEntry;
- pEntry = (ScRange*)aRemoveList.Next();
- }
}
@@ -590,9 +582,9 @@ IMPL_LINK( ScDbNameDlg, RemoveBtnHdl, void *, EMPTYARG )
SCCOL nColStart, nColEnd;
SCROW nRowStart, nRowEnd;
itr->GetArea( nTab, nColStart, nRowStart, nColEnd, nRowEnd );
- aRemoveList.Insert(
- new ScRange( ScAddress( nColStart, nRowStart, nTab ),
- ScAddress( nColEnd, nRowEnd, nTab ) ) );
+ aRemoveList.push_back(
+ ScRange( ScAddress( nColStart, nRowStart, nTab ),
+ ScAddress( nColEnd, nRowEnd, nTab ) ) );
rDBs.erase(itr);
diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx
index 4160f163aacc..67344c197d0e 100644
--- a/sc/source/ui/inc/dbfunc.hxx
+++ b/sc/source/ui/inc/dbfunc.hxx
@@ -81,7 +81,7 @@ public:
ScDBData* GetDBData( bool bMarkArea = true, ScGetDBMode eMode = SC_DB_MAKE, ScGetDBSelection eSel = SC_DBSEL_KEEP);
ScDBData* GetAnonymousDBData();
- void NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList );
+ void NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const std::vector<ScRange> &rDelAreaList );
void Consolidate( const ScConsolidateParam& rParam, sal_Bool bRecord = sal_True );
diff --git a/sc/source/ui/inc/dbnamdlg.hxx b/sc/source/ui/inc/dbnamdlg.hxx
index e9ce21292b8d..a5bd150be1f2 100644
--- a/sc/source/ui/inc/dbnamdlg.hxx
+++ b/sc/source/ui/inc/dbnamdlg.hxx
@@ -29,6 +29,8 @@
#ifndef SC_DBNAMDLG_HXX
#define SC_DBNAMDLG_HXX
+#include <vector>
+
#include <vcl/combobox.hxx>
#include <vcl/fixed.hxx>
@@ -97,7 +99,7 @@ private:
ScDBCollection aLocalDbCol;
ScRange theCurArea;
- List aRemoveList;
+ std::vector<ScRange> aRemoveList;
#ifdef _DBNAMDLG_CXX
private:
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index bc2d0f6bce33..c1b5502977ef 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -211,7 +211,7 @@ ScDBData* ScDBFunc::GetAnonymousDBData()
// Datenbankbereiche aendern (Dialog)
-void ScDBFunc::NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList )
+void ScDBFunc::NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const std::vector<ScRange> &rDelAreaList )
{
ScDocShell* pDocShell = GetViewData()->GetDocShell();
@@ -222,21 +222,16 @@ void ScDBFunc::NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List&
ScDBCollection* pRedoColl = NULL;
const sal_Bool bRecord (pDoc->IsUndoEnabled());
- long nDelCount = rDelAreaList.Count();
- for (long nDelPos=0; nDelPos<nDelCount; nDelPos++)
+ std::vector<ScRange>::const_iterator iter;
+ for (iter = rDelAreaList.begin(); iter != rDelAreaList.end(); ++iter)
{
- ScRange* pEntry = (ScRange*) rDelAreaList.GetObject(nDelPos);
+ // Targets am SBA abmelden nicht mehr noetig
+ const ScAddress& rStart = iter->aStart;
+ const ScAddress& rEnd = iter->aEnd;
+ pDocShell->DBAreaDeleted( rStart.Tab(),
+ rStart.Col(), rStart.Row(),
+ rEnd.Col(), rEnd.Row() );
- if ( pEntry )
- {
- ScAddress& rStart = pEntry->aStart;
- ScAddress& rEnd = pEntry->aEnd;
- pDocShell->DBAreaDeleted( rStart.Tab(),
- rStart.Col(), rStart.Row(),
- rEnd.Col(), rEnd.Row() );
-
- // Targets am SBA abmelden nicht mehr noetig
- }
}
if (bRecord)