[Libreoffice-commits] .: Branch 'feature/calc-multiline-input' - 35 commits - chart2/source .gitignore sc/CppunitTest_sc_ucalc.mk sc/inc sc/Library_sc.mk sc/Package_qa_unit.mk sc/qa sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Mon May 23 12:44:50 PDT 2011


 .gitignore                                                    |    6 
 chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx |    2 
 chart2/source/controller/main/ShapeController.cxx             |    2 
 chart2/source/model/main/ChartModel.cxx                       |    4 
 chart2/source/view/axes/ScaleAutomatism.cxx                   |    2 
 chart2/source/view/axes/Tickmarks_Dates.cxx                   |    6 
 chart2/source/view/charttypes/VSeriesPlotter.cxx              |    4 
 chart2/source/view/main/VLegend.cxx                           |    4 
 sc/CppunitTest_sc_ucalc.mk                                    |   13 
 sc/Library_sc.mk                                              |    2 
 sc/Package_qa_unit.mk                                         |   44 
 sc/inc/arealink.hxx                                           |   16 
 sc/inc/compiler.hxx                                           |    4 
 sc/inc/datauno.hxx                                            |    2 
 sc/inc/dbcolect.hxx                                           |  217 --
 sc/inc/dbdata.hxx                                             |  266 ++
 sc/inc/document.hxx                                           |   11 
 sc/inc/rangeutl.hxx                                           |   10 
 sc/inc/table.hxx                                              |    2 
 sc/qa/unit/Makefile                                           |   53 
 sc/source/core/data/column2.cxx                               |    2 
 sc/source/core/data/column3.cxx                               |  107 -
 sc/source/core/data/documen2.cxx                              |    4 
 sc/source/core/data/documen3.cxx                              |  107 -
 sc/source/core/data/document.cxx                              |   22 
 sc/source/core/data/drwlayer.cxx                              |   13 
 sc/source/core/data/table1.cxx                                |   14 
 sc/source/core/data/table2.cxx                                |    2 
 sc/source/core/data/table6.cxx                                |    3 
 sc/source/core/data/validat.cxx                               |   12 
 sc/source/core/inc/core_pch.hxx                               |    3 
 sc/source/core/tool/compiler.cxx                              |   41 
 sc/source/core/tool/dbcolect.cxx                              |  861 --------
 sc/source/core/tool/dbdata.cxx                                | 1037 ++++++++++
 sc/source/core/tool/interpr4.cxx                              |    5 
 sc/source/core/tool/rangeutl.cxx                              |   62 
 sc/source/filter/excel/excdoc.cxx                             |    2 
 sc/source/filter/excel/excimp8.cxx                            |    2 
 sc/source/filter/excel/excrecds.cxx                           |    2 
 sc/source/filter/excel/xeescher.cxx                           |    8 
 sc/source/filter/excel/xename.cxx                             |    2 
 sc/source/filter/excel/xepage.cxx                             |    8 
 sc/source/filter/html/htmlexp.cxx                             |    8 
 sc/source/filter/html/htmlpars.cxx                            |   10 
 sc/source/filter/inc/filt_pch.hxx                             |    1 
 sc/source/filter/rtf/rtfparse.cxx                             |   24 
 sc/source/filter/starcalc/scflt.cxx                           |    4 
 sc/source/filter/xml/XMLExportDatabaseRanges.cxx              |  197 -
 sc/source/filter/xml/XMLExportDatabaseRanges.hxx              |    2 
 sc/source/filter/xml/xmldrani.cxx                             |  220 --
 sc/source/filter/xml/xmldrani.hxx                             |    6 
 sc/source/filter/xml/xmlexprt.cxx                             |    2 
 sc/source/ui/app/inputhdl.cxx                                 |    2 
 sc/source/ui/app/inputwin.cxx                                 |   42 
 sc/source/ui/app/scmod.cxx                                    |    2 
 sc/source/ui/dbgui/consdlg.cxx                                |   10 
 sc/source/ui/dbgui/dbnamdlg.cxx                               |  101 
 sc/source/ui/dbgui/fieldwnd.cxx                               |   10 
 sc/source/ui/dbgui/filtdlg.cxx                                |    2 
 sc/source/ui/dbgui/foptmgr.cxx                                |    8 
 sc/source/ui/dbgui/pfiltdlg.cxx                               |    2 
 sc/source/ui/dbgui/sfiltdlg.cxx                               |    2 
 sc/source/ui/dbgui/tpsort.cxx                                 |    2 
 sc/source/ui/docshell/arealink.cxx                            |   18 
 sc/source/ui/docshell/dbdocfun.cxx                            |  117 -
 sc/source/ui/docshell/dbdocimp.cxx                            |   16 
 sc/source/ui/docshell/docsh.cxx                               |    2 
 sc/source/ui/docshell/docsh2.cxx                              |    2 
 sc/source/ui/docshell/docsh4.cxx                              |   39 
 sc/source/ui/docshell/docsh5.cxx                              |   14 
 sc/source/ui/drawfunc/drawsh.cxx                              |    2 
 sc/source/ui/drawfunc/fuins1.cxx                              |    2 
 sc/source/ui/inc/consdlg.hxx                                  |    2 
 sc/source/ui/inc/dbdocfun.hxx                                 |   27 
 sc/source/ui/inc/dbfunc.hxx                                   |    2 
 sc/source/ui/inc/dbnamdlg.hxx                                 |    3 
 sc/source/ui/inc/inputwin.hxx                                 |    2 
 sc/source/ui/inc/navipi.hxx                                   |    2 
 sc/source/ui/inc/simpref.hxx                                  |    2 
 sc/source/ui/inc/ui_pch.hxx                                   |    3 
 sc/source/ui/inc/undodat.hxx                                  |    8 
 sc/source/ui/navipi/content.cxx                               |   46 
 sc/source/ui/navipi/navipi.cxx                                |    2 
 sc/source/ui/navipi/scenwnd.cxx                               |   29 
 sc/source/ui/optdlg/opredlin.cxx                              |    7 
 sc/source/ui/optdlg/tpview.cxx                                |    2 
 sc/source/ui/src/globstr.src                                  |    2 
 sc/source/ui/src/optdlg.src                                   |    2 
 sc/source/ui/undo/refundo.cxx                                 |    2 
 sc/source/ui/undo/undobase.cxx                                |    2 
 sc/source/ui/undo/undoblk.cxx                                 |    2 
 sc/source/ui/undo/undodat.cxx                                 |   29 
 sc/source/ui/undo/undoutil.cxx                                |    2 
 sc/source/ui/unoobj/cellsuno.cxx                              |    2 
 sc/source/ui/unoobj/datauno.cxx                               |   71 
 sc/source/ui/unoobj/dispuno.cxx                               |    2 
 sc/source/ui/unoobj/fmtuno.cxx                                |    2 
 sc/source/ui/vba/vbarange.cxx                                 |    2 
 sc/source/ui/vba/vbasheetobjects.cxx                          |    4 
 sc/source/ui/view/cellsh.cxx                                  |   17 
 sc/source/ui/view/cellsh1.cxx                                 |    2 
 sc/source/ui/view/cellsh2.cxx                                 |   25 
 sc/source/ui/view/dbfunc.cxx                                  |   45 
 sc/source/ui/view/dbfunc3.cxx                                 |    6 
 sc/source/ui/view/gridwin.cxx                                 |    2 
 sc/source/ui/view/gridwin4.cxx                                |    2 
 sc/source/ui/view/tabvwsh4.cxx                                |   18 
 sc/source/ui/view/tabvwshb.cxx                                |    7 
 sc/source/ui/view/viewfun2.cxx                                |   16 
 sc/source/ui/view/viewfun3.cxx                                |    2 
 sc/source/ui/view/viewfun4.cxx                                |    6 
 sc/source/ui/view/viewfun5.cxx                                |    2 
 sc/source/ui/view/viewfunc.cxx                                |    2 
 113 files changed, 2084 insertions(+), 2187 deletions(-)

New commits:
commit 42eb2de7a08c50b36b731f6df67f119e2d5d6fdf
Merge: e0142fa... 551cca5...
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon May 23 15:39:06 2011 -0400

    Merge branch 'master' into feature/calc-multiline-input

commit 551cca5872a7dff96016e964a602c17a516b2ef3
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Mon May 23 07:19:28 2011 -0700

    Fix an old remove DECLARE_LIST bug. Could be related to fdo#37429
    
    Thanks for finding this go to npcdoom.

diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx
index 1243138..beeb479 100644
--- a/sc/source/filter/rtf/rtfparse.cxx
+++ b/sc/source/filter/rtf/rtfparse.cxx
@@ -239,15 +239,21 @@ void ScRTFParser::NewCellRow( ImportInfo* /*pInfo*/ )
         ScRTFCellDefault* pD;
         bNewDef = false;
         // rechts nicht buendig? => neue Tabelle
-        if (  nLastWidth
-           && ( (pD = &(pDefaultList->back())) != 0 )
-           && pD->nTwips != nLastWidth
-           )
+        if ( nLastWidth && !pDefaultList->empty() )
         {
-            SCCOL n1, n2;
-            if ( !( SeekTwips( nLastWidth, &n1 )
-                && SeekTwips( pD->nTwips, &n2 ) && n1 == n2) )
-                ColAdjust();
+            pD = &(pDefaultList->back());
+            if (pD->nTwips != nLastWidth )
+            {
+                SCCOL n1, n2;
+                if ( !(  SeekTwips( nLastWidth, &n1 )
+                      && SeekTwips( pD->nTwips, &n2 )
+                      && n1 == n2
+                      )
+                )
+                {
+                    ColAdjust();
+                }
+            }
         }
         // TwipCols aufbauen, erst nach nLastWidth Vergleich!
         for ( size_t i = 0, nListSize = pDefaultList->size(); i < nListSize; ++i )
commit a40d55fb96728318eac7964ff069795f810ea4de
Author: David Tardon <dtardon at redhat.com>
Date:   Mon May 23 14:33:11 2011 +0200

    fix mis-merge

diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index d58b8bd..ec8db65 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -30,23 +30,10 @@
 
 $(eval $(call gb_CppunitTest_CppunitTest,sc_ucalc))
 
-$(eval $(call gb_CppunitTest_add_package_headers,sc_ucalc,sc_qa_unit))
-
 $(eval $(call gb_CppunitTest_add_exception_objects,sc_ucalc, \
     sc/qa/unit/ucalc \
 ))
 
