]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Fix functions that used functions but did not defined it
[lyx.git] / src / Buffer.cpp
index de7f4d217c98b947f09a0796de4f3607ca23f525..0f7560c8e472a2608000971fe3e8b96e1101b852 100644 (file)
@@ -41,7 +41,6 @@
 #include "LaTeXFeatures.h"
 #include "LaTeX.h"
 #include "Layout.h"
-#include "Lexer.h"
 #include "LyXAction.h"
 #include "LyX.h"
 #include "LyXRC.h"
@@ -95,6 +94,7 @@
 #include "support/filetools.h"
 #include "support/gettext.h"
 #include "support/gzstream.h"
+#include "support/Lexer.h"
 #include "support/lstrings.h"
 #include "support/mutex.h"
 #include "support/os.h"
@@ -1882,7 +1882,8 @@ Buffer::ExportStatus Buffer::writeLaTeXSource(otexstream & os,
        // This is only set once per document (in master)
        if (!runparams.is_child) {
                runparams.use_polyglossia = features.usePolyglossia();
-               runparams.use_hyperref = features.isRequired("hyperref");
+               runparams.use_hyperref = features.isRequired("hyperref")
+                               || features.isProvided("hyperref");
                runparams.use_CJK = features.mustProvide("CJK");
        }
        LYXERR(Debug::OUTFILE, "  Buffer validation done.");
@@ -4208,7 +4209,8 @@ unique_ptr<TexRow> Buffer::getSourceCode(odocstream & os, string const & format,
                        validate(features);
                        runparams.use_polyglossia = features.usePolyglossia();
                        runparams.use_babel = features.useBabel();
-                       runparams.use_hyperref = features.isRequired("hyperref");
+                       runparams.use_hyperref = features.isRequired("hyperref")
+                               || features.isProvided("hyperref");
                        // latex or literate
                        otexstream ots(os);
                        // output above
@@ -5238,8 +5240,7 @@ void Buffer::Impl::setLabel(ParIterator & it, UpdateType utype) const
        par.itemdepth = getItemDepth(it);
 
        if (layout.margintype == MARGIN_MANUAL) {
-               if (par.params().labelWidthString().empty())
-                       par.params().labelWidthString(par.expandLabel(layout, bp));
+               // nothing to do: empty label width string is fine.
        } else if (layout.latextype == LATEX_BIB_ENVIRONMENT) {
                // we do not need to do anything here, since the empty case is
                // handled during export.
@@ -5562,6 +5563,9 @@ Buffer::ReadStatus Buffer::reload()
        Buffer const * oldparent = d->parent();
        d->setParent(nullptr);
        ReadStatus const status = loadLyXFile();
+       // The inset members in cursors held by buffer views are now wrong.
+       workAreaManager().sanitizeCursors();
+       setBusy(false);
        if (status == ReadSuccess) {
                updateBuffer();
                changed(true);
@@ -5578,7 +5582,6 @@ Buffer::ReadStatus Buffer::reload()
        } else {
                message(bformat(_("Could not reload document %1$s."), disp_fn));
        }
-       setBusy(false);
        removePreviews();
        updatePreviews();
        errors("Parse");