]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
scons/SConstruct: remove non-existent path to make "update_po" work
[lyx.git] / src / Paragraph.cpp
index ee39e6a5181ef7b20c2b1e6338649694b6866039..bd368ef6c50ea3cf6a38f95ed764718425a423b5 100644 (file)
@@ -48,6 +48,7 @@
 #include "frontends/FontMetrics.h"
 
 #include "insets/InsetBibitem.h"
+#include "insets/InsetLabel.h"
 #include "insets/InsetOptArg.h"
 
 #include "support/lstrings.h"
@@ -1957,8 +1958,9 @@ bool Paragraph::latex(Buffer const & buf,
                        open_font = false;
                }
 
-               // Switch file encoding if necessary
-               if (runparams.encoding->package() == Encoding::inputenc &&
+               // Switch file encoding if necessary (and allowed)
+               if (!runparams.verbatim && 
+                   runparams.encoding->package() == Encoding::inputenc &&
                    font.language()->encoding()->package() == Encoding::inputenc) {
                        std::pair<bool, int> const enc_switch = switchEncoding(os, bparams,
                                        runparams.moving_arg, *(runparams.encoding),
@@ -2148,8 +2150,9 @@ string Paragraph::getID(Buffer const & buf, OutputParams const & runparams) cons
                        Inset const * inset = getInset(i);
                        InsetCode lyx_code = inset->lyxCode();
                        if (lyx_code == LABEL_CODE) {
-                               string const id = static_cast<InsetCommand const *>(inset)->getContents();
-                               return "id='" + to_utf8(sgml::cleanID(buf, runparams, from_utf8(id))) + "'";
+                               InsetLabel const * const il = static_cast<InsetLabel const *>(inset);
+                               docstring const & id = il->getParam("name");
+                               return "id='" + to_utf8(sgml::cleanID(buf, runparams, id)) + "'";
                        }
                }