From: Jürgen Spitzmüller Date: Tue, 4 Dec 2007 09:25:50 +0000 (+0000) Subject: framed.sty goes InsetBox: X-Git-Tag: 1.6.10~7064 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=3582be1441db296f29b54649f743745843e499e2;p=features.git framed.sty goes InsetBox: * src/insets/InsetBox.{cpp,h}: * src/frontends/qt4/GuiBox.{cpp,h}: * src/frontends/qt4/ui/BoxUi.ui: - add and handle Framed and Shaded boxes - use more descriptive label names - implement name() function for Box:Shaded's sake * src/insets/InsetNote.{cpp,h}: * src/frontends/qt4/GuiNote.cpp: * src/frontends/qt4/ui/NoteUi.ui: - remove Framed and Shaded. * lib/layouts/stdinsets.inc: - remove Note:Framed and Note:Shaded - add Box:Shaded * Buffer.cpp: - bump format to 304. * lib/lyx2lyx/LyX.py: * lib/lyx2lyx/lyx_1_6.py: - add conversion/reversion of framed/shaded notes to boxes. * development/FORMAT: - document file format change. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21945 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/development/FORMAT b/development/FORMAT index f119437786..51c270e95b 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -1,6 +1,10 @@ LyX file-format changes ----------------------- +2007-12-03 Jürgen Spitzmüller + * Format incremented to 304: framed and shaded boxes are now real boxes + (not notes). + 2007-11-25 Uwe Stöhr * Format incremented to 303: remove Serbocroatian as this was not a real babel language (Croatian was used instead in the background) diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc index 10ff29fe6b..78a648a374 100644 --- a/lib/layouts/stdinsets.inc +++ b/lib/layouts/stdinsets.inc @@ -1,5 +1,5 @@ # Textclass definition file for LaTeX. -# Author : Martin vermeer +# Author : Martin vermeer # Inset layouts definition # #InsetLayout @@ -118,30 +118,6 @@ InsetLayout Note:Greyedout MultiPar true End -InsetLayout Note:Framed - LabelString framed - LatexType environment - LatexName framed - BgColor greyedoutbg - LabelFont - Color greyedout - Size Small - EndFont - MultiPar true -End - -InsetLayout Note:Shaded - LabelString shaded - LatexType environment - LatexName shaded - BgColor shaded - LabelFont - Color greyedout - Size Small - EndFont - MultiPar true -End - InsetLayout ERT LabelString ERT LatexType none @@ -219,6 +195,15 @@ InsetLayout Box MultiPar true End +InsetLayout Box:Shaded + BgColor shaded + LabelFont + Color foreground + Size Small + EndFont + MultiPar true +End + InsetLayout figure LabelString Figure LabelFont diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py index 081ad0f893..125af4a481 100644 --- a/lib/lyx2lyx/LyX.py +++ b/lib/lyx2lyx/LyX.py @@ -80,7 +80,7 @@ format_relation = [("0_06", [200], minor_versions("0.6" , 4)), ("1_3", [221], minor_versions("1.3" , 7)), ("1_4", range(222,246), minor_versions("1.4" , 5)), ("1_5", range(246,277), minor_versions("1.5" , 2)), - ("1_6", range(277,304), minor_versions("1.6" , 0))] # Uwe: Serbocroatian + ("1_6", range(277,305), minor_versions("1.6" , 0))] def formats_list(): diff --git a/lib/lyx2lyx/lyx_1_6.py b/lib/lyx2lyx/lyx_1_6.py index 1482856ae3..af1f2bab2e 100644 --- a/lib/lyx2lyx/lyx_1_6.py +++ b/lib/lyx2lyx/lyx_1_6.py @@ -33,7 +33,7 @@ def find_end_of_inset(lines, i): def wrap_into_ert(string, src, dst): " Wrap a something into an ERT" - return string.replace(src, '\n\\begin_inset ERT\nstatus collapsed\n\\begin_layout standard\n' + return string.replace(src, '\n\\begin_inset ERT\nstatus collapsed\n\\begin_layout Standard\n' + dst + '\n\\end_layout\n\\end_inset\n') @@ -367,7 +367,7 @@ def convert_latexcommand_index(document): fullcontent = document.body[i + 2][6:].strip('"') document.body[i:i + 2] = ["\\begin_inset Index", "status collapsed", - "\\begin_layout standard"] + "\\begin_layout Standard"] # Put here the conversions needed from LaTeX string to LyXText. # Here we do a minimal conversion to prevent crashes and data loss. # Manual patch-up may be needed. @@ -425,7 +425,7 @@ def revert_latexcommand_index(document): line = line[16:] if line.startswith("\\begin_inset Formula"): line = line[20:] - if line.startswith("\\begin_layout standard"): + if line.startswith("\\begin_layout Standard"): line = line[22:] if line.startswith("\\end_layout"): line = line[11:] @@ -861,6 +861,58 @@ def convert_serbocroatian(document): j = j + 1 +def convert_framed_notes(document): + "Convert framed notes to boxes. " + i = 0 + while 1: + i = find_tokens(document.body, ["\\begin_inset Note Framed", "\\begin_inset Note Shaded"], i) + + if i == -1: + return + document.body[i] = document.body[i].replace("\\begin_inset Note", "\\begin_inset Box") + document.body.insert(i + 1, 'position "t"\nhor_pos "c"\nhas_inner_box 0\ninner_pos "t"\n' \ + 'use_parbox 0\nwidth "100col%"\nspecial "none"\nheight "1in"\n' \ + 'height_special "totalheight"') + i = i + 1 + + +def revert_framed_notes(document): + "Revert framed boxes to notes. " + i = 0 + while 1: + i = find_tokens(document.body, ["\\begin_inset Box Framed", "\\begin_inset Box Shaded"], i) + + if i == -1: + return + j = find_end_of_inset(document.body, i + 1) + if j == -1: + # should not happen + document.warning("Malformed LyX document: Could not find end of Box inset.") + k = find_token(document.body, "status", i + 1, j) + if k == -1: + document.warning("Malformed LyX document: Missing `status' tag in Box inset.") + return + status = document.body[k] + l = find_token(document.body, "\\begin_layout Standard", i + 1, j) + if l == -1: + document.warning("Malformed LyX document: Missing `\\begin_layout Standard' in Box inset.") + return + m = find_token(document.body, "\\end_layout", i + 1, j) + if m == -1: + document.warning("Malformed LyX document: Missing `\\end_layout' in Box inset.") + return + ibox = find_token(document.body, "has_inner_box 1", i + 1, k) + pbox = find_token(document.body, "use_parbox 1", i + 1, k) + if ibox == -1 and pbox == -1: + document.body[i] = document.body[i].replace("\\begin_inset Box", "\\begin_inset Note") + del document.body[i+1:k] + else: + document.body[i] = document.body[i].replace("\\begin_inset Box Shaded", "\\begin_inset Box Frameless") + document.body.insert(l + 1, "\\begin_inset Note Shaded\n" + status + "\n\\begin_layout Standard\n") + document.body.insert(m + 1, "\\end_layout\n\\end_inset") + i = i + 1 + + ## # Conversion hub # @@ -892,10 +944,12 @@ convert = [[277, [fix_wrong_tables]], [300, []], [301, []], [302, []], - [303, [convert_serbocroatian]] + [303, [convert_serbocroatian]], + [304, [convert_framed_notes]] ] -revert = [[302, []], +revert = [[303, [revert_framed_notes]], + [302, []], [301, [revert_latin, revert_samin]], [300, [revert_linebreak]], [299, [revert_pagebreak]], diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 9eabc12967..40f439de28 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -153,7 +153,7 @@ namespace os = support::os; namespace { -int const LYX_FORMAT = 303; // Uwe: Serbocroatian +int const LYX_FORMAT = 304; // JSpitzm: framed.sty goes InsetBox } // namespace anon diff --git a/src/frontends/qt4/GuiBox.cpp b/src/frontends/qt4/GuiBox.cpp index 1c50d3b7b2..5193ec14b7 100644 --- a/src/frontends/qt4/GuiBox.cpp +++ b/src/frontends/qt4/GuiBox.cpp @@ -43,16 +43,17 @@ void box_gui_tokens(vector & ids, vector & gui_names) { char const * const ids_[] = { "Frameless", "Boxed", "ovalbox", - "Ovalbox", "Shadowbox", "Doublebox"}; + "Ovalbox", "Shadowbox", "Shaded", "Doublebox"}; size_t const ids_size = sizeof(ids_) / sizeof(char *); ids = vector(ids_, ids_ + ids_size); gui_names.clear(); - gui_names.push_back(_("No frame drawn")); - gui_names.push_back(_("Rectangular box")); - gui_names.push_back(_("Oval box, thin")); - gui_names.push_back(_("Oval box, thick")); - gui_names.push_back(_("Shadow box")); - gui_names.push_back(_("Double box")); + gui_names.push_back(_("No frame")); + gui_names.push_back(_("Simple rectangular frame")); + gui_names.push_back(_("Oval frame, thin")); + gui_names.push_back(_("Oval frame, thick")); + gui_names.push_back(_("Drop shadow")); + gui_names.push_back(_("Shaded background")); + gui_names.push_back(_("Double rectangular frame")); } @@ -115,6 +116,8 @@ GuiBox::GuiBox(GuiView & lv) connect(innerBoxCO, SIGNAL(activated(const QString&)), this, SLOT(innerBoxChanged(const QString &))); connect(innerBoxCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(pagebreakCB, SIGNAL(stateChanged(int)), + this, SLOT(pagebreakClicked())); heightED->setValidator(unsignedLengthValidator(heightED)); widthED->setValidator(unsignedLengthValidator(widthED)); @@ -131,6 +134,7 @@ GuiBox::GuiBox(GuiView & lv) bc().addReadOnly(heightCB); bc().addReadOnly(heightED); bc().addReadOnly(heightUnitsLC); + bc().addReadOnly(pagebreakCB); bc().setRestore(restorePB); bc().setOK(okPB); @@ -183,6 +187,9 @@ void GuiBox::typeChanged(int index) heightUnitsLC->setEnabled(true); setSpecial(true); } + if (index != 1) + pagebreakCB->setChecked(false); + pagebreakCB->setEnabled(index == 1); int itype = innerBoxCO->currentIndex(); setInnerType(frameless, itype); } @@ -202,9 +209,34 @@ void GuiBox::restoreClicked() } +void GuiBox::pagebreakClicked() +{ + bool pbreak = (pagebreakCB->checkState() == Qt::Checked); + innerBoxCO->setEnabled(!pbreak); + if (pbreak) { + valignCO->setEnabled(false); + ialignCO->setEnabled(false); + halignCO->setEnabled(false); + heightCB->setEnabled(false); + heightED->setEnabled(false); + heightUnitsLC->setEnabled(false); + setSpecial(false); + } else + typeChanged(typeCO->currentIndex()); + +} + void GuiBox::updateContents() { string type = params_.type; + if (type == "Framed") { + pagebreakCB->setChecked(true); + type = "Boxed"; + } else + pagebreakCB->setChecked(false); + + pagebreakCB->setEnabled(type == "Boxed"); + for (unsigned int i = 0; i < gui_names_.size(); ++i) { if (type == ids_[i]) typeCO->setCurrentIndex(i); @@ -282,10 +314,14 @@ void GuiBox::updateContents() void GuiBox::applyView() { - params_.type = ids_[typeCO->currentIndex()]; + bool pagebreak = pagebreakCB->isChecked(); + if (pagebreak) + params_.type = "Framed"; + else + params_.type = ids_[typeCO->currentIndex()]; - params_.inner_box = innerBoxCO->currentText() != qt_("None"); - params_.use_parbox = innerBoxCO->currentText() == qt_("Parbox"); + params_.inner_box = (!pagebreak && innerBoxCO->currentText() != qt_("None")); + params_.use_parbox = (!pagebreak && innerBoxCO->currentText() == qt_("Parbox")); params_.pos = "tcb"[valignCO->currentIndex()]; params_.inner_pos = "tcbs"[ialignCO->currentIndex()]; diff --git a/src/frontends/qt4/GuiBox.h b/src/frontends/qt4/GuiBox.h index 0c293da123..230d46439a 100644 --- a/src/frontends/qt4/GuiBox.h +++ b/src/frontends/qt4/GuiBox.h @@ -35,6 +35,7 @@ private Q_SLOTS: void innerBoxChanged(const QString &); void typeChanged(int); void restoreClicked(); + void pagebreakClicked(); private: /// diff --git a/src/frontends/qt4/GuiNote.cpp b/src/frontends/qt4/GuiNote.cpp index 457eb136cb..2c432f3b3b 100644 --- a/src/frontends/qt4/GuiNote.cpp +++ b/src/frontends/qt4/GuiNote.cpp @@ -37,8 +37,6 @@ GuiNote::GuiNote(GuiView & lv) connect(noteRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); connect(greyedoutRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); - connect(framedRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); - connect(shadedRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy); bc().setOK(okPB); @@ -71,12 +69,6 @@ void GuiNote::updateContents() case InsetNoteParams::Greyedout: greyedoutRB->setChecked(true); break; - case InsetNoteParams::Framed: - framedRB->setChecked(true); - break; - case InsetNoteParams::Shaded: - shadedRB->setChecked(true); - break; } } @@ -87,10 +79,6 @@ void GuiNote::applyView() params_.type = InsetNoteParams::Greyedout; else if (commentRB->isChecked()) params_.type = InsetNoteParams::Comment; - else if (framedRB->isChecked()) - params_.type = InsetNoteParams::Framed; - else if (shadedRB->isChecked()) - params_.type = InsetNoteParams::Shaded; else params_.type = InsetNoteParams::Note; } diff --git a/src/frontends/qt4/ui/BoxUi.ui b/src/frontends/qt4/ui/BoxUi.ui index ec11399650..a309ca4e79 100644 --- a/src/frontends/qt4/ui/BoxUi.ui +++ b/src/frontends/qt4/ui/BoxUi.ui @@ -6,7 +6,7 @@ 0 0 356 - 268 + 288 @@ -22,7 +22,17 @@ 6 - + + + + Check this if the box should break across pages + + + Allow &page breaks + + + + Alignment @@ -175,95 +185,7 @@ - - - - Supported box types - - - - - - - Inner box -- needed for fixed width & line breaks - - - - None - - - - - Parbox - - - - - Minipage - - - - - - - - Width value - - - - - - - false - - - Height value - - - - - - - - - - &Width: - - - widthED - - - - - - - - - - &Decoration: - - - typeCO - - - - - - - - - - - - - Inner Bo&x: - - - innerBoxCO - - - - + 0 @@ -347,6 +269,13 @@ + + + + false + + + @@ -363,11 +292,92 @@ - - + + + + + + + Inner Bo&x: + + + innerBoxCO + + + + + + + + + + + + + &Decoration: + + + typeCO + + + + + + + + + + &Width: + + + widthED + + + + + false + + Height value + + + + + + + Width value + + + + + + + Inner box -- needed for fixed width & line breaks + + + + None + + + + + Parbox + + + + + Minipage + + + + + + + + Supported box types + diff --git a/src/frontends/qt4/ui/NoteUi.ui b/src/frontends/qt4/ui/NoteUi.ui index 10f45a043d..252595b50d 100644 --- a/src/frontends/qt4/ui/NoteUi.ui +++ b/src/frontends/qt4/ui/NoteUi.ui @@ -6,7 +6,7 @@ 0 0 202 - 208 + 184 @@ -17,28 +17,28 @@ - 11 + 9 6 - - + + - &OK + Close - false + true - - + + - Close + &OK - true + false @@ -84,44 +84,21 @@ - - - - Framed in box - - - &Framed - - - - - - - Box with shaded background - - - &Shaded - - - - - - qt_helpers.h - noteRB commentRB greyedoutRB - framedRB - shadedRB okPB closePB + + qt_helpers.h + diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp index 3318c75b6d..df1bd47784 100644 --- a/src/insets/InsetBox.cpp +++ b/src/insets/InsetBox.cpp @@ -49,9 +49,11 @@ BoxTranslator const init_boxtranslator() { BoxTranslator translator("Boxed", InsetBox::Boxed); translator.addPair("Frameless", InsetBox::Frameless); + translator.addPair("Framed", InsetBox::Framed); translator.addPair("ovalbox", InsetBox::ovalbox); translator.addPair("Ovalbox", InsetBox::Ovalbox); translator.addPair("Shadowbox", InsetBox::Shadowbox); + translator.addPair("Shaded", InsetBox::Shaded); translator.addPair("Doublebox",InsetBox::Doublebox); return translator; } @@ -59,12 +61,14 @@ BoxTranslator const init_boxtranslator() BoxTranslatorLoc const init_boxtranslator_loc() { - BoxTranslatorLoc translator(_("Boxed"), InsetBox::Boxed); - translator.addPair(_("Frameless"), InsetBox::Frameless); - translator.addPair(_("ovalbox"), InsetBox::ovalbox); - translator.addPair(_("Ovalbox"), InsetBox::Ovalbox); - translator.addPair(_("Shadowbox"), InsetBox::Shadowbox); - translator.addPair(_("Doublebox"), InsetBox::Doublebox); + BoxTranslatorLoc translator(_("simple frame"), InsetBox::Boxed); + translator.addPair(_("frameless"), InsetBox::Frameless); + translator.addPair(_("simple frame, page breaks"), InsetBox::Framed); + translator.addPair(_("oval, thin"), InsetBox::ovalbox); + translator.addPair(_("oval, thick"), InsetBox::Ovalbox); + translator.addPair(_("drop shadow"), InsetBox::Shadowbox); + translator.addPair(_("shaded background"), InsetBox::Shaded); + translator.addPair(_("double frame"), InsetBox::Doublebox); return translator; } @@ -113,6 +117,16 @@ docstring const InsetBox::editMessage() const } +docstring InsetBox::name() const +{ + // FIXME: UNICODE + string name = string("Box"); + if (boxtranslator().find(params_.type) == Shaded) + name += string(":Shaded"); + return from_ascii(name); +} + + void InsetBox::write(Buffer const & buf, ostream & os) const { params_.write(os); @@ -244,8 +258,10 @@ int InsetBox::latex(Buffer const & buf, odocstream & os, stdwidth = true; switch (btype) { case Frameless: + case Framed: break; case Boxed: + case Shaded: width_string += " - 2\\fboxsep - 2\\fboxrule"; break; case ovalbox: @@ -273,6 +289,10 @@ int InsetBox::latex(Buffer const & buf, odocstream & os, switch (btype) { case Frameless: break; + case Framed: + os << "\\begin{framed}%\n"; + i += 1; + break; case Boxed: os << "\\framebox"; if (!params_.inner_box) { @@ -301,6 +321,9 @@ int InsetBox::latex(Buffer const & buf, odocstream & os, case Shadowbox: os << "\\shadowbox{"; break; + case Shaded: + // later + break; case Doublebox: os << "\\doublebox{"; break; @@ -341,9 +364,15 @@ int InsetBox::latex(Buffer const & buf, odocstream & os, os << "%\n"; i += 1; } + if (btype == Shaded) + os << "\\begin{shaded}%\n"; + i += 1; i += InsetText::latex(buf, os, runparams); + if (btype == Shaded) + os << "\\end{shaded}"; + if (params_.inner_box) { if (params_.use_parbox) os << "%\n}"; @@ -354,6 +383,9 @@ int InsetBox::latex(Buffer const & buf, odocstream & os, switch (btype) { case Frameless: break; + case Framed: + os << "\\end{framed}"; + break; case Boxed: if (!params_.inner_box) os << "}"; // for makebox @@ -365,6 +397,9 @@ int InsetBox::latex(Buffer const & buf, odocstream & os, case Shadowbox: os << "}"; break; + case Shaded: + // already done + break; } os << "%\n"; @@ -380,24 +415,56 @@ int InsetBox::plaintext(Buffer const & buf, odocstream & os, BoxType const btype = boxtranslator().find(params_.type); switch (btype) { - case Frameless: break; - case Boxed: os << "[\n"; break; - case ovalbox: os << "(\n"; break; - case Ovalbox: os << "((\n"; break; - case Shadowbox: os << "[/\n"; break; - case Doublebox: os << "[[\n"; break; + case Frameless: + break; + case Framed: + case Boxed: + os << "[\n"; + break; + case ovalbox: + os << "(\n"; + break; + case Ovalbox: + os << "((\n"; + break; + case Shadowbox: + case Shaded: + os << "[/\n"; + break; + case Doublebox: + os << "[[\n"; + break; } InsetText::plaintext(buf, os, runparams); int len = 0; switch (btype) { - case Frameless: os << "\n"; break; - case Boxed: os << "\n]"; len = 1; break; - case ovalbox: os << "\n)"; len = 1; break; - case Ovalbox: os << "\n))"; len = 2; break; - case Shadowbox: os << "\n/]"; len = 2; break; - case Doublebox: os << "\n]]"; len = 2; break; + case Frameless: + os << "\n"; + break; + case Framed: + case Boxed: + os << "\n]"; + len = 1; + break; + case ovalbox: + os << "\n)"; + len = 1; + break; + case Ovalbox: + os << "\n))"; + len = 2; + break; + case Shadowbox: + case Shaded: + os << "\n/]"; + len = 2; + break; + case Doublebox: + os << "\n]]"; + len = 2; + break; } return PLAINTEXT_NEWLINE + len; // len chars on a separate line @@ -417,6 +484,9 @@ void InsetBox::validate(LaTeXFeatures & features) const switch (btype) { case Frameless: break; + case Framed: + features.require("framed"); + break; case Boxed: features.require("calc"); break; @@ -427,6 +497,10 @@ void InsetBox::validate(LaTeXFeatures & features) const features.require("calc"); features.require("fancybox"); break; + case Shaded: + features.require("color"); + features.require("framed"); + break; } InsetText::validate(features); } diff --git a/src/insets/InsetBox.h b/src/insets/InsetBox.h index 218b209ecc..337c3bc34b 100644 --- a/src/insets/InsetBox.h +++ b/src/insets/InsetBox.h @@ -66,6 +66,8 @@ public: /// InsetCode lyxCode() const { return BOX_CODE; } /// + docstring name() const; + /// void write(Buffer const &, std::ostream &) const; /// void read(Buffer const & buf, Lexer & lex); @@ -99,9 +101,11 @@ public: enum BoxType { Frameless, Boxed, + Framed, ovalbox, Ovalbox, Shadowbox, + Shaded, Doublebox }; protected: @@ -109,8 +113,6 @@ protected: virtual void doDispatch(Cursor & cur, FuncRequest & cmd); /// Is the width forced to some value? virtual bool hasFixedWidth() const; - /// - virtual docstring name() const { return from_ascii("Box"); } private: friend class InsetBoxParams; diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp index bb2f0eeb1b..64a4898a52 100644 --- a/src/insets/InsetNote.cpp +++ b/src/insets/InsetNote.cpp @@ -57,8 +57,6 @@ NoteTranslator const init_notetranslator() NoteTranslator translator("Note", InsetNoteParams::Note); translator.addPair("Comment", InsetNoteParams::Comment); translator.addPair("Greyedout", InsetNoteParams::Greyedout); - translator.addPair("Framed", InsetNoteParams::Framed); - translator.addPair("Shaded", InsetNoteParams::Shaded); return translator; } @@ -68,8 +66,6 @@ NoteTranslatorLoc const init_notetranslator_loc() NoteTranslatorLoc translator(_("Note"), InsetNoteParams::Note); translator.addPair(_("Comment"), InsetNoteParams::Comment); translator.addPair(_("Greyed out"), InsetNoteParams::Greyedout); - translator.addPair(_("Framed"), InsetNoteParams::Framed); - translator.addPair(_("Shaded"), InsetNoteParams::Shaded); return translator; } @@ -151,13 +147,7 @@ docstring InsetNote::name() const Inset::DisplayType InsetNote::display() const { - switch (params_.type) { - case InsetNoteParams::Framed: - case InsetNoteParams::Shaded: - return AlignLeft; - default: - return Inline; - } + return Inline; } @@ -323,12 +313,6 @@ void InsetNote::validate(LaTeXFeatures & features) const features.require("color"); features.require("lyxgreyedout"); } - if (params_.type == InsetNoteParams::Shaded) { - features.require("color"); - features.require("framed"); - } - if (params_.type == InsetNoteParams::Framed) - features.require("framed"); InsetText::validate(features); } diff --git a/src/insets/InsetNote.h b/src/insets/InsetNote.h index 303b2882bc..11fe68f783 100644 --- a/src/insets/InsetNote.h +++ b/src/insets/InsetNote.h @@ -23,9 +23,7 @@ public: enum Type { Note, Comment, - Greyedout, - Framed, - Shaded + Greyedout }; /// \c type defaults to Note InsetNoteParams(); @@ -53,7 +51,7 @@ public: InsetCode lyxCode() const { return NOTE_CODE; } /// docstring name() const; - /// framed and shaded notes are displayed + /// virtual DisplayType display() const; /// void write(Buffer const &, std::ostream &) const;