]> git.lyx.org Git - lyx.git/commitdiff
Merge branch '2.2.x' into 2.2.2-staging 2.2.2-staging
authorRichard Heck <rgheck@lyx.org>
Mon, 25 Jul 2016 18:55:16 +0000 (14:55 -0400)
committerRichard Heck <rgheck@lyx.org>
Mon, 25 Jul 2016 18:55:16 +0000 (14:55 -0400)
lib/doc/UserGuide.lyx
lib/lyx2lyx/lyx_2_1.py
src/BiblioInfo.cpp
src/BiblioInfo.h
src/LyXRC.cpp
src/RowPainter.cpp
src/TextMetrics.cpp
src/frontends/qt4/GuiFontLoader.cpp
src/frontends/qt4/GuiView.cpp
status.22x

index 09ad3a6a0ffd91601f6df168c0cf099ba791a3b4..ca7b29aa2064e2a5e99bc3c88238282af75580c8 100644 (file)
@@ -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
 
index fe5f9d69932ca2ab47e632609873f1e72391825b..7044ad8328d319c9653e07292712a67f74f538d6 100644 (file)
@@ -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
 
 
 ###############################################################################
index f2bf332a2655204b8dbdce3b630bbc4c5fbd0c20..569f0d2e25fe9983462561947aa244c399c641e1 100644 (file)
@@ -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<docstring> 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);
index be7bf09b6c311a5289bc1ee505db19a6ee1ac886..43b949a6e45dc3e3b8939b2e44908e0285a16502 100644 (file)
@@ -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;
        ///
index 8b7c3b3ec89756bdeda71245322239e9ec4cb39d..7696d0991fb2502d888c0183ee49d63c84605734 100644 (file)
@@ -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:
index 8c62926889000c68a6262d724a9c30e8752920f2..fdd79240b4703471e65794eeef259cc436015d31 100644 (file)
@@ -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();
        }
index ed819812c41fdab8f48e845801be7e8adf78a61c..a26b88dc726b0d6a32f9cb5f90fdec712e4783b5 100644 (file)
@@ -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
index 9a662a893b3ce846386588370befeeaeae755f15..148677b5fb4f10848c558584033ae01423b44b38 100644 (file)
@@ -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 =
index bb75daa1d93946d2e2bf5ede509321ae5b398a55..ba207f23d483247d8a848fb57435120b748ec2f3 100644 (file)
@@ -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<int>(cmd.argument());
+                               zoom += convert<int>(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:
index 0e9f06d6eebbcbaf44a7816dfd9dacd9531275ed..a6d4801d7348e39cedde7e41c58081d92a6f6bb8 100644 (file)
@@ -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
-