From: Richard Heck Date: Mon, 25 Jul 2016 18:55:16 +0000 (-0400) Subject: Merge branch '2.2.x' into 2.2.2-staging X-Git-Tag: 2.2.2~110 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2F2.2.2-staging;hp=c0a8259d68e56fe17b43a4d5b9838d2a9a2355e3;p=lyx.git Merge branch '2.2.x' into 2.2.2-staging --- diff --git a/lib/doc/UserGuide.lyx b/lib/doc/UserGuide.lyx index 09ad3a6a0f..ca7b29aa20 100644 --- a/lib/doc/UserGuide.lyx +++ b/lib/doc/UserGuide.lyx @@ -134,11 +134,12 @@ enumitem \papercolumns 1 \papersides 2 \paperpagestyle default -\tracking_changes false +\tracking_changes true \output_changes false \html_math_output 0 \html_css_as_file 0 \html_be_strict true +\author 1414654397 "Richard Heck" \end_header \begin_body @@ -6728,7 +6729,13 @@ reference "sec:TeX-Code" \emph on enumi \emph default - is hereby the first level counter of the enumeration. + is +\change_inserted 1414654397 1468603336 +the LaTeX name of +\change_deleted 1414654397 1468603338 +hereby +\change_unchanged +the first level counter of the enumeration. The command \series bold diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py index fe5f9d6993..7044ad8328 100644 --- a/lib/lyx2lyx/lyx_2_1.py +++ b/lib/lyx2lyx/lyx_2_1.py @@ -219,7 +219,15 @@ def convert_TeX_brace_to_Argument(document, line, n, nmax, inset, environment, o else: lineERT += 1 if environment == True: + # FIXME This version of the routine does not check for and pass over + # arguments before n. So it attempts to process the argument in the + # document, no matter what has been specified. + # + # The other branch does do that, but probably that code would be better + # in a single location: Skip all those arguments, then process the ones + # we want. end_ERT = find_end_of_inset(document.body, lineERT) + document.warning(str(end_ERT)) if end_ERT == -1: document.warning("Can't find end of ERT!!") break @@ -254,6 +262,9 @@ def convert_TeX_brace_to_Argument(document, line, n, nmax, inset, environment, o document.body[lineERT2 : end2 + 1] = ["\\end_layout", "", "\\end_inset"] document.body[lineERT : end_ERT + 1] = ["\\begin_inset Argument " + str(n), "status open", "", "\\begin_layout Plain Layout"] n += 1 + else: + document.warning("Unable to process argument!") + n += 1 ############################################################################### diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp index f2bf332a26..569f0d2e25 100644 --- a/src/BiblioInfo.cpp +++ b/src/BiblioInfo.cpp @@ -255,7 +255,8 @@ BibTeXInfo::BibTeXInfo(docstring const & key, docstring const & type) {} -docstring const BibTeXInfo::getAbbreviatedAuthor(bool jurabib_style) const +docstring const BibTeXInfo::getAbbreviatedAuthor( + Buffer const * buf, bool jurabib_style) const { if (!is_bibtex_) { docstring const opt = label(); @@ -296,33 +297,23 @@ docstring const BibTeXInfo::getAbbreviatedAuthor(bool jurabib_style) const docstring retval = familyName(authors[0]); - if (authors.size() == 2 && authors[1] != "others") - retval = bformat(from_ascii("%1$s and %2$s"), - familyName(authors[0]), familyName(authors[1])); - - if (authors.size() >= 2) - retval = bformat(from_ascii("%1$s et al."), - familyName(authors[0])); + if (authors.size() == 2 && authors[1] != "others") { + docstring const dformat = buf ? + buf->B_("%1$s and %2$s") : from_ascii("%1$s and %2$s"); + retval = bformat(dformat, familyName(authors[0]), familyName(authors[1])); + } else if (authors.size() >= 2) { + // we get here either if the author list is longer than two names + // or if the second 'name' is "others". we do the same thing either + // way. + docstring const dformat = buf ? + buf->B_("%1$s et al.") : from_ascii("%1$s et al."); + retval = bformat(dformat, familyName(authors[0])); + } return convertLaTeXCommands(retval); } -docstring const BibTeXInfo::getAbbreviatedAuthor(Buffer const & buf, bool jurabib_style) const -{ - docstring const author = getAbbreviatedAuthor(jurabib_style); - if (!is_bibtex_) - return author; - vector const authors = getVectorFromString(author, from_ascii(" and ")); - if (authors.size() == 2) - return bformat(buf.B_("%1$s and %2$s"), authors[0], authors[1]); - docstring::size_type const idx = author.rfind(from_ascii(" et al.")); - if (idx != docstring::npos) - return bformat(buf.B_("%1$s et al."), author.substr(0, idx)); - return author; -} - - docstring const BibTeXInfo::getYear() const { if (is_bibtex_) @@ -720,12 +711,12 @@ docstring BibTeXInfo::getValueForKey(string const & oldkey, Buffer const & buf, ret = cite_number_; else if (key == "abbrvauthor") // Special key to provide abbreviated author names. - ret = getAbbreviatedAuthor(buf, false); + ret = getAbbreviatedAuthor(&buf, false); else if (key == "shortauthor") // When shortauthor is not defined, jurabib automatically // provides jurabib-style abbreviated author names. We do // this as well. - ret = getAbbreviatedAuthor(buf, true); + ret = getAbbreviatedAuthor(&buf, true); else if (key == "shorttitle") { // When shorttitle is not defined, jurabib uses for `article' // and `periodical' entries the form `journal volume [year]' @@ -822,7 +813,7 @@ docstring const BiblioInfo::getAbbreviatedAuthor(docstring const & key, Buffer c if (it == end()) return docstring(); BibTeXInfo const & data = it->second; - return data.getAbbreviatedAuthor(buf, false); + return data.getAbbreviatedAuthor(&buf, false); } @@ -1093,7 +1084,7 @@ void BiblioInfo::makeCitationLabels(Buffer const & buf) if (numbers) { entry.label(entry.citeNumber()); } else { - docstring const auth = entry.getAbbreviatedAuthor(buf, false); + docstring const auth = entry.getAbbreviatedAuthor(&buf, false); // we do it this way so as to access the xref, if necessary // note that this also gives us the modifier docstring const year = getYear(*it, buf, true); diff --git a/src/BiblioInfo.h b/src/BiblioInfo.h index be7bf09b6c..43b949a6e4 100644 --- a/src/BiblioInfo.h +++ b/src/BiblioInfo.h @@ -52,10 +52,10 @@ public: /// constructor that sets the entryType BibTeXInfo(docstring const & key, docstring const & type); /// \return the short form of an authorlist, used for sorting - docstring const getAbbreviatedAuthor(bool jurabib_style = false) const; - /// \return the short form of an authorlist, translated to the - /// buffer language. - docstring const getAbbreviatedAuthor(Buffer const & buf, bool jurabib_style = false) const; + /// this will be translated to the UI language if buf is null + /// otherwise, it will be translated to the buffer language. + docstring const getAbbreviatedAuthor( + Buffer const * buf = 0, bool jurabib_style = false) const; /// docstring const getYear() const; /// diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp index 8b7c3b3ec8..7696d0991f 100644 --- a/src/LyXRC.cpp +++ b/src/LyXRC.cpp @@ -604,6 +604,8 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format) case RC_SCREEN_ZOOM: lexrc >> zoom; + if (zoom < 10) + zoom = 10; break; case RC_GEOMETRY_SESSION: diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp index 8c62926889..fdd79240b4 100644 --- a/src/RowPainter.cpp +++ b/src/RowPainter.cpp @@ -587,7 +587,13 @@ void RowPainter::paintOnlyInsets() x_ += e.full_width(); continue; } + int orig_x = x_; paintInset(e.inset, e.font, e.change, e.pos); + // The line that indicates word in a different language + paintForeignMark(orig_x, e.font.language(), e.dim.descent()); + // change tracking (not for insets that handle it themselves) + if (! e.inset->canTrackChanges()) + paintChange(orig_x, e.font, e.change); } else x_ += e.full_width(); } diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index ed819812c4..a26b88dc72 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -402,6 +402,7 @@ bool TextMetrics::redoParagraph(pit_type const pit) } // redo insets + par.setBeginOfBody(); Font const bufferfont = buffer.params().getFont(); CoordCache::Insets & insetCache = bv_->coordCache().insets(); InsetList::const_iterator ii = par.insetList().begin(); @@ -435,7 +436,6 @@ bool TextMetrics::redoParagraph(pit_type const pit) } } - par.setBeginOfBody(); pos_type first = 0; size_t row_index = 0; // maximum pixel width of a row diff --git a/src/frontends/qt4/GuiFontLoader.cpp b/src/frontends/qt4/GuiFontLoader.cpp index 9a662a893b..148677b5fb 100644 --- a/src/frontends/qt4/GuiFontLoader.cpp +++ b/src/frontends/qt4/GuiFontLoader.cpp @@ -95,11 +95,24 @@ static GuiFontInfo * fontinfo_[NUM_FAMILIES][NUM_SERIES][NUM_SHAPE][NUM_SIZE]; // if not cached, create it. GuiFontInfo & fontinfo(FontInfo const & f) { - // LASSERT: Is there anything we might do here besides crash? - LBUFERR(f.family() < NUM_FAMILIES); - LBUFERR(f.series() < NUM_SERIES); - LBUFERR(f.realShape() < NUM_SHAPE); - LBUFERR(f.size() < NUM_SIZE); + bool const fontIsRealized = + (f.family() < NUM_FAMILIES) && + (f.series() < NUM_SERIES) && + (f.realShape() < NUM_SHAPE) && + (f.size() < NUM_SIZE); + if (!fontIsRealized) { + // We can reset the font to something sensible in release mode. + LATTEST(false); + LYXERR0("Unrealized font!"); + // We could be fancier here, if we wanted, and just fix things where + // there is a problem. But it doesn't seem worth it, since we should + // not be here in the first place. + GuiFontInfo * & fi = + fontinfo_[sane_font.family()][sane_font.series()][sane_font.realShape()][sane_font.size()]; + if (!fi) + fi = new GuiFontInfo(f); + return *fi; + } // fi is a reference to the pointer type (GuiFontInfo *) in the // fontinfo_ table. GuiFontInfo * & fi = diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index bb75daa1d9..ba207f23d4 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1988,6 +1988,8 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag) case LFUN_BUFFER_ZOOM_OUT: enable = doc_buffer && lyxrc.zoom > 10; + if (lyxrc.zoom <= 10) + flag.message(_("Zoom level cannot be less than 10%.")); break; case LFUN_BUFFER_ZOOM_IN: @@ -3923,17 +3925,22 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr) break; case LFUN_BUFFER_ZOOM_IN: - case LFUN_BUFFER_ZOOM_OUT: + case LFUN_BUFFER_ZOOM_OUT: { + // use a signed temp to avoid overflow + int zoom = lyxrc.zoom; if (cmd.argument().empty()) { if (cmd.action() == LFUN_BUFFER_ZOOM_IN) - lyxrc.zoom += 20; + zoom += 20; else - lyxrc.zoom -= 20; + zoom -= 20; } else - lyxrc.zoom += convert(cmd.argument()); + zoom += convert(cmd.argument()); - if (lyxrc.zoom < 10) - lyxrc.zoom = 10; + if (zoom < 10) + zoom = 10; + lyxrc.zoom = zoom; + + dr.setMessage(bformat(_("Zoom level is now %1$d%"), lyxrc.zoom)); // The global QPixmapCache is used in GuiPainter to cache text // painting so we must reset it. @@ -3941,6 +3948,7 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr) guiApp->fontLoader().update(); lyx::dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE)); break; + } case LFUN_VC_REGISTER: case LFUN_VC_RENAME: diff --git a/status.22x b/status.22x index 0e9f06d6ee..a6d4801d73 100644 --- a/status.22x +++ b/status.22x @@ -18,15 +18,15 @@ What's new * TEX2LYX IMPROVEMENTS - * USER INTERFACE +* When changing zoom level, show current value in status bar (bug + 10212). - + * DOCUMENTATION AND LOCALIZATION - * BUILD/INSTALLATION @@ -40,12 +40,28 @@ What's new * LYX2LYX +- Fix hang with some IEEEtran documents (bug 10307). + * USER INTERFACE +- Avoid crashing in release mode if we stumble across an unrealized font. -* INTERNALS +- Fix display of citations with two authors. + +- Fix display of multi-author citations when the GUI language is not English. +- Fix bug where change tracking marks are lost under math insets (bug + 10265). + +- Fix display glitch when switching to Description layout with an inset + at the beginning of the paragraph (bug 10163) + + +* USER INTERFACE + + +* INTERNALS * DOCUMENTATION AND LOCALIZATION @@ -57,10 +73,8 @@ What's new * TEX2LYX - * ADVANCED FIND AND REPLACE * BUILD/INSTALLATION -