summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-04-09 22:36:58 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-04-13 01:54:36 -0400
commiteea7b093d10d5bec85a090f5d205783bada94ad6 (patch)
treed2cb6ab582060b7e0613caf00b1280a5c00827dc
parent302a764316bbca6447940d7f346f821daabaff27 (diff)
Implement set_date() interface method.
It'll simply call set_auto() for now. Change-Id: I580b2ecbd34ffe7674f64ade912877ef07a60aca
-rw-r--r--sc/source/filter/inc/orcusinterface.hxx9
-rw-r--r--sc/source/filter/orcus/interface.cxx45
2 files changed, 30 insertions, 24 deletions
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index adf78823bb75..69e123b914c4 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -59,6 +59,11 @@ public:
// Orcus import interface
virtual void set_auto(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, const char* p, size_t n);
+ virtual void set_string(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, size_t sindex);
+ virtual void set_value(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, double value);
+ virtual void set_bool(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, bool value);
+ virtual void set_date(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, const char* p, size_t n);
+
virtual void set_format(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, size_t xf_index);
virtual void set_formula(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::formula_grammar_t grammar, const char* p, size_t n);
@@ -82,10 +87,6 @@ public:
orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, orcus::spreadsheet::formula_grammar_t grammar,
const char* p, size_t n, const char* p_range, size_t n_range);
- virtual void set_string(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, size_t sindex);
- virtual void set_value(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, double value);
- virtual void set_bool(orcus::spreadsheet::row_t row, orcus::spreadsheet::col_t col, bool value);
-
SCTAB getIndex() const { return mnTab; }
};
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 8f9eb0702d9a..5c00e56f373c 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -128,6 +128,31 @@ void ScOrcusSheet::set_auto(row_t row, col_t col, const char* p, size_t n)
mrDoc.SetString(col, row, mnTab, aVal);
}
+void ScOrcusSheet::set_string(row_t row, col_t col, size_t sindex)
+{
+ // We need to defer string cells since the shared string pool is not yet
+ // populated at the time this method is called. Orcus imports string
+ // table after the cells get imported. We won't need to do this once we
+ // implement true shared strings in Calc core.
+
+ mrFactory.pushStringCell(ScAddress(col, row, mnTab), sindex);
+}
+
+void ScOrcusSheet::set_value(row_t row, col_t col, double value)
+{
+ mrDoc.SetValue( col, row, mnTab, value );
+}
+
+void ScOrcusSheet::set_bool(row_t row, col_t col, bool value)
+{
+ mrDoc.SetValue(col, row, mnTab, value ? 1.0 : 0.0);
+}
+
+void ScOrcusSheet::set_date(row_t row, col_t col, const char* p, size_t n)
+{
+ set_auto(row, col, p, n);
+}
+
void ScOrcusSheet::set_format(row_t /*row*/, col_t /*col*/, size_t /*xf_index*/)
{
}
@@ -240,26 +265,6 @@ void ScOrcusSheet::set_array_formula(
{
}
-void ScOrcusSheet::set_string(row_t row, col_t col, size_t sindex)
-{
- // We need to defer string cells since the shared string pool is not yet
- // populated at the time this method is called. Orcus imports string
- // table after the cells get imported. We won't need to do this once we
- // implement true shared strings in Calc core.
-
- mrFactory.pushStringCell(ScAddress(col, row, mnTab), sindex);
-}
-
-void ScOrcusSheet::set_value(row_t row, col_t col, double value)
-{
- mrDoc.SetValue( col, row, mnTab, value );
-}
-
-void ScOrcusSheet::set_bool(row_t row, col_t col, bool value)
-{
- mrDoc.SetValue(col, row, mnTab, value ? 1.0 : 0.0);
-}
-
ScOrcusSharedStrings::ScOrcusSharedStrings(ScOrcusFactory& rFactory) :
mrFactory(rFactory) {}