]> git.lyx.org Git - lyx.git/blob - src/paragraph_pimpl.C
63f03be183a12bb863c6e0ed673b8f5fa6651ad0
[lyx.git] / src / paragraph_pimpl.C
1 /**
2  * \file paragraph_pimpl.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  * \author Jean-Marc Lasgouttes
8  * \author John Levon
9  * \author André Pönitz
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #include <config.h>
15
16 #include "paragraph_pimpl.h"
17 #include "paragraph.h"
18
19 #include "bufferparams.h"
20 #include "debug.h"
21 #include "encoding.h"
22 #include "language.h"
23 #include "LaTeXFeatures.h"
24 #include "LColor.h"
25 #include "lyxlength.h"
26 #include "lyxrc.h"
27 #include "outputparams.h"
28 #include "texrow.h"
29
30 #include <boost/next_prior.hpp>
31
32
33 namespace lyx {
34
35 using std::endl;
36 using std::upper_bound;
37 using std::lower_bound;
38 using std::string;
39
40
41 // Initialization of the counter for the paragraph id's,
42 unsigned int Paragraph::Pimpl::paragraph_id = 0;
43
44 namespace {
45
46 struct special_phrase {
47         string phrase;
48         docstring macro;
49         bool builtin;
50 };
51
52 special_phrase const special_phrases[] = {
53         { "LyX", from_ascii("\\LyX{}"), false },
54         { "TeX", from_ascii("\\TeX{}"), true },
55         { "LaTeX2e", from_ascii("\\LaTeXe{}"), true },
56         { "LaTeX", from_ascii("\\LaTeX{}"), true },
57 };
58
59 size_t const phrases_nr = sizeof(special_phrases)/sizeof(special_phrase);
60
61 } // namespace anon
62
63
64 Paragraph::Pimpl::Pimpl(Paragraph * owner)
65         : owner_(owner)
66 {
67         inset_owner = 0;
68         id_ = paragraph_id++;
69 }
70
71
72 Paragraph::Pimpl::Pimpl(Pimpl const & p, Paragraph * owner)
73         : params(p.params), changes_(p.changes_), owner_(owner)
74 {
75         inset_owner = p.inset_owner;
76         fontlist = p.fontlist;
77         id_ = paragraph_id++;
78 }
79
80
81 void Paragraph::Pimpl::setContentsFromPar(Paragraph const & par)
82 {
83         owner_->text_ = par.text_;
84         // FIXME: change tracking (MG)
85         // check whether this method is really needed
86         changes_ = par.pimpl_->changes_;
87 }
88
89
90 bool Paragraph::Pimpl::isChanged(pos_type start, pos_type end) const
91 {
92         BOOST_ASSERT(start >= 0 && start <= size());
93         BOOST_ASSERT(end > start && end <= size() + 1);
94
95         return changes_.isChanged(start, end);
96 }
97
98
99 void Paragraph::Pimpl::setChange(Change const & change)
100 {
101         // beware of the imaginary end-of-par character!
102         changes_.set(change, 0, size() + 1);
103
104         /*
105          * Propagate the change recursively - but not in case of DELETED!
106          *
107          * Imagine that your co-author makes changes in an existing inset. He
108          * sends your document to you and you come to the conclusion that the
109          * inset should go completely. If you erase it, LyX must not delete all
110          * text within the inset. Otherwise, the change tracked insertions of
111          * your co-author get lost and there is no way to restore them later.
112          *
113          * Conclusion: An inset's content should remain untouched if you delete it
114          */
115
116         if (change.type != Change::DELETED) {
117                 for (pos_type pos = 0; pos < size(); ++pos) {
118                         if (owner_->isInset(pos)) {
119                                 owner_->getInset(pos)->setChange(change);
120                         }
121                 }
122         }
123 }
124
125
126 void Paragraph::Pimpl::setChange(pos_type pos, Change const & change)
127 {
128         BOOST_ASSERT(pos >= 0 && pos <= size());
129
130         changes_.set(change, pos);
131
132         // see comment in setChange(Change const &) above
133
134         if (change.type != Change::DELETED &&
135             pos < size() && owner_->isInset(pos)) {
136                 owner_->getInset(pos)->setChange(change);
137         }
138 }
139
140
141 Change const Paragraph::Pimpl::lookupChange(pos_type pos) const
142 {
143         BOOST_ASSERT(pos >= 0 && pos <= size());
144
145         return changes_.lookup(pos);
146 }
147
148
149 void Paragraph::Pimpl::acceptChanges(pos_type start, pos_type end)
150 {
151         BOOST_ASSERT(start >= 0 && start <= size());
152         BOOST_ASSERT(end > start && end <= size() + 1);
153         
154         for (pos_type pos = start; pos < end; ++pos) {
155                 switch (lookupChange(pos).type) {
156                         case Change::UNCHANGED:
157                                 break;
158
159                         case Change::INSERTED:
160                                 changes_.set(Change(Change::UNCHANGED), pos);
161                                 break;
162
163                         case Change::DELETED:
164                                 // Suppress access to non-existent
165                                 // "end-of-paragraph char"
166                                 if (pos < size()) {
167                                         eraseChar(pos, false);
168                                         --end;
169                                         --pos;
170                                 }
171                                 break;
172                 }
173
174                 // also accept changes in nested insets
175                 if (pos < size() && owner_->isInset(pos)) {
176                         owner_->getInset(pos)->acceptChanges();
177                 }
178         }
179 }
180
181
182 void Paragraph::Pimpl::rejectChanges(pos_type start, pos_type end)
183 {
184         BOOST_ASSERT(start >= 0 && start <= size());
185         BOOST_ASSERT(end > start && end <= size() + 1);
186
187         for (pos_type pos = start; pos < end; ++pos) {
188                 switch (lookupChange(pos).type) {
189                         case Change::UNCHANGED:
190                                 // also reject changes inside of insets
191                                 if (pos < size() && owner_->isInset(pos)) {
192                                         owner_->getInset(pos)->rejectChanges();
193                                 }
194                                 break;
195
196                         case Change::INSERTED:
197                                 // Suppress access to non-existent
198                                 // "end-of-paragraph char"
199                                 if (pos < size()) {
200                                         eraseChar(pos, false);
201                                         --end;
202                                         --pos;
203                                 }
204                                 break;
205
206                         case Change::DELETED:
207                                 changes_.set(Change(Change::UNCHANGED), pos);
208
209                                 // Do NOT reject changes within a deleted inset!
210                                 // There may be insertions of a co-author inside of it!
211
212                                 break;
213                 }
214         }
215 }
216
217
218 Paragraph::value_type Paragraph::Pimpl::getChar(pos_type pos) const
219 {
220         BOOST_ASSERT(pos >= 0 && pos <= size());
221
222         return owner_->getChar(pos);
223 }
224
225
226 void Paragraph::Pimpl::insertChar(pos_type pos, value_type c, Change const & change)
227 {
228         BOOST_ASSERT(pos >= 0 && pos <= size());
229
230         // track change
231         changes_.insert(change, pos);
232
233         // This is actually very common when parsing buffers (and
234         // maybe inserting ascii text)
235         if (pos == size()) {
236                 // when appending characters, no need to update tables
237                 owner_->text_.push_back(c);
238                 return;
239         }
240
241         owner_->text_.insert(owner_->text_.begin() + pos, c);
242
243         // Update the font table.
244         FontTable search_font(pos, LyXFont());
245         for (FontList::iterator it 
246               = lower_bound(fontlist.begin(), fontlist.end(), search_font, matchFT());
247              it != fontlist.end(); ++it)
248         {
249                 it->pos(it->pos() + 1);
250         }
251
252         // Update the insets
253         owner_->insetlist.increasePosAfterPos(pos);
254 }
255
256
257 void Paragraph::Pimpl::insertInset(pos_type pos, InsetBase * inset,
258                                    Change const & change)
259 {
260         BOOST_ASSERT(inset);
261         BOOST_ASSERT(pos >= 0 && pos <= size());
262
263         insertChar(pos, META_INSET, change);
264         BOOST_ASSERT(owner_->text_[pos] == META_INSET);
265
266         // Add a new entry in the insetlist.
267         owner_->insetlist.insert(inset, pos);
268 }
269
270
271 bool Paragraph::Pimpl::eraseChar(pos_type pos, bool trackChanges)
272 {
273         BOOST_ASSERT(pos >= 0 && pos <= size());
274
275         if (trackChanges) {
276                 Change::Type changetype(changes_.lookup(pos).type);
277
278                 if (changetype == Change::UNCHANGED) {
279                         setChange(pos, Change(Change::DELETED));
280                         return false;
281                 }
282
283                 if (changetype == Change::DELETED)
284                         return false;
285         }
286
287         // Don't physically access nonexistent end-of-paragraph char
288         if (pos == size()) {
289                 // FIXME: change tracking (MG)
290                 // how do we handle end-of-pars previously marked inserted?
291                 return false;
292         }
293
294         // track change
295         changes_.erase(pos);
296
297         // if it is an inset, delete the inset entry
298         if (owner_->text_[pos] == Paragraph::META_INSET) {
299                 owner_->insetlist.erase(pos);
300         }
301
302         owner_->text_.erase(owner_->text_.begin() + pos);
303
304         // Erase entries in the tables.
305         FontTable search_font(pos, LyXFont());
306
307         FontList::iterator it =
308                 lower_bound(fontlist.begin(),
309                             fontlist.end(),
310                             search_font, matchFT());
311         if (it != fontlist.end() && it->pos() == pos &&
312             (pos == 0 ||
313              (it != fontlist.begin()
314               && boost::prior(it)->pos() == pos - 1))) {
315                 // If it is a multi-character font
316                 // entry, we just make it smaller
317                 // (see update below), otherwise we
318                 // should delete it.
319                 unsigned int const i = it - fontlist.begin();
320                 fontlist.erase(fontlist.begin() + i);
321                 it = fontlist.begin() + i;
322                 if (i > 0 && i < fontlist.size() &&
323                     fontlist[i - 1].font() == fontlist[i].font()) {
324                         fontlist.erase(fontlist.begin() + i - 1);
325                         it = fontlist.begin() + i - 1;
326                 }
327         }
328
329         // Update all other entries
330         FontList::iterator fend = fontlist.end();
331         for (; it != fend; ++it)
332                 it->pos(it->pos() - 1);
333
334         // Update the insetlist
335         owner_->insetlist.decreasePosAfterPos(pos);
336
337         return true;
338 }
339
340
341 int Paragraph::Pimpl::eraseChars(pos_type start, pos_type end, bool trackChanges)
342 {
343         BOOST_ASSERT(start >= 0 && start <= size());
344         BOOST_ASSERT(end > start && end <= size() + 1);
345
346         pos_type i = start;
347         for (pos_type count = end - start; count; --count) {
348                 if (!eraseChar(i, trackChanges))
349                         ++i;
350         }
351         return end - i;
352 }
353
354
355 void Paragraph::Pimpl::simpleTeXBlanks(odocstream & os, TexRow & texrow,
356                                        pos_type const i,
357                                        unsigned int & column,
358                                        LyXFont const & font,
359                                        LyXLayout const & style)
360 {
361         if (style.pass_thru)
362                 return;
363
364         if (column > lyxrc.ascii_linelen
365             && i
366             && getChar(i - 1) != ' '
367             && (i < size() - 1)
368             // same in FreeSpacing mode
369             && !owner_->isFreeSpacing()
370             // In typewriter mode, we want to avoid
371             // ! . ? : at the end of a line
372             && !(font.family() == LyXFont::TYPEWRITER_FAMILY
373                  && (getChar(i - 1) == '.'
374                      || getChar(i - 1) == '?'
375                      || getChar(i - 1) == ':'
376                      || getChar(i - 1) == '!'))) {
377                 os << '\n';
378                 texrow.newline();
379                 texrow.start(owner_->id(), i + 1);
380                 column = 0;
381         } else if (style.free_spacing) {
382                 os << '~';
383         } else {
384                 os << ' ';
385         }
386 }
387
388
389 bool Paragraph::Pimpl::isTextAt(string const & str, pos_type pos) const
390 {
391         pos_type const len = str.length();
392
393         // is the paragraph large enough?
394         if (pos + len > size())
395                 return false;
396
397         // does the wanted text start at point?
398         for (string::size_type i = 0; i < str.length(); ++i) {
399                 if (str[i] != owner_->text_[pos + i])
400                         return false;
401         }
402
403         // is there a font change in middle of the word?
404         FontList::const_iterator cit = fontlist.begin();
405         FontList::const_iterator end = fontlist.end();
406         for (; cit != end; ++cit) {
407                 if (cit->pos() >= pos)
408                         break;
409         }
410         if (cit != end && pos + len - 1 > cit->pos())
411                 return false;
412
413         return true;
414 }
415
416
417 void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
418                                              BufferParams const & bparams,
419                                              odocstream & os,
420                                              TexRow & texrow,
421                                              OutputParams const & runparams,
422                                              LyXFont & font,
423                                              LyXFont & running_font,
424                                              LyXFont & basefont,
425                                              LyXFont const & outerfont,
426                                              bool & open_font,
427                                              Change::Type & running_change,
428                                              LyXLayout const & style,
429                                              pos_type & i,
430                                              unsigned int & column,
431                                              value_type const c)
432 {
433         if (style.pass_thru) {
434                 if (c != Paragraph::META_INSET) {
435                         if (c != '\0')
436                                 os.put(c);
437                 } else
438                         owner_->getInset(i)->plaintext(buf, os, runparams);
439                 return;
440         }
441
442         // Two major modes:  LaTeX or plain
443         // Handle here those cases common to both modes
444         // and then split to handle the two modes separately.
445         switch (c) {
446         case Paragraph::META_INSET: {
447                 InsetBase * inset = owner_->getInset(i);
448
449                 // FIXME: remove this check
450                 if (!inset)
451                         break;
452
453                 // FIXME: move this to InsetNewline::latex
454                 if (inset->lyxCode() == InsetBase::NEWLINE_CODE) {
455                         // newlines are handled differently here than
456                         // the default in simpleTeXSpecialChars().
457                         if (!style.newline_allowed) {
458                                 os << '\n';
459                         } else {
460                                 if (open_font) {
461                                         column += running_font.latexWriteEndChanges(os, basefont, basefont);
462                                         open_font = false;
463                                 }
464                                 basefont = owner_->getLayoutFont(bparams, outerfont);
465                                 running_font = basefont;
466
467                                 if (font.family() == LyXFont::TYPEWRITER_FAMILY)
468                                         os << '~';
469
470                                 if (runparams.moving_arg)
471                                         os << "\\protect ";
472
473                                 os << "\\\\\n";
474                         }
475                         texrow.newline();
476                         texrow.start(owner_->id(), i + 1);
477                         column = 0;
478                         break;
479                 }
480
481                 // output change tracking marks only if desired,
482                 // if dvipost is installed,
483                 // and with dvi/ps (other formats don't work)
484                 LaTeXFeatures features(buf, bparams, runparams);
485                 bool const output = bparams.outputChanges
486                         && runparams.flavor == OutputParams::LATEX
487                         && features.isAvailable("dvipost");
488
489                 if (inset->canTrackChanges()) {
490                         column += Changes::latexMarkChange(os, running_change,
491                                 Change::UNCHANGED, output);
492                         running_change = Change::UNCHANGED;
493                 }
494
495                 bool close = false;
496                 odocstream::pos_type const len = os.tellp();
497
498                 if ((inset->lyxCode() == InsetBase::GRAPHICS_CODE
499                      || inset->lyxCode() == InsetBase::MATH_CODE
500                      || inset->lyxCode() == InsetBase::URL_CODE)
501                     && running_font.isRightToLeft()) {
502                         os << "\\L{";
503                         close = true;
504                 }
505
506 #ifdef WITH_WARNINGS
507 #warning Bug: we can have an empty font change here!
508 // if there has just been a font change, we are going to close it
509 // right now, which means stupid latex code like \textsf{}. AFAIK,
510 // this does not harm dvi output. A minor bug, thus (JMarc)
511 #endif
512                 // some insets cannot be inside a font change command
513                 if (open_font && inset->noFontChange()) {
514                         column +=running_font.
515                                 latexWriteEndChanges(os,
516                                                      basefont,
517                                                      basefont);
518                         open_font = false;
519                         basefont = owner_->getLayoutFont(bparams, outerfont);
520                         running_font = basefont;
521                 }
522
523                 int tmp = inset->latex(buf, os, runparams);
524
525                 if (close)
526                         os << '}';
527
528                 if (tmp) {
529                         for (int j = 0; j < tmp; ++j) {
530                                 texrow.newline();
531                         }
532                         texrow.start(owner_->id(), i + 1);
533                         column = 0;
534                 } else {
535                         column += os.tellp() - len;
536                 }
537         }
538         break;
539
540         default:
541                 // And now for the special cases within each mode
542
543                 switch (c) {
544                 case '\\':
545                         os << "\\textbackslash{}";
546                         column += 15;
547                         break;
548
549                 // The following characters could be written literally in latin1, but they
550                 // would be wrongly converted on systems where char is signed, so we give
551                 // the code points.
552                 // This also makes us independant from the encoding of this source file.
553                 case 0xb1:    // ± PLUS-MINUS SIGN
554                 case 0xb2:    // ² SUPERSCRIPT TWO
555                 case 0xb3:    // ³ SUPERSCRIPT THREE
556                 case 0xd7:    // × MULTIPLICATION SIGN
557                 case 0xf7:    // ÷ DIVISION SIGN
558                 case 0xb9:    // ¹ SUPERSCRIPT ONE
559                 case 0xac:    // ¬ NOT SIGN
560                 case 0xb5:    // µ MICRO SIGN
561                         if ((bparams.inputenc == "latin1" ||
562                              bparams.inputenc == "latin9") ||
563                             (bparams.inputenc == "auto" &&
564                              (font.language()->encoding()->latexName()
565                               == "latin1" ||
566                               font.language()->encoding()->latexName()
567                               == "latin9"))) {
568                                 os << "\\ensuremath{";
569                                 os.put(c);
570                                 os << '}';
571                                 column += 13;
572                         } else {
573                                 os.put(c);
574                         }
575                         break;
576
577                 case '|': case '<': case '>':
578                         // In T1 encoding, these characters exist
579                         if (lyxrc.fontenc == "T1") {
580                                 os.put(c);
581                                 //... but we should avoid ligatures
582                                 if ((c == '>' || c == '<')
583                                     && i <= size() - 2
584                                     && getChar(i + 1) == c) {
585                                         //os << "\\textcompwordmark{}";
586                                         // Jean-Marc, have a look at
587                                         // this. I think this works
588                                         // equally well:
589                                         os << "\\,{}";
590                                         // Lgb
591                                         column += 19;
592                                 }
593                                 break;
594                         }
595                         // Typewriter font also has them
596                         if (font.family() == LyXFont::TYPEWRITER_FAMILY) {
597                                 os.put(c);
598                                 break;
599                         }
600                         // Otherwise, we use what LaTeX
601                         // provides us.
602                         switch (c) {
603                         case '<':
604                                 os << "\\textless{}";
605                                 column += 10;
606                                 break;
607                         case '>':
608                                 os << "\\textgreater{}";
609                                 column += 13;
610                                 break;
611                         case '|':
612                                 os << "\\textbar{}";
613                                 column += 9;
614                                 break;
615                         }
616                         break;
617
618                 case '-': // "--" in Typewriter mode -> "-{}-"
619                         if (i <= size() - 2
620                             && getChar(i + 1) == '-'
621                             && font.family() == LyXFont::TYPEWRITER_FAMILY) {
622                                 os << "-{}";
623                                 column += 2;
624                         } else {
625                                 os << '-';
626                         }
627                         break;
628
629                 case '\"':
630                         os << "\\char`\\\"{}";
631                         column += 9;
632                         break;
633
634                 case 0xa3:    // £ POUND SIGN
635                         if (bparams.inputenc == "default") {
636                                 os << "\\pounds{}";
637                                 column += 8;
638                         } else {
639                                 os.put(c);
640                         }
641                         break;
642
643                 case '$': case '&':
644                 case '%': case '#': case '{':
645                 case '}': case '_':
646                         os << '\\';
647                         os.put(c);
648                         column += 1;
649                         break;
650
651                 case '~':
652                         os << "\\textasciitilde{}";
653                         column += 16;
654                         break;
655
656                 case '^':
657                         os << "\\textasciicircum{}";
658                         column += 17;
659                         break;
660
661                 case '*': case '[':
662                         // avoid being mistaken for optional arguments
663                         os << '{';
664                         os.put(c);
665                         os << '}';
666                         column += 2;
667                         break;
668
669                 case ' ':
670                         // Blanks are printed before font switching.
671                         // Sure? I am not! (try nice-latex)
672                         // I am sure it's correct. LyX might be smarter
673                         // in the future, but for now, nothing wrong is
674                         // written. (Asger)
675                         break;
676
677                 default:
678
679                         // I assume this is hack treating typewriter as verbatim
680                         if (font.family() == LyXFont::TYPEWRITER_FAMILY) {
681                                 if (c != '\0') {
682                                         os.put(c);
683                                 }
684                                 break;
685                         }
686
687                         // LyX, LaTeX etc.
688
689                         // FIXME: if we have "LaTeX" with a font
690                         // change in the middle (before the 'T', then
691                         // the "TeX" part is still special cased.
692                         // Really we should only operate this on
693                         // "words" for some definition of word
694
695                         size_t pnr = 0;
696
697                         for (; pnr < phrases_nr; ++pnr) {
698                                 if (isTextAt(special_phrases[pnr].phrase, i)) {
699                                         os << special_phrases[pnr].macro;
700                                         i += special_phrases[pnr].phrase.length() - 1;
701                                         column += special_phrases[pnr].macro.length() - 1;
702                                         break;
703                                 }
704                         }
705
706                         if (pnr == phrases_nr && c != '\0') {
707                                 os.put(c);
708                         }
709                         break;
710                 }
711         }
712 }
713
714
715 void Paragraph::Pimpl::validate(LaTeXFeatures & features,
716                                 LyXLayout const & layout) const
717 {
718         BufferParams const & bparams = features.bufferParams();
719
720         // check the params.
721         if (!params.spacing().isDefault())
722                 features.require("setspace");
723
724         // then the layouts
725         features.useLayout(layout.name());
726
727         // then the fonts
728         Language const * doc_language = bparams.language;
729
730         FontList::const_iterator fcit = fontlist.begin();
731         FontList::const_iterator fend = fontlist.end();
732         for (; fcit != fend; ++fcit) {
733                 if (fcit->font().noun() == LyXFont::ON) {
734                         lyxerr[Debug::LATEX] << "font.noun: "
735                                              << fcit->font().noun()
736                                              << endl;
737                         features.require("noun");
738                         lyxerr[Debug::LATEX] << "Noun enabled. Font: "
739                                              << fcit->font().stateText(0)
740                                              << endl;
741                 }
742                 switch (fcit->font().color()) {
743                 case LColor::none:
744                 case LColor::inherit:
745                 case LColor::ignore:
746                         // probably we should put here all interface colors used for
747                         // font displaying! For now I just add this ones I know of (Jug)
748                 case LColor::latex:
749                 case LColor::note:
750                         break;
751                 default:
752                         features.require("color");
753                         lyxerr[Debug::LATEX] << "Color enabled. Font: "
754                                              << fcit->font().stateText(0)
755                                              << endl;
756                 }
757
758                 Language const * language = fcit->font().language();
759                 if (language->babel() != doc_language->babel() &&
760                     language != ignore_language &&
761                     language != latex_language)
762                 {
763                         features.useLanguage(language);
764                         lyxerr[Debug::LATEX] << "Found language "
765                                              << language->babel() << endl;
766                 }
767         }
768
769         if (!params.leftIndent().zero())
770                 features.require("ParagraphLeftIndent");
771
772         // then the insets
773         InsetList::const_iterator icit = owner_->insetlist.begin();
774         InsetList::const_iterator iend = owner_->insetlist.end();
775         for (; icit != iend; ++icit) {
776                 if (icit->inset) {
777                         icit->inset->validate(features);
778                         if (layout.needprotect &&
779                             icit->inset->lyxCode() == InsetBase::FOOT_CODE)
780                                 features.require("NeedLyXFootnoteCode");
781                 }
782         }
783
784         // then the contents
785         for (pos_type i = 0; i < size() ; ++i) {
786                 for (size_t pnr = 0; pnr < phrases_nr; ++pnr) {
787                         if (!special_phrases[pnr].builtin
788                             && isTextAt(special_phrases[pnr].phrase, i)) {
789                                 features.require(special_phrases[pnr].phrase);
790                                 break;
791                         }
792                 }
793         }
794 }
795
796
797 } // namespace lyx