diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-04-09 21:00:19 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-04-13 01:54:36 -0400 |
commit | 302a764316bbca6447940d7f346f821daabaff27 (patch) | |
tree | 9609da62b104a037125df595401c7f865b40dc17 /sc | |
parent | 01944e4c8c44a7fd9a8bc42708247f1bf5a528f6 (diff) |
Implement segment-based string import.
With this, string cells from ODS docs get imported. For now, format runs
are ignored.
Change-Id: Ia9530357d3afc6cf4a0c52362bc770560debfd61
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/inc/orcusinterface.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/orcus/interface.cxx | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx index de07b75dca41..adf78823bb75 100644 --- a/sc/source/filter/inc/orcusinterface.hxx +++ b/sc/source/filter/inc/orcusinterface.hxx @@ -11,6 +11,7 @@ #define __SC_ORCUSINTERFACE_HXX__ #include "address.hxx" +#include "rtl/strbuf.hxx" #define __ORCUS_STATIC_LIB #include <orcus/spreadsheet/import_interface.hpp> @@ -29,6 +30,7 @@ class ScOrcusSharedStrings : public orcus::spreadsheet::iface::import_shared_str { ScOrcusFactory& mrFactory; + OStringBuffer maCurSegment; public: ScOrcusSharedStrings(ScOrcusFactory& rFactory); diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index 73b4d0beb416..8f9eb0702d9a 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -278,22 +278,28 @@ size_t ScOrcusSharedStrings::add(const char* s, size_t n) void ScOrcusSharedStrings::set_segment_bold(bool /*b*/) { } + void ScOrcusSharedStrings::set_segment_italic(bool /*b*/) { } + void ScOrcusSharedStrings::set_segment_font_name(const char* /*s*/, size_t /*n*/) { } + void ScOrcusSharedStrings::set_segment_font_size(double /*point*/) { } -void ScOrcusSharedStrings::append_segment(const char* /*s*/, size_t /*n*/) + +void ScOrcusSharedStrings::append_segment(const char* s, size_t n) { + maCurSegment.append(s, n); } size_t ScOrcusSharedStrings::commit_segments() { - return 0; + OString aStr = maCurSegment.makeStringAndClear(); + return mrFactory.addString(OStringToOUString(aStr, RTL_TEXTENCODING_UTF8)); } void ScOrcusStyles::set_font_count(size_t /*n*/) |