[Libreoffice-commits] .: sc/source

Petr Mladek pmladek at kemper.freedesktop.org
Mon Jun 6 10:53:40 PDT 2011


 sc/source/ui/dbgui/dbnamdlg.cxx |   14 +++-----------
 sc/source/ui/inc/dbfunc.hxx     |    2 +-
 sc/source/ui/inc/dbnamdlg.hxx   |    4 +++-
 sc/source/ui/view/dbfunc.cxx    |   23 +++++++++--------------
 4 files changed, 16 insertions(+), 27 deletions(-)

New commits:
commit 3de51ad4a3d9b0f6e2a9af017bfa192be091bfe7
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Thu Jun 2 11:49:54 2011 -0430

    Replace List with std::vector<ScRange>.

diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 09fd536..ab57796 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 abdfe13..291ec07 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 e547a47..247d405 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 a8a5049..b1b2386 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)


More information about the Libreoffice-commits mailing list