[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/inc sc/Library_sc.mk sc/source
Kohei Yoshida
kohei.yoshida at gmail.com
Tue Jun 18 12:34:04 PDT 2013
sc/Library_sc.mk | 1
sc/inc/cell.hxx | 42 --------------
sc/inc/editdataarray.hxx | 75 ++++++++++++++++++++++++++
sc/source/core/data/attarray.cxx | 2
sc/source/core/data/cell2.cxx | 70 ------------------------
sc/source/core/data/cellvalue.cxx | 1
sc/source/core/data/column.cxx | 1
sc/source/core/data/column2.cxx | 1
sc/source/core/data/column3.cxx | 1
sc/source/core/data/dociter.cxx | 1
sc/source/core/data/documen2.cxx | 1
sc/source/core/data/documen3.cxx | 1
sc/source/core/data/documen4.cxx | 1
sc/source/core/data/documen6.cxx | 1
sc/source/core/data/documen7.cxx | 1
sc/source/core/data/documen8.cxx | 1
sc/source/core/data/document.cxx | 1
sc/source/core/data/documentimport.cxx | 1
sc/source/core/tool/editdataarray.cxx | 93 +++++++++++++++++++++++++++++++++
sc/source/ui/undo/undoblk3.cxx | 2
20 files changed, 171 insertions(+), 127 deletions(-)
New commits:
commit 77f475c36c63bf9543a5b9c0bbc083b6d2f781b4
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Jun 18 15:36:19 2013 -0400
Move ScEditDataArray out of cell.?xx and into its own files.
Change-Id: I107cec7d70f4d00ff52cb071d69a615fbab8d9f2
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index d7de9aa..c20746b 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -197,6 +197,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/tool/detfunc \
sc/source/core/tool/docoptio \
sc/source/core/tool/doubleref \
+ sc/source/core/tool/editdataarray \
sc/source/core/tool/editutil \
sc/source/core/tool/filtopt \
sc/source/core/tool/formulagroup \
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index 860104b..aef29df 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -199,48 +199,6 @@ public:
void UpdateFields(SCTAB nTab);
};
-class ScEditDataArray
-{
-public:
- class Item
- {
- public:
- explicit Item(SCTAB nTab, SCCOL nCol, SCROW nRow,
- EditTextObject* pOldData, EditTextObject* pNewData);
- ~Item();
-
- const EditTextObject* GetOldData() const;
- const EditTextObject* GetNewData() const;
- SCTAB GetTab() const;
- SCCOL GetCol() const;
- SCROW GetRow() const;
-
- private:
- Item(); // disabled
-
- private:
- ::boost::shared_ptr<EditTextObject> mpOldData;
- ::boost::shared_ptr<EditTextObject> mpNewData;
- SCTAB mnTab;
- SCCOL mnCol;
- SCROW mnRow;
-
- };
-
- ScEditDataArray();
- ~ScEditDataArray();
-
- void AddItem(SCTAB nTab, SCCOL nCol, SCROW nRow,
- EditTextObject* pOldData, EditTextObject* pNewData);
-
- const Item* First();
- const Item* Next();
-
-private:
- ::std::vector<Item>::const_iterator maIter;
- ::std::vector<Item> maArray;
-};
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/editdataarray.hxx b/sc/inc/editdataarray.hxx
new file mode 100644
index 0000000..fdcccbd
--- /dev/null
+++ b/sc/inc/editdataarray.hxx
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef SC_EDITDATAARRAY_HXX
+#define SC_EDITDATAARRAY_HXX
+
+#include "address.hxx"
+#include "editeng/editobj.hxx"
+
+#include <vector>
+#include <boost/shared_ptr.hpp>
+
+class EditTextObject;
+
+class ScEditDataArray
+{
+public:
+ class Item
+ {
+ public:
+ explicit Item(SCTAB nTab, SCCOL nCol, SCROW nRow,
+ EditTextObject* pOldData, EditTextObject* pNewData);
+ ~Item();
+
+ const EditTextObject* GetOldData() const;
+ const EditTextObject* GetNewData() const;
+ SCTAB GetTab() const;
+ SCCOL GetCol() const;
+ SCROW GetRow() const;
+
+ private:
+ Item(); // disabled
+
+ private:
+ ::boost::shared_ptr<EditTextObject> mpOldData;
+ ::boost::shared_ptr<EditTextObject> mpNewData;
+ SCTAB mnTab;
+ SCCOL mnCol;
+ SCROW mnRow;
+
+ };
+
+ ScEditDataArray();
+ ~ScEditDataArray();
+
+ void AddItem(SCTAB nTab, SCCOL nCol, SCROW nRow,
+ EditTextObject* pOldData, EditTextObject* pNewData);
+
+ const Item* First();
+ const Item* Next();
+
+private:
+ ::std::vector<Item>::const_iterator maIter;
+ ::std::vector<Item> maArray;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 9447bb9..d585732 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -40,7 +40,7 @@
#include "rechead.hxx"
#include "globstr.hrc"
#include "segmenttree.hxx"
-#include "cell.hxx"
+#include "editdataarray.hxx"
#include "formulacell.hxx"
#include "cellvalue.hxx"
#include "editutil.hxx"
diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx
index 0d46036..4503086 100644
--- a/sc/source/core/data/cell2.cxx
+++ b/sc/source/core/data/cell2.cxx
@@ -153,74 +153,4 @@ void ScEditCell::SetTextObject(
mpData = ScEditUtil::Clone(*pObject, *mpDoc);
}
-ScEditDataArray::ScEditDataArray()
-{
-}
-
-ScEditDataArray::~ScEditDataArray()
-{
-}
-
-void ScEditDataArray::AddItem(SCTAB nTab, SCCOL nCol, SCROW nRow,
- EditTextObject* pOldData, EditTextObject* pNewData)
-{
- maArray.push_back(Item(nTab, nCol, nRow, pOldData, pNewData));
-}
-
-const ScEditDataArray::Item* ScEditDataArray::First()
-{
- maIter = maArray.begin();
- if (maIter == maArray.end())
- return NULL;
- return &(*maIter++);
-}
-
-const ScEditDataArray::Item* ScEditDataArray::Next()
-{
- if (maIter == maArray.end())
- return NULL;
- return &(*maIter++);
-}
-
-// ============================================================================
-
-ScEditDataArray::Item::Item(SCTAB nTab, SCCOL nCol, SCROW nRow,
- EditTextObject* pOldData, EditTextObject* pNewData) :
- mnTab(nTab),
- mnCol(nCol),
- mnRow(nRow)
-{
- mpOldData.reset(pOldData);
- mpNewData.reset(pNewData);
-}
-
-ScEditDataArray::Item::~Item()
-{
-}
-
-const EditTextObject* ScEditDataArray::Item::GetOldData() const
-{
- return mpOldData.get();
-}
-
-const EditTextObject* ScEditDataArray::Item::GetNewData() const
-{
- return mpNewData.get();
-}
-
-SCTAB ScEditDataArray::Item::GetTab() const
-{
- return mnTab;
-}
-
-SCCOL ScEditDataArray::Item::GetCol() const
-{
- return mnCol;
-}
-
-SCROW ScEditDataArray::Item::GetRow() const
-{
- return mnRow;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/cellvalue.cxx b/sc/source/core/data/cellvalue.cxx
index abc1bbc..f9575d5 100644
--- a/sc/source/core/data/cellvalue.cxx
+++ b/sc/source/core/data/cellvalue.cxx
@@ -10,7 +10,6 @@
#include "cellvalue.hxx"
#include "document.hxx"
#include "column.hxx"
-#include "cell.hxx"
#include "formulacell.hxx"
#include "editeng/editobj.hxx"
#include "editeng/editstat.hxx"
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 1ac6471..82ccdf9 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -19,7 +19,6 @@
#include "column.hxx"
#include "scitems.hxx"
-#include "cell.hxx"
#include "formulacell.hxx"
#include "document.hxx"
#include "docpool.hxx"
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 5c25a86..65b6b82 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -19,7 +19,6 @@
#include "column.hxx"
#include "scitems.hxx"
-#include "cell.hxx"
#include "formulacell.hxx"
#include "document.hxx"
#include "docpool.hxx"
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 10edd5a..53eb88a 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -20,7 +20,6 @@
#include "column.hxx"
#include "scitems.hxx"
-#include "cell.hxx"
#include "formulacell.hxx"
#include "document.hxx"
#include "attarray.hxx"
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 548f378..2d6a8eb 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -25,7 +25,6 @@
#include "document.hxx"
#include "table.hxx"
#include "column.hxx"
-#include "cell.hxx"
#include "formulacell.hxx"
#include "attarray.hxx"
#include "patattr.hxx"
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 2fcf8f5..6c5052b 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -84,7 +84,6 @@
#include "formulaparserpool.hxx"
#include "clipparam.hxx"
#include "macromgr.hxx"
-#include "cell.hxx"
#include "formulacell.hxx"
#include "clipcontext.hxx"
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 1b64286..c580f41 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -29,7 +29,6 @@
#include <vcl/svapp.hxx>
#include "document.hxx"
#include "attrib.hxx"
-#include "cell.hxx"
#include "table.hxx"
#include "rangenam.hxx"
#include "dbdata.hxx"
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 0595e10..f59c119 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -41,7 +41,6 @@
#include "externalrefmgr.hxx"
#include "colorscale.hxx"
#include "attrib.hxx"
-#include "cell.hxx"
#include "formulacell.hxx"
#include "tokenarray.hxx"
diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx
index b08c5a9..a165f97 100644
--- a/sc/source/core/data/documen6.cxx
+++ b/sc/source/core/data/documen6.cxx
@@ -26,7 +26,6 @@
#include <comphelper/processfactory.hxx>
#include "document.hxx"
-#include "cell.hxx"
#include "cellform.hxx"
#include "patattr.hxx"
#include "scrdata.hxx"
diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx
index 1c3f665..459888a 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -22,7 +22,6 @@
#include "document.hxx"
#include "brdcst.hxx"
#include "bcaslot.hxx"
-#include "cell.hxx"
#include "formulacell.hxx"
#include "formula/errorcodes.hxx" // errCircularReference
#include "scerrors.hxx"
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index d01eed8..570a14c 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -52,7 +52,6 @@
#include "global.hxx"
#include "table.hxx"
#include "column.hxx"
-#include "cell.hxx"
#include "poolhelp.hxx"
#include "docpool.hxx"
#include "stlpool.hxx"
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index fe95b4b..2c977f2 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -72,7 +72,6 @@
#include "scresid.hxx"
#include "hints.hxx"
#include "detdata.hxx"
-#include "cell.hxx"
#include "dpobject.hxx"
#include "detfunc.hxx" // for UpdateAllComments
#include "scmod.hxx"
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index c3be033..679e04f 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -11,7 +11,6 @@
#include "document.hxx"
#include "table.hxx"
#include "column.hxx"
-#include "cell.hxx"
#include "formulacell.hxx"
#include "docoptio.hxx"
#include "globalnames.hxx"
diff --git a/sc/source/core/tool/editdataarray.cxx b/sc/source/core/tool/editdataarray.cxx
new file mode 100644
index 0000000..85be62c
--- /dev/null
+++ b/sc/source/core/tool/editdataarray.cxx
@@ -0,0 +1,93 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "editdataarray.hxx"
+
+ScEditDataArray::ScEditDataArray()
+{
+}
+
+ScEditDataArray::~ScEditDataArray()
+{
+}
+
+void ScEditDataArray::AddItem(SCTAB nTab, SCCOL nCol, SCROW nRow,
+ EditTextObject* pOldData, EditTextObject* pNewData)
+{
+ maArray.push_back(Item(nTab, nCol, nRow, pOldData, pNewData));
+}
+
+const ScEditDataArray::Item* ScEditDataArray::First()
+{
+ maIter = maArray.begin();
+ if (maIter == maArray.end())
+ return NULL;
+ return &(*maIter++);
+}
+
+const ScEditDataArray::Item* ScEditDataArray::Next()
+{
+ if (maIter == maArray.end())
+ return NULL;
+ return &(*maIter++);
+}
+
+// ============================================================================
+
+ScEditDataArray::Item::Item(SCTAB nTab, SCCOL nCol, SCROW nRow,
+ EditTextObject* pOldData, EditTextObject* pNewData) :
+ mnTab(nTab),
+ mnCol(nCol),
+ mnRow(nRow)
+{
+ mpOldData.reset(pOldData);
+ mpNewData.reset(pNewData);
+}
+
+ScEditDataArray::Item::~Item()
+{
+}
+
+const EditTextObject* ScEditDataArray::Item::GetOldData() const
+{
+ return mpOldData.get();
+}
+
+const EditTextObject* ScEditDataArray::Item::GetNewData() const
+{
+ return mpNewData.get();
+}
+
+SCTAB ScEditDataArray::Item::GetTab() const
+{
+ return mnTab;
+}
+
+SCCOL ScEditDataArray::Item::GetCol() const
+{
+ return mnCol;
+}
+
+SCROW ScEditDataArray::Item::GetRow() const
+{
+ return mnRow;
+}
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index e380106..124251f 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -50,7 +50,7 @@
#include "docuno.hxx"
#include "progress.hxx"
#include "editutil.hxx"
-#include "cell.hxx"
+#include "editdataarray.hxx"
// STATIC DATA ---------------------------------------------------------------
More information about the Libreoffice-commits
mailing list