From def72111a5ac739cf8c5377a67adeee64c37e1ab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Mon, 6 Mar 2000 02:42:40 +0000 Subject: [PATCH] change to use ostreams instead of string when writing files. fiddling with insettext. font fix in formula.C. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@584 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 44 + development/Code_rules/Rules | 39 + lib/layouts/seminar.layout | 112 ++ lib/lyxrc.example | 4 + src/LyXAction.C | 7 +- src/WorkArea.C | 69 +- src/buffer.C | 736 ++++++++++- src/buffer.h | 7 + src/insets/figinset.C | 21 +- src/insets/figinset.h | 7 +- src/insets/inset.C | 6 +- src/insets/insetbib.C | 10 + src/insets/insetcommand.C | 15 +- src/insets/insetcommand.h | 7 +- src/insets/inseterror.C | 15 +- src/insets/inseterror.h | 7 +- src/insets/insetgraphics.C | 15 +- src/insets/insetgraphics.h | 7 +- src/insets/insetinfo.C | 15 +- src/insets/insetinfo.h | 7 +- src/insets/insetlabel.C | 19 +- src/insets/insetlabel.h | 7 +- src/insets/insetlatexaccent.C | 17 +- src/insets/insetlatexaccent.h | 7 +- src/insets/insetquotes.C | 27 +- src/insets/insetquotes.h | 7 +- src/insets/insetref.C | 19 +- src/insets/insetref.h | 7 +- src/insets/insetspecialchar.C | 29 +- src/insets/insetspecialchar.h | 7 +- src/insets/insettext.C | 153 ++- src/insets/insettext.h | 9 +- src/insets/insettoc.C | 17 + src/insets/insettoc.h | 7 + src/insets/inseturl.C | 21 +- src/insets/inseturl.h | 7 +- src/insets/lyxinset.h | 14 +- src/lyx_cb.C | 4 +- src/lyx_gui.C | 93 +- src/lyxfont.C | 158 +++ src/lyxfont.h | 21 +- src/lyxparagraph.h | 67 +- src/lyxrc.C | 16 +- src/lyxrc.h | 2 + src/mathed/formula.C | 20 +- src/mathed/formula.h | 7 +- src/mathed/formulamacro.C | 15 +- src/mathed/formulamacro.h | 7 +- src/mathed/math_macro.C | 2 +- src/paragraph.C | 2311 ++++++++++++++++++++++++++++++--- src/spellchecker.C | 3 +- src/support/lstrings.h | 2 +- src/support/lyxmanip.h | 20 + src/table.C | 473 ++++++- src/table.h | 13 +- src/tex-accent.C | 10 +- src/text.C | 5 + 57 files changed, 4357 insertions(+), 416 deletions(-) create mode 100644 lib/layouts/seminar.layout create mode 100644 src/support/lyxmanip.h diff --git a/ChangeLog b/ChangeLog index 0c3ecbe565..bcbeb08065 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,47 @@ +2000-03-06 Lars Gullik Bjønnes + + * lib/layouts/seminar.layout: feeble attempt at a layout for + seminar.cls, far from completet and could really use some looking + at from people used to write layout files. + + * src/support/lyxmanip.h (newlineAndDepth): ostream manipulator to + use instead of the AddNewlineAndDepth funtion in lyx_cb.C. This is + a lot nicer and works nicely with ostreams. + + * src/mathed/formula.C (draw): a slightly different solution that + the one posted to the list, but I think this one works too. (font + size wrong in headers.) + + * src/insets/insettext.C (computeTextRows): some fiddling on + Jürgens turf, added some comments that he should read. + + * src/lyxrc.C: remove all traces of RC_NOMENUACCELERATORS, never + used and it gave compiler warnings. + RC_SHOW_BANNER + "\\show_banner" added, also to reading and + writing of lyxrc. + + * src/lyx_gui.C (create_forms): do the right thing when + show_banner is true/false. + + * src/lyx_cb.C (TimerCB): no need to close or do anything if + show_banner is false. + + * most file writing files: Now use iostreams to do almost all of + the writing. Also instead of passing string &, we now use + stringstreams. mathed output is still not adapted to iostreams. + This change can be turned off by commenting out all the occurences + of the "#define USE_OSTREAM_ONLY 1" lines. + + * src/WorkArea.C (createPixmap): don't output debug messages. + (WorkArea): don't output debug messages. + + * lib/lyxrc.example: added a comment about the new variable + \show_banner + + * development/Code_rules/Rules: Added some more commente about how + to build class interfaces and on how better encapsulation can be + achieved. + 2000-03-03 Juergen Vigna * src/insets/insetert.C (InsetERT): Now ERT-insets break row diff --git a/development/Code_rules/Rules b/development/Code_rules/Rules index 62d14269d8..7b35986bf3 100644 --- a/development/Code_rules/Rules +++ b/development/Code_rules/Rules @@ -167,3 +167,42 @@ and enums. own. In case you have to change the generated files for any of the reasons above, you should provide a patch against the clean generated file. Your callbacks must be in a separate file. + + ************************************************************* + + How to create class interfaces. + (a.k.a How Non-Member Functions Improve Encapsulation) + ====================================================== + + I recently read an article by Scott Meyers in C/C++ Users +Journal (Vol.18,No.2), where he makes a strong case on how non-member +functions makes classes more encapsulated, not less. Just to skipping +to the core of this provides us with the following algorithm for +deciding what kind of function to add to a class interface: + + - We need to add a function f to the class C's API. + + if (f needs to be virtual) + make f a member function of C; + else if (f is operator>> or operator<<) { + make f a non-member funtion; + if (f needs access to non-public members of C) + make f a friend of C; + } else if (f needs type conversions on its left-most argument) { + make f a non-member function; + if (f needs access to non-public members of C) + make f a friend of C; + } else if (f can be implemented via C's public interface) + make f a non-member function; + else + make f a member function of C; + +Unfortunately, to make the best use of this kind of Class API's we +need namespaces. As soon as Jean-Marc stop using gcc 2.8 and other +compilers seem more or less up to date on namespaces we will begin to +use them. _BUT_ we should begin to use the above algoritm ASAP. We +should also go through old code and apply this algorithm to the +existing member functions. That will help maintainability in the +future. + +(I'll feel in more from Scott Meyers article when time allows.) diff --git a/lib/layouts/seminar.layout b/lib/layouts/seminar.layout new file mode 100644 index 0000000000..7275b87dd9 --- /dev/null +++ b/lib/layouts/seminar.layout @@ -0,0 +1,112 @@ +#% Do not delete the line below; configure depends on this +# \DeclareLaTeXClass{seminar} +# Initial attemt at makeing a LyX layout file for the seminar class. +# Author : Lars Gullik Bjønnes + +# Input general definitions +Input stdclass.inc + +Sides 1 +Columns 1 + +ClassOptions + FontSize 8|9|10|11|12|14|17 + Other slidesec +End + +# There are no chapters in an article. +NoStyle Chapter +NoStyle Chapter* + +MaxCounter Counter_Section +SecNumDepth 3 +TocDepth 3 + +# Change a bit Part and Part* +Style Part + Align Left + AlignPossible Left + TopSep 2 + BottomSep 1.5 + + Font + Size Larger + EndFont +End + +Style Part* + Align Left + AlignPossible Left + TopSep 2 + BottomSep 1.5 + + Font + Size Larger + EndFont +End + + +Style LandscapeSlide + CopyStyle Standard + LatexType Environment + LatexName slide + KeepEmpty 1 + Labeltype Static + LabelString "Landscape Slide" + LabelSep "MMMMMMM" +End + +Style PortraitSlide + CopyStyle Standard + LatexType Environment + LatexName slide* + KeepEmpty 1 + Labeltype Static + LabelString "Portrait Slide" +End + +Style Slide + Obsoletedby LandscapeSlide +End + +Style Slide* + Obsoletedby PortraitSlide +End + +Style SlideHeading + CopyStyle Section + LatexName slideheading +End + +Style SlideSubHeading + CopyStyle Subsection + LatexName slidesubheading +End + +Style ListOfSlides + KeepEmpty 1 + Align Center + LatexType Command + LatexName listofslides + Labeltype Static + LabelString "List Of Slides" +End + +Style SlideContents + KeepEmpty 1 + Align Center + LatexType Command + LatexName slidecontents + Labeltype Static + LabelString "Slidecontents" +End + +Style ProgressContents + KeepEmpty 1 + Align Center + LatexType Command + LatexName Slidecontents + Labeltype Static + LabelString "Progress Contents" +End + diff --git a/lib/lyxrc.example b/lib/lyxrc.example index e0395a1cb5..15f4016fa1 100644 --- a/lib/lyxrc.example +++ b/lib/lyxrc.example @@ -58,6 +58,10 @@ # MISC SECTION ########################################################### # +# Set this to false if you don't want the startup banner. +# Default is true. +#\show_banner true + # Set to false if you don't want the current selection to be replaced # automatically by what you type. Default is true. #\auto_region_delete false diff --git a/src/LyXAction.C b/src/LyXAction.C index ed378223aa..275c59f07b 100644 --- a/src/LyXAction.C +++ b/src/LyXAction.C @@ -497,9 +497,10 @@ int LyXAction::LookupFunc(string const & func) const } -#ifdef WITH_WARNINGS -#warning Not working as it should. -#endif +//#ifdef WITH_WARNINGS +//#warning Not working as it should. +//#endif +// I have no clue what is wrong with it... (Lgb) int LyXAction::getApproxFunc(string const & func) const // This func should perhaps also be able to return a list of all // actions that has func as a prefix. That should actually be quite diff --git a/src/WorkArea.C b/src/WorkArea.C index 900db135a4..5f95e0cada 100644 --- a/src/WorkArea.C +++ b/src/WorkArea.C @@ -64,10 +64,11 @@ WorkArea::WorkArea(BufferView * o, int xpos, int ypos, int width, int height) fl_freeze_all_forms(); figinset_canvas = 0; - - lyxerr << "Creating work area: +" - << xpos << '+' << ypos << ' ' - << width << 'x' << height << endl; + + if (lyxerr.debugging()) + lyxerr << "Creating work area: +" + << xpos << '+' << ypos << ' ' + << width << 'x' << height << endl; // FL_OBJECT * obj; const int bw = int(abs(float(fl_get_border_width()))); @@ -81,9 +82,10 @@ WorkArea::WorkArea(BufferView * o, int xpos, int ypos, int width, int height) fl_set_object_gravity(obj, NorthWestGravity, NorthWestGravity); // a box - lyxerr << "\tbackground box: +" - << xpos << '+' << ypos << ' ' - << width - 15 << 'x' << height << endl; + if (lyxerr.debugging()) + lyxerr << "\tbackground box: +" + << xpos << '+' << ypos << ' ' + << width - 15 << 'x' << height << endl; backgroundbox = obj = fl_add_box(FL_BORDER_BOX, xpos, ypos, width - 15, @@ -98,9 +100,10 @@ WorkArea::WorkArea(BufferView * o, int xpos, int ypos, int width, int height) // up - scrollbar button fl_set_border_width(-1); - lyxerr << "\tup button: +" - << xpos + width - 15 << '+' << ypos << ' ' - << 15 << 'x' << 15 << endl; + if (lyxerr.debugging()) + lyxerr << "\tup button: +" + << xpos + width - 15 << '+' << ypos << ' ' + << 15 << 'x' << 15 << endl; button_up = obj = fl_add_pixmapbutton(FL_TOUCH_BUTTON, xpos + width - 15, ypos, @@ -118,9 +121,11 @@ WorkArea::WorkArea(BufferView * o, int xpos, int ypos, int width, int height) // the scrollbar slider fl_set_border_width(-bw); - lyxerr << "\tscrollbar slider: +" - << xpos + width - 15 << '+' << ypos + 15 << ' ' - << 15 << 'x' << height - 30 << endl; + + if (lyxerr.debugging()) + lyxerr << "\tscrollbar slider: +" + << xpos + width - 15 << '+' << ypos + 15 << ' ' + << 15 << 'x' << height - 30 << endl; scrollbar = obj = fl_add_slider(FL_VERT_SLIDER, xpos + width - 15, ypos + 15, @@ -136,9 +141,11 @@ WorkArea::WorkArea(BufferView * o, int xpos, int ypos, int width, int height) // down - scrollbar button fl_set_border_width(-1); - lyxerr << "\tdown button: +" - << xpos + width - 15 << '+' << ypos + height - 15 << ' ' - << 15 << 'x' << 15 << endl; + if (lyxerr.debugging()) + lyxerr << "\tdown button: +" + << xpos + width - 15 << '+' + << ypos + height - 15 << ' ' + << 15 << 'x' << 15 << endl; button_down = obj = fl_add_pixmapbutton(FL_TOUCH_BUTTON, xpos + width - 15, ypos + height - 15, @@ -167,9 +174,12 @@ WorkArea::WorkArea(BufferView * o, int xpos, int ypos, int width, int height) // We add this object as late as possible to avoit problems // with drawing. - lyxerr << "\tfree object: +" - << xpos + bw << '+' << ypos + bw << ' ' - << width - 15 - 2 * bw << 'x' << height - 2 * bw << endl; + if (lyxerr.debugging()) + lyxerr << "\tfree object: +" + << xpos + bw << '+' << ypos + bw << ' ' + << width - 15 - 2 * bw << 'x' + << height - 2 * bw << endl; + work_area = obj = fl_add_free(FL_INPUT_FREE, xpos + bw, ypos + bw, width - 15 - 2 * bw, // scrollbarwidth @@ -245,15 +255,18 @@ void WorkArea::createPixmap(int width, int height) if (workareapixmap) XFreePixmap(fl_display, workareapixmap); - - lyxerr << "Creating pixmap (" << width << 'x' << height << ")" << endl; + + if (lyxerr.debugging()) + lyxerr << "Creating pixmap (" + << width << 'x' << height << ")" << endl; workareapixmap = XCreatePixmap(fl_display, RootWindow(fl_display, 0), width, height, fl_get_visual_depth()); - lyxerr << "\tpixmap=" << workareapixmap << endl; + if (lyxerr.debugging()) + lyxerr << "\tpixmap=" << workareapixmap << endl; } @@ -328,8 +341,8 @@ void WorkArea::scroll_cb(FL_OBJECT * ob, long) bool Lgb_bug_find_hack = false; int WorkArea::work_area_handler(FL_OBJECT * ob, int event, - FL_Coord, FL_Coord , - int /*key*/, void * xev) + FL_Coord, FL_Coord , + int /*key*/, void * xev) { static int x_old = -1; static int y_old = -1; @@ -381,16 +394,16 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event, // Done by the raw callback: // case FL_KEYBOARD: WorkAreaKeyPress(ob, 0,0,0,ev,0); break; case FL_FOCUS: - lyxerr << "Workarea event: FOCUS" << endl; + lyxerr.debug() << "Workarea event: FOCUS" << endl; break; case FL_UNFOCUS: - lyxerr << "Workarea event: UNFOCUS" << endl; + lyxerr.debug() << "Workarea event: UNFOCUS" << endl; break; case FL_ENTER: - lyxerr << "Workarea event: ENTER" << endl; + lyxerr.debug() << "Workarea event: ENTER" << endl; break; case FL_LEAVE: - lyxerr << "Workarea event: LEAVE" << endl; + lyxerr.debug() << "Workarea event: LEAVE" << endl; break; case FL_DBLCLICK: if (!ev) break; diff --git a/src/buffer.C b/src/buffer.C index 0cc2d32515..3eb78ad986 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -1525,6 +1525,537 @@ void Buffer::writeFileAscii(string const & fname, int linelen) } +#ifdef USE_OSTREAM_ONLY +void Buffer::makeLaTeXFile(string const & fname, + string const & original_path, + bool nice, bool only_body) +{ + lyxerr[Debug::LATEX] << "makeLaTeXFile..." << endl; + + niceFile = nice; // this will be used by Insetincludes. + + tex_code_break_column = lyxrc->ascii_linelen; + + LyXTextClass const & tclass = + textclasslist.TextClass(params.textclass); + + ofstream ofs(fname.c_str()); + if (!ofs) { + WriteFSAlert(_("Error: Cannot open file: "), fname); + return; + } + + // validate the buffer. + lyxerr[Debug::LATEX] << " Validating buffer..." << endl; + LaTeXFeatures features(tclass.numLayouts()); + validate(features); + lyxerr[Debug::LATEX] << " Buffer validation done." << endl; + + texrow.reset(); + // The starting paragraph of the coming rows is the + // first paragraph of the document. (Asger) + texrow.start(paragraph, 0); + + if (!only_body && nice) { + ofs << "%% " LYX_DOCVERSION " created this file. " + "For more info, see http://www.lyx.org/.\n" + "%% Do not edit unless you really know what " + "you are doing.\n"; + texrow.newline(); + texrow.newline(); + } + lyxerr.debug() << "lyx header finished" << endl; + // There are a few differences between nice LaTeX and usual files: + // usual is \batchmode and has a + // special input@path to allow the including of figures + // with either \input or \includegraphics (what figinsets do). + // batchmode is not set if there is a tex_code_break_column. + // In this case somebody is interested in the generated LaTeX, + // so this is OK. input@path is set when the actual parameter + // original_path is set. This is done for usual tex-file, but not + // for nice-latex-file. (Matthias 250696) + if (!only_body) { + if (!nice){ + // code for usual, NOT nice-latex-file + ofs << "\\batchmode\n"; // changed + // from \nonstopmode + texrow.newline(); + } + if (!original_path.empty()) { + ofs << "\\makeatletter\n" + << "\\def\\input@path{{" + << original_path << "/}}\n" + << "\\makeatother\n"; + texrow.newline(); + texrow.newline(); + texrow.newline(); + } + + ofs << "\\documentclass"; + + string options; // the document class options. + + if (tokenPos(tclass.opt_fontsize(), '|', params.fontsize) >= 0) { + // only write if existing in list (and not default) + options += params.fontsize; + options += "pt,"; + } + + + if (!params.use_geometry && + (params.paperpackage == BufferParams::PACKAGE_NONE)) { + switch (params.papersize) { + case BufferParams::PAPER_A4PAPER: + options += "a4paper,"; + break; + case BufferParams::PAPER_USLETTER: + options += "letterpaper,"; + break; + case BufferParams::PAPER_A5PAPER: + options += "a5paper,"; + break; + case BufferParams::PAPER_B5PAPER: + options += "b5paper,"; + break; + case BufferParams::PAPER_EXECUTIVEPAPER: + options += "executivepaper,"; + break; + case BufferParams::PAPER_LEGALPAPER: + options += "legalpaper,"; + break; + } + } + + // if needed + if (params.sides != tclass.sides()) { + switch (params.sides) { + case LyXTextClass::OneSide: + options += "oneside,"; + break; + case LyXTextClass::TwoSides: + options += "twoside,"; + break; + } + + } + + // if needed + if (params.columns != tclass.columns()) { + if (params.columns == 2) + options += "twocolumn,"; + else + options += "onecolumn,"; + } + + if (!params.use_geometry + && params.orientation == BufferParams::ORIENTATION_LANDSCAPE) + options += "landscape,"; + + // language should be a parameter to \documentclass + if (params.language != "default") { + if (params.language == "hebrew") + options += "english,"; + else if (lyxrc->rtl_support) + options += "hebrew,"; + options += params.language + ','; + } else if (lyxrc->rtl_support) + options += "hebrew,english,"; + + // the user-defined options + if (!params.options.empty()) { + options += params.options + ','; + } + + if (!options.empty()){ + options = strip(options, ','); + ofs << '[' << options << ']'; + } + + ofs << '{' + << textclasslist.LatexnameOfClass(params.textclass) + << "}\n"; + texrow.newline(); + // end of \documentclass defs + + // font selection must be done before loading fontenc.sty + if (params.fonts != "default") { + ofs << "\\usepackage{" << params.fonts << "}\n"; + texrow.newline(); + } + // this one is not per buffer + if (lyxrc->fontenc != "default") { + ofs << "\\usepackage[" << lyxrc->fontenc + << "]{fontenc}\n"; + texrow.newline(); + } + if (params.inputenc != "default") { + ofs << "\\usepackage[" << params.inputenc + << "]{inputenc}\n"; + texrow.newline(); + } + + /* at the very beginning the text parameters */ + if (params.paperpackage != BufferParams::PACKAGE_NONE) { + switch (params.paperpackage) { + case BufferParams::PACKAGE_A4: + ofs << "\\usepackage{a4}\n"; + texrow.newline(); + break; + case BufferParams::PACKAGE_A4WIDE: + ofs << "\\usepackage{a4wide}\n"; + texrow.newline(); + break; + case BufferParams::PACKAGE_WIDEMARGINSA4: + ofs << "\\usepackage[widemargins]{a4}\n"; + texrow.newline(); + break; + } + } + if (params.use_geometry) { + ofs << "\\usepackage{geometry}\n"; + texrow.newline(); + ofs << "\\geometry{verbose"; + if (params.orientation == BufferParams::ORIENTATION_LANDSCAPE) + ofs << ",landscape"; + switch (params.papersize2) { + case BufferParams::VM_PAPER_CUSTOM: + if (!params.paperwidth.empty()) + ofs << ",paperwidth=" + << params.paperwidth; + if (!params.paperheight.empty()) + ofs << ",paperheight=" + << params.paperheight; + break; + case BufferParams::VM_PAPER_USLETTER: + ofs << ",letterpaper"; + break; + case BufferParams::VM_PAPER_USLEGAL: + ofs << ",legalpaper"; + break; + case BufferParams::VM_PAPER_USEXECUTIVE: + ofs << ",executivepaper"; + break; + case BufferParams::VM_PAPER_A3: + ofs << ",a3paper"; + break; + case BufferParams::VM_PAPER_A4: + ofs << ",a4paper"; + break; + case BufferParams::VM_PAPER_A5: + ofs << ",a5paper"; + break; + case BufferParams::VM_PAPER_B3: + ofs << ",b3paper"; + break; + case BufferParams::VM_PAPER_B4: + ofs << ",b4paper"; + break; + case BufferParams::VM_PAPER_B5: + ofs << ",b5paper"; + break; + default: + // default papersize ie BufferParams::VM_PAPER_DEFAULT + switch (lyxrc->default_papersize) { + case BufferParams::PAPER_DEFAULT: // keep compiler happy + case BufferParams::PAPER_USLETTER: + ofs << ",letterpaper"; + break; + case BufferParams::PAPER_LEGALPAPER: + ofs << ",legalpaper"; + break; + case BufferParams::PAPER_EXECUTIVEPAPER: + ofs << ",executivepaper"; + break; + case BufferParams::PAPER_A3PAPER: + ofs << ",a3paper"; + break; + case BufferParams::PAPER_A4PAPER: + ofs << ",a4paper"; + break; + case BufferParams::PAPER_A5PAPER: + ofs << ",a5paper"; + break; + case BufferParams::PAPER_B5PAPER: + ofs << ",b5paper"; + break; + } + } + if (!params.topmargin.empty()) + ofs << ",tmargin=" << params.topmargin; + if (!params.bottommargin.empty()) + ofs << ",bmargin=" << params.bottommargin; + if (!params.leftmargin.empty()) + ofs << ",lmargin=" << params.leftmargin; + if (!params.rightmargin.empty()) + ofs << ",rmargin=" << params.rightmargin; + if (!params.headheight.empty()) + ofs << ",headheight=" << params.headheight; + if (!params.headsep.empty()) + ofs << ",headsep=" << params.headsep; + if (!params.footskip.empty()) + ofs << ",footskip=" << params.footskip; + ofs << "}\n"; + texrow.newline(); + } + if (params.use_amsmath + && !prefixIs(textclasslist.LatexnameOfClass(params.textclass), "ams")) { + ofs << "\\usepackage{amsmath}\n"; + texrow.newline(); + } + + if (tokenPos(tclass.opt_pagestyle(), '|', params.pagestyle) >= 0) { + if (params.pagestyle == "fancy") { + ofs << "\\usepackage{fancyhdr}\n"; + texrow.newline(); + } + ofs << "\\pagestyle{" << params.pagestyle << "}\n"; + texrow.newline(); + } + + // We try to load babel late, in case it interferes + // with other packages. + if (params.language != "default" || lyxrc->rtl_support ) { + ofs << "\\usepackage{babel}\n"; + texrow.newline(); + } + + if (params.secnumdepth != tclass.secnumdepth()) { + ofs << "\\setcounter{secnumdepth}{" + << params.secnumdepth + << "}\n"; + texrow.newline(); + } + if (params.tocdepth != tclass.tocdepth()) { + ofs << "\\setcounter{tocdepth}{" + << params.tocdepth + << "}\n"; + texrow.newline(); + } + + if (params.paragraph_separation) { + switch (params.defskip.kind()) { + case VSpace::SMALLSKIP: + ofs << "\\setlength\\parskip{\\smallskipamount}\n"; + break; + case VSpace::MEDSKIP: + ofs << "\\setlength\\parskip{\\medskipamount}\n"; + break; + case VSpace::BIGSKIP: + ofs << "\\setlength\\parskip{\\bigskipamount}\n"; + break; + case VSpace::LENGTH: + ofs << "\\setlength\\parskip{" + << params.defskip.length().asLatexString() + << "}\n"; + break; + default: // should never happen // Then delete it. + ofs << "\\setlength\\parskip{\\medskipamount}\n"; + break; + } + texrow.newline(); + + ofs << "\\setlength\\parindent{0pt}\n"; + texrow.newline(); + } + + // Now insert the LyX specific LaTeX commands... + string preamble, tmppreamble; + + // The optional packages; + preamble = features.getPackages(params); + + // this might be useful... + preamble += "\n\\makeatletter\n\n"; + + // Some macros LyX will need + tmppreamble = features.getMacros(params); + + if (!tmppreamble.empty()) { + preamble += "\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% " + "LyX specific LaTeX commands.\n" + + tmppreamble + '\n'; + } + + // the text class specific preamble + tmppreamble = features.getTClassPreamble(params); + if (!tmppreamble.empty()) { + preamble += "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% " + "Textclass specific LaTeX commands.\n" + + tmppreamble + '\n'; + } + + /* the user-defined preamble */ + if (!params.preamble.empty()) { + preamble += "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% " + "User specified LaTeX commands.\n" + + params.preamble + '\n'; + } + + preamble += "\\makeatother\n\n"; + + // Itemize bullet settings need to be last in case the user + // defines their own bullets that use a package included + // in the user-defined preamble -- ARRae + // Actually it has to be done much later than that + // since some packages like frenchb make modifications + // at \begin{document} time -- JMarc + string bullets_def; + for (int i = 0; i < 4; ++i) { + if (params.user_defined_bullets[i] != ITEMIZE_DEFAULTS[i]) { + if (bullets_def.empty()) + bullets_def="\\AtBeginDocument{\n"; + bullets_def += " \\renewcommand{\\labelitemi"; + switch (i) { + // `i' is one less than the item to modify + case 0: + break; + case 1: + bullets_def += 'i'; + break; + case 2: + bullets_def += "ii"; + break; + case 3: + bullets_def += 'v'; + break; + } + bullets_def += "}{" + + params.user_defined_bullets[i].getText() + + "}\n"; + } + } + + if (!bullets_def.empty()) + preamble += bullets_def + "}\n\n"; + + for (int j = countChar(preamble, '\n'); j-- ;) { + texrow.newline(); + } + + ofs << preamble; + + // make the body. + ofs << "\\begin{document}\n\n"; + texrow.newline(); + texrow.newline(); + } // only_body + lyxerr.debug() << "preamble finished, now the body." << endl; + + bool was_title = false; + bool already_title = false; +#ifdef HAVE_SSTREAM + ostringstream ftnote; +#else + char * tmpholder = 0; +#endif + TexRow ft_texrow; + int ftcount = 0; + + LyXParagraph * par = paragraph; + + // if only_body + while (par) { +#ifndef HAVE_SSTREAM + ostrstream ftnote; + if (tmpholder) { + ftnote << tmpholder; + delete [] tmpholder; + tmpholder = 0; + } +#endif + if (par->IsDummy()) + lyxerr[Debug::LATEX] << "Error in MakeLateXFile." + << endl; + LyXLayout const & layout = + textclasslist.Style(params.textclass, + par->layout); + + if (layout.intitle) { + if (already_title) { + lyxerr <<"Error in MakeLatexFile: You" + " should not mix title layouts" + " with normal ones." << endl; + } else + was_title = true; + } else if (was_title && !already_title) { + ofs << "\\maketitle\n"; + texrow.newline(); + already_title = true; + was_title = false; + } + // We are at depth 0 so we can just use + // ordinary \footnote{} generation + // flag this with ftcount + ftcount = -1; + if (layout.isEnvironment() + || par->pextra_type != LyXParagraph::PEXTRA_NONE) { + par = par->TeXEnvironment(ofs, texrow, + ftnote, ft_texrow, ftcount); + } else { + par = par->TeXOnePar(ofs, texrow, + ftnote, ft_texrow, ftcount); + } + + // Write out what we've generated... + if (ftcount >= 1) { + if (ftcount > 1) { + ofs << "\\addtocounter{footnote}{-" + << ftcount - 1 + << '}'; + } + ofs << ftnote.str(); + texrow += ft_texrow; +#ifdef HAVE_SSTREAM + ftnote.str(string()); +#else + delete [] ftnote.str(); +#endif + ft_texrow.reset(); + ftcount = 0; + } +#ifndef HAVE_SSTREAM + else { + // I hate strstreams + tmpholder = ftnote.str(); + } +#endif + } +#ifndef HAVE_SSTREAM + delete [] tmpholder; +#endif + // It might be that we only have a title in this document + if (was_title && !already_title) { + ofs << "\\maketitle\n"; + texrow.newline(); + } + + if (!only_body) { + ofs << "\\end{document}\n"; + texrow.newline(); + + lyxerr[Debug::LATEX] << "makeLaTeXFile...done" << endl; + } else { + lyxerr[Debug::LATEX] << "LaTeXFile for inclusion made." + << endl; + } + + // Just to be sure. (Asger) + texrow.newline(); + + // tex_code_break_column's value is used to decide + // if we are in batchmode or not (within mathed_write() + // in math_write.C) so we must set it to a non-zero + // value when we leave otherwise we save incorrect .lyx files. + tex_code_break_column = lyxrc->ascii_linelen; + + ofs.close(); + if (ofs.fail()) { + lyxerr << "File was not closed properly." << endl; + } + + lyxerr.debug() << "Finished making latex file." << endl; +} +#else void Buffer::makeLaTeXFile(string const & fname, string const & original_path, bool nice, bool only_body) @@ -2048,6 +2579,7 @@ void Buffer::makeLaTeXFile(string const & fname, ofs.close(); lyxerr.debug() << "Finished making latex file." << endl; } +#endif bool Buffer::isLatex() const @@ -2285,7 +2817,6 @@ void Buffer::DocBookHandleCaption(ostream & os, string & inner_tag, LyXParagraph * & par) { LyXParagraph * tpar = par; - string tmp_par, extra_par; while (tpar && (tpar->footnoteflag != LyXParagraph::NO_FOOTNOTE) && (tpar->layout != textclasslist.NumberOfLayout(params.textclass, "Caption").second)) @@ -2294,11 +2825,18 @@ void Buffer::DocBookHandleCaption(ostream & os, string & inner_tag, tpar->layout == textclasslist.NumberOfLayout(params.textclass, "Caption").second) { sgmlOpenTag(os, depth + 1, inner_tag); +#ifdef USE_OSTREAM_ONLY + string extra_par; + SimpleDocBookOnePar(os, extra_par, tpar, + desc_on, depth + 2); +#else + string tmp_par, extra_par; SimpleDocBookOnePar(tmp_par, extra_par, tpar, desc_on, depth + 2); tmp_par = strip(tmp_par); tmp_par = frontStrip(tmp_par); os << tmp_par; +#endif sgmlCloseTag(os, depth+1, inner_tag); if(!extra_par.empty()) os << extra_par; @@ -2317,13 +2855,15 @@ void Buffer::DocBookHandleFootnote(ostream & os, LyXParagraph * & par, // This is not how I like to see enums. They should not be anonymous // and variables of its type should not be declared right after the // last brace. (Lgb) - enum { + enum SOME_ENUM { NO_ONE, FOOTNOTE_LIKE, MARGIN_LIKE, FIG_LIKE, TAB_LIKE - } last = NO_ONE, present = FOOTNOTE_LIKE; + }; + SOME_ENUM last = NO_ONE; + SOME_ENUM present = FOOTNOTE_LIKE; while (par && par->footnoteflag != LyXParagraph::NO_FOOTNOTE) { if(last == present) { @@ -2339,7 +2879,8 @@ void Buffer::DocBookHandleFootnote(ostream & os, LyXParagraph * & par, os << "\n"; } else { os << tmp_par; - if(!inner_tag.empty()) sgmlCloseTag(os, depth+1, inner_tag); + if(!inner_tag.empty()) sgmlCloseTag(os, depth + 1, + inner_tag); if(!extra_par.empty()) os << extra_par; if(!tag.empty()) sgmlCloseTag(os, depth, tag); extra_par.clear(); @@ -2385,8 +2926,24 @@ void Buffer::DocBookHandleFootnote(ostream & os, LyXParagraph * & par, // ignore all caption here, we processed them above!!! if (par->layout != textclasslist.NumberOfLayout(params.textclass, "Caption").second) { - SimpleDocBookOnePar(tmp_par, extra_par, par, +#ifdef USE_OSTREAM_ONLY +#ifdef HAVE_SSTREAM + ostringstream ost; +#else + ostrstream ost; +#endif + SimpleDocBookOnePar(ost, extra_par, par, desc_on, depth + 2); +#ifdef HAVE_SSTREAM + tmp_par += ost.str().c_str(); +#else + ost << '\0'; + char * ctmp = ost.str(); + tmp_par += ctmp; + delete [] ctmp; +#endif +#else +#endif } tmp_par = frontStrip(strip(tmp_par)); @@ -2394,7 +2951,7 @@ void Buffer::DocBookHandleFootnote(ostream & os, LyXParagraph * & par, par = par->next; } os << tmp_par; - if(!inner_tag.empty()) sgmlCloseTag(os, depth+1, inner_tag); + if(!inner_tag.empty()) sgmlCloseTag(os, depth + 1, inner_tag); if(!extra_par.empty()) os << extra_par; if(!tag.empty()) sgmlCloseTag(os, depth, tag); } @@ -2597,9 +3154,13 @@ void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par, ++char_line_count; } else if (c == LyXParagraph::META_INSET) { inset = par->GetInset(i); +#ifdef USE_OSTREAM_ONLY + inset->Linuxdoc(os); +#else string tmp_out; inset->Linuxdoc(tmp_out); os << tmp_out; +#endif } else { string sgml_string; @@ -2887,6 +3448,14 @@ void Buffer::makeDocBookFile(string const & fname, int column) } do { +#ifdef USE_OSTREAM_ONLY + string extra_par; + SimpleDocBookOnePar(ofs, extra_par, par, desc_on, + depth + 1 + command_depth); + par = par->next; + DocBookHandleFootnote(ofs, par, + depth + 1 + command_depth); +#else string tmp_par, extra_par; SimpleDocBookOnePar(tmp_par, extra_par, par, desc_on, @@ -2896,6 +3465,7 @@ void Buffer::makeDocBookFile(string const & fname, int column) par = par->next; DocBookHandleFootnote(ofs, par, depth + 1 + command_depth); +#endif } while(par && par->IsDummy()); @@ -2957,6 +3527,142 @@ void Buffer::makeDocBookFile(string const & fname, int column) } +#ifdef USE_OSTREAM_ONLY +void Buffer::SimpleDocBookOnePar(ostream & os, string & extra, + LyXParagraph * par, int & desc_on, + int const depth) +{ + if (par->table) { + par->SimpleDocBookOneTablePar(os, extra, desc_on, depth); + return; + } + LyXFont font1, font2; + char c; + Inset * inset; + LyXParagraph::size_type main_body; + int j; + //string emph = "emphasis"; + bool emph_flag = false; + int char_line_count = 0; + + LyXLayout const & style = textclasslist.Style(params.textclass, + par->GetLayout()); + + if (style.labeltype != LABEL_MANUAL) + main_body = 0; + else + main_body = par->BeginningOfMainBody(); + + // gets paragraph main font + if (main_body > 0) + font1 = style.labelfont; + else + font1 = style.font; + + char_line_count = depth; + if(!style.free_spacing) + for (j = 0; j < depth; ++j) + os << ' '; + + // parsing main loop + for (LyXParagraph::size_type i = 0; + i < par->size(); ++i) { + font2 = par->getFont(i); + + // handle tag + if (font1.emph() != font2.emph() && i) { + if (font2.emph() == LyXFont::ON) { + os << ""; + emph_flag= true; + }else { + os << ""; + emph_flag= false; + } + } + + c = par->GetChar(i); + + if (c == LyXParagraph::META_INSET) { + inset = par->GetInset(i); +#ifdef HAVE_SSTREAM + ostringstream ost; + inset->DocBook(ost); + string tmp_out = ost.str().c_str(); +#else + ostrstream ost; + inset->DocBook(ost); + ost << '\0'; + char * ctmp = ost.str(); + string tmp_out(ctmp); + delete [] ctmp; +#endif + // + // This code needs some explanation: + // Two insets are treated specially + // label if it is the first element in a command paragraph + // desc_on == 3 + // graphics inside tables or figure floats can't go on + // title (the equivalente in latex for this case is caption + // and title should come first + // desc_on == 4 + // + if(desc_on!= 3 || i!= 0) { + if(!tmp_out.empty() && tmp_out[0] == '@') { + if(desc_on == 4) + extra += frontStrip(tmp_out, '@'); + else + os << frontStrip(tmp_out, '@'); + } + else + os << tmp_out; + } + } else if (font2.latex() == LyXFont::ON) { + // "TeX"-Mode on ==> SGML-Mode on. + if (c!= '\0') + os << c; + ++char_line_count; + } + else { + string sgml_string; + if (par->linuxDocConvertChar(c, sgml_string) + && !style.free_spacing) { // in freespacing + // mode, spaces are + // non-breaking characters + // char is ' ' + if (desc_on == 1) { + ++char_line_count; + os << "\n"; + desc_on = 2; + } + else { + os << c; + } + } + else { + os << sgml_string; + } + } + font1 = font2; + } + + /* needed if there is an optional argument but no contents */ + if (main_body > 0 && main_body == par->size()) { + font1 = style.font; + } + if (emph_flag) { + os << ""; + } + + /* resets description flag correctly */ + switch(desc_on){ + case 1: + /* not closed... */ + os << ""; + break; + } + os << '\n'; +} +#else void Buffer::SimpleDocBookOnePar(string & file, string & extra, LyXParagraph * par, int & desc_on, int const depth) @@ -2967,7 +3673,7 @@ void Buffer::SimpleDocBookOnePar(string & file, string & extra, } LyXFont font1, font2; char c; - Inset *inset; + Inset * inset; LyXParagraph::size_type main_body; int j; string emph= "emphasis"; @@ -3013,8 +3719,23 @@ void Buffer::SimpleDocBookOnePar(string & file, string & extra, if (c == LyXParagraph::META_INSET) { inset = par->GetInset(i); +#ifdef USE_OSTREAM_ONLY +#ifdef HAVE_SSTREAM + ostringstream ost; + inset->DocBook(ost); + string tmp_out = ost.str().c_str(); +#else + ostrstream ost; + inset->DocBook(ost); + ost << '\0'; + char * ctmp = ost.str(); + string tmp_out(ctmp); + delete [] ctmp; +#endif +#else string tmp_out; inset->DocBook(tmp_out); +#endif // // This code needs some explanation: // Two insets are treated specially @@ -3082,6 +3803,7 @@ void Buffer::SimpleDocBookOnePar(string & file, string & extra, } file += '\n'; } +#endif int Buffer::runLaTeX() diff --git a/src/buffer.h b/src/buffer.h index 8b141a54b6..ebb6dcfd7a 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -357,10 +357,17 @@ private: /// void SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par, int desc_on, int const depth); +#ifdef USE_OSTREAM_ONLY + /// + void SimpleDocBookOnePar(ostream &, string & extra, + LyXParagraph * par, int & desc_on, + int const depth); +#else /// void SimpleDocBookOnePar(string & file, string & extra, LyXParagraph * par, int & desc_on, int const depth); +#endif /// LinuxDoc. void push_tag(ostream & os, char const * tag, diff --git a/src/insets/figinset.C b/src/insets/figinset.C index 6bc9176219..5f8f1c4487 100644 --- a/src/insets/figinset.C +++ b/src/insets/figinset.C @@ -1209,7 +1209,6 @@ int InsetFig::Latex(string & file, signed char /* fragile*/ ) const file += cmd + ' '; return 0; } -#endif int InsetFig::Linuxdoc(string &/*file*/) const @@ -1229,6 +1228,26 @@ int InsetFig::DocBook(string & file) const return 0; } +#else + +int InsetFig::Linuxdoc(ostream &) const +{ + return 0; +} + + +int InsetFig::DocBook(ostream & os) const +{ + string figurename = fname; + + if(suffixIs(figurename, ".eps")) + figurename.erase(fname.length() - 5); + + os << "@"; + return 0; +} +#endif + void InsetFig::Validate(LaTeXFeatures & features) const { diff --git a/src/insets/figinset.h b/src/insets/figinset.h index 83234badc5..3b0a2b3ab6 100644 --- a/src/insets/figinset.h +++ b/src/insets/figinset.h @@ -42,11 +42,16 @@ public: #ifndef USE_OSTREAM_ONLY /// int Latex(string & file, signed char fragile) const; -#endif /// int Linuxdoc(string & file) const; /// int DocBook(string & file) const; +#else + /// + int Linuxdoc(ostream &) const; + /// + int DocBook(ostream &) const; +#endif /// Updates needed features for this inset. void Validate(LaTeXFeatures & features) const; diff --git a/src/insets/inset.C b/src/insets/inset.C index 02b733c9a7..a8dce4e1b8 100644 --- a/src/insets/inset.C +++ b/src/insets/inset.C @@ -110,12 +110,11 @@ void UpdatableInset::ToggleInsetCursor(BufferView *) void UpdatableInset::Edit(BufferView * bv, int, int, unsigned int) { - LyXFont - font; + LyXFont font; scx = 0; - mx_scx=abs((width(bv->getPainter(), font) - bv->paperWidth())/2); + mx_scx=abs((width(bv->getPainter(), font) - bv->paperWidth()) / 2); } @@ -132,6 +131,7 @@ void UpdatableInset::SetFont(BufferView *, LyXFont const &, bool ) { } + /// An updatable inset could handle lyx editing commands #ifdef SCROLL_INSET UpdatableInset::RESULT diff --git a/src/insets/insetbib.C b/src/insets/insetbib.C index 61f71bcb4a..fdc0998b35 100644 --- a/src/insets/insetbib.C +++ b/src/insets/insetbib.C @@ -239,6 +239,15 @@ void InsetBibKey::setCounter(int c) // of time cause LyX3 won't use lyxlex anyway. (ale) void InsetBibKey::Write(ostream & os) const { +#ifdef USE_OSTREAM_ONLY + os << "\\bibitem "; + if (!options.empty()) { + os << '[' + << options << ']'; + } + os << '{' + << contents << "}\n"; +#else string s; if (!options.empty()) { s += '['; @@ -247,6 +256,7 @@ void InsetBibKey::Write(ostream & os) const s += '{'; s += contents + '}'; os << "\\bibitem " << s << "\n"; +#endif } diff --git a/src/insets/insetcommand.C b/src/insets/insetcommand.C index 9c7c8b1bda..2615799453 100644 --- a/src/insets/insetcommand.C +++ b/src/insets/insetcommand.C @@ -257,7 +257,6 @@ int InsetCommand::Latex(string & file, signed char /*fragile*/) const file += getCommand(); return 0; } -#endif int InsetCommand::Linuxdoc(string &/*file*/) const @@ -271,6 +270,20 @@ int InsetCommand::DocBook(string &/*file*/) const return 0; } +#else + +int InsetCommand::Linuxdoc(ostream &) const +{ + return 0; +} + + +int InsetCommand::DocBook(ostream &) const +{ + return 0; +} +#endif + Inset * InsetCommand::Clone() const { diff --git a/src/insets/insetcommand.h b/src/insets/insetcommand.h index bc3cb17978..afdbcb98c4 100644 --- a/src/insets/insetcommand.h +++ b/src/insets/insetcommand.h @@ -51,11 +51,16 @@ public: #ifndef USE_OSTREAM_ONLY /// virtual int Latex(string & file, signed char fragile) const; -#endif /// virtual int Linuxdoc(string & file) const; /// virtual int DocBook(string & file) const; +#else + /// + virtual int Linuxdoc(ostream &) const; + /// + virtual int DocBook(ostream &) const; +#endif /// Inset * Clone() const; /// diff --git a/src/insets/inseterror.C b/src/insets/inseterror.C index 93fbda4a4d..c2c873cf90 100644 --- a/src/insets/inseterror.C +++ b/src/insets/inseterror.C @@ -112,7 +112,6 @@ int InsetError::Latex(string &, signed char /*fragile*/) const { return 0; } -#endif int InsetError::Linuxdoc(string &) const @@ -126,6 +125,20 @@ int InsetError::DocBook(string &) const return 0; } +#else + +int InsetError::Linuxdoc(ostream &) const +{ + return 0; +} + + +int InsetError::DocBook(ostream &) const +{ + return 0; +} +#endif + bool InsetError::AutoDelete() const { diff --git a/src/insets/inseterror.h b/src/insets/inseterror.h index 86f7c712f9..47892510a6 100644 --- a/src/insets/inseterror.h +++ b/src/insets/inseterror.h @@ -51,11 +51,16 @@ public: #ifndef USE_OSTREAM_ONLY /// int Latex(string & file, signed char fragile) const; -#endif /// int Linuxdoc(string & file) const; /// int DocBook(string & file) const; +#else + /// + int Linuxdoc(ostream &) const; + /// + int DocBook(ostream &) const; +#endif /// bool AutoDelete() const; /// what appears in the minibuffer when opening diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index dcbfc71a35..348546d42d 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -230,7 +230,6 @@ int InsetGraphics::Latex(string & /*file*/, signed char /*fragile*/) const { return 0; } -#endif int InsetGraphics::Linuxdoc(string & /*file*/) const @@ -244,6 +243,20 @@ int InsetGraphics::DocBook(string & /*file*/) const return 0; } +#else + +int InsetGraphics::Linuxdoc(ostream &) const +{ + return 0; +} + + +int InsetGraphics::DocBook(ostream &) const +{ + return 0; +} +#endif + void InsetGraphics::Validate(LaTeXFeatures & /*features*/) const { diff --git a/src/insets/insetgraphics.h b/src/insets/insetgraphics.h index f54d1f29ad..df7fadf0d1 100644 --- a/src/insets/insetgraphics.h +++ b/src/insets/insetgraphics.h @@ -49,11 +49,16 @@ public: #ifndef USE_OSTREAM_ONLY /// int Latex(string & file, signed char fragile) const; -#endif /// int Linuxdoc(string & /*file*/) const; /// int DocBook(string & /*file*/) const; +#else + /// + int Linuxdoc(ostream &) const; + /// + int DocBook(ostream &) const; +#endif /// Updates needed features for this inset. void Validate(LaTeXFeatures & features) const; diff --git a/src/insets/insetinfo.C b/src/insets/insetinfo.C index 9499ec0de2..fc90380130 100644 --- a/src/insets/insetinfo.C +++ b/src/insets/insetinfo.C @@ -137,7 +137,6 @@ int InsetInfo::Latex(string &, signed char /*fragile*/) const { return 0; } -#endif int InsetInfo::Linuxdoc(string &) const @@ -151,6 +150,20 @@ int InsetInfo::DocBook(string &) const return 0; } +#else + +int InsetInfo::Linuxdoc(ostream &) const +{ + return 0; +} + + +int InsetInfo::DocBook(ostream &) const +{ + return 0; +} +#endif + unsigned char InsetInfo::Editable() const { diff --git a/src/insets/insetinfo.h b/src/insets/insetinfo.h index 5fa617c66b..3ae6a47e7c 100644 --- a/src/insets/insetinfo.h +++ b/src/insets/insetinfo.h @@ -53,11 +53,16 @@ public: #ifndef USE_OSTREAM_ONLY /// int Latex(string & file, signed char fragile) const; -#endif /// int Linuxdoc(string & file) const; /// int DocBook(string & file) const; +#else + /// + int Linuxdoc(ostream &) const; + /// + int DocBook(ostream &) const; +#endif /// what appears in the minibuffer when opening const char * EditMessage() const {return _("Opened note");} /// diff --git a/src/insets/insetlabel.C b/src/insets/insetlabel.C index 697a524079..0a2a94f044 100644 --- a/src/insets/insetlabel.C +++ b/src/insets/insetlabel.C @@ -56,7 +56,6 @@ int InsetLabel::Latex(string & file, signed char /*fragile*/) const file += escape(getCommand()); return 0; } -#endif int InsetLabel::Linuxdoc(string & file) const @@ -72,6 +71,24 @@ int InsetLabel::DocBook(string & file) const return 0; } +#else + +int InsetLabel::Linuxdoc(ostream & os) const +{ + os << "