-$(eval $(call gb_CppunitTest_set_args,sc_ucalc,\
-	--headless \
-	--invisible \
-	"-env:UNO_TYPES=$(foreach binrdb,udkapi.rdb types.rdb,\
-		file://$(if $(filter WNT,$(OS)),/)$(OUTDIR)/bin/$(binrdb))" \
-	"-env:UNO_SERVICES=$(foreach rdb,$(OUTDIR)/xml/ure/services.rdb $(WORKDIR)/CustomTarget/sc/qa/unit/services.rdb,\
-		file://$(if $(filter WNT,$(OS)),/)$(rdb))" \
-	$(foreach dir,URE_INTERNAL_LIB_DIR OOO_BASE_DIR BRAND_BASE_DIR, \
-		-env:$(dir)=file://$(if $(filter WNT,$(OS)),/$(OUTDIR)/bin,$(OUTDIR)/lib)) \
-))
-
 $(eval $(call gb_CppunitTest_add_library_objects,sc_ucalc,sc))
 
 $(eval $(call gb_CppunitTest_add_linked_libs,sc_ucalc, \
diff --git a/sc/Package_qa_unit.mk b/sc/Package_qa_unit.mk
deleted file mode 100644
index 8db8cb7..0000000
--- a/sc/Package_qa_unit.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Version: MPL 1.1 / GPLv3+ / LGPLv3+
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (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.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Initial Developer of the Original Code is
-#        Bjoern Michaelsen <bjoern.michaelsen at canonical.com> (Canonical Ltd.)
-# Portions created by the Initial Developer are Copyright (C) 2011 the
-# Initial Developer. All Rights Reserved.
-#
-# Contributor(s): Bjoern Michaelsen <bjoern.michaelsen at canonical.com> (Canonical Ltd.)
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
-# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
-# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
-# instead of those above.
-
-$(eval $(call gb_Package_Package,sc_qa_unit,$(WORKDIR)/CustomTarget/sc/qa/unit))
-$(eval $(call gb_Package_add_customtarget,sc_qa_unit,sc/qa/unit))
-
-# dependencies that cause the CustomTarget Makefile to be called recursively for
-# (re)build
-$(eval $(call gb_CustomTarget_add_outdir_dependencies,sc/qa/unit,\
-	$(foreach newcomponentfile,\
-		framework/util/fwk \
-		sfx2/util/sfx \
-		unoxml/source/service/unoxml,\
-	$(OUTDIR)/xml/component/$(newcomponentfile).component) \
-	$(foreach oldcomponentfile, \
-		i18npool \
-		ucb1 \
-		ucpfile1, \
-	$(OUTDIR)/xml/$(oldcomponentfile).component) \
-))
-
-# vim: set noet sw=4:
diff --git a/sc/qa/unit/Makefile b/sc/qa/unit/Makefile
deleted file mode 100644
index 87694f1..0000000
--- a/sc/qa/unit/Makefile
+++ /dev/null
@@ -1,53 +0,0 @@
-# Version: MPL 1.1 / GPLv3+ / LGPLv3+
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (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.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Initial Developer of the Original Code is
-#        Bjoern Michaelsen <bjoern.michaelsen at canonical.com> (Canonical Ltd.)
-# Portions created by the Initial Developer are Copyright (C) 2011 the
-# Initial Developer. All Rights Reserved.
-#
-# Contributor(s): Bjoern Michaelsen <bjoern.michaelsen at canonical.com> (Canonical Ltd.)
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
-# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
-# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
-# instead of those above.
-
-MYDIR := $(realpath $(dir $(firstword $(MAKEFILE_LIST))))
-
-all : services.rdb
-
-services.rdb : $(foreach newcomponentfile,\
-		framework/util/fwk \
-		sfx2/util/sfx \
-		unoxml/source/service/unoxml,\
-	$(OUTDIR)/xml/component/$(newcomponentfile).component \
-)
-
-services.rdb : $(foreach oldcomponentfile, \
-		i18npool \
-		ucb1 \
-		ucpfile1, \
-	$(OUTDIR)/xml/$(oldcomponentfile).component \
-)
-
-services.rdb :
-	echo '<?xml version="1.0"?><components xmlns="http://openoffice.org/2010/uno-components">' > $@
-	$(gb_AWK) -- \
-		'/^<\?xml version.*/ { next; } \
-		{ gsub(/vnd.sun.star.expand:\$$OOO_BASE_DIR\/program/, "vnd.sun.star.expand:$$OOO_BASE_DIR",$$0); gsub(/vnd.sun.star.expand:\$$BRAND_BASE_DIR\/program/, "vnd.sun.star.expand:$$BRAND_BASE_DIR",$$0); print; }' \
-		$^ >> $@
-	echo '</components>' >> $@
-
-.PHONY : all
-# vim: set noet sw=4 ts=4:
commit d30c66cb1954103a159da2ef82dba4bf9685844f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun May 22 23:35:50 2011 +0200

    fix for fdo#37429 crash when copy/paste table from writer to calc

diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx
index 44d0498..1243138 100644
--- a/sc/source/filter/rtf/rtfparse.cxx
+++ b/sc/source/filter/rtf/rtfparse.cxx
@@ -299,7 +299,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
     {
         case RTF_TROWD:			// denotes table row defauls, before RTF_CELLX
         {
-            if ( (pD = &(pDefaultList->back())) != 0 )
+            if ( !pDefaultList->empty() && (pD = &(pDefaultList->back())) != 0 )
                 nLastWidth = pD->nTwips;
             nColCnt = 0;
             pDefaultList->clear();
commit dea06b746fb0b9e7d06f4eeba41c352bd33d887c
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Sat May 21 18:29:38 2011 -0430

    Replace List for std::vector<String>.

diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 74ee9d3..215a658 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -552,13 +552,12 @@ void ScTabViewShell::GetUndoState(SfxItemSet &rSet)
                     SfxStringListItem aStrLst( nWhich );
                     if ( pUndoManager )
                     {
-                        List* pList = aStrLst.GetList();
+                        std::vector<String> &aList = aStrLst.GetList();
                         sal_Bool bIsUndo = ( nWhich == SID_GETUNDOSTRINGS );
                         size_t nCount = bIsUndo ? pUndoManager->GetUndoActionCount() : pUndoManager->GetRedoActionCount();
                         for (size_t i=0; i<nCount; i++)
-                            pList->Insert( new String( bIsUndo ? pUndoManager->GetUndoActionComment(i) :
-                                                                 pUndoManager->GetRedoActionComment(i) ),
-                                           LIST_APPEND );
+                            aList.push_back( bIsUndo ? pUndoManager->GetUndoActionComment(i) :
+                                                       pUndoManager->GetRedoActionComment(i) );
                     }
                     rSet.Put( aStrLst );
                 }
commit 6da3ad3fc84228effdd09221dd7d4c3a1755f8d4
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Sat May 21 18:24:08 2011 -0430

    Replace List for std::vector<String>.

diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 5d6c875..d795128 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -735,8 +735,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
 
             case SID_SELECT_SCENARIO:
                 {
-                    List		aList;
-
+                    std::vector<String> aList;
                     Color	aDummyCol;
 
                     if ( !pDoc->IsScenario(nTab) )
@@ -750,12 +749,12 @@ void ScCellShell::GetState(SfxItemSet &rSet)
                         while ( pDoc->IsScenario(nScTab) )
                         {
                             pDoc->GetName( nScTab, aStr );
-                            aList.Insert( new String( aStr ), LIST_APPEND );
+                            aList.push_back(aStr);
                             pDoc->GetScenarioData( nScTab, aStr, aDummyCol, nFlags );
-                            aList.Insert( new String( aStr ), LIST_APPEND );
+                            aList.push_back(aStr);
                             // Protection is sal_True if both Sheet and Scenario are protected
                             aProtect = (bSheetProtected && (nFlags & SC_SCENARIO_PROTECT)) ? '1' : '0';
-                            aList.Insert( new String( aProtect), LIST_APPEND );
+                            aList.push_back(aProtect);
                             ++nScTab;
                         }
                     }
@@ -764,15 +763,11 @@ void ScCellShell::GetState(SfxItemSet &rSet)
                         String	aComment;
                         sal_uInt16	nDummyFlags;
                         pDoc->GetScenarioData( nTab, aComment, aDummyCol, nDummyFlags );
-                        DBG_ASSERT( aList.Count() == 0, "List not empty!" );
-                        aList.Insert( new String( aComment ) );
+                        DBG_ASSERT( aList.empty(), "List not empty!" );
+                        aList.push_back(aComment);
                     }
 
                     rSet.Put( SfxStringListItem( nWhich, &aList ) );
-
-                    sal_uLong nCount = aList.Count();
-                    for ( sal_uLong i=0; i<nCount; i++ )
-                        delete (String*) aList.GetObject(i);
                 }
                 break;
 
commit a78957fe6458ee5298c31ef5356fdcd6e6ea61b0
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Sat May 21 18:13:34 2011 -0430

    Replace List for std::vector<String>.

diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx
index 1f3cbd8..46c8578 100644
--- a/sc/source/ui/inc/navipi.hxx
+++ b/sc/source/ui/inc/navipi.hxx
@@ -73,7 +73,7 @@ public:
     explicit            ScScenarioListBox( ScScenarioWindow& rParent );
     virtual             ~ScScenarioListBox();
 
-    void                UpdateEntries( List* pNewEntryList );
+    void                UpdateEntries( const std::vector<String> &aNewEntryList );
 
 protected:
     virtual void        Select();
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index 377f4a8..56cfa47 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -64,15 +64,12 @@ ScScenarioListBox::~ScScenarioListBox()
 {
 }
 
-void ScScenarioListBox::UpdateEntries( List* pNewEntryList )
+void ScScenarioListBox::UpdateEntries( const std::vector<String> &aNewEntryList )
 {
     Clear();
     maEntries.clear();
 
-    if( !pNewEntryList )
-        return;
-
-    switch( pNewEntryList->Count() )
+    switch( aNewEntryList.size() )
     {
         case 0:
             // no scenarios in current sheet
@@ -81,31 +78,33 @@ void ScScenarioListBox::UpdateEntries( List* pNewEntryList )
 
         case 1:
             // sheet is a scenario container, comment only
-            mrParent.SetComment( *static_cast< String* >( pNewEntryList->First() ) );
+            mrParent.SetComment( aNewEntryList[0] );
         break;
 
         default:
         {
             // sheet contains scenarios
-            DBG_ASSERT( pNewEntryList->Count() % 3 == 0, "ScScenarioListBox::UpdateEntries - wrong list size" );
+            DBG_ASSERT( aNewEntryList.size() % 3 == 0, "ScScenarioListBox::UpdateEntries - wrong list size" );
             SetUpdateMode( false );
-            String* pEntry = static_cast< String* >( pNewEntryList->First() );
-            while( pEntry )
+
+            std::vector<String>::const_iterator iter;
+            for (iter = aNewEntryList.begin(); iter != aNewEntryList.end(); ++iter)
             {
                 ScenarioEntry aEntry;
 
                 // first entry of a triple is the scenario name
-                aEntry.maName = *pEntry;
+                aEntry.maName = *iter;
+
                 // second entry of a triple is the scenario comment
-                if( (pEntry = static_cast< String* >( pNewEntryList->Next() )) != 0 )
-                    aEntry.maComment = *pEntry;
+                ++iter;
+                aEntry.maComment = *iter;
+
                 // third entry of a triple is the protection ("0" = not protected, "1" = protected)
-                if( (pEntry = static_cast< String* >( pNewEntryList->Next() )) != 0 )
-                    aEntry.mbProtected = (pEntry->Len() > 0) && (pEntry->GetChar( 0 ) != '0');
+                ++iter;
+                aEntry.mbProtected = (iter->Len() > 0) && (iter->GetChar( 0 ) != '0');
 
                 maEntries.push_back( aEntry );
                 InsertEntry( aEntry.maName, LISTBOX_APPEND );
-                pEntry = static_cast< String* >( pNewEntryList->Next() );
             }
             SetUpdateMode( sal_True );
             SetNoSelection();
commit 66ac561d255ab92a43dcf933ac9bc76577ba7659
Author: David Tardon <dtardon at redhat.com>
Date:   Mon May 23 07:38:02 2011 +0200

    compensate for already shifted segments

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 25706e6..c281a35 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -526,6 +526,11 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe
         {
             SCSIZE nStartSegment(aIt->first);
             bool bMoveSegment(aIt->second);
+            // The indexes in aRemovedSegments denote cell positions in the
+            // original array. But as we are shifting it from the left, we have
+            // to compensate for already performed shifts for latter segments.
+            // TODO: use reverse iterators instead
+            SCSIZE nShift(0);
             ++aIt;
             do
             {
@@ -533,9 +538,12 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe
                 if (bMoveSegment)
                 {
                     memmove(
-                            &pItems[nStartSegment], &pItems[nEndSegment],
+                            &pItems[nStartSegment - nShift],
+                            &pItems[nEndSegment - nShift],
                             (nCount - nEndSegment) * sizeof(ColEntry));
-                    nCount -= nEndSegment - nStartSegment;
+                    SCSIZE const nNewShift(nEndSegment - nStartSegment);
+                    nShift += nNewShift;
+                    nCount -= nNewShift;
                 }
                 nStartSegment = nEndSegment;
                 bMoveSegment = aIt->second;
commit 0fd5c0237e0fcfe481371c6f5b95d51f35e4bd17
Author: David Tardon <dtardon at redhat.com>
Date:   Sun May 22 13:01:36 2011 +0200

    improve perf. of removing contents of large number of cells

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index d447552..25706e6 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -30,7 +30,9 @@
 #include "precompiled_sc.hxx"
 // INCLUDE ---------------------------------------------------------------
 
+#include <boost/scoped_ptr.hpp>
 
+#include <mdds/flat_segment_tree.hpp>
 
 #include <sfx2/objsh.hxx>
 #include <svl/zforlist.hxx>
@@ -377,13 +379,6 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe
             if ( ScPostIt* pNote = pItems[ nIdx ].pCell->GetNote() )
                 pNote->ForgetCaption();
 
-    // special simple mode if all contents are deleted and cells do not contain broadcasters
-    bool bSimple = ((nDelFlag & IDF_CONTENTS) == IDF_CONTENTS);
-    if (bSimple)
-        for ( SCSIZE nIdx = nStartIndex; bSimple && (nIdx <= nEndIndex); ++nIdx )
-            if (pItems[ nIdx ].pCell->GetBroadcaster())
-                bSimple = false;
-
     ScHint aHint( SC_HINT_DYING, ScAddress( nCol, 0, nTab ), 0 );
 
     // cache all formula cells, they will be deleted at end of this function
@@ -391,12 +386,17 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe
     FormulaCellVector aDelCells;
     aDelCells.reserve( nEndIndex - nStartIndex + 1 );
 
-    // simple deletion of the cell objects
-    if (bSimple)
+    typedef mdds::flat_segment_tree<SCSIZE, bool> RemovedSegments_t;
+    RemovedSegments_t aRemovedSegments(nStartIndex, nEndIndex + 1, false);
+    SCSIZE nFirst(nStartIndex);
+
+    // dummy replacement for old cells, to prevent that interpreter uses old cell
+    boost::scoped_ptr<ScNoteCell> pDummyCell(new ScNoteCell);
+
+    for ( SCSIZE nIdx = nStartIndex; nIdx <= nEndIndex; ++nIdx )
     {
-        // pNoteCell: dummy replacement for old cells, to prevent that interpreter uses old cell
-        ScNoteCell* pNoteCell = new ScNoteCell;
-        for ( SCSIZE nIdx = nStartIndex; nIdx <= nEndIndex; ++nIdx )
+        // all contents is deleted and cell do not contain broadcaster
+        if (((nDelFlag & IDF_CONTENTS) == IDF_CONTENTS) && pItems[ nIdx ].pCell->GetBroadcaster())
         {
             ScBaseCell* pOldCell = pItems[ nIdx ].pCell;
             if (pOldCell->GetCellType() == CELLTYPE_FORMULA)
@@ -407,27 +407,19 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe
             else
             {
                 // interpret in broadcast must not use the old cell
-                pItems[ nIdx ].pCell = pNoteCell;
+                pItems[ nIdx ].pCell = pDummyCell.get();
                 aHint.GetAddress().SetRow( pItems[ nIdx ].nRow );
                 aHint.SetCell( pOldCell );
                 pDocument->Broadcast( aHint );
                 pOldCell->Delete();
             }
         }
-        delete pNoteCell;
-        memmove( &pItems[nStartIndex], &pItems[nEndIndex + 1], (nCount - nEndIndex - 1) * sizeof(ColEntry) );
-        nCount -= nEndIndex-nStartIndex+1;
-    }
-
-    // else: delete some contents of the cells
-    else
-    {
-        SCSIZE j = nStartIndex;
-        for ( SCSIZE nIdx = nStartIndex; nIdx <= nEndIndex; ++nIdx )
+        // delete some contents of the cells
+        else
         {
             // decide whether to delete the cell object according to passed flags
             bool bDelete = false;
-            ScBaseCell* pOldCell = pItems[j].pCell;
+            ScBaseCell* pOldCell = pItems[nIdx].pCell;
             CellType eCellType = pOldCell->GetCellType();
             switch ( eCellType )
             {
@@ -439,7 +431,7 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe
                     // if not, decide according to cell number format
                     if( !bDelete && (nValFlags != 0) )
                     {
-                        sal_uLong nIndex = (sal_uLong)((SfxUInt32Item*)GetAttr( pItems[j].nRow, ATTR_VALUE_FORMAT ))->GetValue();
+                        sal_uLong nIndex = (sal_uLong)((SfxUInt32Item*)GetAttr( pItems[nIdx].nRow, ATTR_VALUE_FORMAT ))->GetValue();
                         short nType = pDocument->GetFormatTable()->GetType(nIndex);
                         bool bIsDate = (nType == NUMBERFORMAT_DATE) || (nType == NUMBERFORMAT_TIME) || (nType == NUMBERFORMAT_DATETIME);
                         bDelete = nValFlags == (bIsDate ? IDF_DATETIME : IDF_VALUE);
@@ -479,21 +471,16 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe
                 }
 
                 // remove cell entry in cell item list
-                SCROW nOldRow = pItems[j].nRow;
+                SCROW nOldRow = pItems[nIdx].nRow;
                 if (pNoteCell)
                 {
                     // replace old cell with the replacement note cell
-                    pItems[j].pCell = pNoteCell;
-                    ++j;
+                    pItems[nIdx].pCell = pNoteCell;
+                    // ... so it's not really deleted
+                    bDelete = false;
                 }
                 else
-                {
-                    // remove the old cell from the cell item list
-                    --nCount;
-                    memmove( &pItems[j], &pItems[j + 1], (nCount - j) * sizeof(ColEntry) );
-                    pItems[nCount].nRow = 0;
-                    pItems[nCount].pCell = 0;
-                }
+                    pItems[nIdx].pCell = pDummyCell.get();
 
                 // cache formula cells (will be deleted later), delete cell of other type
                 if (eCellType == CELLTYPE_FORMULA)
@@ -514,10 +501,46 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe
             {
                 // delete cell note
                 if (bDeleteNote)
-                    pItems[j].pCell->DeleteNote();
-                // cell not deleted, move index to next cell
-                ++j;
+                    pItems[nIdx].pCell->DeleteNote();
             }
+
+            if (!bDelete)
+            {
+                // We just came to a non-deleted cell after a segment of
+                // deleted ones. So we need to remember the segment
+                // before moving on.
+                if (nFirst < nIdx)
+                    aRemovedSegments.insert_back(nFirst, nIdx, true);
+                nFirst = nIdx + 1;
+            }
+        }
+    }
+    // there is a segment of deleted cells at the end
+    if (nFirst < nEndIndex)
+        aRemovedSegments.insert_back(nFirst, nEndIndex + 1, true);
+
+    {
+        RemovedSegments_t::const_iterator aIt(aRemovedSegments.begin());
+        RemovedSegments_t::const_iterator aEnd(aRemovedSegments.end());
+        if (aIt != aEnd)
+        {
+            SCSIZE nStartSegment(aIt->first);
+            bool bMoveSegment(aIt->second);
+            ++aIt;
+            do
+            {
+                SCSIZE const nEndSegment(aIt->first);
+                if (bMoveSegment)
+                {
+                    memmove(
+                            &pItems[nStartSegment], &pItems[nEndSegment],
+                            (nCount - nEndSegment) * sizeof(ColEntry));
+                    nCount -= nEndSegment - nStartSegment;
+                }
+                nStartSegment = nEndSegment;
+                bMoveSegment = aIt->second;
+                ++aIt;
+            } while (aIt != aEnd);
         }
     }
 
commit 86d8c9c36e2f3a31a24b9d4980a6ebec6430f657
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 20 08:52:59 2011 +0100

    adjust for return by ref instead of pointer

diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index eed8a4a..672f2a2 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -257,12 +257,12 @@ ScHTMLExport::ScHTMLExport( SvStream& rStrmP, const String& rBaseURL, ScDocument
     sIndent[0] = 0;
 
     // set HTML configuration
-    SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
-    eDestEnc = (pDoc->IsClipOrUndo() ? RTL_TEXTENCODING_UTF8 : pHtmlOptions->GetTextEncoding());
-    bCopyLocalFileToINet = pHtmlOptions->IsSaveGraphicsLocal();
+    SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
+    eDestEnc = (pDoc->IsClipOrUndo() ? RTL_TEXTENCODING_UTF8 : rHtmlOptions.GetTextEncoding());
+    bCopyLocalFileToINet = rHtmlOptions.IsSaveGraphicsLocal();
     for ( sal_uInt16 j=0; j < SC_HTML_FONTSIZES; j++ )
     {
-        sal_uInt16 nSize = pHtmlOptions->GetFontSize( j );
+        sal_uInt16 nSize = rHtmlOptions.GetFontSize( j );
         // remember in Twips, like our SvxFontHeightItem
         if ( nSize )
             nFontSize[j] = nSize * 20;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 329bf96..fb749d6 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2640,7 +2640,7 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
 
         if ( aString.GetChar(0) == '=' )
         {
-            SvxAutoCorrect* pAuto = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+            SvxAutoCorrect* pAuto = SvxAutoCorrCfg::Get().GetAutoCorrect();
             if ( pAuto )
             {
                 sal_Unicode cReplace = pAuto->GetStartDoubleQuote();
commit 45c009cfc8e7f3f8d8a7177aa493ac53657c09dc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu May 19 23:19:39 2011 +0100

    adjust for return by ref instead of pointer

diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 7af88be..0c3531a 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -82,9 +82,9 @@ ScHTMLParser::ScHTMLParser( EditEngine* pEditEngine, ScDocument* pDoc ) :
     ScEEParser( pEditEngine ),
     mpDoc( pDoc )
 {
-    SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
+    SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
     for( sal_uInt16 nIndex = 0; nIndex < SC_HTML_FONTSIZES; ++nIndex )
-        maFontHeights[ nIndex ] = pHtmlOptions->GetFontSize( nIndex ) * 20;
+        maFontHeights[ nIndex ] = rHtmlOptions.GetFontSize( nIndex ) * 20;
 }
 
 ScHTMLParser::~ScHTMLParser()
@@ -1285,9 +1285,9 @@ void ScHTMLLayoutParser::Image( ImportInfo* pInfo )
 
     sal_uInt16 nFormat;
     Graphic* pGraphic = new Graphic;
-    GraphicFilter* pFilter = GraphicFilter::GetGraphicFilter();
+    GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
     if ( GRFILTER_OK != GraphicFilter::LoadGraphic( pImage->aURL, pImage->aFilterName,
-            *pGraphic, pFilter, &nFormat ) )
+            *pGraphic, &rFilter, &nFormat ) )
     {
         delete pGraphic;
         return ;        // dumm gelaufen
@@ -1297,7 +1297,7 @@ void ScHTMLLayoutParser::Image( ImportInfo* pInfo )
         pActEntry->bHasGraphic = sal_True;
         pActEntry->aAltText.Erase();
     }
-    pImage->aFilterName = pFilter->GetImportFormatName( nFormat );
+    pImage->aFilterName = rFilter.GetImportFormatName( nFormat );
     pImage->pGraphic = pGraphic;
     if ( !(pImage->aSize.Width() && pImage->aSize.Height()) )
     {
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 392497f..30549f6 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -224,7 +224,7 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell*	pViewSh,
             bAsLink = ((const SfxBoolItem*)pItem)->GetValue();
 
         Graphic aGraphic;
-        int nError = GraphicFilter::LoadGraphic( aFileName, aFilterName, aGraphic, GraphicFilter::GetGraphicFilter() );
+        int nError = GraphicFilter::LoadGraphic( aFileName, aFilterName, aGraphic, &GraphicFilter::GetGraphicFilter() );
         if ( nError == GRFILTER_OK )
         {
             lcl_InsertGraphic( aGraphic, aFileName, aFilterName, bAsLink, sal_True, pViewSh, pWindow, pView );
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 818f3f5..4847428 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -653,15 +653,15 @@ sal_Bool ScViewFunc::PasteFile( const Point& rPos, const String& rFile, sal_Bool
 
     sal_uInt16 nFilterFormat;
     Graphic aGraphic;
-    GraphicFilter* pGraphicFilter = GraphicFilter::GetGraphicFilter();
+    GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
 
 
-    if (!pGraphicFilter->ImportGraphic(aGraphic, aURL,
+    if (!rGraphicFilter.ImportGraphic(aGraphic, aURL,
             GRFILTER_FORMAT_DONTKNOW, &nFilterFormat ))
     {
         if ( bLink )
         {
-            String aFltName = pGraphicFilter->GetImportFormatName(nFilterFormat);
+            String aFltName = rGraphicFilter.GetImportFormatName(nFilterFormat);
             return PasteGraphic( rPos, aGraphic, aStrURL, aFltName );
         }
         else
commit 908f56761eb0b789137c50cfee1e8a84a1db51d2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed May 18 22:21:04 2011 +0100

    valgrind: fix leak when range isn't transferred to rangelist

diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index 3c50143..e80031f 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -557,12 +557,19 @@ sal_Bool ScRangeStringConverter::GetRangeListFromString(
     while( nOffset >= 0 )
     {
         ScRange* pRange = new ScRange;
-        if (  GetRangeFromString( *pRange, rRangeListStr, pDocument, eConv, nOffset, cSeperator, cQuote )
-           && (nOffset >= 0)
+        if (
+             GetRangeFromString( *pRange, rRangeListStr, pDocument, eConv, nOffset, cSeperator, cQuote ) &&
+             (nOffset >= 0)
            )
+        {
             rRangeList.push_back( pRange );
+            pRange = NULL;
+        }
         else if (nOffset > -1)
             bRet = false;
+        //if ownership transferred to rRangeList pRange was NULLed, otherwwise
+        //delete it
+        delete pRange;
     }
     return bRet;
 }
commit 82cb48a7f71b2591dbfa2079ec3ca859fbbe8c47
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed May 18 15:39:37 2011 +0100

    valgrind: break circular dependency leaks

diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 325dd5d..66f07c7 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -572,6 +572,10 @@ void SAL_CALL ChartModel::dispose() throw(uno::RuntimeException)
     m_xCurrentController.clear();
 
     DisposeHelper::DisposeAndClear( m_xRangeHighlighter );
+
+    if( m_xOldModelAgg.is())
+        m_xOldModelAgg->setDelegator( NULL );
+
     OSL_TRACE( "ChartModel: dispose() called" );
 }
 
commit 43ad627cc85a6a72e2fd5950cc2125db8c226727
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 17 21:42:32 2011 +0100

    adjust to ensure rename

diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 097893f..64a281f 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -167,7 +167,7 @@ ScModule::ScModule( SfxObjectFactory* pFact ) :
 
     //	ErrorHandler anlegen - war in Init()
     //	zwischen OfficeApplication::Init und ScGlobal::Init
-    SvxErrorHandler::Get();
+    SvxErrorHandler::ensure();
     pErrorHdl	 = new SfxErrorHandler( RID_ERRHDLSC,
                                         ERRCODE_AREA_SC,
                                         ERRCODE_AREA_APP2-1,
commit caf9aba1f200b6f2adeca9c933e32747139e7853
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 17 10:03:12 2011 +0100

    adjust for modified singleton

diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index 5c8dccb..4e54097 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -328,7 +328,7 @@ void ShapeController::executeDispatch_FormatArea()
                     SfxItemPool& rItemPool = pDrawViewWrapper->GetModel()->GetItemPool();
                     SfxItemSet aSet( rItemPool, rItemPool.GetFirstWhich(), rItemPool.GetLastWhich() );
                     const SvxColorTableItem* pColorItem = static_cast< const SvxColorTableItem* >( aSet.GetItem( SID_COLOR_TABLE ) );
-                    if ( pColorItem && pColorItem->GetColorTable() == XColorTable::GetStdColorTable() )
+                    if ( pColorItem && pColorItem->GetColorTable() == &XColorTable::GetStdColorTable() )
                     {
                         pDlg->DontDeleteColorTable();
                     }
commit db61126356b89db63d54b7f76b33008c5e7177ce
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 17 10:00:34 2011 +0100

    adjust for modified singleton

diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 8e133fc..9b37ed6 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -242,14 +242,13 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) :
 
         // set color table
         SvxColorTableItem* pColItem = (SvxColorTableItem*) pObjSh->GetItem( SID_COLOR_TABLE );
-        XColorTable* pXCol = pColItem ? pColItem->GetColorTable() : XColorTable::GetStdColorTable();
+        XColorTable* pXCol = pColItem ? pColItem->GetColorTable() : &XColorTable::GetStdColorTable();
         SetColorTable( pXCol );
     }
     else
-        SetColorTable( XColorTable::GetStdColorTable() );
+        SetColorTable( &XColorTable::GetStdColorTable() );
 
     SetSwapGraphics(sal_True);
-//	SetSwapAsynchron(sal_True);		// an der View
 
     SetScaleUnit(MAP_100TH_MM);
     SfxItemPool& rPool = GetItemPool();
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index 0a163a7..a2e676b 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -144,7 +144,7 @@ void ScDocShell::InitItems()
     else
     {
         //	always use global color table instead of local copy
-        PutItem( SvxColorTableItem( XColorTable::GetStdColorTable(), SID_COLOR_TABLE ) );
+        PutItem( SvxColorTableItem( &XColorTable::GetStdColorTable(), SID_COLOR_TABLE ) );
     }
 
     if ( !aDocument.GetForbiddenCharacters().is() ||
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index c8e16b2..45fb2f1 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -422,7 +422,7 @@ void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq, sal_uInt16 nTabPage )
     // (see SwDrawShell::ExecDrawDlg)
     const SvxColorTableItem* pColorItem =
         static_cast<const SvxColorTableItem*>( pViewData->GetSfxDocShell()->GetItem(SID_COLOR_TABLE) );
-    if (pColorItem->GetColorTable() == XColorTable::GetStdColorTable())
+    if (pColorItem->GetColorTable() == &XColorTable::GetStdColorTable())
         pDlg->DontDeleteColorTable();
 
     if ( nTabPage != 0xffff )
diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx
index 03d966d..8c88e22 100644
--- a/sc/source/ui/optdlg/opredlin.cxx
+++ b/sc/source/ui/optdlg/opredlin.cxx
@@ -159,8 +159,6 @@ sal_Bool ScRedlineOptionsTabPage::FillItemSet( SfxItemSet& /* rSet */ )
 
 void ScRedlineOptionsTabPage::Reset( const SfxItemSet& /* rSet */ )
 {
-
-    XColorTable* pColorTbl = XColorTable::GetStdColorTable();
     aContentColorLB.InsertEntry(aAuthorStr);
     aMoveColorLB.InsertEntry(aAuthorStr);
     aInsertColorLB.InsertEntry(aAuthorStr);
@@ -171,9 +169,10 @@ void ScRedlineOptionsTabPage::Reset( const SfxItemSet& /* rSet */ )
     aInsertColorLB.SetUpdateMode( false);
     aRemoveColorLB.SetUpdateMode( false);
 
-    for( sal_uInt16 i = 0; i < pColorTbl->Count(); ++i )
+    XColorTable& rColorTbl = XColorTable::GetStdColorTable();
+    for( sal_uInt16 i = 0; i < rColorTbl.Count(); ++i )
     {
-        XColorEntry* pEntry = pColorTbl->GetColor( i );
+        XColorEntry* pEntry = rColorTbl.GetColor( i );
         Color aColor = pEntry->GetColor();
         String sName = pEntry->GetName();
 
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 9bbc445..ce555fe 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -335,7 +335,7 @@ void ScTpContentOptions::InitGridOpt()
                 pColorTable = ((SvxColorTableItem*)pItem)->GetColorTable();
         }
         else
-            pColorTable = XColorTable::GetStdColorTable();
+            pColorTable = &XColorTable::GetStdColorTable();
 
         if ( !pColorTable )
             return;
commit e1d6a1c542ca2b21f11c581fa6e4be6235deb3af
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri May 20 06:11:07 2011 +0200

    update sheet local db data when sheets are inserted/deleted

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 779fcb7..6c07d4e 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1400,7 +1400,12 @@ void ScTable::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY )
 
 void ScTable::UpdateInsertTab(SCTAB nTable)
 {
-    if (nTab >= nTable) nTab++;
+    if (nTab >= nTable)
+    {
+        nTab++;
+        if (pDBDataNoName)
+            pDBDataNoName->UpdateMoveTab(nTab - 1 ,nTab);
+    }
     for (SCCOL i=0; i <= MAXCOL; i++) aCol[i].UpdateInsertTab(nTable);
 
     if (IsStreamValid())
@@ -1409,7 +1414,12 @@ void ScTable::UpdateInsertTab(SCTAB nTable)
 
 void ScTable::UpdateDeleteTab( SCTAB nTable, sal_Bool bIsMove, ScTable* pRefUndo )
 {
-    if (nTab > nTable) nTab--;
+    if (nTab > nTable)
+    {
+        nTab--;
+        if (pDBDataNoName)
+            pDBDataNoName->UpdateMoveTab(nTab + 1,nTab);
+    }
 
     SCCOL i;
     if (pRefUndo)
commit 6e1ff6d24f0c93af145a73b27918fe49b1960b71
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed May 18 19:09:41 2011 -0400

    Make sure to only export up to 1026 manual page breaks to XLS.
    
    If you export even one excess page break than 1026, Excel refuses
    to load the whole document.

diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx
index 47899eb..5ac8493 100644
--- a/sc/source/filter/excel/xepage.cxx
+++ b/sc/source/filter/excel/xepage.cxx
@@ -330,6 +330,14 @@ XclExpPageSettings::XclExpPageSettings( const XclExpRoot& rRoot ) :
         maData.maHorPageBreaks.push_back(nRow);
     }
 
+    if (maData.maHorPageBreaks.size() > 1026)
+    {
+        // Excel allows only up to 1026 page breaks.  Trim any excess page breaks.
+        ScfUInt16Vec::iterator itr = maData.maHorPageBreaks.begin();
+        ::std::advance(itr, 1026);
+        maData.maHorPageBreaks.erase(itr, maData.maHorPageBreaks.end());
+    }
+
     set<SCCOL> aColBreaks;
     rDoc.GetAllColBreaks(aColBreaks, nScTab, false, true);
     for (set<SCCOL>::const_iterator itr = aColBreaks.begin(), itrEnd = aColBreaks.end(); itr != itrEnd; ++itr)
commit a6c4db6a2ddb42564bd172f96366ea939a5c63a2
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Wed May 18 20:04:12 2011 -0700

    Remove all the #include <tools/ownlist.hxx>
    
    I'm deleting the header since it's no longer used.

diff --git a/sc/source/core/inc/core_pch.hxx b/sc/source/core/inc/core_pch.hxx
index 3e84de8..123e3ca 100644
--- a/sc/source/core/inc/core_pch.hxx
+++ b/sc/source/core/inc/core_pch.hxx
@@ -122,7 +122,6 @@
 #include <vcl/ptrstyle.hxx>
 #include <tools/wintypes.hxx>
 #include <vcl/event.hxx>
-#include <tools/ownlist.hxx>
 #include <svl/itempool.hxx>
 #include <tools/datetime.hxx>
 #include <attrib.hxx>
diff --git a/sc/source/filter/inc/filt_pch.hxx b/sc/source/filter/inc/filt_pch.hxx
index 12207bd..7ff38bc 100644
--- a/sc/source/filter/inc/filt_pch.hxx
+++ b/sc/source/filter/inc/filt_pch.hxx
@@ -177,7 +177,6 @@
 #include <tools/wintypes.hxx>
 #include <vcl/inputctx.hxx>
 #include <vcl/event.hxx>
-#include <tools/ownlist.hxx>
 #include <vcl/cmdevt.hxx>
 #include <vcl/vclenum.hxx>
 #include <cell.hxx>
diff --git a/sc/source/ui/inc/ui_pch.hxx b/sc/source/ui/inc/ui_pch.hxx
index 8c2d201..210784a 100644
--- a/sc/source/ui/inc/ui_pch.hxx
+++ b/sc/source/ui/inc/ui_pch.hxx
@@ -68,7 +68,6 @@
 #include <sot/object.hxx>
 #include <sot/sotdata.hxx>
 #include <sot/factory.hxx>
-#include <tools/ownlist.hxx>
 #include <vcl/font.hxx>
 #include <vcl/wall.hxx>
 #include <vcl/settings.hxx>
commit b6a4bef73ccdb817860e8cb17e3397b0e5ffbdf7
Author: Tor Lillqvist <tml at iki.fi>
Date:   Thu May 19 00:39:00 2011 +0300

    Add the wntgcc directories

diff --git a/.gitignore b/.gitignore
index 788a396..441f779 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,8 @@
 /*/unxlng??.pro
 /*/wntmsc???
 /*/wntmsc???.pro
+/*/wntgcc?
+/*/wntgcc?.pro
 /*/unxmac??.pro
 /*/unxmac??
 /*/unxios?
commit 7949537f8e12105cc39351d0875c7792aedc4d22
Author: Tor Lillqvist <tml at iki.fi>
Date:   Thu May 19 00:33:59 2011 +0300

    Add the unxios and unxand directories

diff --git a/.gitignore b/.gitignore
index de98410..788a396 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,7 @@
 /*/wntmsc???.pro
 /*/unxmac??.pro
 /*/unxmac??
+/*/unxios?
+/*/unxios?.pro
+/*/unxand?
+/*/unxand?.pro
commit a4ee60a86b62af6cf83e9a70152f06f50a79982a
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Tue May 17 11:27:07 2011 +0900

    fdo#34072
    
    replace content in unprotected cells, even if the sheet is protected

diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index f39fad9..4837dc9 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -148,7 +148,8 @@ sal_Bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW
                 !( (eCellType == CELLTYPE_FORMULA &&
                 ((cMatrixFlag = ((ScFormulaCell*)pCell)->GetMatrixFlag()) == MM_REFERENCE))
                 // kein UndoDoc => Matrix nicht wiederherstellbar => nicht ersetzen
-                || (cMatrixFlag != MM_NONE && !pUndoDoc) )
+                || (cMatrixFlag != MM_NONE && !pUndoDoc) ) &&
+             IsBlockEditable(nCol, nRow, nCol, nRow)
             )
         {
             if ( cMatrixFlag == MM_NONE && rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE )
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index ec16f0f..00dc12f 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1632,22 +1632,6 @@ void ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
         }
     }
 
-    if (   nCommand == SVX_SEARCHCMD_REPLACE
-        || nCommand == SVX_SEARCHCMD_REPLACE_ALL )
-    {
-        for ( SCTAB j = nStartTab; j <= nEndTab; j++ )
-        {
-            if ( (bAllTables || rMark.GetTableSelect( j )) &&
-                    pDoc->IsTabProtected( j ) )
-            {
-                if ( pOldSelectedTables )
-                    delete [] pOldSelectedTables;
-                ErrorMessage(STR_PROTECTIONERR);
-                return;
-            }
-        }
-    }
-
     if (   nCommand == SVX_SEARCHCMD_FIND
         || nCommand == SVX_SEARCHCMD_FIND_ALL)
         bAddUndo = false;
commit 5bff70a55a8629d21543fb247ec01c1443e79deb
Author: Christian Dywan <christian.dywan at lanedo.com>
Date:   Wed May 18 16:05:23 2011 +0200

    Unify Display Grid/ Grid Visible and other menu items

diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 91ece56..fa9a9df 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -363,7 +363,7 @@ Resource RID_GLOBSTR
     };
     String STR_UNDO_TRANSLITERATE
     {
-        Text [ en-US ] = "Case/Characters";
+        Text [ en-US ] = "~Change Case";
     };
     String STR_DB_NONAME
     {
diff --git a/sc/source/ui/src/optdlg.src b/sc/source/ui/src/optdlg.src
index a73f582..5a210d0 100644
--- a/sc/source/ui/src/optdlg.src
+++ b/sc/source/ui/src/optdlg.src
@@ -480,7 +480,7 @@ TabPage RID_SCPAGE_CONTENT
         HelpID = "sc:CheckBox:RID_SCPAGE_CONTENT:CB_GUIDELINE";
         Pos = MAP_APPFONT ( 12 , 56 ) ;
         Size = MAP_APPFONT ( 112 , 10 ) ;
-        Text [ en-US ] = "Guides ~while moving";
+        Text [ en-US ] = "Helplines ~While Moving";
     };
     CheckBox CB_HANDLES
     {
commit d33a4bd2c7a041b9081d3bec67f43830aef3fef6
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Tue May 17 23:17:10 2011 -0430

    Fix index out of bounds in ScTableConditionalFormat.

diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index 7e1694d..457e79f 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -287,7 +287,7 @@ void ScTableConditionalFormat::AddEntry_Impl(const ScCondFormatEntryItem& aEntry
 
 ScTableConditionalEntry* ScTableConditionalFormat::GetObjectByIndex_Impl(sal_uInt16 nIndex) const
 {
-    return aEntries[nIndex];
+    return nIndex < aEntries.size() ? aEntries[nIndex] : NULL;
 }
 
 void SAL_CALL ScTableConditionalFormat::addNew(
commit 3bc9bde9abbf304f181279ec541cd18f0e5dcf8e
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Mon May 16 22:09:46 2011 +0200

    WaE - add explicit casting (decimal-types → integer types)

diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
index 724d90f..2a9015b 100644
--- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
@@ -619,7 +619,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
                     {
                         TimeInterval aTimeInterval;
                         aScale.TimeIncrement.MajorTimeInterval >>= aTimeInterval;
-                        aTimeInterval.Number = static_cast<double>(fValue);
+                        aTimeInterval.Number = static_cast<sal_Int32>(fValue);
                         aScale.TimeIncrement.MajorTimeInterval = uno::makeAny( aTimeInterval );
                         bSetScale = true;
                     }
diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx
index cb9be00..461ba21 100644
--- a/chart2/source/view/axes/ScaleAutomatism.cxx
+++ b/chart2/source/view/axes/ScaleAutomatism.cxx
@@ -714,7 +714,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis(
             }
         }
         rExplicitIncrement.MajorTimeInterval.Number = nNumer;
-        nMainIncrementCount = nDayCount/(nNumer*nDaysPerInterval);
+        nMainIncrementCount = static_cast<long>(nDayCount/(nNumer*nDaysPerInterval));
     }
 
     //choose minor time interval:
diff --git a/chart2/source/view/axes/Tickmarks_Dates.cxx b/chart2/source/view/axes/Tickmarks_Dates.cxx
index 9a9cc85..98849b7 100644
--- a/chart2/source/view/axes/Tickmarks_Dates.cxx
+++ b/chart2/source/view/axes/Tickmarks_Dates.cxx
@@ -82,8 +82,8 @@ void DateTickFactory::getAllTicks( ::std::vector< ::std::vector< TickInfo > >& r
     
     Date aNull(m_aScale.NullDate);
 
-    Date aDate = aNull + ::rtl::math::approxFloor(m_aScale.Minimum);
-    Date aMaxDate = aNull + ::rtl::math::approxFloor(m_aScale.Maximum);
+    Date aDate = aNull + static_cast<long>(::rtl::math::approxFloor(m_aScale.Minimum));
+    Date aMaxDate = aNull + static_cast<long>(::rtl::math::approxFloor(m_aScale.Maximum));
 
     uno::Reference< chart2::XScaling > xScaling(m_aScale.Scaling);
     uno::Reference< chart2::XScaling > xInverseScaling(m_xInverseScaling);
@@ -125,7 +125,7 @@ void DateTickFactory::getAllTicks( ::std::vector< ::std::vector< TickInfo > >& r
     }
 
     //create minor date tickinfos
-    aDate = aNull + ::rtl::math::approxFloor(m_aScale.Minimum);
+    aDate = aNull + static_cast<long>(::rtl::math::approxFloor(m_aScale.Minimum));
     while( aDate<= aMaxDate )
     {
         if( bShifted && aDate==aMaxDate )
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 2bd8afe..00c4666 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -1189,11 +1189,11 @@ long VSeriesPlotter::calculateTimeResolutionOnXAxis()
             aNullDate = m_apNumberFormatterWrapper->getNullDate();
         if( aIt!=aEnd )
         {
-            Date aPrevious(aNullDate); aPrevious+=rtl::math::approxFloor(aIt->fValue);
+            Date aPrevious(aNullDate); aPrevious+=static_cast<long>(rtl::math::approxFloor(aIt->fValue));
             ++aIt;
             for(;aIt!=aEnd;++aIt)
             {
-                Date aCurrent(aNullDate); aCurrent+=rtl::math::approxFloor(aIt->fValue);
+                Date aCurrent(aNullDate); aCurrent+=static_cast<long>(rtl::math::approxFloor(aIt->fValue));
                 if( ::com::sun::star::chart::TimeUnit::YEAR == nRet )
                 {
                     if( DateHelper::IsInSameYear( aPrevious, aCurrent ) )
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index b872ee4..cbfef00 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -898,8 +898,8 @@ void VLegend::createShapes(
                     RelativeSize aRelativeSize;
                     if ((xLegendProp->getPropertyValue( C2U( "RelativeSize" )) >>= aRelativeSize))
                     {
-                        aLegendSize.Width = ::rtl::math::approxCeil( aRelativeSize.Primary * rPageSize.Width );
-                        aLegendSize.Height = ::rtl::math::approxCeil( aRelativeSize.Secondary * rPageSize.Height );
+                        aLegendSize.Width = static_cast<sal_Int32>(::rtl::math::approxCeil( aRelativeSize.Primary * rPageSize.Width ));
+                        aLegendSize.Height = static_cast<sal_Int32>(::rtl::math::approxCeil( aRelativeSize.Secondary * rPageSize.Height ));
                     }
                     else
                         eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH;                  
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 9cb0192..8e133fc 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -552,8 +552,8 @@ namespace
     Point lcl_calcAvailableDiff(ScDocument &rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const Point &aWantedDiff)
     {
         Point aAvailableDiff(aWantedDiff);
-        long nHeight = rDoc.GetRowHeight( nRow, nTab ) * HMM_PER_TWIPS;
-        long nWidth = rDoc.GetColWidth( nCol, nTab ) * HMM_PER_TWIPS;
+        long nHeight = static_cast<long>(rDoc.GetRowHeight( nRow, nTab ) * HMM_PER_TWIPS);
+        long nWidth  = static_cast<long>(rDoc.GetColWidth(  nCol, nTab ) * HMM_PER_TWIPS);
         if (aAvailableDiff.Y() > nHeight)
             aAvailableDiff.Y() = nHeight;
         if (aAvailableDiff.X() > nWidth)
@@ -565,8 +565,8 @@ namespace
     {
         rCalcPoly.setB2DPoint(nWhichPoint, basegfx::B2DPoint(rPos.X(), rPos.Y()));
         basegfx::B2DRange aRange(basegfx::tools::getRange(rCalcPoly));
-        return Rectangle(aRange.getMinX(), aRange.getMinY(),
-            aRange.getMaxX(), aRange.getMaxY());
+        return Rectangle(static_cast<long>(aRange.getMinX()), static_cast<long>(aRange.getMinY()),
+            static_cast<long>(aRange.getMaxX()), static_cast<long>(aRange.getMaxY()));
     }
 }
 
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index b80d4c9..e0faf0e 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -196,8 +196,8 @@ static void lcl_GetFromTo( const XclExpRoot& rRoot, const Rectangle &aRect, sal_
             }
             if( r.Left() > aRect.Left() && r.Top() > aRect.Top() )
             {
-                aFrom = Rectangle( nCol-1, HMM2XL( nColOff ),
-                                   nRow-1, HMM2XL( nRowOff ) );
+                aFrom = Rectangle( nCol-1, static_cast<long>(HMM2XL( nColOff )),
+                                   nRow-1, static_cast<long>(HMM2XL( nRowOff )) );
                 bTo=true;
             }
         }
@@ -209,8 +209,8 @@ static void lcl_GetFromTo( const XclExpRoot& rRoot, const Rectangle &aRect, sal_
                 nRow++;
             if( r.Right() >= aRect.Right() && r.Bottom() >= aRect.Bottom() )
             {
-                aTo = Rectangle( nCol, HMM2XL( aRect.Right() - r.Left() ),
-                                 nRow, HMM2XL( aRect.Bottom() - r.Top() ));
+                aTo = Rectangle( nCol, static_cast<long>(HMM2XL( aRect.Right() - r.Left() )),
+                                 nRow, static_cast<long>(HMM2XL( aRect.Bottom() - r.Top() )));
                 break;
             }
         }
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index eadd0f4..b32bc9f 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -846,8 +846,8 @@ size_t ScDPHorFieldControl::CalcNewFieldIndex(SCsCOL nDX, SCsROW nDY) const
     size_t nFldCount = GetFieldCount();
     SCsROW nRow = nSel % mnFieldBtnRowCount;
     SCsCOL nCol = nSel / mnFieldBtnRowCount;
-    SCsCOL nColUpper = ceil(
-        static_cast<double>(nFldCount) / static_cast<double>(mnFieldBtnRowCount)) - 1;
+    SCsCOL nColUpper = static_cast<SCsCOL>(ceil(
+        static_cast<double>(nFldCount) / static_cast<double>(mnFieldBtnRowCount)) - 1);
     SCsROW nRowUpper = mnFieldBtnRowCount - 1;
 
     nCol += nDX;
@@ -912,8 +912,8 @@ void ScDPHorFieldControl::ScrollToShowSelection()
 void ScDPHorFieldControl::ResetScrollBar()
 {
     long nOldMax = maScroll.GetRangeMax();
-    long nNewMax = ceil(
-        static_cast<double>(GetFieldCount()) / static_cast<double>(mnFieldBtnRowCount));
+    long nNewMax = static_cast<long>(ceil(
+        static_cast<double>(GetFieldCount()) / static_cast<double>(mnFieldBtnRowCount)));
 
     if (nOldMax != nNewMax)
     {
@@ -1281,7 +1281,7 @@ ScDPFieldType ScDPDataFieldControl::GetFieldType() const
 Size ScDPDataFieldControl::GetFieldSize() const
 {
     Size aWndSize = GetSizePixel();
-    long nFieldObjWidth = aWndSize.Width() / 2.0 - OUTER_MARGIN_HOR - DATA_FIELD_BTN_GAP/2;
+    long nFieldObjWidth = static_cast<long>(aWndSize.Width() / 2.0 - OUTER_MARGIN_HOR - DATA_FIELD_BTN_GAP/2);
     Size aFieldSize(nFieldObjWidth, FIELD_BTN_HEIGHT);
     return aFieldSize;
 }
diff --git a/sc/source/ui/vba/vbasheetobjects.cxx b/sc/source/ui/vba/vbasheetobjects.cxx
index b05aa82..b350744 100644
--- a/sc/source/ui/vba/vbasheetobjects.cxx
+++ b/sc/source/ui/vba/vbasheetobjects.cxx
@@ -342,8 +342,8 @@ uno::Any SAL_CALL ScVbaGraphicObjectsBase::Add( const uno::Any& rLeft, const uno
     /*  Extract double values from passed Anys (the lclPointsToHmm() helper
         function will throw a RuntimeException on any error), and convert from
         points to 1/100 mm. */
-    awt::Point aPos( lclPointsToHmm( rLeft ), lclPointsToHmm( rTop ) );
-    awt::Size aSize( lclPointsToHmm( rWidth ), lclPointsToHmm( rHeight ) );
+    awt::Point aPos( static_cast<sal_Int32>(lclPointsToHmm( rLeft )),  static_cast<sal_Int32>(lclPointsToHmm( rTop )) );
+    awt::Size aSize( static_cast<sal_Int32>(lclPointsToHmm( rWidth )), static_cast<sal_Int32>(lclPointsToHmm( rHeight )) );
     // TODO: translate coordinates for RTL sheets
     if( (aPos.X < 0) || (aPos.Y < 0) || (aSize.Width <= 0) || (aSize.Height <= 0) )
         throw uno::RuntimeException();
commit d890debd3738927c3c4b0515606d117471cfece2
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Mon May 16 12:07:58 2011 +0300

    The (nested) class ScDBCollection::NamedDBs must be DLLPUBLIC, too
    
    Referenced from Sc10Import::LoadDataBaseCollection() in the scfilt
    library.

diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index 8c9fe39..2772a02 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -166,7 +166,7 @@ public:
     /**
      * Stores global named database ranges.
      */
-    class NamedDBs
+    class SC_DLLPUBLIC NamedDBs
     {
         friend class ScDBCollection;
 
commit 407ea72c6ac9e1dccd7437b07c0398748833cd31
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri May 13 23:11:42 2011 -0400

    Renamed dbcolect.?xx to dbdata.?xx.
    
    That deliberately mis-spelled header name always bothered me.  Now
    fixed once and for all.
    
    For the record, the original file name was inspired by the 8-character
    rule that some of the old compilers that the Hamburg guys had to use,
    years and years ago.

diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index c57671e..078c94c 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -167,7 +167,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
 	sc/source/core/tool/collect  \
 	sc/source/core/tool/compiler \
 	sc/source/core/tool/consoli  \
-	sc/source/core/tool/dbcolect \
+	sc/source/core/tool/dbdata \
 	sc/source/core/tool/ddelink \
 	sc/source/core/tool/detdata  \
 	sc/source/core/tool/detfunc \
diff --git a/sc/inc/dbcolect.hxx b/sc/inc/dbcolect.hxx
deleted file mode 100644
index bf2a032..0000000
--- a/sc/inc/dbcolect.hxx
+++ /dev/null
@@ -1,266 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SC_DBCOLECT_HXX
-#define SC_DBCOLECT_HXX
-
-#include "scdllapi.h"
-#include "collect.hxx"
-#include "global.hxx"       // MAXQUERY
-#include "sortparam.hxx"    // MAXSORT
-#include "refreshtimer.hxx"
-#include "address.hxx"
-#include "scdllapi.h"
-#include "subtotalparam.hxx"
-#include "queryparam.hxx"
-
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/ptr_container/ptr_set.hpp>
-#include <boost/scoped_ptr.hpp>
-
-class ScDocument;
-
-class ScDBData : public ScRefreshTimer
-{
-private:
-    ScSortParam maSortParam;
-    ScQueryParam maQueryParam;
-    ScSubTotalParam maSubTotal;
-    ScImportParam maImportParam;
-
-    // DBParam
-    const ::rtl::OUString aName;
-    SCTAB           nTable;
-    SCCOL           nStartCol;
-    SCROW           nStartRow;
-    SCCOL           nEndCol;
-    SCROW           nEndRow;
-    bool            bByRow;
-    bool            bHasHeader;
-    bool            bDoSize;
-    bool            bKeepFmt;
-    bool            bStripData;
-
-    // QueryParam
-    bool            bIsAdvanced;        // true if created by advanced filter
-    ScRange         aAdvSource;         // source range
-
-    bool            bDBSelection;       // not in Param: if selection, block update
-
-    sal_uInt16      nIndex;             // unique index formulas
-    bool            bAutoFilter;        // AutoFilter? (not saved)
-    bool            bModified;          // is set/cleared for/by(?) UpdateReference
-
-    using ScRefreshTimer::operator==;
-
-public:
-    struct less : public ::std::binary_function<ScDBData, ScDBData, bool>
-    {
-        bool operator() (const ScDBData& left, const ScDBData& right) const;
-    };
-
-    SC_DLLPUBLIC ScDBData(const ::rtl::OUString& rName,
-             SCTAB nTab,
-             SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-             bool bByR = true, bool bHasH = true);
-    ScDBData(const ScDBData& rData);
-    ScDBData(const ::rtl::OUString& rName, const ScDBData& rData);
-    ~ScDBData();
-
-    ScDBData&   operator= (const ScDBData& rData);
-
-    bool        operator== (const ScDBData& rData) const;
-
-    SCTAB       GetTable() const;
-    const ::rtl::OUString& GetName() const { return aName; }
-    void        GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const;
-    SC_DLLPUBLIC void GetArea(ScRange& rRange) const;
-    void        SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
-    void        MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
-    bool        IsByRow() const                 { return bByRow; }
-    void        SetByRow(bool bByR)             { bByRow = bByR; }
-    bool        HasHeader() const               { return bHasHeader; }
-    void        SetHeader(bool bHasH)           { bHasHeader = bHasH; }
-    void        SetIndex(sal_uInt16 nInd)           { nIndex = nInd; }
-    sal_uInt16  GetIndex() const                { return nIndex; }
-    bool        IsDoSize() const                { return bDoSize; }
-    void        SetDoSize(bool bSet)            { bDoSize = bSet; }
-    bool        IsKeepFmt() const               { return bKeepFmt; }
-    void        SetKeepFmt(bool bSet)           { bKeepFmt = bSet; }
-    bool        IsStripData() const             { return bStripData; }
-    void        SetStripData(bool bSet)         { bStripData = bSet; }
-
-    ::rtl::OUString GetSourceString() const;
-    ::rtl::OUString GetOperations() const;
-
-    void        GetSortParam(ScSortParam& rSortParam) const;
-    void        SetSortParam(const ScSortParam& rSortParam);
-
-    SC_DLLPUBLIC void       GetQueryParam(ScQueryParam& rQueryParam) const;
-    SC_DLLPUBLIC void       SetQueryParam(const ScQueryParam& rQueryParam);
-    SC_DLLPUBLIC bool       GetAdvancedQuerySource(ScRange& rSource) const;
-    SC_DLLPUBLIC void       SetAdvancedQuerySource(const ScRange* pSource);
-
-    void        GetSubTotalParam(ScSubTotalParam& rSubTotalParam) const;
-    void        SetSubTotalParam(const ScSubTotalParam& rSubTotalParam);
-
-    void        GetImportParam(ScImportParam& rImportParam) const;
-    void        SetImportParam(const ScImportParam& rImportParam);
-
-    bool        IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const;
-    bool        IsDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
-
-    bool        HasImportParam() const   { return maImportParam.bImport; }
-    SC_DLLPUBLIC bool HasQueryParam() const;
-    bool        HasSortParam() const     { return maSortParam.bDoSort[0]; }
-    bool        HasSubTotalParam() const { return maSubTotal.bGroupActive[0]; }
-
-    bool        HasImportSelection() const      { return bDBSelection; }
-    void        SetImportSelection(bool bSet)   { bDBSelection = bSet; }
-
-    bool        HasAutoFilter() const       { return bAutoFilter; }
-    void        SetAutoFilter(bool bSet)    { bAutoFilter = bSet; }
-
-    bool        IsModified() const          { return bModified; }
-    void        SetModified(bool bMod)      { bModified = bMod; }
-
-    void    UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos );
-    void    UpdateReference(ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
-                        SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
-                        SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
-                        SCsCOL nDx, SCsROW nDy, SCsTAB nDz);
-
-    void ExtendDataArea(ScDocument* pDoc);
-};
-
-class SC_DLLPUBLIC ScDBCollection
-{
-public:
-    enum RangeType { GlobalNamed, GlobalAnonymous, SheetAnonymous };
-
-    /**
-     * Stores global named database ranges.
-     */
-    class NamedDBs
-    {
-        friend class ScDBCollection;
-
-        typedef ::boost::ptr_set<ScDBData, ScDBData::less> DBsType;
-        DBsType maDBs;
-        ScDBCollection& mrParent;
-        ScDocument& mrDoc;
-        NamedDBs(ScDBCollection& rParent, ScDocument& rDoc);
-        NamedDBs(const NamedDBs& r);
-    public:
-        typedef DBsType::iterator iterator;
-        typedef DBsType::const_iterator const_iterator;
-
-        iterator begin();
-        iterator end();
-        const_iterator begin() const;
-        const_iterator end() const;
-        ScDBData* findByIndex(sal_uInt16 nIndex);
-        ScDBData* findByName(const ::rtl::OUString& rName);
-        bool insert(ScDBData* p);
-        void erase(iterator itr);
-        void erase(const ScDBData& r);
-        bool empty() const;
-        size_t size() const;
-        bool operator== (const NamedDBs& r) const;
-    };
-
-    /**
-     * Stores global anonymous database ranges.
-     */
-    class AnonDBs
-    {
-        typedef ::boost::ptr_vector<ScDBData> DBsType;
-        DBsType maDBs;
-    public:
-        typedef DBsType::iterator iterator;
-        typedef DBsType::const_iterator const_iterator;
-
-        iterator begin();
-        iterator end();
-        const_iterator begin() const;
-        const_iterator end() const;
-        const ScDBData* findAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const;
-        const ScDBData* findByRange(const ScRange& rRange) const;
-        ScDBData* getByRange(const ScRange& rRange);
-        void insert(ScDBData* p);
-        void erase(iterator itr);
-        bool empty() const;
-        size_t size() const;
-        bool operator== (const AnonDBs& r) const;
-    };
-
-private:
-    Link        aRefreshHandler;
-    ScDocument* pDoc;
-    sal_uInt16 nEntryIndex;         // counter for unique indices
-    NamedDBs maNamedDBs;
-    AnonDBs maAnonDBs;
-
-public:
-    ScDBCollection(ScDocument* pDocument);
-    ScDBCollection(const ScDBCollection& r);
-
-    NamedDBs& getNamedDBs();
-    const NamedDBs& getNamedDBs() const;
-
-    AnonDBs& getAnonDBs();
-    const AnonDBs& getAnonDBs() const;
-
-    const ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly) const;
-    ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly);
-    const ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
-    ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
-    const ScDBData* GetFilterDBAtTable(SCTAB nTab) const;
-    ScDBData* GetDBNearCursor(SCCOL nCol, SCROW nRow, SCTAB nTab );
-
-    void    DeleteOnTab( SCTAB nTab );
-    void    UpdateReference(UpdateRefMode eUpdateRefMode,
-                                SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
-                                SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
-                                SCsCOL nDx, SCsROW nDy, SCsTAB nDz);
-    void    UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos );
-
-    sal_uInt16  GetEntryIndex()                 { return nEntryIndex; }
-    void    SetEntryIndex(sal_uInt16 nInd)      { nEntryIndex = nInd; }
-
-    void            SetRefreshHandler( const Link& rLink )
-                        { aRefreshHandler = rLink; }
-    const Link&     GetRefreshHandler() const   { return aRefreshHandler; }
-
-    bool empty() const;
-    bool operator== (const ScDBCollection& r) const;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
new file mode 100644
index 0000000..8c9fe39
--- /dev/null
+++ b/sc/inc/dbdata.hxx
@@ -0,0 +1,266 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SC_DBCOLECT_HXX
+#define SC_DBCOLECT_HXX
+
+#include "scdllapi.h"
+#include "collect.hxx"
+#include "global.hxx"       // MAXQUERY
+#include "sortparam.hxx"    // MAXSORT
+#include "refreshtimer.hxx"
+#include "address.hxx"
+#include "scdllapi.h"
+#include "subtotalparam.hxx"
+#include "queryparam.hxx"
+
+#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/ptr_container/ptr_set.hpp>
+#include <boost/scoped_ptr.hpp>
+
+class ScDocument;
+
+class ScDBData : public ScRefreshTimer
+{
+private:
+    ScSortParam maSortParam;
+    ScQueryParam maQueryParam;
+    ScSubTotalParam maSubTotal;
+    ScImportParam maImportParam;
+
+    // DBParam
+    const ::rtl::OUString aName;
+    SCTAB           nTable;
+    SCCOL           nStartCol;
+    SCROW           nStartRow;
+    SCCOL           nEndCol;
+    SCROW           nEndRow;
+    bool            bByRow;
+    bool            bHasHeader;
+    bool            bDoSize;
+    bool            bKeepFmt;
+    bool            bStripData;
+
+    // QueryParam
+    bool            bIsAdvanced;        // true if created by advanced filter
+    ScRange         aAdvSource;         // source range
+
+    bool            bDBSelection;       // not in Param: if selection, block update
+
+    sal_uInt16      nIndex;             // unique index formulas
+    bool            bAutoFilter;        // AutoFilter? (not saved)
+    bool            bModified;          // is set/cleared for/by(?) UpdateReference
+
+    using ScRefreshTimer::operator==;
+
+public:
+    struct less : public ::std::binary_function<ScDBData, ScDBData, bool>
+    {
+        bool operator() (const ScDBData& left, const ScDBData& right) const;
+    };
+
+    SC_DLLPUBLIC ScDBData(const ::rtl::OUString& rName,
+             SCTAB nTab,
+             SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
+             bool bByR = true, bool bHasH = true);
+    ScDBData(const ScDBData& rData);
+    ScDBData(const ::rtl::OUString& rName, const ScDBData& rData);
+    ~ScDBData();
+
+    ScDBData&   operator= (const ScDBData& rData);
+
+    bool        operator== (const ScDBData& rData) const;
+
+    SCTAB       GetTable() const;
+    const ::rtl::OUString& GetName() const { return aName; }
+    void        GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const;
+    SC_DLLPUBLIC void GetArea(ScRange& rRange) const;
+    void        SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
+    void        MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
+    bool        IsByRow() const                 { return bByRow; }
+    void        SetByRow(bool bByR)             { bByRow = bByR; }
+    bool        HasHeader() const               { return bHasHeader; }
+    void        SetHeader(bool bHasH)           { bHasHeader = bHasH; }
+    void        SetIndex(sal_uInt16 nInd)           { nIndex = nInd; }
+    sal_uInt16  GetIndex() const                { return nIndex; }
+    bool        IsDoSize() const                { return bDoSize; }
+    void        SetDoSize(bool bSet)            { bDoSize = bSet; }
+    bool        IsKeepFmt() const               { return bKeepFmt; }
+    void        SetKeepFmt(bool bSet)           { bKeepFmt = bSet; }
+    bool        IsStripData() const             { return bStripData; }
+    void        SetStripData(bool bSet)         { bStripData = bSet; }
+
+    ::rtl::OUString GetSourceString() const;
+    ::rtl::OUString GetOperations() const;
+
+    void        GetSortParam(ScSortParam& rSortParam) const;
+    void        SetSortParam(const ScSortParam& rSortParam);
+
+    SC_DLLPUBLIC void       GetQueryParam(ScQueryParam& rQueryParam) const;
+    SC_DLLPUBLIC void       SetQueryParam(const ScQueryParam& rQueryParam);
+    SC_DLLPUBLIC bool       GetAdvancedQuerySource(ScRange& rSource) const;
+    SC_DLLPUBLIC void       SetAdvancedQuerySource(const ScRange* pSource);
+
+    void        GetSubTotalParam(ScSubTotalParam& rSubTotalParam) const;
+    void        SetSubTotalParam(const ScSubTotalParam& rSubTotalParam);
+
+    void        GetImportParam(ScImportParam& rImportParam) const;
+    void        SetImportParam(const ScImportParam& rImportParam);
+
+    bool        IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const;
+    bool        IsDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
+
+    bool        HasImportParam() const   { return maImportParam.bImport; }
+    SC_DLLPUBLIC bool HasQueryParam() const;
+    bool        HasSortParam() const     { return maSortParam.bDoSort[0]; }
+    bool        HasSubTotalParam() const { return maSubTotal.bGroupActive[0]; }
+
+    bool        HasImportSelection() const      { return bDBSelection; }
+    void        SetImportSelection(bool bSet)   { bDBSelection = bSet; }
+
+    bool        HasAutoFilter() const       { return bAutoFilter; }
+    void        SetAutoFilter(bool bSet)    { bAutoFilter = bSet; }
+
+    bool        IsModified() const          { return bModified; }
+    void        SetModified(bool bMod)      { bModified = bMod; }
+
+    void    UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos );
+    void    UpdateReference(ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
+                        SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
+                        SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
+                        SCsCOL nDx, SCsROW nDy, SCsTAB nDz);
+
+    void ExtendDataArea(ScDocument* pDoc);
+};
+
+class SC_DLLPUBLIC ScDBCollection
+{
+public:
+    enum RangeType { GlobalNamed, GlobalAnonymous, SheetAnonymous };
+
+    /**
+     * Stores global named database ranges.
+     */
+    class NamedDBs
+    {
+        friend class ScDBCollection;
+
+        typedef ::boost::ptr_set<ScDBData, ScDBData::less> DBsType;
+        DBsType maDBs;
+        ScDBCollection& mrParent;
+        ScDocument& mrDoc;
+        NamedDBs(ScDBCollection& rParent, ScDocument& rDoc);
+        NamedDBs(const NamedDBs& r);
+    public:
+        typedef DBsType::iterator iterator;
+        typedef DBsType::const_iterator const_iterator;
+
+        iterator begin();
+        iterator end();
+        const_iterator begin() const;
+        const_iterator end() const;
+        ScDBData* findByIndex(sal_uInt16 nIndex);
+        ScDBData* findByName(const ::rtl::OUString& rName);
+        bool insert(ScDBData* p);
+        void erase(iterator itr);
+        void erase(const ScDBData& r);
+        bool empty() const;
+        size_t size() const;
+        bool operator== (const NamedDBs& r) const;
+    };
+
+    /**
+     * Stores global anonymous database ranges.
+     */
+    class AnonDBs
+    {
+        typedef ::boost::ptr_vector<ScDBData> DBsType;
+        DBsType maDBs;
+    public:
+        typedef DBsType::iterator iterator;
+        typedef DBsType::const_iterator const_iterator;
+
+        iterator begin();
+        iterator end();
+        const_iterator begin() const;
+        const_iterator end() const;
+        const ScDBData* findAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const;
+        const ScDBData* findByRange(const ScRange& rRange) const;
+        ScDBData* getByRange(const ScRange& rRange);
+        void insert(ScDBData* p);
+        void erase(iterator itr);
+        bool empty() const;
+        size_t size() const;
+        bool operator== (const AnonDBs& r) const;
+    };
+
+private:
+    Link        aRefreshHandler;
+    ScDocument* pDoc;
+    sal_uInt16 nEntryIndex;         // counter for unique indices
+    NamedDBs maNamedDBs;
+    AnonDBs maAnonDBs;
+
+public:
+    ScDBCollection(ScDocument* pDocument);
+    ScDBCollection(const ScDBCollection& r);
+
+    NamedDBs& getNamedDBs();
+    const NamedDBs& getNamedDBs() const;
+
+    AnonDBs& getAnonDBs();
+    const AnonDBs& getAnonDBs() const;
+
+    const ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly) const;
+    ScDBData* GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly);
+    const ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
+    ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
+    const ScDBData* GetFilterDBAtTable(SCTAB nTab) const;
+    ScDBData* GetDBNearCursor(SCCOL nCol, SCROW nRow, SCTAB nTab );
+
+    void    DeleteOnTab( SCTAB nTab );
+    void    UpdateReference(UpdateRefMode eUpdateRefMode,
+                                SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
+                                SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
+                                SCsCOL nDx, SCsROW nDy, SCsTAB nDz);
+    void    UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos );
+
+    sal_uInt16  GetEntryIndex()                 { return nEntryIndex; }
+    void    SetEntryIndex(sal_uInt16 nInd)      { nEntryIndex = nInd; }
+
+    void            SetRefreshHandler( const Link& rLink )
+                        { aRefreshHandler = rLink; }
+    const Link&     GetRefreshHandler() const   { return aRefreshHandler; }
+
+    bool empty() const;
+    bool operator== (const ScDBCollection& r) const;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/rangeutl.hxx b/sc/inc/rangeutl.hxx
index 41fd294..e9ded5c 100644
--- a/sc/inc/rangeutl.hxx
+++ b/sc/inc/rangeutl.hxx
@@ -33,7 +33,7 @@
 
 #include "address.hxx"
 #include "rangenam.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
 #include "scdllapi.h"
 
 #include <com/sun/star/table/CellAddress.hpp>
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 45ee67f..49c705f 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -38,7 +38,7 @@
 #include "column.hxx"
 #include "sortparam.hxx"
 #include "compressedarray.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
 
 #include <memory>
 #include <set>
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 7ec4b23..f736f88 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -66,7 +66,7 @@
 #include "subtotal.hxx"
 #include "markdata.hxx"
 #include "compiler.hxx"			// ScTokenArray GetCodeLen
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
 #include "fillinfo.hxx"
 #include "segmenttree.hxx"
 #include "docparam.hxx"
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 5864055..4cd3657 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -57,7 +57,7 @@
 #include "attrib.hxx"
 #include "patattr.hxx"
 #include "rangenam.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
 #include "pivot.hxx"
 #include "docpool.hxx"
 #include "stlpool.hxx"
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index bbd8f2c..17d5bd9 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -46,7 +46,7 @@
 #include "cell.hxx"
 #include "table.hxx"
 #include "rangenam.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
 #include "pivot.hxx"
 #include "docpool.hxx"
 #include "poolhelp.hxx"
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index a40ee81..9292cb5 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -68,7 +68,7 @@
 #include "stlsheet.hxx"
 #include "globstr.hrc"
 #include "rechead.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
 #include "pivot.hxx"
 #include "chartlis.hxx"
 #include "rangelst.hxx"
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 99dbd2a..ba65ebf 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -55,7 +55,7 @@
 #include "rechead.hxx"
 #include "globstr.hrc"
 #include "rangenam.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
 
 #include <math.h>
 #include <memory>
diff --git a/sc/source/core/inc/core_pch.hxx b/sc/source/core/inc/core_pch.hxx
index 044d995..3e84de8 100644
--- a/sc/source/core/inc/core_pch.hxx
+++ b/sc/source/core/inc/core_pch.hxx
@@ -196,7 +196,7 @@
 #include <rangenam.hxx>
 #include <scmatrix.hxx>
 #include <svx/pageitem.hxx>
-#include <dbcolect.hxx>
+#include <dbdata.hxx>
 #include <userlist.hxx>
 #include <editeng/editdata.hxx>
 #include <basic/sbxvar.hxx>
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 2b8bab7..70a20b5 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -56,7 +56,7 @@
 #include <math.h>
 #include "compiler.hxx"
 #include "rangenam.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
 #include "document.hxx"
 #include "callform.hxx"
 #include "addincol.hxx"
diff --git a/sc/source/core/tool/dbcolect.cxx b/sc/source/core/tool/dbcolect.cxx
deleted file mode 100644
index a7a5610..0000000
--- a/sc/source/core/tool/dbcolect.cxx
+++ /dev/null
@@ -1,1037 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sc.hxx"
-
-
-#include <tools/debug.hxx>
-#include <unotools/transliterationwrapper.hxx>
-
-#include "dbcolect.hxx"
-#include "global.hxx"
-#include "globalnames.hxx"
-#include "refupdat.hxx"
-#include "rechead.hxx"
-#include "document.hxx"
-#include "queryparam.hxx"
-#include "globstr.hrc"
-#include "subtotalparam.hxx"
-
-#include <memory>
-
-using ::std::auto_ptr;
-using ::std::unary_function;
-using ::std::for_each;
-using ::std::find_if;
-using ::std::remove_if;
-using ::std::pair;
-
-//---------------------------------------------------------------------------------------
-
-bool ScDBData::less::operator() (const ScDBData& left, const ScDBData& right) const
-{
-    return ScGlobal::GetpTransliteration()->compareString(left.GetName(), right.GetName()) < 0;
-}
-
-ScDBData::ScDBData( const ::rtl::OUString& rName,
-                    SCTAB nTab,
-                    SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-                    bool bByR, bool bHasH) :
-    aName       (rName),
-    nTable      (nTab),
-    nStartCol   (nCol1),
-    nStartRow   (nRow1),
-    nEndCol     (nCol2),
-    nEndRow     (nRow2),
-    bByRow      (bByR),
-    bHasHeader  (bHasH),
-    bDoSize     (false),
-    bKeepFmt    (false),
-    bStripData  (false),
-    bIsAdvanced (false),
-    bDBSelection(false),
-    nIndex      (0),
-    bAutoFilter (false),
-    bModified   (false)
-{
-    ScSortParam aSortParam;
-    ScQueryParam aQueryParam;
-    ScImportParam aImportParam;
-
-    SetSortParam( aSortParam );
-    SetQueryParam( aQueryParam );
-    SetImportParam( aImportParam );
-}
-
-ScDBData::ScDBData( const ScDBData& rData ) :
-    ScRefreshTimer      ( rData ),
-    maSortParam         (rData.maSortParam),
-    maQueryParam        (rData.maQueryParam),
-    maSubTotal          (rData.maSubTotal),
-    maImportParam       (rData.maImportParam),
-    aName               (rData.aName),
-    nTable              (rData.nTable),
-    nStartCol           (rData.nStartCol),
-    nStartRow           (rData.nStartRow),
-    nEndCol             (rData.nEndCol),
-    nEndRow             (rData.nEndRow),
-    bByRow              (rData.bByRow),
-    bHasHeader          (rData.bHasHeader),
-    bDoSize             (rData.bDoSize),
-    bKeepFmt            (rData.bKeepFmt),
-    bStripData          (rData.bStripData),
-    bIsAdvanced         (rData.bIsAdvanced),
-    aAdvSource          (rData.aAdvSource),
-    bDBSelection        (rData.bDBSelection),
-    nIndex              (rData.nIndex),
-    bAutoFilter         (rData.bAutoFilter),
-    bModified           (rData.bModified)
-{
-}
-
-ScDBData::ScDBData( const ::rtl::OUString& rName, const ScDBData& rData ) :
-    ScRefreshTimer      ( rData ),
-    maSortParam         (rData.maSortParam),
-    maQueryParam        (rData.maQueryParam),
-    maSubTotal          (rData.maSubTotal),
-    maImportParam       (rData.maImportParam),
-    aName               (rName),
-    nTable              (rData.nTable),
-    nStartCol           (rData.nStartCol),
-    nStartRow           (rData.nStartRow),
-    nEndCol             (rData.nEndCol),
-    nEndRow             (rData.nEndRow),
-    bByRow              (rData.bByRow),
-    bHasHeader          (rData.bHasHeader),
-    bDoSize             (rData.bDoSize),
-    bKeepFmt            (rData.bKeepFmt),
-    bStripData          (rData.bStripData),
-    bIsAdvanced         (rData.bIsAdvanced),
-    aAdvSource          (rData.aAdvSource),
-    bDBSelection        (rData.bDBSelection),
-    nIndex              (rData.nIndex),
-    bAutoFilter         (rData.bAutoFilter),
-    bModified           (rData.bModified)
-{
-}
-
-ScDBData& ScDBData::operator= (const ScDBData& rData)
-{
-    // Don't modify the name.  The name is not mutable as it is used as a key
-    // in the container to keep the db ranges sorted by the name.
-    ScRefreshTimer::operator=( rData );
-    maSortParam         = rData.maSortParam;
-    maQueryParam        = rData.maQueryParam;
-    maSubTotal          = rData.maSubTotal;
-    maImportParam       = rData.maImportParam;
-    nTable              = rData.nTable;
-    nStartCol           = rData.nStartCol;
-    nStartRow           = rData.nStartRow;
-    nEndCol             = rData.nEndCol;
-    nEndRow             = rData.nEndRow;
-    bByRow              = rData.bByRow;
-    bHasHeader          = rData.bHasHeader;
-    bDoSize             = rData.bDoSize;
-    bKeepFmt            = rData.bKeepFmt;
-    bStripData          = rData.bStripData;
-    bIsAdvanced         = rData.bIsAdvanced;
-    aAdvSource          = rData.aAdvSource;
-    bDBSelection        = rData.bDBSelection;
-    nIndex              = rData.nIndex;
-    bAutoFilter         = rData.bAutoFilter;
-
-    return *this;
-}
-
-SCTAB ScDBData::GetTable() const
-{
-    return nTable;
-}
-
-bool ScDBData::operator== (const ScDBData& rData) const
-{
-    //  Daten, die nicht in den Params sind
-
-    if ( nTable     != rData.nTable     ||
-         bDoSize    != rData.bDoSize    ||
-         bKeepFmt   != rData.bKeepFmt   ||
-         bIsAdvanced!= rData.bIsAdvanced||
-         bStripData != rData.bStripData ||
-//       SAB: I think this should be here, but I don't want to break something
-//         bAutoFilter!= rData.bAutoFilter||
-         ScRefreshTimer::operator!=( rData )
-        )
-        return false;
-
-    if ( bIsAdvanced && aAdvSource != rData.aAdvSource )
-        return false;
-
-    ScSortParam aSort1, aSort2;
-    GetSortParam(aSort1);
-    rData.GetSortParam(aSort2);
-    if (!(aSort1 == aSort2))
-        return false;
-
-    ScQueryParam aQuery1, aQuery2;
-    GetQueryParam(aQuery1);
-    rData.GetQueryParam(aQuery2);
-    if (!(aQuery1 == aQuery2))
-        return false;
-
-    ScSubTotalParam aSubTotal1, aSubTotal2;
-    GetSubTotalParam(aSubTotal1);
-    rData.GetSubTotalParam(aSubTotal2);
-    if (!(aSubTotal1 == aSubTotal2))
-        return false;
-
-    ScImportParam aImport1, aImport2;
-    GetImportParam(aImport1);
-    rData.GetImportParam(aImport2);
-    if (!(aImport1 == aImport2))
-        return false;
-
-    return true;
-}
-
-ScDBData::~ScDBData()
-{
-    StopRefreshTimer();
-}
-
-
-::rtl::OUString ScDBData::GetSourceString() const
-{
-    ::rtl::OUStringBuffer aBuf;
-    if (maImportParam.bImport)
-    {
-        aBuf.append(maImportParam.aDBName);
-        aBuf.append(sal_Unicode('/'));
-        aBuf.append(maImportParam.aStatement);
-    }
-    return aBuf.makeStringAndClear();
-}
-
-::rtl::OUString ScDBData::GetOperations() const
-{
-    ::rtl::OUStringBuffer aBuf;
-    if (maQueryParam.GetEntryCount())
-    {
-        const ScQueryEntry& rEntry = maQueryParam.GetEntry(0);
-        if (rEntry.bDoQuery)
-            aBuf.append(ScGlobal::GetRscString(STR_OPERATION_FILTER));
-    }
-
-    if (maSortParam.bDoSort[0])
-    {
-        if (aBuf.getLength())
-            aBuf.appendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
-        aBuf.append(ScGlobal::GetRscString(STR_OPERATION_SORT));
-    }
-
-    if (maSubTotal.bGroupActive[0] && !maSubTotal.bRemoveOnly)
-    {
-        if (aBuf.getLength())
-            aBuf.appendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
-        aBuf.append(ScGlobal::GetRscString(STR_OPERATION_SUBTOTAL));
-    }
-
-    if (!aBuf.getLength())
-        aBuf.append(ScGlobal::GetRscString(STR_OPERATION_NONE));
-
-    return aBuf.makeStringAndClear();
-}
-
-void ScDBData::GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const
-{
-    rTab  = nTable;
-    rCol1 = nStartCol;
-    rRow1 = nStartRow;
-    rCol2 = nEndCol;
-    rRow2 = nEndRow;
-}
-
-void ScDBData::GetArea(ScRange& rRange) const
-{
-    SCROW nNewEndRow = nEndRow;
-    rRange = ScRange( nStartCol, nStartRow, nTable, nEndCol, nNewEndRow, nTable );
-}
-
-void ScDBData::SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
-{
-    nTable  = nTab;
-    nStartCol = nCol1;
-    nStartRow = nRow1;
-    nEndCol   = nCol2;
-    nEndRow   = nRow2;
-}
-
-void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
-{
-    sal_uInt16 i;
-    long nDifX = ((long) nCol1) - ((long) nStartCol);
-    long nDifY = ((long) nRow1) - ((long) nStartRow);
-
-    long nSortDif = bByRow ? nDifX : nDifY;
-    long nSortEnd = bByRow ? static_cast<long>(nCol2) : static_cast<long>(nRow2);
-
-    for (i=0; i<MAXSORT; i++)
-    {
-        maSortParam.nField[i] += nSortDif;
-        if (maSortParam.nField[i] > nSortEnd)
-        {
-            maSortParam.nField[i] = 0;
-            maSortParam.bDoSort[i] = false;
-        }
-    }
-
-    if (maQueryParam.GetEntryCount() < MAXQUERY)
-        maQueryParam.Resize(MAXQUERY);
-    for (i=0; i<MAXQUERY; i++)
-    {
-        ScQueryEntry& rEntry = maQueryParam.GetEntry(i);
-        rEntry.nField += nDifX;
-        if (rEntry.nField > nCol2)
-        {
-            rEntry.nField = 0;
-            rEntry.bDoQuery = false;
-        }
-    }
-    for (i=0; i<MAXSUBTOTAL; i++)
-    {
-        maSubTotal.nField[i] = sal::static_int_cast<SCCOL>( maSubTotal.nField[i] + nDifX );
-        if (maSubTotal.nField[i] > nCol2)
-        {
-            maSubTotal.nField[i] = 0;
-            maSubTotal.bGroupActive[i] = false;
-        }
-    }
-
-    SetArea( nTab, nCol1, nRow1, nCol2, nRow2 );
-}
-
-void ScDBData::GetSortParam( ScSortParam& rSortParam ) const
-{
-    rSortParam = maSortParam;
-    rSortParam.nCol1 = nStartCol;
-    rSortParam.nRow1 = nStartRow;
-    rSortParam.nCol2 = nEndCol;
-    rSortParam.nRow2 = nEndRow;
-    rSortParam.bByRow = bByRow;
-    rSortParam.bHasHeader = bHasHeader;
-}
-
-void ScDBData::SetSortParam( const ScSortParam& rSortParam )
-{
-    maSortParam = rSortParam;
-    bByRow = rSortParam.bByRow;
-}
-
-void ScDBData::GetQueryParam( ScQueryParam& rQueryParam ) const
-{
-    rQueryParam = maQueryParam;
-    rQueryParam.nCol1 = nStartCol;
-    rQueryParam.nRow1 = nStartRow;
-    rQueryParam.nCol2 = nEndCol;
-    rQueryParam.nRow2 = nEndRow;
-    rQueryParam.nTab  = nTable;
-    rQueryParam.bByRow = bByRow;
-    rQueryParam.bHasHeader = bHasHeader;
-}
-
-void ScDBData::SetQueryParam(const ScQueryParam& rQueryParam)
-{
-    DBG_ASSERT( rQueryParam.GetEntryCount() <= MAXQUERY ||
-                !rQueryParam.GetEntry(MAXQUERY).bDoQuery,
-                "zuviele Eintraege bei ScDBData::SetQueryParam" );
-
-    maQueryParam = rQueryParam;
-
-    //  set bIsAdvanced to false for everything that is not from the
-    //  advanced filter dialog
-    bIsAdvanced = false;
-}
-
-void ScDBData::SetAdvancedQuerySource(const ScRange* pSource)
-{
-    if (pSource)
-    {
-        aAdvSource = *pSource;
-        bIsAdvanced = true;
-    }
-    else
-        bIsAdvanced = false;
-}
-
-bool ScDBData::GetAdvancedQuerySource(ScRange& rSource) const
-{
-    rSource = aAdvSource;
-    return bIsAdvanced;
-}
-
-void ScDBData::GetSubTotalParam(ScSubTotalParam& rSubTotalParam) const
-{
-    rSubTotalParam = maSubTotal;
-
-    // Share the data range with the parent db data.  The range in the subtotal
-    // param struct is not used.
-    rSubTotalParam.nCol1 = nStartCol;
-    rSubTotalParam.nRow1 = nStartRow;
-    rSubTotalParam.nCol2 = nEndCol;
-    rSubTotalParam.nRow2 = nEndRow;
-}
-
-void ScDBData::SetSubTotalParam(const ScSubTotalParam& rSubTotalParam)
-{
-    maSubTotal = rSubTotalParam;
-}
-
-void ScDBData::GetImportParam(ScImportParam& rImportParam) const
-{
-    rImportParam = maImportParam;
-    // set the range.
-    rImportParam.nCol1 = nStartCol;
-    rImportParam.nRow1 = nStartRow;
-    rImportParam.nCol2 = nEndCol;
-    rImportParam.nRow2 = nEndRow;
-}
-
-void ScDBData::SetImportParam(const ScImportParam& rImportParam)
-{
-    // the range is ignored.
-    maImportParam = rImportParam;
-}
-
-bool ScDBData::IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const
-{
-    if (nTab == nTable)
-    {
-        if ( bStartOnly )
-            return ( nCol == nStartCol && nRow == nStartRow );
-        else
-            return ( nCol >= nStartCol && nCol <= nEndCol &&
-                     nRow >= nStartRow && nRow <= nEndRow );
-    }
-
-    return false;
-}
-
-bool ScDBData::IsDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
-{
-    return (bool)((nTab == nTable)
-                    && (nCol1 == nStartCol) && (nRow1 == nStartRow)
-                    && (nCol2 == nEndCol) && (nRow2 == nEndRow));
-}
-
-bool ScDBData::HasQueryParam() const
-{
-    if (!maQueryParam.GetEntryCount())
-        return false;
-
-    return maQueryParam.GetEntry(0).bDoQuery;
-}
-
-void ScDBData::UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos)
-{
-        ScRange aRange;
-        GetArea( aRange );
-        SCTAB nTab = aRange.aStart.Tab();               // hat nur eine Tabelle
-
-        //  anpassen wie die aktuelle Tabelle bei ScTablesHint (tabvwsh5.cxx)
-
-        if ( nTab == nOldPos )                          // verschobene Tabelle
-            nTab = nNewPos;
-        else if ( nOldPos < nNewPos )                   // nach hinten verschoben
-        {
-            if ( nTab > nOldPos && nTab <= nNewPos )    // nachrueckender Bereich
-                --nTab;
-        }
-        else                                            // nach vorne verschoben
-        {
-            if ( nTab >= nNewPos && nTab < nOldPos )    // nachrueckender Bereich
-                ++nTab;
-        }
-
-        bool bChanged = ( nTab != aRange.aStart.Tab() );
-        if (bChanged)
-            SetArea( nTab, aRange.aStart.Col(), aRange.aStart.Row(),
-                                    aRange.aEnd.Col(),aRange.aEnd .Row() );
-
-        //  MoveTo ist nicht noetig, wenn nur die Tabelle geaendert ist
-
-        SetModified(bChanged);
-
-}
-
-void ScDBData::UpdateReference(ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
-                                SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
-                                SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
-                                SCsCOL nDx, SCsROW nDy, SCsTAB nDz)
-{
-    SCCOL theCol1;
-    SCROW theRow1;
-    SCTAB theTab1;
-    SCCOL theCol2;
-    SCROW theRow2;
-    SCTAB theTab2;
-    GetArea( theTab1, theCol1, theRow1, theCol2, theRow2 );
-    theTab2 = theTab1;
-
-    bool bDoUpdate = ScRefUpdate::Update( pDoc, eUpdateRefMode,
-                                            nCol1,nRow1,nTab1, nCol2,nRow2,nTab2, nDx,nDy,nDz,
-                                            theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 ) != UR_NOTHING;
-    if (bDoUpdate)
-        MoveTo( theTab1, theCol1, theRow1, theCol2, theRow2 );
-
-    ScRange aRangeAdvSource;
-    if ( GetAdvancedQuerySource(aRangeAdvSource) )
-    {
-        aRangeAdvSource.GetVars( theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 );
-        if ( ScRefUpdate::Update( pDoc, eUpdateRefMode,
-                                    nCol1,nRow1,nTab1, nCol2,nRow2,nTab2, nDx,nDy,nDz,
-                                    theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 ) )
-        {
-            aRangeAdvSource.aStart.Set( theCol1,theRow1,theTab1 );
-            aRangeAdvSource.aEnd.Set( theCol2,theRow2,theTab2 );
-            SetAdvancedQuerySource( &aRangeAdvSource );
-
-            bDoUpdate = true;       // DBData is modified
-        }
-    }
-
-    SetModified(bDoUpdate);
-
-    //!     Testen, ob mitten aus dem Bereich geloescht/eingefuegt wurde !!!
-}
-

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list