]> git.lyx.org Git - features.git/commitdiff
Fix argument status detection for InsetText
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 1 Dec 2012 10:49:24 +0000 (11:49 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 1 Dec 2012 10:49:24 +0000 (11:49 +0100)
src/insets/InsetText.cpp

index b48684fe97a27c8a54fcba627e0fe75f882f939c..ed2633b429dad7d29596470ea797a273a36964de 100644 (file)
@@ -341,20 +341,24 @@ bool InsetText::getStatus(Cursor & cur, FuncRequest const & cmd,
                if (&buffer().inset() == this || !cur.paragraph().layout().latexargs().empty()
                    || !cur.paragraph().layout().itemargs().empty())
                        return text_.getStatus(cur, cmd, status);
+
                Layout::LaTeXArgMap args = getLayout().latexargs();
                Layout::LaTeXArgMap::const_iterator const lait = args.find(arg);
                if (lait != args.end()) {
                        status.setEnabled(true);
-                       InsetList::const_iterator it = cur.paragraph().insetList().begin();
-                       InsetList::const_iterator end = cur.paragraph().insetList().end();
-                       for (; it != end; ++it) {
-                               if (it->inset->lyxCode() == ARG_CODE) {
-                                       InsetArgument const * ins =
-                                               static_cast<InsetArgument const *>(it->inset);
-                                       if (ins->name() == arg) {
-                                               // we have this already
-                                               status.setEnabled(false);
-                                               return true;
+                       ParagraphList::const_iterator pit = paragraphs().begin();
+                       for (; pit != paragraphs().end(); ++pit) {
+                               InsetList::const_iterator it = pit->insetList().begin();
+                               InsetList::const_iterator end = pit->insetList().end();
+                               for (; it != end; ++it) {
+                                       if (it->inset->lyxCode() == ARG_CODE) {
+                                               InsetArgument const * ins =
+                                                       static_cast<InsetArgument const *>(it->inset);
+                                               if (ins->name() == arg) {
+                                                       // we have this already
+                                                       status.setEnabled(false);
+                                                       return true;
+                                               }
                                        }
                                }
                        }