]> git.lyx.org Git - features.git/commitdiff
Remove unused variables found by cppcheck
authorGeorg Baum <baum@lyx.org>
Sun, 20 Sep 2015 19:39:59 +0000 (21:39 +0200)
committerGeorg Baum <baum@lyx.org>
Sun, 20 Sep 2015 19:39:59 +0000 (21:39 +0200)
There are still a few warnings of the kind
(style) Variable 'x' is assigned a value that is never used.
since I did not touch code where I was not sure whether there might be a real
bug, and I kept some for symmetry reasons as well.

src/frontends/qt4/GuiInclude.cpp
src/insets/InsetGraphics.cpp
src/insets/InsetQuotes.cpp
src/output_latex.cpp
src/tex2lyx/text.cpp

index fe8cc3ba5bb086e2cb9bdcbb534d1a0c6935815c..e1fc2754346e5b32edef5b145ecf3e98607fe8b8 100644 (file)
@@ -296,7 +296,6 @@ void GuiInclude::edit()
 {
        if (!isValid())
                return;
-       string const file = fromqstr(filenameED->text());
        if (bc().policy().buttonStatus(ButtonPolicy::OKAY)) {
                slotOK();
                applyView();
index bc82db732b5421f3296a9069aea050fde5f857fd..83cd84ddf06f6a6fc81056463e0ba1d2933fd542 100644 (file)
@@ -503,7 +503,7 @@ copyToDirIfNeeded(DocFileName const & file, string const & dir)
 {
        string const file_in = file.absFileName();
        string const only_path = onlyPath(file_in);
-       if (rtrim(onlyPath(file_in) , "/") == rtrim(dir, "/"))
+       if (rtrim(only_path, "/") == rtrim(dir, "/"))
                return make_pair(IDENTICAL_PATHS, FileName(file_in));
 
        string mangled = file.mangledFileName();
index 9682d661d7ba3bc5f9fcf816c0780026898a9370..01776a30fd0aa9cf415454c8553737673e8ce896 100644 (file)
@@ -339,13 +339,12 @@ void InsetQuotes::forOutliner(docstring & os, size_t) const
 
 void InsetQuotes::validate(LaTeXFeatures & features) const
 {
-       bool const use_babel = features.useBabel();
        char type = quote_char[quote_index[side_][language_]];
 
 #ifdef DO_USE_DEFAULT_LANGUAGE
        if (features.bufferParams().language->lang() == "default"
 #else
-       if (!use_babel
+       if (!features.useBabel()
 #endif
            && lyxrc.fontenc != "T1") {
                if (times_ == SingleQuotes)
index 80cb9904425419affc7cb4a41dac52a4bd15e156..c14e8eea418798e1984a4662a3aa26f25dab4f2b 100644 (file)
@@ -671,8 +671,6 @@ void TeXOnePar(Buffer const & buf,
                getPolyglossiaEnvName(par_language): par_language->babel();
        string const prev_lang = use_polyglossia ?
                getPolyglossiaEnvName(prev_language) : prev_language->babel();
-       string const doc_lang = use_polyglossia ?
-               getPolyglossiaEnvName(doc_language) : doc_language->babel();
        string const outer_lang = use_polyglossia ?
                getPolyglossiaEnvName(outer_language) : outer_language->babel();
        string lang_begin_command = use_polyglossia ?
index 961d51d322e2b1875953f6d11bd8cee819895da3..d16c52ed2af6b580bc332aa398ce222a54fcee06 100644 (file)
@@ -2095,7 +2095,6 @@ void copy_file(FileName const & src, string dstname)
                dst = FileName(dstname);
        else
                dst = makeAbsPath(dstname, absParent);
-       string const absMaster = getMasterFilePath(false);
        FileName const srcpath = src.onlyPath();
        FileName const dstpath = dst.onlyPath();
        if (equivalent(srcpath, dstpath))