Remove unused variables found by cppcheck

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.
This commit is contained in:
Georg Baum 2015-09-20 21:39:59 +02:00
parent aab1b145a5
commit b24664b0ac
5 changed files with 2 additions and 7 deletions

View 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();

View 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();

View 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)

View 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 ?

View 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))