From c71568094a35bbda781ac2070e50a59a3b5ac9f7 Mon Sep 17 00:00:00 2001 From: Gert van Valkenhoef Date: Wed, 9 Nov 2011 10:32:36 +0000 Subject: [PATCH] Update handling of multi-byte strings --- odcread.cc | 5 +++-- textmodel.cc | 4 ++-- textmodel.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/odcread.cc b/odcread.cc index 24bb51e..e790fdd 100644 --- a/odcread.cc +++ b/odcread.cc @@ -85,8 +85,9 @@ namespace odc { d_context.top()->addPiece(text); } virtual void textLongPiece(const LongPiece *piece) { - std::string text = piece->getText(); - d_context.top()->addPiece(text); + throw "Long Piece not handled"; + //std::string text = piece->getText(); + //d_context.top()->addPiece(text); } }; diff --git a/textmodel.cc b/textmodel.cc index f9dbae2..56bedba 100644 --- a/textmodel.cc +++ b/textmodel.cc @@ -182,8 +182,8 @@ std::string LongPiece::toString() const { return std::string("LongPiece(FIXME)");// + std::wstring((wchar_t*)d_buf) + std::string(")"); } -std::string LongPiece::getText() const { - return std::string("FIXME");// + std::wstring((wchar_t*)d_buf) + std::string(")"); +std::wstring LongPiece::getText() const { + return std::wstring((wchar_t*)d_buf); } void LongPiece::accept(Visitor &visitor) const { diff --git a/textmodel.h b/textmodel.h index 92d387a..07a8f64 100644 --- a/textmodel.h +++ b/textmodel.h @@ -37,7 +37,7 @@ namespace odc { ~LongPiece(); virtual void read(Reader &reader); virtual std::string toString() const; - virtual std::string getText() const; + virtual std::wstring getText() const; virtual void accept(Visitor &visitor) const; }; -- 2.29.2