[Libreoffice-commits] .: sc/inc sc/Library_sc.mk sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Fri May 13 20:13:52 PDT 2011
sc/Library_sc.mk | 2
sc/inc/dbcolect.hxx | 266 -----
sc/inc/dbdata.hxx | 266 +++++
sc/inc/rangeutl.hxx | 2
sc/inc/table.hxx | 2
sc/source/core/data/column2.cxx | 2
sc/source/core/data/documen2.cxx | 2
sc/source/core/data/documen3.cxx | 2
sc/source/core/data/document.cxx | 2
sc/source/core/data/validat.cxx | 2
sc/source/core/inc/core_pch.hxx | 2
sc/source/core/tool/compiler.cxx | 2
sc/source/core/tool/dbcolect.cxx | 1037 -----------------------
sc/source/core/tool/dbdata.cxx | 1037 +++++++++++++++++++++++
sc/source/core/tool/interpr4.cxx | 2
sc/source/core/tool/rangeutl.cxx | 2
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/xename.cxx | 2
sc/source/filter/starcalc/scflt.cxx | 2
sc/source/filter/xml/XMLExportDatabaseRanges.cxx | 2
sc/source/filter/xml/xmldrani.cxx | 2
sc/source/filter/xml/xmldrani.hxx | 2
sc/source/ui/app/inputwin.cxx | 2
sc/source/ui/dbgui/consdlg.cxx | 2
sc/source/ui/dbgui/filtdlg.cxx | 2
sc/source/ui/dbgui/foptmgr.cxx | 2
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 | 2
sc/source/ui/docshell/dbdocfun.cxx | 2
sc/source/ui/docshell/dbdocimp.cxx | 2
sc/source/ui/docshell/docsh.cxx | 2
sc/source/ui/docshell/docsh4.cxx | 2
sc/source/ui/docshell/docsh5.cxx | 2
sc/source/ui/inc/dbnamdlg.hxx | 2
sc/source/ui/inc/simpref.hxx | 2
sc/source/ui/inc/ui_pch.hxx | 2
sc/source/ui/navipi/content.cxx | 2
sc/source/ui/navipi/navipi.cxx | 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 | 2
sc/source/ui/undo/undoutil.cxx | 2
sc/source/ui/unoobj/cellsuno.cxx | 2
sc/source/ui/unoobj/datauno.cxx | 2
sc/source/ui/unoobj/dispuno.cxx | 2
sc/source/ui/vba/vbarange.cxx | 2
sc/source/ui/view/cellsh1.cxx | 2
sc/source/ui/view/dbfunc.cxx | 2
sc/source/ui/view/dbfunc3.cxx | 2
sc/source/ui/view/gridwin.cxx | 2
sc/source/ui/view/gridwin4.cxx | 2
sc/source/ui/view/tabvwsh4.cxx | 2
sc/source/ui/view/viewfun3.cxx | 2
sc/source/ui/view/viewfun5.cxx | 2
sc/source/ui/view/viewfunc.cxx | 2
60 files changed, 1359 insertions(+), 1359 deletions(-)
New commits:
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 !!!
-}
-
-void ScDBData::ExtendDataArea(ScDocument* pDoc)
-{
- // Extend the DB area to include data rows immediately below.
- SCCOL nCol1a = nStartCol, nCol2a = nEndCol;
- SCROW nRow1a = nStartRow, nRow2a = nEndRow;
- pDoc->GetDataArea(nTable, nCol1a, nRow1a, nCol2a, nRow2a, false, false);
- nEndRow = nRow2a;
-}
-
-namespace {
-
-class FindByTable : public unary_function<ScDBData, bool>
-{
- SCTAB mnTab;
-public:
- FindByTable(SCTAB nTab) : mnTab(nTab) {}
-
- bool operator() (const ScDBData& r) const
- {
- ScRange aRange;
- r.GetArea(aRange);
- return aRange.aStart.Tab() == mnTab;
- }
-};
-
-class UpdateRefFunc : public unary_function<ScDBData, void>
-{
- ScDocument* mpDoc;
- UpdateRefMode meMode;
- SCCOL mnCol1;
- SCROW mnRow1;
- SCTAB mnTab1;
- SCCOL mnCol2;
- SCROW mnRow2;
- SCTAB mnTab2;
- SCsCOL mnDx;
- SCsROW mnDy;
- SCsTAB mnDz;
-
-public:
- UpdateRefFunc(ScDocument* pDoc, UpdateRefMode eMode,
- SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
- SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
- SCsCOL nDx, SCsROW nDy, SCsTAB nDz) :
- mpDoc(pDoc), meMode(eMode),
- mnCol1(nCol1), mnRow1(nRow1), mnTab1(nTab1),
- mnCol2(nCol2), mnRow2(nRow2), mnTab2(nTab2),
- mnDx(nDx), mnDy(nDy), mnDz(nDz) {}
-
- void operator() (ScDBData& r)
- {
- r.UpdateReference(mpDoc, meMode, mnCol1, mnRow1, mnTab1, mnCol2, mnRow2, mnTab2, mnDx, mnDy, mnDz);
- }
-};
-
-class UpdateMoveTabFunc : public unary_function<ScDBData, void>
-{
- SCTAB mnOldTab;
- SCTAB mnNewTab;
-public:
- UpdateMoveTabFunc(SCTAB nOld, SCTAB nNew) : mnOldTab(nOld), mnNewTab(nNew) {}
- void operator() (ScDBData& r)
- {
- r.UpdateMoveTab(mnOldTab, mnNewTab);
- }
-};
-
-class FindByCursor : public unary_function<ScDBData, bool>
-{
- SCCOL mnCol;
- SCROW mnRow;
- SCTAB mnTab;
- bool mbStartOnly;
-public:
- FindByCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) :
- mnCol(nCol), mnRow(nRow), mnTab(nTab), mbStartOnly(bStartOnly) {}
-
- bool operator() (const ScDBData& r)
- {
- return r.IsDBAtCursor(mnCol, mnRow, mnTab, mbStartOnly);
- }
-};
-
-class FindByRange : public unary_function<ScDBData, bool>
-{
- const ScRange& mrRange;
-public:
- FindByRange(const ScRange& rRange) : mrRange(rRange) {}
-
- bool operator() (const ScDBData& r)
- {
- return r.IsDBAtArea(
- mrRange.aStart.Tab(), mrRange.aStart.Col(), mrRange.aStart.Row(), mrRange.aEnd.Col(), mrRange.aEnd.Row());
- }
-};
-
-class FindByIndex : public unary_function<ScDBData, bool>
-{
- sal_uInt16 mnIndex;
-public:
- FindByIndex(sal_uInt16 nIndex) : mnIndex(nIndex) {}
- bool operator() (const ScDBData& r) const
- {
- return r.GetIndex() == mnIndex;
- }
-};
-
-class FindByName : public unary_function<ScDBData, bool>
-{
- const ::rtl::OUString& mrName;
-public:
- FindByName(const ::rtl::OUString& rName) : mrName(rName) {}
- bool operator() (const ScDBData& r) const
- {
- return r.GetName() == mrName;
- }
-};
-
-class FindFilterDBByTable : public unary_function<ScDBData, bool>
-{
- SCTAB mnTab;
-public:
- FindFilterDBByTable(SCTAB nTab) : mnTab(nTab) {}
- bool operator() (const ScDBData& r) const
- {
- if (r.GetTable() != mnTab)
- return false;
-
- return (r.HasAutoFilter() || r.HasQueryParam());
- }
-};
-
-}
-
-ScDBCollection::NamedDBs::NamedDBs(ScDBCollection& rParent, ScDocument& rDoc) :
- mrParent(rParent), mrDoc(rDoc) {}
-
-ScDBCollection::NamedDBs::NamedDBs(const NamedDBs& r) :
- maDBs(r.maDBs), mrParent(r.mrParent), mrDoc(r.mrDoc) {}
-
-ScDBCollection::NamedDBs::iterator ScDBCollection::NamedDBs::begin()
-{
- return maDBs.begin();
-}
-
-ScDBCollection::NamedDBs::iterator ScDBCollection::NamedDBs::end()
-{
- return maDBs.end();
-}
-
-ScDBCollection::NamedDBs::const_iterator ScDBCollection::NamedDBs::begin() const
-{
- return maDBs.begin();
-}
-
-ScDBCollection::NamedDBs::const_iterator ScDBCollection::NamedDBs::end() const
-{
- return maDBs.end();
-}
-
-ScDBData* ScDBCollection::NamedDBs::findByIndex(sal_uInt16 nIndex)
-{
- DBsType::iterator itr = find_if(
- maDBs.begin(), maDBs.end(), FindByIndex(nIndex));
- return itr == maDBs.end() ? NULL : &(*itr);
-}
-
-ScDBData* ScDBCollection::NamedDBs::findByName(const ::rtl::OUString& rName)
-{
- DBsType::iterator itr = find_if(
- maDBs.begin(), maDBs.end(), FindByName(rName));
- return itr == maDBs.end() ? NULL : &(*itr);
-}
-
-bool ScDBCollection::NamedDBs::insert(ScDBData* p)
-{
- auto_ptr<ScDBData> pData(p);
- if (!pData->GetIndex())
- pData->SetIndex(mrParent.nEntryIndex++);
-
- pair<DBsType::iterator, bool> r = maDBs.insert(pData);
-
- if (r.second && p->HasImportParam() && !p->HasImportSelection())
- {
- p->SetRefreshHandler(mrParent.GetRefreshHandler());
- p->SetRefreshControl(mrDoc.GetRefreshTimerControlAddress());
- }
- return r.second;
-}
-
-void ScDBCollection::NamedDBs::erase(iterator itr)
-{
- maDBs.erase(itr);
-}
-
-void ScDBCollection::NamedDBs::erase(const ScDBData& r)
-{
- maDBs.erase(r);
-}
-
-bool ScDBCollection::NamedDBs::empty() const
-{
- return maDBs.empty();
-}
-
-size_t ScDBCollection::NamedDBs::size() const
-{
- return maDBs.size();
-}
-
-bool ScDBCollection::NamedDBs::operator== (const NamedDBs& r) const
-{
- return maDBs == r.maDBs;
-}
-
-ScDBCollection::AnonDBs::iterator ScDBCollection::AnonDBs::begin()
-{
- return maDBs.begin();
-}
-
-ScDBCollection::AnonDBs::iterator ScDBCollection::AnonDBs::end()
-{
- return maDBs.end();
-}
-
-ScDBCollection::AnonDBs::const_iterator ScDBCollection::AnonDBs::begin() const
-{
- return maDBs.begin();
-}
-
-ScDBCollection::AnonDBs::const_iterator ScDBCollection::AnonDBs::end() const
-{
- return maDBs.end();
-}
-
-const ScDBData* ScDBCollection::AnonDBs::findAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const
-{
- DBsType::const_iterator itr = find_if(
- maDBs.begin(), maDBs.end(), FindByCursor(nCol, nRow, nTab, bStartOnly));
- return itr == maDBs.end() ? NULL : &(*itr);
-}
-
-const ScDBData* ScDBCollection::AnonDBs::findByRange(const ScRange& rRange) const
-{
- DBsType::const_iterator itr = find_if(
- maDBs.begin(), maDBs.end(), FindByRange(rRange));
- return itr == maDBs.end() ? NULL : &(*itr);
-}
-
-ScDBData* ScDBCollection::AnonDBs::getByRange(const ScRange& rRange)
-{
- const ScDBData* pData = findByRange(rRange);
- if (!pData)
- {
- // Insert a new db data. They all have identical names.
- rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM(STR_DB_GLOBAL_NONAME));
- ::std::auto_ptr<ScDBData> pNew(new ScDBData(
- aName, rRange.aStart.Tab(), rRange.aStart.Col(), rRange.aStart.Row(),
- rRange.aEnd.Col(), rRange.aEnd.Row(), true, false));
- pData = pNew.get();
- maDBs.push_back(pNew);
- }
- return const_cast<ScDBData*>(pData);
-}
-
-void ScDBCollection::AnonDBs::insert(ScDBData* p)
-{
- rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM(STR_DB_GLOBAL_NONAME));
- ::std::auto_ptr<ScDBData> pNew(p);
- maDBs.push_back(pNew);
-}
-
-void ScDBCollection::AnonDBs::erase(iterator itr)
-{
- maDBs.erase(itr);
-}
-
-bool ScDBCollection::AnonDBs::empty() const
-{
- return maDBs.empty();
-}
-
-size_t ScDBCollection::AnonDBs::size() const
-{
- return maDBs.size();
-}
-
-bool ScDBCollection::AnonDBs::operator== (const AnonDBs& r) const
-{
- return maDBs == r.maDBs;
-}
-
-ScDBCollection::ScDBCollection(ScDocument* pDocument) :
- pDoc(pDocument), nEntryIndex(SC_START_INDEX_DB_COLL), maNamedDBs(*this, *pDocument) {}
-
-ScDBCollection::ScDBCollection(const ScDBCollection& r) :
- pDoc(r.pDoc), nEntryIndex(r.nEntryIndex), maNamedDBs(r.maNamedDBs), maAnonDBs(r.maAnonDBs) {}
-
-ScDBCollection::NamedDBs& ScDBCollection::getNamedDBs()
-{
- return maNamedDBs;
-}
-
-const ScDBCollection::NamedDBs& ScDBCollection::getNamedDBs() const
-{
- return maNamedDBs;
-}
-
-ScDBCollection::AnonDBs& ScDBCollection::getAnonDBs()
-{
- return maAnonDBs;
-}
-
-const ScDBCollection::AnonDBs& ScDBCollection::getAnonDBs() const
-{
- return maAnonDBs;
-}
-
-const ScDBData* ScDBCollection::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly) const
-{
- // First, search the global named db ranges.
- NamedDBs::DBsType::const_iterator itr = find_if(
- maNamedDBs.begin(), maNamedDBs.end(), FindByCursor(nCol, nRow, nTab, bStartOnly));
- if (itr != maNamedDBs.end())
- return &(*itr);
-
- // Check for the sheet-local anonymous db range.
- const ScDBData* pNoNameData = pDoc->GetAnonymousDBData(nTab);
- if (pNoNameData)
- if (pNoNameData->IsDBAtCursor(nCol,nRow,nTab,bStartOnly))
- return pNoNameData;
-
- // Check the global anonymous db ranges.
- const ScDBData* pData = getAnonDBs().findAtCursor(nCol, nRow, nTab, bStartOnly);
- if (pData)
- return pData;
-
- return NULL;
-}
-
-ScDBData* ScDBCollection::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly)
-{
- // First, search the global named db ranges.
- NamedDBs::DBsType::iterator itr = find_if(
- maNamedDBs.begin(), maNamedDBs.end(), FindByCursor(nCol, nRow, nTab, bStartOnly));
- if (itr != maNamedDBs.end())
- return &(*itr);
-
- // Check for the sheet-local anonymous db range.
- ScDBData* pNoNameData = pDoc->GetAnonymousDBData(nTab);
- if (pNoNameData)
- if (pNoNameData->IsDBAtCursor(nCol,nRow,nTab,bStartOnly))
- return pNoNameData;
-
- // Check the global anonymous db ranges.
- const ScDBData* pData = getAnonDBs().findAtCursor(nCol, nRow, nTab, bStartOnly);
- if (pData)
- return const_cast<ScDBData*>(pData);
-
- return NULL;
-}
-
-const ScDBData* ScDBCollection::GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
-{
- // First, search the global named db ranges.
- ScRange aRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab);
- NamedDBs::DBsType::const_iterator itr = find_if(
- maNamedDBs.begin(), maNamedDBs.end(), FindByRange(aRange));
- if (itr != maNamedDBs.end())
- return &(*itr);
-
- // Check for the sheet-local anonymous db range.
- ScDBData* pNoNameData = pDoc->GetAnonymousDBData(nTab);
- if (pNoNameData)
- if (pNoNameData->IsDBAtArea(nTab, nCol1, nRow1, nCol2, nRow2))
- return pNoNameData;
-
- // Lastly, check the global anonymous db ranges.
- return maAnonDBs.findByRange(aRange);
-}
-
-ScDBData* ScDBCollection::GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
-{
- // First, search the global named db ranges.
- ScRange aRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab);
- NamedDBs::DBsType::iterator itr = find_if(
- maNamedDBs.begin(), maNamedDBs.end(), FindByRange(aRange));
- if (itr != maNamedDBs.end())
- return &(*itr);
-
- // Check for the sheet-local anonymous db range.
- ScDBData* pNoNameData = pDoc->GetAnonymousDBData(nTab);
- if (pNoNameData)
- if (pNoNameData->IsDBAtArea(nTab, nCol1, nRow1, nCol2, nRow2))
- return pNoNameData;
-
- // Lastly, check the global anonymous db ranges.
- const ScDBData* pData = getAnonDBs().findByRange(aRange);
- if (pData)
- return const_cast<ScDBData*>(pData);
-
- return NULL;
-}
-
-const ScDBData* ScDBCollection::GetFilterDBAtTable(SCTAB nTab) const
-{
- NamedDBs::DBsType::const_iterator itr = find_if(
- maNamedDBs.begin(), maNamedDBs.end(), FindFilterDBByTable(nTab));
-
- return itr == maNamedDBs.end() ? NULL : &(*itr);
-}
-
-void ScDBCollection::DeleteOnTab( SCTAB nTab )
-{
- FindByTable func(nTab);
- // First, collect the positions of all items that need to be deleted.
- ::std::vector<NamedDBs::DBsType::iterator> v;
- {
- NamedDBs::DBsType::iterator itr = maNamedDBs.begin(), itrEnd = maNamedDBs.end();
- for (; itr != itrEnd; ++itr)
- {
- if (func(*itr))
- v.push_back(itr);
- }
- }
-
- // Delete them all.
- ::std::vector<NamedDBs::DBsType::iterator>::iterator itr = v.begin(), itrEnd = v.end();
- for (; itr != itrEnd; ++itr)
- maNamedDBs.erase(*itr);
-
- remove_if(maAnonDBs.begin(), maAnonDBs.end(), func);
-}
-
-void ScDBCollection::UpdateReference(UpdateRefMode eUpdateRefMode,
- SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
- SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
- SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
-{
- ScDBData* pData = pDoc->GetAnonymousDBData(nTab1);
- if (pData)
- {
- if (nTab1 == nTab2 && nDz == 0)
- {
- pData->UpdateReference(
- pDoc, eUpdateRefMode,
- nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz);
- }
- else
- {
- //this will perhabs break undo
- }
- }
-
- UpdateRefFunc func(pDoc, eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz);
- for_each(maNamedDBs.begin(), maNamedDBs.end(), func);
- for_each(maAnonDBs.begin(), maAnonDBs.end(), func);
-}
-
-
-void ScDBCollection::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos )
-{
- UpdateMoveTabFunc func(nOldPos, nNewPos);
- for_each(maNamedDBs.begin(), maNamedDBs.end(), func);
- for_each(maAnonDBs.begin(), maAnonDBs.end(), func);
-}
-
-ScDBData* ScDBCollection::GetDBNearCursor(SCCOL nCol, SCROW nRow, SCTAB nTab )
-{
- ScDBData* pNearData = NULL;
- NamedDBs::DBsType::iterator itr = maNamedDBs.begin(), itrEnd = maNamedDBs.end();
- for (; itr != itrEnd; ++itr)
- {
- SCTAB nAreaTab;
- SCCOL nStartCol, nEndCol;
- SCROW nStartRow, nEndRow;
- itr->GetArea( nAreaTab, nStartCol, nStartRow, nEndCol, nEndRow );
- if ( nTab == nAreaTab && nCol+1 >= nStartCol && nCol <= nEndCol+1 &&
- nRow+1 >= nStartRow && nRow <= nEndRow+1 )
- {
- if ( nCol < nStartCol || nCol > nEndCol || nRow < nStartRow || nRow > nEndRow )
- {
- if (!pNearData)
- pNearData = &(*itr); // ersten angrenzenden Bereich merken
- }
- else
- return &(*itr); // nicht "unbenannt" und Cursor steht wirklich drin
- }
- }
- if (pNearData)
- return pNearData; // angrenzender, wenn nichts direkt getroffen
- return pDoc->GetAnonymousDBData(nTab); // "unbenannt" nur zurueck, wenn sonst nichts gefunden
-}
-
-bool ScDBCollection::empty() const
-{
- return maNamedDBs.empty() && maAnonDBs.empty();
-}
-
-bool ScDBCollection::operator== (const ScDBCollection& r) const
-{
- return maNamedDBs == r.maNamedDBs && maAnonDBs == r.maAnonDBs &&
- nEntryIndex == r.nEntryIndex && pDoc == r.pDoc && aRefreshHandler == r.aRefreshHandler;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
new file mode 100644
index 0000000..a1ca196
--- /dev/null
+++ b/sc/source/core/tool/dbdata.cxx
@@ -0,0 +1,1037 @@
+/* -*- 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 "dbdata.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 !!!
+}
+
+void ScDBData::ExtendDataArea(ScDocument* pDoc)
+{
+ // Extend the DB area to include data rows immediately below.
+ SCCOL nCol1a = nStartCol, nCol2a = nEndCol;
+ SCROW nRow1a = nStartRow, nRow2a = nEndRow;
+ pDoc->GetDataArea(nTable, nCol1a, nRow1a, nCol2a, nRow2a, false, false);
+ nEndRow = nRow2a;
+}
+
+namespace {
+
+class FindByTable : public unary_function<ScDBData, bool>
+{
+ SCTAB mnTab;
+public:
+ FindByTable(SCTAB nTab) : mnTab(nTab) {}
+
+ bool operator() (const ScDBData& r) const
+ {
+ ScRange aRange;
+ r.GetArea(aRange);
+ return aRange.aStart.Tab() == mnTab;
+ }
+};
+
+class UpdateRefFunc : public unary_function<ScDBData, void>
+{
+ ScDocument* mpDoc;
+ UpdateRefMode meMode;
+ SCCOL mnCol1;
+ SCROW mnRow1;
+ SCTAB mnTab1;
+ SCCOL mnCol2;
+ SCROW mnRow2;
+ SCTAB mnTab2;
+ SCsCOL mnDx;
+ SCsROW mnDy;
+ SCsTAB mnDz;
+
+public:
+ UpdateRefFunc(ScDocument* pDoc, UpdateRefMode eMode,
+ SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
+ SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
+ SCsCOL nDx, SCsROW nDy, SCsTAB nDz) :
+ mpDoc(pDoc), meMode(eMode),
+ mnCol1(nCol1), mnRow1(nRow1), mnTab1(nTab1),
+ mnCol2(nCol2), mnRow2(nRow2), mnTab2(nTab2),
+ mnDx(nDx), mnDy(nDy), mnDz(nDz) {}
+
+ void operator() (ScDBData& r)
+ {
+ r.UpdateReference(mpDoc, meMode, mnCol1, mnRow1, mnTab1, mnCol2, mnRow2, mnTab2, mnDx, mnDy, mnDz);
+ }
+};
+
+class UpdateMoveTabFunc : public unary_function<ScDBData, void>
+{
+ SCTAB mnOldTab;
+ SCTAB mnNewTab;
+public:
+ UpdateMoveTabFunc(SCTAB nOld, SCTAB nNew) : mnOldTab(nOld), mnNewTab(nNew) {}
+ void operator() (ScDBData& r)
+ {
+ r.UpdateMoveTab(mnOldTab, mnNewTab);
+ }
+};
+
+class FindByCursor : public unary_function<ScDBData, bool>
+{
+ SCCOL mnCol;
+ SCROW mnRow;
+ SCTAB mnTab;
+ bool mbStartOnly;
+public:
+ FindByCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) :
+ mnCol(nCol), mnRow(nRow), mnTab(nTab), mbStartOnly(bStartOnly) {}
+
+ bool operator() (const ScDBData& r)
+ {
+ return r.IsDBAtCursor(mnCol, mnRow, mnTab, mbStartOnly);
+ }
+};
+
+class FindByRange : public unary_function<ScDBData, bool>
+{
+ const ScRange& mrRange;
+public:
+ FindByRange(const ScRange& rRange) : mrRange(rRange) {}
+
+ bool operator() (const ScDBData& r)
+ {
+ return r.IsDBAtArea(
+ mrRange.aStart.Tab(), mrRange.aStart.Col(), mrRange.aStart.Row(), mrRange.aEnd.Col(), mrRange.aEnd.Row());
+ }
+};
+
+class FindByIndex : public unary_function<ScDBData, bool>
+{
+ sal_uInt16 mnIndex;
+public:
+ FindByIndex(sal_uInt16 nIndex) : mnIndex(nIndex) {}
+ bool operator() (const ScDBData& r) const
+ {
+ return r.GetIndex() == mnIndex;
+ }
+};
+
+class FindByName : public unary_function<ScDBData, bool>
+{
+ const ::rtl::OUString& mrName;
+public:
+ FindByName(const ::rtl::OUString& rName) : mrName(rName) {}
+ bool operator() (const ScDBData& r) const
+ {
+ return r.GetName() == mrName;
+ }
+};
+
+class FindFilterDBByTable : public unary_function<ScDBData, bool>
+{
+ SCTAB mnTab;
+public:
+ FindFilterDBByTable(SCTAB nTab) : mnTab(nTab) {}
+ bool operator() (const ScDBData& r) const
+ {
+ if (r.GetTable() != mnTab)
+ return false;
+
+ return (r.HasAutoFilter() || r.HasQueryParam());
+ }
+};
+
+}
+
+ScDBCollection::NamedDBs::NamedDBs(ScDBCollection& rParent, ScDocument& rDoc) :
+ mrParent(rParent), mrDoc(rDoc) {}
+
+ScDBCollection::NamedDBs::NamedDBs(const NamedDBs& r) :
+ maDBs(r.maDBs), mrParent(r.mrParent), mrDoc(r.mrDoc) {}
+
+ScDBCollection::NamedDBs::iterator ScDBCollection::NamedDBs::begin()
+{
+ return maDBs.begin();
+}
+
+ScDBCollection::NamedDBs::iterator ScDBCollection::NamedDBs::end()
+{
+ return maDBs.end();
+}
+
+ScDBCollection::NamedDBs::const_iterator ScDBCollection::NamedDBs::begin() const
+{
+ return maDBs.begin();
+}
+
+ScDBCollection::NamedDBs::const_iterator ScDBCollection::NamedDBs::end() const
+{
+ return maDBs.end();
+}
+
+ScDBData* ScDBCollection::NamedDBs::findByIndex(sal_uInt16 nIndex)
+{
+ DBsType::iterator itr = find_if(
+ maDBs.begin(), maDBs.end(), FindByIndex(nIndex));
+ return itr == maDBs.end() ? NULL : &(*itr);
+}
+
+ScDBData* ScDBCollection::NamedDBs::findByName(const ::rtl::OUString& rName)
+{
+ DBsType::iterator itr = find_if(
+ maDBs.begin(), maDBs.end(), FindByName(rName));
+ return itr == maDBs.end() ? NULL : &(*itr);
+}
+
+bool ScDBCollection::NamedDBs::insert(ScDBData* p)
+{
+ auto_ptr<ScDBData> pData(p);
+ if (!pData->GetIndex())
+ pData->SetIndex(mrParent.nEntryIndex++);
+
+ pair<DBsType::iterator, bool> r = maDBs.insert(pData);
+
+ if (r.second && p->HasImportParam() && !p->HasImportSelection())
+ {
+ p->SetRefreshHandler(mrParent.GetRefreshHandler());
+ p->SetRefreshControl(mrDoc.GetRefreshTimerControlAddress());
+ }
+ return r.second;
+}
+
+void ScDBCollection::NamedDBs::erase(iterator itr)
+{
+ maDBs.erase(itr);
+}
+
+void ScDBCollection::NamedDBs::erase(const ScDBData& r)
+{
+ maDBs.erase(r);
+}
+
+bool ScDBCollection::NamedDBs::empty() const
+{
+ return maDBs.empty();
+}
+
+size_t ScDBCollection::NamedDBs::size() const
+{
+ return maDBs.size();
+}
+
+bool ScDBCollection::NamedDBs::operator== (const NamedDBs& r) const
+{
+ return maDBs == r.maDBs;
+}
+
+ScDBCollection::AnonDBs::iterator ScDBCollection::AnonDBs::begin()
+{
+ return maDBs.begin();
+}
+
+ScDBCollection::AnonDBs::iterator ScDBCollection::AnonDBs::end()
+{
+ return maDBs.end();
+}
+
+ScDBCollection::AnonDBs::const_iterator ScDBCollection::AnonDBs::begin() const
+{
+ return maDBs.begin();
+}
+
+ScDBCollection::AnonDBs::const_iterator ScDBCollection::AnonDBs::end() const
+{
+ return maDBs.end();
+}
+
+const ScDBData* ScDBCollection::AnonDBs::findAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const
+{
+ DBsType::const_iterator itr = find_if(
+ maDBs.begin(), maDBs.end(), FindByCursor(nCol, nRow, nTab, bStartOnly));
+ return itr == maDBs.end() ? NULL : &(*itr);
+}
+
+const ScDBData* ScDBCollection::AnonDBs::findByRange(const ScRange& rRange) const
+{
+ DBsType::const_iterator itr = find_if(
+ maDBs.begin(), maDBs.end(), FindByRange(rRange));
+ return itr == maDBs.end() ? NULL : &(*itr);
+}
+
+ScDBData* ScDBCollection::AnonDBs::getByRange(const ScRange& rRange)
+{
+ const ScDBData* pData = findByRange(rRange);
+ if (!pData)
+ {
+ // Insert a new db data. They all have identical names.
+ rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM(STR_DB_GLOBAL_NONAME));
+ ::std::auto_ptr<ScDBData> pNew(new ScDBData(
+ aName, rRange.aStart.Tab(), rRange.aStart.Col(), rRange.aStart.Row(),
+ rRange.aEnd.Col(), rRange.aEnd.Row(), true, false));
+ pData = pNew.get();
+ maDBs.push_back(pNew);
+ }
+ return const_cast<ScDBData*>(pData);
+}
+
+void ScDBCollection::AnonDBs::insert(ScDBData* p)
+{
+ rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM(STR_DB_GLOBAL_NONAME));
+ ::std::auto_ptr<ScDBData> pNew(p);
+ maDBs.push_back(pNew);
+}
+
+void ScDBCollection::AnonDBs::erase(iterator itr)
+{
+ maDBs.erase(itr);
+}
+
+bool ScDBCollection::AnonDBs::empty() const
+{
+ return maDBs.empty();
+}
+
+size_t ScDBCollection::AnonDBs::size() const
+{
+ return maDBs.size();
+}
+
+bool ScDBCollection::AnonDBs::operator== (const AnonDBs& r) const
+{
+ return maDBs == r.maDBs;
+}
+
+ScDBCollection::ScDBCollection(ScDocument* pDocument) :
+ pDoc(pDocument), nEntryIndex(SC_START_INDEX_DB_COLL), maNamedDBs(*this, *pDocument) {}
+
+ScDBCollection::ScDBCollection(const ScDBCollection& r) :
+ pDoc(r.pDoc), nEntryIndex(r.nEntryIndex), maNamedDBs(r.maNamedDBs), maAnonDBs(r.maAnonDBs) {}
+
+ScDBCollection::NamedDBs& ScDBCollection::getNamedDBs()
+{
+ return maNamedDBs;
+}
+
+const ScDBCollection::NamedDBs& ScDBCollection::getNamedDBs() const
+{
+ return maNamedDBs;
+}
+
+ScDBCollection::AnonDBs& ScDBCollection::getAnonDBs()
+{
+ return maAnonDBs;
+}
+
+const ScDBCollection::AnonDBs& ScDBCollection::getAnonDBs() const
+{
+ return maAnonDBs;
+}
+
+const ScDBData* ScDBCollection::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly) const
+{
+ // First, search the global named db ranges.
+ NamedDBs::DBsType::const_iterator itr = find_if(
+ maNamedDBs.begin(), maNamedDBs.end(), FindByCursor(nCol, nRow, nTab, bStartOnly));
+ if (itr != maNamedDBs.end())
+ return &(*itr);
+
+ // Check for the sheet-local anonymous db range.
+ const ScDBData* pNoNameData = pDoc->GetAnonymousDBData(nTab);
+ if (pNoNameData)
+ if (pNoNameData->IsDBAtCursor(nCol,nRow,nTab,bStartOnly))
+ return pNoNameData;
+
+ // Check the global anonymous db ranges.
+ const ScDBData* pData = getAnonDBs().findAtCursor(nCol, nRow, nTab, bStartOnly);
+ if (pData)
+ return pData;
+
+ return NULL;
+}
+
+ScDBData* ScDBCollection::GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly)
+{
+ // First, search the global named db ranges.
+ NamedDBs::DBsType::iterator itr = find_if(
+ maNamedDBs.begin(), maNamedDBs.end(), FindByCursor(nCol, nRow, nTab, bStartOnly));
+ if (itr != maNamedDBs.end())
+ return &(*itr);
+
+ // Check for the sheet-local anonymous db range.
+ ScDBData* pNoNameData = pDoc->GetAnonymousDBData(nTab);
+ if (pNoNameData)
+ if (pNoNameData->IsDBAtCursor(nCol,nRow,nTab,bStartOnly))
+ return pNoNameData;
+
+ // Check the global anonymous db ranges.
+ const ScDBData* pData = getAnonDBs().findAtCursor(nCol, nRow, nTab, bStartOnly);
+ if (pData)
+ return const_cast<ScDBData*>(pData);
+
+ return NULL;
+}
+
+const ScDBData* ScDBCollection::GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
+{
+ // First, search the global named db ranges.
+ ScRange aRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab);
+ NamedDBs::DBsType::const_iterator itr = find_if(
+ maNamedDBs.begin(), maNamedDBs.end(), FindByRange(aRange));
+ if (itr != maNamedDBs.end())
+ return &(*itr);
+
+ // Check for the sheet-local anonymous db range.
+ ScDBData* pNoNameData = pDoc->GetAnonymousDBData(nTab);
+ if (pNoNameData)
+ if (pNoNameData->IsDBAtArea(nTab, nCol1, nRow1, nCol2, nRow2))
+ return pNoNameData;
+
+ // Lastly, check the global anonymous db ranges.
+ return maAnonDBs.findByRange(aRange);
+}
+
+ScDBData* ScDBCollection::GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
+{
+ // First, search the global named db ranges.
+ ScRange aRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab);
+ NamedDBs::DBsType::iterator itr = find_if(
+ maNamedDBs.begin(), maNamedDBs.end(), FindByRange(aRange));
+ if (itr != maNamedDBs.end())
+ return &(*itr);
+
+ // Check for the sheet-local anonymous db range.
+ ScDBData* pNoNameData = pDoc->GetAnonymousDBData(nTab);
+ if (pNoNameData)
+ if (pNoNameData->IsDBAtArea(nTab, nCol1, nRow1, nCol2, nRow2))
+ return pNoNameData;
+
+ // Lastly, check the global anonymous db ranges.
+ const ScDBData* pData = getAnonDBs().findByRange(aRange);
+ if (pData)
+ return const_cast<ScDBData*>(pData);
+
+ return NULL;
+}
+
+const ScDBData* ScDBCollection::GetFilterDBAtTable(SCTAB nTab) const
+{
+ NamedDBs::DBsType::const_iterator itr = find_if(
+ maNamedDBs.begin(), maNamedDBs.end(), FindFilterDBByTable(nTab));
+
+ return itr == maNamedDBs.end() ? NULL : &(*itr);
+}
+
+void ScDBCollection::DeleteOnTab( SCTAB nTab )
+{
+ FindByTable func(nTab);
+ // First, collect the positions of all items that need to be deleted.
+ ::std::vector<NamedDBs::DBsType::iterator> v;
+ {
+ NamedDBs::DBsType::iterator itr = maNamedDBs.begin(), itrEnd = maNamedDBs.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ if (func(*itr))
+ v.push_back(itr);
+ }
+ }
+
+ // Delete them all.
+ ::std::vector<NamedDBs::DBsType::iterator>::iterator itr = v.begin(), itrEnd = v.end();
+ for (; itr != itrEnd; ++itr)
+ maNamedDBs.erase(*itr);
+
+ remove_if(maAnonDBs.begin(), maAnonDBs.end(), func);
+}
+
+void ScDBCollection::UpdateReference(UpdateRefMode eUpdateRefMode,
+ SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
+ SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
+ SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
+{
+ ScDBData* pData = pDoc->GetAnonymousDBData(nTab1);
+ if (pData)
+ {
+ if (nTab1 == nTab2 && nDz == 0)
+ {
+ pData->UpdateReference(
+ pDoc, eUpdateRefMode,
+ nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz);
+ }
+ else
+ {
+ //this will perhabs break undo
+ }
+ }
+
+ UpdateRefFunc func(pDoc, eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz);
+ for_each(maNamedDBs.begin(), maNamedDBs.end(), func);
+ for_each(maAnonDBs.begin(), maAnonDBs.end(), func);
+}
+
+
+void ScDBCollection::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos )
+{
+ UpdateMoveTabFunc func(nOldPos, nNewPos);
+ for_each(maNamedDBs.begin(), maNamedDBs.end(), func);
+ for_each(maAnonDBs.begin(), maAnonDBs.end(), func);
+}
+
+ScDBData* ScDBCollection::GetDBNearCursor(SCCOL nCol, SCROW nRow, SCTAB nTab )
+{
+ ScDBData* pNearData = NULL;
+ NamedDBs::DBsType::iterator itr = maNamedDBs.begin(), itrEnd = maNamedDBs.end();
+ for (; itr != itrEnd; ++itr)
+ {
+ SCTAB nAreaTab;
+ SCCOL nStartCol, nEndCol;
+ SCROW nStartRow, nEndRow;
+ itr->GetArea( nAreaTab, nStartCol, nStartRow, nEndCol, nEndRow );
+ if ( nTab == nAreaTab && nCol+1 >= nStartCol && nCol <= nEndCol+1 &&
+ nRow+1 >= nStartRow && nRow <= nEndRow+1 )
+ {
+ if ( nCol < nStartCol || nCol > nEndCol || nRow < nStartRow || nRow > nEndRow )
+ {
+ if (!pNearData)
+ pNearData = &(*itr); // ersten angrenzenden Bereich merken
+ }
+ else
+ return &(*itr); // nicht "unbenannt" und Cursor steht wirklich drin
+ }
+ }
+ if (pNearData)
+ return pNearData; // angrenzender, wenn nichts direkt getroffen
+ return pDoc->GetAnonymousDBData(nTab); // "unbenannt" nur zurueck, wenn sonst nichts gefunden
+}
+
+bool ScDBCollection::empty() const
+{
+ return maNamedDBs.empty() && maAnonDBs.empty();
+}
+
+bool ScDBCollection::operator== (const ScDBCollection& r) const
+{
+ return maNamedDBs == r.maNamedDBs && maAnonDBs == r.maAnonDBs &&
+ nEntryIndex == r.nEntryIndex && pDoc == r.pDoc && aRefreshHandler == r.aRefreshHandler;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 9abbcb1..c7fb264 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -55,7 +55,7 @@
#include "interpre.hxx"
#include "global.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "cell.hxx"
#include "callform.hxx"
#include "addincol.hxx"
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index ff8866b..3c50143 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -38,7 +38,7 @@
#include "rangeutl.hxx"
#include "document.hxx"
#include "global.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "rangenam.hxx"
#include "scresid.hxx"
#include "globstr.hrc"
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index 40ff8a4..8d6d49f 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -51,7 +51,7 @@
#include "dociter.hxx"
#include "document.hxx"
#include "rangenam.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "global.hxx"
#include "globstr.hrc"
#include "progress.hxx"
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 6389342..223dd7b 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -83,7 +83,7 @@
#include "docpool.hxx"
#include "attrib.hxx"
#include "conditio.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "globalnames.hxx"
#include "editutil.hxx"
#include "markdata.hxx"
diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index 619d48a..60b0ca7 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -82,7 +82,7 @@
#include "progress.hxx"
#include "dociter.hxx"
#include "rangenam.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "stlsheet.hxx"
#include "stlpool.hxx"
#include "editutil.hxx"
diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index 55a4ea8..432390a 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -35,7 +35,7 @@
#include "globstr.hrc"
#include "document.hxx"
#include "rangenam.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "xehelper.hxx"
#include "xelink.hxx"
#include "globalnames.hxx"
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index 2abcbe2..dfdbb58 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -65,7 +65,7 @@
#include "document.hxx"
#include "collect.hxx"
#include "rangenam.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "stlsheet.hxx"
#include "stlpool.hxx"
#include "filter.hxx"
diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
index b81f179..86084a6 100644
--- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
+++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
@@ -41,7 +41,7 @@
#include "XMLExportIterator.hxx"
#include "XMLConverter.hxx"
#include "unonames.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "document.hxx"
#include "globstr.hrc"
#include "globalnames.hxx"
diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx
index bef1205..c7a26d7 100644
--- a/sc/source/filter/xml/xmldrani.cxx
+++ b/sc/source/filter/xml/xmldrani.cxx
@@ -41,7 +41,7 @@
#include "globstr.hrc"
#include "globalnames.hxx"
#include "docuno.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "datauno.hxx"
#include "attrib.hxx"
#include "unonames.hxx"
diff --git a/sc/source/filter/xml/xmldrani.hxx b/sc/source/filter/xml/xmldrani.hxx
index 0f4d9c6..6a8c1b2 100644
--- a/sc/source/filter/xml/xmldrani.hxx
+++ b/sc/source/filter/xml/xmldrani.hxx
@@ -39,7 +39,7 @@
#include <com/sun/star/table/CellRangeAddress.hpp>
#include <com/sun/star/table/TableOrientation.hpp>
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
class ScDBData;
class ScXMLImport;
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index de04792..d4e5018 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -67,7 +67,7 @@
#include "appoptio.hxx"
#include "rangenam.hxx"
#include <formula/compiler.hrc>
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "rangeutl.hxx"
#include "docfunc.hxx"
#include "funcdesc.hxx"
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx
index 571caed..e2d5731 100644
--- a/sc/source/ui/dbgui/consdlg.cxx
+++ b/sc/source/ui/dbgui/consdlg.cxx
@@ -39,7 +39,7 @@
#include "tabvwsh.hxx"
#include "uiitems.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "rangenam.hxx"
#include "rangeutl.hxx"
#include "reffact.hxx"
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 36551ba..205d038 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -39,7 +39,7 @@
#include <vcl/waitobj.hxx>
#include "uiitems.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "reffact.hxx"
#include "viewdata.hxx"
#include "document.hxx"
diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx
index ce2abde..a99d872 100644
--- a/sc/source/ui/dbgui/foptmgr.cxx
+++ b/sc/source/ui/dbgui/foptmgr.cxx
@@ -40,7 +40,7 @@
#include "anyrefdg.hxx"
#include "rangeutl.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "viewdata.hxx"
#include "document.hxx"
#include "queryparam.hxx"
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index b2e0cfe..2e73149 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -44,7 +44,7 @@
#include "uiitems.hxx"
#include "global.hxx"
#include "globalnames.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "scresid.hxx"
#include "sc.hrc"
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index c704f59..289019d 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -38,7 +38,7 @@
#include "uiitems.hxx"
#include "rangenam.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "reffact.hxx"
#include "viewdata.hxx"
#include "document.hxx"
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 0ddd3b1..e4b9529 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -44,7 +44,7 @@
#include "document.hxx"
#include "global.hxx"
#include "globalnames.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "userlist.hxx"
#include "rangeutl.hxx"
#include "scresid.hxx"
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index 5bada6b..e9e97bd 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -47,7 +47,7 @@
#include "document.hxx"
#include "docsh.hxx"
#include "rangenam.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "undoblk.hxx"
#include "globstr.hrc"
#include "markdata.hxx"
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 741e226..e20f218 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -41,7 +41,7 @@
#include "dbdocfun.hxx"
#include "sc.hrc"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "undodat.hxx"
#include "docsh.hxx"
#include "docfunc.hxx"
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index 64cf97d..10e704c 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -56,7 +56,7 @@
#include "docsh.hxx"
#include "globstr.hrc"
#include "scerrors.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "markdata.hxx"
#include "undodat.hxx"
#include "progress.hxx"
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 46687e8..ff9b70e 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -118,7 +118,7 @@
#include "xmlwrap.hxx"
#include "drwlayer.hxx"
#include "refreshtimer.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "scextopt.hxx"
#include "compiler.hxx"
#include "cfgids.hxx"
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index e4aa32c..36e0e8e 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -96,7 +96,7 @@ using namespace ::com::sun::star;
#include "undocell.hxx"
#include "undotab.hxx"
#include "inputhdl.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "servobj.hxx"
#include "rangenam.hxx"
#include "scmod.hxx"
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 46da786..da2bf45 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -58,7 +58,7 @@
#include "dpshttab.hxx"
#include "dbdocfun.hxx"
#include "consoli.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "olinetab.hxx"
#include "patattr.hxx"
#include "attrib.hxx"
diff --git a/sc/source/ui/inc/dbnamdlg.hxx b/sc/source/ui/inc/dbnamdlg.hxx
index e74b8f7..e547a47 100644
--- a/sc/source/ui/inc/dbnamdlg.hxx
+++ b/sc/source/ui/inc/dbnamdlg.hxx
@@ -35,7 +35,7 @@
#include <vcl/morebtn.hxx>
#include "anyrefdg.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "expftext.hxx"
class ScViewData;
diff --git a/sc/source/ui/inc/simpref.hxx b/sc/source/ui/inc/simpref.hxx
index d0ddb0b..40d5b30 100644
--- a/sc/source/ui/inc/simpref.hxx
+++ b/sc/source/ui/inc/simpref.hxx
@@ -37,7 +37,7 @@
#include <vcl/morebtn.hxx>
#include "anyrefdg.hxx"
-#include "dbcolect.hxx"
+#include "dbdata.hxx"
#include "expftext.hxx"
class ScViewData;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list