]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBranch.cpp
Do not output deleted rows columns if show changes in output is false
[lyx.git] / src / insets / InsetBranch.cpp
index 7947b8ec392f6ca8706c8b3c7f959ec6181d6d3b..6afa0c72ea6f575491359a7949e5de09dc0e5d8c 100644 (file)
@@ -190,6 +190,21 @@ void InsetBranch::doDispatch(Cursor & cur, FuncRequest & cmd)
                        // cur.forceBufferUpdate() is not enough
                        buf->updateBuffer();
                }
+
+               // if branch exists in a descendant, update previews.
+               // TODO: only needed if "Show preview" is enabled in the included inset.
+               bool exists_in_desc = false;
+               for (auto const & it : buf->getDescendants()) {
+                       if (it->params().branchlist().find(params_.branch))
+                               exists_in_desc = true;
+               }
+               if (exists_in_desc) {
+                       // TODO: ideally we would only update the previews of the
+                       // specific children that have this branch directly or
+                       // in one of their descendants
+                       buf->removePreviews();
+                       buf->updatePreviews();
+               }
                break;
        }
        case LFUN_BRANCH_INVERT:
@@ -294,7 +309,7 @@ void InsetBranch::latex(otexstream & os, OutputParams const & runparams) const
 {
        if (producesOutput()) {
                OutputParams rp = runparams;
-               rp.inbranch = rp.use_babel || rp.use_polyglossia;
+               rp.inbranch = true;
                InsetText::latex(os, rp);
        }
 }