From: Richard Heck Date: Tue, 14 Dec 2010 23:50:50 +0000 (+0000) Subject: Use the layout defined label for the TOC, too. X-Git-Tag: 2.0.0~1370 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=de1655f92b2c56868f30d66036c05f7ddd4e0f19;p=features.git Use the layout defined label for the TOC, too. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36888 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp index 24a8b82cba..47fe721ced 100644 --- a/src/insets/InsetNote.cpp +++ b/src/insets/InsetNote.cpp @@ -61,15 +61,6 @@ NoteTranslator const init_notetranslator() } -NoteTranslatorLoc const init_notetranslator_loc() -{ - NoteTranslatorLoc translator(_("Note[[InsetNote]]"), InsetNoteParams::Note); - translator.addPair(_("Comment"), InsetNoteParams::Comment); - translator.addPair(_("Greyed out"), InsetNoteParams::Greyedout); - return translator; -} - - NoteTranslator const & notetranslator() { static NoteTranslator translator = init_notetranslator(); @@ -77,17 +68,9 @@ NoteTranslator const & notetranslator() } -NoteTranslatorLoc const & notetranslator_loc() -{ - static NoteTranslatorLoc translator = init_notetranslator_loc(); - return translator; -} - } // anon - - InsetNoteParams::InsetNoteParams() : type(Note) {} @@ -218,9 +201,9 @@ void InsetNote::addToToc(DocIterator const & cpit) pit.push_back(CursorSlice(*this)); Toc & toc = buffer().tocBackend().toc("note"); - docstring str; - str = notetranslator_loc().find(params_.type) + from_ascii(": ") - + text().getPar(0).asString(); + InsetLayout const & il = getLayout(); + docstring const label = translateIfPossible(il.labelstring()); + docstring const str = label + from_ascii(": ") + text().getPar(0).asString(); toc.push_back(TocItem(pit, 0, str, toolTipText())); // Proceed with the rest of the inset. InsetCollapsable::addToToc(cpit);