sc/source/filter/inc/orcusinterface.hxx | 12 ++++++++++++ sc/source/filter/orcus/interface.cxx | 20 +++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-)
New commits: commit 2817eeb5b41dc0991b115aa9430f15f0c84aa97c Author: Kohei Yoshida <[email protected]> Date: Wed Apr 10 21:04:38 2013 -0400 Import null date via orcus. Change-Id: Ifa50e460768ffff4b1096d795ab694fea62a6c29 diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx index 4cb03fa..05ebc6d 100644 --- a/sc/source/filter/inc/orcusinterface.hxx +++ b/sc/source/filter/inc/orcusinterface.hxx @@ -26,6 +26,16 @@ class ScOrcusSheet; class ScOrcusFactory; class ScRangeData; +class ScOrcusGlobalSettings : public orcus::spreadsheet::iface::import_global_settings +{ + ScDocument& mrDoc; + +public: + ScOrcusGlobalSettings(ScDocument& rDoc); + + virtual void set_origin_date(int year, int month, int day); +}; + class ScOrcusSharedStrings : public orcus::spreadsheet::iface::import_shared_strings { ScOrcusFactory& mrFactory; @@ -175,6 +185,7 @@ class ScOrcusFactory : public orcus::spreadsheet::iface::import_factory StringHashType maStringHash; StringCellCaches maStringCells; + ScOrcusGlobalSettings maGlobalSettings; ScOrcusSharedStrings maSharedStrings; boost::ptr_vector<ScOrcusSheet> maSheets; ScOrcusStyles maStyles; @@ -184,6 +195,7 @@ public: virtual orcus::spreadsheet::iface::import_sheet* append_sheet(const char *sheet_name, size_t sheet_name_length); virtual orcus::spreadsheet::iface::import_sheet* get_sheet(const char *sheet_name, size_t sheet_name_length); + virtual orcus::spreadsheet::iface::import_global_settings* get_global_settings(); virtual orcus::spreadsheet::iface::import_shared_strings* get_shared_strings(); virtual orcus::spreadsheet::iface::import_styles* get_styles(); virtual void finalize(); diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index e843467..68f7a1f 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -15,6 +15,7 @@ #include "tokenarray.hxx" #include "stringutil.hxx" #include "globalnames.hxx" +#include "docoptio.hxx" #include "formula/token.hxx" #include "tools/datetime.hxx" @@ -23,10 +24,22 @@ using orcus::spreadsheet::row_t; using orcus::spreadsheet::col_t; using orcus::spreadsheet::formula_grammar_t; +ScOrcusGlobalSettings::ScOrcusGlobalSettings(ScDocument& rDoc) : mrDoc(rDoc) {} + +void ScOrcusGlobalSettings::set_origin_date(int year, int month, int day) +{ + ScDocOptions aOpt = mrDoc.GetDocOptions(); + aOpt.SetDate(year, month, day); + mrDoc.SetDocOptions(aOpt); +} + ScOrcusFactory::StringCellCache::StringCellCache(const ScAddress& rPos, size_t nIndex) : maPos(rPos), mnIndex(nIndex) {} -ScOrcusFactory::ScOrcusFactory(ScDocument& rDoc) : mrDoc(rDoc), maSharedStrings(*this) {} +ScOrcusFactory::ScOrcusFactory(ScDocument& rDoc) : + mrDoc(rDoc), + maGlobalSettings(mrDoc), + maSharedStrings(*this) {} orcus::spreadsheet::iface::import_sheet* ScOrcusFactory::append_sheet(const char* sheet_name, size_t sheet_name_length) { @@ -71,6 +84,11 @@ orcus::spreadsheet::iface::import_sheet* ScOrcusFactory::get_sheet(const char* s return &maSheets.back(); } +orcus::spreadsheet::iface::import_global_settings* ScOrcusFactory::get_global_settings() +{ + return &maGlobalSettings; +} + orcus::spreadsheet::iface::import_shared_strings* ScOrcusFactory::get_shared_strings() { return &maSharedStrings; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
