[Libreoffice-commits] core.git: Branch 'feature/orcus-update' - sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Tue Apr 9 19:34:53 PDT 2013


 sc/source/filter/inc/orcusinterface.hxx |    9 +++---
 sc/source/filter/orcus/interface.cxx    |   45 +++++++++++++++++---------------
 2 files changed, 30 insertions(+), 24 deletions(-)

New commits:
commit 64856171af652aad12d8f755e28a008cd32d0799
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Tue Apr 9 22:36:58 2013 -0400

    Implement set_date() interface method.
    
    It'll simply call set_auto() for now.
    
    Change-Id: I580b2ecbd34ffe7674f64ade912877ef07a60aca

diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index adf7882..69e123b 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 8f9eb07..5c00e56 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) {}
 


More information about the Libreoffice-commits mailing list