From 9a23fd146be4ba64b0cb720993bdc73a514fecf2 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Fri, 18 Oct 2019 12:37:46 +0300 Subject: . --- src/plain.cpp | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'src/plain.cpp') diff --git a/src/plain.cpp b/src/plain.cpp index db5c63b..b510d58 100644 --- a/src/plain.cpp +++ b/src/plain.cpp @@ -1,42 +1 @@ #include "plain.hpp" - - -TexoPlainImporter::TexoPlainImporter(TexoProducer &producer): - TexoImporter(producer), first(true), space(0), newline(false) -{} - -void TexoPlainImporter::Put(const char c) -{ - if (first) { - first = false; - producer.Put(Texo(Texo::paragraph_begin)); - } - if (c == ' ') { - ++space; - } else if (c == '\n') { - if (newline) { - newline = false; - producer.Put(Texo(Texo::paragraph_end)); - producer.Put(Texo(Texo::paragraph_begin)); - } else { - newline = true; - } - } else if (!c) { - producer.Put(Texo(Texo::paragraph_end)); - } else { - if (newline) { - newline = false; - if (space) { - space = 0; - producer.Put(Texo(Texo::newline)); - } else { - producer.Put(Texo(' ')); - } - } - while (space) { - producer.Put(Texo(' ')); - --space; - } - producer.Put(Texo(c)); - } -} -- cgit v1.2.3