From 93577c5a5b0893c198e8b032d61ef98b8c7f8831 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sun, 12 Jun 2011 18:01:53 +0000 Subject: [PATCH] Revert r39007 and r38983, since these broke the string freeze. I'll recommit for 2.0.2. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39020 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ui/stdtoolbars.inc | 10 +++++----- src/CutAndPaste.cpp | 16 ++-------------- src/Text.cpp | 7 ------- src/TextClass.cpp | 9 +++------ src/TextClass.h | 3 +-- status.20x | 4 ---- 6 files changed, 11 insertions(+), 38 deletions(-) diff --git a/lib/ui/stdtoolbars.inc b/lib/ui/stdtoolbars.inc index 3bc0f02d5d..3db71ce031 100644 --- a/lib/ui/stdtoolbars.inc +++ b/lib/ui/stdtoolbars.inc @@ -353,15 +353,15 @@ ToolbarSet Toolbar "frac-square" "Fractions" Item "Standard \\frac" "math-insert \frac" Item "Nice fraction (3/4) \\nicefrac" "math-insert \nicefrac" - Item "Unit (km) \\unitone" "math-insert \unitone" - Item "Unit (864 m) \\unittwo" "math-insert \unittwo" + Item "Unit (km) \\unit" "math-insert \unitone" + Item "Unit (864 m) \\unit" "math-insert \unittwo" Item "Unit fraction (km/h) \\unitfrac" "math-insert \unitfrac" - Item "Unit fraction (20 km/h) \\unitfracthree" "math-insert \unitfracthree" + Item "Unit fraction (20 km/h) \\unitfrac" "math-insert \unitfracthree" Item "Text fraction \\tfrac" "math-insert \tfrac" Item "Display fraction \\dfrac" "math-insert \dfrac" Item "Continued fraction \\cfrac" "math-insert \cfrac" - Item "Continued fraction (left) \\cfracleft" "math-insert \cfracleft" - Item "Continued fraction (right) \\cfracright" "math-insert \cfracright" + Item "Continued fraction (left) \\cfrac" "math-insert \cfracleft" + Item "Continued fraction (right) \\cfrac" "math-insert \cfracright" Item "Binomial \\binom" "math-insert \binom" Item "Text binomial \\tbinom" "math-insert \tbinom" Item "Display binomial \\dbinom" "math-insert \dbinom" diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 2bac66f8a6..39b732fea6 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -647,25 +647,13 @@ void switchBetweenClasses(DocumentClass const * const oldone, DocumentClass const & newtc = *newone; // layouts - ParIterator it = par_iterator_begin(in); ParIterator end = par_iterator_end(in); - // for remembering which layouts we've had to add - set newlayouts; - for (; it != end; ++it) { + for (ParIterator it = par_iterator_begin(in); it != end; ++it) { docstring const name = it->layout().name(); // the pasted text will keep their own layout name. If this layout does // not exist in the new document, it will behave like a standard layout. - bool const added_one = newtc.addLayoutIfNeeded(name); - if (added_one) - newlayouts.insert(name); - - if (added_one || newlayouts.find(name) != newlayouts.end()) { - // Warn the user. - docstring const s = bformat(_("Layout `%1$s' was not found."), name); - errorlist.push_back( - ErrorItem(_("Layout Not Found"), s, it->id(), 0, it->size())); - } + newtc.addLayoutIfNeeded(name); if (in.usePlainLayout()) it->setLayout(newtc.plainLayout()); diff --git a/src/Text.cpp b/src/Text.cpp index c79b67660d..c877e63263 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -356,13 +356,6 @@ void Text::readParToken(Paragraph & par, Lexer & lex, // of this document. For example, when you apply class article to a beamer document, // all unknown layouts such as frame will be added to document class article so that // these layouts can keep their original names. - bool const added_one = tclass.addLayoutIfNeeded(layoutname); - if (added_one) { - // Warn the user. - docstring const s = bformat(_("Layout `%1$s' was not found."), layoutname); - errorList.push_back( - ErrorItem(_("Layout Not Found"), s, par.id(), 0, par.size())); - } par.setLayout(bp.documentClass()[layoutname]); diff --git a/src/TextClass.cpp b/src/TextClass.cpp index c9cbcae5e0..00558d5862 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -1199,13 +1199,10 @@ bool TextClass::load(string const & path) const } -bool DocumentClass::addLayoutIfNeeded(docstring const & n) const +void DocumentClass::addLayoutIfNeeded(docstring const & n) const { - if (hasLayout(n)) - return false; - - layoutlist_.push_back(createBasicLayout(n, true)); - return true; + if (!hasLayout(n)) + layoutlist_.push_back(createBasicLayout(n, true)); } diff --git a/src/TextClass.h b/src/TextClass.h index 6e20650cc2..f3d2197278 100644 --- a/src/TextClass.h +++ b/src/TextClass.h @@ -373,8 +373,7 @@ public: /// a plain inset layout for use as a default static InsetLayout const & plainInsetLayout() { return plain_insetlayout_; } /// add a new layout \c name if it does not exist in layoutlist_ - /// \return whether we had to add one. - bool addLayoutIfNeeded(docstring const & name) const; + void addLayoutIfNeeded(docstring const & name) const; /////////////////////////////////////////////////////////////////// // accessors diff --git a/status.20x b/status.20x index 7e312c8d08..84cf0bd467 100644 --- a/status.20x +++ b/status.20x @@ -71,8 +71,6 @@ What's new - Fix output of decimally aligned columns in unviewed (on screen) tables. -- Inform user of unknown layouts caused by class change (bug 7571). - - Avoid LaTeX errors if font changing commands are used in the wrong mode by assuring to switch to the right mode on export. @@ -148,8 +146,6 @@ What's new - Enable OK/Apply in Document>Settings dialog when bullet size is changed. -- Display LyX's internal \unit equivalents in the math toolbar menu (bug 7620). - * ADVANCED FIND AND REPLACE -- 2.39.5