diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-04-10 21:04:38 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-04-13 01:54:37 -0400 |
commit | 3b9bc3e8703fe751911333f22e689710187f130d (patch) | |
tree | 373c8eeb5d9604f20a0c6a69ece576d7903d3a83 | |
parent | bc36f99b32cd46acd4e5dbdc63cfff23316185af (diff) |
Import null date via orcus.
Change-Id: Ifa50e460768ffff4b1096d795ab694fea62a6c29
-rw-r--r-- | sc/source/filter/inc/orcusinterface.hxx | 12 | ||||
-rw-r--r-- | sc/source/filter/orcus/interface.cxx | 20 |
2 files changed, 31 insertions, 1 deletions
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx index 4cb03fa38a30..05ebc6d552f6 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 e843467ed1a7..68f7a1fca382 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; |