]> git.lyx.org Git - lyx.git/commitdiff
Fix "dead store" warnings of Xcode analyze tool
authorStephan Witt <switt@lyx.org>
Fri, 9 Oct 2015 06:08:49 +0000 (08:08 +0200)
committerStephan Witt <switt@lyx.org>
Fri, 9 Oct 2015 06:16:23 +0000 (08:16 +0200)
src/AspellChecker.cpp
src/TextClass.cpp
src/frontends/qt4/GuiCitation.cpp
src/frontends/qt4/GuiPrefs.cpp
src/insets/InsetCollapsable.cpp
src/insets/InsetExternal.cpp
src/insets/InsetTabular.cpp
src/lyxfind.cpp

index 06da1f81495af0d276704b2c4f15247c1a45b179..c4b24199940fa2146418638e50024b11abf0694e 100644 (file)
@@ -219,7 +219,7 @@ AspellConfig * AspellChecker::Private::getConfig(string const & lang, string con
        }
        if (!have_dict) {
                // check for package data of OS installation
-               have_dict = checkAspellData(config, osPackageBase(), osPackageDataDirectory(), osPackageDictDirectory(), lang, variety);
+               checkAspellData(config, osPackageBase(), osPackageDataDirectory(), osPackageDictDirectory(), lang, variety);
        }
        return config ;
 }
index 60fab48e6ca54abe2b73d1df844b6241b7a05fbe..17fc266ebdf0dc5fb2b1730a4d2ccaba93a7a845 100644 (file)
@@ -413,8 +413,8 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
                }
 
                // used below to track whether we are in an IfStyle or IfCounter tag.
-               bool ifstyle    = false;
-               bool ifcounter  = false;
+               bool ifstyle   = false;
+               bool ifcounter = false;
 
                switch (static_cast<TextClassTags>(le)) {
 
@@ -508,9 +508,6 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
                                Layout lay;
                                readStyle(lexrc, lay);
                        }
-
-                       // reset flag
-                       ifstyle = false;
                        break;
                }
 
@@ -764,8 +761,6 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
                                lexrc.printError("No name given for style: `$$Token'.");
                                error = true;
                        }
-                       // reset flag
-                       ifcounter = false;
                        break;
 
                case TC_TITLELATEXTYPE:
index 483c8fb5b128e86ffee2ab1597476714fa82dffe..052d700b2b0a7f8c6f3b100206c3603d4bf78cee 100644 (file)
@@ -260,9 +260,6 @@ void GuiCitation::updateStyles(BiblioInfo const & bi)
                return;
        }
 
-       if (!selectedLV->selectionModel()->selectedIndexes().empty())
-               curr = selectedLV->selectionModel()->selectedIndexes()[0].row();
-
        static const size_t max_length = 80;
        QStringList sty = citationStyles(bi, max_length);
 
index 72e5328a6d0d53803bf6406169b75d6f73327f3d..f7c00f45bfb11d7a5a4a62c6e9977b906a46d931 100644 (file)
@@ -2863,7 +2863,6 @@ QTreeWidgetItem * PrefShortcuts::insertShortcutItem(FuncRequest const & lfun,
        QString const lfun_name = toqstr(from_utf8(action_name)
                        + ' ' + lfun.argument());
        QString const shortcut = toqstr(seq.print(KeySequence::ForGui));
-       KeyMap::ItemType item_tag = tag;
 
        QTreeWidgetItem * newItem = 0;
        // for unbind items, try to find an existing item in the system bind list
@@ -2880,7 +2879,6 @@ QTreeWidgetItem * PrefShortcuts::insertShortcutItem(FuncRequest const & lfun,
                // Such an item is not displayed to avoid confusion (what is
                // unmatched removed?).
                if (!newItem) {
-                       item_tag = KeyMap::UserExtraUnbind;
                        return 0;
                }
        }
@@ -2913,7 +2911,7 @@ QTreeWidgetItem * PrefShortcuts::insertShortcutItem(FuncRequest const & lfun,
        newItem->setText(1, shortcut);
        // record BindFile representation to recover KeySequence when needed.
        newItem->setData(1, Qt::UserRole, toqstr(seq.print(KeySequence::BindFile)));
-       setItemType(newItem, item_tag);
+       setItemType(newItem, tag);
        return newItem;
 }
 
index 337845a607fc7739624df9209705a588e3140720..aeac8b358681eebc60f7e8a6043d613c903ae707 100644 (file)
@@ -348,7 +348,6 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
                        int const ww = max(textdim.wid, w);
                        pi.pain.rectText(x + (ww - w) / 2, y + desc + a,
                                buttonLabel(bv), font, Color_none, Color_none);
-                       desc += d;
                }
 
                // a visual cue when the cursor is inside the inset
index daa5831107cf3b23b403049c4bca88f6bb502fcb..a62100e9b00fb19caaa49492718eb4f13923ff3f 100644 (file)
@@ -616,10 +616,8 @@ void InsetExternal::setParams(InsetExternalParams const & p)
                LASSERT(false, return);
                break;
        case PREVIEW_INSTANT: {
-               //FIXME: why is the value below immediately forgotten?
-               RenderMonitoredPreview * preview_ptr = renderer_->asMonitoredPreview();
                renderer_.reset(new RenderMonitoredPreview(this));
-               preview_ptr = renderer_->asMonitoredPreview();
+               RenderMonitoredPreview * preview_ptr = preview_ptr = renderer_->asMonitoredPreview();
                preview_ptr->fileChanged(bind(&InsetExternal::fileChanged, this));
                if (preview_ptr->monitoring())
                        preview_ptr->stopMonitoring();
index 6a138cc18d6e5c7ebcf480a1bfe85e9907ba9c85..d92acf2e0ffe21769a633965402934b3b0f79321 100644 (file)
@@ -6231,7 +6231,6 @@ bool InsetTabular::insertPlaintextString(BufferView & bv, docstring const & buf,
        if (usePaste) {
                paste_tabular.reset(new Tabular(buffer_, rows, maxCols));
                loctab = paste_tabular.get();
-               cols = 0;
                dirtyTabularStack(true);
        } else {
                loctab = &tabular;
index aedbc53bff0dd5d0bf52859e164b472b4752a40e..0a788c7ba85e6cf204cd8d71bda095db5f45b6da 100644 (file)
@@ -592,7 +592,6 @@ string escape_for_regex(string s, bool match_latex)
                }
                if (end_pos == s.size()) {
                        s.replace(new_pos, end_pos - new_pos, t);
-                       pos = s.size();
                        LYXERR(Debug::FIND, "Regexp after \\regexp{} removal: " << s);
                        break;
                }
@@ -1224,12 +1223,10 @@ int findBackwardsAdv(DocIterator & cur, MatchStringAdv & match)
                return 0;
        cur.backwardPos();
        DocIterator cur_orig(cur);
-       bool found_match;
        bool pit_changed = false;
-       found_match = false;
        do {
                cur.pos() = 0;
-               found_match = match(cur, -1, false);
+               bool found_match = match(cur, -1, false);
 
                if (found_match) {
                        if (pit_changed)